pqRenderViewSelectionReaction.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 pqRenderViewSelectionReaction_h
5 #define pqRenderViewSelectionReaction_h
6 
7 #include "pqSelectionReaction.h"
8 #include "vtkWeakPointer.h"
9 #include <QCursor>
10 #include <QPointer>
11 #include <QShortcut>
12 #include <QString>
13 #include <QTimer>
14 
16 class pqRenderView;
17 class pqView;
18 class vtkIntArray;
19 class vtkObject;
21 
31 {
32  Q_OBJECT
33  typedef pqSelectionReaction Superclass;
34 
35 public:
37  {
57  SELECT_SURFACE_CELLS_TOOLTIP
58  };
59 
64  pqRenderViewSelectionReaction(QAction* parentAction, pqRenderView* view, SelectionMode mode,
65  QActionGroup* modifierGroup = nullptr);
66 
71 
72 Q_SIGNALS:
73 
75 
78  void selectedCustomBox(int xmin, int ymin, int xmax, int ymax);
79  void selectedCustomBox(const int region[4]);
80  void selectedCustomPolygon(vtkIntArray* polygon);
82 
83 protected Q_SLOTS:
90  virtual void actionTriggered(bool val);
91 
96  void updateEnableState() override;
97 
103  virtual void setView(pqView* view);
104 
108  void setRepresentation(pqDataRepresentation* representation);
109 
113  virtual void beginSelection();
114 
119  virtual void endSelection();
120 
124  virtual void preSelection();
125 
129  virtual void fastPreSelection();
130 
135  virtual void onMouseStop();
136 
140  virtual void clearSelectionCache();
141 
142 protected: // NOLINT(readability-redundant-access-specifiers)
146  virtual void selectionChanged(vtkObject*, unsigned long, void* calldata);
147 
152  virtual void onMouseMove();
153 
155 
158  virtual void onLeftButtonRelease();
159  virtual void onWheelRotate();
160  virtual void onRightButtonPressed();
161  virtual void onRightButtonRelease();
163 
167  int getSelectionModifier() override;
168 
172  virtual bool isCompatible(SelectionMode mode);
173 
177  virtual void UpdateTooltip();
178 
182  virtual void cleanupObservers();
183 
184 private:
185  Q_DISABLE_COPY(pqRenderViewSelectionReaction)
186  QPointer<pqRenderView> View;
187  QPointer<pqDataRepresentation> Representation;
188  QMetaObject::Connection RepresentationConnection;
189  SelectionMode Mode;
190  int PreviousRenderViewMode;
191  vtkWeakPointer<vtkObject> ObservedObject;
192  unsigned long ObserverIds[6];
193  QCursor ZoomCursor;
194  QTimer MouseMovingTimer;
195  bool MouseMoving;
196  int MousePosition[2];
197  bool DisablePreSelection = false;
198  vtkSMRepresentationProxy* CurrentRepresentation = nullptr;
199  QShortcut* CopyToolTipShortcut = nullptr;
200  QString PlainTooltipText;
201 
202  static QPointer<pqRenderViewSelectionReaction> ActiveReaction;
203 };
204 
205 #endif
Proxy for a representations.
pqDataRepresentation is the superclass for a display for a pqPipelineSource i.e.
virtual int getSelectionModifier()
Get the current state of selection modifier, if any.
virtual void updateEnableState()
Definition: pqReaction.h:48
#define PQAPPLICATIONCOMPONENTS_EXPORT
This is a PQ abstraction of a generic view module.
Definition: pqView.h:26
pqRenderViewSelectionReaction handles various selection modes available on RenderViews.
Generric reaction for creating selections on views.