.. role:: blue :class: blue Three-Dimensional Geometric Object MbSpaceItem ============================================== .. _MbSpaceItem_Three-Dimensional_Geometrical_Object_: .. kernel version: 118060 The :blue:`MbSpaceItem` class is declared in the *space_item.h* file. The :blue:`MbSpaceItem` class is derived from the :ref:`MbRefItem ` and :blue:`TapeBase` classes and is the base class for three-dimensional geometric objects. The three-dimensional geometric objects of the C3D kernel include points, curves, surfaces, auxiliary objects and geometric model objects: .. figure:: /MODELER/GEOMETRICAL_OBJECTS/pictures/O.2.2.1.png :width: 12cm :align: center The following families of three-dimensional geometric objects are derived from the :blue:`MbSpaceItem` class: :blue:`MbPoint3D` is a point. :blue:`MbCurve3D` is a curve. :ref:`MbSurface ` is a surface. :ref:`MbLegend ` is an auxiliary geometric object. :ref:`MbItem ` is a geometric model object. The main methods of three-dimensional geometric objects are: .. code-block:: cpp virtual void Move( const MbVector3D & to, MbRegTransform * iReg = nullptr ); virtual void Rotate( const MbAxis3D & axis, double angle, MbRegTransform * iReg = nullptr ); virtual void Transform( const MbMatrix3D & matr, MbRegTransform * iReg = nullptr ); These methods perform geometric transformations of the object. When a transformation is applied, the :blue:`MbRegTransform` registrar is used to prevent repeated transformations of shared nested objects. If an object stores pointers or references to other objects, then the nested objects are also transformed. The registrar must be used when several related objects, which reference common nested objects, are transformed sequentially. If the transformation is performed without the registrar, shared nested objects can be transformed multiple times. In addition, all geometric objects have methods that provide copying, checking for equality, checking for the possibility to make objects equal, and making objects equal: .. code-block:: cpp // Create a copy of the object using the registrar MbSpaceItem & Duplicate( MbRegDuplicate * iReg = nullptr ); // Determine whether the objects are equal virtual bool IsSame( const MbSpaceItem & other, double accuracy = LENGTH_EPSILON ); // Determine whether the objects are similar virtual bool IsSimilar( const MbSpaceItem & item ); // Make the objects equal if they are similar virtual bool SetEqual( const MbSpaceItem & item ); When a copy is created, the :blue:`MbRegDuplicate` registrar is used to prevent repeated copying of shared nested objects. If an object stores pointers or references to other objects, then the nested objects are also copied. The registrar must be used when several related objects, which reference common nested objects, are copied sequentially. If copying is performed without the registrar, multiple copies of the same nested object may be created instead of a single shared copy. To identify the type, geometric objects are provided with the following methods: .. code-block:: cpp MbeSpaceType IsA(); MbeSpaceType Type(); MbeSpaceType Family(); These methods return a value of the enumeration of three-dimensional geometric object types. The following methods .. code-block:: cpp MbProperty & CreateProperty( MbePrompt name ); void GetProperties( MbProperties & properties ); void SetProperties( MbProperties & properties ); provide access to and editing of the internal data of geometric objects. The :blue:`GetProperties`\() method appends the object data to the **properties** collection in the form of descendants of the :blue:`MbProperty` class. The :blue:`CalculateWire`\( double sag, :ref:`MbMesh ` & **mesh** ) method builds a polygonal copy of the geometric object which is used for visualization.