Commit | Line | Data |
---|---|---|
973c2be1 | 1 | // Copyright (c) 1999-2014 OPEN CASCADE SAS |
92d1589b | 2 | // |
973c2be1 | 3 | // This file is part of Open CASCADE Technology software library. |
92d1589b | 4 | // |
d5f74e42 | 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 | |
973c2be1 | 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. | |
b311480e | 10 | // |
973c2be1 | 11 | // Alternatively, this file may be used under the terms of Open CASCADE |
12 | // commercial license or contractual agreement. | |
92d1589b A |
13 | |
14 | #ifndef _BRepExtrema_ExtPF_HeaderFile | |
15 | #define _BRepExtrema_ExtPF_HeaderFile | |
16 | ||
1c35b92f | 17 | #include <Standard_DefineAlloc.hxx> |
92d1589b | 18 | #include <Extrema_ExtPS.hxx> |
92d1589b | 19 | #include <Standard_Integer.hxx> |
92d1589b | 20 | #include <TColStd_SequenceOfReal.hxx> |
92d1589b | 21 | #include <Extrema_SequenceOfPOnSurf.hxx> |
92d1589b | 22 | #include <BRepAdaptor_Surface.hxx> |
92d1589b | 23 | #include <Extrema_ExtFlag.hxx> |
92d1589b | 24 | #include <Extrema_ExtAlgo.hxx> |
ebc93ae7 | 25 | |
92d1589b A |
26 | class TopoDS_Vertex; |
27 | class TopoDS_Face; | |
28 | class gp_Pnt; | |
29 | ||
30 | ||
31 | class BRepExtrema_ExtPF | |
32 | { | |
33 | public: | |
34 | ||
1c35b92f | 35 | DEFINE_STANDARD_ALLOC |
92d1589b A |
36 | |
37 | Standard_EXPORT BRepExtrema_ExtPF() | |
38 | {} | |
39 | //! It calculates all the distances. <br> | |
40 | Standard_EXPORT BRepExtrema_ExtPF(const TopoDS_Vertex& TheVertex,const TopoDS_Face& TheFace, | |
41 | const Extrema_ExtFlag TheFlag = Extrema_ExtFlag_MINMAX, | |
42 | const Extrema_ExtAlgo TheAlgo = Extrema_ExtAlgo_Grad); | |
43 | ||
44 | Standard_EXPORT void Initialize(const TopoDS_Face& TheFace, | |
45 | const Extrema_ExtFlag TheFlag = Extrema_ExtFlag_MINMAX, | |
46 | const Extrema_ExtAlgo TheAlgo = Extrema_ExtAlgo_Grad); | |
47 | ||
48 | //! An exception is raised if the fields have not been initialized. <br> | |
49 | //! Be careful: this method uses the Face only for classify not for the fields. <br> | |
50 | Standard_EXPORT void Perform(const TopoDS_Vertex& TheVertex,const TopoDS_Face& TheFace); | |
51 | //! True if the distances are found. <br> | |
52 | Standard_EXPORT Standard_Boolean IsDone() const | |
53 | { | |
54 | return myExtPS.IsDone(); | |
55 | } | |
56 | //! Returns the number of extremum distances. <br> | |
57 | Standard_EXPORT Standard_Integer NbExt() const | |
58 | { | |
59 | return myPoints.Length(); | |
60 | } | |
61 | //! Returns the value of the <N>th extremum square distance. <br> | |
62 | Standard_EXPORT Standard_Real SquareDistance(const Standard_Integer N) const | |
63 | { | |
64 | return mySqDist.Value(N); | |
65 | } | |
66 | //! Returns the parameters on the Face of the <N>th extremum distance. <br> | |
67 | Standard_EXPORT void Parameter(const Standard_Integer N,Standard_Real& U,Standard_Real& V) const | |
68 | { | |
69 | myPoints.Value(N).Parameter(U, V); | |
70 | } | |
71 | //! Returns the Point of the <N>th extremum distance. <br> | |
72 | Standard_EXPORT gp_Pnt Point(const Standard_Integer N) const | |
73 | { | |
74 | return myPoints.Value(N).Value(); | |
75 | } | |
76 | ||
77 | Standard_EXPORT void SetFlag(const Extrema_ExtFlag F) | |
78 | { | |
79 | myExtPS.SetFlag(F); | |
80 | } | |
81 | ||
82 | Standard_EXPORT void SetAlgo(const Extrema_ExtAlgo A) | |
83 | { | |
84 | myExtPS.SetAlgo(A); | |
85 | } | |
86 | ||
87 | private: | |
88 | ||
89 | Extrema_ExtPS myExtPS; | |
90 | TColStd_SequenceOfReal mySqDist; | |
91 | Extrema_SequenceOfPOnSurf myPoints; | |
92 | BRepAdaptor_Surface mySurf; | |
93 | }; | |
94 | ||
95 | #endif |