1 // Copyright (C) 2014-2017 CEA/DEN, EDF R&D
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.
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.
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
17 // See http://www.salome-platform.org/ or
18 // email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
21 #include <GeomAPI_Ax2.h>
25 #define MY_AX1 implPtr<gp_Ax2>()
27 //=================================================================================================
28 GeomAPI_Ax2::GeomAPI_Ax2()
29 : GeomAPI_Interface(new gp_Ax2())
33 //=================================================================================================
34 GeomAPI_Ax2::GeomAPI_Ax2(std::shared_ptr<GeomAPI_Pnt> theOrigin,
35 std::shared_ptr<GeomAPI_Dir> theN,
36 std::shared_ptr<GeomAPI_Dir> theVX)
37 : GeomAPI_Interface(new gp_Ax2(theOrigin->impl<gp_Pnt>(),
39 theVX->impl<gp_Dir>()))
43 //=================================================================================================
44 GeomAPI_Ax2::GeomAPI_Ax2(std::shared_ptr<GeomAPI_Pnt> theOrigin,
45 std::shared_ptr<GeomAPI_Dir> theDir)
46 : GeomAPI_Interface(new gp_Ax2(theOrigin->impl<gp_Pnt>(),
47 theDir->impl<gp_Dir>()))
51 //=================================================================================================
52 void GeomAPI_Ax2::setOrigin(const std::shared_ptr<GeomAPI_Pnt>& theOrigin)
54 MY_AX1->SetLocation(theOrigin->impl<gp_Pnt>());
57 //=================================================================================================
58 std::shared_ptr<GeomAPI_Pnt> GeomAPI_Ax2::origin() const
60 gp_Pnt aPnt = MY_AX1->Location();
61 return std::shared_ptr<GeomAPI_Pnt>(new GeomAPI_Pnt(aPnt.X(),aPnt.Y(),aPnt.Z()));
64 //=================================================================================================
65 void GeomAPI_Ax2::setDir(const std::shared_ptr<GeomAPI_Dir>& theDir)
67 MY_AX1->SetDirection(theDir->impl<gp_Dir>());
70 //=================================================================================================
71 std::shared_ptr<GeomAPI_Dir> GeomAPI_Ax2::dir() const
73 gp_Dir aDir = MY_AX1->Direction();
74 return std::shared_ptr<GeomAPI_Dir>(new GeomAPI_Dir(aDir.X(), aDir.Y(), aDir.Z()));