pqDefaultContextMenu.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Kitware Inc.
2 // SPDX-FileCopyrightText: Copyright (c) Sandia Corporation
3 // SPDX-License-Identifier: BSD-3-Clause
4 #ifndef pqDefaultContextMenu_h
5 #define pqDefaultContextMenu_h
6 
9 #include "vtkType.h"
10 #include <QList> // needed for QList.
11 #include <QObject>
12 #include <QPoint> // needed for QPoint.
13 #include <QPointer>
14 
17 class pqView;
18 class QAction;
19 class QMenu;
20 
31  : public QObject
32  , public pqContextMenuInterface
33 {
34  Q_OBJECT
35  Q_INTERFACES(pqContextMenuInterface)
37 
38 public:
39  pqDefaultContextMenu(QObject* parent = nullptr);
40  ~pqDefaultContextMenu() override;
41 
43 
49  bool contextMenu(QMenu* menu, pqView* viewContext, const QPoint& viewPoint,
50  pqRepresentation* dataContext, const QList<unsigned int>& dataBlockContext) const override;
52 
57  int priority() const override { return 0; }
58 
59 protected Q_SLOTS:
60 
64  void hide();
65 
69  void reprTypeChanged(QAction* action);
70 
74  void colorMenuTriggered(QAction* action);
75 
79  void showAllBlocks() const;
80 
81 protected: // NOLINT(readability-redundant-access-specifiers)
85  virtual void buildColorFieldsMenu(pqPipelineRepresentation* pipelineRepr, QMenu* menu) const;
86 
87  mutable QPoint Position;
88  mutable QPointer<pqDataRepresentation> PickedRepresentation;
89 
90 private:
91  Q_DISABLE_COPY(pqDefaultContextMenu)
92 };
93 
94 #endif
pqDataRepresentation is the superclass for a display for a pqPipelineSource i.e.
This interface creates ParaView&#39;s default context menu in render views.
This is PQ representation for a single representation.
This is PQ representation for a single display.
int priority() const override
The priority is used to order calls to pqContextMenuInterface::contextMenu among all registered insta...
#define PQAPPLICATIONCOMPONENTS_EXPORT
This is a PQ abstraction of a generic view module.
Definition: pqView.h:26
Interface class for plugins that add a context menu to pqViews.
QPointer< pqDataRepresentation > PickedRepresentation
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...