C3D Toolkit  Kernel - 117982, Vision - 2.9.2.2

Geometric model. More...

#include <model_entity.h>

+ Inheritance diagram for MbModel:
+ Collaboration diagram for MbModel:

Classes

class  ItemConstIterator
 Constant iterator on objects of the model. More...
 
class  ItemIterator
 Simple iterator on objects of model. More...
 

Public Member Functions

 MbModel (SimpleName n=0)
 Constructor by object's name.
 
virtual ~MbModel ()
 Destructor.
 
SimpleName GetModelName () const
 Get name of a model.
 
void SetModelName (SimpleName n)
 Set name of a model.
 
MbItemAddItem (MbItem &item, SimpleName n=c3d::UNDEFINED_SNAME)
 Add object to the model. More...
 
bool AddModel (const MbModel &)
 Add item objects of to the model.
 
bool ReplaceItem (const MbItem &item, MbItem &newItem, bool saveName=false)
 Replace the object. More...
 
template<class Items >
void GetItems (Items &) const
 Get all the objects.

 
bool DetachItem (MbItem *, bool resetName=true)
 Detach an object if it is in the model.
 
template<class Items >
void DetachItems (Items &)
 Detach all the objects.
 
bool DeleteItem (MbItem *, bool resetName=true)
 Delete an object if it is in the model.
 
void DeleteItems ()
 Delete all the model objects.
 
bool DecomposeAssemblies ()
 Decompose assemblies with subassemblies into components.
 
bool FillMeshModel (const MbStepData &stepData, const MbFormNote &note, MbModel &meshModel) const
 Fill the given model with polygonal copies of the model objects. More...
 
bool AddYourMesh (const MbStepData &stepData, const MbFormNote &note, MbMesh &mesh) const
 Add polygonal object. More...
 
MbModelCutMeshModel (const MbPlacement3D &cutPlace, double distance, const MbSNameMaker *names=nullptr) const
 Cut model of polygonal objects by one or two parallel planes. More...
 
