C3D Toolkit  Kernel - 117982, Vision - 2.9.2.2

A model geometric object. More...

#include <model_item.h>

+ Inheritance diagram for MbItem:
+ Collaboration diagram for MbItem:

Public Member Functions

 MbItem ()
 Constructor.
 
virtual ~MbItem ()
 Destructor.
 
Common functions of a geometric object.
MbeSpaceType Type () const override
 Get the group object type.
 
MbeSpaceType Family () const override
 Get family of objects.
 
MbeImplicationType ImplicationType () const override
 Get attribute container type.
 
MbPropertyCreateProperty (MbePrompt n) const override
 Create your own property with the name.
 
void GetProperties (MbProperties &properties) override
 Outstanding properties of the object. More...
 
void SetProperties (const MbProperties &properties) override
 Change the properties of an object. More...
 
void GetBasisPoints (MbControlData3D &) const override
 Get control points of object.
 
void SetBasisPoints (const MbControlData3D &) override
 Change the object by control points.
 
virtual void GetBasisPoints (MbControlData &) const
 
virtual void SetBasisPoints (const MbControlData &)
 
virtual bool GetPlacement (MbPlacement3D &p) const
 Get the coordinate system of an item if it is exist. More...
 
virtual bool SetPlacement (const MbPlacement3D &)
 Set the coordinate system of an item if it is possible.
 
Common functions of object of geometric model.

Build polygonal copy mesh.

Build a polygonal copy of the object that is represented by polygons or/and fasets.

Parameters
[in]stepData- Data for еру step calculation for polygonal object.
[in]note- Way for polygonal object constructing.
[in,out]mesh- The builded polygonal object.
bool RebuildItem (MbeCopyMode sameShell, RPArray< MbSpaceItem > *items, IProgressIndicator *progInd) override
 Reconstruct object according to the history tree. More...
 
virtual MbItemCreateMesh (const MbStepData &stepData, const MbFormNote &note, MbRegDuplicate *iReg) const =0
 Create polygonal object. More...
 
virtual bool AddYourMesh (const MbStepData &stepData, const MbFormNote &note, MbMesh &mesh) const
 Add polygonal object. More...
 
virtual MbItemCutMesh (const MbPlacement3D &cutPlace, double distance, const MbSNameMaker *names=nullptr) const
 Cut the polygonal object by one or two parallel planes. More...
 
virtual bool NearestMesh (MbeSpaceType sType, MbeTopologyType tType, MbePlaneType pType, const MbAxis3D &axis, double maxDistance, bool gridPriority, double &t, double &dMin, MbItem *&find, SimpleName &findName, MbRefItem *&element, SimpleName &elementName, MbPath &path, MbMatrix3D &from) const
 Find the nearest object or name of the nearest object. More...
 
virtual bool GetItems (MbeSpaceType type, const MbMatrix3D &from, std::vector< SPtr< MbItem >> &items, std::vector< MbMatrix3D > &matrs)
 Get all objects by the type. More...
 
virtual bool GetItems (MbeSpaceType type, const MbMatrix3D &from, RPArray< MbItem > &items, SArray< MbMatrix3D > &matrs)
 Get all objects by type. More...
 
virtual bool GetUniqItems (MbeSpaceType type, CSSArray< const MbItem * > &items) const
 Get all unique objects by type. More...
 
virtual const MbItemGetItemByPath (const MbPath &path, size_t ind, MbMatrix3D &from, size_t currInd=0) const
 Get the object by its path. More...
 
virtual const MbItemFindItem (const MbSpaceItem *s, MbPath &path, MbMatrix3D &from) const
 Find object by geometric object. More...
 
virtual const MbItemFindItem (const MbPlaneItem *s, MbPath &path, MbMatrix3D &from) const
 Find object by geometric object. More...
 
virtual const MbItemFindItem (const MbItem *s, MbPath &path, MbMatrix3D &from) const
 Find object by object of geometric model. More...
 
virtual const MbItemGetItemByName (SimpleName n, MbPath &path, MbMatrix3D &from) const
 Find object by name. More...
 
virtual void TransformSelected (const MbMatrix3D &matr, MbRegTransform *iReg=nullptr)
 Transform selected object according to the matrix. More...
 
