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