bool NearestMesh (MbeSpaceType sType, MbeTopologyType tType, MbePlaneType pType, const MbAxis3D &axis, double maxDistance, bool gridPriority, 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 void GetItems (MbeSpaceType type, std::vector< SPtr< MbItem >> &items, std::vector< MbMatrix3D > &matrs)
 Get all objects by the type. More...
 
virtual void GetItems (MbeSpaceType type, RPArray< MbItem > &items, SArray< MbMatrix3D > &matrs)
 Get all objects by type. More...
 
virtual void GetItems (MbeSpaceType type, RPArray< const MbItem > &items, SArray< MbMatrix3D > &matrs) const
 Get all objects by type. More...
 
virtual void GetUniqItems (MbeSpaceType type, CSSArray< const MbItem * > &items) const
 Get all unique objects by type. More...
 
bool MakePath (const MbItem &obj, MbPath &path, MbMatrix3D &from) const
 Create path of object's position. More...
 
const MbItemGetItemByPath (const MbPath &path, MbMatrix3D &from) const
 Get the object by its path. More...
 
const MbItemFindItem (const MbSpaceItem *s, MbPath &path, MbMatrix3D &from) const
 Find object by geometric object. More...
 
const MbItemFindItem (const MbPlaneItem *s, MbPath &path, MbMatrix3D &from) const
 Find object by geometric object. More...
 
const MbItemFindItem (const MbItem *s, MbPath &path, MbMatrix3D &from) const
 Find object by object of geometric model. More...
 
const MbItemGetItemByName (SimpleName n, MbPath &path, MbMatrix3D &from) const
 Find object by name. More...
 
MbItemSetItemByName (SimpleName n, MbPath &path, MbMatrix3D &from)
 Find object by name for editing. More...
 
void Traverse (ItModelVisitor &) const
 General-purpose algorithm traversing the model graph in depth.
 
void TransformSelected (const MbMatrix3D &, MbRegTransform *=nullptr)
 Transform selected objects by matrix.
 
void MoveSelected (const MbVector3D &, MbRegTransform *=nullptr)
 Move selected objects.
 
void RotateSelected (const MbAxis3D &, double angle, MbRegTransform *=nullptr)
 Rotate selected objects around an axis.
 
void DetachSelected (RPArray< MbItem > &, SArray< MbMatrix3D > &, bool selected, bool resetName=true)
 Detach all selected objects. More...
 
void DetachInvisible (RPArray< MbItem > &, SArray< MbMatrix3D > &, bool invisible, bool resetName=true)
 Detach all visible or invisible objects.
 
size_t ItemsCount () const
 Get the count of objects of model.
 
bool ContainsItem (const MbItem *) const
 Whether the object is contained in model.
 
bool AddModelItems (const MbModel &)
 Add objects of other model to the model.

 
size_t GetSelected (RPArray< MbItem > &) const
 Add selected objects of model to array without search in complex composite objects.
 
void CalculateGabarit (MbCube &) const
 Calculate bounding box for all the objects of model.
 
ItemConstIterator CBegin () const
 Get constant iterator on all objects pointing to the first element.

 
ItemConstIterator CEnd () const
 Get constant iterator on all objects pointing to the past-the-end element.

 
ItemConstIterator CBegin (SimpleName n) const
 Get constant iterator by the given name pointing to the first element.

 
ItemConstIterator CEnd (SimpleName n) const
 Get constant iterator by the given name pointing to the past-the-end element.

 
ItemIterator Begin ()
 Get non-constant iterator on all the objects pointing to the first element.

 
ItemIterator End ()
 Get non-constant iterator on all the objects pointing to the past-the-end element.

 
ItemIterator Begin (SimpleName n)
 Get non-constant iterator by the given name pointing to the first element.

 
ItemIterator End (SimpleName n)
 Get non-constant iterator by the given name pointing to the past-the-end element.

 
Common functions of a geometric object
MbeImplicationType ImplicationType () const override
 Type of an attribute container is a classifier of inheritors.
 
MbModelDuplicate (MbRegDuplicate *=nullptr) const
 Create a copy.
 
void Transform (const MbMatrix3D &, MbRegTransform *iReg=nullptr)
 Transform according to the matrix.

 
void Move (const MbVector3D &, MbRegTransform *iReg=nullptr)
 Translate along a vector.
 
void Rotate (const MbAxis3D &, double angle, MbRegTransform *iReg=nullptr)
 Rotate about an axis.
 
double DistanceToPoint (const MbCartPoint3D &) const
 Calculate the distance to a point.
 
void AddYourGabaritTo (MbCube &) const
 Include your own bounding box into bounding box.
 
MbPropertyCreateProperty (MbePrompt) const
 Create your own property with specified name.
 
void GetProperties (MbProperties &)
 Get properties of the object.
 
void SetProperties (const MbProperties &)
 Set properties of the object.
 
- 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.
 
- Public Member Functions inherited from MbRefItem
virtual MbeRefType RefType () const
 Registration type (for copying, duplication).
 
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.
 
virtual bool RebuildItem (MbeCopyMode sameShell, RPArray< MbSpaceItem > *items, IProgressIndicator *progInd)
 Reconstruct object according to the history tree.
 
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.
 

Protected Member Functions

 MbModel (const MbModel &, MbRegDuplicate *)
 Copy-constructor with the registrator.
 
- 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

Geometric model.

Geometric model is a container of geometric objects.
The model consists of arrays of pointers to geometric model objects MbItem. The model can contain MbAssistingItem assisting items, MbPointFrame points, MbWireFrame frames, MbSolid solids, polygonal objects MbMesh, MbSpaceInstance and MbPlaneInstance objects.
Model is used to describe geometric properties of real and imaginary objects, to visualize modeled objects, to calculate geometric properties of modeled objects.
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 which coincides with the first field std::multimap of the 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

◆ AddItem()

MbItem* MbModel::AddItem ( MbItem item,
SimpleName  n = c3d::UNDEFINED_SNAME 
)

Add object to the model.

Add object to the model with a given name.

Parameters
[in]item- A model object.
[in]n- A name of an object. If a given name is equal to zero, then the model names an object with its unique name.
Returns
Added object.

◆ ReplaceItem()

bool MbModel::ReplaceItem ( const MbItem item,
MbItem newItem,
bool  saveName = false 
)

Replace the object.

Replace the object by a new one.

Parameters
[in]item- An object to replace.
[in]newItem- A new object.
Returns
Returns true if the replacement has been done.

◆ FillMeshModel()

bool MbModel::FillMeshModel ( const MbStepData stepData,
const MbFormNote note,
MbModel meshModel 
) const

Fill the given model with polygonal copies of the model objects.

Fill the given model with polygonal copies of the original model objects. Given model is being cleared and filled with polygonal copies of objects of the original model. Given model is to be filled similarly to original model, but instead of solids, wire-frames, point-frames and other finite objects of model the given model is filled by the corresponding polygonal copies of objects (MbMesh). Assemblies and instances in the given model remains similar to the original model. Given model can be used for calculations and visualization of the model.

Note
In multithreaded mode runs in parallel.
Parameters
[in]stepData- Data for step calculation during triangulation.
[in]note- Way for polygonal object constructing.
[out]meshModel- Given model to be filled.
Returns
If there were no errors during construction, then true, otherwise false.

◆ AddYourMesh()

bool MbModel::AddYourMesh ( const MbStepData stepData,
const MbFormNote note,
MbMesh mesh 
) const

Add polygonal object.

Add polygonal copy of the model to the given polygonal object (MbMesh). All the objects, assemblies and instances of the model are placed in a unified planar polygonal object. The same object inserted several times in assemblies and instances of the model gets several copies because each copy is transformed by the matrix of local coordinate system of the corresponding assembly and instance.

Parameters
[in]stepData- Data for step calculation during triangulation.
[in]note- Way for polygonal object constructing.
[out]mesh- Given polygonal object.
Returns
Whether the object is added.

◆ CutMeshModel()

MbModel* MbModel::CutMeshModel ( const MbPlacement3D cutPlace,
double  distance,
const MbSNameMaker names = nullptr 
) const

Cut model of polygonal objects by one or two parallel planes.

Create new model of polygonal objects and fill it by the source model parts lying under XY plane of the local coordinate system at the given distance.
Function "cuts" only MbMesh model of polygonal objects. Function "cuts" the model by two planes: XY plane of 'place' local coordinate system and plane parallel to it and located at 'distance' distance below it. If 'distance' is less than or equal to zero, then the function "cuts" an object only by one XY plane of local coordinate system.
Contents of the source polygonal objects that are necessary for creation of cut object and not affected by cutting planes are added to returned cut object without copying.

Parameters
[in]place- A local coordinate system which XY plane defines a cutting plane.
[in]distance- Distance to a parallel cutting plane is measured in negative direction of Z-axis of local coordinate system.
[in]names- An object defining names generation in the operation.
Returns
Returns a new model of polygonal objects that lies under XY plane of local coordinate system at given distance.

◆ NearestMesh()

bool MbModel::NearestMesh ( MbeSpaceType  sType,
MbeTopologyType  tType,
MbePlaneType  pType,
const MbAxis3D axis,
double  maxDistance,
bool  gridPriority,
MbItem *&  find,
SimpleName findName,
MbRefItem *&  element,
SimpleName elementName,
MbPath path,
MbMatrix3D from 
) const

Find the nearest object or name of the nearest object.

Find the nearest three-dimensional object or its name by type of object and component of the required object or its name by topological or two-dimensional type of the element (on demand) at distance from line less than or equal to the given value. Function is intended for identification of a geometric object which is begetter of a polygonal object. The real search is performed for MbMesh polygonal object's MbPrimitive elements from which the information is taken about geometric object which is begetter of the primitive.

Note
In multithreaded mode runs in parallel.
Parameters
[in]sType- Type of required object.
[in]tType- Topological type of the required object's component.
[in]pType- Two-dimensional type of the required object's component.
[in]axis- Line of search.
[in]maxDistance- Distance from the line on which the object is looked for.
[in]gridPriority- Increased priority triangulation grid when searching.
[out]find- Found object.
[out]findName- Name of the found object.
[out]element- Found component of the object.
[out]elementName- Name of found component of the object.
[out]path- Path to the object in model.
[out]from- Transformation matrix of the found object to the global coordinate system.
Returns
Whether the object or its name is found.

◆ MakePath()

bool MbModel::MakePath ( const MbItem obj,
MbPath path,
MbMatrix3D from 
) const

Create path of object's position.

Create path of object's position in the model and get transformation matrix of the object to the global coordinate system. Object can be contained in other object (in assembly or in instance).

Parameters
[in]obj- Object.
[out]path- Path to the object in model.
[out]from- Transformation matrix of object to the global coordinate system.
Returns
Whether the path and the matrix of object are found.

◆ GetItemByPath()

const MbItem* MbModel::GetItemByPath ( const MbPath path,
MbMatrix3D from 
) const

Get the object by its path.

Get the object by path of its position in the model and get transformation matrix of the object to the global coordinate system. Object can be contained in other object (in assembly or in instance).

Parameters
[in]path- Path to object in the model.
[out]from- Transformation matrix of object to the global coordinate system.
Returns
Whether the path and the matrix of object are found.

◆ FindItem() [1/3]

const MbItem* MbModel::FindItem ( const MbSpaceItem s,
MbPath path,
MbMatrix3D from 
) const

Find object by geometric object.

Find object by geometric object and also get the path to the object in model and get transformation matrix to the global coordinate system.

Parameters
[in]s- Geometric object.
[out]path- Path to object in the model.
[out]from- Transformation matrix of object to the global coordinate system.
Returns
Whether the path and the matrix of object are found.

◆ FindItem() [2/3]

const MbItem* MbModel::FindItem ( const MbPlaneItem s,
MbPath path,
MbMatrix3D from 
) const

Find object by geometric object.

Find object by geometric object and also get the path to the object in model and get transformation matrix to the global coordinate system.

Parameters
[in]s- Geometric object.
[out]path- Path to object in the model.
[out]from- Transformation matrix of object to the global coordinate system.
Returns
Whether the path and the matrix of object are found.

◆ FindItem() [3/3]

const MbItem* MbModel::FindItem ( const MbItem s,
MbPath path,
MbMatrix3D from 
) const

Find object by object of geometric model.

Find object by object of geometric model and also get the path to the object in model and get transformation matrix to the global coordinate system.

Parameters
[in]s- Geometric object.
[out]path- Path to object in the model.
[out]from- Transformation matrix of object to the global coordinate system.
Returns
Whether the path and the matrix of object are found.

◆ GetItemByName()

const MbItem* MbModel::GetItemByName ( SimpleName  n,
MbPath path,
MbMatrix3D from 
) const

Find object by name.

Find object by name and also get path to object in model and get transformation matrix to the global coordinate system.

Parameters
[in]n- A name of an object.
[out]path- Path to object in the model.
[out]from- Transformation matrix of object to the global coordinate system.
Returns
Whether the path and the matrix of object are found.

◆ SetItemByName()

MbItem* MbModel::SetItemByName ( SimpleName  n,
MbPath path,
MbMatrix3D from 
)

Find object by name for editing.

Find object by name for editing and also get path to object in model and get transformation matrix to the global coordinate system.

Parameters
[in]n- A name of an object.
[out]path- Path to object in the model.
[out]from- Transformation matrix of object to the global coordinate system.
Returns
Whether the path and the matrix of object are found.

◆ DetachSelected()

void MbModel::DetachSelected ( RPArray< MbItem > &  ,
SArray< MbMatrix3D > &  ,
bool  selected,
bool  resetName = true 
)

Detach all selected objects.

Detach all selected objects of model including ones contained in complex composite objects such as assembly.

Parameters
[out]items- Detach the objects.
[out]matrs- Transformation matrices of detached objects to global coordinate system.

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