3D Widgets in ParaView
From ParaQ Wiki
Jump to navigationJump to search
Overview
This documents talks about the handling on 3D Widgets in the ParaView's ServerManager. 3D Widgets are different from other VTK objects because of one major difference, the user can affect 3D Widget properties by two means: setting then directly using the API, interacting with the widget. (This is also true with some 2D Widget like Plots, Scalar Bars. However, in ServerManager, they are handled differently as displays.)
NOTE: This discussion explains about current ParaView design, not the direction for future.
Design
What are 3D Widgets?
- 3D Widgets include the Point/Line/Implicit Plane/Sphere/Box widgets. These are typically used where we want to make it possible for the user to set/change some properties of VTK entities like clip surfaces, point/line sources interactively --- by directly interacting with the RenderWindow.
- Hence, whenever there is a 3D Widget used, we typically have a VTK object that is controlled by that 3D widget. In ParaView, both the 3D Widget and the controller object are separate proxies. The linking between the two is maintained by the GUI.
3D Widget Proxy Bevaviour
- The proxy created for a 3D widget is a special proxy. It not merely conveys commands to the server objects, but also does some processing on the client side. Why this processing is necessary and what processing is done will be clear soon.
- 3D Widget proxy creates the 3D Widget object on RenderServer and the Client. Whenever a propery is modified on the client side (and the user calls UpdateVTKObjects on the proxy), the changes to the property are conveyed to both the client and the server object by the Proxy (just as any other proxy).
- Now, the user can also interact with the 3D widget. For the vtk 3D widget object to know that the user is interacting with it, it needs to know the interactor. Now, in ParaView, the interactor only exists on the client. Hence, only the client side 3D widget can detect the interaction events and reposition/reorient (etc) itself accordingly. This implies that on every interaction with a 3D Widget, only the client side object is updated and not the serverside objects.
- To update the server side objects on interaction, the 3D Widget proxy has code to listen to interaction events on the vtk 3D Widget object on the client. On every interaction event, the proxy obtains the changed property values from the client object (eg in line widget the two endpoint positions) and pushes it down to the Server Object.
- Note that th
- The 3D widget also has a GUI. The GUI can be used to change the 3D widget properties.