<html>
VTK Gurus:<br><br>
I've got 3D CAD model viewer application. I'm using VTK v4.0 on an
SGI.<br><br>
My models are made of little polygons that have a material property
integer. Models are composed of several "parts". I'd like my
application to be able to change the color of each polygon based on
either the material property integer or the part number.<br><br>
I can color the models both ways. I color according to material property
by using a vtkIntegerArray and something like this:<br>
<dl><font face="Courier New, Courier">
<dd>pdFacet->GetCellData()->SetScalars(materialPropInteger);<br><br>
</font>
</dl>where pdFacet is a vtkPolyData object. I do this step while reading
the CAD model data in from a file.<br><br>
Alternatively, I can color the model based on part number this way:<br>
<dl><font face="Courier New, Courier">
<dd>actorFoo->GetProperty()->SetColor(icol1, icol2,
icol3);<br><br>
</font>
</dl>Both methods work fine independently. However, I cannot toggle
between these two modes easily. I could re-read from disk, but this would
be inefficient. I could create another vtkIntegerArray and store the part
number for each polygon, but I don't know how to change the SetScalars
thing once I've done the PolyData to Mapper to Actor process.<br><br>
Suggestions?<br><br>
Thanks,<br>
Scott<br>
</html>