Back to home page

EIC code displayed by LXR

 
 

    


Warning, /include/opencascade/IntCurve_ProjPCurGen.gxx is written in an unsupported language. File is not indexed.

0001 // Created on: 1992-10-13
0002 // Created by: Laurent BUCHARD
0003 // Copyright (c) 1992-1999 Matra Datavision
0004 // Copyright (c) 1999-2014 OPEN CASCADE SAS
0005 //
0006 // This file is part of Open CASCADE Technology software library.
0007 //
0008 // This library is free software; you can redistribute it and/or modify it under
0009 // the terms of the GNU Lesser General Public License version 2.1 as published
0010 // by the Free Software Foundation, with special exception defined in the file
0011 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0012 // distribution for complete text of the license and disclaimer of any warranty.
0013 //
0014 // Alternatively, this file may be used under the terms of Open CASCADE
0015 // commercial license or contractual agreement.
0016 
0017 #include <Extrema_POnCurv2d.hxx>
0018 
0019 Standard_Real IntCurve_ProjPCurGen::FindParameter 
0020   (const TheCurve& C,
0021    const gp_Pnt2d& P,
0022    const Standard_Real LowParameter,
0023    const Standard_Real HighParameter,
0024    const Standard_Real) 
0025 {
0026   Standard_Real theparam,defaultparam;
0027   Standard_Integer NbPts = TheCurveTool::NbSamples(C);
0028   Standard_Real theEpsX  = TheCurveTool::EpsX(C);
0029   Extrema_POnCurv2d POnC;
0030   
0031   IntCurve_TheCurveLocator::Locate(P,C,NbPts,LowParameter,HighParameter,POnC);
0032   defaultparam = POnC.Parameter();
0033   IntCurve_TheLocateExtPC Loc(P,C,defaultparam,theEpsX);
0034 
0035   if(Loc.IsDone() == Standard_False) {
0036     //-- cout<<"\n Erreur dans LocateExtPC "<<endl;
0037     theparam = defaultparam;
0038   }
0039   else {
0040     if(Loc.IsMin() == Standard_False) { 
0041       //-- cout<<"\n Erreur dans LocateExtPC (Maximum trouve) "<<endl;
0042       theparam = defaultparam;
0043     }
0044     else {
0045       theparam = Loc.Point().Parameter();
0046     }
0047   }
0048   return theparam;
0049 }
0050 
0051 
0052 Standard_Real IntCurve_ProjPCurGen::FindParameter
0053   (const TheCurve& C,
0054    const gp_Pnt2d& P,
0055    const Standard_Real Tol) 
0056 {
0057 
0058   Standard_Real theParam;
0059   theParam = FindParameter( C
0060                            ,P
0061                            ,TheCurveTool::FirstParameter(C)
0062                            ,TheCurveTool::LastParameter(C)
0063                            ,Tol);
0064   return theParam;
0065 }
0066 
0067 
0068 
0069