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