Defines an occurrence of assembly or part in a scene graph. More...
#include <cadex/ModelData/Instance.hxx>
Public Member Functions | |
Instance (Initialized) | |
Instance (const UTF16String &theName) | |
Constructor. | |
Instance (const ModelElement &theElement, const UTF16String &theName=UTF16String()) | |
Constructor. | |
Instance (const ModelElement &theElement, const Geom::Transformation &theTransformation, const UTF16String &theName=UTF16String()) | |
Constructor. | |
void | SetReference (const ModelElement &theElement) |
Sets a referenced object. | |
ModelElement | Reference () const |
Returns the referenced object. | |
void | SetTransformation (const Geom::Transformation &theTrsf) |
Sets transformation matrix. | |
bool | HasTransformation () const |
Returns true if the instance has an explicitly attached transformation matrix. | |
const Geom::Transformation & | Transformation () const |
Returns the transformation matrix. | |
![]() | |
void | SetName (const UTF16String &theName) |
Sets a name. | |
UTF16String | Name () const |
Returns a name. | |
void | SetUuid (const Uuid &theUuid) |
Sets an object uuid. | |
cadex::Uuid | Uuid () const |
Returns an object uuid. | |
void | Accept (ModelElementVisitor &theVisitor) const |
Accepts an element visitor. | |
![]() | |
size_t | Id () const |
Return unique identifier of public object. | |
internal::BaseObjectImpl * | Impl () const |
bool | IsNull () const |
operator bool () const | |
template<typename T > | |
bool | IsOfType () const |
template<typename T > | |
T * | Impl () const |
Reserved for internal use. | |
Static Public Member Functions | |
static bool | CompareType (const BaseObject &theObject) |
Returns true if theObject is an instance. | |
![]() | |
static bool | CompareType (const BaseObject &theObject) |
Returns true if theObject is a model element. | |
Additional Inherited Members | |
![]() | |
typedef std::shared_ptr< internal::BaseObjectImpl > | ImplType |
![]() | |
ModelElement (const ImplType &theImpl) | |
![]() | |
BaseObject (const ImplType &theImpl) | |
Defines an occurrence of assembly or part in a scene graph.
Instance contains a reference to another element part or assembly and is used to share data, e.g. two instances can share the same part adding own transformations. Instance points to a specific scene graph element configuration and may return base configuration of reference scene graph element.
|
explicit |
Constructor.
Creates an instance with the specified name.
|
explicit |
Constructor.
Creates an instance referencing /a theElement with the provided name. If /a theElement is null (IsNull()), no reference is set.
cadex::ModelData::Instance::Instance | ( | const ModelElement & | theElement, |
const Geom::Transformation & | theTransformation, | ||
const UTF16String & | theName = UTF16String() ) |
Constructor.
Creates an instance referencing /a theElement with the provided name and transformation. If /a theElement is null (IsNull()), no reference is set.
bool cadex::ModelData::Instance::HasTransformation | ( | ) | const |
Returns true if the instance has an explicitly attached transformation matrix.
Returns true if the matrix has been assigned with SetTransformation() and false otherwise.
ModelElement cadex::ModelData::Instance::Reference | ( | ) | const |
Returns the referenced object.
Returns null if the instance does not refer to any object.
const Geom::Transformation & cadex::ModelData::Instance::Transformation | ( | ) | const |
Returns the transformation matrix.
If the matrix has not been explicitly assigned with SetTransformation() then creates and explicitly assigns an identity matrix.