ParaView
pqQVTKWidget.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: ParaView
4  Module: $RCSfile$
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 pqQVTKWidget_h
33 #define pqQVTKWidget_h
34 
35 #include "QVTKWidget.h"
36 #include "pqCoreModule.h"
37 #include "vtkSmartPointer.h"
38 #include "vtkWeakPointer.h"
39 
40 #include <QPointer>
41 
42 class vtkSMProxy;
43 class vtkSMSession;
44 
54 class PQCORE_EXPORT pqQVTKWidget : public QVTKWidget
55 {
56  Q_OBJECT
57  typedef QVTKWidget Superclass;
58 
59 public:
60  pqQVTKWidget(QWidget* parent = NULL, Qt::WindowFlags f = 0);
61  virtual ~pqQVTKWidget();
62 
66  void setViewProxy(vtkSMProxy*);
67 
72  void setSession(vtkSMSession*);
73 
77  vtkTypeUInt32 getProxyId();
78 
83  void setSizePropertyName(const QString& pname) { this->SizePropertyName = pname; }
84  const QString& sizePropertyName() const { return this->SizePropertyName; }
85 
86 public slots:
87  void paintMousePointer(int x, int y);
88 
89 protected:
93  virtual void resizeEvent(QResizeEvent* event);
94 
98  virtual void moveEvent(QMoveEvent* event);
99 
100  // method called in paintEvent() to render the image cache on to the device.
101  // return false, if cache couldn;t be used for painting. In that case, the
102  // paintEvent() method will continue with the default painting code.
103  virtual bool paintCachedImage();
104 
105 private slots:
106  void updateSizeProperties();
107 
108 private:
109  Q_DISABLE_COPY(pqQVTKWidget)
110  vtkSmartPointer<vtkSMProxy> ViewProxy;
111  vtkWeakPointer<vtkSMSession> Session;
112  QImage MousePointerToDraw;
113  QString SizePropertyName;
114 };
115 
116 #endif
void setSizePropertyName(const QString &pname)
Set/Get the name of the property to use to update the size of the widget on the proxy.
Definition: pqQVTKWidget.h:83
vtkSMSession is the default ParaView session.
Definition: vtkSMSession.h:35
pqQVTKWidget extends QVTKWidget to add awareness for view proxies.
Definition: pqQVTKWidget.h:54
proxy for a VTK object(s) on a server
Definition: vtkSMProxy.h:152
const QString & sizePropertyName() const
Definition: pqQVTKWidget.h:84