Defines a group of scene graph element. More...
#include <cadex/ModelData_Assembly.hxx>
Public Types | |
typedef cadex::internal::ModelData_AssemblyImpl | ImplType |
![]() | |
typedef cadex::internal::ModelData_SceneGraphElementImpl | ImplType |
![]() | |
typedef int | IdType |
Defines a type identifier. | |
Public Member Functions | |
ModelData_Assembly () | |
ModelData_Assembly (initialized) | |
ModelData_Assembly (ImplType *theImpl) | |
Constructor (reserved for internal use). | |
ModelData_Assembly (const Base_UTF16String &theName) | |
const ModelData_Instance & | AddInstance (const ModelData_SceneGraphElement &theElement, const Base_UTF16String &theInstanceName=Base_UTF16String()) |
Adds a new child element into the assembly. | |
const ModelData_Instance & | AddInstance (const ModelData_SceneGraphElement &theElement, const ModelData_Transformation &theTransformation, const Base_UTF16String &theInstanceName=Base_UTF16String()) |
void | AddInstance (const ModelData_Instance &theInstance) |
bool | RemoveInstance (const ModelData_Instance &theInstance) |
Removes an instance from an assembly. | |
size_t | NumberOfInstances () const |
Returns number of instances in this assembly. | |
![]() | |
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. | |
![]() | |
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 | |
![]() | |
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). | |
![]() | |
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. | |
Defines a group of scene graph element.
Direct children of assembly are always instances which can refer to nested sub-assemblies or parts.
cadex::ModelData_Assembly::ModelData_Assembly | ( | ) |
If theToInitialize is false then creates a null object (see IsNull()).
const ModelData_Instance & cadex::ModelData_Assembly::AddInstance | ( | const ModelData_SceneGraphElement & | theElement, |
const Base_UTF16String & | theInstanceName = Base_UTF16String() |
||
) |
Adds a new child element into the assembly.
Assemblies may only have instances as direct children. If theElement is not an instance (i.e. is a part or an assembly) then an interim instance is created which will refer to theElement.
If theElement is an instance then return it, otherwise returns a newly created instance.
Parts and assemblies may be added to multiple assemblies to be shared. However they must be referred by unique instances when adding to parent assemblies, i.e. each instance may not be added as a child into more than one assembly. Otherwise this will create an invalid model object which undefined subsequent behavior.
size_t cadex::ModelData_Assembly::NumberOfInstances | ( | ) | const |
Returns number of instances in this assembly.
Returns 0 if IsNull().
bool cadex::ModelData_Assembly::RemoveInstance | ( | const ModelData_Instance & | theInstance | ) |
Removes an instance from an assembly.
Returns a boolean value specifying whether the removal took place.
true
value invalidates the instances of ModelData_Model::ElementVisitor and ModelData_Model::ElementIterator over assembly's children, making further behavior of these objects undefined.