0024428: Implementation of LGPL license
[occt.git] / src / BRepExtrema / BRepExtrema_ExtCC.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_ExtCC_HeaderFile
15#define _BRepExtrema_ExtCC_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_ExtCC_HeaderFile
28#include <Extrema_ExtCC.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_Edge;
44class gp_Pnt;
45
46
47class BRepExtrema_ExtCC
48{
49 public:
50
1c35b92f 51 DEFINE_STANDARD_ALLOC
92d1589b
A
52
53 Standard_EXPORT BRepExtrema_ExtCC()
54 {
55 }
56 //! It calculates all the distances. <br>
57 Standard_EXPORT BRepExtrema_ExtCC(const TopoDS_Edge& E1,const TopoDS_Edge& E2);
58
59 Standard_EXPORT void Initialize(const TopoDS_Edge& E2);
60 //! An exception is raised if the fields have not been initialized. <br>
61 Standard_EXPORT void Perform(const TopoDS_Edge& E1);
62 //! True if the distances are found. <br>
63 Standard_EXPORT Standard_Boolean IsDone() const
64 {
65 return myExtCC.IsDone();
66 }
67 //! Returns the number of extremum distances. <br>
68 Standard_EXPORT Standard_Integer NbExt() const
69 {
70 return myExtCC.NbExt();
71 }
72 //! Returns True if E1 and E2 are parallel. <br>
73 Standard_EXPORT Standard_Boolean IsParallel() const
74 {
75 return myExtCC.IsParallel();
76 }
77 //! Returns the value of the <N>th extremum square distance. <br>
78 Standard_EXPORT Standard_Real SquareDistance(const Standard_Integer N) const
79 {
80 return myExtCC.SquareDistance(N);
81 }
82 //! Returns the parameter on the first edge of the <N>th extremum distance. <br>
83 Standard_EXPORT Standard_Real ParameterOnE1(const Standard_Integer N) const;
84 //! Returns the Point of the <N>th extremum distance on the edge E1. <br>
85 Standard_EXPORT gp_Pnt PointOnE1(const Standard_Integer N) const;
86 //! Returns the parameter on the second edge of the <N>th extremum distance. <br>
87 Standard_EXPORT Standard_Real ParameterOnE2(const Standard_Integer N) const;
88 //! Returns the Point of the <N>th extremum distance on the edge E2. <br>
89 Standard_EXPORT gp_Pnt PointOnE2(const Standard_Integer N) const;
90 //! if the edges is a trimmed curve, <br>
91 //! dist11 is a square distance between the point on E1 <br>
92 //! of parameter FirstParameter and the point of <br>
93 //! parameter FirstParameter on E2. <br>
94 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;
95
96 private:
97
98 Extrema_ExtCC myExtCC;
99 Handle_BRepAdaptor_HCurve myHC;
100};
101
102#endif