1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
3 // File: GeomData_Point.h
4 // Created: 24 Apr 2014
5 // Author: Mikhail PONIKAROV
7 #ifndef GeomData_Point_H_
8 #define GeomData_Point_H_
11 #include "GeomDataAPI_Point.h"
13 #include <TDF_Label.hxx>
15 class ModelAPI_ExpressionDouble;
17 /**\class GeomData_Point
19 * \brief Attribute that contains 3D point.
21 class GeomData_Point : public GeomDataAPI_Point
23 enum { NUM_COMPONENTS = 3 };
24 /// Expressions for X, Y and Z
25 std::shared_ptr<ModelAPI_ExpressionDouble> myExpression[NUM_COMPONENTS];
27 /// Defines the double value
28 GEOMDATA_EXPORT virtual void setValue(const double theX, const double theY, const double theZ);
30 GEOMDATA_EXPORT virtual void setValue(const std::shared_ptr<GeomAPI_Pnt>& thePoint);
32 /// Returns the X double value
33 GEOMDATA_EXPORT virtual double x() const;
34 /// Returns the Y double value
35 GEOMDATA_EXPORT virtual double y() const;
36 /// Returns the Z double value
37 GEOMDATA_EXPORT virtual double z() const;
38 /// Returns the 3D point
39 GEOMDATA_EXPORT virtual std::shared_ptr<GeomAPI_Pnt> pnt();
41 /// Defines the calculated double value
42 GEOMDATA_EXPORT virtual
43 void setCalculatedValue(const double theX, const double theY, const double theZ);
45 /// Defines the text values
46 GEOMDATA_EXPORT virtual void setText(const std::string& theX,
47 const std::string& theY,
48 const std::string& theZ);
50 /// Returns the X text value
51 GEOMDATA_EXPORT virtual std::string textX();
52 /// Returns the Y text value
53 GEOMDATA_EXPORT virtual std::string textY();
54 /// Returns the Z text value
55 GEOMDATA_EXPORT virtual std::string textZ();
57 /// Allows to set expression (text) as invalid (by the parameters listener)
58 GEOMDATA_EXPORT virtual void setExpressionInvalid(int, const bool theFlag);
60 /// Returns true if text is invalid
61 GEOMDATA_EXPORT virtual bool expressionInvalid(int);
63 /// Allows to set expression (text) error (by the parameters listener)
64 GEOMDATA_EXPORT virtual void setExpressionError(int theComponent, const std::string& theError);
66 /// Returns an expression error
67 GEOMDATA_EXPORT virtual std::string expressionError(int theComponent);
69 /// Defines the used parameters
70 GEOMDATA_EXPORT virtual void setUsedParameters(int theComponent,
71 const std::set<std::string>& theUsedParameters);
73 /// Returns the used parameters
74 GEOMDATA_EXPORT virtual std::set<std::string> usedParameters(int theComponent) const;
77 /// Initializes attributes
78 GEOMDATA_EXPORT GeomData_Point();
79 /// Reinitializes the internal state of the attribute (may be needed on undo/redo, abort, etc)
80 virtual void reinit();
82 friend class Model_Data;