Commit | Line | Data |
---|---|---|
973c2be1 | 1 | // Copyright (c) 1999-2014 OPEN CASCADE SAS |
b311480e | 2 | // |
973c2be1 | 3 | // This file is part of Open CASCADE Technology software library. |
b311480e | 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_ExtFF_HeaderFile | |
15 | #define _BRepExtrema_ExtFF_HeaderFile | |
16 | ||
92d1589b | 17 | #include <Extrema_ExtSS.hxx> |
92d1589b | 18 | #include <TColStd_SequenceOfReal.hxx> |
92d1589b | 19 | #include <Extrema_SequenceOfPOnSurf.hxx> |
c22b52d6 | 20 | #include <BRepAdaptor_Surface.hxx> |
92d1589b | 21 | #include <Extrema_POnSurf.hxx> |
ebc93ae7 | 22 | #include <Standard_DefineAlloc.hxx> |
23 | ||
92d1589b | 24 | class TopoDS_Face; |
92d1589b | 25 | |
92d1589b A |
26 | class BRepExtrema_ExtFF |
27 | { | |
28 | public: | |
29 | ||
1c35b92f | 30 | DEFINE_STANDARD_ALLOC |
92d1589b | 31 | |
0f57ab75 | 32 | BRepExtrema_ExtFF() |
92d1589b A |
33 | { |
34 | } | |
35 | //! It calculates all the distances. <br> | |
36 | Standard_EXPORT BRepExtrema_ExtFF(const TopoDS_Face& F1,const TopoDS_Face& F2); | |
37 | ||
38 | Standard_EXPORT void Initialize(const TopoDS_Face& F2) ; | |
39 | //! An exception is raised if the fields have not been initialized. <br> | |
40 | //! Be careful: this method uses the Face F2 only for classify, not for the fields. <br> | |
41 | Standard_EXPORT void Perform(const TopoDS_Face& F1,const TopoDS_Face& F2); | |
42 | //! True if the distances are found. <br> | |
0f57ab75 | 43 | Standard_Boolean IsDone() const |
92d1589b A |
44 | { |
45 | return myExtSS.IsDone(); | |
46 | } | |
47 | //! Returns True if the surfaces are parallel. <br> | |
0f57ab75 | 48 | Standard_Boolean IsParallel() const |
92d1589b A |
49 | { |
50 | return myExtSS.IsParallel(); | |
51 | } | |
52 | //! Returns the number of extremum distances. <br> | |
0f57ab75 | 53 | Standard_Integer NbExt() const |
92d1589b A |
54 | { |
55 | return mySqDist.Length(); | |
56 | } | |
57 | //! Returns the value of the <N>th extremum square distance. <br> | |
0f57ab75 | 58 | Standard_Real SquareDistance(const Standard_Integer N) const |
92d1589b A |
59 | { |
60 | return mySqDist.Value(N); | |
61 | } | |
62 | //! Returns the parameters on the Face F1 of the <N>th extremum distance. <br> | |
0f57ab75 | 63 | void ParameterOnFace1(const Standard_Integer N,Standard_Real& U,Standard_Real& V) const |
92d1589b A |
64 | { |
65 | myPointsOnS1.Value(N).Parameter(U, V); | |
66 | } | |
67 | //! Returns the parameters on the Face F2 of the <N>th extremum distance. <br> | |
0f57ab75 | 68 | void ParameterOnFace2(const Standard_Integer N,Standard_Real& U,Standard_Real& V) const |
92d1589b A |
69 | { |
70 | myPointsOnS2.Value(N).Parameter(U, V); | |
71 | } | |
72 | //! Returns the Point of the <N>th extremum distance. <br> | |
0f57ab75 | 73 | gp_Pnt PointOnFace1(const Standard_Integer N) const |
92d1589b A |
74 | { |
75 | return myPointsOnS1.Value(N).Value(); | |
76 | } | |
77 | //! Returns the Point of the <N>th extremum distance. <br> | |
0f57ab75 | 78 | gp_Pnt PointOnFace2(const Standard_Integer N) const |
92d1589b A |
79 | { |
80 | return myPointsOnS2.Value(N).Value(); | |
81 | } | |
82 | ||
83 | private: | |
84 | ||
85 | Extrema_ExtSS myExtSS; | |
86 | TColStd_SequenceOfReal mySqDist; | |
87 | Extrema_SequenceOfPOnSurf myPointsOnS1; | |
88 | Extrema_SequenceOfPOnSurf myPointsOnS2; | |
c22b52d6 | 89 | Handle(BRepAdaptor_Surface) myHS; |
92d1589b A |
90 | }; |
91 | ||
92 | #endif |