C3D Toolkit  Kernel - 117982, Vision - 2.9.2.2

A name of an object. More...

#include <name_item.h>

+ Collaboration diagram for MbName:

Public Types

enum  EIndexes {
  i_Main , i_First , i_Cut , i_Copy ,
  i_Extra , i_PseudoCopy = -1
}
 A name index. More...
 
enum  BaseNameIndex { bni_Main , bni_First , bni_Cut , bni_Total }
 Main index of name. More...
 
enum  ExtraNameIndex { eni_Copy , eni_Extra , eni_Total }
 Additional index of name. More...
 
enum  ReservedMainNames {
  rmn_EmergencyName = -5 , rmn_DummyFaceName = -4 , rmn_ReservedName = -3 , rmn_SectionItemName = -2 ,
  rmn_DefaultName = -1
}
 Reserved main names. More...
 

Public Member Functions

 MbName ()
 Default constructor.
 
 MbName (const MbName &other)
 Copy-constructor. More...
 
virtual ~MbName ()
 Destructor.
 
SimpleName GetMainName () const
 Get main name.
 
bool SetMainName (SimpleName mn)
 Set main name. More...
 
void SetName (const MbName &n, bool setFlags=true)
 Set name. More...
 
bool IsEmpty () const
 Whether the array of name identifiers is empty. More...
 
size_t CountAll () const
 Get the number of elements in array.
 
size_t CountBase () const
 Get the number of array elements in base part.
 
void AddNamesBase (SimpleNameArray &to) const
 Extract names into array.
 
SimpleName GetNameBase (size_t i) const
 Get or generate the main name.
 
SimpleName GetNameExtra (size_t i) const
 Get or generate the additional name.
 
bool IsCutIndex () const
 Get an index of a cutaway.
 
bool GetCutIndex (SimpleName &cutIndex) const
 Get an cut index. More...
 
void SetCutIndex (SimpleName cutIndex)
 Set an cut index. More...
 
bool RemoveCutIndex ()
 Delete an index of cutaway.
 
SimpleName GetFirstName () const
 Get first name.
 
SimpleName GetFirstNameDirect () const
 Direct access to the first name.
 
void SetFirstNameDirect (SimpleName fi)
 Direct access to the first name.
 
bool IsCutFlag () const
 Get flag of cutaway.
 
void SetCutFlag (bool s=true)
 Set flag of cutaway.
 
void SetSheet (bool s)
 Set flag of sheet primitive.
 
void SetInnerBend (bool s)
 Set flag of internal part of bend.
 
void SetOuterBend (bool s)
 Set flag of external part of bend.
 
void SetSideBend (bool s)
 Set flag of side part of bend.
 
void SetStampRibBend (bool s)
 Set flag of reinforcement rib part of sheet solid.
 
void SetSweptFlange (bool s)
 Set flag of a swept flange.
 
bool IsSheet () const
 Get flag of sheet primitive.
 
bool IsInnerBend () const
 Get flag of internal part of bend.
 
bool IsOuterBend () const
 Get flag of external part of bend.
 
bool IsSideBend () const
 Get flag of side part of bend.
 
bool IsStampRibBend () const
 Get flag of reinforcement rib part of sheet solid.
 
bool IsSweptFlange () const
 Get flag of a swept flange.
 
void SetCopyIndex (SimpleName ci)
 Set an index of copying.
 
bool GetCopyIndex (SimpleName &ci) const
 Get an index of copying.
 
bool SetCopyPosition (size_t row, size_t col)
 Set a position in grid of copying. More...
 
bool GetCopyPosition (ptrdiff_t &row, ptrdiff_t &col)
 Get position in grid of copying. More...
 
bool IsCopied () const
 Whether the indices of copying can be obtained.

 
SimpleName GetCopySourceName () const
 Get the main name of source for copying, to be called only after check by IsCopied();.
 
void GetCopyIndices (SArray< SimpleName > &indexes, size_t &count) const
 Get array of copying indices. More...
 
SimpleName Hash () const
 Calculate hash of itself.
 
bool operator== (const MbName &) const
 An equality operator.
 
bool operator< (const MbName &) const
 Comparison operator.
 
bool operator!= (const MbName &n) const
 Inequality operator.
 
void GetProperties (MbProperties &)
 Get properties of the object.
 
void SetProperties (const MbProperties &)
 Set properties of the object.
 
void ToString (c3d::string_t &strName) const
 Convert name to string.
 
void FromString (const c3d::string_t &strName)
 Convert name from string.
 
size_t SizeOf () const
 Size in memory.
 
void operator= (const MbName &other)
 An assignment operator.
 
void Assign (const MbName &other)
 Assignment function (without copying of flags).
 
void MakeTemplate ()
 Create template from name.
 

Static Public Member Functions

static UniqueNamePtr UniqueFaceName ()
 Unique name of dummy face.
 

Static Public Attributes

static const UniqueNamePtr uniqueFaceName
 Unique name of dummy face.
 

Protected Types

enum  EFlags {
  f_Cut = 0x01 , f_Sheet = 0x02 , f_InnerBend = 0x04 , f_OuterBend = 0x08 ,
  f_SideBend = 0x10 , f_RibBend = 0x20 , f_SweptFlange = 0x40
}
 Flags. More...
 

