Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:03:28

0001 // Created on: 1992-07-22
0002 // Created by: Laurent PAINNOT
0003 // Copyright (c) 1992-1999 Matra Datavision
0004 // Copyright (c) 1999-2014 OPEN CASCADE SAS
0005 //
0006 // This file is part of Open CASCADE Technology software library.
0007 //
0008 // This library is free software; you can redistribute it and/or modify it under
0009 // the terms of the GNU Lesser General Public License version 2.1 as published
0010 // by the Free Software Foundation, with special exception defined in the file
0011 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0012 // distribution for complete text of the license and disclaimer of any warranty.
0013 //
0014 // Alternatively, this file may be used under the terms of Open CASCADE
0015 // commercial license or contractual agreement.
0016 
0017 #ifndef _Extrema_ExtElSS_HeaderFile
0018 #define _Extrema_ExtElSS_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 #include <Standard_Handle.hxx>
0023 
0024 #include <Standard_Boolean.hxx>
0025 #include <Standard_Integer.hxx>
0026 #include <TColStd_HArray1OfReal.hxx>
0027 #include <Extrema_HArray1OfPOnSurf.hxx>
0028 #include <Standard_Real.hxx>
0029 
0030 class gp_Pln;
0031 class gp_Sphere;
0032 class gp_Cylinder;
0033 class gp_Cone;
0034 class gp_Torus;
0035 class Extrema_POnSurf;
0036 
0037 
0038 //! It calculates all the distances between 2 elementary
0039 //! surfaces.
0040 //! These distances can be maximum or minimum.
0041 class Extrema_ExtElSS 
0042 {
0043 public:
0044 
0045   DEFINE_STANDARD_ALLOC
0046 
0047   
0048   Standard_EXPORT Extrema_ExtElSS();
0049   
0050   //! Calculates the distances between 2 planes.
0051   //! These planes can be parallel.
0052   Standard_EXPORT Extrema_ExtElSS(const gp_Pln& S1, const gp_Pln& S2);
0053   
0054   Standard_EXPORT void Perform (const gp_Pln& S1, const gp_Pln& S2);
0055   
0056   //! Calculates the distances between a plane
0057   //! and a sphere.
0058   Standard_EXPORT Extrema_ExtElSS(const gp_Pln& S1, const gp_Sphere& S2);
0059   
0060   Standard_EXPORT void Perform (const gp_Pln& S1, const gp_Sphere& S2);
0061   
0062   //! Calculates the distances between 2 spheres.
0063   //! These spheres can be parallel.
0064   Standard_EXPORT Extrema_ExtElSS(const gp_Sphere& S1, const gp_Sphere& S2);
0065   
0066   Standard_EXPORT void Perform (const gp_Sphere& S1, const gp_Sphere& S2);
0067   
0068   //! Calculates the distances between a sphere
0069   //! and a cylinder.
0070   Standard_EXPORT Extrema_ExtElSS(const gp_Sphere& S1, const gp_Cylinder& S2);
0071   
0072   Standard_EXPORT void Perform (const gp_Sphere& S1, const gp_Cylinder& S2);
0073   
0074   //! Calculates the distances between a sphere
0075   //! and a cone.
0076   Standard_EXPORT Extrema_ExtElSS(const gp_Sphere& S1, const gp_Cone& S2);
0077   
0078   Standard_EXPORT void Perform (const gp_Sphere& S1, const gp_Cone& S2);
0079   
0080   //! Calculates the distances between a sphere
0081   //! and a torus.
0082   Standard_EXPORT Extrema_ExtElSS(const gp_Sphere& S1, const gp_Torus& S2);
0083   
0084   Standard_EXPORT void Perform (const gp_Sphere& S1, const gp_Torus& S2);
0085   
0086   //! Returns True if the distances are found.
0087   Standard_EXPORT Standard_Boolean IsDone() const;
0088   
0089   //! Returns True if the two surfaces are parallel.
0090   Standard_EXPORT Standard_Boolean IsParallel() const;
0091   
0092   //! Returns the number of extremum distances.
0093   Standard_EXPORT Standard_Integer NbExt() const;
0094   
0095   //! Returns the value of the Nth extremum square distance.
0096   Standard_EXPORT Standard_Real SquareDistance (const Standard_Integer N = 1) const;
0097   
0098   //! Returns the points for the Nth resulting distance.
0099   //! P1 is on the first surface, P2 on the second one.
0100   Standard_EXPORT void Points (const Standard_Integer N, Extrema_POnSurf& P1, Extrema_POnSurf& P2) const;
0101 
0102 
0103 
0104 
0105 protected:
0106 
0107 
0108 
0109 
0110 
0111 private:
0112 
0113 
0114 
0115   Standard_Boolean myDone;
0116   Standard_Boolean myIsPar;
0117   Standard_Integer myNbExt;
0118   Handle(TColStd_HArray1OfReal) mySqDist;
0119   Handle(Extrema_HArray1OfPOnSurf) myPOnS1;
0120   Handle(Extrema_HArray1OfPOnSurf) myPOnS2;
0121 
0122 
0123 };
0124 
0125 
0126 
0127 
0128 
0129 
0130 
0131 #endif // _Extrema_ExtElSS_HeaderFile