Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // Created on: 1993-07-08
0002 // Created by: Isabelle GRIGNON
0003 // Copyright (c) 1993-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_HeaderFile
0018 #define _BndLib_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 #include <Standard_Handle.hxx>
0023 
0024 #include <Standard_Real.hxx>
0025 class gp_Lin;
0026 class Bnd_Box;
0027 class gp_Lin2d;
0028 class Bnd_Box2d;
0029 class gp_Circ;
0030 class gp_Circ2d;
0031 class gp_Elips;
0032 class gp_Elips2d;
0033 class gp_Parab;
0034 class gp_Parab2d;
0035 class gp_Hypr;
0036 class gp_Hypr2d;
0037 class gp_Cylinder;
0038 class gp_Cone;
0039 class gp_Sphere;
0040 class gp_Torus;
0041 
0042 
0043 //! The BndLib package provides functions to add a geometric primitive to a bounding box.
0044 //! Note: these functions work with gp objects, optionally
0045 //! limited by parameter values. If the curves and surfaces
0046 //! provided by the gp package are not explicitly
0047 //! parameterized, they still have an implicit parameterization,
0048 //! similar to that which they infer for the equivalent Geom or Geom2d objects.
0049 //! Add : Package to compute the bounding boxes for elementary
0050 //! objects from gp in 2d and 3d .
0051 //!
0052 //! AddCurve2d : A class to compute the bounding box for a curve
0053 //! in 2d dimensions ;the curve is defined by a tool
0054 //!
0055 //! AddCurve : A class to compute the bounding box for a curve
0056 //! in 3d dimensions ;the curve is defined by a tool
0057 //!
0058 //! AddSurface : A class to compute the bounding box for a surface.
0059 //! The surface is defined by a tool for the geometry and another
0060 //! tool for the topology (only the edges in 2d dimensions)
0061 class BndLib 
0062 {
0063 public:
0064 
0065   DEFINE_STANDARD_ALLOC
0066 
0067   
0068   //! Bounding box for a surface trimmed or not
0069   //! Adds the segment of the line L limited by the two
0070   //! parameter values P1 and P2, to the bounding box B, and
0071   //! then enlarges B by the tolerance value Tol.
0072   //! Tol is the tolerance value to enlarge the minimum and maximum dimension
0073   //! P1 and P2 may represent infinite values.
0074   //! Exceptions
0075   //! Standard_Failure if P1 and P2 are either two negative
0076   //! infinite real numbers, or two positive infinite real numbers.
0077   Standard_EXPORT static void Add (const gp_Lin& L, const Standard_Real P1, const Standard_Real P2, const Standard_Real Tol, Bnd_Box& B);
0078   
0079   Standard_EXPORT static void Add (const gp_Lin2d& L, const Standard_Real P1, const Standard_Real P2, const Standard_Real Tol, Bnd_Box2d& B);
0080   
0081   Standard_EXPORT static void Add (const gp_Circ& C, const Standard_Real Tol, Bnd_Box& B);
0082   
0083   //! P2-P1 can be in [0,2*pi]
0084   Standard_EXPORT static void Add (const gp_Circ& C, const Standard_Real P1, const Standard_Real P2, const Standard_Real Tol, Bnd_Box& B);
0085   
0086   Standard_EXPORT static void Add (const gp_Circ2d& C, const Standard_Real Tol, Bnd_Box2d& B);
0087   
0088   //! Adds the circle C, or the arc of the circle C
0089   //! limited by the two parameter values P1 and P2,
0090   //! to the bounding box B, and then enlarges B by the tolerance value Tol.
0091   //! P2-P1 can be in [0,2*pi]
0092   Standard_EXPORT static void Add (const gp_Circ2d& C, const Standard_Real P1, const Standard_Real P2, const Standard_Real Tol, Bnd_Box2d& B);
0093   
0094   Standard_EXPORT static void Add (const gp_Elips& C, const Standard_Real Tol, Bnd_Box& B);
0095   
0096   //! P2-P1 can be in [0,2*pi]
0097   Standard_EXPORT static void Add (const gp_Elips& C, const Standard_Real P1, const Standard_Real P2, const Standard_Real Tol, Bnd_Box& B);
0098   
0099   Standard_EXPORT static void Add (const gp_Elips2d& C, const Standard_Real Tol, Bnd_Box2d& B);
0100   
0101   //! Adds the ellipse E, or the arc of the ellipse E
0102   //! limited by the two parameter values P1 and P2,
0103   //! to the bounding box B, and then enlarges B by the tolerance value Tol.
0104   //! P2-P1 can be in [0,2*pi]
0105   Standard_EXPORT static void Add (const gp_Elips2d& C, const Standard_Real P1, const Standard_Real P2, const Standard_Real Tol, Bnd_Box2d& B);
0106   
0107   Standard_EXPORT static void Add (const gp_Parab& P, const Standard_Real P1, const Standard_Real P2, const Standard_Real Tol, Bnd_Box& B);
0108   
0109   //! Adds the arc of the parabola P limited by the two
0110   //! parameter values P1 and P2, to the bounding box B, and
0111   //! then enlarges B by the tolerance value Tol.
0112   //! P1 and P2 may represent infinite values.
0113   //! Exceptions
0114   //! Standard_Failure if P1 and P2 are either two negative
0115   //! infinite real numbers, or two positive infinite real numbers.
0116   Standard_EXPORT static void Add (const gp_Parab2d& P, const Standard_Real P1, const Standard_Real P2, const Standard_Real Tol, Bnd_Box2d& B);
0117   
0118   Standard_EXPORT static void Add (const gp_Hypr& H, const Standard_Real P1, const Standard_Real P2, const Standard_Real Tol, Bnd_Box& B);
0119   
0120   //! Adds the arc of the branch of hyperbola H limited by the
0121   //! two parameter values P1 and P2, to the bounding box B,
0122   //! and then enlarges B by the tolerance value Tol.
0123   //! P1 and P2 may represent infinite values.
0124   //! Exceptions
0125   //! Standard_Failure if P1 and P2 are either two negative
0126   //! infinite real numbers, or two positive infinite real numbers.
0127   Standard_EXPORT static void Add (const gp_Hypr2d& H, const Standard_Real P1, const Standard_Real P2, const Standard_Real Tol, Bnd_Box2d& B);
0128   
0129   //! UMax -UMin can be in [0,2*pi]
0130   Standard_EXPORT static void Add (const gp_Cylinder& S, const Standard_Real UMin, const Standard_Real UMax, const Standard_Real VMin, const Standard_Real VMax, const Standard_Real Tol, Bnd_Box& B);
0131   
0132   //! Adds to the bounding box B, the patch of the cylinder S limited
0133   //! -   in the v parametric direction, by the two parameter
0134   //! values VMin and VMax
0135   //! -   and optionally in the u parametric direction, by the two
0136   //! parameter values UMin and UMax.
0137   //! B is then enlarged by the tolerance value Tol.
0138   //! VMin and VMax may represent infinite values.
0139   //! Exceptions
0140   //! Standard_Failure if VMin and VMax are either two
0141   //! negative infinite real numbers, or two positive infinite real numbers.
0142   Standard_EXPORT static void Add (const gp_Cylinder& S, const Standard_Real VMin, const Standard_Real VMax, const Standard_Real Tol, Bnd_Box& B);
0143   
0144   //! UMax-UMin can be in [0,2*pi]
0145   Standard_EXPORT static void Add (const gp_Cone& S, const Standard_Real UMin, const Standard_Real UMax, const Standard_Real VMin, const Standard_Real VMax, const Standard_Real Tol, Bnd_Box& B);
0146   
0147   //! Adds to the bounding box B, the patch of the cone S limited
0148   //! -   in the v parametric direction, by the two parameter
0149   //! values VMin and VMax
0150   //! -   and optionally in the u parametric direction, by the two
0151   //! parameter values UMin and UMax,
0152   //! B is then enlarged by the tolerance value Tol.
0153   //! VMin and VMax may represent infinite values.
0154   //! Exceptions
0155   //! Standard_Failure if VMin and VMax are either two
0156   //! negative infinite real numbers, or two positive infinite real numbers.
0157   Standard_EXPORT static void Add (const gp_Cone& S, const Standard_Real VMin, const Standard_Real VMax, const Standard_Real Tol, Bnd_Box& B);
0158   
0159   Standard_EXPORT static void Add (const gp_Sphere& S, const Standard_Real Tol, Bnd_Box& B);
0160   
0161   //! Adds to the bounding box B the sphere S, or
0162   //! -   the patch of the sphere S, limited in the u parametric
0163   //! direction, by the two parameter values UMin and UMax,
0164   //! and in the v parametric direction, by the two parameter
0165   //! values VMin and VMax.
0166   //! B is then enlarged by the tolerance value Tol.
0167   //! UMax-UMin can be in [0,2*pi]
0168   //! VMin,VMax can be [-pi/2,pi/2]
0169   Standard_EXPORT static void Add (const gp_Sphere& S, const Standard_Real UMin, const Standard_Real UMax, const Standard_Real VMin, const Standard_Real VMax, const Standard_Real Tol, Bnd_Box& B);
0170   
0171   Standard_EXPORT static void Add (const gp_Torus& P, const Standard_Real Tol, Bnd_Box& B);
0172   
0173   //! Adds to the bounding box B
0174   //! -   the torus S, or
0175   //! -   the patch of the torus S, limited in the u parametric
0176   //! direction, by the two parameter values UMin and UMax,
0177   //! and in the v parametric direction, by the two parameter
0178   //! values VMin and VMax.
0179   //! B is then enlarged by the tolerance value Tol.
0180   //! UMax-UMin can be in [0,2*pi],
0181   //! VMin,VMax can be [-pi/2,pi/2]
0182   Standard_EXPORT static void Add (const gp_Torus& P, const Standard_Real UMin, const Standard_Real UMax, const Standard_Real VMin, const Standard_Real VMax, const Standard_Real Tol, Bnd_Box& B);
0183 
0184 };
0185 
0186 #endif // _BndLib_HeaderFile