pqStandardViewFrameActionsImplementation.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: ParaView
4  Module: pqStandardViewFrameActionsImplementation.h
5 
6  Copyright (c) 2005,2006 Sandia Corporation, Kitware Inc.
7  All rights reserved.
8 
9  ParaView is a free software; you can redistribute it and/or modify it
10  under the terms of the ParaView license version 1.2.
11 
12  See License_v1.2.txt for the full ParaView license.
13  A copy of this license can be obtained by contacting
14  Kitware Inc.
15  28 Corporate Drive
16  Clifton Park, NY 12065
17  USA
18 
19 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR
23 CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
24 EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
25 PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
26 PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
27 LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
28 NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
29 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 
31 ========================================================================*/
32 #ifndef pqStandardViewFrameActionsImplementation_h
33 #define pqStandardViewFrameActionsImplementation_h
34 
35 #include "pqApplicationComponentsModule.h" // needed for export macros
37 #include <QObject> // needed for QObject
38 #include <QPointer> // needed for QPointer
39 
40 class pqContextView;
41 class pqRenderView;
42 class pqSpreadSheetView;
43 class pqView;
44 class QAction;
45 class QActionGroup;
46 class QShortcut;
47 class QWidget;
48 
89  : public QObject
91 {
92  Q_OBJECT
93  Q_INTERFACES(pqViewFrameActionsInterface);
94 
95 public:
96  pqStandardViewFrameActionsImplementation(QObject* parent = nullptr);
98 
104  void frameConnected(pqViewFrame* frame, pqView* view) override;
105 
106 protected Q_SLOTS:
111  void aboutToShowConvertMenu();
112 
116  void selectSurfaceCellsTriggered();
117  void selectSurfacePointsTriggered();
118  void selectFrustumCellsTriggered();
119  void selectFrustumPointsTriggered();
120  void selectBlocksTriggered();
121  void escTriggered();
122 
128  void manageGroupExclusivity(QAction*);
129 
133  void escapeableActionToggled(bool checked);
134 
138  void interactiveSelectionToggled(bool checked);
139 
143  void captureViewTriggered();
144 
145 protected: // NOLINT(readability-redundant-access-specifiers)
149  virtual void setupEmptyFrame(QWidget* frame);
150 
154  virtual void addGenericActions(pqViewFrame* frame, pqView* view);
155 
159  virtual QActionGroup* addSelectionModifierActions(pqViewFrame* frame, pqView* view);
160 
164  virtual void addSeparator(pqViewFrame* frame, pqView* view);
165 
169  virtual void addContextViewActions(pqViewFrame* frame, pqContextView* chart_view);
170 
174  virtual void addRenderViewActions(pqViewFrame* frame, pqRenderView* view);
175 
179  virtual void addSpreadSheetViewActions(pqViewFrame* frame, pqSpreadSheetView* view);
180 
185  virtual bool isButtonVisible(const std::string& buttonName, pqView* view);
186 
187  struct ViewType
188  {
189  QString Label;
190  QString Name;
191  ViewType() = default;
192  ViewType(const QString& label, const QString& name)
193  : Label(label)
194  , Name(name)
195  {
196  }
197  };
198 
203  virtual QList<ViewType> availableViewTypes();
204 
209  virtual pqView* handleCreateView(const ViewType& viewType);
210 
215  void invoked(pqViewFrame*, const ViewType& type, const QString& command);
216 
217 private:
219  QPointer<QShortcut> ShortCutSurfaceCells;
220  QPointer<QShortcut> ShortCutSurfacePoints;
221  QPointer<QShortcut> ShortCutFrustumCells;
222  QPointer<QShortcut> ShortCutFrustumPoints;
223  QPointer<QShortcut> ShortCutBlocks;
224  QPointer<QShortcut> ShortCutEsc;
225  QPointer<QShortcut> ShortCutGrow;
226  QPointer<QShortcut> ShortCutShrink;
227  static bool ViewTypeComparator(const ViewType& one, const ViewType& two);
228 };
229 
230 #endif
type
pqViewFrameActionsInterface is an interface used by pqMultiViewWidget to add actions/toolbuttons to p...
pqViewFrame is used to represent a frame for any ParaView view shown in the pqMultiViewWidget.
Definition: pqViewFrame.h:59
pqContextView is an abstract base class for all charting views based on the VTK context charting libr...
Definition: pqContextView.h:47
#define PQAPPLICATIONCOMPONENTS_EXPORT
This is a PQ abstraction of a generic view module.
Definition: pqView.h:54
View for spread-sheet view.
pqStandardViewFrameActionsImplementation implements pqViewFrameActionsInterface to add the default vi...
virtual void frameConnected(pqViewFrame *frame, pqView *view)=0
This method is called after a frame is assigned to a view.