Salome HOME
Merge branch 'Dev_1.1.0' of newgeom:newgeom into Dev_1.1.0
[modules/shaper.git] / src / GeomData / GeomData_Dir.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2
3 // File:        GeomData_Dir.h
4 // Created:     24 Apr 2014
5 // Author:      Mikhail PONIKAROV
6
7 #ifndef GeomData_Dir_H_
8 #define GeomData_Dir_H_
9
10 #include "GeomData.h"
11 #include "GeomDataAPI_Dir.h"
12 #include <TDataStd_RealArray.hxx>
13 #include <TDF_Label.hxx>
14 #include <memory>
15
16 class GeomAPI_Dir;
17 class GeomAPI_XYZ;
18
19 /**\class GeomData_Dir
20  * \ingroup DataModel
21  * \brief Attribute that contains direction.
22  */
23 class GeomData_Dir : public GeomDataAPI_Dir
24 {
25   Handle_TDataStd_RealArray myCoords;  ///< X, Y and Z doubles as real array attribute [0; 2]
26  public:
27   /// Defines the double value
28   GEOMDATA_EXPORT virtual void setValue(const double theX, const double theY, const double theZ);
29   /// Defines the direction
30   GEOMDATA_EXPORT virtual void setValue(const std::shared_ptr<GeomAPI_Dir>& theDir);
31
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 direction of this attribute
39   GEOMDATA_EXPORT virtual std::shared_ptr<GeomAPI_Dir> dir();
40   /// Returns the coordinates of this attribute
41   GEOMDATA_EXPORT virtual std::shared_ptr<GeomAPI_XYZ> xyz();
42
43  protected:
44   /// Initializes attributes
45   GEOMDATA_EXPORT GeomData_Dir(TDF_Label& theLabel);
46
47   friend class Model_Data;
48 };
49
50 #endif