Hide menu
Loading...
Searching...
No Matches
cadex::ModelData::Instance Class Reference

Defines an occurrence of assembly or part in a scene graph. More...

#include <cadex/ModelData/Instance.hxx>

Inheritance diagram for cadex::ModelData::Instance:
cadex::ModelData::ModelElement cadex::BaseObject

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::TransformationTransformation () const
 Returns the transformation matrix.
 
- Public Member Functions inherited from cadex::ModelData::ModelElement
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.
 
- Public Member Functions inherited from cadex::BaseObject
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 Public Member Functions inherited from cadex::ModelData::ModelElement
static bool CompareType (const BaseObject &theObject)
 Returns true if theObject is a model element.
 

Additional Inherited Members

- Public Types inherited from cadex::BaseObject
typedef std::shared_ptr< internal::BaseObjectImpl > ImplType
 
- Protected Member Functions inherited from cadex::ModelData::ModelElement
 ModelElement (const ImplType &theImpl)
 
- Protected Member Functions inherited from cadex::BaseObject
 BaseObject (const ImplType &theImpl)
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ Instance() [1/3]

cadex::ModelData::Instance::Instance ( const UTF16String & theName)
explicit

Constructor.

Creates an instance with the specified name.

◆ Instance() [2/3]

cadex::ModelData::Instance::Instance ( const ModelElement & theElement,
const UTF16String & theName = UTF16String() )
explicit

Constructor.

Creates an instance referencing /a theElement with the provided name. If /a theElement is null (IsNull()), no reference is set.

◆ Instance() [3/3]

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.

Member Function Documentation

◆ HasTransformation()

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.

See also
SetTransformation(), Transformation().

◆ Reference()

ModelElement cadex::ModelData::Instance::Reference ( ) const

Returns the referenced object.

Returns null if the instance does not refer to any object.

See also
SetReference().

◆ Transformation()

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.

See also
HasTransformation(), SetTransformation().