Version: 9.12.0
GEOMGUI_DimensionProperty Class Reference

Utility class to unpack/pack dimension presentations as object property of study. More...

#include <GEOMGUI_DimensionProperty.h>

Classes

struct  Angle
 Declaration of properties for angle dimensions. More...
 
struct  Diameter
 Declaration of properties for diameter dimensions. More...
 
struct  Length
 Declaration of properties for length dimensions. More...
 
struct  Record
 

Public Types

enum  DimensionType { DimensionType_Length , DimensionType_Diameter , DimensionType_Angle }
 Type of packed presentation. More...
 
typedef QSharedPointer< RecordRecordPtr
 

Public Member Functions

 GEOMGUI_DimensionProperty ()
 Constructor. Inits empty property. More...
 
 GEOMGUI_DimensionProperty (const GEOMGUI_DimensionProperty &theOther)
 Copy constructor. More...
 
 GEOMGUI_DimensionProperty (const std::string &theEntry)
 Constructor. Inits property from attribute. More...
 
 GEOMGUI_DimensionProperty (const QString &theProperty)
 Constructor. Inits property from formatted QString. More...
 
 ~GEOMGUI_DimensionProperty ()
 Destructor. More...
 
 operator QVariant () const
 Overload QVariant cast operator. More...
 
 operator QString () const
 Overload QString cast operator. More...
 
bool operator== (const GEOMGUI_DimensionProperty &theOther) const
 Overload comparison. More...
 
bool operator!= (const GEOMGUI_DimensionProperty &theOther) const
 Overload comparison. More...
 
int GetNumber () const
 Returns number of dimension records. More...
 
void AddRecord (const Handle(AIS_Dimension)&theIO, const gp_Ax3 &theLCS)
 Adds new record for the passed interactive object. Convenience method. More...
 
void AddRecord (const RecordPtr &theRecord)
 Adds new dimension record. More...
 
void SetRecord (const int theIndex, const Handle(AIS_Dimension)&theIO, const gp_Ax3 &theLCS)
 Update dimension record data. More...
 
void SetRecord (const int theIndex, const RecordPtr &theRecord)
 Update dimension record data. More...
 
const RecordPtrGetRecord (const int theIndex) const
 Access record by index. More...
 
void RemoveRecord (const int theIndex)
 Removes record by its index. More...
 
void Clear ()
 Clears property data. More...
 
bool IsVisible (const int theIndex) const
 Returns visibility state of dimension record by its index. More...
 
void SetVisible (const int theIndex, const bool theIsVisible)
 Changes visibility state of the dimension record. More...
 
QString GetName (const int theIndex) const
 Returns name of dimension record by its index. More...
 
void SetName (const int theIndex, const QString &theName)
 Changes name of dimension record. More...
 
int GetType (const int theIndex) const
 Returns dimension type. More...
 
void LoadFromAttribute (const std::string &theEntry)
 Loads properties data from attribute "AttributeTableOfReal". More...
 
void SaveToAttribute (const std::string &theEntry)
 Saves properties data to attribute "AttributeTableOfReal". More...
 

Private Types

typedef QVector< bool > VectorOfVisibility
 
typedef QVector< QString > VectorOfNames
 
typedef QVector< RecordPtrVectorOfRecords
 

Private Member Functions

int TypeFromIO (const Handle(AIS_Dimension)&theIO) const
 Determines dimension type code. More...
 

Private Attributes

VectorOfVisibility myVisibility
 
VectorOfNames myNames
 
VectorOfRecords myRecords
 

Detailed Description

Dimension presentations are store in relative coordinate system (LCS). To ensure that dimension is bound to the equal shape irrespectively of its location transformation.

The record is a list of qvariant, containing packed dimension properties and its attributes: (name);(is_visible);(dimension type);(dimension property list);

The following packing scheme is used to store dimension data: Length: (plane)[0-3] (flyout)[4] (text flags)[5-6] (arrow flag)[7] (p1)[8-10] (pnt2)[11-13] Diam: (plane)[0-3] (flyout)[4] (text flags)[5-6] (arrow flag)[7] (circle loc, xdir, ydir, rad)[8-17] Angle: (flyout)[0] (text flags)[1-2] (arrow flag)[3] (p1)[4-6] (p2)[7-9] (center)[10-12]

Member Typedef Documentation

◆ RecordPtr

◆ VectorOfNames

typedef QVector<QString> GEOMGUI_DimensionProperty::VectorOfNames
private

◆ VectorOfRecords

◆ VectorOfVisibility

typedef QVector<bool> GEOMGUI_DimensionProperty::VectorOfVisibility
private

Member Enumeration Documentation

◆ DimensionType

Enumerator
DimensionType_Length 
DimensionType_Diameter 
DimensionType_Angle 

Constructor & Destructor Documentation

◆ GEOMGUI_DimensionProperty() [1/4]

GEOMGUI_DimensionProperty::GEOMGUI_DimensionProperty ( )

◆ GEOMGUI_DimensionProperty() [2/4]

GEOMGUI_DimensionProperty::GEOMGUI_DimensionProperty ( const GEOMGUI_DimensionProperty theOther)

