ParaView
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 QAction;
44 class QActionGroup;
45 class QShortcut;
46 class QWidget;
47 
88 class PQAPPLICATIONCOMPONENTS_EXPORT pqStandardViewFrameActionsImplementation
89  : public QObject,
91 {
92  Q_OBJECT
93  Q_INTERFACES(pqViewFrameActionsInterface);
94 
95 public:
96  pqStandardViewFrameActionsImplementation(QObject* parent = 0);
98 
104  virtual void frameConnected(pqViewFrame* frame, pqView* view);
105 
106 protected slots:
111  void aboutToShowConvertMenu();
112 
117  void invoked();
118 
122  void selectSurfaceCellsTriggered();
123  void selectSurfacePointsTriggered();
124  void selectFrustumCellsTriggered();
125  void selectFrustumPointsTriggered();
126  void selectBlocksTriggered();
127  void escTriggered();
128 
134  void manageGroupExclusivity(QAction*);
135 
139  void escapeableActionToggled(bool checked);
140 
144  void interactiveSelectionToggled(bool checked);
145 
146 protected:
150  virtual void setupEmptyFrame(QWidget* frame);
151 
155  virtual void addGenericActions(pqViewFrame* frame, pqView* view);
156 
160  virtual QActionGroup* addSelectionModifierActions(pqViewFrame* frame, pqView* view);
161 
165  virtual void addSeparator(pqViewFrame* frame, pqView* view);
166 
170  virtual void addContextViewActions(pqViewFrame* frame, pqContextView* chart_view);
171 
175  virtual void addRenderViewActions(pqViewFrame* frame, pqRenderView* view);
176 
180  virtual void addSpreadSheetViewActions(pqViewFrame* frame, pqSpreadSheetView* view);
181 
186  virtual bool isButtonVisible(const std::string& buttonName, pqView* view);
187 
188  struct ViewType
189  {
190  QString Label;
191  QString Name;
192  ViewType() {}
193  ViewType(const QString& label, const QString& name)
194  : Label(label)
195  , Name(name)
196  {
197  }
198  };
199 
204  virtual QList<ViewType> availableViewTypes();
205 
210  virtual void handleCreateView(const ViewType& viewType);
211 
212 private:
214  QPointer<QShortcut> ShortCutSurfaceCells;
215  QPointer<QShortcut> ShortCutSurfacePoints;
216  QPointer<QShortcut> ShortCutFrustumCells;
217  QPointer<QShortcut> ShortCutFrustumPoints;
218  QPointer<QShortcut> ShortCutBlocks;
219  QPointer<QShortcut> ShortCutEsc;
220  static bool ViewTypeComparator(const ViewType& one, const ViewType& two);
221 };
222 
223 #endif
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
This is a PQ abstraction of a generic view module.
Definition: pqView.h:56
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.