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 
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  ~pqPropertyLinksConnection() override;
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 
94  void setTraceChanges(bool trace) { this->TraceChanges = trace; }
95  bool traceChanges() const { return this->TraceChanges; }
96 
97 public Q_SLOTS:
102  void copyValuesFromServerManagerToQt(bool use_unchecked);
103 
108  void copyValuesFromQtToServerManager(bool use_unchecked);
109 
110 protected:
115  virtual void setQtValue(const QVariant& value);
116  virtual void setServerManagerValue(bool use_unchecked, const QVariant& value);
117  virtual QVariant currentQtValue() const;
118  virtual QVariant currentServerManagerValue(bool use_unchecked) const;
119 
120 Q_SIGNALS:
125  void qtpropertyModified();
126 
131  void smpropertyModified();
132 
133 private:
134  Q_DISABLE_COPY(pqPropertyLinksConnection)
135  vtkNew<vtkEventQtSlotConnect> VTKConnector;
136 
137  QPointer<QObject> ObjectQt;
138  QString PropertyQt;
139  QString SignalQt;
140 
143  int IndexSM;
144  bool TraceChanges;
145 };
146 
147 #endif
QObject * objectQt() const
Provides access to the Qt QObject and property name.
superclass for all SM properties
#define PQCORE_EXPORT
Definition: pqCoreModule.h:15
void setTraceChanges(bool trace)
Provide access to whether changes sent from Qt to the server manager are traceable.
proxy for a VTK object(s) on a server
Definition: vtkSMProxy.h:152
value
pqPropertyLinksConnection is used by pqPropertyLinks to keep a QObject and vtkSMProperty linked toget...
const QString & propertyQt() const
VTKCOMMONCORE_EXPORT bool operator==(const vtkUnicodeString &lhs, const vtkUnicodeString &rhs)
vtkSMProperty * propertySM() const
vtkSMProxy * proxy() const
Provides access to the ServerManager proxy/property/index.