Salome HOME
Issue #718 - Translation with parameters - wrong coordinates
[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 class GeomAPI_Pnt;
14
15 /**\class GeomDataAPI_Point
16  * \ingroup DataModel
17  * \brief Attribute that contains 3D point coordinates. 
18  */
19
20 class GeomDataAPI_Point : public ModelAPI_Attribute
21 {
22  public:
23   /// Defines the double value
24   GEOMDATAAPI_EXPORT virtual void setValue(const double theX, const double theY, const double theZ) = 0;
25   /// Defines the point
26   GEOMDATAAPI_EXPORT virtual void setValue(const std::shared_ptr<GeomAPI_Pnt>& thePoint) = 0;
27
28   /// Returns the X double value
29   GEOMDATAAPI_EXPORT virtual double x() const = 0;
30   /// Returns the Y double value
31   GEOMDATAAPI_EXPORT virtual double y() const = 0;
32   /// Returns the Z double value
33   GEOMDATAAPI_EXPORT virtual double z() const = 0;
34   /// Returns the 3D point
35   GEOMDATAAPI_EXPORT virtual std::shared_ptr<GeomAPI_Pnt> pnt() = 0;
36
37   /// Defines the calculated double value
38   GEOMDATAAPI_EXPORT virtual void setCalculatedValue(const double theX, const double theY, const double theZ) = 0;
39   
40   /// Defines the text values
41   GEOMDATAAPI_EXPORT virtual void setText(const std::string& theX,
42                                           const std::string& theY,
43                                           const std::string& theZ) = 0;
44
45   /// Returns the text values
46   GEOMDATAAPI_EXPORT virtual std::string textX() = 0;
47   GEOMDATAAPI_EXPORT virtual std::string textY() = 0;
48   GEOMDATAAPI_EXPORT virtual std::string textZ() = 0;
49
50   enum PointComponent { C_X = 0,
51                         C_Y = 1,
52                         C_Z = 2,
53   };
54
55   /// Allows to set expression (text) as invalid (by the parameters listener)
56   GEOMDATAAPI_EXPORT virtual void setExpressionInvalid(int theComponent, const bool theFlag) = 0;
57
58   /// Returns true if text is invalid
59   GEOMDATAAPI_EXPORT virtual bool expressionInvalid(int theComponent) = 0;
60
61   /// Returns the type of this class of attributes
62   static std::string typeId()
63   {
64     return std::string("Point");
65   }
66
67   /// Returns the type of this class of attributes, not static method
68   GEOMDATAAPI_EXPORT virtual std::string attributeType();
69
70  protected:
71   /// Objects are created for features automatically
72   GEOMDATAAPI_EXPORT GeomDataAPI_Point();
73   GEOMDATAAPI_EXPORT virtual ~GeomDataAPI_Point();
74 };
75
76 //! Pointer on attribute object
77 typedef std::shared_ptr<GeomDataAPI_Point> AttributePointPtr;
78
79 #endif