[Paraview] Send an array from client to server
Utkarsh Ayachit
utkarsh.ayachit at kitware.com
Sat Sep 26 19:32:11 EDT 2015
I am sure you're misinterpreting the code. I created the extra vtkSM class
in my example only so that I can do the "SendStream" somewhere. Anycase,
I'll let you figure that out when you have the time.
Utkarsh
On Sat, Sep 26, 2015 at 6:10 PM, Biddiscombe, John A. <biddisco at cscs.ch>
wrote:
> Thanks Utkarsh,
>
> I’ve decided to stick with my own solution for the time being – having to
> create extra vtkSMxxx classes for all the sources adds too much maintenance
> to the code, whereas just adding an #include seems cleaner. When my
> immediate deadline has passed I’ll look again at it.
>
> Thanks
>
> JB
>
> From: Utkarsh Ayachit <utkarsh.ayachit at kitware.com>
> Date: Thursday 24 September 2015 17:57
> To: cscs <biddisco at cscs.ch>
> Cc: "paraview at paraview.org" <paraview at paraview.org>
> Subject: Re: [Paraview] Send an array from client to server
>
> Attached is the solution, there a small mistake in my origin script:
>
> vtkClientServerStream stream;
> stream << vtkClientServerStream::Invoke
> << VTKOBJECT(proxy)
> << SetValues
> << maxValues
> << stream.InsertArray(values, maxValues)
> << vtkClientServerStream::End;
>
> Utkarsh
>
> On Mon, Sep 21, 2015 at 8:40 AM, Utkarsh Ayachit <
> utkarsh.ayachit at kitware.com> wrote:
>
>> John,
>>
>> That looks too convoluted. I haven't done this in a while so I'll need
>> to refresh my memory a bit. I'll make an example today and then get
>> back to you.
>>
>> Utkarsh
>>
>> On Sun, Sep 20, 2015 at 4:43 AM, Biddiscombe, John A. <biddisco at cscs.ch>
>> wrote:
>> > Just following up so that when I’ve forgotten how to do it ...
>> >
>> > This works
>> >
>> > #define VTK_WRAPPING_CXX
>> > #include "vtkClientServerStream.h"
>> >
>> > ...
>> >
>> >
>> > // void SetSelectedGIds(int n, const int *Ids);
>> > void SetSelectedGIds(int N, int Ids[]);
>> > //BTX
>> > void SetSelectedGIds(int N, vtkClientServerStreamDataArg<int> &temp0);
>> > //ETX
>> >
>> > And in the cxx, use the vtkClientServerStreamDataArg operator () to get
>> > the T* pointer.
>> >
>> > Then in the client GUI
>> >
>> > vtkClientServerStream::Array array =
>> > {
>> > vtkClientServerStream::int32_array,
>> > static_cast<vtkTypeUInt32>(numValues),
>> >
>> >
>> static_cast<vtkTypeUInt32>(sizeof(vtkClientServerStream::int32_value)*numVa
>> > lues),
>> > (int*)(data)
>> > };
>> >
>> >
>> > vtkClientServerStream stream;
>> > stream << vtkClientServerStream::Invoke
>> > << VTKOBJECT(proxy)
>> > << "SetSelectedGIds"
>> > << numValues
>> > << array;
>> > stream << vtkClientServerStream::End;
>> >
>> > This correctly inserts the array and the type,size,data vars so that the
>> > server reads them as expected.
>> >
>> > I’m not happy about the fact that we have to spoof the wrapper
>> generators,
>> > but at least I don’t need to modify the ClientServerStreamArg<>
>> > implementation.
>> >
>> >
>> >
>> > JB
>> >
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/paraview/attachments/20150926/eb54ef5f/attachment.html>
More information about the ParaView
mailing list