[Paraview] Reader Plugin stopped working with ParaView 3.12

Utkarsh Ayachit utkarsh.ayachit at kitware.com
Fri Jan 20 09:09:48 EST 2012


I presume all you're missing is a call to this->view()->render() after
all's done.

Utkarsh

On Tue, Jan 17, 2012 at 4:07 PM, Jagjeet Nain <jagjeet.nain at gmail.com> wrote:
> 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
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the ParaView Wiki at:
> http://paraview.org/Wiki/ParaView
>
> Follow this link to subscribe/unsubscribe:
> http://www.paraview.org/mailman/listinfo/paraview
>


More information about the ParaView mailing list