virtual void MoveSelected (const MbVector3D &to, MbRegTransform *iReg=nullptr)
 Move selected object along a vector. More...
 
virtual void RotateSelected (const MbAxis3D &axis, double angle, MbRegTransform *iReg=nullptr)
 Rotate selected object by a given angle about an axis. More...
 
virtual bool GetMatrixFrom (MbMatrix3D &from) const
 Get transform matrix from local coordinate system of object.
 
virtual bool GetMatrixInto (MbMatrix3D &into) const
 Get transform matrix into local coordinate system of object.
 
void Assign (const MbItem &other)
 Copy creators and attributes.
 
void CopyItemName (const MbItem &other)
 Copy the name of an object.
 
SimpleName GetItemName () const
 Get name of object.
 
void SetItemName (SimpleName n)
 Set name of the object.
 
bool IsAttributeEqual (int attribute)
 Whether a sign attribute matches an object?
 
- Public Member Functions inherited from MbSpaceItem
virtual ~MbSpaceItem ()
 Destructor.
 
void PrepareWrite () const
 Register object. More...
 
MbeRefType RefType () const override
 Get a registration type (for copying, duplication).
 
virtual MbeSpaceType IsA () const =0
 Get the type of the object.
 
bool IsFamilyRegistrable () const override
 Whether the object belongs to a registrable family.
 
virtual MbSpaceItemDuplicate (MbRegDuplicate *iReg=nullptr) const =0
 Create a copy of the object. More...
 
virtual void Transform (const MbMatrix3D &matr, MbRegTransform *iReg=nullptr)=0
 Convert the object according to the matrix. More...
 
virtual void Move (const MbVector3D &to, MbRegTransform *iReg=nullptr)=0
 Move an object along a vector. More...
 
virtual void Rotate (const MbAxis3D &axis, double angle, MbRegTransform *iReg=nullptr)=0
 Rotate an object around an axis at a given angle. More...
 
virtual bool IsSame (const MbSpaceItem &other, double accuracy=LENGTH_EPSILON) const =0
 Determine whether an object is equal. More...
 
virtual bool IsSimilar (const MbSpaceItem &item) const
 Determine whether an object is similar. More...
 
virtual bool SetEqual (const MbSpaceItem &item)=0
 Make objects equal if they are similar. More...
 
virtual double DistanceToPoint (const MbCartPoint3D &point) const =0
 Determine the distance to the point. More...
 
virtual void AddYourGabaritTo (MbCube &cube) const =0
 Expand sent bounding box (a.k.a. gabarit), so that it included the object. More...
 
virtual void CalculateLocalGabarit (const MbMatrix3D &into, MbCube &cube) const =0
 To compute bounding box in a local coordinate system. More...
 
virtual void Refresh ()
 Translate all the time (mutable) data objects in an inconsistent (initial) state.
 
virtual void CalculateMesh (const MbStepData &stepData, const MbFormNote &note, MbMesh &mesh) const =0
 Build polygonal copy mesh. More...
 
void CalculateWire (const MbStepData &stepData, MbMesh &mesh) const
 
void CalculateWire (double sag, MbMesh &mesh) const
 
virtual void GetBasisItems (RPArray< MbSpaceItem > &)
 Outstanding reference objects in a container sent.
 
- 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.
 
- 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 MbTransactions
 MbTransactions ()
 Constructor without parameters.
 
template<class Creators >
 MbTransactions (const Creators &creators)
 Constructor by creators.
 
virtual ~MbTransactions ()
 Destructor.
 
void CreatorsCopy (MbTransactions &other, MbRegDuplicate *iReg=nullptr) const
 Clear the given history tree and copy the creators to it.

 
void CreatorsAssign (const MbTransactions &other)
 Clear the history tree and copy the creators from the given history tree to it.

 
bool SetCreatorsEqual (const MbTransactions &other)
 Make the creators equal to the creators from the given history tree if the creators are similar.
 
bool IsCreatorsSimilar (const MbTransactions &other) const
 Check whether the corresponding creators of the given history tree are similar.
 
void CreatorsTransform (const MbMatrix3D &, MbRegTransform *=nullptr)
 Transform the creators according to the matrix.
 
void CreatorsMove (const MbVector3D &, MbRegTransform *=nullptr)
 Move creators along the vector.
 
