C3D Toolkit  Kernel - 117982, Vision - 2.9.2.2

Constructor of shell for elementary solid. More...

#include <cr_elementary_solid.h>

+ Inheritance diagram for MbElementarySolid:
+ Collaboration diagram for MbElementarySolid:

Public Member Functions

template<class PointsVector >
 MbElementarySolid (const PointsVector &pnts, ElementaryShellType t, const MbSNameMaker &n)
 Constructor. More...
 
virtual ~MbElementarySolid ()
 Destructor.
 
Common functions of the shell creator.
MbeCreatorType IsA () const override
 Get the object type.
 
void Transform (const MbMatrix3D &, MbRegTransform *=nullptr) override
 Transform according to the matrix. More...
 
void Move (const MbVector3D &, MbRegTransform *=nullptr) override
 Translate along a vector. More...
 
void Rotate (const MbAxis3D &, double angle, MbRegTransform *=nullptr) override
 Rotate an object about the axis. More...
 
MbCreatorDuplicate (MbRegDuplicate *=nullptr) const override
 Create a copy of the object. More...
 
MbePrompt GetPropertyName () override
 Get a name of object property.
 
void GetProperties (MbProperties &) override
 Get properties of the object.
 
void SetProperties (const MbProperties &) override
 Set properties of the object.
 
void GetBasisItems (RPArray< MbSpaceItem > &) override
 Get the basis objects.
 
void GetBasisPoints (MbControlData3D &) const override
 Get control points of object.
 
void SetBasisPoints (const MbControlData3D &) override
 Change the object by control points.
 
bool IsSame (const MbCreator &, double accuracy) const override
 Determine whether an object is equal? More...
 
bool IsSimilar (const MbCreator &) const override
 Determine whether an object is similar? More...
 
bool SetEqual (const MbCreator &) override
 Make the objects equal if they are similar.
 
bool CreateShell (MbFaceShell *&, MbeCopyMode sameShell, RPArray< MbSpaceItem > *=nullptr) override
 Create a shell from the initial data. More...
 
- Public Member Functions inherited from MbCreator
virtual ~MbCreator ()
 Destructor.
 
MbeRefType RefType () const override
 Get the registration type (for copying, duplication).
 
virtual MbeCreatorType Type () const
 Get the group type of the object.
 
bool CreateShell (c3d::ShellSPtr &shell, MbeCopyMode sameShell, RPArray< MbSpaceItem > *items=nullptr)
 Create a shell from the initial data. More...
 
virtual bool CreateWireFrame (MbWireFrame *&frame, MbeCopyMode sameShell, RPArray< MbSpaceItem > *items=nullptr)
 Create a wire-frame from the source data. More...
 
bool CreateWireFrame (SPtr< MbWireFrame > &frame, MbeCopyMode sameShell)
 Create a wire-frame from the source data. More...
 
virtual bool CreatePointFrame (MbPointFrame *&frame, MbeCopyMode sameShell, RPArray< MbSpaceItem > *items=nullptr)
 Create a point-frame from the source data. More...
 
bool CreatePointFrame (SPtr< MbPointFrame > &frame, MbeCopyMode sameShell)
 Create a point-frame from the source data. More...
 
virtual bool CreateMesh (MbMesh *&mesh, MbeCopyMode sameShell, RPArray< MbSpaceItem > *items=nullptr)
 Create a polygonal object from the source data. More...
 
bool CreateMesh (SPtr< MbMesh > &mesh, MbeCopyMode sameShell)
 Create a polygonal object from the source data. More...
 
virtual void Refresh (MbFaceShell &)
 Update the shell shape.
 
virtual void Refresh (MbWireFrame &)
 Update the frame shape.
 
virtual size_t GetCreatorsCount (MbeCreatorType ct) const
 Count internal creators by type.
 
virtual bool GetInternalCreators (MbeCreatorType, c3d::ConstCreatorsSPtrVector &) const
 Get internal creators by type.
 
virtual bool SetInternalCreators (MbeCreatorType, c3d::CreatorsSPtrVector &)
 Get internal creators by type.
 
virtual bool Perform (MbCreator *) const
 Displace/Change the creator.
 
virtual void SetYourVersion (VERSION version, bool forAll)
 Set the objects version.
 
VERSION GetYourVersion () const
 Get the object version.
 
const MbSNameMakerGetYourNameMaker () const
 Get the name-maker.
 
MbSNameMakerSetYourNameMaker ()
 Get the object's name-maker for editing.
 
