Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-12 08:46:19

0001 // Created on: 1995-07-24
0002 // Created by: Modelistation
0003 // Copyright (c) 1995-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 _BndLib_AddSurface_HeaderFile
0018 #define _BndLib_AddSurface_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 
0023 class Adaptor3d_Surface;
0024 class Bnd_Box;
0025 
0026 //! computes the box from a surface
0027 //! Functions to add a surface to a bounding box.
0028 //! The surface is defined from a Geom surface.
0029 class BndLib_AddSurface
0030 {
0031 public:
0032   DEFINE_STANDARD_ALLOC
0033 
0034   //! Adds to the bounding box B the surface S
0035   //! B is then enlarged by the tolerance value Tol.
0036   //! Note: depending on the type of curve, one of the following
0037   //! representations of the surface S is used to include it in the bounding box B:
0038   //! -   an exact representation if S is built from a plane, a
0039   //! cylinder, a cone, a sphere or a torus,
0040   //! -   the poles of the surface if S is built from a Bezier
0041   //! surface or a BSpline surface,
0042   //! -   the points of an approximation of the surface S in
0043   //! cases other than offset surfaces;
0044   //! -   in the case of an offset surface, the basis surface is first
0045   //! included according to the previous rules; then the
0046   //! bounding box is enlarged by the offset value.
0047   //! Warning
0048   //! Do not use these functions to add a non-finite surface to
0049   //! the bounding box B.
0050   //! If UMin, UMax, VMin or VMax is an infinite value B will become WholeSpace.
0051   //! S is an adapted surface, that is, an object which is an interface between:
0052   //! -   the services provided by a surface from the package Geom
0053   //! -   and those required of the surface by the computation algorithm.
0054   //! The adapted surface is created in the following way:
0055   //! Handle(Geom_Surface) mysurface = ... ;
0056   //! GeomAdaptor_Surface S(mysurface);
0057   //! The bounding box B is then enlarged by adding this surface:
0058   //! Bnd_Box B;
0059   //! // ...
0060   //! Standard_Real Tol = ... ;
0061   //! AddSurface::Add ( S, Tol, B );
0062   Standard_EXPORT static void Add(const Adaptor3d_Surface& S, const Standard_Real Tol, Bnd_Box& B);
0063 
0064   //! Adds to the bounding box B the surface S
0065   //! the patch of the surface S limited in the u parametric
0066   //! direction by the two parameter values UMin, UMax, and
0067   //! in the v parametric direction by the two parameter
0068   //! values VMin, VMax.
0069   //! Note: depending on the type of curve, one of the following
0070   //! representations of the surface S is used to include it in the bounding box B:
0071   //! -   an exact representation if S is built from a plane, a
0072   //! cylinder, a cone, a sphere or a torus,
0073   //! -   the poles of the surface if S is built from a Bezier
0074   //! surface or a BSpline surface,
0075   //! -   the points of an approximation of the surface S in
0076   //! cases other than offset surfaces;
0077   //! -   in the case of an offset surface, the basis surface is first
0078   //! included according to the previous rules; then the
0079   //! bounding box is enlarged by the offset value.
0080   //! Warning
0081   //! Do not use these functions to add a non-finite surface to
0082   //! the bounding box B.
0083   //! If UMin, UMax, VMin or VMax is an infinite value B will become WholeSpace.
0084   //! S is an adapted surface, that is, an object which is an interface between:
0085   //! -   the services provided by a surface from the package Geom
0086   //! -   and those required of the surface by the computation algorithm.
0087   //! The adapted surface is created in the following way:
0088   //! Handle(Geom_Surface) mysurface = ... ;
0089   //! GeomAdaptor_Surface S(mysurface);
0090   //! The bounding box B is then enlarged by adding this surface:
0091   //! Bnd_Box B;
0092   //! // ...
0093   //! Standard_Real Tol = ... ;
0094   //! AddSurface::Add ( S, Tol, B );
0095   Standard_EXPORT static void Add(const Adaptor3d_Surface& S,
0096                                   const Standard_Real      UMin,
0097                                   const Standard_Real      UMax,
0098                                   const Standard_Real      VMin,
0099                                   const Standard_Real      VMax,
0100                                   const Standard_Real      Tol,
0101                                   Bnd_Box&                 B);
0102 
0103   //! Adds the surface S to the bounding box B.
0104   //! This algorithm builds precise bounding box
0105 
0106   Standard_EXPORT static void AddOptimal(const Adaptor3d_Surface& S,
0107                                          const Standard_Real      Tol,
0108                                          Bnd_Box&                 B);
0109 
0110   Standard_EXPORT static void AddOptimal(const Adaptor3d_Surface& S,
0111                                          const Standard_Real      UMin,
0112                                          const Standard_Real      UMax,
0113                                          const Standard_Real      VMin,
0114                                          const Standard_Real      VMax,
0115                                          const Standard_Real      Tol,
0116                                          Bnd_Box&                 B);
0117 
0118   //! Adds to the bounding box B the surface S
0119   //! using numerical minimization algorithms
0120   //! This method is used in AddOptimal for not analytical surfaces and torus.
0121   //! if Tol < Precision::Confusion(), Precision::Confusion is used as computation tolerance
0122   Standard_EXPORT static void AddGenSurf(const Adaptor3d_Surface& S,
0123                                          const Standard_Real      UMin,
0124                                          const Standard_Real      UMax,
0125                                          const Standard_Real      VMin,
0126                                          const Standard_Real      VMax,
0127                                          const Standard_Real      Tol,
0128                                          Bnd_Box&                 B);
0129 
0130 protected:
0131 private:
0132 };
0133 
0134 #endif // _BndLib_AddSurface_HeaderFile