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 
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  ~pqProxy() override;
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 
141 
144  static std::string rstToHtml(const char* rstStr);
145  static QString rstToHtml(const QString& rstStr);
147 
158  virtual void addHelperProxy(const QString& key, vtkSMProxy*);
159  void removeHelperProxy(const QString& key, vtkSMProxy*);
160 
166  void updateHelperProxies() const;
167 
171  vtkSMSessionProxyManager* proxyManager() const;
172 
178  static pqProxy* findProxyWithHelper(vtkSMProxy* aproxy, QString& key);
179 
189  bool userModifiedSMName() { return this->UserModifiedSMName; }
190 
191 Q_SIGNALS:
195  void nameChanged(pqServerManagerModelItem*);
196 
200  void modifiedStateChanged(pqServerManagerModelItem*);
201 
202 protected:
203  friend class pqServerManagerModel;
204 
214  void setSMName(const QString& new_name);
215 
216  // Use this method to initialize the pqObject state using the
217  // underlying vtkSMProxy. This needs to be done only once,
218  // after the object has been created.
219  virtual void initialize();
220 
221  // Method used to update the internal structure without affecting
222  // the ProxyManager proxy registration
223  virtual void addInternalHelperProxy(const QString& key, vtkSMProxy*) const;
224  virtual void removeInternalHelperProxy(const QString& key, vtkSMProxy*) const;
225 
226 protected Q_SLOTS:
227  // Used to monitor helper proxy registration when created on other clients
228  void onProxyRegistered(const QString&, const QString&, vtkSMProxy*);
229  void onProxyUnRegistered(const QString&, const QString&, vtkSMProxy*);
230 
231 private:
232  QPointer<pqServer> Server;
233  QString SMName;
234  QString SMGroup;
235  pqProxyInternal* Internal;
236  ModifiedState Modified;
237  bool UserModifiedSMName;
238 };
239 
240 #endif
bool userModifiedSMName()
Return whether or not the user has modified the GUI name of the source.
Definition: pqProxy.h:189
ModifiedState
The modification state of this proxy.
Definition: pqProxy.h:63
pqServerManagerModelItem is a element maintained by pqServerManagerModel.
#define PQCORE_EXPORT
Definition: pqCoreModule.h:15
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
key
pqServer (should be renamed to pqSession) is a pqServerManagerModelItem subclass that represents a vt...
Definition: pqServer.h:64