0023024: Update headers of OCCT files
[occt.git] / src / BRepExtrema / BRepExtrema_ExtPC.hxx
1 // Copyright (c) 1999-2012 OPEN CASCADE SAS
2 //
3 // The content of this file is subject to the Open CASCADE Technology Public
4 // License Version 6.5 (the "License"). You may not use the content of this file
5 // except in compliance with the License. Please obtain a copy of the License
6 // at http://www.opencascade.org and read it completely before using this file.
7 //
8 // The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
9 // main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
10 //
11 // The Original Code and all software distributed under the License is
12 // distributed on an "AS IS" basis, without warranty of any kind, and the
13 // Initial Developer hereby disclaims all such warranties, including without
14 // limitation, any warranties of merchantability, fitness for a particular
15 // purpose or non-infringement. Please see the License for the specific terms
16 // and conditions governing the rights and limitations under the License.
17
18 #ifndef _BRepExtrema_ExtPC_HeaderFile
19 #define _BRepExtrema_ExtPC_HeaderFile
20
21 #ifndef _Standard_HeaderFile
22 #include <Standard.hxx>
23 #endif
24 #ifndef _Standard_DefineAlloc_HeaderFile
25 #include <Standard_DefineAlloc.hxx>
26 #endif
27 #ifndef _Standard_Macro_HeaderFile
28 #include <Standard_Macro.hxx>
29 #endif
30
31 #ifndef _Extrema_ExtPC_HeaderFile
32 #include <Extrema_ExtPC.hxx>
33 #endif
34 #ifndef _Handle_BRepAdaptor_HCurve_HeaderFile
35 #include <Handle_BRepAdaptor_HCurve.hxx>
36 #endif
37 #ifndef _Standard_Boolean_HeaderFile
38 #include <Standard_Boolean.hxx>
39 #endif
40 #ifndef _Standard_Integer_HeaderFile
41 #include <Standard_Integer.hxx>
42 #endif
43 #ifndef _Standard_Real_HeaderFile
44 #include <Standard_Real.hxx>
45 #endif
46 class BRepAdaptor_HCurve;
47 class TopoDS_Vertex;
48 class TopoDS_Edge;
49 class gp_Pnt;
50
51
52 class BRepExtrema_ExtPC
53 {
54  public:
55
56   DEFINE_STANDARD_ALLOC
57   
58   Standard_EXPORT BRepExtrema_ExtPC()
59   {
60   }
61   //! It calculates all the distances. <br>
62   Standard_EXPORT BRepExtrema_ExtPC(const TopoDS_Vertex& V,const TopoDS_Edge& E);
63   
64   Standard_EXPORT void Initialize(const TopoDS_Edge& E);
65   //! An exception is raised if the fields have not been initialized. <br>
66   Standard_EXPORT void Perform(const TopoDS_Vertex& V);
67   //! True if the distances are found. <br>
68   Standard_EXPORT Standard_Boolean IsDone() const
69   {
70     return myExtPC.IsDone();
71   }
72   //! Returns the number of extremum distances. <br>
73   Standard_EXPORT Standard_Integer NbExt() const
74   {
75     return myExtPC.NbExt();
76   }
77   //! Returns True if the <N>th extremum distance is a minimum. <br>
78   Standard_EXPORT Standard_Boolean IsMin(const Standard_Integer N) const
79   {
80     return myExtPC.IsMin(N);
81   }
82   //! Returns the value of the <N>th extremum square distance. <br>
83   Standard_EXPORT Standard_Real SquareDistance(const Standard_Integer N) const
84   {
85     return myExtPC.SquareDistance(N);
86   }
87   //! Returns the parameter on the edge of the <N>th extremum distance. <br>
88   Standard_EXPORT Standard_Real Parameter(const Standard_Integer N) const
89   {
90     return myExtPC.Point(N).Parameter();
91   }
92   //! Returns the Point of the <N>th extremum distance. <br>
93   Standard_EXPORT gp_Pnt Point(const Standard_Integer N) const
94   {
95     return myExtPC.Point(N).Value();
96   }
97   //! if the curve is a trimmed curve, <br>
98   //! dist1 is a square distance between <P> and the point <br>
99   //! of parameter FirstParameter <pnt1> and <br>
100   //! dist2 is a square distance between <P> and the point <br>
101   //! of parameter LastParameter <pnt2>. <br>
102   Standard_EXPORT void TrimmedSquareDistances(Standard_Real& dist1,Standard_Real& dist2,gp_Pnt& pnt1,gp_Pnt& pnt2) const
103   {
104     myExtPC.TrimmedSquareDistances(dist1,dist2,pnt1,pnt2);
105   }
106
107  private:
108
109   Extrema_ExtPC myExtPC;
110   Handle_BRepAdaptor_HCurve myHC;
111 };
112
113 #endif