X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FFrontTrack%2FFrontTrack_Projector.cxx;h=450bab6a75cb1dbc1bb125d87b34d7f9dab1892c;hb=refs%2Ftags%2FV9_13_0b1;hp=a23d00dc2823b711ad651ef87c64fb10597e0d6a;hpb=17fe5b49cfe394b6015b4d53cc11d15f2108d40c;p=modules%2Fhomard.git diff --git a/src/FrontTrack/FrontTrack_Projector.cxx b/src/FrontTrack/FrontTrack_Projector.cxx old mode 100755 new mode 100644 index a23d00dc..450bab6a --- a/src/FrontTrack/FrontTrack_Projector.cxx +++ b/src/FrontTrack/FrontTrack_Projector.cxx @@ -1,3 +1,21 @@ +// Copyright (C) 2017-2024 CEA, EDF +// +// 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 +// // File : FrontTrack_Projector.cxx // Created : Wed Apr 26 20:33:55 2017 // Author : Edward AGAPOV (eap) @@ -104,6 +122,9 @@ namespace // actual projection algorithms double* newSolution, const double* prevSolution = 0) { +#ifdef _DEBUG_ + std::cout << ".. project a point to the curve prevSolution = " << prevSolution << std::endl; +#endif gp_Pnt proj; Standard_Real param; @@ -115,6 +136,9 @@ namespace // actual projection algorithms { _dist = _projector.Project( _curve, P, _tol, proj, param, false ); } +#ifdef _DEBUG_ + std::cout << ".. _dist : " << _dist << std::endl; +#endif proj = _curve.Value( param ); newSolution[0] = param; @@ -130,6 +154,9 @@ namespace // actual projection algorithms double* newSolution, const double* prevSolution = 0) { +#ifdef _DEBUG_ + std::cout << ".. project a point to a curve and check " << std::endl; +#endif projection = project( point, newSolution, prevSolution ); return ( _uRange[0] < newSolution[0] && newSolution[0] < _uRange[1] && _dist * _dist < maxDist2 ); @@ -436,6 +463,7 @@ namespace // actual projection algorithms newSolution[0], newSolution[1]); projection = ElSLib::CylinderValue( newSolution[0], newSolution[1], _cylinder.Position(), _cylinder.Radius() ); + _dist = point.Distance( projection ); return ( _dist * _dist < maxDist2 ) && SurfaceProjector::classify( newSolution ); } @@ -611,7 +639,7 @@ namespace // actual projection algorithms bool isStraight( const GeomAdaptor_Curve& curve, const double tol ) { // rough check: evaluate how far from a straight line connecting the curve ends - // stand several internal points of the curve + // stand several internal points of the curve const double f = curve.FirstParameter(); const double l = curve.LastParameter();