[Paraview] Reader Plugin stopped working with ParaView 3.12

Jagjeet Nain jagjeet.nain at gmail.com
Tue Jan 17 16:07:54 EST 2012


Hi,
I had a reader plugin which used to work fine with ParaView 3.8.1, but
stopped working when it was compiled with paraview 3.12.

This reader used to load image geometry as points and then used to load
image as texture to be overlaid on points.
After porting to Paraview 3.12, only Points geometry gets displayed but
image does not get displayed .
After executing the reader, I can see that image name is populated in the
"Apply Texture" list of Display panel and it is also active but still image
is not shown.
When I select "None" and then re-select same(as previous) image name in the
drop down list of "Apply Texture", then image gets displayed.
*So in short although correct image name is getting populated in the list
and that is active as well but image  only  gets displayed in the second
activation. This was not the case with Paraview 3.8.1.*
Below is the code which loads texture as image. This method is connected to
the dataUpdated(pqPipelineSource*)

bool loadTexture()
{

QFileInfo finfo(this->filename);
  if (!finfo.isReadable() )
    {
    return false;
    }

vtkSMSourceProxy* sp = vtkSMSourceProxy::SafeDownCast(this->proxy());
vtkSMStringVectorProperty *name = vtkSMStringVectorProperty::SafeDownCast(
sp->GetProperty("FileName") );
this->filename = name->GetElement(0);

pqPipelineSource* ps =
qobject_cast<pqPipelineSource*>(this->referenceProxy());
 //we should never have more than 1 view for this, so we don't need to
worry about this
pqDataRepresentation *rep = ps->getRepresentation(  this->view() );
if ( rep )
{
vtkSMProxyManager* pxm = vtkSMProxyManager::GetProxyManager();
vtkSMProxy* texture = pxm->NewProxy("textures", "ImageTexture");
 //texture->SetConnectionID( this->proxy()->GetConnectionID() );
//texture->SetServers(vtkProcessModule::CLIENT|vtkProcessModule::RENDER_SERVER);

pqSMAdaptor::setElementProperty(texture->GetProperty("FileName"), filename);
pqSMAdaptor::setEnumerationProperty(texture->GetProperty("SourceProcess"),
"Client");
texture->UpdateVTKObjects();

pxm->RegisterProxy(TEXTURESGROUP,
vtksys::SystemTools::GetFilenameName(filename.toAscii().data()).c_str(),
texture);

vtkSMProperty* textureProperty = rep->getProxy()->GetProperty("Texture");
if ( textureProperty )
{
pqSMAdaptor::setProxyProperty(textureProperty, texture);
texture->UpdateVTKObjects();
}
texture->Delete();
}
  return true;
}


Can somebody please point me out what extra should I do in the above code
to make it Paraview 3.12 compatible.
with regards
Jagjeet
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.paraview.org/pipermail/paraview/attachments/20120117/0e6eb25f/attachment.htm>


More information about the ParaView mailing list