0032742: Coding - get rid of unused headers [Adaptor2d to Approx]
[occt.git] / src / AppParCurves / AppParCurves_MultiBSpCurve.hxx
1 // Created on: 1993-09-20
2 // Created by: Modelistation
3 // Copyright (c) 1993-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
5 //
6 // This file is part of Open CASCADE Technology software library.
7 //
8 // This library is free software; you can redistribute it and/or modify it under
9 // the terms of the GNU Lesser General Public License version 2.1 as published
10 // by the Free Software Foundation, with special exception defined in the file
11 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 // distribution for complete text of the license and disclaimer of any warranty.
13 //
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
16
17 #ifndef _AppParCurves_MultiBSpCurve_HeaderFile
18 #define _AppParCurves_MultiBSpCurve_HeaderFile
19
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
23
24 #include <TColStd_HArray1OfReal.hxx>
25 #include <TColStd_HArray1OfInteger.hxx>
26 #include <Standard_Integer.hxx>
27 #include <AppParCurves_MultiCurve.hxx>
28 #include <AppParCurves_Array1OfMultiPoint.hxx>
29 #include <TColStd_Array1OfReal.hxx>
30 #include <TColStd_Array1OfInteger.hxx>
31 #include <Standard_OStream.hxx>
32 class gp_Pnt;
33 class gp_Pnt2d;
34 class gp_Vec;
35 class gp_Vec2d;
36
37
38 //! This class describes a MultiBSpCurve approximating a Multiline.
39 //! Just as a Multiline is a set of a given number of lines, a MultiBSpCurve is a set
40 //! of a specified number of bsplines defined by:
41 //! -   A specified number of MultiPoints - the poles of a specified number of curves
42 //! -   The degree of approximation identical for each of the specified number of curves.
43 //!
44 //! Example of a MultiBSpCurve composed of a specified number of MultiPoints:
45 //!
46 //! P1______P2_____P3______P4________........_____PNbMPoints
47 //!
48 //! Q1______Q2_____Q3______Q4________........_____QNbMPoints
49 //! .                                               .
50 //! .                                               .
51 //! .                                               .
52 //! R1______R2_____R3______R4________........_____RNbMPoints
53 //!
54 //! Pi, Qi, ..., Ri are points of dimension 2 or 3.
55 //!
56 //! (Pi, Qi, ...Ri), i= 1,...NbPoles are MultiPoints.
57 //! each MultiPoint has got NbPol Poles.
58 //! MultiBSpCurves are created by the SplineValue method in the ComputeLine
59 //! class, and by the Value method in TheVariational class. MultiBSpCurve
60 //! provides the information required to create the BSpline defined by the approximation.
61 class AppParCurves_MultiBSpCurve  : public AppParCurves_MultiCurve
62 {
63 public:
64
65   DEFINE_STANDARD_ALLOC
66
67   
68   //! returns an indefinite MultiBSpCurve.
69   Standard_EXPORT AppParCurves_MultiBSpCurve();
70   
71   //! creates a MultiBSpCurve, describing BSpline curves all
72   //! containing the same number of MultiPoint.
73   //! An exception is raised if Degree < 0.
74   Standard_EXPORT AppParCurves_MultiBSpCurve(const Standard_Integer NbPol);
75   
76   //! creates a MultiBSpCurve, describing BSpline curves all
77   //! containing the same number of MultiPoint.
78   //! Each MultiPoint must have NbCurves Poles.
79   Standard_EXPORT AppParCurves_MultiBSpCurve(const AppParCurves_Array1OfMultiPoint& tabMU, const TColStd_Array1OfReal& Knots, const TColStd_Array1OfInteger& Mults);
80   
81   //! creates a MultiBSpCurve, describing BSpline
82   //! curves, taking control points from <SC>.
83   Standard_EXPORT AppParCurves_MultiBSpCurve(const AppParCurves_MultiCurve& SC, const TColStd_Array1OfReal& Knots, const TColStd_Array1OfInteger& Mults);
84   
85   //! Knots of the multiBSpCurve are assigned to <theknots>.
86   Standard_EXPORT void SetKnots (const TColStd_Array1OfReal& theKnots);
87   
88   //! Multiplicities of the multiBSpCurve are assigned
89   //! to <theMults>.
90   Standard_EXPORT void SetMultiplicities (const TColStd_Array1OfInteger& theMults);
91   
92   //! Returns an array of Reals containing
93   //! the multiplicities of curves resulting from the approximation.
94   Standard_EXPORT const TColStd_Array1OfReal& Knots() const;
95   
96   //! Returns an array of Reals containing the
97   //! multiplicities of curves resulting from the approximation.
98   Standard_EXPORT const TColStd_Array1OfInteger& Multiplicities() const;
99   
100   //! returns the degree of the curve(s).
101   Standard_EXPORT virtual Standard_Integer Degree() const Standard_OVERRIDE;
102   
103   //! returns the value of the point with a parameter U
104   //! on the BSpline curve number CuIndex.
105   //! An exception is raised if CuIndex <0 or > NbCurves.
106   //! An exception is raised if the curve dimension is 2d.
107   Standard_EXPORT virtual void Value (const Standard_Integer CuIndex, const Standard_Real U, gp_Pnt& Pt) const Standard_OVERRIDE;
108   
109   //! returns the value of the point with a parameter U
110   //! on the BSpline curve number CuIndex.
111   //! An exception is raised if CuIndex <0 or > NbCurves.
112   //! An exception is raised if the curve dimension is 3d.
113   Standard_EXPORT virtual void Value (const Standard_Integer CuIndex, const Standard_Real U, gp_Pnt2d& Pt) const Standard_OVERRIDE;
114   
115   //! returns the value of the point with a parameter U
116   //! on the BSpline curve number CuIndex.
117   //! An exception is raised if CuIndex <0 or > NbCurves.
118   //! An exception is raised if the curve dimension is 3d.
119   Standard_EXPORT virtual void D1 (const Standard_Integer CuIndex, const Standard_Real U, gp_Pnt& Pt, gp_Vec& V1) const Standard_OVERRIDE;
120   
121   //! returns the value of the point with a parameter U
122   //! on the BSpline curve number CuIndex.
123   //! An exception is raised if CuIndex <0 or > NbCurves.
124   //! An exception is raised if the curve dimension is 2d.
125   Standard_EXPORT virtual void D1 (const Standard_Integer CuIndex, const Standard_Real U, gp_Pnt2d& Pt, gp_Vec2d& V1) const Standard_OVERRIDE;
126   
127   //! returns the value of the point with a parameter U
128   //! on the BSpline curve number CuIndex.
129   //! An exception is raised if CuIndex <0 or > NbCurves.
130   //! An exception is raised if the curve dimension is 3d.
131   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;
132   
133   //! returns the value of the point with a parameter U
134   //! on the BSpline curve number CuIndex.
135   //! An exception is raised if CuIndex <0 or > NbCurves.
136   //! An exception is raised if the curve dimension is 2d.
137   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;
138   
139   //! Prints on the stream o information on the current
140   //! state of the object.
141   //! Is used to redefine the operator <<.
142   Standard_EXPORT virtual void Dump (Standard_OStream& o) const Standard_OVERRIDE;
143
144
145
146
147 protected:
148
149
150
151
152
153 private:
154
155
156
157   Handle(TColStd_HArray1OfReal) myknots;
158   Handle(TColStd_HArray1OfInteger) mymults;
159   Standard_Integer myDegree;
160
161
162 };
163
164
165
166
167
168
169
170 #endif // _AppParCurves_MultiBSpCurve_HeaderFile