Salome HOME
Issue #2560: Add Interpolation feature to Build plugin for creation a curve by the...
[modules/shaper.git] / src / GeomAPI / GeomAPI_Ax3.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 GEOMAPI_AX3_H_
22 #define GEOMAPI_AX3_H_
23
24 #include "GeomAPI.h"
25 #include "GeomAPI_Pnt.h"
26 #include "GeomAPI_Dir.h"
27
28 /**
29  * \ingroup DataModel
30  * \brief The class represents a coordinate plane which is 2d plane with X and Y directions
31  * and origin
32  */ 
33 class GeomAPI_Ax3 : public GeomAPI_Interface
34 {
35 public:
36   /// Default constructor
37   GEOMAPI_EXPORT
38   GeomAPI_Ax3();
39
40   /// Constructor
41   /// \param theOrigin point of origin
42   /// \param theDirX direction of X axis
43   /// \param theNorm direction of normal vector
44   GEOMAPI_EXPORT
45   GeomAPI_Ax3(std::shared_ptr<GeomAPI_Pnt> theOrigin,
46               std::shared_ptr<GeomAPI_Dir> theDirX,
47               std::shared_ptr<GeomAPI_Dir> theNorm);
48
49   /// Sets origin point
50   GEOMAPI_EXPORT
51   void setOrigin(const std::shared_ptr<GeomAPI_Pnt>& theOrigin);
52
53   /// Returns the plane origin point
54   GEOMAPI_EXPORT
55   std::shared_ptr<GeomAPI_Pnt> origin() const;
56
57   /// Sets X direction vector
58   GEOMAPI_EXPORT
59   void setDirX(const std::shared_ptr<GeomAPI_Dir>& theDirX);
60
61   /// Returns X direction vector
62   GEOMAPI_EXPORT
63   std::shared_ptr<GeomAPI_Dir> dirX() const;
64
65   /// Sets Y direction vector
66   GEOMAPI_EXPORT
67   void setDirY(const std::shared_ptr<GeomAPI_Dir>& theDirY);
68
69   /// Returns Y direction vector
70   GEOMAPI_EXPORT
71   std::shared_ptr<GeomAPI_Dir> dirY() const;
72
73   /// Sets Z direction vector
74   GEOMAPI_EXPORT
75   void setNormal(const std::shared_ptr<GeomAPI_Dir>& theNorm);
76
77   /// Returns Z direction vector
78   GEOMAPI_EXPORT
79   std::shared_ptr<GeomAPI_Dir> normal() const;
80
81   /// Converts 2d coordinates from the plane to 3d space point
82   /// \param theX X coordinate
83   /// \param theY Y coordinate
84   GEOMAPI_EXPORT
85   std::shared_ptr<GeomAPI_Pnt> to3D(double theX, double theY) const;
86
87   /// Converts 3d  to 2d coordinates of the plane
88   /// \param theX X coordinate
89   /// \param theY Y coordinate
90   /// \param theZ Z coordinate
91   GEOMAPI_EXPORT
92   std::shared_ptr<GeomAPI_Pnt2d> to2D(double theX, double theY, double theZ) const;
93
94 };
95
96
97 //! Pointer on the object
98 typedef std::shared_ptr<GeomAPI_Ax3> GeomAx3Ptr;
99
100 #endif