◆ GEOMGUI_DimensionProperty() [3/4]

GEOMGUI_DimensionProperty::GEOMGUI_DimensionProperty ( const std::string &  theEntry)

References LoadFromAttribute().

◆ GEOMGUI_DimensionProperty() [4/4]

GEOMGUI_DimensionProperty::GEOMGUI_DimensionProperty ( const QString &  theProperty)

◆ ~GEOMGUI_DimensionProperty()

GEOMGUI_DimensionProperty::~GEOMGUI_DimensionProperty ( )

Member Function Documentation

◆ AddRecord() [1/2]

void GEOMGUI_DimensionProperty::AddRecord ( const Handle(AIS_Dimension)&  theIO,
const gp_Ax3 &  theLCS 
)
Parameters
theIO[in] the interactive dimension to append as new record.
theLCS[in] the local coordinate system of parent object.

References DimensionType_Angle, DimensionType_Diameter, DimensionType_Length, Handle(), myNames, myRecords, myVisibility, and TypeFromIO().

◆ AddRecord() [2/2]

void GEOMGUI_DimensionProperty::AddRecord ( const RecordPtr theRecord)
Parameters
theRecord[in] the record to add.

References myNames, myRecords, and myVisibility.

◆ Clear()

void GEOMGUI_DimensionProperty::Clear ( )

References myNames, myRecords, and myVisibility.

◆ GetName()

QString GEOMGUI_DimensionProperty::GetName ( const int  theIndex) const
Parameters
theIndex[in] the index of the dimension record.

References myNames.

◆ GetNumber()

int GEOMGUI_DimensionProperty::GetNumber ( ) const

References myRecords.

◆ GetRecord()

const GEOMGUI_DimensionProperty::RecordPtr & GEOMGUI_DimensionProperty::GetRecord ( const int  theIndex) const
Parameters
theIndex[in] the index of the dimension record.

References myRecords.

◆ GetType()

int GEOMGUI_DimensionProperty::GetType ( const int  theIndex) const

References myRecords.

◆ IsVisible()

bool GEOMGUI_DimensionProperty::IsVisible ( const int  theIndex) const
Parameters
theIndex[in] the index of the dimension record.

References myVisibility.

◆ LoadFromAttribute()

void GEOMGUI_DimensionProperty::LoadFromAttribute ( const std::string &  theEntry)
Parameters
theEntry[in] the entry of GEOM object to operate with.

References Clear(), DimensionType_Angle, DimensionType_Diameter, DimensionType_Length, myNames, myRecords, and myVisibility.

◆ operator QString()

GEOMGUI_DimensionProperty::operator QString ( ) const

◆ operator QVariant()

GEOMGUI_DimensionProperty::operator QVariant ( ) const

◆ operator!=()

bool GEOMGUI_DimensionProperty::operator!= ( const GEOMGUI_DimensionProperty theOther) const
inline

◆ operator==()

bool GEOMGUI_DimensionProperty::operator== ( const GEOMGUI_DimensionProperty theOther) const

◆ RemoveRecord()

void GEOMGUI_DimensionProperty::RemoveRecord ( const int  theIndex)
Parameters
theIndex[in] the index of dimension record.

References myNames, myRecords, and myVisibility.

◆ SaveToAttribute()

void GEOMGUI_DimensionProperty::SaveToAttribute ( const std::string &  theEntry)
Parameters
theEntry[in] the entry of GEOM object to operate with.

References myNames, myRecords, and myVisibility.

◆ SetName()

void GEOMGUI_DimensionProperty::SetName ( const int  theIndex,
const QString &  theName 
)
Parameters
theIndex[in] the index of the dimension record.
theName[in] the new name.

References myNames.

◆ SetRecord() [1/2]

void GEOMGUI_DimensionProperty::SetRecord ( const int  theIndex,
const Handle(AIS_Dimension)&  theIO,
const gp_Ax3 &  theLCS 
)
Parameters
theIndex[in] the index of the record.
theIO[in] the interactive dimension to update properties.
theLCS[in] the local coordinate system of parent object.

References DimensionType_Angle, DimensionType_Diameter, DimensionType_Length, Handle(), myRecords, and TypeFromIO().

◆ SetRecord() [2/2]

void GEOMGUI_DimensionProperty::SetRecord ( const int  theIndex,
const RecordPtr theRecord 
)
Parameters
theIndex[in] the index of the dimension record.
theRecord[in] the record to replace with.

References myRecords.

◆ SetVisible()

void GEOMGUI_DimensionProperty::SetVisible ( const int  theIndex,
const bool  theIsVisible 
)
Parameters
theIndex[in] the index of the dimension record.
theIsVisible[in] the new visibility state.

References myVisibility.

◆ TypeFromIO()

int GEOMGUI_DimensionProperty::TypeFromIO ( const Handle(AIS_Dimension)&  theIO) const
private

Member Data Documentation

◆ myNames

VectorOfNames GEOMGUI_DimensionProperty::myNames
private

◆ myRecords

VectorOfRecords GEOMGUI_DimensionProperty::myRecords
private

◆ myVisibility

VectorOfVisibility GEOMGUI_DimensionProperty::myVisibility
private

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