// File: GeomToStep_MakeBSplineCurveWithKnots_gen.gxx // Created: Thu Aug 5 16:13:17 1993 // Author: Martine LANGLOIS // Handle(StepGeom_BSplineCurveWithKnots) BSWK; Standard_Integer Deg, N, i, Nknots, itampon; Standard_Real rtampon; Handle(StepGeom_CartesianPoint) Pt = new StepGeom_CartesianPoint; Handle(StepGeom_HArray1OfCartesianPoint) Listpoints; StepGeom_BSplineCurveForm Form; StepData_Logical Fermeture, Selfinter; Handle(TColStd_HArray1OfInteger) Mult; Handle(TColStd_HArray1OfReal) ListKnots, ListWeights; GeomAbs_BSplKnotDistribution Distribution; StepGeom_KnotType KnotSpec; Deg = BS->Degree(); N = BS->NbPoles(); Array1OfPnt_gen P(1,N); BS->Poles(P); Listpoints = new StepGeom_HArray1OfCartesianPoint(1,N); for ( i=P.Lower(); i<=P.Upper(); i++) { GeomToStep_MakeCartesianPoint MkPoint(P.Value(i)); Pt = MkPoint.Value(); Listpoints->SetValue(i, Pt); } Form = StepGeom_bscfUnspecified; if (BS->IsClosed()) Fermeture = StepData_LTrue; else Fermeture = StepData_LFalse; Selfinter = StepData_LFalse; Nknots = BS->NbKnots(); TColStd_Array1OfInteger M(1,Nknots); BS->Multiplicities(M); Mult = new TColStd_HArray1OfInteger(1,Nknots); for ( i=M.Lower(); i<=M.Upper(); i++) { itampon = M.Value(i); Mult->SetValue(i, itampon); } TColStd_Array1OfReal K(1,Nknots); BS->Knots(K); ListKnots = new TColStd_HArray1OfReal(1,Nknots); for ( i=K.Lower(); i<=K.Upper(); i++) { rtampon = K.Value(i); ListKnots->SetValue(i, rtampon); } Distribution = BS->KnotDistribution(); if ( Distribution == GeomAbs_NonUniform ) KnotSpec = StepGeom_ktUnspecified; else if ( Distribution == GeomAbs_Uniform ) KnotSpec = StepGeom_ktUniformKnots; else if ( Distribution == GeomAbs_QuasiUniform ) KnotSpec = StepGeom_ktQuasiUniformKnots; else KnotSpec = StepGeom_ktPiecewiseBezierKnots; BSWK = new StepGeom_BSplineCurveWithKnots; Handle(TCollection_HAsciiString) name = new TCollection_HAsciiString(""); BSWK->Init(name, Deg, Listpoints, Form, Fermeture, Selfinter, Mult, ListKnots, KnotSpec ); theBSplineCurveWithKnots = BSWK; done = Standard_True;