From SCIRun Documentation Wiki
Jump to navigation Jump to search

3D Widgets and Constraints in SCIRun

This section introduces the concepts of 3D widgets and the Constraints used to make them functional.


SCIRun has a set of 3D interaction widgets. These widgets have a graphical representation within the scene graph of the Viewer module, and can be directly manipulated within a visualization. Furthermore, the module that creates a widget maintains access to and control of the widget, and is alerted through a callback when a widget is manipulated within a scence. Through this callback mechanism, the module can respond appropriately as the widget interaction is taking place - thereby allowing compuational feedback to be directly coupled with the visual feedback.

Widgets are useful in any context where direct manipulation has clear advantages over indirect manipulation. For example, when specifying a cutting plane for a scene, it is possible to specify that plane by entering the A, B, C, and D of a plane equation (Ax + By + Cz + D = 0) with sliders or text-entry boxes; however, it is often much more natural to place a graphical representation of that plane (for example, a rectangular frame widget) into the scene and provide the user handles to translate and rotate the clipping plane directly. By manipulating the object directly, a greater sense of immersion is obtained, and the user has a more natural mechanism for setting parameters.

One important aspect of 3D widgets in SCIRun is the notion of Constraints. Constraints are used to ensure that the user will not introduce degenerate situations when providing input to SCIRun. For example, with the DistanceConstraint, two points are constrained to be a fixed distance apart. If one point moves to a new location, the other point must be moved in order to maintain that constraint. Some of the simpler constraints are solved using direct methods, while more complex constraints are solved using interative methods.

While the primary use for constraints within SCIRun is to provide robust 3D widgets, it doesn't preclude their use in other situations where constraints may be needed, such as in modeling particle interactions in a finite element simulation.

Programming 3D Widgets

Widgets should be constructed within the module that will be using them, and should be sent to a Viewer module through a Geom outport. The developer should implement the virtual get_pick() method for their module if they want catch the callbacks when the widget is manipulated.

Go back to Documentation:SCIRun:DevManual