|
||||
File indexing completed on 2025-01-18 10:03:38
0001 // Created on: 1996-03-12 0002 // Created by: Bruno DUMORTIER 0003 // Copyright (c) 1996-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 _GeomConvert_BSplineCurveToBezierCurve_HeaderFile 0018 #define _GeomConvert_BSplineCurveToBezierCurve_HeaderFile 0019 0020 #include <Standard.hxx> 0021 #include <Standard_DefineAlloc.hxx> 0022 #include <Standard_Handle.hxx> 0023 0024 #include <Standard_Integer.hxx> 0025 #include <TColGeom_Array1OfBezierCurve.hxx> 0026 #include <TColStd_Array1OfReal.hxx> 0027 class Geom_BSplineCurve; 0028 class Geom_BezierCurve; 0029 0030 0031 //! An algorithm to convert a BSpline curve into a series 0032 //! of adjacent Bezier curves. 0033 //! A BSplineCurveToBezierCurve object provides a framework for: 0034 //! - defining the BSpline curve to be converted 0035 //! - implementing the construction algorithm, and 0036 //! - consulting the results. 0037 //! References : 0038 //! Generating the Bezier points of B-spline curves and surfaces 0039 //! (Wolfgang Bohm) CAD volume 13 number 6 november 1981 0040 class GeomConvert_BSplineCurveToBezierCurve 0041 { 0042 public: 0043 0044 DEFINE_STANDARD_ALLOC 0045 0046 0047 //! Computes all the data needed to convert the 0048 //! BSpline curve BasisCurve into a series of adjacent Bezier arcs. 0049 Standard_EXPORT GeomConvert_BSplineCurveToBezierCurve(const Handle(Geom_BSplineCurve)& BasisCurve); 0050 0051 //! Computes all the data needed to convert 0052 //! the portion of the BSpline curve BasisCurve 0053 //! limited by the two parameter values U1 and U2 into a series of adjacent Bezier arcs. 0054 //! The result consists of a series of BasisCurve arcs 0055 //! limited by points corresponding to knot values of the curve. 0056 //! Use the available interrogation functions to ascertain 0057 //! the number of computed Bezier arcs, and then to 0058 //! construct each individual Bezier curve (or all Bezier curves). 0059 //! Note: ParametricTolerance is not used. 0060 //! Raises DomainError if U1 or U2 are out of the parametric bounds of the basis 0061 //! curve [FirstParameter, LastParameter]. The Tolerance criterion 0062 //! is ParametricTolerance. 0063 //! Raised if Abs (U2 - U1) <= ParametricTolerance. 0064 Standard_EXPORT GeomConvert_BSplineCurveToBezierCurve(const Handle(Geom_BSplineCurve)& BasisCurve, const Standard_Real U1, const Standard_Real U2, const Standard_Real ParametricTolerance); 0065 0066 //! Constructs and returns the Bezier curve of index 0067 //! Index to the table of adjacent Bezier arcs 0068 //! computed by this algorithm. 0069 //! This Bezier curve has the same orientation as the 0070 //! BSpline curve analyzed in this framework. 0071 //! Exceptions 0072 //! Standard_OutOfRange if Index is less than 1 or 0073 //! greater than the number of adjacent Bezier arcs 0074 //! computed by this algorithm. 0075 Standard_EXPORT Handle(Geom_BezierCurve) Arc (const Standard_Integer Index); 0076 0077 //! Constructs all the Bezier curves whose data is 0078 //! computed by this algorithm and loads these curves into the Curves table. 0079 //! The Bezier curves have the same orientation as the 0080 //! BSpline curve analyzed in this framework. 0081 //! Exceptions 0082 //! Standard_DimensionError if the Curves array was 0083 //! not created with the following bounds: 0084 //! - 1 , and 0085 //! - the number of adjacent Bezier arcs computed by 0086 //! this algorithm (as given by the function NbArcs). 0087 Standard_EXPORT void Arcs (TColGeom_Array1OfBezierCurve& Curves); 0088 0089 //! This methode returns the bspline's knots associated to 0090 //! the converted arcs 0091 //! Raised if the length of Curves is not equal to 0092 //! NbArcs + 1. 0093 Standard_EXPORT void Knots (TColStd_Array1OfReal& TKnots) const; 0094 0095 0096 //! Returns the number of BezierCurve arcs. 0097 //! If at the creation time you have decomposed the basis curve 0098 //! between the parametric values UFirst, ULast the number of 0099 //! BezierCurve arcs depends on the number of knots included inside 0100 //! the interval [UFirst, ULast]. 0101 //! If you have decomposed the whole basis B-spline curve the number 0102 //! of BezierCurve arcs NbArcs is equal to the number of knots less 0103 //! one. 0104 Standard_EXPORT Standard_Integer NbArcs() const; 0105 0106 0107 0108 0109 protected: 0110 0111 0112 0113 0114 0115 private: 0116 0117 0118 0119 Handle(Geom_BSplineCurve) myCurve; 0120 0121 0122 }; 0123 0124 0125 0126 0127 0128 0129 0130 #endif // _GeomConvert_BSplineCurveToBezierCurve_HeaderFile
[ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |