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_Add3dCurve_HeaderFile
0018 #define _BndLib_Add3dCurve_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 
0023 //
0024 class Adaptor3d_Curve;
0025 class Bnd_Box;
0026 
0027 
0028 //! Computes the bounding box for a curve in 3d.
0029 //! Functions to add a 3D curve to a bounding box.
0030 //! The 3D curve is defined from a Geom curve.
0031 class BndLib_Add3dCurve 
0032 {
0033 public:
0034 
0035   DEFINE_STANDARD_ALLOC
0036 
0037   
0038   //! Adds to the bounding box B the curve C
0039   //! B is then enlarged by the tolerance value Tol.
0040   //! Note: depending on the type of curve, one of the following
0041   //! representations of the curve C is used to include it in the bounding box B:
0042   //! -   an exact representation if C is built from a line, a circle   or a conic curve,
0043   //! -   the poles of the curve if C is built from a Bezier curve or   a BSpline curve,
0044   //! if not, the points of an approximation of the curve C.
0045   //! Warning
0046   //! C is an adapted curve, that is, an object which is an interface between:
0047   //! -   the services provided by a 3D curve from the package   Geom
0048   //! -   and those required of the curve by the computation algorithm.
0049   //! The adapted curve is created in the following way:
0050   //! Handle(Geom_Curve) mycurve = ... ;
0051   //! GeomAdaptor_Curve C(mycurve);
0052   //! The bounding box B is then enlarged by adding it:
0053   //! Bnd_Box B;
0054   //! // ...
0055   //! Standard_Real Tol = ... ;
0056   //! Add3dCurve::Add ( C, Tol, B );
0057   //! Exceptions
0058   //! Standard_Failure if the curve is built from:
0059   //! -   a Geom_Line, or
0060   //! -   a Geom_Parabola, or
0061   //! -   a Geom_Hyperbola,
0062   //! and P1 and P2 are either two negative infinite real
0063   //! numbers, or two positive infinite real numbers.
0064   Standard_EXPORT static void Add (const Adaptor3d_Curve& C, const Standard_Real Tol, Bnd_Box& B);
0065   
0066   //! Adds to the bounding box B the curve C
0067   //! the arc of the curve C limited by the two parameter values P1 and P2.
0068   //! Note: depending on the type of curve, one of the following
0069   //! representations of the curve C is used to include it in the bounding box B:
0070   //! -   an exact representation if C is built from a line, a circle   or a conic curve,
0071   //! -   the poles of the curve if C is built from a Bezier curve or   a BSpline curve,
0072   //! if not, the points of an approximation of the curve C.
0073   //! Warning
0074   //! C is an adapted curve, that is, an object which is an interface between:
0075   //! -   the services provided by a 3D curve from the package   Geom
0076   //! -   and those required of the curve by the computation algorithm.
0077   //! The adapted curve is created in the following way:
0078   //! Handle(Geom_Curve) mycurve = ... ;
0079   //! GeomAdaptor_Curve C(mycurve);
0080   //! The bounding box B is then enlarged by adding it:
0081   //! Bnd_Box B;
0082   //! // ...
0083   //! Standard_Real Tol = ... ;
0084   //! Add3dCurve::Add ( C, Tol, B );
0085   //! Exceptions
0086   //! Standard_Failure if the curve is built from:
0087   //! -   a Geom_Line, or
0088   //! -   a Geom_Parabola, or
0089   //! -   a Geom_Hyperbola,
0090   //! and P1 and P2 are either two negative infinite real
0091   //! numbers, or two positive infinite real numbers.
0092   Standard_EXPORT static void Add (const Adaptor3d_Curve& C, const Standard_Real U1, const Standard_Real U2, const Standard_Real Tol, Bnd_Box& B);
0093 
0094   //! Adds to the bounding box B the curve C
0095   //! These methods use more precise algorithms for building bnd box
0096   //! then methods Add(...)
0097   Standard_EXPORT static void AddOptimal (const Adaptor3d_Curve& C, const Standard_Real Tol, Bnd_Box& B);
0098   Standard_EXPORT static void AddOptimal (const Adaptor3d_Curve& C, 
0099                                           const Standard_Real U1, const Standard_Real U2, 
0100                                           const Standard_Real Tol, Bnd_Box& B);
0101   //! Adds to the bounding box B the curve C
0102   //! using numerical minimization algorithms
0103   //! This method is used in AddOptimal for not analytical curves.
0104   //! if Tol < Precision::Confusion(), Precision:;Confusion is used as computation tolerance
0105   Standard_EXPORT static void AddGenCurv(const Adaptor3d_Curve& C, 
0106                                          const Standard_Real UMin,
0107                                          const Standard_Real UMax,
0108                                          const Standard_Real Tol,
0109                                          Bnd_Box& B);
0110 
0111 protected:
0112 
0113 
0114 
0115 
0116 
0117 private:
0118 
0119 
0120 
0121 
0122 
0123 };
0124 
0125 
0126 
0127 
0128 
0129 
0130 
0131 #endif // _BndLib_Add3dCurve_HeaderFile