[Paraview] Accessing VTK data from a Paraview plugin

Utkarsh Ayachit utkarsh.ayachit at kitware.com
Tue Feb 19 10:42:29 EST 2008


As you have discovered, there is no direct access to the actual 
vtkDataObject on the client side. This is because paraview supports 
server configurations in which the data processing server may be in 
another process. In that case one cannot directly access the data on the 
client side, since the data is never delivered in its entirety to the 
client.

Utkarsh

Miron Sadziak wrote:
> Thank you for you help. I checked the filter plugin description and the 
> examples but I think thats not what I want. At least I cant figure out 
> how I can use it to read the raw data through the client. The code I 
> posted in the previous mail is already a part of a plugin which shows a 
> toolbar with buttons in Paraview client. Clicking on a button should pop 
> up a window with the point coordinates of all points of the selected 
> source. Thats the aim but now it only shows the number of points and the 
> vtk class name "vtkImageData". Since these informations are already on 
> the client there must be a simple way to get also all the point 
> coordinates/point data of that vtkImageData class. How to do it ?
> 
> 
> Mike Jackson さんは書きました:
>> You probably want to write a Filter plugin for ParaView. Look on the 
>> Wiki for more information.
>>
>> Mike
>>
>> On Feb 18, 2008, at 8:16 PM, Miron Sadziak wrote:
>>
>>> Hi
>>>
>>> I want to write a plugin for Paraview to manipulate the data Paraview
>>> has opened.
>>> It will be mostly ImageData or PolyData but I would like to understand
>>> the general idea how to do it.
>>> Im using C++ so the code i have figured out by now looks like that:
>>>
>>> #Getting the active source
>>> pqApplicationCore* core = pqApplicationCore::instance();
>>> pqServerManagerSelection sels = 
>>> *core->getSelectionModel()->selectedItems();
>>> pqPipelineSource* source = 0;
>>> pqServerManagerModelItem* item = 0;
>>> pqServerManagerSelection::ConstIterator iter = sels.begin();
>>> item = *iter;
>>> source = dynamic_cast<pqPipelineSource*>(item);
>>>
>>> #Trying to access the data of the source.
>>> #Here I can access data information only, not raw-data
>>> vtkPVDataInformation*
>>> datainfo=source->getOutputPort(0)->getDataInformation(true);
>>> cout << "PointsNumber " << datainfo->GetNumberOfPoints() << "\n";
>>> cout << "DataClassName " << datainfo->GetDataClassName() << "\n";
>>>
>>> It all works but its just data information.
>>> I would like to access a function like GetData or GetDataArray to be
>>> able to read the data contained in the VTK object. To read/write
>>> directly from/to the data array. The problem is that I cant find a
>>> suitable function in any of the classes like pqPipelineSource,
>>> vtkPVDataInformation etc.
>>> What should I do ?
>>>
>>> I would be thankful for any help,
>>> Paraview user
>>>
>>>
>>
> 
> _______________________________________________
> ParaView mailing list
> ParaView at paraview.org
> http://www.paraview.org/mailman/listinfo/paraview
> 


More information about the ParaView mailing list