[Paraview-developers] Retrieve VTK data from pqPipelineSource
David E DeMarle
dave.demarle at kitware.com
Tue Jan 31 17:15:23 EST 2012
vtkSMProxy *myProxy = pqPipelineSource->getProxy();
vtkObjectBase *myObject = myProxy->GetClientSideObject();
Then you can safe down cast that to a vtkAlgorithm and then get that
algorithm's output dataset.
However be warned getting the object in this way is problematic
because of the nature of a proxy. There isn't always a 1:1 mapping
between proxies and vtk instances and it won't work at all in a client
server setting. You can't get a pointer to something that lives (in
many instances) on a remote (parallel) server. That is what the proxy
layer is for - controlling things without necessarily having direct
access to them.
David E DeMarle
Kitware, Inc.
R&D Engineer
21 Corporate Drive
Clifton Park, NY 12065-8662
Phone: 518-881-4909
On Mon, Jan 30, 2012 at 4:55 PM, Joe Ping-Lin Hsiao <phsiao at cs.unc.edu> wrote:
> I am still stuck on this problem. Any suggestion?
>
> On Sun, Jan 1, 2012 at 5:20 PM, Joe Ping-Lin Hsiao <phsiao at cs.unc.edu> wrote:
>> Hi,
>>
>> Is there any way to retrieve VTK data pointers (e.g. vtkImageData)
>> from pqPipelineSource?
>> The thing that I am planing to do is keeping all the pointers of the
>> loaded image stacks, so later I'll be able to color one data with
>> another data set's scalar array. Which color array to use will be
>> determined by user through a QComboBox.
>>
>> Right now I have a slot function receiving the signal
>> "pqApplicationCore::instance()->getObjectBuilder()->sourceCreated(pqPipelineSource*)"
>> whenever a source is created, but I couldn't find a way to get the
>> vtkImageData from pqPipelineSource.
>>
>> The closest post I found is a 2008 thread where
>> vtkSMClientDeliveryRepresentationProxy was suggested:
>> http://www.cmake.org/pipermail/paraview/2008-February/007057.html
>> But seems like there's no examples of
>> vtkSMClientDeliveryRepresentationProxy in ParaView 3.12.0.
>> Any suggestion?
> _______________________________________________
> Paraview-developers mailing list
> Paraview-developers at paraview.org
> http://public.kitware.com/mailman/listinfo/paraview-developers
More information about the Paraview-developers
mailing list