From: fps Date: Thu, 14 Nov 2013 14:11:03 +0000 (+0000) Subject: Fix issue with XAO import X-Git-Tag: BR_hydro_v_0_3_1~24 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=2bcfa2c510b8f5370ae39623253fdf5895ad9e59;p=modules%2Fgeom.git Fix issue with XAO import --- diff --git a/src/GEOMImpl/GEOMImpl_IInsertOperations.cxx b/src/GEOMImpl/GEOMImpl_IInsertOperations.cxx index dd96ec8a6..9e5998fe7 100644 --- a/src/GEOMImpl/GEOMImpl_IInsertOperations.cxx +++ b/src/GEOMImpl/GEOMImpl_IInsertOperations.cxx @@ -1263,7 +1263,7 @@ bool GEOMImpl_IInsertOperations::ImportXAO(const char* fileName, { XAO::Field* xaoField = xaoObject->getField(i); - Handle(TColStd_HArray1OfExtendedString) components = new TColStd_HArray1OfExtendedString(0, xaoField->countComponents()); + Handle(TColStd_HArray1OfExtendedString) components = new TColStd_HArray1OfExtendedString(0, xaoField->countComponents()-1); for (int j = 0; j < xaoField->countComponents(); ++j) { components->SetValue(j, (TCollection_ExtendedString)xaoField->getComponentName(j).c_str()); @@ -1285,11 +1285,11 @@ bool GEOMImpl_IInsertOperations::ImportXAO(const char* fileName, XAO::BooleanStep* bstep = bfield->getStep(j); Handle(GEOM_FieldStep) step = field->AddStep(bstep->getStep(), bstep->getStamp()); - Handle(TColStd_HArray1OfInteger) values = new TColStd_HArray1OfInteger(0, bstep->countValues()); + Handle(TColStd_HArray1OfInteger) values = new TColStd_HArray1OfInteger(0, bstep->countValues()-1); std::vector bvalues = bstep->getValues(); for (int k = 0; k < bstep->countValues(); ++k) { - values->SetValue(0, bvalues[k] ? 1 : 0); + values->SetValue(k, bvalues[k] ? 1 : 0); } step->SetValues(values); } @@ -1303,11 +1303,11 @@ bool GEOMImpl_IInsertOperations::ImportXAO(const char* fileName, XAO::IntegerStep* istep = ifield->getStep(j); Handle(GEOM_FieldStep) step = field->AddStep(istep->getStep(), istep->getStamp()); - Handle(TColStd_HArray1OfInteger) values = new TColStd_HArray1OfInteger(0, istep->countValues()); + Handle(TColStd_HArray1OfInteger) values = new TColStd_HArray1OfInteger(0, istep->countValues()-1); std::vector ivalues = istep->getValues(); for (int k = 0; k < istep->countValues(); ++k) { - values->SetValue(0, ivalues[k]); + values->SetValue(k, ivalues[k]); } step->SetValues(values); } @@ -1321,11 +1321,11 @@ bool GEOMImpl_IInsertOperations::ImportXAO(const char* fileName, XAO::DoubleStep* dstep = dfield->getStep(j); Handle(GEOM_FieldStep) step = field->AddStep(dstep->getStep(), dstep->getStamp()); - Handle(TColStd_HArray1OfReal) values = new TColStd_HArray1OfReal(0, dstep->countValues()); + Handle(TColStd_HArray1OfReal) values = new TColStd_HArray1OfReal(0, dstep->countValues()-1); std::vector dvalues = dstep->getValues(); for (int k = 0; k < dstep->countValues(); ++k) { - values->SetValue(0, dvalues[k]); + values->SetValue(k, dvalues[k]); } step->SetValues(values); } @@ -1339,11 +1339,11 @@ bool GEOMImpl_IInsertOperations::ImportXAO(const char* fileName, XAO::StringStep* sstep = sfield->getStep(j); Handle(GEOM_FieldStep) step = field->AddStep(sstep->getStep(), sstep->getStamp()); - Handle(TColStd_HArray1OfExtendedString) values = new TColStd_HArray1OfExtendedString(0, sstep->countValues()); + Handle(TColStd_HArray1OfExtendedString) values = new TColStd_HArray1OfExtendedString(0, sstep->countValues()-1); std::vector svalues = sstep->getValues(); for (int k = 0; k < sstep->countValues(); ++k) { - values->SetValue(0, TCollection_ExtendedString(svalues[k].c_str())); + values->SetValue(k, TCollection_ExtendedString(svalues[k].c_str())); } step->SetValues(values); } @@ -1361,7 +1361,6 @@ bool GEOMImpl_IInsertOperations::ImportXAO(const char* fileName, // list of sub shapes pd << "["; int nbSubshapes = subShapes->Length(); - std::cout << "Nb SubShapes = " << nbSubshapes << std::endl; if (nbSubshapes > 0) { for (int i = 1; i <= nbSubshapes; i++)