1 // File: GeomDataAPI_Point2D.h
2 // Created: 24 Apr 2014
3 // Author: Mikhail PONIKAROV
5 #ifndef GeomDataAPI_Point2D_H_
6 #define GeomDataAPI_Point2D_H_
8 #include "GeomDataAPI.h"
9 #include <ModelAPI_Attribute.h>
13 /**\class GeomDataAPI_Point2D
15 * \brief Attribute that contains 2D point coordinates.
18 class GeomDataAPI_Point2D : public ModelAPI_Attribute
21 /// Defines the double value
22 virtual void setValue(const double theX, const double theY) = 0;
24 virtual void setValue(const std::shared_ptr<GeomAPI_Pnt2d>& thePoint) = 0;
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 std::shared_ptr<GeomAPI_Pnt2d> pnt() = 0;
33 /// Appends the delta values to point
34 void move(const double theDeltaX, const double theDeltaY)
36 setValue(x() + theDeltaX, y() + theDeltaY);
40 /// Returns the type of this class of attributes
41 static inline std::string type()
43 return std::string("Point2D");
46 /// Returns the type of this class of attributes, not static method
47 virtual std::string attributeType()
53 /// Objects are created for features automatically