0027961: Visualization - remove unused and no more working OpenGl_AVIWriter
[occt.git] / src / BRepExtrema / BRepExtrema_ExtPC.cxx
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
5 //
6 // This file is part of Open CASCADE Technology software library.
7 //
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.
13 //
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
16
17 #include <BRepExtrema_ExtPC.hxx>
18
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>
24
25
26 //=======================================================================
27 //function : BRepExtrema_ExtPC
28 //purpose  : 
29 //=======================================================================
30
31 BRepExtrema_ExtPC::BRepExtrema_ExtPC(const TopoDS_Vertex& V, const TopoDS_Edge& E)
32 {
33   Initialize(E);
34   Perform(V);
35 }
36
37 //=======================================================================
38 //function : Initialize
39 //purpose  : 
40 //=======================================================================
41
42 void BRepExtrema_ExtPC::Initialize(const TopoDS_Edge& E)
43 {
44   Standard_Real U1,U2;
45   BRepAdaptor_Curve Curv(E);
46   myHC = new BRepAdaptor_HCurve(Curv);
47   Standard_Real Tol = Min(BRep_Tool::Tolerance(E), Precision::Confusion());
48   Tol = Max(Curv.Resolution(Tol), Precision::PConfusion());
49   BRep_Tool::Range(E,U1,U2);
50   myExtPC.Initialize(myHC->Curve(),U1,U2,Tol);
51 }
52
53 //=======================================================================
54 //function : Perform
55 //purpose  : 
56 //=======================================================================
57
58 void BRepExtrema_ExtPC::Perform(const TopoDS_Vertex& V)
59 {
60   gp_Pnt P = BRep_Tool::Pnt(V);
61   myExtPC.Perform(P);
62 }