Developer Documentation
ContextMenuInterface Class Reference

Interface class for creating custom context menus. More...

#include <OpenFlipper/BasePlugin/ContextMenuInterface.hh>

Inheritance diagram for ContextMenuInterface:
BackupPlugin DataControlPlugin MouseAndKeyPlugin MovePlugin PolyLinePlugin SelectionBasePlugin SkeletonEditingPlugin SplatCloudRenderingControlPlugin TextureControlPlugin TypeBSplineCurvePlugin TypeBSplineSurfacePlugin TypeCameraPlugin TypeHexahedralMeshPlugin TypePolyhedralMeshPlugin TypeSkeletonPlugin TypeTetrahedralMeshPlugin ViewControlPlugin

Signals

virtual void addContextMenuItem (QAction *_action, ContextMenuType _type)
 Add an entry for a context Menu. More...
 

Public Member Functions

virtual ~ContextMenuInterface ()
 Destructor.
 
virtual void addContextMenuItem (QAction *_action, DataType _objectType, ContextMenuType _type)
 Add an entry for a context Menu. More...
 
virtual void hideContextMenu ()
 hide the main context menu
 

Private Slots

virtual void slotUpdateContextMenu (int _objectId)
 

Private Member Functions

virtual void slotUpdateContextMenuNode (int _nodeId)
 
virtual void slotUpdateContextMenuBackground ()
 

Detailed Description

Interface class for creating custom context menus.

Detailed description

Using this interface you can create custom context menus for your plugin. You can choose between context menus for objects, nodes or the background.
Before a menu of the requested type is shown, an update function for the specific type will be invoked by the core. You have to create a QAction. The signals and slots of your actions have to be connected to your plugin. Just connect them as usual. Only visibility of the menu is handled by the core. You can also add submenus to the context menus. Just add the action for the menu ( menu->menuAction() )

Definition at line 85 of file ContextMenuInterface.hh.

Member Function Documentation

◆ addContextMenuItem [1/2]

virtual void ContextMenuInterface::addContextMenuItem ( QAction *  _action,
ContextMenuType  _type 
)
inlinevirtualsignal

Add an entry for a context Menu.

Create an Action (Can also be the action of a Menu) and register this menu as a context menu to the core. This Action will be visible when you right click in the viewer widget on an item of the given context menu type. You can add a whole menu here by adding the action: menu->menuAction() of your own menu.

Parameters
_actionPointer to the new Action
_typeType context menu type

Definition at line 104 of file ContextMenuInterface.hh.

◆ addContextMenuItem() [2/2]

virtual void ContextMenuInterface::addContextMenuItem ( QAction *  _action,
DataType  _objectType,
ContextMenuType  _type 
)
inlinevirtual

Add an entry for a context Menu.

Create an action (Can also be the action of a Menu) and register this action as a context menu entry to the core. This Action will only be visible if the picked object is of the given DataType. To support multiple object types with your menu, you can emit this signal multiple times with the same action but different DataTypes. You can add a whole Menu here by adding the action: menu->menuAction()

Parameters
_actionPointer to the new action
_objectTypeType of the picked object
_typeType of the context Menu ( See ContextMenuType )

Definition at line 118 of file ContextMenuInterface.hh.

◆ slotUpdateContextMenu

virtual void ContextMenuInterface::slotUpdateContextMenu ( int  _objectId)
inlineprivatevirtualslot

When the main application requests a context menu, this slot is called before showing the window. If an object is picked the id will be given in this call so you can change the contents of your menu depending on the given object.

Parameters
_objectIdid of the object

Reimplemented in TypeBSplineCurvePlugin, TypeBSplineSurfacePlugin, TypeCameraPlugin, and TypeSkeletonPlugin.

Definition at line 131 of file ContextMenuInterface.hh.

◆ slotUpdateContextMenuBackground()

virtual void ContextMenuInterface::slotUpdateContextMenuBackground ( )
inlineprivatevirtual

When the main application requests a context menu, this slot is called before showing the window. This slot will be called indicating that the background has been picked.

Definition at line 145 of file ContextMenuInterface.hh.

◆ slotUpdateContextMenuNode()

virtual void ContextMenuInterface::slotUpdateContextMenuNode ( int  _nodeId)
inlineprivatevirtual

When the main application requests a context menu, this slot is called before showing the window. This slot will be called indicating that a scenegraph node not belonging to an object has been picked.

Parameters
_nodeIdid of the picked node

Definition at line 139 of file ContextMenuInterface.hh.


The documentation for this class was generated from the following file: