Salome HOME
Merge remote-tracking branch 'origin/Dev_1.1.0' into Dev_1.1.0
[modules/shaper.git] / src / GeomAPI / GeomAPI_Pln.cpp
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2
3 // File:        GeomAPI_Pln.cpp
4 // Created:     23 Apr 2014
5 // Author:      Mikhail PONIKAROV
6
7 #include<GeomAPI_Pln.h>
8 #include <GeomAPI_Pnt.h>
9 #include <GeomAPI_Dir.h>
10
11 #include<gp_Pln.hxx>
12
13 using namespace std;
14
15 GeomAPI_Pln::GeomAPI_Pln(const std::shared_ptr<GeomAPI_Pnt>& thePoint,
16                          const std::shared_ptr<GeomAPI_Dir>& theNormal)
17     : GeomAPI_Interface(new gp_Pln(thePoint->impl<gp_Pnt>(), theNormal->impl<gp_Dir>()))
18 {
19 }
20
21 GeomAPI_Pln::GeomAPI_Pln(const double theA, const double theB, const double theC, const double theD)
22     : GeomAPI_Interface(new gp_Pln(theA, theB, theC, theD))
23 {
24 }
25
26 std::shared_ptr<GeomAPI_Pnt> GeomAPI_Pln::location()
27 {
28   gp_Pnt aLoc = impl<gp_Pln>().Location();
29   return std::shared_ptr<GeomAPI_Pnt>(new GeomAPI_Pnt(aLoc.X(), aLoc.Y(), aLoc.Z()));
30 }
31
32 std::shared_ptr<GeomAPI_Dir> GeomAPI_Pln::direction()
33 {
34   const gp_Dir& aDir = impl<gp_Pln>().Axis().Direction();
35   return std::shared_ptr<GeomAPI_Dir>(new GeomAPI_Dir(aDir.X(), aDir.Y(), aDir.Z()));
36 }
37
38 void GeomAPI_Pln::coefficients(double& theA, double& theB, double& theC, double& theD)
39 {
40   impl<gp_Pln>().Coefficients(theA, theB, theC, theD);
41 }