To allow plugin to add item in the contextual menu
This issue was created automatically from an original Mantis Issue. Further discussion may take place here.
the pqPipelineContextMenuBehaviour implements a buildMenu() function. This a protected, virtual function as well as the QMenu Menu member variable. Thus it is possible to override the buildMenu function in a child class in order to manipulate the context Menu.
However, buildMenu is called only when right-clicking on a mesh (because of the pqView picker). Attached is a patched that makes buildMenu called at each right click in a view. The existing pqDataRepresentation's checks are performed inside the new buildMenu function.