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"
12 #include <TDataStd_RealArray.hxx>
13 #include <TDataStd_ExtStringArray.hxx>
14 #include <TDataStd_BooleanArray.hxx>
15 #include <TDF_Label.hxx>
17 /**\class GeomData_Point
19 * \brief Attribute that contains 3D point.
22 class GeomData_Point : public GeomDataAPI_Point
24 Handle_TDataStd_RealArray myCoords; ///< X, Y and Z doubles as real array attribute [0; 2]
25 Handle_TDataStd_ExtStringArray myTextArray; ///< Text representation of the X, Y and Z attributes [0; 2]
26 Handle_TDataStd_BooleanArray myExpressionInvalidArray; ///< Flag of invalid expression of the X, Y and Z attributes [0; 2]
28 /// Defines the double value
29 GEOMDATA_EXPORT virtual void setValue(const double theX, const double theY, const double theZ);
31 GEOMDATA_EXPORT virtual void setValue(const std::shared_ptr<GeomAPI_Pnt>& thePoint);
33 /// Returns the X double value
34 GEOMDATA_EXPORT virtual double x() const;
35 /// Returns the Y double value
36 GEOMDATA_EXPORT virtual double y() const;
37 /// Returns the Z double value
38 GEOMDATA_EXPORT virtual double z() const;
39 /// Returns the 3D point
40 GEOMDATA_EXPORT virtual std::shared_ptr<GeomAPI_Pnt> pnt();
42 /// Defines the calculated double value
43 GEOMDATA_EXPORT virtual 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);
64 /// Initializes attributes
65 GEOMDATA_EXPORT GeomData_Point(TDF_Label& theLabel);
67 friend class Model_Data;