Salome HOME
Issue #2998: Add help description for automatic creation of constraints
[modules/shaper.git] / src / GeomAPI / GeomAPI_Pln.cpp
index 38484ea75370718745f0c79e7a7b0dd181329027..c52dda9d659e869e48c55bc1c6e19a1aeebe1977 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
@@ -12,9 +12,9 @@
 //
 // You should have received a copy of the GNU Lesser General Public
 // License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <GeomAPI_Pln.h>
@@ -80,18 +80,6 @@ bool GeomAPI_Pln::isCoincident(const std::shared_ptr<GeomAPI_Pln> thePlane,
     aMyPln.Axis().IsParallel(anOtherPln.Axis(), theTolerance));
 }
 
-bool GeomAPI_Pln::isParallel(const std::shared_ptr<GeomAPI_Lin> theLine)
-{
-  std::shared_ptr<GeomAPI_XYZ> aLineDir = theLine->direction()->xyz();
-  std::shared_ptr<GeomAPI_XYZ> aLineLoc = theLine->location()->xyz();
-
-  std::shared_ptr<GeomAPI_XYZ> aNormal = direction()->xyz();
-  std::shared_ptr<GeomAPI_XYZ> aLocation = location()->xyz();
-
-  double aDot = aNormal->dot(aLineDir);
-  return Abs(aDot) < Precision::SquareConfusion();
-}
-
 std::shared_ptr<GeomAPI_Pnt>
   GeomAPI_Pln::intersect(const std::shared_ptr<GeomAPI_Lin>& theLine) const
 {
@@ -131,6 +119,13 @@ double GeomAPI_Pln::distance(const std::shared_ptr<GeomAPI_Pln> thePlane) const
   return aMyPln.Distance(anOtherPln);
 }
 
+double GeomAPI_Pln::distance(const std::shared_ptr<GeomAPI_Pnt> thePoint) const
+{
+  const gp_Pln& aMyPln = impl<gp_Pln>();
+  const gp_Pnt& aPnt = thePoint->impl<gp_Pnt>();
+  return aMyPln.Distance(aPnt);
+}
+
 void GeomAPI_Pln::translate(const std::shared_ptr<GeomAPI_Dir> theDir, double theDist)
 {
   gp_Vec aVec(theDir->impl<gp_Dir>());