1 // Copyright (c) 1999-2014 OPEN CASCADE SAS
3 // This file is part of Open CASCADE Technology software library.
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.
11 // Alternatively, this file may be used under the terms of Open CASCADE
12 // commercial license or contractual agreement.
14 #ifndef _BRepExtrema_ExtFF_HeaderFile
15 #define _BRepExtrema_ExtFF_HeaderFile
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>
27 class BRepExtrema_ExtFF
36 //! It calculates all the distances. <br>
37 Standard_EXPORT BRepExtrema_ExtFF(const TopoDS_Face& F1,const TopoDS_Face& F2);
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
46 return myExtSS.IsDone();
48 //! Returns True if the surfaces are parallel. <br>
49 Standard_Boolean IsParallel() const
51 return myExtSS.IsParallel();
53 //! Returns the number of extremum distances. <br>
54 Standard_Integer NbExt() const
56 return mySqDist.Length();
58 //! Returns the value of the <N>th extremum square distance. <br>
59 Standard_Real SquareDistance(const Standard_Integer N) const
61 return mySqDist.Value(N);
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
66 myPointsOnS1.Value(N).Parameter(U, V);
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
71 myPointsOnS2.Value(N).Parameter(U, V);
73 //! Returns the Point of the <N>th extremum distance. <br>
74 gp_Pnt PointOnFace1(const Standard_Integer N) const
76 return myPointsOnS1.Value(N).Value();
78 //! Returns the Point of the <N>th extremum distance. <br>
79 gp_Pnt PointOnFace2(const Standard_Integer N) const
81 return myPointsOnS2.Value(N).Value();
86 Extrema_ExtSS myExtSS;
87 TColStd_SequenceOfReal mySqDist;
88 Extrema_SequenceOfPOnSurf myPointsOnS1;
89 Extrema_SequenceOfPOnSurf myPointsOnS2;
90 Handle(BRepAdaptor_Surface) myHS;