0024428: Implementation of LGPL license
[occt.git] / src / BRepExtrema / BRepExtrema_ExtFF.hxx
1 // Copyright (c) 1999-2014 OPEN CASCADE SAS
2 //
3 // This file is part of Open CASCADE Technology software library.
4 //
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.
10 //
11 // Alternatively, this file may be used under the terms of Open CASCADE
12 // commercial license or contractual agreement.
13
14 #ifndef _BRepExtrema_ExtFF_HeaderFile
15 #define _BRepExtrema_ExtFF_HeaderFile
16
17 #ifndef _Standard_HeaderFile
18 #include <Standard.hxx>
19 #endif
20 #ifndef _Standard_DefineAlloc_HeaderFile
21 #include <Standard_DefineAlloc.hxx>
22 #endif
23 #ifndef _Standard_Macro_HeaderFile
24 #include <Standard_Macro.hxx>
25 #endif
26
27 #ifndef _Extrema_ExtSS_HeaderFile
28 #include <Extrema_ExtSS.hxx>
29 #endif
30 #ifndef _Standard_Integer_HeaderFile
31 #include <Standard_Integer.hxx>
32 #endif
33 #ifndef _TColStd_SequenceOfReal_HeaderFile
34 #include <TColStd_SequenceOfReal.hxx>
35 #endif
36 #ifndef _Extrema_SequenceOfPOnSurf_HeaderFile
37 #include <Extrema_SequenceOfPOnSurf.hxx>
38 #endif
39 #ifndef _Handle_BRepAdaptor_HSurface_HeaderFile
40 #include <Handle_BRepAdaptor_HSurface.hxx>
41 #endif
42 #ifndef _Standard_Boolean_HeaderFile
43 #include <Standard_Boolean.hxx>
44 #endif
45 #ifndef _Standard_Real_HeaderFile
46 #include <Standard_Real.hxx>
47 #endif
48 #ifndef _Extrema_POnSurf_HeaderFile
49 #include <Extrema_POnSurf.hxx>
50 #endif
51 class BRepAdaptor_HSurface;
52 class TopoDS_Face;
53 class gp_Pnt;
54
55
56
57 class BRepExtrema_ExtFF
58 {
59  public:
60
61   DEFINE_STANDARD_ALLOC
62   
63   Standard_EXPORT BRepExtrema_ExtFF()
64   {
65   }
66   //! It calculates all the distances. <br>
67   Standard_EXPORT BRepExtrema_ExtFF(const TopoDS_Face& F1,const TopoDS_Face& F2);
68   
69   Standard_EXPORT void Initialize(const TopoDS_Face& F2) ;
70   //! An exception is raised if the fields have not been initialized. <br>
71   //! Be careful: this method uses the Face F2 only for classify, not for the fields. <br>
72   Standard_EXPORT void Perform(const TopoDS_Face& F1,const TopoDS_Face& F2);
73   //! True if the distances are found. <br>
74   Standard_EXPORT Standard_Boolean IsDone() const
75   {
76     return myExtSS.IsDone();
77   }
78   //! Returns True if the surfaces are parallel. <br>
79   Standard_EXPORT Standard_Boolean IsParallel() const
80   {
81     return myExtSS.IsParallel();
82   }
83   //! Returns the number of extremum distances. <br>
84   Standard_EXPORT Standard_Integer NbExt() const
85   {
86     return mySqDist.Length();
87   }
88   //! Returns the value of the <N>th extremum square distance. <br>
89   Standard_EXPORT Standard_Real SquareDistance(const Standard_Integer N) const
90   {
91     return mySqDist.Value(N);
92   }
93   //! Returns the parameters on the Face F1 of the <N>th extremum distance. <br>
94   Standard_EXPORT void ParameterOnFace1(const Standard_Integer N,Standard_Real& U,Standard_Real& V) const
95   {
96     myPointsOnS1.Value(N).Parameter(U, V);
97   }
98   //! Returns the parameters on the Face F2 of the <N>th extremum distance. <br>
99   Standard_EXPORT void ParameterOnFace2(const Standard_Integer N,Standard_Real& U,Standard_Real& V) const
100   {
101     myPointsOnS2.Value(N).Parameter(U, V);
102   }
103   //! Returns the Point of the <N>th extremum distance. <br>
104   Standard_EXPORT gp_Pnt PointOnFace1(const Standard_Integer N) const
105   {
106     return myPointsOnS1.Value(N).Value(); 
107   }
108   //! Returns the Point of the <N>th extremum distance. <br>
109   Standard_EXPORT gp_Pnt PointOnFace2(const Standard_Integer N) const
110   {
111     return myPointsOnS2.Value(N).Value();
112   }
113
114  private:
115
116   Extrema_ExtSS myExtSS;
117   TColStd_SequenceOfReal mySqDist;
118   Extrema_SequenceOfPOnSurf myPointsOnS1;
119   Extrema_SequenceOfPOnSurf myPointsOnS2;
120   Handle_BRepAdaptor_HSurface myHS;
121 };
122
123 #endif