Salome HOME
Issue #2079 : Select parent feature for default Constructions. Disable popup menu...
[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   TDF_Label myLab; ///< the main label of the attribute
26   Handle_TDataStd_RealArray myCoords;  ///< X, Y and Z doubles as real array attribute [0; 2]
27  public:
28   /// Defines the double value
29   GEOMDATA_EXPORT virtual void setValue(const double theX, const double theY, const double theZ);
30   /// Defines the direction
31   GEOMDATA_EXPORT virtual void setValue(const std::shared_ptr<GeomAPI_Dir>& theDir);
32
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 direction of this attribute
40   GEOMDATA_EXPORT virtual std::shared_ptr<GeomAPI_Dir> dir();
41   /// Returns the coordinates of this attribute
42   GEOMDATA_EXPORT virtual std::shared_ptr<GeomAPI_XYZ> xyz();
43
44  protected:
45   /// Initializes attributes
46   GEOMDATA_EXPORT GeomData_Dir(TDF_Label& theLabel);
47   /// Reinitializes the internal state of the attribute (may be needed on undo/redo, abort, etc)
48   virtual void reinit();
49
50   friend class Model_Data;
51 };
52
53 #endif