Wonderful,<div><br></div><div>You definitely getting there. BTW, what do you mean by a &quot;<span class="Apple-style-span" style="font-size: medium; ">weird clipping between refresh</span>&quot; ?</div><div><br></div><div>
Thanks,</div><div><br></div><div>Seb</div><div><br><div class="gmail_quote">On Mon, May 9, 2011 at 7:39 PM, Rajvikram Singh <span dir="ltr">&lt;<a href="mailto:rajvikrams@yahoo.com">rajvikrams@yahoo.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><table cellspacing="0" cellpadding="0" border="0"><tbody><tr><td valign="top" style="font:inherit">Great. Just tried creating two views with CreateRenderView() within the same session and was able to attach a different pipeline to both. <br>
<br>For the view locking, I found a function called AddCameraLink(view1, view2, linkname) which allowed me to achieve what I wanted. The views are sync&#39;d and apart from a weird clipping between refresh, it works flawlessly. So I don&#39;t think I&#39;ll need to write a server side plugin .. this time :)<br>
<br>Thanks again Sebastien.<br><br><br><br><br>--- On <b>Tue, 10/5/11, Sebastien Jourdain <i>&lt;<a href="mailto:sebastien.jourdain@kitware.com" target="_blank">sebastien.jourdain@kitware.com</a>&gt;</i></b> wrote:<br><blockquote style="border-left:2px solid rgb(16, 16, 255);margin-left:5px;padding-left:5px">
<br>From: Sebastien Jourdain &lt;<a href="mailto:sebastien.jourdain@kitware.com" target="_blank">sebastien.jourdain@kitware.com</a>&gt;<br>Subject: Re: [Paraview] ParaviewWeb two sessions, two views, two volume datasets<br>
To: &quot;Rajvikram Singh&quot;
 &lt;<a href="mailto:rajvikrams@yahoo.com" target="_blank">rajvikrams@yahoo.com</a>&gt;<br>Cc: <a href="mailto:paraview@paraview.org" target="_blank">paraview@paraview.org</a><br>Date: Tuesday, 10 May, 2011, 4:10 AM<div>
<div></div><div class="h5"><br><br><div>Hi Raj,<div><br></div><div>first of all you only need one session. A session is basically a dedicated connection to a ParaView server. So by creating 2 session, you were creating 2 server where you could have created 2 views in the same session and setup a mechanism to keep both camera of the views in synch.</div>

<div>Moreover, as you are using the same session, you can reuse your objects such as the LUT.</div><div>To keep object in synch, you will have to write some piece of code on the server side that you could call from your javascript client. </div>

<div>I don&#39;t have a simple example in mind but you could look at the pwsimple.py where I had some binding between the widget and the implicit functions that it represent. Of course the event type won&#39;t be the same but the idea is there. </div>

<div><br></div><div>In fact inside a Python plugin you should define a method like that:</div><div><br></div><div>def bindViews(view1, view2):</div><div>   # add some python code to bind the two camera together</div><div>

   # or maybe set the active camera of view1 to be the active</div><div>   # camera of view 2.</div><div><br></div><div>I know that it does not give you the full answer but at least it give you some hints.</div><div><br>
</div>
<div>Seb</div><div><br><div>On Mon, May 9, 2011 at 5:29 PM, Rajvikram Singh <span dir="ltr">&lt;<a rel="nofollow" href="http://mc/compose?to=rajvikrams@yahoo.com" target="_blank">rajvikrams@yahoo.com</a>&gt;</span> wrote:<br>
<blockquote style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<table border="0" cellpadding="0" cellspacing="0"><tbody><tr><td style="font:inherit" valign="top">Hi everyone<br>    I would like to load two volume datasets (called FISH and SIMS in the code below) in ParaviewWeb and then render them side by side in two different views. The users should be able to &#39;lock&#39; the camera amongst the two views so that moving the object in one window also affects the camera in the other. <br>

<br>I tried the following piece of code but ran into a error which made me think maybe I don&#39;t understand the concept of sessions and Display properties well. Hoping somebody could help shed some light. There are two functions that I&#39;ve copy pasted below. Most of the variables are global for now and shared between the functions.<br>

