Version: 8.3.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
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 (SalomeApp_Study *theStudy, 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 comparsion. More...
 
bool operator!= (const GEOMGUI_DimensionProperty &theOther) const
 Overload comparsion. 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 (SalomeApp_Study *theStudy, const std::string &theEntry)
 Loads properties data from attribute "AttributeTableOfReal". More...
 
void SaveToAttribute (SalomeApp_Study *theStudy, 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

typedef QVector<QString> GEOMGUI_DimensionProperty::VectorOfNames
private
typedef QVector<bool> GEOMGUI_DimensionProperty::VectorOfVisibility
private

Member Enumeration Documentation

Enumerator
DimensionType_Length 
DimensionType_Diameter 
DimensionType_Angle 

Constructor & Destructor Documentation

GEOMGUI_DimensionProperty::GEOMGUI_DimensionProperty ( )
GEOMGUI_DimensionProperty::GEOMGUI_DimensionProperty ( const GEOMGUI_DimensionProperty theOther)
GEOMGUI_DimensionProperty::GEOMGUI_DimensionProperty ( SalomeApp_Study *  theStudy,
const std::string &  theEntry 
)

References LoadFromAttribute().

GEOMGUI_DimensionProperty::GEOMGUI_DimensionProperty ( const QString &  theProperty)
GEOMGUI_DimensionProperty::~GEOMGUI_DimensionProperty ( )

Member Function Documentation

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 anAngle, DimensionType_Angle, DimensionType_Diameter, DimensionType_Length, Handle(), myNames, myRecords, myVisibility, and TypeFromIO().

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

References myNames, myRecords, and myVisibility.

void GEOMGUI_DimensionProperty::Clear ( )

References myNames, myRecords, and myVisibility.

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

References myNames.

int GEOMGUI_DimensionProperty::GetNumber ( ) const

References myRecords.

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

References myRecords.

int GEOMGUI_DimensionProperty::GetType ( const int  theIndex) const

References myRecords.

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

References myVisibility.

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

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

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

References operator==().

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

References myNames, myRecords, and myVisibility.

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

References it(), myNames, myRecords, and myVisibility.

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.

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 anAngle, DimensionType_Angle, DimensionType_Diameter, DimensionType_Length, Handle(), myRecords, and TypeFromIO().

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.

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.

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

Member Data Documentation

VectorOfNames GEOMGUI_DimensionProperty::myNames
private
VectorOfRecords GEOMGUI_DimensionProperty::myRecords
private
VectorOfVisibility GEOMGUI_DimensionProperty::myVisibility
private

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