[Paraview-developers] Slicing / Selection Widget in Paraview/Web

Sebastien Jourdain sebastien.jourdain at kitware.com
Fri Nov 22 10:15:47 EST 2013


The widget proxy is not properly python wrapped.

To solve the issue you need to do:

dataInfo = dataSet.GetDataInformation(0)
sliceWidgetW = simple.servermanager. _getPyProxy(sliceWidget)
sliceWidgetW.PlaceWidget = dataInfo.GetBounds()

Seb


On Fri, Nov 22, 2013 at 7:03 AM, kyr <akyrieleis at gmail.com> wrote:

> From the file ParaViewAdapter_pwsimple you pointed me, Sebastien, to I am
> using :
>
> def CreateWidgetRepresentation(view,name):
>   proxy = servermanager.CreateProxy("representations", name, None)
>   pythonWrap = servermanager.rendering.__dict__[proxy.GetXMLName()]()
>   pythonWrap.UpdateVTKObjects()
>   view.Representations.append(pythonWrap)
>   pythonWrap.Visibility = 1
>   pythonWrap.Enabled = 1
>   return pytho
>
> and
>
> def CreateBindedWidget(proxy, view):
>     widgetProxy = None
>     # Find the corresponding widget representation
>     if proxy.__class__.__name__ == 'Plane':
>         widgetProxy = CreateWidgetRepresentation(view,
> 'ImplicitPlaneWidgetRepresentation')
>         setattr(proxy.__class__, 'UpdateWidget', _plane_update_widget)
>         setattr(proxy.__class__, 'WidgetUpdate', _plane_widget_update)
>         widgetProxy.GetProperty('DrawPlane').SetElement(0, 0)
>         widgetProxy.GetProperty('PlaceFactor').SetElement(0, 1.0)
>         proxy.UpdateWidget(widgetProxy)
>         widgetProxy.AddObserver("StartInteractionEvent", _draw_plane)
>         proxy.Observed = widgetProxy
>         proxy.ObserverTag = widgetProxy.AddObserver("EndInteractionEvent",
> proxy.WidgetUpdate)
>     elif ...
>
>
> In order to enable the widget I have:
>
>  Slice2 = simple.FindSource('Slice2')
>  dataSet = simple.FindSource(dname)
>  view = simple.GetActiveView()
>  sliceWidget = pwsimple.CreateBindedWidget(Slice2, view)
>  dataInfo = dataSet.GetDataInformation(0)
> sliceWidget.PlaceWidget = dataInfo.GetBounds()
>
> The last line stops the code !! I was wondering if the functions in
> ParaViewAdapter_pwsimple are still valid ? I simple want to display the
> long
> arrow and the bounding boxes of the widget.
>
> Thanks for any help.
>
> kyr.
>
>
>
>
>
> --
> View this message in context:
> http://the-unofficial-paraview-developers-forum.34153.x6.nabble.com/Slicing-Selection-Widget-in-Paraview-Web-tp2637p2658.html
> Sent from the The Unofficial ParaView Developers Forum mailing list
> archive at Nabble.com.
> _______________________________________________
> 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/20131122/1a42edb4/attachment.htm>


More information about the Paraview-developers mailing list