[vtkusers] VTK 6 vtkCompositeDataDisplayAttributes

Chao Liang chaolian at mtu.edu
Thu Aug 15 17:16:15 EDT 2013


Hi,

>From this example,
http://vtk.org/gitweb?p=VTK.git;a=blob;f=Rendering/OpenGL/Testing/Cxx/TestMultiblockDisplayProperties.cxx
It shows how to color each block on a multiblockdataset, but this dataset
is get from a reader:
vtkXMLMultiBlockDataReader

Then the key line is:
mapper->SetInputConnection(reader->GetOutputPort());
then it works, i can see different colors on different blocks.

But in my case, say, I already have a vtkMultiBlockDataSet *mb in my code,
so I don't need to use any reader. Then this is what I did:

vtkCompositeDataGeometryFilter *sgfilter =
vtkCompositeDataGeometryFilter::New();
sgfilter->SetInputData(mb);
sgfilter->Update();
mapper->SetInputConnection(sgfilter->GetOutputPort());

But it doesn't work, I cannot see different colors as I expected.

So, what should I do in my case in order to use
vtkCompositeDataDisplayAttributes class to show different colors in
different blocks.

Thanks in advance.

Chao
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20130815/d24acb69/attachment.htm>


More information about the vtkusers mailing list