<html><body><div style="color:#000; background-color:#fff; font-family:times new roman, new york, times, serif;font-size:12pt"><div><span>Hi Utkarsh,</span></div><div><span>Seb has indicated that you may be able to help with an issue of trying to create an interactive selection with labels (see below). I'm totally stuck. Any help will be much appreciated.</span></div><div><span>Thanks.</span></div><div><span>Jane </span></div><div><br></div> <div style="font-size: 12pt; font-family: 'times new roman', 'new york', times, serif; "> <div style="font-size: 12pt; font-family: 'times new roman', 'new york', times, serif; "> <div dir="ltr"> <font size="2" face="Arial"> ----- Forwarded Message -----<br> <b><span style="font-weight:bold;">From:</span></b> Sebastien Jourdain <sebastien.jourdain@kitware.com><br> <b><span style="font-weight: bold;">To:</span></b> Jane Hickmott <jane.hickmott@yahoo.com> <br><b><span style="font-weight:
bold;">Cc:</span></b> "paraview@paraview.org" <paraview@paraview.org>; Utkarsh Ayachit <utkarsh.ayachit@kitware.com> <br> <b><span style="font-weight: bold;">Sent:</span></b> Sunday, 8 April 2012, 19:15<br> <b><span style="font-weight: bold;">Subject:</span></b> Re: [Paraview] Paraviewweb<br> </font> </div> <br>Ok, I miss understood your goal.<br><br>Then, the missing part should be something like that.<br><br>var view = paraview.GetRenderView(); // this is optional if you<br>already have a reference to the view...<br>view.setInteractionMode(2);<br><br>Although, I've quickly tried it online with firebug and I did not<br>manage to see the selection. I'm wondering if we are both missing<br>something here... Like the creation of a selection proxy that is<br>created to get the selected screen area and convert it to a set of<br>cellId...<br><br>Utkarsh might have a better insight on that selection part.<br><br>Seb<br><br>PS: Here is the mapping
based on the string values<br><br>file: ParaView-SRC/ParaViewCore/ServerImplementation/Resources/views_and_representations.xml<br><br><IntVectorProperty name="InteractionMode"<br> command="SetInteractionMode"<br> number_of_elements="1"<br> default_values="0"><br> <EnumerationDomain name="enum"><br> <Entry text="3D" value="0" /><br> <Entry text="2D" value="1" /><br> <Entry text="Selection" value="2" /><br> </EnumerationDomain><br> </IntVectorProperty><br><br>On Sun, Apr 8, 2012 at 12:43 PM, Jane Hickmott <<a ymailto="mailto:jane.hickmott@yahoo.com" href="mailto:jane.hickmott@yahoo.com">jane.hickmott@yahoo.com</a>> wrote:<br>> Hi Seb,<br>> Thank you for your help. However, your code appears to
only toggle<br>> 'SelectionPointLabelVisibility' on/off. What I really need is the<br>> equivalent of 'select points on' button as on the GUI that will enable me to<br>> interactively select an area on the plot to display labels on. I can do<br>> this easily interactively, but the python trace appears not to record all of<br>> the clicks. There is something I'm missing...<br>><br>> Frustrated... :(<br>><br>> Jane.<br>><br>> ________________________________<br>> From: Sebastien Jourdain <<a ymailto="mailto:sebastien.jourdain@kitware.com" href="mailto:sebastien.jourdain@kitware.com">sebastien.jourdain@kitware.com</a>><br>> To: Jane Hickmott <<a ymailto="mailto:jane.hickmott@yahoo.com" href="mailto:jane.hickmott@yahoo.com">jane.hickmott@yahoo.com</a>><br>> Cc: <a ymailto="mailto:paraview@paraview.org" href="mailto:paraview@paraview.org">paraview@paraview.org</a><br>> Sent: Sunday, 8
April 2012, 14:44<br>> Subject: Re: [Paraview] Paraviewweb<br>><br>> Hi Jane,<br>><br>> keep the prarview mailing list in the loop so anyone could contribute and<br>> learn.<br>><br>> In your case that will be pretty simple.<br>> If you use jQuery as JavaScript library that could look like that:<br>><br>> var sourceProxy = paraview.FindSource({name:"Fluid_f2.vtk"});<br>> var representation = paraview.GetDisplayProperties({proxy: sourceProxy});<br>> $('.my-button-class').click(function() {<br>> if($(this).toggleClass("showLabel").hasClass("showLabel")) {<br>> representation.setSelectionPointLabelVisibility(1);<br>> } else {<br>> representation.setSelectionPointLabelVisibility(0);<br>> }<br>> });<br>><br>> Or you can create a python script on the server side that can be<br>> called from the JavaScript.<br>> For more details on that you can
read the plugin documentation of<br>> ParaViewWeb here.<br>><br>> <a href="http://www.paraview.org/Wiki/ParaViewWeb_Plugins" target="_blank">http://www.paraview.org/Wiki/ParaViewWeb_Plugins</a><br>><br>> Seb<br>><br>> On Sun, Apr 8, 2012 at 4:10 AM, Jane Hickmott <<a ymailto="mailto:jane.hickmott@yahoo.com" href="mailto:jane.hickmott@yahoo.com">jane.hickmott@yahoo.com</a>><br>> wrote:<br>>> Thank you, Seb. Much appreciated. Sorry I'm a novice in Javascript.<br>>> Here<br>>> is a python trace of what I would like to accomplish - can anyone please<br>>> show me how to convert this to javascript? Many thanks.<br>>> As an aside is there no way to call an external python module from within<br>>> javascript? That would solve everything.<br>>><br>>> Jane.<br>>><br>>> try: paraview.simple<br>>> except: from paraview.simple import
*<br>>> paraview.simple._DisableFirstRenderCameraReset()<br>>><br>>> Fluid_f2 = FindSource("Fluid_f2.vtk")<br>>> DataRepresentation1 = GetDisplayProperties(Fluid_f2)<br>>> RenderView1 = GetRenderView()<br>>> DataRepresentation1.SelectionPointLabelVisibility = 1<br>>><br>>> RenderView1.InteractionMode = 'Selection'<br>>><br>>> RenderView1.CameraClippingRange = [19767.705902611211, 38094.489486240847]<br>>> RenderView1.InteractionMode = '3D'<br>>><br>>> Render()<br>>><br>>> ________________________________<br>>> From: Sebastien Jourdain <<a ymailto="mailto:sebastien.jourdain@kitware.com" href="mailto:sebastien.jourdain@kitware.com">sebastien.jourdain@kitware.com</a>><br>>> To: Jane Hickmott <<a ymailto="mailto:jane.hickmott@yahoo.com" href="mailto:jane.hickmott@yahoo.com">jane.hickmott@yahoo.com</a>><br>>> Cc: "<a
ymailto="mailto:paraview@paraview.org" href="mailto:paraview@paraview.org">paraview@paraview.org</a>" <<a ymailto="mailto:paraview@paraview.org" href="mailto:paraview@paraview.org">paraview@paraview.org</a>><br>>> Sent: Saturday, 7 April 2012, 19:29<br>>> Subject: Re: [Paraview] Paraviewweb<br>>><br>>> Hi Jane,<br>>><br>>> The best thing to do to figure out what is needed in your use case, is<br>>> to load your state inside ParaView and do the action that you want to<br>>> achieve while the Python trace is recording your changes.<br>>><br>>> Once you get the trace of your actions you can either convert that<br>>> code to JavaScript or write a plugin that execute somehow the same<br>>> action in Python as we are using python to write ParaViewWeb plugins.<br>>><br>>> The access of the trace mechanism is inside the Tools menu of ParaView.<br>>><br>>> If
you need some help to figure out the conversion between Python and<br>>> JS, just post the trace on the mailing list.<br>>><br>>> I'm glad you managed to produce your own first Web application using<br>>> ParaViewWeb.<br>>><br>>> Seb<br>>><br>>> On Sat, Apr 7, 2012 at 6:44 AM, Jane Hickmott <<a ymailto="mailto:jane.hickmott@yahoo.com" href="mailto:jane.hickmott@yahoo.com">jane.hickmott@yahoo.com</a>><br>>> wrote:<br>>>> Hi Paraview community!<br>>>> I am trying to develop a paraviewweb application that involves loading of<br>>>> a<br>>>> state file plus the creation of a 'button' to allow data labels to appear<br>>>> on<br>>>> the plot. I can load the state file but have no idea how to create the<br>>>> necessary button and functionality. I would be grateful to anyone kind<br>>>> enough to give me a
few pointers. Thank you.<br>>>><br>>>> Jane<br>>>><br>>>> _______________________________________________<br>>>> Powered by www.kitware.com<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>>><br>>><br>><br>><br><br><br> </div> </div> </div></body></html>