Public Member Functions | List of all members
pqContextMenuInterface Class Reference

Interface class for plugins that add a context menu to pqViews. More...

#include <pqContextMenuInterface.h>

Inheritance diagram for pqContextMenuInterface:
Inheritance graph
[legend]

Public Member Functions

 pqContextMenuInterface ()
 
virtual ~pqContextMenuInterface ()
 
virtual bool contextMenu (QMenu *menu, pqView *viewContext, const QPoint &viewPoint, pqRepresentation *dataContext, const QList< unsigned int > &dataBlockContext) const
 This method is called when a context menu is requested, usually by a right click in a pqView instance. More...
 
virtual bool contextMenu (QMenu *menu, pqView *viewContext, const QPoint &viewPoint, pqRepresentation *dataContext, const QStringList &dataBlockContext) const
 This is a newer variant of the contextMenu where the dataBlockContext is provided as selectors instead of composite ids. More...
 
virtual int priority () const
 This method's return value is used to set the precedence of the interface. More...
 

Detailed Description

Interface class for plugins that add a context menu to pqViews.

pqContextMenuInterface is the interface which plugins adding a context menu to pqViews should implement. One would typically use the add_paraview_context_menu CMake macro to ensure an instance of the class is created and registered with the pqPipelineContextMenuBehavior class (which is responsible for creating the context menu).

Definition at line 25 of file pqContextMenuInterface.h.

Constructor & Destructor Documentation

◆ pqContextMenuInterface()

pqContextMenuInterface::pqContextMenuInterface ( )

◆ ~pqContextMenuInterface()

virtual pqContextMenuInterface::~pqContextMenuInterface ( )
virtual

Member Function Documentation

◆ contextMenu() [1/2]

virtual bool pqContextMenuInterface::contextMenu ( QMenu *  menu,
pqView viewContext,
const QPoint &  viewPoint,
pqRepresentation dataContext,
const QList< unsigned int > &  dataBlockContext 
) const
virtual

This method is called when a context menu is requested, usually by a right click in a pqView instance.

This method should return true if (a) the context is one handled by this instance (and presumably it will modify the provided QMenu); and (b) this instance should be the last interface to contribute to the menu. Returning false indicates the context is not one this instance handles or that interfaces with a lower priority may modify the menu.

Each registered interface is called in order of descending priority until one returns true, so your implementation should return false as quickly as possible.

If dataContext is a pqDataRepresentation and holds multiblock data, the dataBlockContext is a list of block IDs to which the menu actions should apply.

Reimplemented in pqDefaultContextMenu.

◆ contextMenu() [2/2]

virtual bool pqContextMenuInterface::contextMenu ( QMenu *  menu,
pqView viewContext,
const QPoint &  viewPoint,
pqRepresentation dataContext,
const QStringList &  dataBlockContext 
) const
virtual

This is a newer variant of the contextMenu where the dataBlockContext is provided as selectors instead of composite ids.

Selectors are more reliable especially when dealing with partitioned datasets and their collections in distributed mode and hence should be preferred.

Reimplemented in pqBlockContextMenu.

◆ priority()

virtual int pqContextMenuInterface::priority ( ) const
inlinevirtual

This method's return value is used to set the precedence of the interface.

Interfaces with greater priority are invoked before others and may cause menu-building to terminate early. ParaView's default context-menu interface uses a priority of 0 and returns false.

If you wish to modify the default menu, assign a negative priority to your interface. If you wish to override the default menu, assign a positive priority to your interface and have contextMenu() return true.

Reimplemented in pqDefaultContextMenu, and pqBlockContextMenu.

Definition at line 70 of file pqContextMenuInterface.h.


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