Back to home page

EIC code displayed by LXR

 
 

    


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

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