Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/opencascade/Geom2dConvert_BSplineCurveKnotSplitting.hxx was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

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 _Geom2dConvert_BSplineCurveKnotSplitting_HeaderFile
0017 #define _Geom2dConvert_BSplineCurveKnotSplitting_HeaderFile
0018 
0019 #include <Standard.hxx>
0020 #include <Standard_DefineAlloc.hxx>
0021 #include <Standard_Handle.hxx>
0022 
0023 #include <Standard_Integer.hxx>
0024 #include <NCollection_Array1.hxx>
0025 #include <NCollection_HArray1.hxx>
0026 class Geom2d_BSplineCurve;
0027 
0028 //! An algorithm to determine points at which a BSpline
0029 //! curve should be split in order to obtain arcs of the same continuity.
0030 //! If you require curves with a minimum continuity for
0031 //! your computation, it is useful to know the points
0032 //! between which an arc has a continuity of a given
0033 //! order. The continuity order is given at the construction time.
0034 //! For a BSpline curve, the discontinuities are
0035 //! localized at the knot values. Between two knot values
0036 //! the BSpline is infinitely and continuously
0037 //! differentiable. At a given knot, the continuity is equal
0038 //! to: Degree - Mult, where Degree is the
0039 //! degree of the BSpline curve and Mult is the multiplicity of the knot.
0040 //! It is possible to compute the arcs which correspond to
0041 //! this splitting using the global function
0042 //! SplitBSplineCurve provided by the package Geom2dConvert.
0043 //! A BSplineCurveKnotSplitting object provides a framework for:
0044 //! -   defining the curve to be analysed and the required degree of continuity,
0045 //! -   implementing the computation algorithm, and
0046 //! -   consulting the results.
0047 class Geom2dConvert_BSplineCurveKnotSplitting
0048 {
0049 public:
0050   DEFINE_STANDARD_ALLOC
0051 
0052   //! Determines points at which the BSpline curve
0053   //! BasisCurve should be split in order to obtain arcs
0054   //! with a degree of continuity equal to ContinuityRange.
0055   //! These points are knot values of BasisCurve. They
0056   //! are identified by indices in the knots table of BasisCurve.
0057   //! Use the available interrogation functions to access
0058   //! computed values, followed by the global function
0059   //! SplitBSplineCurve (provided by the package
0060   //! Geom2dConvert) to split the curve.
0061   //! Exceptions
0062   //! Standard_RangeError if ContinuityRange is less than zero.
0063   Standard_EXPORT Geom2dConvert_BSplineCurveKnotSplitting(
0064     const occ::handle<Geom2d_BSplineCurve>& BasisCurve,
0065     const int                               ContinuityRange);
0066 
0067   //! Returns the number of points at which the analysed
0068   //! BSpline curve should be split, in order to obtain arcs
0069   //! with the continuity required by this framework.
0070   //! All these points correspond to knot values. Note that
0071   //! the first and last points of the curve, which bound the
0072   //! first and last arcs, are counted among these splitting points.
0073   Standard_EXPORT int NbSplits() const;
0074 
0075   //! Loads the SplitValues table with the split knots
0076   //! values computed in this framework. Each value in the
0077   //! table is an index in the knots table of the BSpline
0078   //! curve analysed by this algorithm.
0079   //! The values in SplitValues are given in ascending
0080   //! order and comprise the indices of the knots which
0081   //! give the first and last points of the curve. Use two
0082   //! consecutive values from the table as arguments of the
0083   //! global function SplitBSplineCurve (provided by the
0084   //! package Geom2dConvert) to split the curve.
0085   //! Exceptions
0086   //! Standard_DimensionError if the array SplitValues
0087   //! was not created with the following bounds:
0088   //! -   1, and
0089   //! -   the number of split points computed in this
0090   //! framework (as given by the function NbSplits).
0091   Standard_EXPORT void Splitting(NCollection_Array1<int>& SplitValues) const;
0092 
0093   //! Returns the split knot of index Index to the split knots
0094   //! table computed in this framework. The returned value
0095   //! is an index in the knots table of the BSpline curve
0096   //! analysed by this algorithm.
0097   //! Notes:
0098   //! -   If Index is equal to 1, the corresponding knot
0099   //! gives the first point of the curve.
0100   //! -   If Index is equal to the number of split knots
0101   //! computed in this framework, the corresponding
0102   //! point is the last point of the curve.
0103   //! Exceptions
0104   //! Standard_RangeError if Index is less than 1 or
0105   //! greater than the number of split knots computed in this framework.
0106   Standard_EXPORT int SplitValue(const int Index) const;
0107 
0108 private:
0109   occ::handle<NCollection_HArray1<int>> splitIndexes;
0110 };
0111 
0112 #endif // _Geom2dConvert_BSplineCurveKnotSplitting_HeaderFile