<div>It only re-initializes if I create another session like this</div><div>paraview.createSession("Shuttle", "", "default");</div><div>but I think I shouldn't be creating a new session </div>
<div>just to see a different object. </div><div><br></div><div>I am completely ok with using different file formats. All </div><div>I am trying to do is to minimize the paraviewweb-js-python </div><div>scripting part as I have very limited experience there. That's </div>
<div>why I was using state files. Is it better to use something else ?</div><div><br></div><div>Thank you, </div><div>Cagatay </div><br><div class="gmail_quote">On Thu, May 3, 2012 at 2:09 PM, Sebastien Jourdain <span dir="ltr"><<a href="mailto:sebastien.jourdain@kitware.com" target="_blank">sebastien.jourdain@kitware.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Normally loading a state file should re-initialize everything, so the<br>
<div class="im"><br>
activeView = paraview.CreateIfNeededRenderView();<br>
paraview.ResetCamera();<br>
activeView.setCenterOfRotation(activeView.getCameraFocalPoint());<br>
<br>
</div>should be redone and all the renderer should be re-init with the new view id.<br>
<br>
Seb<br>
<div class="HOEnZb"><div class="h5"><br>
<br>
On Thu, May 3, 2012 at 5:02 PM, Sebastien Jourdain<br>
<<a href="mailto:sebastien.jourdain@kitware.com">sebastien.jourdain@kitware.com</a>> wrote:<br>
> Hi Cagatay,<br>
><br>
> does your data needs to be a ParaView state file, our would it be<br>
> better if it was some other VTK compatible file ?<br>
><br>
> Seb<br>
><br>
> On Thu, May 3, 2012 at 3:18 PM, Cagatay Bilgin <<a href="mailto:bilgincc@gmail.com">bilgincc@gmail.com</a>> wrote:<br>
>> I am trying to build a web application that<br>
>> can visualize different objects by the use<br>
>> of a drop down bar. I do not want to create<br>
>> new connections or sessions every time the<br>
>> user changes object to be visualized. I've<br>
>> been trying the whole morning and could not<br>
>> figure out how to i) delete the current view,<br>
>> ii) set it to the view view and iii) refresh the<br>
>> page. Here is what I have so far.<br>
>><br>
>><br>
>><br>
>> var renderers = {};<br>
>> var paraview;<br>
>> var activeView;<br>
>> var basePath =<br>
>> '/bioimaging/home/ccbilgin/opt/apache-tomcat-6.0.35/webapps/PWShuttle/data/';<br>
>> var dataFile = 'tmp.pvsm';<br>
>> * paraview = new Paraview(serverUrl);<br>
>> * paraview.createSession("Shuttle", "", "default");<br>
>><br>
>> function start(){<br>
>> //paraview.LoadState({filename: basePath +<br>
>> '/state.pvsm'});<br>
>> paraview.updateConfiguration(true, "JPEG", "-");<br>
>> paraview.LoadState({filename: basePath + dataFile});<br>
>> activeView = paraview.CreateIfNeededRenderView();<br>
>> paraview.ResetCamera();<br>
>><br>
>> activeView.setCenterOfRotation(activeView.getCameraFocalPoint());<br>
>><br>
>> // Create renderers<br>
>> renderers.java = new HttpAppletRenderer("javaRenderer",<br>
>> serverUrl);<br>
>> renderers.java.init(paraview.sessionId,<br>
>> activeView.__selfid__);<br>
>> renderers.java.setSize("1","1");<br>
>><br>
>> renderers.flash = new FlashRenderer("flashRenderer",<br>
>> serverUrl);<br>
>> renderers.flash.init(paraview.sessionId,<br>
>> activeView.__selfid__);<br>
>><br>
>> renderers.js = new JavaScriptRenderer("jsRenderer",<br>
>> serverUrl);<br>
>> renderers.js.init(paraview.sessionId,<br>
>> activeView.__selfid__);<br>
>><br>
>> paraview.updateConfiguration(true, "JPEG", "WebGL");<br>
>> renderers.webgl = new WebGLRenderer("webglRenderer",<br>
>> serverUrl);<br>
>> renderers.webgl.init(paraview.sessionId,<br>
>> activeView.__selfid__);<br>
>><br>
>> // Remove Java when use in IE<br>
>> if (navigator.appName.indexOf ('Microsoft') != -1) {<br>
>> var e = document.getElementById("java")<br>
>> var parent = e.parentNode;<br>
>> if(e){<br>
>> parent.removeChild(e);<br>
>> }<br>
>> }<br>
>><br>
>> // Use webgl as default<br>
>> renderers.current = renderers.webgl;<br>
>> renderers.current.bindToElementId("renderercontainer");<br>
>> renderers.current.start();<br>
>><br>
>> // Update render size<br>
>> updateSize();<br>
>><br>
>> // Action images<br>
>> updateActionButtons(true);<br>
>> }<br>
>><br>
>> ....<br>
>><br>
>> function switchData(){<br>
>> var type = document.getElementById("data-type").value;<br>
>> dataFile = 'cone.pvsm';<br>
>> start();<br>
>> }<br>
>><br>
>> ....<br>
>><br>
>> <select id="data-type" name="data-type"<br>
>> style="z-index: 5;width: 100px; position: absolute; right:<br>
>> 40px; top: 30px;"<br>
>> onchange="switchData()" ><br>
>> <option value="1">1.mhd</option><br>
>> <option value="2">2.mhd</option><br>
>> <option value="3">3.mhd</option><br>
>> </select><br>
>><br>
>><br>
>> _______________________________________________<br>
>> Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
>><br>
>> Visit other Kitware open-source projects at<br>
>> <a 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:<br>
>> <a href="http://paraview.org/Wiki/ParaView" target="_blank">http://paraview.org/Wiki/ParaView</a><br>
>><br>
>> Follow this link to subscribe/unsubscribe:<br>
>> <a href="http://www.paraview.org/mailman/listinfo/paraview" target="_blank">http://www.paraview.org/mailman/listinfo/paraview</a><br>
>><br>
</div></div></blockquote></div><br>