OCC22322 Improvement of Extrema performance
[occt.git] / src / BRepExtrema / BRepExtrema_ExtPC.cxx
CommitLineData
7fd59977 1// File: BRepExtrema_ExtPC.cxx
2// Created: Wed Dec 15 16:48:53 1993
3// Author: Christophe MARION
7fd59977 4
92d1589b
A
5#include <BRepExtrema_ExtPC.hxx>
6
7fd59977 7#include <BRep_Tool.hxx>
92d1589b
A
8//#include <StdFail_NotDone.hxx>
9//#include <Standard_Failure.hxx>
7fd59977 10#include <BRepAdaptor_Curve.hxx>
11#include <BRepAdaptor_HCurve.hxx>
12
13
14//=======================================================================
15//function : BRepExtrema_ExtPC
16//purpose :
17//=======================================================================
18
92d1589b 19BRepExtrema_ExtPC::BRepExtrema_ExtPC(const TopoDS_Vertex& V, const TopoDS_Edge& E)
7fd59977 20{
21 Initialize(E);
22 Perform(V);
23}
24
25//=======================================================================
26//function : Initialize
27//purpose :
28//=======================================================================
29
30void BRepExtrema_ExtPC::Initialize(const TopoDS_Edge& E)
31{
32 Standard_Real U1,U2;
33 BRepAdaptor_Curve Curv(E);
34 myHC = new BRepAdaptor_HCurve(Curv);
35 BRep_Tool::Range(E,U1,U2);
92d1589b 36 myExtPC.Initialize(myHC->Curve(),U1,U2);
7fd59977 37}
38
39//=======================================================================
40//function : Perform
41//purpose :
42//=======================================================================
43
44void BRepExtrema_ExtPC::Perform(const TopoDS_Vertex& V)
45{
46 gp_Pnt P = BRep_Tool::Pnt(V);
92d1589b 47 myExtPC.Perform(P);
7fd59977 48}