Attribute-style helper tool to manage shape annotation data of an object.
#include <GEOMGUI_AnnotationAttrs.h>
Classes | |
struct | Properties |
Public Member Functions | |
DEFINE_STANDARD_RTTIEXT (GEOMGUI_AnnotationAttrs, Standard_Transient) static Handle(GEOMGUI_AnnotationAttrs) FindAttributes(const _PTR(SObject)&theObject) | |
Find annotation data defined for an object. More... | |
QString | ExportAsPropertyString () const |
Exports annotation records as a property string. More... | |
void | ImportFromPropertyString (const QString &theString) |
Imports annotation records from a property string. More... | |
void | SetupPresentation (const Handle(GEOM_Annotation)&thePresentation, const int theIndex, const gp_Ax3 &theShapeLCS) |
Setup parameters of the annotation presentation with the properties of a definition. More... | |
void | SetNbAnnotation (const int theCount) const |
Changes count of annotation definitions stored on the object. More... | |
int | GetNbAnnotation () const |
Returns number of annotation definitions stored on the object. More... | |
void | SetIsVisible (const int theIndex, const bool theIsVisible) |
Sets application visibility state of an annotation definition. More... | |
bool | GetIsVisible (const int theIndex) const |
Returns applicationb visibility state of an annotaion definition. More... | |
void | SetText (const int theIndex, const QString &theText) |
Sets annotation label's text. More... | |
QString | GetText (const int theIndex) const |
Returns annotation label's text. More... | |
void | SetIsScreenFixed (const int theIndex, const bool theIsScreenFixed) |
Sets screen fixed flag of the annotation definition. More... | |
bool | GetIsScreenFixed (const int theIndex) const |
Returns screen fixed flag of the annotation definition. More... | |
void | SetPosition (const int theIndex, const gp_Pnt &thePosition) |
Sets position of the annotation definition. More... | |
gp_Pnt | GetPosition (const int theIndex) const |
Returns position of the annotation definition. More... | |
void | SetAttach (const int theIndex, const gp_Pnt &theAttach) |
Sets attach point of the annotation definition. More... | |
gp_Pnt | GetAttach (const int theIndex) const |
Returns attach point of the annotation definition. More... | |
void | SetShapeSel (const int theIndex, const int theShapeType, const int theSubIdx) |
Sets shape selection arguments. More... | |
void | GetShapeSel (const int theIndex, int &theShapeType, int &theSubIdx) const |
Returns shape selection arguments. More... | |
void | Append (const Properties &theProps) |
Appends new annotation definition with the given properties. More... | |
void | Append (const Properties &theProps, const gp_Ax3 &theShapeLCS) |
Appends new annotation definition with the given properties and converts position and attachment points to the given shape's local frame of reference. More... | |
void | Remove (const Standard_Integer theIndex) |
Removes annotation definition by the given index. More... | |
void | SetProperties (const int theIndex, const Properties &theProps) |
Sets complete properties of an annotation definition. More... | |
void | SetProperties (const int theIndex, const Properties &theProps, const gp_Ax3 &theShapeLCS) |
Sets complete properties of an annotation definition with converting position and attachment points to the given shape's local frame of reference. More... | |
void | GetProperties (const int theIndex, Properties &theProps) const |
Returns complete properties of an annotation definition. More... | |
Static Public Member Functions | |
static | Handle (GEOMGUI_AnnotationAttrs) FindOrCreateAttributes(const _PTR(SObject)&theObject |
Find or create annotation data fields for an object. More... | |
static void | Remove (const _PTR(SObject)&theObject) |
Remove annotation data fields for an object. More... | |
static void | SetupPresentation (const Handle(GEOM_Annotation)&thePresentation, const Properties &theProps, const gp_Ax3 &theShapeLCS) |
Setup parameters of the annotation presentation with the properties given. More... | |
Public Attributes | |
static SalomeApp_Study * | theStudy |
Private Member Functions | |
GEOMGUI_AnnotationAttrs (const _PTR(SObject)&theObject, const _PTR(AttributeParameter)&theParameter) | |
GEOMGUI_AnnotationAttrs (const GEOMGUI_AnnotationAttrs &theOther) | |
void | operator= (const GEOMGUI_AnnotationAttrs &theOther) |
_PTR (SObject) myObj | |
_PTR (AttributeParameter) myParameterMap | |
|
inlineprivate |
|
inlineprivate |
|
private |
|
private |
void GEOMGUI_AnnotationAttrs::Append | ( | const Properties & | theProps | ) |
void GEOMGUI_AnnotationAttrs::Append | ( | const Properties & | theProps, |
const gp_Ax3 & | theShapeLCS | ||
) |
theShapeLCS | [in] the position of shape's local frame of reference with respect to the world frame of reference. |
References GetNbAnnotation(), SetNbAnnotation(), and SetProperties().
GEOMGUI_AnnotationAttrs::DEFINE_STANDARD_RTTIEXT | ( | GEOMGUI_AnnotationAttrs | , |
Standard_Transient | |||
) | const |
QString GEOMGUI_AnnotationAttrs::ExportAsPropertyString | ( | ) | const |
References GEOMGUI_AnnotationAttrs::Properties::Attach, GetNbAnnotation(), GetProperties(), GEOMGUI_AnnotationAttrs::Properties::IsScreenFixed, GEOMGUI_AnnotationAttrs::Properties::Position, GEOMGUI_AnnotationAttrs::Properties::ShapeIndex, GEOMGUI_AnnotationAttrs::Properties::ShapeType, and GEOMGUI_AnnotationAttrs::Properties::Text.
gp_Pnt GEOMGUI_AnnotationAttrs::GetAttach | ( | const int | theIndex | ) | const |
bool GEOMGUI_AnnotationAttrs::GetIsScreenFixed | ( | const int | theIndex | ) | const |
bool GEOMGUI_AnnotationAttrs::GetIsVisible | ( | const int | theIndex | ) | const |
int GEOMGUI_AnnotationAttrs::GetNbAnnotation | ( | ) | const |
gp_Pnt GEOMGUI_AnnotationAttrs::GetPosition | ( | const int | theIndex | ) | const |
void GEOMGUI_AnnotationAttrs::GetProperties | ( | const int | theIndex, |
Properties & | theProps | ||
) | const |
theIndex | [in] the index of the annotation definition. |
theProps | [out] the structure containing the properties. |
References GEOMGUI_AnnotationAttrs::Properties::Attach, GetAttach(), GetIsScreenFixed(), GetIsVisible(), GetPosition(), GetShapeSel(), GetText(), GEOMGUI_AnnotationAttrs::Properties::IsScreenFixed, GEOMGUI_AnnotationAttrs::Properties::IsVisible, GEOMGUI_AnnotationAttrs::Properties::Position, GEOMGUI_AnnotationAttrs::Properties::ShapeIndex, GEOMGUI_AnnotationAttrs::Properties::ShapeType, and GEOMGUI_AnnotationAttrs::Properties::Text.
void GEOMGUI_AnnotationAttrs::GetShapeSel | ( | const int | theIndex, |
int & | theShapeType, | ||
int & | theSubIdx | ||
) | const |
theIndex | [in] the index of the annotation definition. |
theShapeType,theSubIdx | [out] the type of the selected shape and the sub-shape index. |
QString GEOMGUI_AnnotationAttrs::GetText | ( | const int | theIndex | ) | const |
|
static |
void GEOMGUI_AnnotationAttrs::ImportFromPropertyString | ( | const QString & | theString | ) |
References Append(), GEOMGUI_AnnotationAttrs::Properties::Attach, GEOMGUI_AnnotationAttrs::Properties::IsScreenFixed, GEOMGUI_AnnotationAttrs::Properties::IsVisible, GEOMGUI_AnnotationAttrs::Properties::Position, SetNbAnnotation(), GEOMGUI_AnnotationAttrs::Properties::ShapeIndex, GEOMGUI_AnnotationAttrs::Properties::ShapeType, and GEOMGUI_AnnotationAttrs::Properties::Text.
|
inlineprivate |
void GEOMGUI_AnnotationAttrs::Remove | ( | const Standard_Integer | theIndex | ) |
This methods performs iterative reindexing of elements starting from the given index, so sequential removal should be performed from the last element, or avoided at all.
References Append(), GetNbAnnotation(), GetProperties(), and SetNbAnnotation().
void GEOMGUI_AnnotationAttrs::SetAttach | ( | const int | theIndex, |
const gp_Pnt & | theAttach | ||
) |
theIndex | [in] the index of the annotation definition. |
theAttach | [in] the attach point of the annotation. |
void GEOMGUI_AnnotationAttrs::SetIsScreenFixed | ( | const int | theIndex, |
const bool | theIsScreenFixed | ||
) |
theIndex | [in] the index of the annotation definition. |
theIsScreenFixed | [in] the presentation flag. |
void GEOMGUI_AnnotationAttrs::SetIsVisible | ( | const int | theIndex, |
const bool | theIsVisible | ||
) |
theIndex | [in] the index of the annotation definition. |
theIsVisible | [in] the visibility state. |
void GEOMGUI_AnnotationAttrs::SetNbAnnotation | ( | const int | theCount | ) | const |
If the count is decreased the extra annotation definitions are cleared out from the attribute.
theNumber | [in] the new number of annotation definitions. |
References GetNbAnnotation().
void GEOMGUI_AnnotationAttrs::SetPosition | ( | const int | theIndex, |
const gp_Pnt & | thePosition | ||
) |
theIndex | [in] the index of the annotation definition. |
thePosition | [in] the position of the annotation label. |
void GEOMGUI_AnnotationAttrs::SetProperties | ( | const int | theIndex, |
const Properties & | theProps | ||
) |
theIndex | [in] the index of the annotation definition. |
theProps | [in] the structure containing the properties. |
void GEOMGUI_AnnotationAttrs::SetProperties | ( | const int | theIndex, |
const Properties & | theProps, | ||
const gp_Ax3 & | theShapeLCS | ||
) |
theIndex | [in] the index of the annotation definition. |
theProps | [in] the structure containing the properties. |
theShapeLCS | [in] the position of shape's local frame of reference with respect to the world frame of reference. |
References GEOMGUI_AnnotationAttrs::Properties::Attach, GEOMGUI_AnnotationAttrs::Properties::IsScreenFixed, GEOMGUI_AnnotationAttrs::Properties::IsVisible, GEOMGUI_AnnotationAttrs::Properties::Position, SetAttach(), SetIsScreenFixed(), SetIsVisible(), SetPosition(), SetShapeSel(), SetText(), GEOMGUI_AnnotationAttrs::Properties::ShapeIndex, GEOMGUI_AnnotationAttrs::Properties::ShapeType, and GEOMGUI_AnnotationAttrs::Properties::Text.
void GEOMGUI_AnnotationAttrs::SetShapeSel | ( | const int | theIndex, |
const int | theShapeType, | ||
const int | theSubIdx | ||
) |
theIndex | [in] the index of the annotation definition. |
theShapeType,theSubIdx | [in] the type of the selected shape and the sub-shape index. |
void GEOMGUI_AnnotationAttrs::SetText | ( | const int | theIndex, |
const QString & | theText | ||
) |
theIndex | [in] the index of the annotation definition. |
theText | [in] the text string. |
|
static |
thePresentation | [in] the presentation to setup. |
theProps | [in] the set of properties. |
theShapeLCS | [in] the local coordinate system of the shape. |
References aText, GEOMGUI_AnnotationAttrs::Properties::Attach, GEOMGUI_AnnotationAttrs::Properties::IsScreenFixed, GEOMGUI_AnnotationAttrs::Properties::Position, GEOM_Annotation::SetAttachPoint(), GEOM_Annotation::SetIsScreenFixed(), GEOM_Annotation::SetPosition(), GEOM_Annotation::SetText(), and GEOMGUI_AnnotationAttrs::Properties::Text.
void GEOMGUI_AnnotationAttrs::SetupPresentation | ( | const Handle(GEOM_Annotation)& | thePresentation, |
const int | theIndex, | ||
const gp_Ax3 & | theShapeLCS | ||
) |
thePresentation | [in] the presentation to setup. |
theIndex | [in] the index of the annotation definition. |
theShapeLCS | [in] the local coordinate system of the shape. |
References GetProperties(), and SetupPresentation().
SalomeApp_Study* GEOMGUI_AnnotationAttrs::theStudy |