Developer Documentation
|
OpenFlipper uses several different ActionModes. These include, Light interaction (Changing lights), Move interaction (navigating through the scene) and the picking interaction. The picking interaction is separated into different pick modes. These modes are usually defined by plugins and are used to restrict the mouse interaction to one plugin. E.g. if the current picking mode is "vertex selection", all other plugins that react on mouse events, but are not responsible for the "vertex selection" will ignore these events.
Pick modes can be created in your plugin initialization. You can add them as visible pick modes (visible in the context menus of objects) or as hidden pick modes PickingInterface::addHiddenPickMode() ( This should be preferred! ). You can also set a special cursor that will be used when your pick mode is active via PickingInterface::setPickModeCursor(). If you need to enable mouse tracking in your mode, you can use PickingInterface::setPickModeMouseTracking(). This will result in mouse events even if no button is pressed.
A change of the current pick mode can be detected by the PickingInterface::slotPickModeChanged() function.
Additionally it is possible to show a special toolbar in OpenFlippers viewer when your pick mode is active. This is especially Useful, when you can change the interaction type by buttons in the bar, e.g. select vertices or faces. Every time your pick mode is activated, your toolbar will be visible at the top of the viewer. Use the functions PickingInterface::setPickModeToolbar() and PickingInterface::removePickModeToolbar() for controlling these toolbars. The embedding is fully transparent so that you can manage your toolbar and connect signals and slots as usual.
To use the PickingInterface: