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