Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-29 09:18:40

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 <NCollection_Array1.hxx>
0026 #include <NCollection_HArray1.hxx>
0027 #include <Extrema_POnCurv.hxx>
0028 #include <Extrema_POnSurf.hxx>
0029 
0030 class gp_Lin;
0031 class gp_Pln;
0032 class gp_Cylinder;
0033 class gp_Cone;
0034 class gp_Sphere;
0035 class gp_Torus;
0036 class gp_Circ;
0037 class gp_Hypr;
0038 class Extrema_POnCurv;
0039 class Extrema_POnSurf;
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   DEFINE_STANDARD_ALLOC
0048 
0049   Standard_EXPORT Extrema_ExtElCS();
0050 
0051   //! Calculates the distances between a line and a
0052   //! plane. The line can be on the plane or on a parallel
0053   //! plane.
0054   Standard_EXPORT Extrema_ExtElCS(const gp_Lin& C, const gp_Pln& S);
0055 
0056   Standard_EXPORT void Perform(const gp_Lin& C, const gp_Pln& S);
0057 
0058   //! Calculates the distances between a line and a
0059   //! cylinder.
0060   Standard_EXPORT Extrema_ExtElCS(const gp_Lin& C, const gp_Cylinder& S);
0061 
0062   Standard_EXPORT void Perform(const gp_Lin& C, const gp_Cylinder& S);
0063 
0064   //! Calculates the distances between a line and a cone.
0065   Standard_EXPORT Extrema_ExtElCS(const gp_Lin& C, const gp_Cone& S);
0066 
0067   Standard_EXPORT void Perform(const gp_Lin& C, const gp_Cone& S);
0068 
0069   //! Calculates the distances between a line and a
0070   //! sphere.
0071   Standard_EXPORT Extrema_ExtElCS(const gp_Lin& C, const gp_Sphere& S);
0072 
0073   Standard_EXPORT void Perform(const gp_Lin& C, const gp_Sphere& S);
0074 
0075   //! Calculates the distances between a line and a
0076   //! torus.
0077   Standard_EXPORT Extrema_ExtElCS(const gp_Lin& C, const gp_Torus& S);
0078 
0079   Standard_EXPORT void Perform(const gp_Lin& C, const gp_Torus& S);
0080 
0081   //! Calculates the distances between a circle and a
0082   //! plane.
0083   Standard_EXPORT Extrema_ExtElCS(const gp_Circ& C, const gp_Pln& S);
0084 
0085   Standard_EXPORT void Perform(const gp_Circ& C, const gp_Pln& S);
0086 
0087   //! Calculates the distances between a circle and a
0088   //! cylinder.
0089   Standard_EXPORT Extrema_ExtElCS(const gp_Circ& C, const gp_Cylinder& S);
0090 
0091   Standard_EXPORT void Perform(const gp_Circ& C, const gp_Cylinder& S);
0092 
0093   //! Calculates the distances between a circle and a
0094   //! cone.
0095   Standard_EXPORT Extrema_ExtElCS(const gp_Circ& C, const gp_Cone& S);
0096 
0097   Standard_EXPORT void Perform(const gp_Circ& C, const gp_Cone& S);
0098 
0099   //! Calculates the distances between a circle and a
0100   //! sphere.
0101   Standard_EXPORT Extrema_ExtElCS(const gp_Circ& C, const gp_Sphere& S);
0102 
0103   Standard_EXPORT void Perform(const gp_Circ& C, const gp_Sphere& S);
0104 
0105   //! Calculates the distances between a circle and a
0106   //! torus.
0107   Standard_EXPORT Extrema_ExtElCS(const gp_Circ& C, const gp_Torus& S);
0108 
0109   Standard_EXPORT void Perform(const gp_Circ& C, const gp_Torus& S);
0110 
0111   //! Calculates the distances between a hyperbola and a
0112   //! plane.
0113   Standard_EXPORT Extrema_ExtElCS(const gp_Hypr& C, const gp_Pln& S);
0114 
0115   Standard_EXPORT void Perform(const gp_Hypr& C, const gp_Pln& S);
0116 
0117   //! Returns True if the distances are found.
0118   Standard_EXPORT bool IsDone() const;
0119 
0120   //! Returns True if the curve is on a parallel surface.
0121   Standard_EXPORT bool IsParallel() const;
0122 
0123   //! Returns the number of extremum distances.
0124   Standard_EXPORT int NbExt() const;
0125 
0126   //! Returns the value of the Nth extremum square distance.
0127   Standard_EXPORT double SquareDistance(const int N = 1) const;
0128 
0129   //! Returns the points of the Nth extremum distance.
0130   //! P1 is on the curve, P2 on the surface.
0131   Standard_EXPORT void Points(const int N, Extrema_POnCurv& P1, Extrema_POnSurf& P2) const;
0132 
0133 private:
0134   bool                                              myDone;
0135   int                                               myNbExt;
0136   bool                                              myIsPar;
0137   occ::handle<NCollection_HArray1<double>>          mySqDist;
0138   occ::handle<NCollection_HArray1<Extrema_POnCurv>> myPoint1;
0139   occ::handle<NCollection_HArray1<Extrema_POnSurf>> myPoint2;
0140 };
0141 
0142 #endif // _Extrema_ExtElCS_HeaderFile