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
6 // This file is part of Open CASCADE Technology software library.
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.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
17 #ifndef _AppParCurves_MultiBSpCurve_HeaderFile
18 #define _AppParCurves_MultiBSpCurve_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
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>
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.
44 //! Example of a MultiBSpCurve composed of a specified number of MultiPoints:
46 //! P1______P2_____P3______P4________........_____PNbMPoints
48 //! Q1______Q2_____Q3______Q4________........_____QNbMPoints
52 //! R1______R2_____R3______R4________........_____RNbMPoints
54 //! Pi, Qi, ..., Ri are points of dimension 2 or 3.
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
68 //! returns an indefinite MultiBSpCurve.
69 Standard_EXPORT AppParCurves_MultiBSpCurve();
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);
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);
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);
85 //! Knots of the multiBSpCurve are assigned to <theknots>.
86 Standard_EXPORT void SetKnots (const TColStd_Array1OfReal& theKnots);
88 //! Multiplicities of the multiBSpCurve are assigned
90 Standard_EXPORT void SetMultiplicities (const TColStd_Array1OfInteger& theMults);
92 //! Returns an array of Reals containing
93 //! the multiplicities of curves resulting from the approximation.
94 Standard_EXPORT const TColStd_Array1OfReal& Knots() const;
96 //! Returns an array of Reals containing the
97 //! multiplicities of curves resulting from the approximation.
98 Standard_EXPORT const TColStd_Array1OfInteger& Multiplicities() const;
100 //! returns the degree of the curve(s).
101 Standard_EXPORT virtual Standard_Integer Degree() const Standard_OVERRIDE;
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;
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;
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;
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;
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;
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;
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;
157 Handle(TColStd_HArray1OfReal) myknots;
158 Handle(TColStd_HArray1OfInteger) mymults;
159 Standard_Integer myDegree;
170 #endif // _AppParCurves_MultiBSpCurve_HeaderFile