0024510: Remove unused local variables
[occt.git] / src / IntCurve / IntCurve_ProjPCurGen.gxx
CommitLineData
b311480e 1// Created on: 1992-10-13
2// Created by: Laurent BUCHARD
3// Copyright (c) 1992-1999 Matra Datavision
973c2be1 4// Copyright (c) 1999-2014 OPEN CASCADE SAS
b311480e 5//
973c2be1 6// This file is part of Open CASCADE Technology software library.
b311480e 7//
973c2be1 8// This library is free software; you can redistribute it and / or modify it
9// under the terms of the GNU Lesser General Public version 2.1 as published
10// by the Free Software Foundation, with special exception defined in the file
11// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12// distribution for complete text of the license and disclaimer of any warranty.
b311480e 13//
973c2be1 14// Alternatively, this file may be used under the terms of Open CASCADE
15// commercial license or contractual agreement.
7fd59977 16
17#include <Extrema_POnCurv2d.hxx>
18
19Standard_Real IntCurve_ProjPCurGen::FindParameter
20 (const TheCurve& C,
21 const gp_Pnt2d& P,
22 const Standard_Real LowParameter,
23 const Standard_Real HighParameter,
24 const Standard_Real)
25{
26 Standard_Real theparam,defaultparam;
27 Standard_Integer NbPts = TheCurveTool::NbSamples(C);
28 Standard_Real theEpsX = TheCurveTool::EpsX(C);
29 Extrema_POnCurv2d POnC;
30
31 IntCurve_TheCurveLocator::Locate(P,C,NbPts,LowParameter,HighParameter,POnC);
32 defaultparam = POnC.Parameter();
33 IntCurve_TheLocateExtPC Loc(P,C,defaultparam,theEpsX);
34
35 if(Loc.IsDone() == Standard_False) {
36 //-- cout<<"\n Erreur dans LocateExtPC "<<endl;
37 theparam = defaultparam;
38 }
39 else {
40 if(Loc.IsMin() == Standard_False) {
41 //-- cout<<"\n Erreur dans LocateExtPC (Maximum trouve) "<<endl;
42 theparam = defaultparam;
43 }
44 else {
45 theparam = Loc.Point().Parameter();
46 }
47 }
48 return theparam;
49}
50
51
52Standard_Real IntCurve_ProjPCurGen::FindParameter
53 (const TheCurve& C,
54 const gp_Pnt2d& P,
55 const Standard_Real Tol)
56{
57
58 Standard_Real theParam;
59 theParam = FindParameter( C
60 ,P
61 ,TheCurveTool::FirstParameter(C)
62 ,TheCurveTool::LastParameter(C)
63 ,Tol);
64 return theParam;
65}
66
67
68
69