void CreatorsRotate (const MbAxis3D &, double angle, MbRegTransform *=nullptr)
 Rotate the creators about the axis by the given angle.
 
size_t GetCreatorsCount () const
 Get the creators count.
 
void Reserve (size_t count)
 Reserve space for creators.
 
const MbCreatorGetCreator (size_t ind) const
 Get constructor by its index.
 
MbCreatorSetCreator (size_t ind)
 Get constructor by its index with possibility of editing.
 
virtual bool GetCreators (RPArray< MbCreator > &) const
 Add your own creators to the given array.
 
virtual bool GetCreators (c3d::CreatorsSPtrVector &) const
 Add your own creators to the given array.
 
template<class CreatorsVector >
bool GetCreatorsCopies (CreatorsVector &creators, MbRegDuplicate *iReg) const
 Add copies of your own creators to the given array.
 
size_t FindCreator (const MbCreator *creator)
 Find the number of creators in the history tree or return SYS_MAX_T if it is absent.
 
bool AddCreator (const MbCreator &, bool addSame=false)
 Add the constructor (addSame = false) or its copy (addSame = true) to the history tree.
 
bool AddCreator (const MbCreator *, bool addSame=false)
 Add the constructor (addSame = false) or its copy (addSame = true) to the history tree.
 
template<class CreatorsVector >
void AddCreators (const CreatorsVector &creators)
 Add creators to the history tree.
 
MbCreatorDetachCreator (size_t ind)
 Remove the constructor with the specified index from the history tree and return it.
 
bool DeleteCreator (size_t ind)
 Delete the constructor with the specified index and remove it from the history tree.
 
void DeleteCreators ()
 Delete all the creators and clear the history tree.
 
int GetCreatorStatus (size_t ind) const
 Get the status of creator with the specified index.
 
bool SetCreatorStatus (size_t ind, MbeProcessState)
 Set status to creator with the specified index.
 
size_t GetActiveCreatorsCount () const
 Get the active creators count.
 
bool SetActiveCreatorsCount (size_t activeCount)
 Set the count of active creators from the beginning to the given index.
 
void BreakCreatorsToBasisItem (size_t c, RPArray< MbSpaceItem > &)
 Get the object created by the specified number of creators and the basis items of the other creators.
 
void GetCreatorsBasisItems (RPArray< MbSpaceItem > &)
 Get the basis items of the creators.
 
void GetCreatorsBasisPoints (MbControlData3D &) const
 Get the basis points of the creators.
 
void SetCreatorsBasisPoints (const MbControlData3D &)
 Change the object by control points.
 
void GetProperties (MbProperties &, bool sameCreators=false)
 Get properties of the creators (using original creators or their copies).
 
void SetProperties (const MbProperties &)
 Set properties of the creators.
 
void CreatorsRead (reader &in)
 Read creators from the stream.
 
void CreatorsWrite (writer &out) const
 Write creators to the stream.
 
- Public Member Functions inherited from MbAttributeContainer
 MbAttributeContainer ()
 Constructor without parameters.
 
 MbAttributeContainer (MbAttribute &)
 Constructor by attribute.
 
virtual ~MbAttributeContainer ()
 Destructor.
 
void AttributesRead (reader &)
 Read attributes from stream.
 
void AttributesWrite (writer &) const
 Writing attributes to stream.
 
void GetProperties (MbProperties &)
 Get properties of attributes.
 
void SetProperties (const MbProperties &)
 Set properties of attributes.
 
void SetDensity (double)
 Set density of an object.
 
double GetDensity () const
 Get density of an object.
 
void SetVisual (float a, float d, float sp, float sh, float t, float e, uint rgb=0)
 Set visual properties of the object.
 
void SetVisual (const MbRGBA &ambient, const MbRGBA &diffuse, const MbRGBA &specular, const MbRGBA &emission, uint8 shininess, uint8 opacity, uint8 chrom)
 Set visual properties of the object.
 
bool GetVisual (float &a, float &d, float &sp, float &sh, float &t, float &e, uint rgb=0) const
 Get visual properties of the object. More...
 
bool IsColored () const
 
void SetColor (uint32)
 Change color of the object.

 
