From: apo Date: Tue, 27 Mar 2007 14:20:03 +0000 (+0000) Subject: To fix Bug NPAL15278 - "EDF 347 : ScalarMaponDeformedShape" X-Git-Tag: V3_2_6pre3 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=b527a2388ef0010fbd22e137aa89d0336387b668;p=modules%2Fgui.git To fix Bug NPAL15278 - "EDF 347 : ScalarMaponDeformedShape" --- diff --git a/src/VTKViewer/VTKViewer_AppendFilter.cxx b/src/VTKViewer/VTKViewer_AppendFilter.cxx index 4218c4f20..b5aea6697 100644 --- a/src/VTKViewer/VTKViewer_AppendFilter.cxx +++ b/src/VTKViewer/VTKViewer_AppendFilter.cxx @@ -256,13 +256,17 @@ VTKViewer_AppendFilter vtkIdList *ptIds; vtkDataSet *ds; vtkUnstructuredGrid *output = this->GetOutput(); - // + numPts = myPoints->GetNumberOfPoints(); if (numPts < 1) { return; } - // + numCells = 0; + + vtkDataSetAttributes::FieldList cellList(this->NumberOfInputs); + int firstCD=1; + for (idx = 0; idx < this->NumberOfInputs; ++idx) { ds = (vtkDataSet *)(this->Inputs[idx]); if (ds != NULL) { @@ -270,14 +274,29 @@ VTKViewer_AppendFilter continue; //no input, just skip } numCells += ds->GetNumberOfCells(); + + cd = ds->GetCellData(); + if ( firstCD ) + { + cellList.InitializeFieldList(cd); + firstCD = 0; + } + else + { + cellList.IntersectFieldList(cd); + } }//if non-empty dataset }//for all inputs + if (numCells < 1) { return; } - // + // Now can allocate memory output->Allocate(numCells); + vtkCellData *outputCD = output->GetCellData(); + outputCD->CopyAllocate(cellList,numCells); + ptIds = vtkIdList::New(); ptIds->Allocate(VTK_CELL_SIZE); // @@ -295,6 +314,7 @@ VTKViewer_AppendFilter for (cellId=0; cellIdGetCellPoints(cellId, ptIds); newCellId = output->InsertNextCell(ds->GetCellType(cellId), ptIds); + outputCD->CopyData(cellList,cd,idx,cellId,newCellId); } } }