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_ExtElCS_HeaderFile
0018 #define _Extrema_ExtElCS_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 #include <Standard_Handle.hxx>
0023 
0024 #include <Standard_Integer.hxx>
0025 #include <TColStd_HArray1OfReal.hxx>
0026 #include <Extrema_HArray1OfPOnCurv.hxx>
0027 #include <Extrema_HArray1OfPOnSurf.hxx>
0028 
0029 class gp_Lin;
0030 class gp_Pln;
0031 class gp_Cylinder;
0032 class gp_Cone;
0033 class gp_Sphere;
0034 class gp_Torus;
0035 class gp_Circ;
0036 class gp_Hypr;
0037 class Extrema_POnCurv;
0038 class Extrema_POnSurf;
0039 
0040 
0041 //! It calculates all the distances between a curve and
0042 //! a surface.
0043 //! These distances can be maximum or minimum.
0044 class Extrema_ExtElCS 
0045 {
0046 public:
0047 
0048   DEFINE_STANDARD_ALLOC
0049 
0050   
0051   Standard_EXPORT Extrema_ExtElCS();
0052   
0053   //! Calculates the distances between a line and a
0054   //! plane. The line can be on the plane or on a parallel
0055   //! plane.
0056   Standard_EXPORT Extrema_ExtElCS(const gp_Lin& C, const gp_Pln& S);
0057   
0058   Standard_EXPORT void Perform (const gp_Lin& C, const gp_Pln& S);
0059   
0060   //! Calculates the distances between a line and a
0061   //! cylinder.
0062   Standard_EXPORT Extrema_ExtElCS(const gp_Lin& C, const gp_Cylinder& S);
0063   
0064   Standard_EXPORT void Perform (const gp_Lin& C, const gp_Cylinder& S);
0065   
0066   //! Calculates the distances between a line and a cone.
0067   Standard_EXPORT Extrema_ExtElCS(const gp_Lin& C, const gp_Cone& S);
0068   
0069   Standard_EXPORT void Perform (const gp_Lin& C, const gp_Cone& S);
0070   
0071   //! Calculates the distances between a line and a
0072   //! sphere.
0073   Standard_EXPORT Extrema_ExtElCS(const gp_Lin& C, const gp_Sphere& S);
0074   
0075   Standard_EXPORT void Perform (const gp_Lin& C, const gp_Sphere& S);
0076   
0077   //! Calculates the distances between a line and a
0078   //! torus.
0079   Standard_EXPORT Extrema_ExtElCS(const gp_Lin& C, const gp_Torus& S);
0080   
0081   Standard_EXPORT void Perform (const gp_Lin& C, const gp_Torus& S);
0082   
0083   //! Calculates the distances between a circle and a
0084   //! plane.
0085   Standard_EXPORT Extrema_ExtElCS(const gp_Circ& C, const gp_Pln& S);
0086   
0087   Standard_EXPORT void Perform (const gp_Circ& C, const gp_Pln& S);
0088   
0089   //! Calculates the distances between a circle and a
0090   //! cylinder.
0091   Standard_EXPORT Extrema_ExtElCS(const gp_Circ& C, const gp_Cylinder& S);
0092   
0093   Standard_EXPORT void Perform (const gp_Circ& C, const gp_Cylinder& S);
0094   
0095   //! Calculates the distances between a circle and a
0096   //! cone.
0097   Standard_EXPORT Extrema_ExtElCS(const gp_Circ& C, const gp_Cone& S);
0098   
0099   Standard_EXPORT void Perform (const gp_Circ& C, const gp_Cone& S);
0100   
0101   //! Calculates the distances between a circle and a
0102   //! sphere.
0103   Standard_EXPORT Extrema_ExtElCS(const gp_Circ& C, const gp_Sphere& S);
0104   
0105   Standard_EXPORT void Perform (const gp_Circ& C, const gp_Sphere& S);
0106   
0107   //! Calculates the distances between a circle and a
0108   //! torus.
0109   Standard_EXPORT Extrema_ExtElCS(const gp_Circ& C, const gp_Torus& S);
0110   
0111   Standard_EXPORT void Perform (const gp_Circ& C, const gp_Torus& S);
0112   
0113   //! Calculates the distances between a hyperbola and a
0114   //! plane.
0115   Standard_EXPORT Extrema_ExtElCS(const gp_Hypr& C, const gp_Pln& S);
0116   
0117   Standard_EXPORT void Perform (const gp_Hypr& C, const gp_Pln& S);
0118   
0119   //! Returns True if the distances are found.
0120   Standard_EXPORT Standard_Boolean IsDone() const;
0121   
0122   //! Returns True if the curve is on a parallel surface.
0123   Standard_EXPORT Standard_Boolean IsParallel() const;
0124   
0125   //! Returns the number of extremum distances.
0126   Standard_EXPORT Standard_Integer NbExt() const;
0127   
0128   //! Returns the value of the Nth extremum square distance.
0129   Standard_EXPORT Standard_Real SquareDistance (const Standard_Integer N = 1) const;
0130   
0131   //! Returns the points of the Nth extremum distance.
0132   //! P1 is on the curve, P2 on the surface.
0133   Standard_EXPORT void Points (const Standard_Integer N, Extrema_POnCurv& P1, Extrema_POnSurf& P2) const;
0134 
0135 
0136 
0137 
0138 protected:
0139 
0140 
0141 
0142 
0143 
0144 private:
0145 
0146 
0147 
0148   Standard_Boolean myDone;
0149   Standard_Integer myNbExt;
0150   Standard_Boolean myIsPar;
0151   Handle(TColStd_HArray1OfReal) mySqDist;
0152   Handle(Extrema_HArray1OfPOnCurv) myPoint1;
0153   Handle(Extrema_HArray1OfPOnSurf) myPoint2;
0154 
0155 
0156 };
0157 
0158 
0159 
0160 
0161 
0162 
0163 
0164 #endif // _Extrema_ExtElCS_HeaderFile