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_HSurface.hxx>
21 #include <Extrema_POnSurf.hxx>
22 #include <Standard_DefineAlloc.hxx>
24 class BRepAdaptor_HSurface;
30 class BRepExtrema_ExtFF
36 Standard_EXPORT BRepExtrema_ExtFF()
39 //! It calculates all the distances. <br>
40 Standard_EXPORT BRepExtrema_ExtFF(const TopoDS_Face& F1,const TopoDS_Face& F2);
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
49 return myExtSS.IsDone();
51 //! Returns True if the surfaces are parallel. <br>
52 Standard_EXPORT Standard_Boolean IsParallel() const
54 return myExtSS.IsParallel();
56 //! Returns the number of extremum distances. <br>
57 Standard_EXPORT Standard_Integer NbExt() const
59 return mySqDist.Length();
61 //! Returns the value of the <N>th extremum square distance. <br>
62 Standard_EXPORT Standard_Real SquareDistance(const Standard_Integer N) const
64 return mySqDist.Value(N);
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
69 myPointsOnS1.Value(N).Parameter(U, V);
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
74 myPointsOnS2.Value(N).Parameter(U, V);
76 //! Returns the Point of the <N>th extremum distance. <br>
77 Standard_EXPORT gp_Pnt PointOnFace1(const Standard_Integer N) const
79 return myPointsOnS1.Value(N).Value();
81 //! Returns the Point of the <N>th extremum distance. <br>
82 Standard_EXPORT gp_Pnt PointOnFace2(const Standard_Integer N) const
84 return myPointsOnS2.Value(N).Value();
89 Extrema_ExtSS myExtSS;
90 TColStd_SequenceOfReal mySqDist;
91 Extrema_SequenceOfPOnSurf myPointsOnS1;
92 Extrema_SequenceOfPOnSurf myPointsOnS2;
93 Handle_BRepAdaptor_HSurface myHS;