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> |
cb389a77 | 20 | #include <BRepAdaptor_HSurface.hxx> |
92d1589b | 21 | #include <Extrema_POnSurf.hxx> |
ebc93ae7 | 22 | #include <Standard_DefineAlloc.hxx> |
23 | ||
92d1589b A |
24 | class BRepAdaptor_HSurface; |
25 | class TopoDS_Face; | |
26 | class gp_Pnt; | |
27 | ||
28 | ||
29 | ||
30 | class BRepExtrema_ExtFF | |
31 | { | |
32 | public: | |
33 | ||
1c35b92f | 34 | DEFINE_STANDARD_ALLOC |
92d1589b A |
35 | |
36 | Standard_EXPORT BRepExtrema_ExtFF() | |
37 | { | |
38 | } | |
39 | //! It calculates all the distances. <br> | |
40 | Standard_EXPORT BRepExtrema_ExtFF(const TopoDS_Face& F1,const TopoDS_Face& F2); | |
41 | ||
42 | Standard_EXPORT void Initialize(const TopoDS_Face& F2) ; | |
43 | //! An exception is raised if the fields have not been initialized. <br> | |
44 | //! Be careful: this method uses the Face F2 only for classify, not for the fields. <br> | |
45 | Standard_EXPORT void Perform(const TopoDS_Face& F1,const TopoDS_Face& F2); | |
46 | //! True if the distances are found. <br> | |
47 | Standard_EXPORT Standard_Boolean IsDone() const | |
48 | { | |
49 | return myExtSS.IsDone(); | |
50 | } | |
51 | //! Returns True if the surfaces are parallel. <br> | |
52 | Standard_EXPORT Standard_Boolean IsParallel() const | |
53 | { | |
54 | return myExtSS.IsParallel(); | |
55 | } | |
56 | //! Returns the number of extremum distances. <br> | |
57 | Standard_EXPORT Standard_Integer NbExt() const | |
58 | { | |
59 | return mySqDist.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 F1 of the <N>th extremum distance. <br> | |
67 | Standard_EXPORT void ParameterOnFace1(const Standard_Integer N,Standard_Real& U,Standard_Real& V) const | |
68 | { | |
69 | myPointsOnS1.Value(N).Parameter(U, V); | |
70 | } | |
71 | //! Returns the parameters on the Face F2 of the <N>th extremum distance. <br> | |
72 | Standard_EXPORT void ParameterOnFace2(const Standard_Integer N,Standard_Real& U,Standard_Real& V) const | |
73 | { | |
74 | myPointsOnS2.Value(N).Parameter(U, V); | |
75 | } | |
76 | //! Returns the Point of the <N>th extremum distance. <br> | |
77 | Standard_EXPORT gp_Pnt PointOnFace1(const Standard_Integer N) const | |
78 | { | |
79 | return myPointsOnS1.Value(N).Value(); | |
80 | } | |
81 | //! Returns the Point of the <N>th extremum distance. <br> | |
82 | Standard_EXPORT gp_Pnt PointOnFace2(const Standard_Integer N) const | |
83 | { | |
84 | return myPointsOnS2.Value(N).Value(); | |
85 | } | |
86 | ||
87 | private: | |
88 | ||
89 | Extrema_ExtSS myExtSS; | |
90 | TColStd_SequenceOfReal mySqDist; | |
91 | Extrema_SequenceOfPOnSurf myPointsOnS1; | |
92 | Extrema_SequenceOfPOnSurf myPointsOnS2; | |
857ffd5e | 93 | Handle(BRepAdaptor_HSurface) myHS; |
92d1589b A |
94 | }; |
95 | ||
96 | #endif |