Salome HOME
Issue #1860: fix end lines with spaces
[modules/shaper.git] / src / GeomDataAPI / GeomDataAPI_Point.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2
3 // File:        GeomDataAPI_Point.h
4 // Created:     24 Apr 2014
5 // Author:      Mikhail PONIKAROV
6
7 #ifndef GeomDataAPI_Point_H_
8 #define GeomDataAPI_Point_H_
9
10 #include "GeomDataAPI.h"
11 #include <ModelAPI_Attribute.h>
12
13 #include <set>
14
15 class GeomAPI_Pnt;
16
17 /**\class GeomDataAPI_Point
18  * \ingroup DataModel
19  * \brief Attribute that contains 3D point coordinates. 
20  */
21
22 class GeomDataAPI_Point : public ModelAPI_Attribute
23 {
24  public:
25   /// Defines the double value
26   GEOMDATAAPI_EXPORT virtual
27     void setValue(const double theX, const double theY, const double theZ) = 0;
28   /// Defines the point
29   GEOMDATAAPI_EXPORT virtual void setValue(const std::shared_ptr<GeomAPI_Pnt>& thePoint) = 0;
30
31   /// Returns the X double value
32   GEOMDATAAPI_EXPORT virtual double x() const = 0;
33   /// Returns the Y double value
34   GEOMDATAAPI_EXPORT virtual double y() const = 0;
35   /// Returns the Z double value
36   GEOMDATAAPI_EXPORT virtual double z() const = 0;
37   /// Returns the 3D point
38   GEOMDATAAPI_EXPORT virtual std::shared_ptr<GeomAPI_Pnt> pnt() = 0;
39
40   /// Defines the calculated double value
41   GEOMDATAAPI_EXPORT virtual
42     void setCalculatedValue(const double theX, const double theY, const double theZ) = 0;
43
44   /// Defines the text values
45   GEOMDATAAPI_EXPORT virtual void setText(const std::string& theX,
46                                           const std::string& theY,
47                                           const std::string& theZ) = 0;
48
49   /// Returns the text value for X
50   GEOMDATAAPI_EXPORT virtual std::string textX() = 0;
51   /// Returns the text value for Y
52   GEOMDATAAPI_EXPORT virtual std::string textY() = 0;
53   /// Returns the text value for Z
54   GEOMDATAAPI_EXPORT virtual std::string textZ() = 0;
55
56   /// Point component (x,y,z)
57   enum PointComponent { C_X = 0,
58                         C_Y = 1,
59                         C_Z = 2,
60   };
61
62   /// Allows to set expression (text) as invalid (by the parameters listener)
63   GEOMDATAAPI_EXPORT virtual void setExpressionInvalid(int theComponent, const bool theFlag) = 0;
64
65   /// Returns true if text is invalid
66   GEOMDATAAPI_EXPORT virtual bool expressionInvalid(int theComponent) = 0;
67
68   /// Allows to set expression (text) error (by the parameters listener)
69   GEOMDATAAPI_EXPORT virtual
70     void setExpressionError(int theComponent, const std::string& theError) = 0;
71
72   /// Returns an expression error
73   GEOMDATAAPI_EXPORT virtual std::string expressionError(int theComponent) = 0;
74
75   /// Defines the used parameters
76   GEOMDATAAPI_EXPORT virtual void setUsedParameters(int theComponent,
77     const std::set<std::string>& theUsedParameters) = 0;
78
79   /// Returns the used parameters
80   GEOMDATAAPI_EXPORT virtual std::set<std::string> usedParameters(int theComponent) const = 0;
81
82   /// Returns the type of this class of attributes
83   static std::string typeId()
84   {
85     return std::string("Point");
86   }
87
88   /// Returns the type of this class of attributes, not static method
89   GEOMDATAAPI_EXPORT virtual std::string attributeType();
90
91  protected:
92   /// Objects are created for features automatically
93   GEOMDATAAPI_EXPORT GeomDataAPI_Point();
94   GEOMDATAAPI_EXPORT virtual ~GeomDataAPI_Point();
95 };
96
97 //! Pointer on attribute object
98 typedef std::shared_ptr<GeomDataAPI_Point> AttributePointPtr;
99
100 #endif