0028966: Coding Rules - remove Adaptor2d_HCurve2d, Adaptor3d_HCurve and Adaptor3d_HSu...
[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 under
6 // the terms of the GNU Lesser General Public License 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 #include <Extrema_ExtSS.hxx>
18 #include <TColStd_SequenceOfReal.hxx>
19 #include <Extrema_SequenceOfPOnSurf.hxx>
20 #include <BRepAdaptor_Surface.hxx>
21 #include <Extrema_POnSurf.hxx>
22 #include <Standard_DefineAlloc.hxx>
23
24 class TopoDS_Face;
25 class gp_Pnt;
26
27 class BRepExtrema_ExtFF
28 {
29  public:
30
31   DEFINE_STANDARD_ALLOC
32   
33   BRepExtrema_ExtFF()
34   {
35   }
36   //! It calculates all the distances. <br>
37   Standard_EXPORT BRepExtrema_ExtFF(const TopoDS_Face& F1,const TopoDS_Face& F2);
38   
39   Standard_EXPORT void Initialize(const TopoDS_Face& F2) ;
40   //! An exception is raised if the fields have not been initialized. <br>
41   //! Be careful: this method uses the Face F2 only for classify, not for the fields. <br>
42   Standard_EXPORT void Perform(const TopoDS_Face& F1,const TopoDS_Face& F2);
43   //! True if the distances are found. <br>
44   Standard_Boolean IsDone() const
45   {
46     return myExtSS.IsDone();
47   }
48   //! Returns True if the surfaces are parallel. <br>
49   Standard_Boolean IsParallel() const
50   {
51     return myExtSS.IsParallel();
52   }
53   //! Returns the number of extremum distances. <br>
54   Standard_Integer NbExt() const
55   {
56     return mySqDist.Length();
57   }
58   //! Returns the value of the <N>th extremum square distance. <br>
59   Standard_Real SquareDistance(const Standard_Integer N) const
60   {
61     return mySqDist.Value(N);
62   }
63   //! Returns the parameters on the Face F1 of the <N>th extremum distance. <br>
64   void ParameterOnFace1(const Standard_Integer N,Standard_Real& U,Standard_Real& V) const
65   {
66     myPointsOnS1.Value(N).Parameter(U, V);
67   }
68   //! Returns the parameters on the Face F2 of the <N>th extremum distance. <br>
69   void ParameterOnFace2(const Standard_Integer N,Standard_Real& U,Standard_Real& V) const
70   {
71     myPointsOnS2.Value(N).Parameter(U, V);
72   }
73   //! Returns the Point of the <N>th extremum distance. <br>
74   gp_Pnt PointOnFace1(const Standard_Integer N) const
75   {
76     return myPointsOnS1.Value(N).Value(); 
77   }
78   //! Returns the Point of the <N>th extremum distance. <br>
79   gp_Pnt PointOnFace2(const Standard_Integer N) const
80   {
81     return myPointsOnS2.Value(N).Value();
82   }
83
84  private:
85
86   Extrema_ExtSS myExtSS;
87   TColStd_SequenceOfReal mySqDist;
88   Extrema_SequenceOfPOnSurf myPointsOnS1;
89   Extrema_SequenceOfPOnSurf myPointsOnS2;
90   Handle(BRepAdaptor_Surface) myHS;
91 };
92
93 #endif