Salome HOME
Merge branch 'master' of newgeom:newgeom
[modules/shaper.git] / src / GeomDataAPI / GeomDataAPI_Point2D.h
1 // File:        GeomDataAPI_Point2D.h
2 // Created:     24 Apr 2014
3 // Author:      Mikhail PONIKAROV
4
5 #ifndef GeomDataAPI_Point2D_HeaderFile
6 #define GeomDataAPI_Point2D_HeaderFile
7
8 #include "GeomDataAPI.h"
9 #include <ModelAPI_Attribute.h>
10
11 class GeomAPI_Pnt2d;
12
13 /**\class GeomDataAPI_Point2D
14  * \ingroup DataModel
15  * \brief Attribute that contains 2D point coordinates.
16  */
17
18 class GeomDataAPI_Point2D : public ModelAPI_Attribute
19 {
20 public:
21   /// Defines the double value
22   virtual void setValue(const double theX, const double theY) = 0;
23   /// Defines the point
24   virtual void setValue(const boost::shared_ptr<GeomAPI_Pnt2d>& thePoint) = 0;
25
26   /// Returns the X double value
27   virtual double x() const = 0;
28   /// Returns the Y double value
29   virtual double y() const = 0;
30   /// Returns the 2D point
31   virtual boost::shared_ptr<GeomAPI_Pnt2d> pnt() = 0;
32
33   /// Returns the type of this class of attributes
34   static inline std::string type() {return std::string("Point2D");}
35
36   /// Returns the type of this class of attributes, not static method
37   virtual std::string attributeType() {return type();}
38
39 protected:
40   /// Objects are created for features automatically
41   GeomDataAPI_Point2D()
42   {}
43 };
44
45 #endif