Defines a group of model elements. 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. | |
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 | SetPMI (const PMI::Data &thePMI) |
| Sets the object PMI. | |
| PMI::Data | PMI () const |
| Returns the object PMI. | |
| 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 assembly. | |
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) | |
Defines a group of model elements.
Direct children of an 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 it is returned; otherwise a new instance is created.
Parts and assemblies may be added to multiple assemblies to be shared. However they must be referred to 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 with undefined behaviour.
| 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.