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 #ifndef _Standard_HeaderFile
18 #include <Standard.hxx>
20 #ifndef _Standard_DefineAlloc_HeaderFile
21 #include <Standard_DefineAlloc.hxx>
23 #ifndef _Standard_Macro_HeaderFile
24 #include <Standard_Macro.hxx>
27 #ifndef _Extrema_ExtPC_HeaderFile
28 #include <Extrema_ExtPC.hxx>
30 #ifndef _Handle_BRepAdaptor_HCurve_HeaderFile
31 #include <BRepAdaptor_HCurve.hxx>
33 #ifndef _Standard_Boolean_HeaderFile
34 #include <Standard_Boolean.hxx>
36 #ifndef _Standard_Integer_HeaderFile
37 #include <Standard_Integer.hxx>
39 #ifndef _Standard_Real_HeaderFile
40 #include <Standard_Real.hxx>
42 class BRepAdaptor_HCurve;
48 class BRepExtrema_ExtPC
54 Standard_EXPORT BRepExtrema_ExtPC()
57 //! It calculates all the distances. <br>
58 Standard_EXPORT BRepExtrema_ExtPC(const TopoDS_Vertex& V,const TopoDS_Edge& E);
60 Standard_EXPORT void Initialize(const TopoDS_Edge& E);
61 //! An exception is raised if the fields have not been initialized. <br>
62 Standard_EXPORT void Perform(const TopoDS_Vertex& V);
63 //! True if the distances are found. <br>
64 Standard_EXPORT Standard_Boolean IsDone() const
66 return myExtPC.IsDone();
68 //! Returns the number of extremum distances. <br>
69 Standard_EXPORT Standard_Integer NbExt() const
71 return myExtPC.NbExt();
73 //! Returns True if the <N>th extremum distance is a minimum. <br>
74 Standard_EXPORT Standard_Boolean IsMin(const Standard_Integer N) const
76 return myExtPC.IsMin(N);
78 //! Returns the value of the <N>th extremum square distance. <br>
79 Standard_EXPORT Standard_Real SquareDistance(const Standard_Integer N) const
81 return myExtPC.SquareDistance(N);
83 //! Returns the parameter on the edge of the <N>th extremum distance. <br>
84 Standard_EXPORT Standard_Real Parameter(const Standard_Integer N) const
86 return myExtPC.Point(N).Parameter();
88 //! Returns the Point of the <N>th extremum distance. <br>
89 Standard_EXPORT gp_Pnt Point(const Standard_Integer N) const
91 return myExtPC.Point(N).Value();
93 //! if the curve is a trimmed curve, <br>
94 //! dist1 is a square distance between <P> and the point <br>
95 //! of parameter FirstParameter <pnt1> and <br>
96 //! dist2 is a square distance between <P> and the point <br>
97 //! of parameter LastParameter <pnt2>. <br>
98 Standard_EXPORT void TrimmedSquareDistances(Standard_Real& dist1,Standard_Real& dist2,gp_Pnt& pnt1,gp_Pnt& pnt2) const
100 myExtPC.TrimmedSquareDistances(dist1,dist2,pnt1,pnt2);
105 Extrema_ExtPC myExtPC;
106 Handle_BRepAdaptor_HCurve myHC;