1 // Created on: 1991-02-21
2 // Created by: Isabelle GRIGNON
3 // Copyright (c) 1991-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
5 //
6 // This file is part of Open CASCADE Technology software library.
7 //
8 // This library is free software; you can redistribute it and/or modify it under
9 // the terms of the GNU Lesser General Public License version 2.1 as published
10 // by the Free Software Foundation, with special exception defined in the file
11 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 // distribution for complete text of the license and disclaimer of any warranty.
13 //
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
16 
17 #ifndef _Extrema_ExtSS_HeaderFile
18 #define _Extrema_ExtSS_HeaderFile
19 
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
23 
24 #include <Extrema_ExtElSS.hxx>
25 #include <Extrema_SequenceOfPOnSurf.hxx>
26 #include <Standard_Real.hxx>
27 #include <TColStd_SequenceOfReal.hxx>
28 #include <GeomAbs_SurfaceType.hxx>
29 #include <Standard_Integer.hxx>
30 class Adaptor3d_Surface;
31 class Extrema_POnSurf;
32 
33 
34 //! It calculates all the extremum distances
35 //! between two surfaces.
36 //! These distances can be minimum or maximum.
37 class Extrema_ExtSS
38 {
39 public:
40 
41   DEFINE_STANDARD_ALLOC
42 
43 
44   Standard_EXPORT Extrema_ExtSS();
45 
46   //! It calculates all the distances between S1 and S2.
47   Standard_EXPORT Extrema_ExtSS(const Adaptor3d_Surface& S1, const Adaptor3d_Surface& S2, const Standard_Real TolS1, const Standard_Real TolS2);
48 
49   //! It calculates all the distances between S1 and S2.
50   Standard_EXPORT Extrema_ExtSS(const Adaptor3d_Surface& S1, const Adaptor3d_Surface& S2, const Standard_Real Uinf1, const Standard_Real Usup1, const Standard_Real Vinf1, const Standard_Real Vsup1, const Standard_Real Uinf2, const Standard_Real Usup2, const Standard_Real Vinf2, const Standard_Real Vsup2, const Standard_Real TolS1, const Standard_Real TolS2);
51 
52   //! Initializes the fields of the algorithm.
53   Standard_EXPORT void Initialize (const Adaptor3d_Surface& S2, const Standard_Real Uinf2, const Standard_Real Usup2, const Standard_Real Vinf2, const Standard_Real Vsup2, const Standard_Real TolS1);
54 
55   //! Computes the distances.
56   //! An exception is raised if the fieds have not been
57   //! initialized.
58   Standard_EXPORT void Perform (const Adaptor3d_Surface& S1, const Standard_Real Uinf1, const Standard_Real Usup1, const Standard_Real Vinf1, const Standard_Real Vsup1, const Standard_Real TolS1);
59 
60   //! Returns True if the distances are found.
61   Standard_EXPORT Standard_Boolean IsDone() const;
62 
63   //! Returns True if the surfaces are parallel
64   Standard_EXPORT Standard_Boolean IsParallel() const;
65 
66   //! Returns the number of extremum distances.
67   Standard_EXPORT Standard_Integer NbExt() const;
68 
69   //! Returns the value of the Nth resulting square distance.
70   Standard_EXPORT Standard_Real SquareDistance (const Standard_Integer N) const;
71 
72   //! Returns the point of the Nth resulting distance.
73   Standard_EXPORT void Points (const Standard_Integer N, Extrema_POnSurf& P1, Extrema_POnSurf& P2) const;
74 
75 private:
76 
77   const Adaptor3d_Surface* myS2;
78   Standard_Boolean myDone;
79   Standard_Boolean myIsPar;
80   Extrema_ExtElSS myExtElSS;
81   Extrema_SequenceOfPOnSurf myPOnS1;
82   Extrema_SequenceOfPOnSurf myPOnS2;
83   Standard_Real myuinf1;
84   Standard_Real myusup1;
85   Standard_Real myvinf1;
86   Standard_Real myvsup1;
87   Standard_Real myuinf2;
88   Standard_Real myusup2;
89   Standard_Real myvinf2;
90   Standard_Real myvsup2;
91   Standard_Real mytolS1;
92   Standard_Real mytolS2;
93   TColStd_SequenceOfReal mySqDist;
94   GeomAbs_SurfaceType myStype;
95 
96 };
97 
98 #endif // _Extrema_ExtSS_HeaderFile
99