Hide menu

Defines a group of scene graph element. More...

Inheritance diagram for cadex::ModelData_Assembly:
cadex::ModelData_SceneGraphElement cadex::ModelData_BaseObject

Public Types

typedef cadex::internal::ModelData_AssemblyImpl 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_Assembly ()
 
 ModelData_Assembly (initialized)
 
 ModelData_Assembly (ImplType *theImpl)
 Constructor (reserved for internal use).
 
 ModelData_Assembly (const Base_UTF16String &theName)
 
const ModelData_InstanceAddInstance (const ModelData_SceneGraphElement &theElement, const Base_UTF16String &theInstanceName=Base_UTF16String())
 Adds a new child element into the assembly. More...
 
const ModelData_InstanceAddInstance (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. More...
 
size_t NumberOfInstances () const
 Returns number of instances in this assembly. More...
 
- Public Member Functions inherited from cadex::ModelData_SceneGraphElement
 ModelData_SceneGraphElement ()
 Constructor. More...
 
void SetAppearance (const ModelData_Appearance &theAppearance)
 
ModelData_Appearance Appearance () const
 
void AddProperties (const ModelData_PropertyTable &theProperties)
 Adds a property table to the element. More...
 
ModelData_PropertyTable Properties () const
 Returns a property table.
 
void AddPMI (const ModelData_PMITable &thePMI)
 Adds a PMI table to the element. More...
 
ModelData_PMITable PMI () const
 Returns a PMI table.
 
void AddToLayer (const ModelData_Layer &theLayer)
 Adds element to layer.
 
void Accept (ModelData_Model::ElementVisitor &theVisitor) const
 Accepts an element visitor. More...
 
- Public Member Functions inherited from cadex::ModelData_BaseObject
 ModelData_BaseObject ()
 Constructor. More...
 
IdType TypeId () const
 Returns an object type id. More...
 
template<typename T >
bool IsOfType () const
 Returns true if the object has a type T. More...
 
void SetName (const Base_UTF16String &theName)
 Sets an object name. More...
 
Base_UTF16String Name () const
 
void SetUuid (const Base_Uuid &theUuid)
 
Base_Uuid Uuid () const
 
void Nullify ()
 Resets reference to implementation object. More...
 
bool IsNull () const
 Returns true if the object is nullified. More...
 
 operator bool () const
 Casts the object to the bool type. More...
 
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 a group of scene graph element.

Direct children of assembly are always instances which can refer to nested sub-assemblies or parts.

Examples:
exploring/bom/main.cxx, exploring/layers/main.cxx, exploring/pmi/main.cxx, modeling/assembly/main.cxx, and modeling/elementremoval/main.cxx.

Constructor & Destructor Documentation

cadex::ModelData_Assembly::ModelData_Assembly ( )

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

Member Function Documentation

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.

Warning
A call to this function resulting in true value invalidates the instances of ModelData_Model::ElementVisitor and ModelData_Model::ElementIterator over assembly's children, making further behavior of these objects undefined.