Protected Attributes

MbIdArr defNames
 An array of identifiers.
 

Friends

class MbNameMaker
 
class MbSNameMaker
 
int MbDefNameCompare (const MbName &n1, const MbName &n2)
 Name comparison function. More...
 
int MbMemDefNameCompare (const MbName &n1, const MbName &n2)
 Name comparison function. More...
 

Detailed Description

A name of an object.

A name of a topological object (automatically generated attribute).
Do not use the main names from the range MbName::ReservedMainNames (exception - MbName::ReservedMainNames::rmn_DefaultName).

Member Enumeration Documentation

◆ EIndexes

A name index.

Enumerator
i_Main 

Main name index.

i_First 

Index of unique name which includes hash constructed by strict rules.

i_Cut 

Index of index of cutaway.

i_Copy 

Index of index of copying.

i_Extra 

Index of previous hash of copying.

i_PseudoCopy 

Index of pseudo copying.

◆ BaseNameIndex

Main index of name.

Enumerator
bni_Main 

Main name index.

bni_First 

Index of unique name which includes hash constructed by strict rules.

bni_Cut 

Index of index of cutaway (can indicate to cutaway).

bni_Total 

Maximum size of base part of name.

◆ ExtraNameIndex

Additional index of name.

Enumerator
eni_Copy 

Index of index of copying.

eni_Extra 

Index of previous hash of copying.

eni_Total 

Periodicity of structure of indices.

◆ ReservedMainNames

Reserved main names.

Enumerator
rmn_EmergencyName 

Emergency name for replacing.

rmn_DummyFaceName 

Default name of dummy face.

rmn_ReservedName 

Reserved name.

rmn_SectionItemName 

Section item name.

rmn_DefaultName 

Default name (= c3d::SIMPLENAME_MAX).

◆ EFlags

enum MbName::EFlags
protected

Flags.

Enumerator
f_Cut 

Primitive is cut.

f_Sheet 

Primitive is sheet. (Valid only for faces)

f_InnerBend 

Primitive is an internal face of bend. (Valid only for faces) //-V112.

f_OuterBend 

Primitive is an external face of bend. (Valid only for faces)

f_SideBend 

Primitive is a side face of bend. (Valid only for faces)

f_RibBend 

Primitive is a face of reinforcement rib of sheet solid. (Valid only for faces)

f_SweptFlange 

Primitive is a face of a swept flange. (Valid only for faces)

Constructor & Destructor Documentation

◆ MbName()

MbName::MbName ( const MbName other)
inline

Copy-constructor.

Copy-constructor.

Copy-constructor.

Parameters
[in]other- Other name.

Member Function Documentation

◆ SetMainName()

bool MbName::SetMainName ( SimpleName  mn)
inline

Set main name.

Set main name.

Parameters
[in]mn- Main name.
Returns
Returns 'true' in case of successful execution.

◆ SetName()

void MbName::SetName ( const MbName n,
bool  setFlags = true 
)

Set name.

Set other name.

Parameters
[in]n- Name.
[in]setFlags- Copy name flags.

◆ IsEmpty()

bool MbName::IsEmpty ( ) const
inline

Whether the array of name identifiers is empty.

Clear array of name identifiers.

◆ GetCutIndex()

bool MbName::GetCutIndex ( SimpleName cutIndex) const
inline

Get an cut index.

Get an index of a cutaway.

Parameters
[out]cutIndex- Cut index.
Returns
Returns 'true' in case of successful execution.

◆ SetCutIndex()

void MbName::SetCutIndex ( SimpleName  cutIndex)

Set an cut index.

Set an index of a cutaway.

Parameters
[in]cutIndex- Cut index. Set an index of cutaway.

◆ SetCopyPosition()

bool MbName::SetCopyPosition ( size_t  row,
size_t  col 
)

Set a position in grid of copying.

Set a copy position in the copy grid when the object is reproduced on a rectangular or concentric grid.

Parameters
[in]row- Index of row.
[in]col- Index of column.
Returns
true, if the copy position was set, otherwise false.

◆ GetCopyPosition()

bool MbName::GetCopyPosition ( ptrdiff_t &  row,
ptrdiff_t &  col 
)

Get position in grid of copying.

Get a copy position in the copy grid when the object is reproduced on a rectangular or concentric grid.

Parameters
[out]row- Index of row.
[out]col- Index of column.
Returns
true, if the copy position was find, otherwise false.

◆ GetCopyIndices()

void MbName::GetCopyIndices ( SArray< SimpleName > &  indexes,
size_t &  count 
) const

Get array of copying indices.

Get the given count of copying indices in reverse order. If requested more than exist, then nothing will be returned.

Parameters
[out]indexes- Array of copying indices.
[in,out]count- Count of the requested indices [in], count of the obtained indices [out].

Friends And Related Function Documentation

◆ MbDefNameCompare

int MbDefNameCompare ( const MbName n1,
const MbName n2 
)
friend

Name comparison function.

Name comparison function for work with sorted structures.

◆ MbMemDefNameCompare

int MbMemDefNameCompare ( const MbName n1,
const MbName n2 
)
friend

Name comparison function.

Name comparison function returns:
-1, if n1 < n2;
0, if n1 == n2;
+1, if n1 > n2;


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