MbItem Geometric Model Object
The MbItem class is declared in the model_item.h file.
The MbItem geometric model object is derived from the MbSpaceItem, MbTransactions, and MbAttributeContainer classes. The C3D geometric kernel operates on geometric model objects shown in Fig. 1.
Fig. 1
The MbTransactions construction journal contains the data required to construct an object and allows you to repeat the construction of the object with edited parameters. The MbAttrContainer attribute container assigns attributes to geometric model objects. Thus, all geometric model objects, in addition to their specific data, contain the following data:
size_t m_countRegistrable – the number of object registrations during writing and reading,
ptrdiff_t useCount – the number of times the object is used by other objects,
std::vector< MbCreator * > transactions – an ordered set of object builders,
std::multimap< int, MbAttribute * > attributes – a set of object attributes.
The following geometric model objects are derived from the MbItem class:
MbSolid – solid body,
MbWireFrame – wireframe model,
MbPointFrame – point frame,
MbMesh – polygonal object,
MbInstance – insertion of a geometric model object,
MbAssembly – assembly unit of geometric model objects,
MbAssistingItem – auxiliary object,
MbSpaceInstanсe – insertion of a three-dimensional object,
MbPlaneInstanсe – insertion of a set of two-dimensional objects.
MbPolymesh – polygonal object with topology.
The main methods of geometric model objects are methods that provide editing and visualization of objects.
The method
bool RebuildItem( MbeCopyMode sameShell, RPArray<MbSpaceItem> items )
rebuilds the object according to the construction journal. This method is called after editing the internal data of the object.
The method
MbItem * CreateMesh( MbeStepData data, bool wire, bool grid, MbRegDuplicate * iReg )
creates a polygonal copy of the object. If the object is an assembly unit or insertion, then the copy of the object will also be an assembly unit or insertion containing polygonal objects.
The method
bool AddYourMesh( MbeStepData data, bool wire, bool grid, MbItem & mesh )
adds a polygonal copy of the object to the mesh object.
The method
bool NearestMesh( MbeSpaceType sType, MbeTopologyType tType, MbePlaneType pType, const MbAxis3D & axis, double maxDistance, double & t, double & dMin, MbItem & **find*, SimpleName & findName, MbRefItem & **element*, SimpleName & elementName, MbPath & path, MbMatrix3D & from )
searches for the nearest polygonal object find, its element element, their names findName and elementName, the path in the assembly unit structure path, and the transformation matrix from to the global coordinate system.
Geometric model objects overload the following methods of a three-dimensional object:
methods that handle the transformation of a geometric object,
void Move( const MbVector3D & v, MbRegTransform * iReg = NULL ),
void Rotate( const MbAxis3D & axis, double angle, MbRegTransform * iReg = NULL ),
void Transform( const MbMatrix3D & m, MbRegTransform * iReg = NULL ),
methods that provide copying, equality checking, checking the possibility to make objects equal, and making objects equal,
MbSpaceItem & Duplicate( MbRegDuplicate * iReg = NULL ),
bool IsSame( const MbSpaceItem & item ),
bool IsSimilar( const MbSpaceItem & item ),
bool SetEqual( const MbSpaceItem & item ),
methods that return a type from the enumeration of geometric objects:
MbeSpaceType IsA(),
MbeSpaceType Type(),
MbeSpaceType Family(),
methods that provide output and editing of the internal data of the object:
MbProperty & CreateProperty( MbePrompt name ),
GetProperties( MbProperties & properties ),
SetProperties( MbProperties & properties ).