27 #ifndef GEOMGUI_DIMENSIONPROPERTY_H
28 #define GEOMGUI_DIMENSIONPROPERTY_H
30 #include <Basics_OCCTVersion.hxx>
33 #include <AIS_Dimension.hxx>
34 #include <AIS_DiameterDimension.hxx>
35 #if OCC_VERSION_LARGE >= 0x070400ff
36 #include <PrsDim_LengthDimension.hxx>
38 #include <AIS_LengthDimension.hxx>
40 #include <AIS_AngleDimension.hxx>
44 #include <QSharedPointer>
50 class SalomeApp_Study;
106 virtual void ToValues(std::vector<double>& theValues)
const = 0;
107 virtual void FromValues(
int& theIt,
const std::vector<double>& theValues) = 0;
119 Record( DimensionType_Length ),
120 FirstPoint( gp::Origin() ),
121 SecondPoint( gp::Origin() ),
124 TextHPos( Prs3d_DTHP_Fit ),
125 TextVPos( Prs3d_DTVP_Center ),
126 ArrowPos( Prs3d_DAO_Fit )
130 Record( DimensionType_Length ),
131 FirstPoint( theOther.FirstPoint ),
132 SecondPoint( theOther.SecondPoint ),
133 Plane( theOther.Plane ),
134 Flyout( theOther.Flyout ),
135 TextHPos( theOther.TextHPos ),
136 TextVPos( theOther.TextVPos ),
137 ArrowPos( theOther.ArrowPos )
147 #if OCC_VERSION_LARGE >= 0x070400ff
148 void Init(
const Handle(PrsDim_LengthDimension)& theIO,
const gp_Ax3& theLCS );
150 void Init(
const Handle(AIS_LengthDimension)& theIO,
const gp_Ax3& theLCS );
158 #if OCC_VERSION_LARGE >= 0x070400ff
159 void Update(
Handle(PrsDim_LengthDimension)& theIO,
const gp_Ax3& theLCS );
161 void Update(
Handle(AIS_LengthDimension)& theIO,
const gp_Ax3& theLCS );
168 void ToValues(std::vector<double>& theValues)
const;
175 void FromValues(
int& theIt,
const std::vector<double>& theValues);
180 bool operator == (
const Length &theOther)
const;
181 bool operator != (
const Length &theOther)
const {
return !(operator == (theOther)); }
198 Record( DimensionType_Diameter ),
201 TextHPos( Prs3d_DTHP_Fit ),
202 TextVPos( Prs3d_DTVP_Center ),
203 ArrowPos( Prs3d_DAO_Fit )
207 Record( DimensionType_Diameter ),
208 Circle( theOther.Circle ),
209 Plane( theOther.Plane ),
210 Flyout( theOther.Flyout ),
211 TextHPos( theOther.TextHPos ),
212 TextVPos( theOther.TextVPos ),
213 ArrowPos( theOther.ArrowPos )
236 void ToValues(std::vector<double>& theValues)
const;
243 void FromValues(
int& theIt,
const std::vector<double>& theValues);
248 bool operator == (
const Diameter &theOther)
const;
249 bool operator != (
const Diameter &theOther)
const {
return !(operator == (theOther)); }
265 Record( DimensionType_Angle ),
266 FirstPoint( gp::Origin() ),
267 SecondPoint( gp::Origin() ),
268 CenterPoint( gp::Origin() ),
270 TextHPos( Prs3d_DTHP_Fit ),
271 TextVPos( Prs3d_DTVP_Center ),
272 ArrowPos( Prs3d_DAO_Fit )
276 Record( DimensionType_Angle ),
277 FirstPoint( theOther.FirstPoint ),
278 SecondPoint( theOther.SecondPoint ),
279 CenterPoint( theOther.CenterPoint ),
280 Flyout( theOther.Flyout ),
281 TextHPos( theOther.TextHPos ),
282 TextVPos( theOther.TextVPos ),
283 ArrowPos( theOther.ArrowPos )
306 void ToValues(std::vector<double>& theValues)
const;
313 void FromValues(
int& theIt,
const std::vector<double>& theValues);
318 bool operator == (
const Angle &theOther)
const;
319 bool operator != (
const Angle &theOther)
const {
return !(operator == (theOther)); }
362 operator QVariant()
const;
367 operator QString()
const;
379 return !(operator == (theOther));
387 int GetNumber()
const;
394 void AddRecord(
const Handle(AIS_Dimension)& theIO,
const gp_Ax3& theLCS );
400 void AddRecord(
const RecordPtr& theRecord );
408 void SetRecord(
const int theIndex,
409 const Handle(AIS_Dimension)& theIO,
410 const gp_Ax3& theLCS );
417 void SetRecord(
const int theIndex,
const RecordPtr& theRecord );
423 const RecordPtr& GetRecord(
const int theIndex )
const;
429 void RemoveRecord(
const int theIndex );
443 bool IsVisible(
const int theIndex )
const;
451 void SetVisible(
const int theIndex,
const bool theIsVisible );
458 QString GetName(
const int theIndex )
const;
466 void SetName(
const int theIndex,
const QString& theName );
471 int GetType(
const int theIndex )
const;
479 void LoadFromAttribute(
const std::string& theEntry );
485 void SaveToAttribute(
const std::string& theEntry );
492 int TypeFromIO(
const Handle(AIS_Dimension)& theIO )
const;
Handle(TColStd_HSequenceOfTransient) AdvancedEngine_IOperations
Create a T-shape object with specified caracteristics for the main and the incident pipes (radius,...
Definition: AdvancedEngine_IOperations.cxx:1907
QSharedPointer< GEOMGUI_DimensionProperty > DimensionPropertyPtr
Definition: GEOMGUI_DimensionProperty.h:52
Utility class to unpack/pack dimension presentations as object property of study.
Definition: GEOMGUI_DimensionProperty.h:71
VectorOfVisibility myVisibility
Definition: GEOMGUI_DimensionProperty.h:502
QVector< RecordPtr > VectorOfRecords
Definition: GEOMGUI_DimensionProperty.h:498
DimensionType
Type of packed presentation.
Definition: GEOMGUI_DimensionProperty.h:78
@ DimensionType_Diameter
Definition: GEOMGUI_DimensionProperty.h:80
@ DimensionType_Length
Definition: GEOMGUI_DimensionProperty.h:79
QSharedPointer< Record > RecordPtr
Definition: GEOMGUI_DimensionProperty.h:330
QVector< bool > VectorOfVisibility
Definition: GEOMGUI_DimensionProperty.h:496
VectorOfRecords myRecords
Definition: GEOMGUI_DimensionProperty.h:504
VectorOfNames myNames
Definition: GEOMGUI_DimensionProperty.h:503
QVector< QString > VectorOfNames
Definition: GEOMGUI_DimensionProperty.h:497
Declaration of properties for angle dimensions.
Definition: GEOMGUI_DimensionProperty.h:263
Angle(const Angle &theOther)
Definition: GEOMGUI_DimensionProperty.h:275
Prs3d_DimensionArrowOrientation ArrowPos
Definition: GEOMGUI_DimensionProperty.h:327
double Flyout
Definition: GEOMGUI_DimensionProperty.h:324
gp_Pnt SecondPoint
Definition: GEOMGUI_DimensionProperty.h:322
Angle()
Definition: GEOMGUI_DimensionProperty.h:264
~Angle()
Definition: GEOMGUI_DimensionProperty.h:286
Prs3d_DimensionTextHorizontalPosition TextHPos
Definition: GEOMGUI_DimensionProperty.h:325
Prs3d_DimensionTextVerticalPosition TextVPos
Definition: GEOMGUI_DimensionProperty.h:326
gp_Pnt FirstPoint
Definition: GEOMGUI_DimensionProperty.h:321
gp_Pnt CenterPoint
Definition: GEOMGUI_DimensionProperty.h:323
Declaration of properties for diameter dimensions.
Definition: GEOMGUI_DimensionProperty.h:196
Diameter(const Diameter &theOther)
Definition: GEOMGUI_DimensionProperty.h:206
double Flyout
Definition: GEOMGUI_DimensionProperty.h:253
gp_Circ Circle
Definition: GEOMGUI_DimensionProperty.h:251
Diameter()
Definition: GEOMGUI_DimensionProperty.h:197
Prs3d_DimensionTextVerticalPosition TextVPos
Definition: GEOMGUI_DimensionProperty.h:255
~Diameter()
Definition: GEOMGUI_DimensionProperty.h:216
Prs3d_DimensionTextHorizontalPosition TextHPos
Definition: GEOMGUI_DimensionProperty.h:254
gp_Pln Plane
Definition: GEOMGUI_DimensionProperty.h:252
Prs3d_DimensionArrowOrientation ArrowPos
Definition: GEOMGUI_DimensionProperty.h:256
Declaration of properties for length dimensions.
Definition: GEOMGUI_DimensionProperty.h:117
Prs3d_DimensionArrowOrientation ArrowPos
Definition: GEOMGUI_DimensionProperty.h:189
Prs3d_DimensionTextHorizontalPosition TextHPos
Definition: GEOMGUI_DimensionProperty.h:187
gp_Pnt FirstPoint
Definition: GEOMGUI_DimensionProperty.h:183
Length()
Definition: GEOMGUI_DimensionProperty.h:118
gp_Pln Plane
Definition: GEOMGUI_DimensionProperty.h:185
Prs3d_DimensionTextVerticalPosition TextVPos
Definition: GEOMGUI_DimensionProperty.h:188
double Flyout
Definition: GEOMGUI_DimensionProperty.h:186
gp_Pnt SecondPoint
Definition: GEOMGUI_DimensionProperty.h:184
Length(const Length &theOther)
Definition: GEOMGUI_DimensionProperty.h:129
~Length()
Definition: GEOMGUI_DimensionProperty.h:140
Definition: GEOMGUI_DimensionProperty.h:91
DimensionType Type() const
Definition: GEOMGUI_DimensionProperty.h:97
Record(const DimensionType theType)
Definition: GEOMGUI_DimensionProperty.h:93
Diameter * AsDiameter()
Definition: GEOMGUI_DimensionProperty.h:103
DimensionType myType
Definition: GEOMGUI_DimensionProperty.h:110
Angle * AsAngle()
Definition: GEOMGUI_DimensionProperty.h:104
virtual void ToValues(std::vector< double > &theValues) const =0
virtual void FromValues(int &theIt, const std::vector< double > &theValues)=0
Length * AsLength()
Definition: GEOMGUI_DimensionProperty.h:102