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 std::shared_ptr<ModelAPI_ExpressionDouble> myExpression[NUM_COMPONENTS]; ///< Expressions for X, Y and Z
26 /// Defines the double value
27 GEOMDATA_EXPORT virtual void setValue(const double theX, const double theY, const double theZ);
29 GEOMDATA_EXPORT virtual void setValue(const std::shared_ptr<GeomAPI_Pnt>& thePoint);
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();
40 /// Defines the calculated double value
41 GEOMDATA_EXPORT virtual void setCalculatedValue(const double theX, const double theY, const double theZ);
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);
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();
55 /// Allows to set expression (text) as invalid (by the parameters listener)
56 GEOMDATA_EXPORT virtual void setExpressionInvalid(int, const bool theFlag);
58 /// Returns true if text is invalid
59 GEOMDATA_EXPORT virtual bool expressionInvalid(int);
61 /// Allows to set expression (text) error (by the parameters listener)
62 GEOMDATA_EXPORT virtual void setExpressionError(int theComponent, const std::string& theError);
64 /// Returns an expression error
65 GEOMDATA_EXPORT virtual std::string expressionError(int theComponent);
67 /// Defines the used parameters
68 GEOMDATA_EXPORT virtual void setUsedParameters(int theComponent,
69 const std::set<std::string>& theUsedParameters);
71 /// Returns the used parameters
72 GEOMDATA_EXPORT virtual std::set<std::string> usedParameters(int theComponent) const;
75 /// Initializes attributes
76 GEOMDATA_EXPORT GeomData_Point(TDF_Label& theLabel);
78 friend class Model_Data;