From: apo Date: Tue, 27 Sep 2005 12:47:35 +0000 (+0000) Subject: To improve Data assignment X-Git-Tag: BR-D5-38-2003_D2005-12-10~131 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=7010bd2a4bf5032507b75e2fec27422ecfe36c67;p=modules%2Fvisu.git To improve Data assignment --- diff --git a/src/CONVERTOR/VISU_Convertor_impl.cxx b/src/CONVERTOR/VISU_Convertor_impl.cxx index 3a9db26d..6cf610fa 100644 --- a/src/CONVERTOR/VISU_Convertor_impl.cxx +++ b/src/CONVERTOR/VISU_Convertor_impl.cxx @@ -1061,9 +1061,10 @@ namespace default: aDataSetAttributes = theSource->GetCellData(); } - int aNumberOfComponents=theField->myNbComp; + + int aNbComp = theField->myNbComp; vtkFloatArray *aFloatArray = vtkFloatArray::New(); - switch(aNumberOfComponents) { + switch(aNbComp) { case 1: aFloatArray->SetNumberOfComponents(1); aDataSetAttributes->SetScalars(aFloatArray); @@ -1072,74 +1073,53 @@ namespace aFloatArray->SetNumberOfComponents(3); aDataSetAttributes->SetVectors(aFloatArray); } - aFloatArray->Delete(); aFloatArray->SetNumberOfTuples(aNbTuples); aFloatArray->SetName(aFieldName.c_str()); - // - vtkFloatArray *aFArr=vtkFloatArray::New(); - aFArr->SetNumberOfComponents(aNumberOfComponents); - aFArr->SetNumberOfTuples(aNbTuples); - aFArr->SetName("VISU_FIELD"); - aDataSetAttributes->AddArray(aFArr); - aFArr->Delete(); - // + + vtkFloatArray *aDataArray = vtkFloatArray::New(); + aDataArray->SetNumberOfComponents(aNbComp); + aDataArray->SetNumberOfTuples(aNbTuples); + aDataSetAttributes->AddArray(aDataArray); + aDataArray->SetName("VISU_FIELD"); + TGeom2Value& aGeom2Value = theValForTime->myGeom2Value; TGeom2Value::const_iterator anIter = aGeom2Value.begin(); - int aTupleIdx = 0, aTupleId = 0; - vectoraVal(aNumberOfComponents); - // - for(; anIter != aGeom2Value.end(); anIter++){ + TVector aDataValues(aNbComp); + for(int aTupleId = 0; anIter != aGeom2Value.end(); anIter++){ int aGeom = anIter->first; const TMeshValue& aMeshValue = anIter->second; int aNbElem = aMeshValue.myNbElem; int aNbGauss = aMeshValue.myNbGauss; - //int aNbComp = aMeshValue.myNbComp; INITMSG(MYDEBUG, "- aGeom = "<