42cf5bc1 |
1 | // Created on: 1993-07-08 |
2 | // Created by: Isabelle GRIGNON |
3 | // Copyright (c) 1993-1999 Matra Datavision |
4 | // Copyright (c) 1999-2014 OPEN CASCADE SAS |
5 | // |
6 | // This file is part of Open CASCADE Technology software library. |
7 | // |
8 | // This library is free software; you can redistribute it and/or modify it under |
9 | // the terms of the GNU Lesser General Public License version 2.1 as published |
10 | // by the Free Software Foundation, with special exception defined in the file |
11 | // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT |
12 | // distribution for complete text of the license and disclaimer of any warranty. |
13 | // |
14 | // Alternatively, this file may be used under the terms of Open CASCADE |
15 | // commercial license or contractual agreement. |
16 | |
17 | #ifndef _BndLib_Add3dCurve_HeaderFile |
18 | #define _BndLib_Add3dCurve_HeaderFile |
19 | |
20 | #include <Standard.hxx> |
21 | #include <Standard_DefineAlloc.hxx> |
22 | #include <Standard_Handle.hxx> |
23 | |
24 | #include <Standard_Real.hxx> |
25 | class Adaptor3d_Curve; |
26 | class Bnd_Box; |
27 | |
28 | |
29 | //! Computes the bounding box for a curve in 3d. |
30 | //! Functions to add a 3D curve to a bounding box. |
31 | //! The 3D curve is defined from a Geom curve. |
32 | class BndLib_Add3dCurve |
33 | { |
34 | public: |
35 | |
36 | DEFINE_STANDARD_ALLOC |
37 | |
38 | |
39 | //! Adds to the bounding box B the curve C |
40 | //! B is then enlarged by the tolerance value Tol. |
41 | //! Note: depending on the type of curve, one of the following |
42 | //! representations of the curve C is used to include it in the bounding box B: |
43 | //! - an exact representation if C is built from a line, a circle or a conic curve, |
44 | //! - the poles of the curve if C is built from a Bezier curve or a BSpline curve, |
45 | //! if not, the points of an approximation of the curve C. |
46 | //! Warning |
47 | //! C is an adapted curve, that is, an object which is an interface between: |
48 | //! - the services provided by a 3D curve from the package Geom |
49 | //! - and those required of the curve by the computation algorithm. |
50 | //! The adapted curve is created in the following way: |
51 | //! Handle(Geom_Curve) mycurve = ... ; |
52 | //! GeomAdaptor_Curve C(mycurve); |
53 | //! The bounding box B is then enlarged by adding it: |
54 | //! Bnd_Box B; |
55 | //! // ... |
56 | //! Standard_Real Tol = ... ; |
57 | //! Add3dCurve::Add ( C, Tol, B ); |
58 | //! Exceptions |
59 | //! Standard_Failure if the curve is built from: |
60 | //! - a Geom_Line, or |
61 | //! - a Geom_Parabola, or |
62 | //! - a Geom_Hyperbola, |
63 | //! and P1 and P2 are either two negative infinite real |
64 | //! numbers, or two positive infinite real numbers. |
65 | Standard_EXPORT static void Add (const Adaptor3d_Curve& C, const Standard_Real Tol, Bnd_Box& B); |
66 | |
67 | //! Adds to the bounding box B the curve C |
68 | //! the arc of the curve C limited by the two parameter values P1 and P2. |
69 | //! Note: depending on the type of curve, one of the following |
70 | //! representations of the curve C is used to include it in the bounding box B: |
71 | //! - an exact representation if C is built from a line, a circle or a conic curve, |
72 | //! - the poles of the curve if C is built from a Bezier curve or a BSpline curve, |
73 | //! if not, the points of an approximation of the curve C. |
74 | //! Warning |
75 | //! C is an adapted curve, that is, an object which is an interface between: |
76 | //! - the services provided by a 3D curve from the package Geom |
77 | //! - and those required of the curve by the computation algorithm. |
78 | //! The adapted curve is created in the following way: |
79 | //! Handle(Geom_Curve) mycurve = ... ; |
80 | //! GeomAdaptor_Curve C(mycurve); |
81 | //! The bounding box B is then enlarged by adding it: |
82 | //! Bnd_Box B; |
83 | //! // ... |
84 | //! Standard_Real Tol = ... ; |
85 | //! Add3dCurve::Add ( C, Tol, B ); |
86 | //! Exceptions |
87 | //! Standard_Failure if the curve is built from: |
88 | //! - a Geom_Line, or |
89 | //! - a Geom_Parabola, or |
90 | //! - a Geom_Hyperbola, |
91 | //! and P1 and P2 are either two negative infinite real |
92 | //! numbers, or two positive infinite real numbers. |
93 | Standard_EXPORT static void Add (const Adaptor3d_Curve& C, const Standard_Real U1, const Standard_Real U2, const Standard_Real Tol, Bnd_Box& B); |
94 | |
95 | |
96 | |
97 | |
98 | protected: |
99 | |
100 | |
101 | |
102 | |
103 | |
104 | private: |
105 | |
106 | |
107 | |
108 | |
109 | |
110 | }; |
111 | |
112 | |
113 | |
114 | |
115 | |
116 | |
117 | |
118 | #endif // _BndLib_Add3dCurve_HeaderFile |