Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // Created on: 1991-10-03
0002 // Copyright (c) 1991-1999 Matra Datavision
0003 // Copyright (c) 1999-2014 OPEN CASCADE SAS
0004 //
0005 // This file is part of Open CASCADE Technology software library.
0006 //
0007 // This library is free software; you can redistribute it and/or modify it under
0008 // the terms of the GNU Lesser General Public License version 2.1 as published
0009 // by the Free Software Foundation, with special exception defined in the file
0010 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0011 // distribution for complete text of the license and disclaimer of any warranty.
0012 //
0013 // Alternatively, this file may be used under the terms of Open CASCADE
0014 // commercial license or contractual agreement.
0015 
0016 #ifndef _GeomConvert_BSplineCurveKnotSplitting_HeaderFile
0017 #define _GeomConvert_BSplineCurveKnotSplitting_HeaderFile
0018 
0019 #include <Standard.hxx>
0020 #include <Standard_DefineAlloc.hxx>
0021 #include <Standard_Handle.hxx>
0022 
0023 #include <TColStd_HArray1OfInteger.hxx>
0024 #include <Standard_Integer.hxx>
0025 #include <TColStd_Array1OfInteger.hxx>
0026 class Geom_BSplineCurve;
0027 
0028 
0029 //! An algorithm to determine points at which a BSpline
0030 //! curve should be split in order to obtain arcs of the same continuity.
0031 //! If you require curves with a minimum continuity for
0032 //! your computation, it is useful to know the points
0033 //! between which an arc has a continuity of a given
0034 //! order. The continuity order is given at the construction time.
0035 //! For a BSpline curve, the discontinuities are
0036 //! localized at the knot values. Between two knot values
0037 //! the BSpline is infinitely and continuously
0038 //! differentiable. At a given knot, the continuity is equal
0039 //! to: Degree - Mult, where Degree is the
0040 //! degree of the BSpline curve and Mult is the multiplicity of the knot.
0041 //! It is possible to compute the arcs which correspond to
0042 //! this splitting using the global function
0043 //! SplitBSplineCurve provided by the package GeomConvert.
0044 //! A BSplineCurveKnotSplitting object provides a framework for:
0045 //! -   defining the curve to be analyzed and the
0046 //! required degree of continuity,
0047 //! -   implementing the computation algorithm, and
0048 //! -   consulting the results.
0049 class GeomConvert_BSplineCurveKnotSplitting 
0050 {
0051 public:
0052 
0053   DEFINE_STANDARD_ALLOC
0054 
0055   
0056   //! Determines points at which the BSpline curve
0057   //! BasisCurve should be split in order to obtain arcs
0058   //! with a degree of continuity equal to ContinuityRange.
0059   //! These points are knot values of BasisCurve. They
0060   //! are identified by indices in the knots table of BasisCurve.
0061   //! Use the available interrogation functions to access
0062   //! computed values, followed by the global function
0063   //! SplitBSplineCurve (provided by the package GeomConvert) to split the curve.
0064   //! Exceptions
0065   //! Standard_RangeError if ContinuityRange is less than zero.
0066   Standard_EXPORT GeomConvert_BSplineCurveKnotSplitting(const Handle(Geom_BSplineCurve)& BasisCurve, const Standard_Integer ContinuityRange);
0067   
0068   //! Returns the number of points at which the analyzed
0069   //! BSpline curve should be split, in order to obtain arcs
0070   //! with the continuity required by this framework.
0071   //! All these points correspond to knot values. Note that
0072   //! the first and last points of the curve, which bound the
0073   //! first and last arcs, are counted among these splitting points.
0074   Standard_EXPORT Standard_Integer NbSplits() const;
0075   
0076   //! Loads the SplitValues table with the split knots
0077   //! values computed in this framework. Each value in the
0078   //! table is an index in the knots table of the BSpline
0079   //! curve analyzed by this algorithm.
0080   //! The values in SplitValues are given in ascending
0081   //! order and comprise the indices of the knots which
0082   //! give the first and last points of the curve. Use two
0083   //! consecutive values from the table as arguments of the
0084   //! global function SplitBSplineCurve (provided by the
0085   //! package GeomConvert) to split the curve.
0086   //! Exceptions
0087   //! Standard_DimensionError if the array SplitValues
0088   //! was not created with the following bounds:
0089   //! -   1, and
0090   //! -   the number of split points computed in this
0091   //! framework (as given by the function NbSplits).
0092   Standard_EXPORT void Splitting (TColStd_Array1OfInteger& SplitValues) const;
0093   
0094   //! Returns the split knot of index Index to the split knots
0095   //! table computed in this framework. The returned value
0096   //! is an index in the knots table of the BSpline curve
0097   //! analyzed by this algorithm.
0098   //! Notes:
0099   //! -   If Index is equal to 1, the corresponding knot
0100   //! gives the first point of the curve.
0101   //! -   If Index is equal to the number of split knots
0102   //! computed in this framework, the corresponding
0103   //! point is the last point of the curve.
0104   //! Exceptions
0105   //! Standard_RangeError if Index is less than 1 or
0106   //! greater than the number of split knots computed in this framework.
0107   Standard_EXPORT Standard_Integer SplitValue (const Standard_Integer Index) const;
0108 
0109 
0110 
0111 
0112 protected:
0113 
0114 
0115 
0116 
0117 
0118 private:
0119 
0120 
0121 
0122   Handle(TColStd_HArray1OfInteger) splitIndexes;
0123 
0124 
0125 };
0126 
0127 
0128 
0129 
0130 
0131 
0132 
0133 #endif // _GeomConvert_BSplineCurveKnotSplitting_HeaderFile