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_ExtPC_HeaderFile | |
15 | #define _BRepExtrema_ExtPC_HeaderFile | |
16 | ||
92d1589b | 17 | #include <Extrema_ExtPC.hxx> |
cb389a77 | 18 | #include <BRepAdaptor_HCurve.hxx> |
ebc93ae7 | 19 | #include <Standard_DefineAlloc.hxx> |
20 | ||
92d1589b A |
21 | class BRepAdaptor_HCurve; |
22 | class TopoDS_Vertex; | |
23 | class TopoDS_Edge; | |
24 | class gp_Pnt; | |
25 | ||
26 | ||
27 | class BRepExtrema_ExtPC | |
28 | { | |
29 | public: | |
30 | ||
1c35b92f | 31 | DEFINE_STANDARD_ALLOC |
92d1589b A |
32 | |
33 | Standard_EXPORT BRepExtrema_ExtPC() | |
34 | { | |
35 | } | |
36 | //! It calculates all the distances. <br> | |
37 | Standard_EXPORT BRepExtrema_ExtPC(const TopoDS_Vertex& V,const TopoDS_Edge& E); | |
38 | ||
39 | Standard_EXPORT void Initialize(const TopoDS_Edge& E); | |
40 | //! An exception is raised if the fields have not been initialized. <br> | |
41 | Standard_EXPORT void Perform(const TopoDS_Vertex& V); | |
42 | //! True if the distances are found. <br> | |
43 | Standard_EXPORT Standard_Boolean IsDone() const | |
44 | { | |
45 | return myExtPC.IsDone(); | |
46 | } | |
47 | //! Returns the number of extremum distances. <br> | |
48 | Standard_EXPORT Standard_Integer NbExt() const | |
49 | { | |
50 | return myExtPC.NbExt(); | |
51 | } | |
52 | //! Returns True if the <N>th extremum distance is a minimum. <br> | |
53 | Standard_EXPORT Standard_Boolean IsMin(const Standard_Integer N) const | |
54 | { | |
55 | return myExtPC.IsMin(N); | |
56 | } | |
57 | //! Returns the value of the <N>th extremum square distance. <br> | |
58 | Standard_EXPORT Standard_Real SquareDistance(const Standard_Integer N) const | |
59 | { | |
60 | return myExtPC.SquareDistance(N); | |
61 | } | |
62 | //! Returns the parameter on the edge of the <N>th extremum distance. <br> | |
63 | Standard_EXPORT Standard_Real Parameter(const Standard_Integer N) const | |
64 | { | |
65 | return myExtPC.Point(N).Parameter(); | |
66 | } | |
67 | //! Returns the Point of the <N>th extremum distance. <br> | |
68 | Standard_EXPORT gp_Pnt Point(const Standard_Integer N) const | |
69 | { | |
70 | return myExtPC.Point(N).Value(); | |
71 | } | |
72 | //! if the curve is a trimmed curve, <br> | |
73 | //! dist1 is a square distance between <P> and the point <br> | |
74 | //! of parameter FirstParameter <pnt1> and <br> | |
75 | //! dist2 is a square distance between <P> and the point <br> | |
76 | //! of parameter LastParameter <pnt2>. <br> | |
77 | Standard_EXPORT void TrimmedSquareDistances(Standard_Real& dist1,Standard_Real& dist2,gp_Pnt& pnt1,gp_Pnt& pnt2) const | |
78 | { | |
79 | myExtPC.TrimmedSquareDistances(dist1,dist2,pnt1,pnt2); | |
80 | } | |
81 | ||
82 | private: | |
83 | ||
84 | Extrema_ExtPC myExtPC; | |
857ffd5e | 85 | Handle(BRepAdaptor_HCurve) myHC; |
92d1589b A |
86 | }; |
87 | ||
88 | #endif |