Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:02:58

0001 // Created on: 1993-09-20
0002 // Created by: Modelistation
0003 // Copyright (c) 1993-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 _AppParCurves_MultiBSpCurve_HeaderFile
0018 #define _AppParCurves_MultiBSpCurve_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 #include <Standard_Handle.hxx>
0023 
0024 #include <TColStd_HArray1OfReal.hxx>
0025 #include <TColStd_HArray1OfInteger.hxx>
0026 #include <Standard_Integer.hxx>
0027 #include <AppParCurves_MultiCurve.hxx>
0028 #include <AppParCurves_Array1OfMultiPoint.hxx>
0029 #include <TColStd_Array1OfReal.hxx>
0030 #include <TColStd_Array1OfInteger.hxx>
0031 #include <Standard_OStream.hxx>
0032 class gp_Pnt;
0033 class gp_Pnt2d;
0034 class gp_Vec;
0035 class gp_Vec2d;
0036 
0037 
0038 //! This class describes a MultiBSpCurve approximating a Multiline.
0039 //! Just as a Multiline is a set of a given number of lines, a MultiBSpCurve is a set
0040 //! of a specified number of bsplines defined by:
0041 //! -   A specified number of MultiPoints - the poles of a specified number of curves
0042 //! -   The degree of approximation identical for each of the specified number of curves.
0043 //!
0044 //! Example of a MultiBSpCurve composed of a specified number of MultiPoints:
0045 //!
0046 //! P1______P2_____P3______P4________........_____PNbMPoints
0047 //!
0048 //! Q1______Q2_____Q3______Q4________........_____QNbMPoints
0049 //! .                                               .
0050 //! .                                               .
0051 //! .                                               .
0052 //! R1______R2_____R3______R4________........_____RNbMPoints
0053 //!
0054 //! Pi, Qi, ..., Ri are points of dimension 2 or 3.
0055 //!
0056 //! (Pi, Qi, ...Ri), i= 1,...NbPoles are MultiPoints.
0057 //! each MultiPoint has got NbPol Poles.
0058 //! MultiBSpCurves are created by the SplineValue method in the ComputeLine
0059 //! class, and by the Value method in TheVariational class. MultiBSpCurve
0060 //! provides the information required to create the BSpline defined by the approximation.
0061 class AppParCurves_MultiBSpCurve  : public AppParCurves_MultiCurve
0062 {
0063 public:
0064 
0065   DEFINE_STANDARD_ALLOC
0066 
0067   
0068   //! returns an indefinite MultiBSpCurve.
0069   Standard_EXPORT AppParCurves_MultiBSpCurve();
0070   
0071   //! creates a MultiBSpCurve, describing BSpline curves all
0072   //! containing the same number of MultiPoint.
0073   //! An exception is raised if Degree < 0.
0074   Standard_EXPORT AppParCurves_MultiBSpCurve(const Standard_Integer NbPol);
0075   
0076   //! creates a MultiBSpCurve, describing BSpline curves all
0077   //! containing the same number of MultiPoint.
0078   //! Each MultiPoint must have NbCurves Poles.
0079   Standard_EXPORT AppParCurves_MultiBSpCurve(const AppParCurves_Array1OfMultiPoint& tabMU, const TColStd_Array1OfReal& Knots, const TColStd_Array1OfInteger& Mults);
0080   
0081   //! creates a MultiBSpCurve, describing BSpline
0082   //! curves, taking control points from <SC>.
0083   Standard_EXPORT AppParCurves_MultiBSpCurve(const AppParCurves_MultiCurve& SC, const TColStd_Array1OfReal& Knots, const TColStd_Array1OfInteger& Mults);
0084   
0085   //! Knots of the multiBSpCurve are assigned to <theknots>.
0086   Standard_EXPORT void SetKnots (const TColStd_Array1OfReal& theKnots);
0087   
0088   //! Multiplicities of the multiBSpCurve are assigned
0089   //! to <theMults>.
0090   Standard_EXPORT void SetMultiplicities (const TColStd_Array1OfInteger& theMults);
0091   
0092   //! Returns an array of Reals containing
0093   //! the multiplicities of curves resulting from the approximation.
0094   Standard_EXPORT const TColStd_Array1OfReal& Knots() const;
0095   
0096   //! Returns an array of Reals containing the
0097   //! multiplicities of curves resulting from the approximation.
0098   Standard_EXPORT const TColStd_Array1OfInteger& Multiplicities() const;
0099   
0100   //! returns the degree of the curve(s).
0101   Standard_EXPORT virtual Standard_Integer Degree() const Standard_OVERRIDE;
0102   
0103   //! returns the value of the point with a parameter U
0104   //! on the BSpline curve number CuIndex.
0105   //! An exception is raised if CuIndex <0 or > NbCurves.
0106   //! An exception is raised if the curve dimension is 2d.
0107   Standard_EXPORT virtual void Value (const Standard_Integer CuIndex, const Standard_Real U, gp_Pnt& Pt) const Standard_OVERRIDE;
0108   
0109   //! returns the value of the point with a parameter U
0110   //! on the BSpline curve number CuIndex.
0111   //! An exception is raised if CuIndex <0 or > NbCurves.
0112   //! An exception is raised if the curve dimension is 3d.
0113   Standard_EXPORT virtual void Value (const Standard_Integer CuIndex, const Standard_Real U, gp_Pnt2d& Pt) const Standard_OVERRIDE;
0114   
0115   //! returns the value of the point with a parameter U
0116   //! on the BSpline curve number CuIndex.
0117   //! An exception is raised if CuIndex <0 or > NbCurves.
0118   //! An exception is raised if the curve dimension is 3d.
0119   Standard_EXPORT virtual void D1 (const Standard_Integer CuIndex, const Standard_Real U, gp_Pnt& Pt, gp_Vec& V1) const Standard_OVERRIDE;
0120   
0121   //! returns the value of the point with a parameter U
0122   //! on the BSpline curve number CuIndex.
0123   //! An exception is raised if CuIndex <0 or > NbCurves.
0124   //! An exception is raised if the curve dimension is 2d.
0125   Standard_EXPORT virtual void D1 (const Standard_Integer CuIndex, const Standard_Real U, gp_Pnt2d& Pt, gp_Vec2d& V1) const Standard_OVERRIDE;
0126   
0127   //! returns the value of the point with a parameter U
0128   //! on the BSpline curve number CuIndex.
0129   //! An exception is raised if CuIndex <0 or > NbCurves.
0130   //! An exception is raised if the curve dimension is 3d.
0131   Standard_EXPORT virtual void D2 (const Standard_Integer CuIndex, const Standard_Real U, gp_Pnt& Pt, gp_Vec& V1, gp_Vec& V2) const Standard_OVERRIDE;
0132   
0133   //! returns the value of the point with a parameter U
0134   //! on the BSpline curve number CuIndex.
0135   //! An exception is raised if CuIndex <0 or > NbCurves.
0136   //! An exception is raised if the curve dimension is 2d.
0137   Standard_EXPORT virtual void D2 (const Standard_Integer CuIndex, const Standard_Real U, gp_Pnt2d& Pt, gp_Vec2d& V1, gp_Vec2d& V2) const Standard_OVERRIDE;
0138   
0139   //! Prints on the stream o information on the current
0140   //! state of the object.
0141   //! Is used to redefine the operator <<.
0142   Standard_EXPORT virtual void Dump (Standard_OStream& o) const Standard_OVERRIDE;
0143 
0144 
0145 
0146 
0147 protected:
0148 
0149 
0150 
0151 
0152 
0153 private:
0154 
0155 
0156 
0157   Handle(TColStd_HArray1OfReal) myknots;
0158   Handle(TColStd_HArray1OfInteger) mymults;
0159   Standard_Integer myDegree;
0160 
0161 
0162 };
0163 
0164 
0165 
0166 
0167 
0168 
0169 
0170 #endif // _AppParCurves_MultiBSpCurve_HeaderFile