1 // Copyright (c) 1999-2012 OPEN CASCADE SAS
3 // The content of this file is subject to the Open CASCADE Technology Public
4 // License Version 6.5 (the "License"). You may not use the content of this file
5 // except in compliance with the License. Please obtain a copy of the License
6 // at http://www.opencascade.org and read it completely before using this file.
8 // The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
9 // main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
11 // The Original Code and all software distributed under the License is
12 // distributed on an "AS IS" basis, without warranty of any kind, and the
13 // Initial Developer hereby disclaims all such warranties, including without
14 // limitation, any warranties of merchantability, fitness for a particular
15 // purpose or non-infringement. Please see the License for the specific terms
16 // and conditions governing the rights and limitations under the License.
18 #ifndef _BRepExtrema_ExtPF_HeaderFile
19 #define _BRepExtrema_ExtPF_HeaderFile
21 #ifndef _Standard_HeaderFile
22 #include <Standard.hxx>
24 #ifndef _Standard_DefineAlloc_HeaderFile
25 #include <Standard_DefineAlloc.hxx>
27 #ifndef _Standard_Macro_HeaderFile
28 #include <Standard_Macro.hxx>
31 #ifndef _Extrema_ExtPS_HeaderFile
32 #include <Extrema_ExtPS.hxx>
34 #ifndef _Standard_Integer_HeaderFile
35 #include <Standard_Integer.hxx>
37 #ifndef _TColStd_SequenceOfReal_HeaderFile
38 #include <TColStd_SequenceOfReal.hxx>
40 #ifndef _Extrema_SequenceOfPOnSurf_HeaderFile
41 #include <Extrema_SequenceOfPOnSurf.hxx>
43 #ifndef _BRepAdaptor_Surface_HeaderFile
44 #include <BRepAdaptor_Surface.hxx>
46 #ifndef _Extrema_ExtFlag_HeaderFile
47 #include <Extrema_ExtFlag.hxx>
49 #ifndef _Extrema_ExtAlgo_HeaderFile
50 #include <Extrema_ExtAlgo.hxx>
52 #ifndef _Standard_Boolean_HeaderFile
53 #include <Standard_Boolean.hxx>
55 #ifndef _Standard_Real_HeaderFile
56 #include <Standard_Real.hxx>
63 class BRepExtrema_ExtPF
69 Standard_EXPORT BRepExtrema_ExtPF()
71 //! It calculates all the distances. <br>
72 Standard_EXPORT BRepExtrema_ExtPF(const TopoDS_Vertex& TheVertex,const TopoDS_Face& TheFace,
73 const Extrema_ExtFlag TheFlag = Extrema_ExtFlag_MINMAX,
74 const Extrema_ExtAlgo TheAlgo = Extrema_ExtAlgo_Grad);
76 Standard_EXPORT void Initialize(const TopoDS_Face& TheFace,
77 const Extrema_ExtFlag TheFlag = Extrema_ExtFlag_MINMAX,
78 const Extrema_ExtAlgo TheAlgo = Extrema_ExtAlgo_Grad);
80 //! An exception is raised if the fields have not been initialized. <br>
81 //! Be careful: this method uses the Face only for classify not for the fields. <br>
82 Standard_EXPORT void Perform(const TopoDS_Vertex& TheVertex,const TopoDS_Face& TheFace);
83 //! True if the distances are found. <br>
84 Standard_EXPORT Standard_Boolean IsDone() const
86 return myExtPS.IsDone();
88 //! Returns the number of extremum distances. <br>
89 Standard_EXPORT Standard_Integer NbExt() const
91 return myPoints.Length();
93 //! Returns the value of the <N>th extremum square distance. <br>
94 Standard_EXPORT Standard_Real SquareDistance(const Standard_Integer N) const
96 return mySqDist.Value(N);
98 //! Returns the parameters on the Face of the <N>th extremum distance. <br>
99 Standard_EXPORT void Parameter(const Standard_Integer N,Standard_Real& U,Standard_Real& V) const
101 myPoints.Value(N).Parameter(U, V);
103 //! Returns the Point of the <N>th extremum distance. <br>
104 Standard_EXPORT gp_Pnt Point(const Standard_Integer N) const
106 return myPoints.Value(N).Value();
109 Standard_EXPORT void SetFlag(const Extrema_ExtFlag F)
114 Standard_EXPORT void SetAlgo(const Extrema_ExtAlgo A)
121 Extrema_ExtPS myExtPS;
122 TColStd_SequenceOfReal mySqDist;
123 Extrema_SequenceOfPOnSurf myPoints;
124 BRepAdaptor_Surface mySurf;