[Paraview-developers] Setting DiffuseColor property does not render

anton.piccardo-selg at stfc.ac.uk anton.piccardo-selg at stfc.ac.uk
Tue Mar 31 07:09:00 EDT 2015


Hi,

I am working on a customization of ParaView (3.98.1) for which I want to set glyphs to a certain color. From the forums I learned that I can set the color by specifing the "DiffuseColor" property of the representation. Although I set the property and apply the UpdateVTKObjects() method, the color of the rendered glyphs does not change ( it is currently white and I want to set it to yellow). When I look into the state XML files, I can see that the value was changed.  My code is similar to:

...
pqDataRepresentation *rep = source->getRepresentation(pqActiveObjects::instance().activeView());
pqPipelineRepresentation *pipelineRepresentation = qobject_cast<pqPipelineRepresentation *>(rep);
pipelineRepresentation->getProxy()->UpdatePropertyInformation();

vtkSMDoubleVectorProperty *prop = vtkSMDoubleVectorProperty::SafeDownCast(
                                                       pipelineRepresentation->getProxy()->GetProperty( "DiffuseColor"));
prop->SetElement(0, 1.0);
prop->SetElement(1, 1.0);
prop->SetElement(2, 0.0);

pipelineRepresentation->getProxy()->UpdateVTKObjects();
pqActiveObjects::instance().activeView()->forceRender();
...

I can see that the color that I have set is set as active color in the ColorWindow of the properties panel, but the image doesn't render the color ( it is still white). What am I missing here? I am grateful to hear about any ideas and suggestions.

Many thanks and best regards,

Anton


More information about the Paraview-developers mailing list