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  {
56  SELECT_SURFACE_CELLS_TOOLTIP
57  };
58 
63  pqRenderViewSelectionReaction(QAction* parentAction, pqRenderView* view, SelectionMode mode,
64  QActionGroup* modifierGroup = nullptr);
65 
70 
71 Q_SIGNALS:
72 
74 
77  void selectedCustomBox(int xmin, int ymin, int xmax, int ymax);
78  void selectedCustomBox(const int region[4]);
79  void selectedCustomPolygon(vtkIntArray* polygon);
81 
82 protected Q_SLOTS:
89  virtual void actionTriggered(bool val);
90 
95  void updateEnableState() override;
96 
102  virtual void setView(pqView* view);
103 
107  void setRepresentation(pqDataRepresentation* representation);
108 
112  virtual void beginSelection();
113 
118  virtual void endSelection();
119 
123  virtual void preSelection();
124 
128  virtual void fastPreSelection();
129 
134  virtual void onMouseStop();
135 
139  virtual void clearSelectionCache();
140 
141 protected: // NOLINT(readability-redundant-access-specifiers)
145  virtual void selectionChanged(vtkObject*, unsigned long, void* calldata);
146 
151  virtual void onMouseMove();
152 
154 
157  virtual void onLeftButtonRelease();
158  virtual void onWheelRotate();
159  virtual void onRightButtonPressed();
160  virtual void onRightButtonRelease();
162 
166  int getSelectionModifier() override;
167 
171  virtual bool isCompatible(SelectionMode mode);
172 
176  virtual void UpdateTooltip();
177 
181  virtual void cleanupObservers();
182 
183 private:
184  Q_DISABLE_COPY(pqRenderViewSelectionReaction)
185  QPointer<pqRenderView> View;
186  QPointer<pqDataRepresentation> Representation;
187  QMetaObject::Connection RepresentationConnection;
188  SelectionMode Mode;
189  int PreviousRenderViewMode;
190  vtkWeakPointer<vtkObject> ObservedObject;
191  unsigned long ObserverIds[6];
192  QCursor ZoomCursor;
193  QTimer MouseMovingTimer;
194  bool MouseMoving;
195  int MousePosition[2];
196  bool DisablePreSelection = false;
197  vtkSMRepresentationProxy* CurrentRepresentation = nullptr;
198  QShortcut* CopyToolTipShortcut = nullptr;
199  QString PlainTooltipText;
200 
201  static QPointer<pqRenderViewSelectionReaction> ActiveReaction;
202 };
203 
204 #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.