Skip to content

GitLab

  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • VTK VTK
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 738
    • Issues 738
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 202
    • Merge requests 202
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Infrastructure Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • VTK
  • VTKVTK
  • Issues
  • #4041

Closed
Open
Created Nov 09, 2006 by Kitware Robot@kwrobotOwner

bug in both vtkPlot3DReader.cxx and vtkMultiBlockPLOT3DReader.cxx

This issue was created automatically from an original Mantis Issue. Further discussion may take place here.


There appears to be a bug in both vtkPlot3DReader.cxx and vtkMultiBlockPLOT3DReader.cxx

The function "ReadQHeader" (in both files) does not properly handle 2D geometries.

 int vtkPLOT3DReader::ReadQHeader(FILE* fp)
 {
   int numGrid = this->GetNumberOfOutputsInternal(fp, 0);
   vtkDebugMacro("Q number of grids: " << numGrid);
   if ( numGrid == 0 )
     {
     return VTK_ERROR;
     }
 
   this->SkipByteCount(fp);
   for(int i=0; i<numGrid; i++)
     {
     int ni, nj, nk;
     this->ReadIntBlock(fp, 1, &ni);
     this->ReadIntBlock(fp, 1, &nj);
     this->ReadIntBlock(fp, 1, &nk);

The above incorrectly attempts to read "nk" whether the data is 2D or 3D. The above should be changed to test for the 2D case :

   for(i=0; i<numGrid; i++)
     {
     int ni, nj, nk;
     this->ReadIntBlock(fp, 1, &ni);
     this->ReadIntBlock(fp, 1, &nj);
     if (!this->TwoDimensionalGeometry)
       {
       this->ReadIntBlock(fp, 1, &nk);
       }
     else
       {
       nk = 1;
       }

This is how it is correctly handled in the function "ReadGeometryHeader".

Assignee
Assign to
Time tracking