1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
3 // File: GeomDataAPI_Point.h
4 // Created: 24 Apr 2014
5 // Author: Mikhail PONIKAROV
7 #ifndef GeomDataAPI_Point_H_
8 #define GeomDataAPI_Point_H_
10 #include "GeomDataAPI.h"
11 #include <ModelAPI_Attribute.h>
17 /**\class GeomDataAPI_Point
19 * \brief Attribute that contains 3D point coordinates.
22 class GeomDataAPI_Point : public ModelAPI_Attribute
25 /// Defines the double value
26 GEOMDATAAPI_EXPORT virtual
27 void setValue(const double theX, const double theY, const double theZ) = 0;
29 GEOMDATAAPI_EXPORT virtual void setValue(const std::shared_ptr<GeomAPI_Pnt>& thePoint) = 0;
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;
40 /// Defines the calculated double value
41 GEOMDATAAPI_EXPORT virtual
42 void setCalculatedValue(const double theX, const double theY, const double theZ) = 0;
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;
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;
56 /// Point component (x,y,z)
57 enum PointComponent { C_X = 0,
62 /// Allows to set expression (text) as invalid (by the parameters listener)
63 GEOMDATAAPI_EXPORT virtual void setExpressionInvalid(int theComponent, const bool theFlag) = 0;
65 /// Returns true if text is invalid
66 GEOMDATAAPI_EXPORT virtual bool expressionInvalid(int theComponent) = 0;
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;
72 /// Returns an expression error
73 GEOMDATAAPI_EXPORT virtual std::string expressionError(int theComponent) = 0;
75 /// Defines the used parameters
76 GEOMDATAAPI_EXPORT virtual void setUsedParameters(int theComponent,
77 const std::set<std::string>& theUsedParameters) = 0;
79 /// Returns the used parameters
80 GEOMDATAAPI_EXPORT virtual std::set<std::string> usedParameters(int theComponent) const = 0;
82 /// Returns the type of this class of attributes
83 static std::string typeId()
85 return std::string("Point");
88 /// Returns the type of this class of attributes, not static method
89 GEOMDATAAPI_EXPORT virtual std::string attributeType();
92 /// Objects are created for features automatically
93 GEOMDATAAPI_EXPORT GeomDataAPI_Point();
94 GEOMDATAAPI_EXPORT virtual ~GeomDataAPI_Point();
97 //! Pointer on attribute object
98 typedef std::shared_ptr<GeomDataAPI_Point> AttributePointPtr;