X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FGeomAPI%2FGeomAPI_Pln.cpp;h=c52dda9d659e869e48c55bc1c6e19a1aeebe1977;hb=ea593bc59e7e9461f6c4e2afd3f24d621edb1011;hp=3f3e44a7ef54ce62e958db08f71f20627ca677fc;hpb=1c292b5bf95e18a6c8fbe407c532213e10c673c5;p=modules%2Fshaper.git diff --git a/src/GeomAPI/GeomAPI_Pln.cpp b/src/GeomAPI/GeomAPI_Pln.cpp index 3f3e44a7e..c52dda9d6 100644 --- a/src/GeomAPI/GeomAPI_Pln.cpp +++ b/src/GeomAPI/GeomAPI_Pln.cpp @@ -1,8 +1,21 @@ -// Copyright (C) 2014-20xx CEA/DEN, EDF R&D - -// File: GeomAPI_Pln.cpp -// Created: 23 Apr 2014 -// Author: Mikhail PONIKAROV +// 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 +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// 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 +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// #include #include @@ -67,18 +80,6 @@ bool GeomAPI_Pln::isCoincident(const std::shared_ptr thePlane, aMyPln.Axis().IsParallel(anOtherPln.Axis(), theTolerance)); } -bool GeomAPI_Pln::isParallel(const std::shared_ptr theLine) -{ - std::shared_ptr aLineDir = theLine->direction()->xyz(); - std::shared_ptr aLineLoc = theLine->location()->xyz(); - - std::shared_ptr aNormal = direction()->xyz(); - std::shared_ptr aLocation = location()->xyz(); - - double aDot = aNormal->dot(aLineDir); - return Abs(aDot) < Precision::SquareConfusion(); -} - std::shared_ptr GeomAPI_Pln::intersect(const std::shared_ptr& theLine) const { @@ -118,6 +119,13 @@ double GeomAPI_Pln::distance(const std::shared_ptr thePlane) const return aMyPln.Distance(anOtherPln); } +double GeomAPI_Pln::distance(const std::shared_ptr thePoint) const +{ + const gp_Pln& aMyPln = impl(); + const gp_Pnt& aPnt = thePoint->impl(); + return aMyPln.Distance(aPnt); +} + void GeomAPI_Pln::translate(const std::shared_ptr theDir, double theDist) { gp_Vec aVec(theDir->impl());