1 // Copyright (C) 2014-2019 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 email : webmaster.salome@opencascade.com
20 #include <GeomAPI_Ax2.h>
24 #define MY_AX1 implPtr<gp_Ax2>()
26 //=================================================================================================
27 GeomAPI_Ax2::GeomAPI_Ax2()
28 : GeomAPI_Interface(new gp_Ax2())
32 //=================================================================================================
33 GeomAPI_Ax2::GeomAPI_Ax2(std::shared_ptr<GeomAPI_Pnt> theOrigin,
34 std::shared_ptr<GeomAPI_Dir> theN,
35 std::shared_ptr<GeomAPI_Dir> theVX)
36 : GeomAPI_Interface(new gp_Ax2(theOrigin->impl<gp_Pnt>(),
38 theVX->impl<gp_Dir>()))
42 //=================================================================================================
43 GeomAPI_Ax2::GeomAPI_Ax2(std::shared_ptr<GeomAPI_Pnt> theOrigin,
44 std::shared_ptr<GeomAPI_Dir> theDir)
45 : GeomAPI_Interface(new gp_Ax2(theOrigin->impl<gp_Pnt>(),
46 theDir->impl<gp_Dir>()))
50 //=================================================================================================
51 void GeomAPI_Ax2::setOrigin(const std::shared_ptr<GeomAPI_Pnt>& theOrigin)
53 MY_AX1->SetLocation(theOrigin->impl<gp_Pnt>());
56 //=================================================================================================
57 std::shared_ptr<GeomAPI_Pnt> GeomAPI_Ax2::origin() const
59 gp_Pnt aPnt = MY_AX1->Location();
60 return std::shared_ptr<GeomAPI_Pnt>(new GeomAPI_Pnt(aPnt.X(),aPnt.Y(),aPnt.Z()));
63 //=================================================================================================
64 void GeomAPI_Ax2::setDir(const std::shared_ptr<GeomAPI_Dir>& theDir)
66 MY_AX1->SetDirection(theDir->impl<gp_Dir>());
69 //=================================================================================================
70 std::shared_ptr<GeomAPI_Dir> GeomAPI_Ax2::dir() const
72 gp_Dir aDir = MY_AX1->Direction();
73 return std::shared_ptr<GeomAPI_Dir>(new GeomAPI_Dir(aDir.X(), aDir.Y(), aDir.Z()));