void SetColor (int R, int G, int B)
 Change color of the object (0-255).
 
uint32 GetColor () const
 Get color of an object.
 
void SetWidth (int)
 Set thickness of lines for object's representation.
 
int GetWidth () const
 Get thickness of lines for object's representation.
 
void SetStyle (int)
 Set style of lines for object's representation.
 
int GetStyle () const
 Get style of lines for object's representation.
 
void SetSelected (bool s=true)
 To allocate or not to allocate an object.
 
bool IsSelected () const
 Is the object selected.
 
bool ReverseSelected ()
 Invert object selection.
 
void SetChanged (bool c=true)
 Set: the object is changed or isn't changed.
 
bool IsChanged () const
 Is the object changed?
 
void SetVisible (bool)
 Set visibility.

 
bool IsVisible () const
 Is the object visible?
 
bool IsInvisible () const
 Is the object invisible?
 
void AttributesAssign (const MbAttributeContainer &)
 Duplicate attributes of a given object, release existing attributes.
 
size_t AttributesCount () const
 Get the number of objects.
 
bool RemoveAttributes (bool onDeleteOwner=false)
 Delete all attributes from container.
 
MbAttributeAddAttribute (MbAttribute *attr, bool checkSame=true)
 Add attribute in container. More...
 
MbAttributeAddAttribute (const MbAttribute &attr, bool checkSame=true)
 Add attribute in container (adds a copy of the attribute if it can be added). More...
 
void GetAttributes (c3d::AttrVector &attrs, MbeAttributeType aFamily, MbeAttributeType subType) const
 Get attributes of a given type or family. More...
 
void GetAttributes (c3d::AttrVector &attrs, MbeAttributeType aType) const
 Get attributes of a given type. More...
 
template<class AttrVector >
void GetAttributes (AttrVector &attrs) const
 Get attributes. More...
 
void GetCommonAttributes (c3d::AttrVector &, const c3d::string_t &samplePrompt, MbeAttributeType subType=at_Undefined, bool firstFound=false) const
 Get attributes using sample of description string.
 
void GetStringAttributes (c3d::AttrVector &, const c3d::string_t &sampleContent) const
 Get string attributes using sample of contents of the string.
 
bool RemoveAttribute (const MbAttribute *, bool checkAccuracySame=false, double accuracy=LENGTH_EPSILON)
 Get an attribute of a given type, the first one is returned if there are many. More...
 
bool RemoveAttributes (MbeAttributeType type, MbeAttributeType subType)
 Delete attributes of a given type.
 
const MbAttributeGetSimpleAttribute (MbeAttributeType) const
 Get a simple attribute of a given subtype.
 
MbAttributeSetSimpleAttribute (MbeAttributeType)
 Get a simple attribute of a given subtype.
 
MbAttributeSetSimpleAttribute (MbAttribute *simpAttr)
 Set a simple attribute of a given subtype.
 
MbAttributeSetSimpleAttribute (const MbAttribute &simpAttr)
 Set a simple attribute of a given subtype (always copies the attribute).
 
void RemoveSimpleAttribute (MbeAttributeType)
 Delete simple attributes (one or more) of a given subtype.
 
MbAttributeDetachSimpleAttribute (MbeAttributeType)
 Detach a simple attribute of a given subtype.
 
void GetUserAttributes (std::vector< MbUserAttribute * > &attrs, const MbUserAttribType &type) const
 Get a user attribute of a given subtype.
 
void RemoveUserAttributes (const MbUserAttribType &type)
 Delete user attributes (one or more) of a given subtype.
 
void DetachUserAttributes (std::vector< MbUserAttribute * > &attrs, const MbUserAttribType &type)
 Detach a user attribute of a given subtype.
 
void AttributesChange ()
 Perform actions when changing the attributes.

 
void AttributesConvert (MbAttributeContainer &other) const
 Perform actions when converting the attributes.

 
void AttributesTransform (const MbMatrix3D &, MbRegTransform *=nullptr)
 Perform actions when transforming the attributes.

 
void AttributesMove (const MbVector3D &, MbRegTransform *=nullptr)
 Perform actions when moving the attributes.

 
void AttributesRotate (const MbAxis3D &, double angle, MbRegTransform *=nullptr)
 Perform actions when rotating the attributes.

 
