Two-Dimensional Geometric Object MbPlaneItem

The MbPlaneItem class is declared in the plane_item.h file.

The MbPlaneItem class is derived from the MbRefItem and TapeBase classes and is the parent class for all two-dimensional geometric objects.

The two-dimensional geometric objects of the C3D kernel include curves, multiline and region:

../../../../_images/O.2.4.1.png

The following families of two-dimensional geometric objects are derived from MbPlaneItem:

MbCurve – two-dimensional curve;

MbMultiline – multiline;

MbRegion – region.

The main methods of two-dimensional geometric objects are:

virtual void Move( const MbVector &        to,
                         MbRegTransform *  iReg        = nullptr,
                   const MbSurface *       newSurface  = nullptr );

virtual void Rotate( const MbCartPoint &     pnt,
                     const MbDirection &     angle,
                           MbRegTransform *  iReg       = nullptr,
                     const MbSurface *       newSurface = nullptr ) = 0;

virtual void Transform( const MbMatrix &        matr,
                              MbRegTransform *  iReg       = nullptr,
                        const MbSurface *       newSurface = nullptr );

serving the transformation of a two-dimensional geometric object. During the transformation, the registrator MbRegTransform is used to prevent multiple transformation of nested objects. If an object contains pointers or references to other objects, then the nested objects are also transformed. The registrator must be used if it is necessary to sequentially transform several interrelated objects whose connection is determined by the presence of pointers or references to common objects in them. When transforming without a registrator, one can obtain multiple transformation of common nested objects.

In addition, all geometric objects have methods providing duplication, checking for equality, checking the possibility of making them equal, and making objects equal:

MbPlaneItem & Duplicate( MbRegDuplicate * iReg = nullptr );

bool IsSame( const MbPlaneItem & item,
                   double        accuracy = LENGTH_EPSILON );

bool IsSimilar( const MbPlaneItem & item );

bool SetEqual( const MbPlaneItem & item );

When creating a copy, the registrator MbRegDuplicate is used to prevent multiple copying of nested objects. If an object contains pointers or references to other objects, then the nested objects are also copied. The registrator must be used if it is necessary to sequentially copy several interrelated objects whose connection is determined by the presence of pointers or references to common objects in them. When copying without a registrator, one can obtain a set of copies of the same nested object instead of a single copy of it.

For type identification, geometric objects are equipped with methods

MbePlaneType IsA();

MbePlaneType Type();

MbePlaneType Family();

returning the type from the enumeration of two-dimensional geometric objects.

The methods

MbProperty & CreateProperty( MbePrompt name );

void GetProperties( MbProperties & properties );

void SetProperties( MbProperties & properties );

provide retrieval and editing of internal data of geometric objects. The GetProperties() method adds the object data to the properties set in the form of classes derived from MbProperty.