Salome HOME
b4bea08413225da5e6efab8341d3c7a5cf5930c0
[modules/shaper.git] / src / GeomDataAPI / GeomDataAPI_Dir.h
1 // Copyright (C) 2014-2023  CEA/DEN, EDF R&D
2 //
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.
7 //
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.
12 //
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
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19
20 #ifndef GeomDataAPI_Dir_H_
21 #define GeomDataAPI_Dir_H_
22
23 #include "GeomDataAPI.h"
24 #include <ModelAPI_Attribute.h>
25
26 class GeomAPI_Dir;
27 class GeomAPI_XYZ;
28
29 /**\class GeomDataAPI_Dir
30  * \ingroup DataModel
31  * \brief Attribute that contains 3D direction coordinates. 
32  */
33
34 class GeomDataAPI_Dir : public ModelAPI_Attribute
35 {
36  public:
37   /// Defines the double value
38   virtual void setValue(const double theX, const double theY, const double theZ) = 0;
39   /// Defines the direction
40   virtual void setValue(const std::shared_ptr<GeomAPI_Dir>& theDir) = 0;
41
42   /// Returns the X double value
43   virtual double x() const = 0;
44   /// Returns the Y double value
45   virtual double y() const = 0;
46   /// Returns the Z double value
47   virtual double z() const = 0;
48   /// Returns the direction of this attribute
49   virtual std::shared_ptr<GeomAPI_Dir> dir() = 0;
50   /// Returns the coordinates of this attribute
51   virtual std::shared_ptr<GeomAPI_XYZ> xyz() = 0;
52
53   /// Returns the type of this class of attributes
54   static std::string typeId()
55   {
56     return std::string("Dir");
57   }
58
59   /// Returns the type of this class of attributes, not static method
60   GEOMDATAAPI_EXPORT virtual std::string attributeType();
61
62  protected:
63   /// Objects are created for features automatically
64   GEOMDATAAPI_EXPORT GeomDataAPI_Dir();
65   GEOMDATAAPI_EXPORT virtual ~GeomDataAPI_Dir();
66 };
67
68 //! Pointer on attribute object
69 typedef std::shared_ptr<GeomDataAPI_Dir> AttributeDirPtr;
70
71 #endif