void SetNameMaker (const MbSNameMaker &n)
 Set the object's name-maker.
 
SimpleName GetMainName () const
 Get the main name of the object.
 
void SetMainName (SimpleName n)
 Set the main name of the object.
 
MbeProcessState GetStatus () const
 Get the flag of state.
 
void SetStatus (MbeProcessState l)
 Set the flag of state.
 
void PrepareWrite () const
 Register the object. More...
 
- Public Member Functions inherited from MbRefItem
refcount_t GetUseCount () const
 Get count of references (get count of owners of an object).
 
refcount_t AddRef () const
 Increase count of references by one.
 
refcount_t DecRef () const
 Decrease count of references by one.
 
refcount_t Release () const
 Decrease count of references by one and if count of references became zero, then remove itself.
 
- Public Member Functions inherited from TapeBase
 TapeBase (RegistrableRec regs=noRegistrable)
 Constructor.
 
 TapeBase (const TapeBase &)
 Copy-constructor.
 
virtual ~TapeBase ()
 Destructor.
 
RegistrableRec GetRegistrable () const
 Whether the stream class is registrable.
 
void SetRegistrable (RegistrableRec regs=registrable) const
 Set the state of registration of the stream class.
 
virtual const char * GetPureName (const VersionContainer &) const
 Get the class name.
 
virtual bool IsFamilyRegistrable () const
 Whether the object belongs to a registrable family.
 

Protected Attributes

SArray< MbCartPoint3Dpoints
 Support points of a solid shell.
 
ElementaryShellType type
 Type of a solid.
 
MbPlacement3D position
 Local coordinate system of a solid.

 
double radius
 Radius of the base of the solid.

 
double minorRadius
 Small radius of the base of the solid.
 
double height
 Height of a solid.
 
double length
 Length of a solid.
 
double minorLength
 Small length of a solid.
 
double width
 Width of a solid.
 
double angle
 Angle between position.axisZ axis and lateral generatrix.
 
double ratio
 Stretch factor.
 
- Protected Attributes inherited from MbCreator
SPtr< MbSNameMakernames
 An object defining the names of elements and objects created by the constructor.
 
MbeProcessState status
 State of the constructor and of the operation result.
 

Additional Inherited Members

- Protected Member Functions inherited from MbCreator
 MbCreator (MbSNameMaker *)
 Constructor by name-maker.
 
 MbCreator (const MbSNameMaker &)
 Constructor by name-maker.
 
 MbCreator (const MbCreator &)
 Copy-constructor.
 
- Protected Member Functions inherited from MbRefItem
 MbRefItem ()
 Constructor without parameters.
 

Detailed Description

Constructor of shell for elementary solid.

Constructor of shell for elementary solid by a set of support points and a type:
solidType = et_Sphere - a sphere (3 points),
solidType = et_Torus - a torus (3 points),
solidType = et_Cylinder - a cylinder (3 points),
solidType = et_Cone - a cone (3 points), in the case of a non-frustum cone, (4 points), in the case of a frustum cone,
solidType = et_Block - a block (4 points),
solidType = et_Wedge - a wedge (4 points),
solidType = et_Prism - a prism (points count is equal to the base vertices count + 1),
solidType = et_Pyramid - a pyramid (points count is equal to the base vertices count + 1),
solidType = et_Plate - a plate (4 points).

Constructor & Destructor Documentation

◆ MbElementarySolid()

template<class PointsVector >
MbElementarySolid::MbElementarySolid ( const PointsVector &  pnts,
ElementaryShellType  t,
const MbSNameMaker n 
)

Constructor.

Constructor by points and type of solid. At the same time, the corresponding parameters are filled in by the array of points of the body and its type.

Parameters
[in]pnts- Support points. \ pnts[0] determines a local coordinate system origin.
For a sphere, a torus, a cylinder, a cone:
pnts[1] determines the direction of Z-axis of a local coordinate system.
pnts[2] determines the direction of X-axis of a local coordinate system. For a frustum cone (in the case of 4 points), if point pnts[2] lies on a line that formed by points pnts[0] and pnts[1], then the X axis of a local system is determined by point pnts[3].
For a block, a plate or a wedge:
pnts[1] determines the direction of X-axis of a local coordinate system.
pnts[2] determines the direction of Y-axis of a local coordinate system.
Also,
pnts[1] determines the height of a cylinder, a cone or a frustum cone, the major radius of a torus, the length of a block or a wedge.
pnts[2] determines the radius of a cylinder or a cone (in the case of 3 points), radius of the upper or lower base of a frustum cone (in the case of 4 points), radius of a sphere, the minor radius of a torus, the width of a block or a wedge.
The last point determines the height of a block, a wedge or a plate, the vertex of a pyramid, radius of the upper or lower base of a frustum cone (in the case of 4 points)
[in]t- Elementary solid type.
[in]n- An object defining names generation in the operation.

