Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-06-28 08:16:26

0001 // Created on: 1991-10-04
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_BSplineSurfaceKnotSplitting_HeaderFile
0017 #define _GeomConvert_BSplineSurfaceKnotSplitting_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_BSplineSurface;
0027 
0028 //! An algorithm to determine isoparametric curves along
0029 //! which a BSpline surface should be split in order to
0030 //! obtain patches of the same continuity. The continuity order is given at the
0031 //! construction time. It is possible to compute the surface patches
0032 //! corresponding to the splitting with the method of package
0033 //! SplitBSplineSurface.
0034 //! For a B-spline surface the discontinuities are localised at
0035 //! the knot values. Between two knots values the B-spline is
0036 //! infinitely continuously differentiable.  For each parametric
0037 //! direction at a knot of range index the continuity in this
0038 //! direction is equal to :  Degree - Mult (Index)   where  Degree
0039 //! is the degree of the basis B-spline functions and Mult the
0040 //! multiplicity of the knot of range Index in the given direction.
0041 //! If for your computation you need to have B-spline surface with a
0042 //! minima of continuity it can be interesting to know between which
0043 //! knot values, a B-spline patch, has a continuity of given order.
0044 //! This algorithm computes the indexes of the knots where you should
0045 //! split the surface, to obtain patches with a constant continuity
0046 //! given at the construction time. If you just want to compute the
0047 //! local derivatives on the surface you don't need to create the
0048 //! BSpline patches, you can use the functions LocalD1, LocalD2,
0049 //! LocalD3, LocalDN of the class BSplineSurface from package Geom.
0050 class GeomConvert_BSplineSurfaceKnotSplitting
0051 {
0052 public:
0053   DEFINE_STANDARD_ALLOC
0054 
0055   //! Determines the u- and v-isoparametric curves
0056   //! along which the BSpline surface BasisSurface
0057   //! should be split in order to obtain patches with a
0058   //! degree of continuity equal to UContinuityRange in
0059   //! the u parametric direction, and to
0060   //! VContinuityRange in the v parametric direction.
0061   //! These isoparametric curves are defined by
0062   //! parameters, which are BasisSurface knot values in
0063   //! the u or v parametric direction. They are identified
0064   //! by indices in the BasisSurface knots table in the
0065   //! corresponding parametric direction.
0066   //! Use the available interrogation functions to access
0067   //! computed values, followed by the global function
0068   //! SplitBSplineSurface (provided by the package
0069   //! GeomConvert) to split the surface.
0070   //! Exceptions
0071   //! Standard_RangeError if UContinuityRange or
0072   //! VContinuityRange is less than zero.
0073   Standard_EXPORT GeomConvert_BSplineSurfaceKnotSplitting(
0074     const Handle(Geom_BSplineSurface)& BasisSurface,
0075     const Standard_Integer             UContinuityRange,
0076     const Standard_Integer             VContinuityRange);
0077 
0078   //! Returns the number of u-isoparametric curves
0079   //! along which the analysed BSpline surface should be
0080   //! split in order to obtain patches with the continuity
0081   //! required by this framework.
0082   //! The parameters which define these curves are knot
0083   //! values in the corresponding parametric direction.
0084   //! Note that the four curves which bound the surface are
0085   //! counted among these splitting curves.
0086   Standard_EXPORT Standard_Integer NbUSplits() const;
0087 
0088   //! Returns the number of v-isoparametric curves
0089   //! along which the analysed BSpline surface should be
0090   //! split in order to obtain patches with the continuity
0091   //! required by this framework.
0092   //! The parameters which define these curves are knot
0093   //! values in the corresponding parametric direction.
0094   //! Note that the four curves which bound the surface are
0095   //! counted among these splitting curves.
0096   Standard_EXPORT Standard_Integer NbVSplits() const;
0097 
0098   //! Loads the USplit and VSplit tables with the split
0099   //! knots values computed in this framework. Each value
0100   //! in these tables is an index in the knots table
0101   //! corresponding to the u or v parametric direction of
0102   //! the BSpline surface analysed by this algorithm.
0103   //! The USplit and VSplit values are given in ascending
0104   //! order and comprise the indices of the knots which
0105   //! give the first and last isoparametric curves of the
0106   //! surface in the corresponding parametric direction.
0107   //! Use two consecutive values from the USplit table and
0108   //! two consecutive values from the VSplit table as
0109   //! arguments of the global function
0110   //! SplitBSplineSurface (provided by the package
0111   //! GeomConvert) to split the surface.
0112   //! Exceptions
0113   //! Standard_DimensionError if:
0114   //! -   the array USplit was not created with the following bounds:
0115   //! -   1 , and
0116   //! -   the number of split knots in the u parametric
0117   //! direction computed in this framework (as given
0118   //! by the function NbUSplits); or
0119   //! -   the array VSplit was not created with the following bounds:
0120   //! -   1 , and
0121   //! -   the number of split knots in the v parametric
0122   //! direction computed in this framework (as given
0123   //! by the function NbVSplits).
0124   Standard_EXPORT void Splitting(TColStd_Array1OfInteger& USplit,
0125                                  TColStd_Array1OfInteger& VSplit) const;
0126 
0127   //! Returns the split knot of index UIndex
0128   //! to the split knots table for the u  parametric direction
0129   //! computed in this framework. The returned value is
0130   //! an index in the knots table relative to the u
0131   //! parametric direction of the BSpline surface analysed by this algorithm.
0132   //! Note: If UIndex is equal to 1, or to the number of split knots for the u
0133   //! parametric direction computed in
0134   //! this framework, the corresponding knot gives the
0135   //! parameter of one of the bounding curves of the surface.
0136   //! Exceptions
0137   //! Standard_RangeError if UIndex  is less than 1 or greater than the number
0138   //! of split knots for the u parametric direction computed in this framework.
0139   Standard_EXPORT Standard_Integer USplitValue(const Standard_Integer UIndex) const;
0140 
0141   //! Returns the split knot of index VIndex
0142   //! to the split knots table for the v  parametric direction
0143   //! computed in this framework. The returned value is
0144   //! an index in the knots table relative to the v
0145   //! parametric direction of the BSpline surface analysed by this algorithm.
0146   //! Note: If UIndex is equal to 1, or to the number of split knots for the v
0147   //! parametric direction computed in
0148   //! this framework, the corresponding knot gives the
0149   //! parameter of one of the bounding curves of the surface.
0150   //! Exceptions
0151   //! Standard_RangeError if VIndex  is less than 1 or greater than the number
0152   //! of split knots for the v parametric direction computed in this framework.
0153   Standard_EXPORT Standard_Integer VSplitValue(const Standard_Integer VIndex) const;
0154 
0155 protected:
0156 private:
0157   Handle(TColStd_HArray1OfInteger) usplitIndexes;
0158   Handle(TColStd_HArray1OfInteger) vsplitIndexes;
0159 };
0160 
0161 #endif // _GeomConvert_BSplineSurfaceKnotSplitting_HeaderFile