ParaView
pqProxy.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: ParaView
4  Module: pqProxy.h
5 
6  Copyright (c) 2005-2008 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 
36 
37 #ifndef _pqPipelineObject_h
38 #define _pqPipelineObject_h
39 
41 #include <QPointer>
42 
43 class pqProxyInternal;
44 class pqServer;
45 class vtkPVXMLElement;
46 class vtkSMProxy;
47 class vtkSMSessionProxyManager;
48 
52 class PQCORE_EXPORT pqProxy : public pqServerManagerModelItem
53 {
54  Q_OBJECT
55 public:
56 
58  enum ModifiedState { UNINITIALIZED, MODIFIED, UNMODIFIED };
59 
60  pqProxy(const QString& group, const QString& name,
61  vtkSMProxy* proxy, pqServer* server, QObject* parent=NULL);
62  virtual ~pqProxy();
63 
65  pqServer *getServer() const;
66 
72  void rename(const QString& newname);
73 
78  const QString& getSMName();
79  const QString& getSMGroup();
80 
84  vtkSMProxy* getProxy() const;
85 
90  ModifiedState modifiedState() const {return this->Modified;}
91 
95  void setModifiedState(ModifiedState modified);
96 
99  vtkPVXMLElement* getHints() const;
100 
102  QList<vtkSMProxy*> getHelperProxies() const;
103 
105  QList<vtkSMProxy*> getHelperProxies(const QString& key) const;
106 
108  QList<QString> getHelperKeys() const;
109 
111  static std::string rstToHtml(const char* rstStr);
112 
121  virtual void addHelperProxy(const QString& key, vtkSMProxy*);
122  void removeHelperProxy(const QString& key, vtkSMProxy*);
123 
127  void updateHelperProxies() const;
128 
130  vtkSMSessionProxyManager* proxyManager() const;
131 
135  static pqProxy* findProxyWithHelper(vtkSMProxy* aproxy, QString& key);
136 
137 signals:
139  void nameChanged(pqServerManagerModelItem*);
140 
142  void modifiedStateChanged(pqServerManagerModelItem*);
143 
144 protected:
145  friend class pqServerManagerModel;
146 
154  void setSMName(const QString& new_name);
155 
156  // Use this method to initialize the pqObject state using the
157  // underlying vtkSMProxy. This needs to be done only once,
158  // after the object has been created.
159  virtual void initialize();
160 
161  // Method used to update the internal structure whithout affecting
162  // the ProxyManager proxy registration
163  virtual void addInternalHelperProxy(const QString& key, vtkSMProxy*) const;
164  virtual void removeInternalHelperProxy(const QString& key, vtkSMProxy*) const;
165 
166 protected slots:
167  // Used to monitor helper proxy registration when created on other clients
168  void onProxyRegistered(const QString&, const QString&, vtkSMProxy*);
169  void onProxyUnRegistered(const QString&, const QString&, vtkSMProxy*);
170 
171 private:
172  QPointer<pqServer> Server;
173  QString SMName;
174  QString SMGroup;
175  pqProxyInternal* Internal;
176  ModifiedState Modified;
177 };
178 
179 #endif
ModifiedState
The modification state of this proxy.
Definition: pqProxy.h:58
pqServerManagerModelItem is a element maintained by pqServerManagerModel.
virtual void onProxyUnRegistered(const QString &group, const QString &name, vtkSMProxy *proxy)
Called when a proxy is unregistered.
This class represents any registered Server Manager proxy.
Definition: pqProxy.h:52
pqServerManagerModel is the model for the Server Manager.
virtual void onProxyRegistered(const QString &group, const QString &name, vtkSMProxy *proxy)
Called when a proxy is registered.
ModifiedState modifiedState() const
Gets whether or not the source has been modified.
Definition: pqProxy.h:90
pqServer (should be renamed to pqSession) is a pqServerManagerModelItem subclass that represents a vt...
Definition: pqServer.h:62