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_ExtCF_HeaderFile
15 #define _BRepExtrema_ExtCF_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_ExtCS_HeaderFile
28 #include <Extrema_ExtCS.hxx>
30 #ifndef _Standard_Integer_HeaderFile
31 #include <Standard_Integer.hxx>
33 #ifndef _TColStd_SequenceOfReal_HeaderFile
34 #include <TColStd_SequenceOfReal.hxx>
36 #ifndef _Extrema_SequenceOfPOnSurf_HeaderFile
37 #include <Extrema_SequenceOfPOnSurf.hxx>
39 #ifndef _Extrema_SequenceOfPOnCurv_HeaderFile
40 #include <Extrema_SequenceOfPOnCurv.hxx>
42 #ifndef _Handle_BRepAdaptor_HSurface_HeaderFile
43 #include <Handle_BRepAdaptor_HSurface.hxx>
45 #ifndef _Standard_Boolean_HeaderFile
46 #include <Standard_Boolean.hxx>
48 #ifndef _Standard_Real_HeaderFile
49 #include <Standard_Real.hxx>
51 #ifndef _Extrema_POnCurv_HeaderFile
52 #include <Extrema_POnCurv.hxx>
54 #ifndef _Extrema_POnSurf_HeaderFile
55 #include <Extrema_POnSurf.hxx>
57 class BRepAdaptor_HSurface;
63 class BRepExtrema_ExtCF
69 Standard_EXPORT BRepExtrema_ExtCF()
72 //! It calculates all the distances. <br>
73 Standard_EXPORT BRepExtrema_ExtCF(const TopoDS_Edge& V,const TopoDS_Face& E);
75 Standard_EXPORT void Initialize(const TopoDS_Face& E);
76 //! An exception is raised if the fields have not been initialized. <br>
77 //! Be careful: this method uses the Face only for classify not for the fields. <br>
78 Standard_EXPORT void Perform(const TopoDS_Edge& V,const TopoDS_Face& F);
79 //! True if the distances are found. <br>
80 Standard_EXPORT Standard_Boolean IsDone() const
82 return myExtCS.IsDone();
84 //! Returns the number of extremum distances. <br>
85 Standard_EXPORT Standard_Integer NbExt() const
87 return mySqDist.Length();
89 //! Returns the value of the <N>th extremum square distance. <br>
90 Standard_EXPORT Standard_Real SquareDistance(const Standard_Integer N) const
92 return mySqDist.Value(N);
94 //! Returns True if the curve is on a parallel surface. <br>
95 Standard_EXPORT Standard_Boolean IsParallel() const
97 return myExtCS.IsParallel();
99 //! Returns the parameters on the Edge of the <N>th extremum distance. <br>
100 Standard_EXPORT Standard_Real ParameterOnEdge(const Standard_Integer N) const
102 return myPointsOnC.Value(N).Parameter();
104 //! Returns the parameters on the Face of the <N>th extremum distance. <br>
105 Standard_EXPORT void ParameterOnFace(const Standard_Integer N,Standard_Real& U,Standard_Real& V) const
107 myPointsOnS.Value(N).Parameter(U, V);
109 //! Returns the Point of the <N>th extremum distance. <br>
110 Standard_EXPORT gp_Pnt PointOnEdge(const Standard_Integer N) const
112 return myPointsOnC.Value(N).Value();
114 //! Returns the Point of the <N>th extremum distance. <br>
115 Standard_EXPORT gp_Pnt PointOnFace(const Standard_Integer N) const
117 return myPointsOnS.Value(N).Value();
122 Extrema_ExtCS myExtCS;
123 TColStd_SequenceOfReal mySqDist;
124 Extrema_SequenceOfPOnSurf myPointsOnS;
125 Extrema_SequenceOfPOnCurv myPointsOnC;
126 Handle_BRepAdaptor_HSurface myHS;