[Paraview] ParaviewWeb : Adding interactive slice filter to pipeline

Rajvikram Singh rajvikrams at yahoo.com
Fri Apr 29 19:25:13 EDT 2011


Hi
   I am trying to add a simple slice filter to a ParaviewWeb client that users could use interact with a volume. The bundled PWApp application does this already and so I tried to go through the code and looked at some Python examples. I was able to get an interactive widget to render but it shows a blank slice. Also the bounds are not correct since the volume is 'flat' and what I see is a cube. 

Here's the code I'm using :

var reader = pv.OpenDataFile({filename : "test.vtk"});    
    var view1 = pv.CreateIfNeededRenderView();
    pv.Render();
    
    var sliceFilter = pv.Slice({Input : reader});
    sliceFilter.SetSliceNormal = [0,0,1]; // sliec along Z
    sliceFilter.SetSliceOrigin = [0,0,0];
    sliceFilter.SetSliceType = 'Plane';
//    sliceFilter.SetInputBounds = pv.GetDataInformation.Bounds;

    var sr = pv.CreateBindedWidget({proxy : sliceFilter.getSliceType(), view : view1});
    sr.setPlaceWidget(reader.Bounds);
    sr.setEnabled(1);
    sr.setVisibility(1);

    var dataRep1 = pv.Show({proxy : sliceFilter});
    

    pv.SetDisplayProperties( {
    proxy : sliceFilter,
    view  : view1,
    Representation : 'Surface',
    } );

I'm attaching a screenshot of what's rendered in my browser. I'm obviously not setting some property correctly .. I just can't tell which one.

Thanks in advance
Raj

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.paraview.org/pipermail/paraview/attachments/20110429/7814f822/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Screenshot.png
Type: image/png
Size: 35484 bytes
Desc: not available
URL: <http://www.paraview.org/pipermail/paraview/attachments/20110429/7814f822/attachment-0001.png>


More information about the ParaView mailing list