<br><br><div style="margin-left:40px;font-style:italic">// The init function loads and displays the two datasets <br>this.init = function() {<br>       
     // Set the web service base URL<br>            var i;<br>            var serverUrl = &quot;&lt;%=request.getScheme()%&gt;://&lt;%=request.getServerName()%&gt;:&lt;%=request.getServerPort()%&gt;/PWService&quot;;<br>            //<br>

            // Create paraview sessions .. one each for FISH and SIMS <br>            //<br>            pv_FISH = new Paraview(serverUrl);<br>            pv_FISH.createSession(&quot;CAVIAT-session-1&quot;, &quot;FISH data&quot;, &quot;default&quot;);<br>

            view_FISH = pv_FISH.CreateIfNeededRenderView();<br>           
 pv_FISH.Render();<br><br>            pv_SIMS = new Paraview(serverUrl);<br>            pv_SIMS.createSession(&quot;CAVIAT-session-2&quot;, &quot;SIMS data&quot;, &quot;default&quot;);<br>            view_SIMS = pv_SIMS.CreateIfNeededRenderView();<br>

            pv_SIMS.Render();<br>    <br>            // Load the data files from disk<br>            data_FISH = pv_FISH.OpenDataFile({filename : file_FISH});<br>            data_SIMS = pv_FISH.OpenDataFile({filename : file_SIMS});<br>

            <br>            // For volume rendering set the display properties for each
 dataset loaded<br>            <br>            this.setupVolumeView(data_FISH, view_FISH, pv_FISH);<br>            this.setupVolumeView(data_SIMS, view_SIMS, pv_SIMS);<br>           <br>            pv_FISH.Show({proxy : data_FISH});<br>

            pv_FISH.UpdatePipeline();<br><br>            pv_SIMS.Show({proxy : data_SIMS});<br>            pv_SIMS.UpdatePipeline();<br><br><br>            // set origin in the middle of dataset<br>            pv_FISH.ResetCamera();<br>

       
     view_FISH.setCenterOfRotation(view_FISH.getCameraFocalPoint());<br><br>            pv_SIMS.ResetCamera();<br>            view_SIMS.setCenterOfRotation(view_SIMS.getCameraFocalPoint());<br><br>            // Create and bind renderers for both sessions<br>

            var renderer_FISH = new JavaScriptRenderer(&quot;rendererName&quot;, serverUrl);<br>            renderer_FISH.init(pv_FISH.sessionId, view_FISH.__selfid__);<br>            renderer_FISH.setSize(&#39;720&#39;,&#39;720&#39;);<br>

            renderer_FISH.bindToElementId(&quot;FISH-container&quot;);<br>           
 renderer_FISH.start();<br><br>            var renderer_SIMS = new JavaScriptRenderer(&quot;rendererName&quot;, serverUrl);<br>            renderer_SIMS.init(pv_SIMS.sessionId, view_SIMS.__selfid__);<br>            renderer_SIMS.setSize(&#39;720&#39;,&#39;720&#39;);<br>

            renderer_SIMS.bindToElementId(&quot;SIMS-container&quot;);<br>            renderer_SIMS.start();<br><br>        }<br><br><br>      // setupVolumeView will prepare the LUT and Scalar Opacity function needed for volume rendering<br>

      this.setupVolumeView = function (_data, _view, _pv) {<br><br>            // *** Check to see is scope of lut and sof is valid for a per
 volume operation ***<br>            var lut = _pv.GetLookupTableForArray({arrayname : &quot;ImageFile&quot;, num_components : 1, HSVWrap : 0, NanColor : [0.0, 0.66666666666666663, 0.0], RGBPoints : [1.0, 0.0, 0.0, 0.0, 16564.27904630101, 1.0, 0.035950255588616767, 0.0, 19924.923666800998, 1.0, 0.035950255588616767, 0.0, 39728.909301543368, 0.0, 0.66666666666666663, 0.0, 65294.000000000007, 0.0, 0.0, 0.0], ColorSpace : &#39;HSV&#39;});<br>

<br>            var sof = _pv.CreatePiecewiseFunction( {Points:[0.0, 0.0, 2762.37, 0.0588235, 2882.47, 0, 6965.97, 0.235294, 15373.2, 0.323529, 25221.6, 0, 26662.9, 0, 36751.5, 0, 44318, 0.0, 52124.7, 0.323529, 63054, 0.294118, 65336, 0.294118] });<br>

<br><br>            _pv.SetDisplayProperties( {<br>            proxy : _data,<br>   
         view  : _view,<br>            SelectMapper : &#39;GPU&#39;,<br>            Representation : &#39;Volume&#39;,<br>            LookupTable : lut,<br>            ColorArrayName : &#39;ImageFile&#39;,<br>            ScalarOpacityFunction : sof<br>

            } );<br><br>   } // end of setDisplayToVolume()<br><br><br><br></div>The error occurs when the code calls the following line inside the init() function.<br>
<br>
this.setupVolumeView(data_SIMS, view_SIMS, pv_SIMS);<br><br>Inside the setupVolumeView() function, while calling SetDisplayProperties(), the code complains &quot;Uncaught exception: Volume is not a valid volume.&quot; This does not happen for the first data but for the second one only. <br>

<br><br>Thanks<br>Raj<br><br><br><br><div style="font-style:italic"><br></div></td></tr></tbody></table><br>_______________________________________________<br>
Powered by <a rel="nofollow" href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a rel="nofollow" href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the ParaView Wiki at: <a rel="nofollow" href="http://paraview.org/Wiki/ParaView" target="_blank">http://paraview.org/Wiki/ParaView</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a rel="nofollow" href="http://www.paraview.org/mailman/listinfo/paraview" target="_blank">http://www.paraview.org/mailman/listinfo/paraview</a><br>
<br></blockquote></div><br></div>
</div></div></div></blockquote></td></tr></tbody></table></blockquote></div><br></div>