0024428: Implementation of LGPL license
[occt.git] / src / BRepExtrema / BRepExtrema_ExtPC.hxx
CommitLineData
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//
973c2be1 5// This library is free software; you can redistribute it and / or modify it
6// under the terms of the GNU Lesser General Public version 2.1 as published
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
17#ifndef _Standard_HeaderFile
18#include <Standard.hxx>
19#endif
1c35b92f 20#ifndef _Standard_DefineAlloc_HeaderFile
21#include <Standard_DefineAlloc.hxx>
22#endif
92d1589b
A
23#ifndef _Standard_Macro_HeaderFile
24#include <Standard_Macro.hxx>
25#endif
26
27#ifndef _Extrema_ExtPC_HeaderFile
28#include <Extrema_ExtPC.hxx>
29#endif
30#ifndef _Handle_BRepAdaptor_HCurve_HeaderFile
31#include <Handle_BRepAdaptor_HCurve.hxx>
32#endif
33#ifndef _Standard_Boolean_HeaderFile
34#include <Standard_Boolean.hxx>
35#endif
36#ifndef _Standard_Integer_HeaderFile
37#include <Standard_Integer.hxx>
38#endif
39#ifndef _Standard_Real_HeaderFile
40#include <Standard_Real.hxx>
41#endif
42class BRepAdaptor_HCurve;
43class TopoDS_Vertex;
44class TopoDS_Edge;
45class gp_Pnt;
46
47
48class BRepExtrema_ExtPC
49{
50 public:
51
1c35b92f 52 DEFINE_STANDARD_ALLOC
92d1589b
A
53
54 Standard_EXPORT BRepExtrema_ExtPC()
55 {
56 }
57 //! It calculates all the distances. <br>
58 Standard_EXPORT BRepExtrema_ExtPC(const TopoDS_Vertex& V,const TopoDS_Edge& E);
59
60 Standard_EXPORT void Initialize(const TopoDS_Edge& E);
61 //! An exception is raised if the fields have not been initialized. <br>
62 Standard_EXPORT void Perform(const TopoDS_Vertex& V);
63 //! True if the distances are found. <br>
64 Standard_EXPORT Standard_Boolean IsDone() const
65 {
66 return myExtPC.IsDone();
67 }
68 //! Returns the number of extremum distances. <br>
69 Standard_EXPORT Standard_Integer NbExt() const
70 {
71 return myExtPC.NbExt();
72 }
73 //! Returns True if the <N>th extremum distance is a minimum. <br>
74 Standard_EXPORT Standard_Boolean IsMin(const Standard_Integer N) const
75 {
76 return myExtPC.IsMin(N);
77 }
78 //! Returns the value of the <N>th extremum square distance. <br>
79 Standard_EXPORT Standard_Real SquareDistance(const Standard_Integer N) const
80 {
81 return myExtPC.SquareDistance(N);
82 }
83 //! Returns the parameter on the edge of the <N>th extremum distance. <br>
84 Standard_EXPORT Standard_Real Parameter(const Standard_Integer N) const
85 {
86 return myExtPC.Point(N).Parameter();
87 }
88 //! Returns the Point of the <N>th extremum distance. <br>
89 Standard_EXPORT gp_Pnt Point(const Standard_Integer N) const
90 {
91 return myExtPC.Point(N).Value();
92 }
93 //! if the curve is a trimmed curve, <br>
94 //! dist1 is a square distance between <P> and the point <br>
95 //! of parameter FirstParameter <pnt1> and <br>
96 //! dist2 is a square distance between <P> and the point <br>
97 //! of parameter LastParameter <pnt2>. <br>
98 Standard_EXPORT void TrimmedSquareDistances(Standard_Real& dist1,Standard_Real& dist2,gp_Pnt& pnt1,gp_Pnt& pnt2) const
99 {
100 myExtPC.TrimmedSquareDistances(dist1,dist2,pnt1,pnt2);
101 }
102
103 private:
104
105 Extrema_ExtPC myExtPC;
106 Handle_BRepAdaptor_HCurve myHC;
107};
108
109#endif