Salome HOME
Templates for implementation of Geom classes receiving
[modules/shaper.git] / src / GeomAPI / GeomAPI_Pln.cpp
1 // File:        GeomAPI_Pln.cpp
2 // Created:     23 Apr 2014
3 // Author:      Mikhail PONIKAROV
4
5 #include<GeomAPI_Pln.h>
6 #include <GeomAPI_Pnt.h>
7 #include <GeomAPI_Dir.h>
8
9 #include<gp_Pln.hxx>
10
11 using namespace std;
12
13 GeomAPI_Pln::GeomAPI_Pln(const shared_ptr<GeomAPI_Pnt>& thePoint,
14             const shared_ptr<GeomAPI_Dir>& theNormal)
15 : GeomAPI_Interface(new gp_Pln(thePoint->impl<gp_Pnt>(),
16                                theNormal->impl<gp_Dir>()))
17 {
18 }
19
20 GeomAPI_Pln::GeomAPI_Pln(
21   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 shared_ptr<GeomAPI_Pnt> GeomAPI_Pln::location()
27 {
28   gp_Pnt aLoc = impl<gp_Pln>().Location();
29   return shared_ptr<GeomAPI_Pnt>(new GeomAPI_Pnt(aLoc.X(), aLoc.Y(), aLoc.Z()));
30 }
31
32 shared_ptr<GeomAPI_Dir> GeomAPI_Pln::direction()
33 {
34   const gp_Dir& aDir = impl<gp_Pln>().Axis().Direction();
35   return shared_ptr<GeomAPI_Dir>(new GeomAPI_Dir(aDir.X(), aDir.Y(), aDir.Z()));
36 }