[Paraview-developers] JavaScript API: change representation

Sebastien Jourdain sebastien.jourdain at kitware.com
Fri Jan 31 19:15:58 EST 2014


Hi Dave,

Are you using one of the existing client side or are you trying to build
your own UI?
Normally you should get the proxy id from the reply of the data that you
loaded.

But you might be able to get more information on that API by looking at the
PipelineManager widget JavaScript code and see how it handle representation
change.

Or check the server side src/Web/Python/protocol.py to see what is done
with the message.

Seb


On Fri, Jan 31, 2014 at 4:40 PM, Dave Allen <
david.allen at meliortechnology.com> wrote:

> I’m using the Javascript API for 4.0.1 to try to render files remotely.  A
> file renders correctly, but with the “Surface” representation.  I’d like to
> change the representation to “Wireframe” (even default to this).
> As far as I can tell from the docs, I need to call
> vtk:updateDisplayProperty() (RPC on protocols.ParaViewWebPipelineManager).
>  Does this seem correct?
>
> Below is the code that is not working.  I’m totally guessing on the
> displayOptions object since the API docs don’t really specify much.  I
> probably need to pass in the proxy_id as well, but I’m unclear how to get
> that.
>
> Also, the only JavaScript API docs I can find are at the URL
> http://www.paraview.org/ParaView3/Doc/Nightly/www/js-doc/.  Is there a
> ParaView4 version I should be looking at?
>
> Much Thanks,
> Dave
>
>
> session.call("vtk:openFileFromPath",'./material.pvd').then(
>     function(reply){
>         console.log('****** Works fine, this line is printed ******');
>         viewport.resetCamera();
>         viewport.render();
>     });
>
> var displayOptions = {
>     Representation: 'Wireframe'
> }
>
> session.call("vtk:updateDisplayProperty", displayOptions).then(
>     function(reply) {
>         console.log('****** This line never gets printed ******');
>         viewport.render();
>     });
>
>
> This e-mail contains privileged and confidential information intended for
> the use of the addressees named above. If you are not the intended
> recipient for this e-mail, you are hereby notified that you must not
> disseminate, copy or take action in respect of any information contained in
> it. If you have received this e-mail in error, please notify the sender
> immediately by e-mail and destroy this e-mail and its attachments.
>
> _______________________________________________
> Paraview-developers mailing list
> Paraview-developers at paraview.org
> http://public.kitware.com/mailman/listinfo/paraview-developers
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/paraview-developers/attachments/20140131/613543e3/attachment.html>


More information about the Paraview-developers mailing list