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