1 // Copyright (c) 1999-2014 OPEN CASCADE SAS
3 // This file is part of Open CASCADE Technology software library.
5 // This library is free software; you can redistribute it and/or modify it under
6 // the terms of the GNU Lesser General Public License version 2.1 as published
7 // by the Free Software Foundation, with special exception defined in the file
8 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
9 // distribution for complete text of the license and disclaimer of any warranty.
11 // Alternatively, this file may be used under the terms of Open CASCADE
12 // commercial license or contractual agreement.
14 #ifndef _BRepExtrema_ExtPC_HeaderFile
15 #define _BRepExtrema_ExtPC_HeaderFile
17 #include <Extrema_ExtPC.hxx>
18 #include <BRepAdaptor_HCurve.hxx>
19 #include <Standard_DefineAlloc.hxx>
21 class BRepAdaptor_HCurve;
27 class BRepExtrema_ExtPC
33 Standard_EXPORT BRepExtrema_ExtPC()
36 //! It calculates all the distances. <br>
37 Standard_EXPORT BRepExtrema_ExtPC(const TopoDS_Vertex& V,const TopoDS_Edge& E);
39 Standard_EXPORT void Initialize(const TopoDS_Edge& E);
40 //! An exception is raised if the fields have not been initialized. <br>
41 Standard_EXPORT void Perform(const TopoDS_Vertex& V);
42 //! True if the distances are found. <br>
43 Standard_EXPORT Standard_Boolean IsDone() const
45 return myExtPC.IsDone();
47 //! Returns the number of extremum distances. <br>
48 Standard_EXPORT Standard_Integer NbExt() const
50 return myExtPC.NbExt();
52 //! Returns True if the <N>th extremum distance is a minimum. <br>
53 Standard_EXPORT Standard_Boolean IsMin(const Standard_Integer N) const
55 return myExtPC.IsMin(N);
57 //! Returns the value of the <N>th extremum square distance. <br>
58 Standard_EXPORT Standard_Real SquareDistance(const Standard_Integer N) const
60 return myExtPC.SquareDistance(N);
62 //! Returns the parameter on the edge of the <N>th extremum distance. <br>
63 Standard_EXPORT Standard_Real Parameter(const Standard_Integer N) const
65 return myExtPC.Point(N).Parameter();
67 //! Returns the Point of the <N>th extremum distance. <br>
68 Standard_EXPORT gp_Pnt Point(const Standard_Integer N) const
70 return myExtPC.Point(N).Value();
72 //! if the curve is a trimmed curve, <br>
73 //! dist1 is a square distance between <P> and the point <br>
74 //! of parameter FirstParameter <pnt1> and <br>
75 //! dist2 is a square distance between <P> and the point <br>
76 //! of parameter LastParameter <pnt2>. <br>
77 Standard_EXPORT void TrimmedSquareDistances(Standard_Real& dist1,Standard_Real& dist2,gp_Pnt& pnt1,gp_Pnt& pnt2) const
79 myExtPC.TrimmedSquareDistances(dist1,dist2,pnt1,pnt2);
84 Extrema_ExtPC myExtPC;
85 Handle(BRepAdaptor_HCurve) myHC;