Salome HOME
Move functions from Python model.services to C++ ModelHighAPI_Services
[modules/shaper.git] / src / GeomData / GeomData_Point.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2
3 // File:        GeomData_Point.h
4 // Created:     24 Apr 2014
5 // Author:      Mikhail PONIKAROV
6
7 #ifndef GeomData_Point_H_
8 #define GeomData_Point_H_
9
10 #include "GeomData.h"
11 #include "GeomDataAPI_Point.h"
12
13 #include <TDF_Label.hxx>
14
15 class ModelAPI_ExpressionDouble;
16
17 /**\class GeomData_Point
18  * \ingroup DataModel
19  * \brief Attribute that contains 3D point.
20  */
21 class GeomData_Point : public GeomDataAPI_Point
22 {
23   enum { NUM_COMPONENTS = 3 };
24   std::shared_ptr<ModelAPI_ExpressionDouble> myExpression[NUM_COMPONENTS]; ///< Expressions for X, Y and Z 
25  public:
26   /// Defines the double value
27   GEOMDATA_EXPORT virtual void setValue(const double theX, const double theY, const double theZ);
28   /// Defines the point
29   GEOMDATA_EXPORT virtual void setValue(const std::shared_ptr<GeomAPI_Pnt>& thePoint);
30
31   /// Returns the X double value
32   GEOMDATA_EXPORT virtual double x() const;
33   /// Returns the Y double value
34   GEOMDATA_EXPORT virtual double y() const;
35   /// Returns the Z double value
36   GEOMDATA_EXPORT virtual double z() const;
37   /// Returns the 3D point
38   GEOMDATA_EXPORT virtual std::shared_ptr<GeomAPI_Pnt> pnt();
39
40   /// Defines the calculated double value
41   GEOMDATA_EXPORT virtual void setCalculatedValue(const double theX, const double theY, const double theZ);
42
43   /// Defines the text values
44   GEOMDATA_EXPORT virtual void setText(const std::string& theX,
45                                        const std::string& theY,
46                                        const std::string& theZ);
47
48   /// Returns the X text value
49   GEOMDATA_EXPORT virtual std::string textX();
50   /// Returns the Y text value
51   GEOMDATA_EXPORT virtual std::string textY();
52   /// Returns the Z text value
53   GEOMDATA_EXPORT virtual std::string textZ();
54
55   /// Allows to set expression (text) as invalid (by the parameters listener)
56   GEOMDATA_EXPORT virtual void setExpressionInvalid(int, const bool theFlag);
57
58   /// Returns true if text is invalid
59   GEOMDATA_EXPORT virtual bool expressionInvalid(int);
60
61   /// Allows to set expression (text) error (by the parameters listener)
62   GEOMDATA_EXPORT virtual void setExpressionError(int theComponent, const std::string& theError);
63
64   /// Returns an expression error
65   GEOMDATA_EXPORT virtual std::string expressionError(int theComponent);
66
67   /// Defines the used parameters
68   GEOMDATA_EXPORT virtual void setUsedParameters(int theComponent, 
69     const std::set<std::string>& theUsedParameters);
70
71   /// Returns the used parameters
72   GEOMDATA_EXPORT virtual std::set<std::string> usedParameters(int theComponent) const;
73
74  protected:
75   /// Initializes attributes
76   GEOMDATA_EXPORT GeomData_Point();
77
78   friend class Model_Data;
79 };
80
81 #endif