Hide menu
Loading...
Searching...
No Matches

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_SceneGraphElement cadex::ModelData_BaseObject

Public Types

typedef cadex::internal::ModelData_InstanceImpl ImplType
 
- Public Types inherited from cadex::ModelData_SceneGraphElement
typedef cadex::internal::ModelData_SceneGraphElementImpl ImplType
 
- Public Types inherited from cadex::ModelData_BaseObject
typedef int IdType
 Defines a type identifier.
 

Public Member Functions

 ModelData_Instance ()
 
 ModelData_Instance (initialized)
 
 ModelData_Instance (ImplType *theImpl)
 
 ModelData_Instance (const Base_UTF16String &theName)
 
 ModelData_Instance (const ModelData_SceneGraphElement &theElement, const Base_UTF16String &theName=Base_UTF16String())
 
 ModelData_Instance (const ModelData_SceneGraphElement &theElement, const ModelData_Transformation &theTrsf, const Base_UTF16String &theName=Base_UTF16String())
 
void SetReference (const ModelData_SceneGraphElement &theElement)
 Sets a referenced object.
 
ModelData_SceneGraphElement Reference () const
 Returns the referenced object.
 
void SetTransformation (const ModelData_Transformation &theTrsf)
 Sets transformation matrix.
 
bool HasTransformation () const
 Returns true if the instance has an explicitly attached transformation matrix.
 
const ModelData_TransformationTransformation () const
 Returns the transformation matrix.
 
ModelData_SceneGraphElement ReferenceBaseConfiguration () const
 Returns the base configuration of the referenced object.
 
void SetReferenceConfigurationName (const Base_UTF16String &theName)
 Sets a configuration name of referenced object.
 
Base_UTF16String ReferenceConfigurationName () const
 Returns the referenced object configuration name.
 
- Public Member Functions inherited from cadex::ModelData_SceneGraphElement
 ModelData_SceneGraphElement ()
 Constructor.
 
void SetAppearance (const ModelData_Appearance &theAppearance)
 Sets appearance of the scene graph element.
 
ModelData_Appearance Appearance () const
 Returns the scene graph element's own appearance.
 
void AddProperties (const ModelData_PropertyTable &theProperties)
 Adds a property table to the element.
 
ModelData_PropertyTable Properties () const
 Returns a property table.
 
void AddPMI (const ModelData_PMITable &thePMI)
 Adds a PMI table to the element.
 
ModelData_PMITable PMI () const
 Returns a PMI table.
 
void AddConfigurations (const ModelData_ConfigurationManager &theConfigurations)
 Adds a configuration manager to the element.
 
ModelData_ConfigurationManager Configurations () const
 Returns a configuration manager.
 
void AddToLayer (const ModelData_Layer &theLayer)
 Adds element to layer.
 
void Accept (ModelData_Model::ElementVisitor &theVisitor) const
 Accepts an element visitor.
 
- Public Member Functions inherited from cadex::ModelData_BaseObject
 ModelData_BaseObject ()
 Constructor.
 
IdType TypeId () const
 Returns an object type id.
 
template<typename T >
bool IsOfType () const
 Returns true if the object has a type T.
 
void SetName (const Base_UTF16String &theName)
 Sets an object name.
 
Base_UTF16String Name () const
 
void SetUuid (const Base_Uuid &theUuid)
 
Base_Uuid Uuid () const
 
void Nullify ()
 Resets reference to implementation object.
 
bool IsNull () const
 Returns true if the object is nullified.
 
 operator bool () const
 Casts the object to the bool type.
 
internal::ModelData_BaseObjectImpl * Impl () const
 Return a handle to backend (reserved for internal use).
 

Static Public Member Functions

static IdType GetTypeId ()
 

Additional Inherited Members

- Protected Member Functions inherited from cadex::ModelData_SceneGraphElement
 ModelData_SceneGraphElement (const internal::ModelData_BaseObjectImpl *theImpl)
 Constructor (reserved for internal use).
 
 ModelData_SceneGraphElement (const internal::ModelData_BaseObjectImpl *theImpl, const Base_UTF16String &theName)
 Constructor (reserved for internal use).
 
- Protected Member Functions inherited from cadex::ModelData_BaseObject
 ModelData_BaseObject (const internal::ModelData_BaseObjectImpl *theImpl)
 Constructor (reserved for internal use).
 
 ModelData_BaseObject (const internal::ModelData_BaseObjectImpl *theImpl, const Base_UTF16String &theName)
 Constructor (reserved for internal use).
 
template<typename T >
T * GetOrCreateImpl ()
 Reserved for internal use.
 

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.

Examples
exploring/bom/Program.cs, exploring/bom/main.cxx, exploring/layers/Program.cs, exploring/layers/main.cxx, exploring/pmi/Program.cs, exploring/pmi/main.cxx, exploring/transformations/Program.cs, exploring/transformations/main.cxx, meshing/remeshing/Program.cs, meshing/remeshing/main.cxx, modeling/assembly/Program.cs, modeling/assembly/main.cxx, modeling/elementremoval/Program.cs, modeling/elementremoval/main.cxx, modification/coloring/Program.cs, modification/coloring/main.cxx, modification/renaming/Program.cs, modification/renaming/main.cxx, modification/rotation/Program.cs, and modification/rotation/main.cxx.

Constructor & Destructor Documentation

◆ ModelData_Instance()

cadex::ModelData_Instance::ModelData_Instance ( )

If theToInitialize is false then creates a null object (see IsNull()).

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().
Examples
exploring/transformations/Program.cs, and exploring/transformations/main.cxx.

◆ Reference()

ModelData_SceneGraphElement cadex::ModelData_Instance::Reference ( ) const

Returns the referenced object.

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

See also
SetReference().
Examples
modeling/elementremoval/main.cxx.

◆ ReferenceBaseConfiguration()

ModelData_SceneGraphElement cadex::ModelData_Instance::ReferenceBaseConfiguration ( ) const

Returns the base configuration of the referenced object.

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

See also
SetReferenceBaseConfiguration().

◆ ReferenceConfigurationName()

Base_UTF16String cadex::ModelData_Instance::ReferenceConfigurationName ( ) const

Returns the referenced object configuration name.

Returns empty string if the referenced object has no configuration name (by default).

See also
SetReferenceConfigurationName().

◆ SetReference()

void cadex::ModelData_Instance::SetReference ( const ModelData_SceneGraphElement theElement)

Sets a referenced object.

Warning
There must be no cyclic references between theElement and this instance as otherwise there will be memory leaks and infinite loop when visiting the scene graph.

◆ Transformation()

const ModelData_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().
Examples
exploring/transformations/Program.cs, exploring/transformations/main.cxx, modification/rotation/Program.cs, and modification/rotation/main.cxx.