1 // Created on: 1993-12-15
2 // Created by: Christophe MARION
3 // Copyright (c) 1993-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
6 // This file is part of Open CASCADE Technology software library.
8 // This library is free software; you can redistribute it and/or modify it under
9 // the terms of the GNU Lesser General Public License 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.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
17 #include <BRepExtrema_ExtPC.hxx>
19 #include <BRep_Tool.hxx>
20 //#include <StdFail_NotDone.hxx>
21 //#include <Standard_Failure.hxx>
22 #include <BRepAdaptor_Curve.hxx>
23 #include <BRepAdaptor_HCurve.hxx>
26 //=======================================================================
27 //function : BRepExtrema_ExtPC
29 //=======================================================================
31 BRepExtrema_ExtPC::BRepExtrema_ExtPC(const TopoDS_Vertex& V, const TopoDS_Edge& E)
37 //=======================================================================
38 //function : Initialize
40 //=======================================================================
42 void BRepExtrema_ExtPC::Initialize(const TopoDS_Edge& E)
44 if (!BRep_Tool::IsGeometric(E))
45 return; // protect against non-geometric type (e.g. polygon)
47 BRepAdaptor_Curve Curv(E);
48 myHC = new BRepAdaptor_HCurve(Curv);
49 Standard_Real Tol = Min(BRep_Tool::Tolerance(E), Precision::Confusion());
50 Tol = Max(Curv.Resolution(Tol), Precision::PConfusion());
51 BRep_Tool::Range(E,U1,U2);
52 myExtPC.Initialize(myHC->Curve(),U1,U2,Tol);
55 //=======================================================================
58 //=======================================================================
60 void BRepExtrema_ExtPC::Perform(const TopoDS_Vertex& V)
64 gp_Pnt P = BRep_Tool::Pnt(V);