Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-28 09:20:07

0001 // Copyright (c) 2025 OPEN CASCADE SAS
0002 //
0003 // This file is part of Open CASCADE Technology software library.
0004 //
0005 // This library is free software; you can redistribute it and/or modify it under
0006 // the terms of the GNU Lesser General Public License version 2.1 as published
0007 // by the Free Software Foundation, with special exception defined in the file
0008 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0009 // distribution for complete text of the license and disclaimer of any warranty.
0010 //
0011 // Alternatively, this file may be used under the terms of Open CASCADE
0012 // commercial license or contractual agreement.
0013 
0014 #ifndef GeomBndLib_Cylinder_HeaderFile
0015 #define GeomBndLib_Cylinder_HeaderFile
0016 
0017 #include <Bnd_Box.hxx>
0018 #include <Geom_CylindricalSurface.hxx>
0019 #include <Standard.hxx>
0020 #include <Standard_DefineAlloc.hxx>
0021 
0022 //! Computes bounding box for a cylindrical surface (Geom_CylindricalSurface).
0023 //! Uses ElSLib iso-curves and GeomBndLib_ConicHelpers for circle arc bounding.
0024 class GeomBndLib_Cylinder
0025 {
0026 public:
0027   DEFINE_STANDARD_ALLOC
0028 
0029   GeomBndLib_Cylinder(const occ::handle<Geom_CylindricalSurface>& theSurf)
0030       : myGeom(theSurf)
0031   {
0032   }
0033 
0034   GeomBndLib_Cylinder(const GeomBndLib_Cylinder&)            = delete;
0035   GeomBndLib_Cylinder& operator=(const GeomBndLib_Cylinder&) = delete;
0036   GeomBndLib_Cylinder(GeomBndLib_Cylinder&&)                 = delete;
0037   GeomBndLib_Cylinder& operator=(GeomBndLib_Cylinder&&)      = delete;
0038 
0039   const occ::handle<Geom_CylindricalSurface>& Geometry() const { return myGeom; }
0040 
0041   //! Compute bounding box for full cylinder.
0042   [[nodiscard]] Standard_EXPORT Bnd_Box Box(double theTol) const;
0043 
0044   //! Compute bounding box for cylinder patch [theUMin, theUMax] x [theVMin, theVMax].
0045   [[nodiscard]] Standard_EXPORT Bnd_Box
0046     Box(double theUMin, double theUMax, double theVMin, double theVMax, double theTol) const;
0047 
0048   //! For analytical surfaces, BoxOptimal is same as Box.
0049   [[nodiscard]] Bnd_Box BoxOptimal(double theUMin,
0050                                    double theUMax,
0051                                    double theVMin,
0052                                    double theVMax,
0053                                    double theTol) const
0054   {
0055     return Box(theUMin, theUMax, theVMin, theVMax, theTol);
0056   }
0057 
0058   //! Compute optimal bounding box for full surface.
0059   [[nodiscard]] Bnd_Box BoxOptimal(double theTol) const { return Box(theTol); }
0060 
0061 private:
0062   occ::handle<Geom_CylindricalSurface> myGeom;
0063 };
0064 
0065 #endif // GeomBndLib_Cylinder_HeaderFile