1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
3 // File: GeomData_Point2D.h
4 // Created: 24 Apr 2014
5 // Author: Mikhail PONIKAROV
7 #ifndef GeomData_Point2D_H_
8 #define GeomData_Point2D_H_
11 #include "GeomDataAPI_Point2D.h"
12 #include <TDataStd_RealArray.hxx>
13 #include <TDataStd_ExtStringArray.hxx>
14 #include <TDataStd_BooleanArray.hxx>
15 #include <TDF_Label.hxx>
17 /**\class GeomData_Point2D
19 * \brief Attribute that contains 2D point.
22 class GeomData_Point2D : public GeomDataAPI_Point2D
24 Handle_TDataStd_RealArray myCoords; ///< X and Y doubles as real array attribute [0; 1]
25 Handle_TDataStd_ExtStringArray myTextArray; ///< Text representation of the X, Y and Z attributes [0; 2]
26 Handle_TDataStd_BooleanArray myExpressionInvalidArray; ///< Flag of invalid expression of the X, Y and Z attributes [0; 2]
28 /// Defines the double value
29 GEOMDATA_EXPORT virtual void setValue(const double theX, const double theY);
31 GEOMDATA_EXPORT virtual void setValue(const std::shared_ptr<GeomAPI_Pnt2d>& thePoint);
33 /// Returns the X double value
34 GEOMDATA_EXPORT virtual double x() const;
35 /// Returns the Y double value
36 GEOMDATA_EXPORT virtual double y() const;
37 /// Returns the 2D point
38 GEOMDATA_EXPORT virtual std::shared_ptr<GeomAPI_Pnt2d> pnt();
40 /// Defines the calculated double value
41 GEOMDATA_EXPORT virtual void setCalculatedValue(const double theX, const double theY);
43 /// Defines the text values
44 GEOMDATA_EXPORT virtual void setText(const std::string& theX,
45 const std::string& theY);
47 /// Returns the text values
48 GEOMDATA_EXPORT virtual std::string textX();
49 GEOMDATA_EXPORT virtual std::string textY();
51 /// Allows to set expression (text) as invalid (by the parameters listener)
52 GEOMDATA_EXPORT virtual void setExpressionInvalid(int, const bool theFlag);
54 /// Returns true if text is invalid
55 GEOMDATA_EXPORT virtual bool expressionInvalid(int);
58 /// Initializes attributes
59 GEOMDATA_EXPORT GeomData_Point2D(TDF_Label& theLabel);
61 friend class Model_Data;