void AttributesCopy (MbAttributeContainer &other, MbRegDuplicate *=nullptr) const
 Perform actions when copying the attributes.

 
void AttributesMerge (MbAttributeContainer &other)
 Perform actions when merging the attributes.

 
void AttributesReplace (MbAttributeContainer &other)
 Perform actions when replacing the attributes.
 
void AttributesSplit (const std::vector< MbAttributeContainer * > &others)
 Perform actions when splitting the attributes.
 
void AttributesDelete ()
 Perform actions when deleting the attributes.
 
- Public Member Functions inherited from MbSyncItem
void Lock () const
 Switch lock on (locking happens only in parallel region).
 
void Unlock () const
 Switch lock off if locking has been set.
 

Protected Member Functions

 MbItem (const MbItem &, MbRegDuplicate *)
 Copy-constructor with duplication registrator.
 
void LockItem () const
 Catch object if multithreading mode is on.
 
void UnlockItem () const
 Release object if multithreading mode is on.
 
- Protected Member Functions inherited from MbSpaceItem
 MbSpaceItem ()
 Default constructor.
 
- Protected Member Functions inherited from MbRefItem
 MbRefItem ()
 Constructor without parameters.
 
- Protected Member Functions inherited from MbTransactions
 MbTransactions (const MbTransactions &, MbRegDuplicate *iReg)
 Copy-constructor with registrator.
 
- Protected Member Functions inherited from MbAttributeContainer
 MbAttributeContainer (const MbAttributeContainer &, MbRegDuplicate *)
 Copy-constructor with the registrator.
 

Additional Inherited Members

- Static Public Member Functions inherited from MbAttributeContainer
static MbUserAttributeReduceUserAttrib (const MbExternalAttribute &)
 Convert user attribute to "system" one.
 
static MbExternalAttributeAdvanceUserAttrib (const MbUserAttribute &)
 Convert "system" attribute to user one.
 

Detailed Description

A model geometric object.

Parent class of model geometric objects.
Inheritors are:
local coordinate system of MbAssistingItem,
MbPointFrame point-frame,
MbWireFrame wireframe,
MbSolid solid,
MbMesh polygonal planar object,
MbInstance instance of object in the local coordinate system,
MbAssembly assembly of objects in the local coordinate system,
MbSpaceInstance instance of three-dimensional object,
MbPlaneInstance instance of a two-dimensional object in the XY-plane of a local coordinate system.
Object contains MbTransactions sequence and ways to construct itself.
Object contains non-geometric properties as MbAttributeContainer attribute container.
The name of an object of a geometric model is represented as a container of simple names. In the beginning of the container there is a SimpleName simple name assigned to object by MbModel geometric model.
If the object doesn't contain other objects, then the container contains one SimpleName simple name. If the object contains other objects (MbAssembly or MbInstance), then the internal objects name is represented as a container with at least two simple names. Number of the elements of an object's name corresponds to the number of levels of objects inclusion relative to the model.

Member Function Documentation

◆ GetProperties()

void MbItem::GetProperties ( MbProperties properties)
overridevirtual

Outstanding properties of the object.

Issue internal data (properties) of the object for viewing and modification.

Parameters
[in]properties- Container for the internal data of the object.

Implements MbSpaceItem.

Reimplemented in MbSpaceInstance, MbWireFrame, MbSolid, MbPointFrame, and MbPlaneInstance.

◆ SetProperties()

void MbItem::SetProperties ( const MbProperties properties)
overridevirtual

Change the properties of an object.

Changing the internal data (properties) of the object you are copying the corresponding values from the sent object.

Parameters
[in]properties- Container for the internal data of the object.

Implements MbSpaceItem.

Reimplemented in MbSpaceInstance, MbWireFrame, MbSolid, MbPointFrame, and MbPlaneInstance.

◆ GetPlacement()

virtual bool MbItem::GetPlacement ( MbPlacement3D p) const
inlinevirtual

Get the coordinate system of an item if it is exist.

Returns
The function returns true, if the object have its own local coordinate system, otherwise it is considered that the object LCS is always "standard" (MbPlacement3D :: global).

Reimplemented in MbWireFrame, MbPlaneInstance, MbInstance, MbAssistingItem, and MbAssembly.


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