pqProxy.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Kitware Inc.
2 // SPDX-FileCopyrightText: Copyright (c) Sandia Corporation
3 // SPDX-License-Identifier: BSD-3-Clause
4 
11 #ifndef pqProxy_h
12 #define pqProxy_h
13 
15 #include <QPointer>
16 
17 class pqProxyInternal;
18 class pqServer;
19 class vtkPVXMLElement;
20 class vtkSMProxy;
22 
29 {
30  Q_OBJECT
31 public:
36  {
39  UNMODIFIED
40  };
41 
42  pqProxy(const QString& group, const QString& name, vtkSMProxy* proxy, pqServer* server,
43  QObject* parent = nullptr);
44  ~pqProxy() override;
45 
49  pqServer* getServer() const;
50 
57  void rename(const QString& newname);
58 
64  const QString& getSMName();
65  const QString& getSMGroup();
66 
72  vtkSMProxy* getProxy() const;
73 
80  ModifiedState modifiedState() const { return this->Modified; }
81 
87  void setModifiedState(ModifiedState modified);
88 
93  vtkPVXMLElement* getHints() const;
94 
98  QList<vtkSMProxy*> getHelperProxies() const;
99 
103  QList<vtkSMProxy*> getHelperProxies(const QString& key) const;
104 
108  QList<QString> getHelperKeys() const;
109 
111 
114  static std::string rstToHtml(const char* rstStr);
115  static QString rstToHtml(const QString& rstStr);
117 
128  virtual void addHelperProxy(const QString& key, vtkSMProxy*);
129  void removeHelperProxy(const QString& key, vtkSMProxy*);
130 
136  void updateHelperProxies() const;
137 
141  vtkSMSessionProxyManager* proxyManager() const;
142 
148  static pqProxy* findProxyWithHelper(vtkSMProxy* aproxy, QString& key);
149 
159  bool userModifiedSMName() { return this->UserModifiedSMName; }
160 
161 Q_SIGNALS:
165  void nameChanged(pqServerManagerModelItem*);
166 
170  void modifiedStateChanged(pqServerManagerModelItem*);
171 
172 protected:
173  friend class pqServerManagerModel;
174 
184  void setSMName(const QString& new_name);
185 
186  // Use this method to initialize the pqObject state using the
187  // underlying vtkSMProxy. This needs to be done only once,
188  // after the object has been created.
189  virtual void initialize();
190 
191  // Method used to update the internal structure without affecting
192  // the ProxyManager proxy registration
193  virtual void addInternalHelperProxy(const QString& key, vtkSMProxy*) const;
194  virtual void removeInternalHelperProxy(const QString& key, vtkSMProxy*) const;
195 
196 protected Q_SLOTS: // NOLINT(readability-redundant-access-specifiers)
197  // Used to monitor helper proxy registration when created on other clients
198  void onProxyRegistered(const QString&, const QString&, vtkSMProxy*);
199  void onProxyUnRegistered(const QString&, const QString&, vtkSMProxy*);
200 
201 private:
202  QPointer<pqServer> Server;
203  QString SMName;
204  QString SMGroup;
205  pqProxyInternal* Internal;
206  ModifiedState Modified;
207  bool UserModifiedSMName;
208 };
209 
210 #endif
bool userModifiedSMName()
Return whether or not the user has modified the GUI name of the source.
Definition: pqProxy.h:159
ModifiedState
The modification state of this proxy.
Definition: pqProxy.h:35
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:28
pqServerManagerModel is the model for the Server Manager.
proxy for a VTK object(s) on a server
Definition: vtkSMProxy.h:140
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:80
key
pqServer (should be renamed to pqSession) is a pqServerManagerModelItem subclass that represents a vt...
Definition: pqServer.h:35