1 // Copyright (C) 2014-2017 CEA/DEN, EDF R&D
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
20 #ifndef GeomDataAPI_Point_H_
21 #define GeomDataAPI_Point_H_
23 #include "GeomDataAPI.h"
24 #include <ModelAPI_Attribute.h>
30 /**\class GeomDataAPI_Point
32 * \brief Attribute that contains 3D point coordinates.
35 class GeomDataAPI_Point : public ModelAPI_Attribute
38 /// Defines the double value
39 GEOMDATAAPI_EXPORT virtual
40 void setValue(const double theX, const double theY, const double theZ) = 0;
42 GEOMDATAAPI_EXPORT virtual void setValue(const std::shared_ptr<GeomAPI_Pnt>& thePoint) = 0;
44 /// Returns the X double value
45 GEOMDATAAPI_EXPORT virtual double x() const = 0;
46 /// Returns the Y double value
47 GEOMDATAAPI_EXPORT virtual double y() const = 0;
48 /// Returns the Z double value
49 GEOMDATAAPI_EXPORT virtual double z() const = 0;
50 /// Returns the 3D point
51 GEOMDATAAPI_EXPORT virtual std::shared_ptr<GeomAPI_Pnt> pnt() = 0;
53 /// Defines the calculated double value
54 GEOMDATAAPI_EXPORT virtual
55 void setCalculatedValue(const double theX, const double theY, const double theZ) = 0;
57 /// Defines the text values
58 GEOMDATAAPI_EXPORT virtual void setText(const std::string& theX,
59 const std::string& theY,
60 const std::string& theZ) = 0;
62 /// Returns the text value for X
63 GEOMDATAAPI_EXPORT virtual std::string textX() = 0;
64 /// Returns the text value for Y
65 GEOMDATAAPI_EXPORT virtual std::string textY() = 0;
66 /// Returns the text value for Z
67 GEOMDATAAPI_EXPORT virtual std::string textZ() = 0;
69 /// Point component (x,y,z)
70 enum PointComponent { C_X = 0,
75 /// Allows to set expression (text) as invalid (by the parameters listener)
76 GEOMDATAAPI_EXPORT virtual void setExpressionInvalid(int theComponent, const bool theFlag) = 0;
78 /// Returns true if text is invalid
79 GEOMDATAAPI_EXPORT virtual bool expressionInvalid(int theComponent) = 0;
81 /// Allows to set expression (text) error (by the parameters listener)
82 GEOMDATAAPI_EXPORT virtual
83 void setExpressionError(int theComponent, const std::string& theError) = 0;
85 /// Returns an expression error
86 GEOMDATAAPI_EXPORT virtual std::string expressionError(int theComponent) = 0;
88 /// Defines the used parameters
89 GEOMDATAAPI_EXPORT virtual void setUsedParameters(int theComponent,
90 const std::set<std::string>& theUsedParameters) = 0;
92 /// Returns the used parameters
93 GEOMDATAAPI_EXPORT virtual std::set<std::string> usedParameters(int theComponent) const = 0;
95 /// Returns the type of this class of attributes
96 static std::string typeId()
98 return std::string("Point");
101 /// Returns the type of this class of attributes, not static method
102 GEOMDATAAPI_EXPORT virtual std::string attributeType();
105 /// Objects are created for features automatically
106 GEOMDATAAPI_EXPORT GeomDataAPI_Point();
107 GEOMDATAAPI_EXPORT virtual ~GeomDataAPI_Point();
110 //! Pointer on attribute object
111 typedef std::shared_ptr<GeomDataAPI_Point> AttributePointPtr;