1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
3 // File: GeomAPI_Pln.cpp
4 // Created: 23 Apr 2014
5 // Author: Mikhail PONIKAROV
7 #include<GeomAPI_Pln.h>
8 #include <GeomAPI_Ax3.h>
9 #include <GeomAPI_Pnt.h>
10 #include <GeomAPI_Dir.h>
16 GeomAPI_Pln::GeomAPI_Pln(const std::shared_ptr<GeomAPI_Ax3>& theAxis)
17 : GeomAPI_Interface(new gp_Ax3(theAxis->impl<gp_Ax3>()))
21 GeomAPI_Pln::GeomAPI_Pln(const std::shared_ptr<GeomAPI_Pnt>& thePoint,
22 const std::shared_ptr<GeomAPI_Dir>& theNormal)
23 : GeomAPI_Interface(new gp_Pln(thePoint->impl<gp_Pnt>(), theNormal->impl<gp_Dir>()))
27 GeomAPI_Pln::GeomAPI_Pln(const double theA, const double theB, const double theC, const double theD)
28 : GeomAPI_Interface(new gp_Pln(theA, theB, theC, theD))
32 std::shared_ptr<GeomAPI_Pnt> GeomAPI_Pln::location()
34 gp_Pnt aLoc = impl<gp_Pln>().Location();
35 return std::shared_ptr<GeomAPI_Pnt>(new GeomAPI_Pnt(aLoc.X(), aLoc.Y(), aLoc.Z()));
38 std::shared_ptr<GeomAPI_Dir> GeomAPI_Pln::direction()
40 const gp_Dir& aDir = impl<gp_Pln>().Axis().Direction();
41 return std::shared_ptr<GeomAPI_Dir>(new GeomAPI_Dir(aDir.X(), aDir.Y(), aDir.Z()));
44 void GeomAPI_Pln::coefficients(double& theA, double& theB, double& theC, double& theD)
46 impl<gp_Pln>().Coefficients(theA, theB, theC, theD);
49 bool GeomAPI_Pln::isCoincident(const std::shared_ptr<GeomAPI_Pln> thePlane, const double theTolerance)
55 const gp_Pln& aMyPln = impl<gp_Pln>();
56 const gp_Pln& anOtherPln = thePlane->impl<gp_Pln>();
57 return (aMyPln.Contains(anOtherPln.Location(), theTolerance) && aMyPln.Axis().IsParallel(anOtherPln.Axis(), theTolerance));