Commit 531e8af0 authored by Brad King's avatar Brad King 💬
Browse files

BUG: Added support for color_scalars to ExecuteInformation.

parent 35fb6c74
......@@ -21,7 +21,7 @@
#include "vtkPointData.h"
#include "vtkStructuredPoints.h"
vtkCxxRevisionMacro(vtkStructuredPointsReader, "1.58");
vtkCxxRevisionMacro(vtkStructuredPointsReader, "1.59");
vtkStandardNewMacro(vtkStructuredPointsReader);
vtkStructuredPointsReader::vtkStructuredPointsReader()
......@@ -250,6 +250,31 @@ void vtkStructuredPointsReader::ExecuteInformation()
}
break;
}
else if ( ! strncmp(this->LowerCase(line), "color_scalars", 13) )
{
this->ReadString(line);
this->ReadString(line);
int numComp = atoi(line);
if (numComp < 1)
{
vtkErrorMacro("Cannot read color_scalar header!" << " for file: "
<< (this->FileName?this->FileName:"(Null FileName)"));
return;
}
output->SetNumberOfScalarComponents(numComp);
// Color scalar type is predefined by FileType.
scalarTypeRead = 1;
if(this->FileType == VTK_BINARY)
{
output->SetScalarTypeToUnsignedChar();
}
else
{
output->SetScalarTypeToFloat();
}
break;
}
}
break; //out of this loop
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment