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 
39 #ifndef _pqPipelineObject_h
40 #define _pqPipelineObject_h
41 
43 #include <QPointer>
44 
45 class pqProxyInternal;
46 class pqServer;
47 class vtkPVXMLElement;
48 class vtkSMProxy;
50 
56 class PQCORE_EXPORT pqProxy : public pqServerManagerModelItem
57 {
58  Q_OBJECT
59 public:
64  {
67  UNMODIFIED
68  };
69 
70  pqProxy(const QString& group, const QString& name, vtkSMProxy* proxy, pqServer* server,
71  QObject* parent = NULL);
72  virtual ~pqProxy();
73 
77  pqServer* getServer() const;
78 
86  void rename(const QString& newname);
87 
94  const QString& getSMName();
95  const QString& getSMGroup();
96 
102  vtkSMProxy* getProxy() const;
103 
110  ModifiedState modifiedState() const { return this->Modified; }
111 
117  void setModifiedState(ModifiedState modified);
118 
123  vtkPVXMLElement* getHints() const;
124 
128  QList<vtkSMProxy*> getHelperProxies() const;
129 
133  QList<vtkSMProxy*> getHelperProxies(const QString& key) const;
134 
138  QList<QString> getHelperKeys() const;
139 
143  static std::string rstToHtml(const char* rstStr);
144 
155  virtual void addHelperProxy(const QString& key, vtkSMProxy*);
156  void removeHelperProxy(const QString& key, vtkSMProxy*);
157 
163  void updateHelperProxies() const;
164 
168  vtkSMSessionProxyManager* proxyManager() const;
169 
175  static pqProxy* findProxyWithHelper(vtkSMProxy* aproxy, QString& key);
176 
177 signals:
181  void nameChanged(pqServerManagerModelItem*);
182 
186  void modifiedStateChanged(pqServerManagerModelItem*);
187 
188 protected:
189  friend class pqServerManagerModel;
190 
200  void setSMName(const QString& new_name);
201 
202  // Use this method to initialize the pqObject state using the
203  // underlying vtkSMProxy. This needs to be done only once,
204  // after the object has been created.
205  virtual void initialize();
206 
207  // Method used to update the internal structure whithout affecting
208  // the ProxyManager proxy registration
209  virtual void addInternalHelperProxy(const QString& key, vtkSMProxy*) const;
210  virtual void removeInternalHelperProxy(const QString& key, vtkSMProxy*) const;
211 
212 protected slots:
213  // Used to monitor helper proxy registration when created on other clients
214  void onProxyRegistered(const QString&, const QString&, vtkSMProxy*);
215  void onProxyUnRegistered(const QString&, const QString&, vtkSMProxy*);
216 
217 private:
218  QPointer<pqServer> Server;
219  QString SMName;
220  QString SMGroup;
221  pqProxyInternal* Internal;
222  ModifiedState Modified;
223 };
224 
225 #endif
ModifiedState
The modification state of this proxy.
Definition: pqProxy.h:63
pqServerManagerModelItem is a element maintained by pqServerManagerModel.
The vtkSMSessionProxyManager is esponsible for creating and managing proxies for a given session...
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:56
pqServerManagerModel is the model for the Server Manager.
proxy for a VTK object(s) on a server
Definition: vtkSMProxy.h:152
This is used by vtkPVXMLParser to represent an XML document starting at the root element.
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:110
pqServer (should be renamed to pqSession) is a pqServerManagerModelItem subclass that represents a vt...
Definition: pqServer.h:64