.. role:: blue :class: blue MbItem Geometric Model Object ============================= .. _MbItem_Geometric_Model_Object_: .. kernel version: The :blue:`MbItem` class is declared in the *model_item.h* file. The :blue:`MbItem` geometric model object is derived from the :ref:`MbSpaceItem `, :blue:`MbTransactions`, and :blue:`MbAttributeContainer` classes. The C3D geometric kernel operates on geometric model objects shown in Fig. 1. .. figure:: /MODELER/OBJECTS_OF_GEOMETRIC_MODEL/pictures/O.8.1.1.png :width: 12cm :align: center Fig. 1 The :blue:`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: :ref:`MbSolid ` – solid body, :ref:`MbWireFrame ` – wireframe model, :ref:`MbPointFrame ` – point frame, :ref:`MbMesh ` – polygonal object, :ref:`MbInstance ` – insertion of a geometric model object, :ref:`MbAssembly ` – assembly unit of geometric model objects, :ref:`MbAssistingItem ` – auxiliary object, :ref:`MbSpaceInstanсe ` – insertion of a three-dimensional object, :ref:`MbPlaneInstanсe ` – insertion of a set of two-dimensional objects. :ref:`MbPolymesh ` – polygonal object with topology. The main methods of geometric model objects are methods that provide editing and visualization of objects. The method bool :blue:`RebuildItem`\( MbeCopyMode sameShell, RPArray<:ref:`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 * :blue:`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 :blue:`AddYourMesh`\( MbeStepData data, bool wire, bool grid, :ref:`MbItem ` & **mesh** ) adds a polygonal copy of the object to the **mesh** object. The method bool :blue:`NearestMesh`\( MbeSpaceType sType, MbeTopologyType tType, MbePlaneType pType, const MbAxis3D & **axis**, double maxDistance, double & t, double & dMin, MbItem *& **find**, SimpleName & findName, :ref:`MbRefItem ` *& **element**, SimpleName & elementName, :blue:`MbPath` & path, :ref:`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 :blue:`Move`\( const :ref:`MbVector3D ` & **v**, MbRegTransform * iReg = NULL ), void :blue:`Rotate`\( const MbAxis3D & **axis**, double **angle**, MbRegTransform * iReg = NULL ), void :blue:`Transform`\( const :ref:`MbMatrix3D ` & **m**, MbRegTransform * iReg = NULL ), methods that provide copying, equality checking, checking the possibility to make objects equal, and making objects equal, :ref:`MbSpaceItem ` & :blue:`Duplicate`\( MbRegDuplicate * iReg = NULL ), bool :blue:`IsSame`\( const :ref:`MbSpaceItem ` & **item** ), bool :blue:`IsSimilar`\( const :ref:`MbSpaceItem ` & **item** ), bool :blue:`SetEqual`\( const :ref:`MbSpaceItem ` & **item** ), methods that return a type from the enumeration of geometric objects: MbeSpaceType :blue:`IsA`\(), MbeSpaceType :blue:`Type`\(), MbeSpaceType :blue:`Family`\(), methods that provide output and editing of the internal data of the object: MbProperty & :blue:`CreateProperty`\( MbePrompt name ), :blue:`GetProperties`\( MbProperties & *properties* ), :blue:`SetProperties`\( MbProperties & *properties* ).