[Paraview-developers] Get data from server to client (helper?)

Utkarsh Ayachit utkarsh.ayachit at kitware.com
Tue Oct 22 12:36:20 EDT 2013


John,

I cannot reproduce the problem. Try the attached patch. With that, I
have added code to do GatherInformation() on a representation when
it's deleted. Try this:

+ Create Sphere
+ Apply
+ Delete Sphere

You'll see an output on the terminal when CopyFromObject is called. In
built-in mode, I see the output on the client, while in client-server
mode, I only see it on the server, as expected.

Utkarsh

On Tue, Oct 22, 2013 at 12:25 PM, Utkarsh Ayachit
<utkarsh.ayachit at kitware.com> wrote:
> I don;t see anything wrong with what you're doing. Let me try it out
> to see if there's something broken/missing.
>
> Utkarsh
>
> On Tue, Oct 22, 2013 at 12:17 PM, Biddiscombe, John A. <biddisco at cscs.ch> wrote:
>> Utkarsh
>>
>>> Create a new vtkPVInformation subclass with following points to note:
>>>
>>> + Override GetRootOnly() to return 1. Thus ParaView will only gather
>>> the information from the root node.
>>> + Override CopyFromObject() to downcast to right type and call which
>>> every method you want to get the data
>>> + Override CopyToStream and CopyFromStream to serialize the data
>>> collected in CopyFromObject to/from a client-server stream.
>>> + AddInformation() is used to reduce the results in parallel. Since
>>> you don't need that, I believe you can leave that empty.
>>>
>>> Now, in your client code, to fetch the data you can do something as follows:
>>>
>>> vtkNew<vtkMyNewInformationClass> instance;
>>> repr->getProxy()->GatherInformation(instance.GetPointer())
>>
>> When we do this, the GatherInformation call is executing on the client. I've experimented with
>>   repr->getProxy()->GatherInformation(info.GetPointer(), vtkPVSession::RENDER_SERVER);
>> but the CopyFromObject() call inside the information is copying on the client, and so results are wrong. I had assumed it would CopyFromObject on the root node of the server, and then CopyToStream and on the client do a CopyDromStream.
>>
>> Is there another step I need perhaps to trigger it to do this the way I expect?
>>
>> thanks
>>
>> JB
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Hack.patch
Type: text/x-patch
Size: 1496 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/paraview-developers/attachments/20131022/88f94e31/attachment.bin>


More information about the Paraview-developers mailing list