Salome HOME
Copyright update 2022
[modules/shaper.git] / src / GeomAPI / GeomAPI_Ax1.h
1 // Copyright (C) 2014-2022  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_AX1_H_
21 #define GEOMAPI_AX1_H_
22
23 #include <GeomAPI.h>
24 #include <GeomAPI_Pnt.h>
25 #include <GeomAPI_Dir.h>
26
27 /** \ingroup DataModel
28  *  \brief The class represents an axis in 3D space.
29  */
30 class GeomAPI_Ax1 : public GeomAPI_Interface
31 {
32 public:
33   /// Default constructor.
34   GEOMAPI_EXPORT
35   GeomAPI_Ax1();
36
37   /** \brief Constructor.
38    *  \param[in] theOrigin point of origin.
39    *  \param[in] theDir direction of axis.
40    */
41   GEOMAPI_EXPORT
42   GeomAPI_Ax1(std::shared_ptr<GeomAPI_Pnt> theOrigin,
43               std::shared_ptr<GeomAPI_Dir> theDir);
44
45   /// Sets origin point.
46   GEOMAPI_EXPORT
47   void setOrigin(const std::shared_ptr<GeomAPI_Pnt>& theOrigin);
48
49   /// \return the plane origin point.
50   GEOMAPI_EXPORT
51   std::shared_ptr<GeomAPI_Pnt> origin() const;
52
53   /// Sets direction vector.
54   GEOMAPI_EXPORT
55   void setDir(const std::shared_ptr<GeomAPI_Dir>& theDir);
56
57   /// \return direction vector.
58   GEOMAPI_EXPORT
59   std::shared_ptr<GeomAPI_Dir> dir() const;
60
61   /// Reverses the unit vector of this axis and assigns the result to this axis.
62   GEOMAPI_EXPORT
63   void reverse();
64
65   /// \return reversed unit vector of this axis.
66   GEOMAPI_EXPORT
67   std::shared_ptr<GeomAPI_Ax1> reversed();
68 };
69
70 #endif