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_ExtCF_HeaderFile | |
15 | #define _BRepExtrema_ExtCF_HeaderFile | |
16 | ||
92d1589b | 17 | #include <Extrema_ExtCS.hxx> |
92d1589b | 18 | #include <TColStd_SequenceOfReal.hxx> |
92d1589b | 19 | #include <Extrema_SequenceOfPOnSurf.hxx> |
92d1589b | 20 | #include <Extrema_SequenceOfPOnCurv.hxx> |
cb389a77 | 21 | #include <BRepAdaptor_HSurface.hxx> |
92d1589b | 22 | #include <Extrema_POnCurv.hxx> |
92d1589b | 23 | #include <Extrema_POnSurf.hxx> |
ebc93ae7 | 24 | #include <Standard_DefineAlloc.hxx> |
25 | ||
92d1589b A |
26 | class BRepAdaptor_HSurface; |
27 | class TopoDS_Edge; | |
28 | class TopoDS_Face; | |
29 | class gp_Pnt; | |
30 | ||
31 | ||
32 | class BRepExtrema_ExtCF | |
33 | { | |
34 | public: | |
35 | ||
1c35b92f | 36 | DEFINE_STANDARD_ALLOC |
92d1589b | 37 | |
0f57ab75 | 38 | BRepExtrema_ExtCF() |
92d1589b A |
39 | { |
40 | } | |
41 | //! It calculates all the distances. <br> | |
0e4e1240 | 42 | Standard_EXPORT BRepExtrema_ExtCF(const TopoDS_Edge& E,const TopoDS_Face& F); |
92d1589b | 43 | |
0e4e1240 | 44 | Standard_EXPORT void Initialize(const TopoDS_Edge& E, const TopoDS_Face& F); |
92d1589b A |
45 | //! An exception is raised if the fields have not been initialized. <br> |
46 | //! Be careful: this method uses the Face only for classify not for the fields. <br> | |
0e4e1240 | 47 | Standard_EXPORT void Perform(const TopoDS_Edge& E,const TopoDS_Face& F); |
92d1589b | 48 | //! True if the distances are found. <br> |
0f57ab75 | 49 | Standard_Boolean IsDone() const |
92d1589b A |
50 | { |
51 | return myExtCS.IsDone(); | |
52 | } | |
53 | //! Returns the number of extremum distances. <br> | |
0f57ab75 | 54 | Standard_Integer NbExt() const |
92d1589b A |
55 | { |
56 | return mySqDist.Length(); | |
57 | } | |
58 | //! Returns the value of the <N>th extremum square distance. <br> | |
0f57ab75 | 59 | Standard_Real SquareDistance(const Standard_Integer N) const |
92d1589b A |
60 | { |
61 | return mySqDist.Value(N); | |
62 | } | |
63 | //! Returns True if the curve is on a parallel surface. <br> | |
0f57ab75 | 64 | Standard_Boolean IsParallel() const |
92d1589b A |
65 | { |
66 | return myExtCS.IsParallel(); | |
67 | } | |
68 | //! Returns the parameters on the Edge of the <N>th extremum distance. <br> | |
0f57ab75 | 69 | Standard_Real ParameterOnEdge(const Standard_Integer N) const |
92d1589b A |
70 | { |
71 | return myPointsOnC.Value(N).Parameter(); | |
72 | } | |
73 | //! Returns the parameters on the Face of the <N>th extremum distance. <br> | |
0f57ab75 | 74 | void ParameterOnFace(const Standard_Integer N,Standard_Real& U,Standard_Real& V) const |
92d1589b A |
75 | { |
76 | myPointsOnS.Value(N).Parameter(U, V); | |
77 | } | |
78 | //! Returns the Point of the <N>th extremum distance. <br> | |
0f57ab75 | 79 | gp_Pnt PointOnEdge(const Standard_Integer N) const |
92d1589b A |
80 | { |
81 | return myPointsOnC.Value(N).Value(); | |
82 | } | |
83 | //! Returns the Point of the <N>th extremum distance. <br> | |
0f57ab75 | 84 | gp_Pnt PointOnFace(const Standard_Integer N) const |
92d1589b A |
85 | { |
86 | return myPointsOnS.Value(N).Value(); | |
87 | } | |
88 | ||
89 | private: | |
90 | ||
91 | Extrema_ExtCS myExtCS; | |
92 | TColStd_SequenceOfReal mySqDist; | |
93 | Extrema_SequenceOfPOnSurf myPointsOnS; | |
94 | Extrema_SequenceOfPOnCurv myPointsOnC; | |
857ffd5e | 95 | Handle(BRepAdaptor_HSurface) myHS; |
92d1589b A |
96 | }; |
97 | ||
98 | #endif |