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_ExtCC_HeaderFile | |
15 | #define _BRepExtrema_ExtCC_HeaderFile | |
16 | ||
92d1589b | 17 | #include <Extrema_ExtCC.hxx> |
cb389a77 | 18 | #include <BRepAdaptor_HCurve.hxx> |
ebc93ae7 | 19 | #include <Standard_DefineAlloc.hxx> |
20 | ||
92d1589b A |
21 | class BRepAdaptor_HCurve; |
22 | class TopoDS_Edge; | |
23 | class gp_Pnt; | |
24 | ||
25 | ||
26 | class BRepExtrema_ExtCC | |
27 | { | |
28 | public: | |
29 | ||
1c35b92f | 30 | DEFINE_STANDARD_ALLOC |
92d1589b | 31 | |
0f57ab75 | 32 | BRepExtrema_ExtCC () |
92d1589b A |
33 | { |
34 | } | |
35 | //! It calculates all the distances. <br> | |
36 | Standard_EXPORT BRepExtrema_ExtCC(const TopoDS_Edge& E1,const TopoDS_Edge& E2); | |
37 | ||
38 | Standard_EXPORT void Initialize(const TopoDS_Edge& E2); | |
39 | //! An exception is raised if the fields have not been initialized. <br> | |
40 | Standard_EXPORT void Perform(const TopoDS_Edge& E1); | |
41 | //! True if the distances are found. <br> | |
0f57ab75 | 42 | Standard_Boolean IsDone() const |
92d1589b A |
43 | { |
44 | return myExtCC.IsDone(); | |
45 | } | |
46 | //! Returns the number of extremum distances. <br> | |
0f57ab75 | 47 | Standard_Integer NbExt() const |
92d1589b A |
48 | { |
49 | return myExtCC.NbExt(); | |
50 | } | |
51 | //! Returns True if E1 and E2 are parallel. <br> | |
0f57ab75 | 52 | Standard_Boolean IsParallel() const |
92d1589b A |
53 | { |
54 | return myExtCC.IsParallel(); | |
55 | } | |
56 | //! Returns the value of the <N>th extremum square distance. <br> | |
0f57ab75 | 57 | Standard_Real SquareDistance(const Standard_Integer N) const |
92d1589b A |
58 | { |
59 | return myExtCC.SquareDistance(N); | |
60 | } | |
61 | //! Returns the parameter on the first edge of the <N>th extremum distance. <br> | |
62 | Standard_EXPORT Standard_Real ParameterOnE1(const Standard_Integer N) const; | |
63 | //! Returns the Point of the <N>th extremum distance on the edge E1. <br> | |
64 | Standard_EXPORT gp_Pnt PointOnE1(const Standard_Integer N) const; | |
65 | //! Returns the parameter on the second edge of the <N>th extremum distance. <br> | |
66 | Standard_EXPORT Standard_Real ParameterOnE2(const Standard_Integer N) const; | |
67 | //! Returns the Point of the <N>th extremum distance on the edge E2. <br> | |
68 | Standard_EXPORT gp_Pnt PointOnE2(const Standard_Integer N) const; | |
69 | //! if the edges is a trimmed curve, <br> | |
70 | //! dist11 is a square distance between the point on E1 <br> | |
71 | //! of parameter FirstParameter and the point of <br> | |
72 | //! parameter FirstParameter on E2. <br> | |
73 | Standard_EXPORT void TrimmedSquareDistances(Standard_Real& dist11,Standard_Real& distP12,Standard_Real& distP21,Standard_Real& distP22,gp_Pnt& P11,gp_Pnt& P12,gp_Pnt& P21,gp_Pnt& P22) const; | |
74 | ||
75 | private: | |
76 | ||
77 | Extrema_ExtCC myExtCC; | |
857ffd5e | 78 | Handle(BRepAdaptor_HCurve) myHC; |
92d1589b A |
79 | }; |
80 | ||
81 | #endif |