Salome HOME
Changes for modifying of GeomData objects by GeomAPI objects
[modules/shaper.git] / src / GeomData / GeomData_Point2D.h
1 // File:        GeomData_Point2D.h
2 // Created:     24 Apr 2014
3 // Author:      Mikhail PONIKAROV
4
5 #ifndef GeomData_Point2D_HeaderFile
6 #define GeomData_Point2D_HeaderFile
7
8 #include "GeomData.h"
9 #include "GeomDataAPI_Point2D.h"
10 #include <TDataStd_RealArray.hxx>
11 #include <TDF_Label.hxx>
12
13 /**\class GeomData_Point2D
14  * \ingroup DataModel
15  * \brief Attribute that contains 2D point.
16  */
17
18 class GeomData_Point2D : public GeomDataAPI_Point2D
19 {
20   Handle_TDataStd_RealArray myCoords; ///< X and Y doubles as real array attribute [0; 1]
21 public:
22   /// Defines the double value
23   GEOMDATA_EXPORT virtual void setValue(const double theX, const double theY);
24   /// Defines the point
25   GEOMDATA_EXPORT virtual void setValue(const boost::shared_ptr<GeomAPI_Pnt2d>& thePoint);
26
27   /// Returns the X double value
28   GEOMDATA_EXPORT virtual double x() const;
29   /// Returns the Y double value
30   GEOMDATA_EXPORT virtual double y() const;
31   /// Returns the 2D point
32   GEOMDATA_EXPORT virtual boost::shared_ptr<GeomAPI_Pnt2d> pnt();
33
34 protected:
35   /// Initializes attributes
36   GEOMDATA_EXPORT GeomData_Point2D(TDF_Label& theLabel);
37
38   friend class Model_Data;
39 };
40
41 #endif