ParaView
pqPropertyLinksConnection.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: ParaView
4  Module: pqPropertyLinksConnection.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 pqPropertyLinksConnection_h
33 #define pqPropertyLinksConnection_h
34 
35 #include <QObject>
36 #include <QPointer>
37 
38 #include "pqCoreModule.h"
39 #include "vtkEventQtSlotConnect.h"
40 #include "vtkNew.h"
41 #include "vtkSMProperty.h"
42 #include "vtkSMProxy.h"
43 #include "vtkWeakPointer.h"
44 
45 class pqPropertyLinks;
46 
54 class PQCORE_EXPORT pqPropertyLinksConnection : public QObject
55 {
56  Q_OBJECT
57  typedef QObject Superclass;
58 
59 public:
64  pqPropertyLinksConnection(QObject* qobject, const char* qproperty, const char* qsignal,
65  vtkSMProxy* smproxy, vtkSMProperty* smproperty, int smindex, bool use_unchecked_modified_event,
66  QObject* parentObject = 0);
67 
68  virtual ~pqPropertyLinksConnection();
69 
70  void setUseUncheckedProperties(bool useUnchecked);
71 
75  bool operator==(const pqPropertyLinksConnection& other) const;
76 
80  QObject* objectQt() const { return this->ObjectQt; }
81  const QString& propertyQt() const { return this->PropertyQt; }
82 
86  vtkSMProxy* proxy() const { return this->ProxySM; }
87  vtkSMProxy* proxySM() const { return this->ProxySM; }
88  vtkSMProperty* propertySM() const { return this->PropertySM; }
89  int indexSM() const { return this->IndexSM; }
90 
91 public slots:
96  void copyValuesFromServerManagerToQt(bool use_unchecked);
97 
102  void copyValuesFromQtToServerManager(bool use_unchecked);
103 
104 protected:
109  virtual void setQtValue(const QVariant& value);
110  virtual void setServerManagerValue(bool use_unchecked, const QVariant& value);
111  virtual QVariant currentQtValue() const;
112  virtual QVariant currentServerManagerValue(bool use_unchecked) const;
113 
114 signals:
119  void qtpropertyModified();
120 
125  void smpropertyModified();
126 
127 private:
128  Q_DISABLE_COPY(pqPropertyLinksConnection)
129  vtkNew<vtkEventQtSlotConnect> VTKConnector;
130 
131  QPointer<QObject> ObjectQt;
132  QString PropertyQt;
133  QString SignalQt;
134 
135  vtkWeakPointer<vtkSMProxy> ProxySM;
136  vtkWeakPointer<vtkSMProperty> PropertySM;
137  int IndexSM;
138 };
139 
140 #endif
QObject * objectQt() const
Provides access to the Qt QObject and property name.
superclass for all SM properties
proxy for a VTK object(s) on a server
Definition: vtkSMProxy.h:152
pqPropertyLinksConnection is used by pqPropertyLinks to keep a QObject and vtkSMProperty linked toget...
const QString & propertyQt() const
vtkSMProperty * propertySM() const
vtkSMProxy * proxy() const
Provides access to the ServerManager proxy/property/index.