Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-06-06 08:35:49

0001 // Created on: 1991-10-10
0002 // Created by: Jean Claude VAUTHIER
0003 // Copyright (c) 1991-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 _Convert_ConicToBSplineCurve_HeaderFile
0018 #define _Convert_ConicToBSplineCurve_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 #include <Standard_Handle.hxx>
0023 
0024 #include <TColgp_HArray1OfPnt2d.hxx>
0025 #include <TColStd_HArray1OfReal.hxx>
0026 #include <TColStd_HArray1OfInteger.hxx>
0027 #include <Standard_Integer.hxx>
0028 #include <Convert_ParameterisationType.hxx>
0029 class gp_Pnt2d;
0030 
0031 //! Root class for algorithms which convert a conic curve into
0032 //! a BSpline curve (CircleToBSplineCurve, EllipseToBSplineCurve,
0033 //! HyperbolaToBSplineCurve, ParabolaToBSplineCurve).
0034 //! These algorithms all work on 2D curves from the gp
0035 //! package and compute all the data needed to construct a
0036 //! BSpline curve equivalent to the conic curve. This data consists of:
0037 //! -   the degree of the curve,
0038 //! -   the periodic characteristics of the curve,
0039 //! -   a poles table with associated weights,
0040 //! -   a knots table with associated multiplicities.
0041 //! The abstract class ConicToBSplineCurve provides a
0042 //! framework for storing and consulting this computed data.
0043 //! The data may then be used to construct a
0044 //! Geom2d_BSplineCurve curvSuper class of the following classes :
0045 //! This abstract class implements the methods to get the geometric
0046 //! representation of the B-spline curve equivalent to the conic.
0047 //! The B-spline is computed at the creation time in the sub classes.
0048 //! The B-spline curve is defined with its degree, its control points
0049 //! (Poles), its weights, its knots and their multiplicity.
0050 //! All the geometric entities used in this package are defined in 2D
0051 //! space.
0052 //! KeyWords :
0053 //! Convert, Conic, BSplineCurve, 2D.
0054 class Convert_ConicToBSplineCurve
0055 {
0056 public:
0057   DEFINE_STANDARD_ALLOC
0058 
0059   //! Returns the degree of the BSpline curve whose data is
0060   //! computed in this framework.
0061   Standard_EXPORT Standard_Integer Degree() const;
0062 
0063   //! Returns the number of poles of the BSpline curve whose
0064   //! data is computed in this framework.
0065   Standard_EXPORT Standard_Integer NbPoles() const;
0066 
0067   //! Returns the number of knots of the BSpline curve whose
0068   //! data is computed in this framework.
0069   Standard_EXPORT Standard_Integer NbKnots() const;
0070 
0071   //! Returns true if the BSpline curve whose data is computed in
0072   //! this framework is periodic.
0073   Standard_EXPORT Standard_Boolean IsPeriodic() const;
0074 
0075   //! Returns the pole of index Index to the poles table of the
0076   //! BSpline curve whose data is computed in this framework.
0077   //! Exceptions
0078   //! Standard_OutOfRange if Index is outside the bounds of
0079   //! the poles table of the BSpline curve whose data is computed in this framework.
0080   Standard_EXPORT gp_Pnt2d Pole(const Standard_Integer Index) const;
0081 
0082   //! Returns the weight of the pole of index Index to the poles
0083   //! table of the BSpline curve whose data is computed in this framework.
0084   //! Exceptions
0085   //! Standard_OutOfRange if Index is outside the bounds of
0086   //! the poles table of the BSpline curve whose data is computed in this framework.
0087   Standard_EXPORT Standard_Real Weight(const Standard_Integer Index) const;
0088 
0089   //! Returns the knot of index Index to the knots table of the
0090   //! BSpline curve whose data is computed in this framework.
0091   //! Exceptions
0092   //! Standard_OutOfRange if Index is outside the bounds of
0093   //! the knots table of the BSpline curve whose data is computed in this framework.
0094   Standard_EXPORT Standard_Real Knot(const Standard_Integer Index) const;
0095 
0096   //! Returns the multiplicity of the knot of index Index to the
0097   //! knots table of the BSpline curve whose data is computed in this framework.
0098   //! Exceptions
0099   //! Standard_OutOfRange if Index is outside the bounds of
0100   //! the knots table of the BSpline curve whose data is computed in this framework.
0101   Standard_EXPORT Standard_Integer Multiplicity(const Standard_Integer Index) const;
0102 
0103   Standard_EXPORT void BuildCosAndSin(const Convert_ParameterisationType Parametrisation,
0104                                       Handle(TColStd_HArray1OfReal)&     CosNumerator,
0105                                       Handle(TColStd_HArray1OfReal)&     SinNumerator,
0106                                       Handle(TColStd_HArray1OfReal)&     Denominator,
0107                                       Standard_Integer&                  Degree,
0108                                       Handle(TColStd_HArray1OfReal)&     Knots,
0109                                       Handle(TColStd_HArray1OfInteger)&  Mults) const;
0110 
0111   Standard_EXPORT void BuildCosAndSin(const Convert_ParameterisationType Parametrisation,
0112                                       const Standard_Real                UFirst,
0113                                       const Standard_Real                ULast,
0114                                       Handle(TColStd_HArray1OfReal)&     CosNumerator,
0115                                       Handle(TColStd_HArray1OfReal)&     SinNumerator,
0116                                       Handle(TColStd_HArray1OfReal)&     Denominator,
0117                                       Standard_Integer&                  Degree,
0118                                       Handle(TColStd_HArray1OfReal)&     Knots,
0119                                       Handle(TColStd_HArray1OfInteger)&  Mults) const;
0120 
0121 protected:
0122   Standard_EXPORT Convert_ConicToBSplineCurve(const Standard_Integer NumberOfPoles,
0123                                               const Standard_Integer NumberOfKnots,
0124                                               const Standard_Integer Degree);
0125 
0126   Handle(TColgp_HArray1OfPnt2d)    poles;
0127   Handle(TColStd_HArray1OfReal)    weights;
0128   Handle(TColStd_HArray1OfReal)    knots;
0129   Handle(TColStd_HArray1OfInteger) mults;
0130   Standard_Integer                 degree;
0131   Standard_Integer                 nbPoles;
0132   Standard_Integer                 nbKnots;
0133   Standard_Boolean                 isperiodic;
0134 
0135 private:
0136 };
0137 
0138 #endif // _Convert_ConicToBSplineCurve_HeaderFile