Defines a group of model element. More...
#include <cadex/ModelData/Assembly.hxx>
Public Member Functions | |
Assembly (Initialized) | |
Assembly (const UTF16String &theName) | |
const Instance & | AddInstance (const ModelElement &theElement) |
Adds a new child element into the assembly. | |
const Instance & | AddInstance (const Part &thePart, const UTF16String &theInstanceName=UTF16String()) |
Adds a new part into the assembly. | |
const Instance & | AddInstance (const Part &thePart, const Geom::Transformation &theTransformation, const UTF16String &theInstanceName=UTF16String()) |
Adds a new part into the assembly. | |
const Instance & | AddInstance (const Assembly &theAssembly, const UTF16String &theInstanceName=UTF16String()) |
Adds a new assembly into the assembly. | |
const Instance & | AddInstance (const Assembly &theAssembly, const Geom::Transformation &theTransformation, const UTF16String &theInstanceName=UTF16String()) |
Adds a new assembly into the assembly. | |
bool | RemoveInstance (const Instance &theInstance) |
Removes an instance from an assembly. | |
const std::vector< Instance > & | Instances () const |
Returns a vector of instances. | |
size_t | NumberOfInstances () const |
Returns number of instances in this assembly. | |
![]() | |
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 assembly. | |
![]() | |
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 a group of model element.
Direct children of assembly are always instances which can refer to nested sub-assemblies or parts.
const Instance & cadex::ModelData::Assembly::AddInstance | ( | const ModelElement & | theElement | ) |
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 Instance & | theInstance | ) |
Removes an instance from an assembly.
Returns a boolean value specifying whether the removal took place.
true
value invalidates the instances of ModelElementVisitor and ModelElementIterator over assembly's children, making further behavior of these objects undefined.