0032630: Coding - get rid of unsused forward declarations [BinMDF to IFSelect]
[occt.git] / src / Geom2dConvert / Geom2dConvert_BSplineCurveToBezierCurve.hxx
CommitLineData
42cf5bc1 1// Created on: 1993-03-24
2// Created by: DUB
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 _Geom2dConvert_BSplineCurveToBezierCurve_HeaderFile
18#define _Geom2dConvert_BSplineCurveToBezierCurve_HeaderFile
19
20#include <Standard.hxx>
21#include <Standard_DefineAlloc.hxx>
22#include <Standard_Handle.hxx>
23
24#include <Standard_Real.hxx>
25#include <Standard_Integer.hxx>
26#include <TColGeom2d_Array1OfBezierCurve.hxx>
27#include <TColStd_Array1OfReal.hxx>
28class Geom2d_BSplineCurve;
42cf5bc1 29class Geom2d_BezierCurve;
30
31
32//! An algorithm to convert a BSpline curve into a series
33//! of adjacent Bezier curves.
34//! A BSplineCurveToBezierCurve object provides a framework for:
35//! - defining the BSpline curve to be converted
36//! - implementing the construction algorithm, and
37//! - consulting the results.
38//! References :
39//! Generating the Bezier points of B-spline curves and surfaces
40//! (Wolfgang Bohm) CAD volume 13 number 6 november 1981
41class Geom2dConvert_BSplineCurveToBezierCurve
42{
43public:
44
45 DEFINE_STANDARD_ALLOC
46
47
48 //! Computes all the data needed to convert
49 //! - the BSpline curve BasisCurve, into a series of adjacent Bezier arcs.
50 //! The result consists of a series of BasisCurve arcs
51 //! limited by points corresponding to knot values of the curve.
52 //! Use the available interrogation functions to ascertain
53 //! the number of computed Bezier arcs, and then to
54 //! construct each individual Bezier curve (or all Bezier curves).
55 //! Note: ParametricTolerance is not used.
56 Standard_EXPORT Geom2dConvert_BSplineCurveToBezierCurve(const Handle(Geom2d_BSplineCurve)& BasisCurve);
57
58 //! Computes all the data needed to convert
59 //! the portion of the BSpline curve BasisCurve
60 //! limited by the two parameter values U1 and U2
61 //! for Example if there is a Knot Uk and
62 //! Uk < U < Uk + ParametricTolerance/2 the last curve
63 //! corresponds to the span [Uk-1, Uk] and not to [Uk, Uk+1]
64 //! The result consists of a series of BasisCurve arcs
65 //! limited by points corresponding to knot values of the curve.
66 //! Use the available interrogation functions to ascertain
67 //! the number of computed Bezier arcs, and then to
68 //! construct each individual Bezier curve (or all Bezier curves).
69 //! Note: ParametricTolerance is not used.
70 //! Raises DomainError if U1 or U2 are out of the parametric bounds of the basis
71 //! curve [FirstParameter, LastParameter]. The Tolerance criterion
72 //! is ParametricTolerance.
73 //! Raised if Abs (U2 - U1) <= ParametricTolerance.
74 Standard_EXPORT Geom2dConvert_BSplineCurveToBezierCurve(const Handle(Geom2d_BSplineCurve)& BasisCurve, const Standard_Real U1, const Standard_Real U2, const Standard_Real ParametricTolerance);
75
76 //! Constructs and returns the Bezier curve of index
77 //! Index to the table of adjacent Bezier arcs
78 //! computed by this algorithm.
79 //! This Bezier curve has the same orientation as the
80 //! BSpline curve analyzed in this framework.
81 //! Exceptions
82 //! Standard_OutOfRange if Index is less than 1 or
83 //! greater than the number of adjacent Bezier arcs
84 //! computed by this algorithm.
85 Standard_EXPORT Handle(Geom2d_BezierCurve) Arc (const Standard_Integer Index);
86
87 //! Constructs all the Bezier curves whose data is
88 //! computed by this algorithm and loads these curves
89 //! into the Curves table.
90 //! The Bezier curves have the same orientation as the
91 //! BSpline curve analyzed in this framework.
92 //! Exceptions
93 //! Standard_DimensionError if the Curves array was
94 //! not created with the following bounds:
95 //! - 1 , and
96 //! - the number of adjacent Bezier arcs computed by
97 //! this algorithm (as given by the function NbArcs).
98 Standard_EXPORT void Arcs (TColGeom2d_Array1OfBezierCurve& Curves);
99
100 //! This methode returns the bspline's knots associated to
101 //! the converted arcs
102 //! Raises DimensionError if the length of Curves is not equal to
103 //! NbArcs + 1
104 Standard_EXPORT void Knots (TColStd_Array1OfReal& TKnots) const;
105
106
107 //! Returns the number of BezierCurve arcs.
108 //! If at the creation time you have decomposed the basis curve
109 //! between the parametric values UFirst, ULast the number of
110 //! BezierCurve arcs depends on the number of knots included inside
111 //! the interval [UFirst, ULast].
112 //! If you have decomposed the whole basis B-spline curve the number
113 //! of BezierCurve arcs NbArcs is equal to the number of knots less
114 //! one.
115 Standard_EXPORT Standard_Integer NbArcs() const;
116
117
118
119
120protected:
121
122
123
124
125
126private:
127
128
129
130 Handle(Geom2d_BSplineCurve) myCurve;
131
132
133};
134
135
136
137
138
139
140
141#endif // _Geom2dConvert_BSplineCurveToBezierCurve_HeaderFile