[Paraview-developers] How to obtain pqPipelineSource from vtkObject?

Hillier, Michael (NRCan/RNCan) michael.hillier at canada.ca
Tue Jan 19 16:20:26 EST 2016


I am having trouble figuring out how to get a pqPipelineSource from a vtkObject (specifically a vtkPolyData) so that I can view those objects in paraview from my plugin. Here is my code


vtkSmartPointer<vtkXMLPolyDataReader> reader = vtkSmartPointer<vtkXMLPolyDataReader>::New();
std::string binary_string; // I get this from a database which stores contents of a binary .vtp file
reader->SetInputString(binary_string);
reader->ReadFromInputStringOn();
reader->Update();

pqApplicationCore *core = pqApplicationCore::instance();
pqDisplayPolicy *displayPolicy = core->getDisplayPolicy();
pqView *view = pqActiveObjects::instance().activeView();

pqPipelineSource* source = ??? // want to obtain from vtkObject/vtkPolyData somehow (vtkPolyData * pdata = reader->GetOutput());
vtkSMProxy *sourceProxy = source->getProxy();
sourceProxy->UpdateVTKObjects();
displayPolicy->setRepresentationVisibility(source->getOutputPort(0),view,true);


Any help much appreciated.

Michael
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/paraview-developers/attachments/20160119/7de1f8c2/attachment.html>


More information about the Paraview-developers mailing list