1 // Created on: 1994-02-18
2 // Created by: Bruno DUMORTIER
3 // Copyright (c) 1994-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.
18 #include <Geom_BSplineCurve.hxx>
19 #include <GeomFill_SectionGenerator.hxx>
21 //=======================================================================
22 //function : GeomFill_SectionGenerator
24 //=======================================================================
25 GeomFill_SectionGenerator::GeomFill_SectionGenerator()
27 if ( mySequence.Length() > 1 ) {
28 Handle(TColStd_HArray1OfReal) HPar
29 = new (TColStd_HArray1OfReal) (1,mySequence.Length());
30 for (Standard_Integer i = 1; i<=mySequence.Length(); i++) {
31 HPar->ChangeValue(i) = i-1;
38 //=======================================================================
39 //function : GeomFill_SectionGenerator
41 //=======================================================================
43 void GeomFill_SectionGenerator::SetParam(const Handle(TColStd_HArray1OfReal) & Params)
45 Standard_Integer ii, L = Params->Upper()-Params->Lower()+1;
47 for (ii=1; ii<=L; ii++) {
48 myParams->SetValue(ii,Params->Value(Params->Lower()+ii-1));
53 //=======================================================================
56 //=======================================================================
58 void GeomFill_SectionGenerator::GetShape(Standard_Integer& NbPoles,
59 Standard_Integer& NbKnots,
60 Standard_Integer& Degree,
61 Standard_Integer& NbPoles2d) const
63 Handle(Geom_BSplineCurve) C =
64 Handle(Geom_BSplineCurve)::DownCast(mySequence(1));
65 NbPoles = C->NbPoles();
66 NbKnots = C->NbKnots();
72 //=======================================================================
75 //=======================================================================
77 void GeomFill_SectionGenerator::Knots(TColStd_Array1OfReal& TKnots) const
79 (Handle(Geom_BSplineCurve)::DownCast(mySequence(1)))->Knots(TKnots);
83 //=======================================================================
86 //=======================================================================
88 void GeomFill_SectionGenerator::Mults(TColStd_Array1OfInteger& TMults) const
90 (Handle(Geom_BSplineCurve)::DownCast(mySequence(1)))->Multiplicities(TMults);
94 //=======================================================================
97 //=======================================================================
99 Standard_Boolean GeomFill_SectionGenerator::Section
100 (const Standard_Integer P,
101 TColgp_Array1OfPnt& Poles,
102 TColgp_Array1OfVec& , //DPoles,
103 TColgp_Array1OfPnt2d& Poles2d,
104 TColgp_Array1OfVec2d& , //DPoles2d,
105 TColStd_Array1OfReal& Weigths,
106 TColStd_Array1OfReal& //DWeigths
109 Section(P , Poles, Poles2d, Weigths);
110 return Standard_False;
114 //=======================================================================
117 //=======================================================================
119 void GeomFill_SectionGenerator::Section
120 (const Standard_Integer P,
121 TColgp_Array1OfPnt& Poles,
122 TColgp_Array1OfPnt2d& , //Poles2d,
123 TColStd_Array1OfReal& Weigths ) const
125 Handle(Geom_BSplineCurve) C =
126 Handle(Geom_BSplineCurve)::DownCast(mySequence(P));
133 //=======================================================================
134 //function : Parameter
136 //=======================================================================
138 Standard_Real GeomFill_SectionGenerator::Parameter
139 (const Standard_Integer P) const
141 return myParams->Value(P);