Member Function Documentation

◆ Transform()

void MbElementarySolid::Transform ( const MbMatrix3D matr,
MbRegTransform iReg = nullptr 
)
overridevirtual

Transform according to the matrix.

Transform the initial object according to the matrix using the registrator. If the object contains references to the other geometric objects, then the nested objects are transformed according to the matrix. The registrator is used for preventing multiple transformation of the object. The function can be used without the registrator to transform a single object. The registrator must be used to transform a set of interdependent objects to prevent repeated transformation of the nested objects, since it is not ruled out that several objects from the set contain references to one or several common objects subject to transformation.

Parameters
[in]matr- A transformation matrix.
[in]iReg- Registrator.

Implements MbCreator.

◆ Move()

void MbElementarySolid::Move ( const MbVector3D to,
MbRegTransform iReg = nullptr 
)
overridevirtual

Translate along a vector.

Move a geometric object along the vector using the registrator. If the object contains references to the other objects, then the translation operation is applied to the nested objects. The registrator is used for preventing multiple transformation of the object. The function can be used without the registrator to transform a single object. The registrator must be used to transform a set of interdependent objects to prevent repeated transformation of the nested objects, since it is not ruled out that several objects from the set contain references to one or several common objects subject to moving.

Parameters
[in]to- Movement vector.
[in]iReg- Registrator.

Implements MbCreator.

◆ Rotate()

void MbElementarySolid::Rotate ( const MbAxis3D axis,
double  angle,
MbRegTransform iReg = nullptr 
)
overridevirtual

Rotate an object about the axis.

Rotate an object about the axis by the given angle using the registrator. If the object contains references to the other geometric objects, then the rotation operation is applied to the nested objects too. The registrator is used for preventing multiple transformation of the object. The function can be used without the registrator to transform a single object. The registrator must be used to transform a set of interdependent objects to prevent repeated transformation of the nested objects, since it is not ruled out that several objects from the set contain references to one or several common objects subject to rotation.

Parameters
[in]axis- The rotation axis.
[in]angle- The rotation angle.
[in]iReg- Registrator.

Implements MbCreator.

◆ Duplicate()

MbCreator& MbElementarySolid::Duplicate ( MbRegDuplicate iReg = nullptr) const
overridevirtual

Create a copy of the object.

Create a copy of the object using the registrator. The registrator is used to prevent multiple copying of an object. If the object contains references to other objects, then the included objects are copied too. It is allowed not to pass the registrator to a function. Then the new copy of the object will be created. It is allowed not to use the registrator while copying a single object or a set of disconnected objects. The registrator must be used to copy several correlated objects successively. It is possible that the relation between objects means that the objects contain references on the common objects. Then, while copying without using the registrator, one can get a set of copies which contain references to the different copies of a single embedded object, what leads to loss of relationship between the copies.

Parameters
[in]iReg- Registrator.
Returns
The object copy.

Implements MbCreator.

◆ IsSame()

bool MbElementarySolid::IsSame ( const MbCreator other,
double  accuracy 
) const
overridevirtual

Determine whether an object is equal?

Still considered objects of the same type, all data is the same (equal).

Parameters
[in]other- The object to compare.
[in]accuracy- The accuracy to compare.
Returns
Whether the objects are equal.

Implements MbCreator.

◆ IsSimilar()

bool MbElementarySolid::IsSimilar ( const MbCreator item) const
overridevirtual

Determine whether an object is similar?

Such are considered the same objects whose data are similar.

Parameters
[in]item- The object to compare.
Returns
Whether the objects are similar.

Reimplemented from MbCreator.

◆ CreateShell()

bool MbElementarySolid::CreateShell ( MbFaceShell *&  shell,
MbeCopyMode  sameShell,
RPArray< MbSpaceItem > *  items = nullptr 
)
overridevirtual

Create a shell from the initial data.

Construction of a new shell or modification of the given one from the source data according to the constructor.

Parameters
[in]shell- A shell to be modified or a new shell.
[in]sameShell- Whether to perform complete copying of elements while constructing.
[in]items- Container for the elements of not performed constructions (can be nullptr).
Returns
Whether the construction is performed.

Reimplemented from MbCreator.


The documentation for this class was generated from the following file: