Index: vtkEnSightGoldBinaryReader.cxx =================================================================== RCS file: /cvsroot/ParaView3/ParaView3/VTK/IO/vtkEnSightGoldBinaryReader.cxx,v retrieving revision 1.78 diff -u -r1.78 vtkEnSightGoldBinaryReader.cxx --- vtkEnSightGoldBinaryReader.cxx 15 Dec 2008 18:34:41 -0000 1.78 +++ vtkEnSightGoldBinaryReader.cxx 23 Mar 2009 16:57:53 -0000 @@ -183,11 +183,14 @@ } } } - - while (strncmp(line, "BEGIN TIME STEP", 15) != 0) + + // use do-while here to initialize 'line' before 'strncmp' is appllied + // Thanks go to Brancois for care of this issue + do { this->ReadLine(line); } + while ( strncmp(line, "BEGIN TIME STEP", 15) != 0 ); } // Skip the 2 description lines. @@ -244,6 +247,11 @@ } realId = this->InsertNewPartId(partId); + // Increment the number of geoemtry parts such that the measured geomtry, + // if any, can be properly combined into a vtkMultiBlockDataSet object. + // --- fix to bug #7453 + this->NumberOfGeometryParts ++; + this->ReadLine(line); // part description line strncpy(nameline, line, 80); // 80 characters in line are allowed @@ -1124,21 +1132,14 @@ this->ReadFloatArray(yCoords, this->NumberOfMeasuredPoints); this->ReadFloatArray(zCoords, this->NumberOfMeasuredPoints); - if (this->ParticleCoordinatesByIndex) - { - for (i = 0; i < this->NumberOfMeasuredPoints; i++) - { - points->InsertNextPoint(xCoords[i], yCoords[i], zCoords[i]); - pd->InsertNextCell(VTK_VERTEX, 1, &i); - } - } - else + // NOTE: EnSight always employs a 1-based indexing scheme and therefore + // 'if (this->ParticleCoordinatesByIndex)' was removed here. Otherwise + // the measured geometry could not be proeperly interpreted. + // This bug was noticed while fixing bug #7453. + for (i = 0; i < this->NumberOfMeasuredPoints; i++) { - for (i = 0; i < this->NumberOfMeasuredPoints; i++) - { - points->InsertNextPoint(xCoords[i], yCoords[i], zCoords[i]); - pd->InsertNextCell(VTK_VERTEX, 1, (vtkIdType*)&pointIds[i]); - } + points->InsertNextPoint(xCoords[i], yCoords[i], zCoords[i]); + pd->InsertNextCell(VTK_VERTEX, 1, &i); } pd->SetPoints(points); @@ -1258,7 +1259,9 @@ numPts = output->GetNumberOfPoints(); if (numPts) { - this->ReadLine(line); + // 'this->ReadLine(line)' was removed here, otherwise there would be a + // problem with timestep retrieval of the measured scalars. + // This bug was noticed while fixing bug #7453. scalars = vtkFloatArray::New(); scalars->SetNumberOfComponents(numberOfComponents); scalars->SetNumberOfTuples(numPts);