ParaView
pqComparativeCueWidget.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: ParaView
4  Module: pqComparativeCueWidget.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 pqComparativeCueWidget_h
33 #define pqComparativeCueWidget_h
34 
35 #include "pqComponentsModule.h"
36 #include "pqTimer.h"
37 #include "vtkSmartPointer.h"
38 #include <QTableWidget>
39 
40 class vtkEventQtSlotConnect;
41 class vtkSMComparativeAnimationCueProxy;
42 class vtkSMProxy;
43 
47 class PQCOMPONENTS_EXPORT pqComparativeCueWidget : public QTableWidget
48 {
49  Q_OBJECT
50  typedef QTableWidget Superclass;
51 public:
52  pqComparativeCueWidget(QWidget* parent=0);
53  virtual ~pqComparativeCueWidget();
54 
56  void setCue(vtkSMProxy*);
57  vtkSMComparativeAnimationCueProxy* cue() const;
58 
59  QSize size() const
60  { return this->Size; }
61 
62  // Returns if this cue can accept more than 1 value as a parameter value.
63  bool acceptsMultipleValues() const;
64 
65 public slots:
67  void setSize(int w, int h)
68  {
69  this->Size = QSize(w, h);
70  this->updateGUIOnIdle();
71  }
72 
73 signals:
74  // triggered every time the user changes the values.
75  void valuesChanged();
76 
77 protected slots:
79  void updateGUI();
80 
82  { this->IdleUpdateTimer.start(); }
83 
85  { this->SelectionChanged = true; }
86 
87  void onCellChanged(int x, int y);
88 
89 protected:
92  virtual void mouseReleaseEvent(QMouseEvent* evt);
93 
94  void editRange();
95 private:
96  Q_DISABLE_COPY(pqComparativeCueWidget)
97 
98  vtkEventQtSlotConnect* VTKConnect;
99  bool InUpdateGUI;
100  bool SelectionChanged;
101  pqTimer IdleUpdateTimer;
102  QSize Size;
103  vtkSmartPointer<vtkSMComparativeAnimationCueProxy> Cue;
104 };
105 
106 #endif
107 
108 
pqComparativeCueWidget is designed to be used by pqComparativeVisPanel to show/edit the values for an...
void setSize(int w, int h)
Set the comparative grid size.