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 "pqCoreModule.h"
36 #include "pqQVTKWidgetBase.h"
37 #include "vtkEventQtSlotConnect.h"
38 #include "vtkNew.h"
39 #include "vtkSmartPointer.h"
40 #include "vtkWeakPointer.h"
41 #include <QPointer>
42 
43 class vtkSMProxy;
44 class vtkSMSession;
45 
55 class PQCORE_EXPORT pqQVTKWidget : public pqQVTKWidgetBase
56 {
57  Q_OBJECT
58  typedef pqQVTKWidgetBase Superclass;
59 
60 public:
61  pqQVTKWidget(QWidget* parent = NULL, Qt::WindowFlags f = 0);
62  ~pqQVTKWidget() override;
63 
67  void setViewProxy(vtkSMProxy*);
68 
73  void setSession(vtkSMSession*);
74 
78  vtkTypeUInt32 getProxyId();
79 
84  void setSizePropertyName(const QString& pname) { this->SizePropertyName = pname; }
85  const QString& sizePropertyName() const { return this->SizePropertyName; }
86 
87 public slots:
88  void paintMousePointer(int x, int y);
89 
90 private slots:
91  void prepareContextForRendering();
92 
93 protected:
94  bool renderVTK();
95  bool canRender();
96 
97 #if PARAVIEW_USING_QVTKOPENGLWIDGET
98  void resizeEvent(QResizeEvent* evt) override;
99 #endif
100 
101 private:
102  Q_DISABLE_COPY(pqQVTKWidget)
103  vtkSmartPointer<vtkSMProxy> ViewProxy;
105  QString SizePropertyName;
107 };
108 
109 #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:84
vtkSMSession is the default ParaView session.
Definition: vtkSMSession.h:35
pqQVTKWidget extends pqQVTKWidgetBase to add awareness for view proxies.
Definition: pqQVTKWidget.h:55
QVTKOpenGLWidget pqQVTKWidgetBase
proxy for a VTK object(s) on a server
Definition: vtkSMProxy.h:152
const QString & sizePropertyName() const
Definition: pqQVTKWidget.h:85