vtkSMProxyManager.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Kitware Inc.
2 // SPDX-License-Identifier: BSD-3-Clause
14 #ifndef vtkSMProxyManager_h
15 #define vtkSMProxyManager_h
16 
17 #include "vtkRemotingServerManagerModule.h" //needed for exports
18 #include "vtkSMObject.h"
19 #include "vtkSmartPointer.h" // Needed for the singleton
20 
21 #include <string> // needed for std::string
22 
23 class vtkPVXMLElement;
24 class vtkSMPluginManager;
25 class vtkSMProxy;
26 class vtkSMProxyLocator;
28 class vtkSMReaderFactory;
29 class vtkSMSession;
31 class vtkSMStateLoader;
33 class vtkSMWriterFactory;
34 
36 {
37 public:
39  void PrintSelf(ostream& os, vtkIndent indent) override;
40 
44  static vtkSMProxyManager* GetProxyManager();
45 
49  static void Finalize();
50 
55  static bool IsInitialized();
56 
62  static int GetVersionMajor();
63 
69  static int GetVersionMinor();
70 
76  static int GetVersionPatch();
77 
81  static const char* GetParaViewSourceVersion();
82 
88  vtkSMSession* GetActiveSession();
89 
91 
96  void SetActiveSession(vtkSMSession* session);
97  void SetActiveSession(vtkIdType sessionId);
99 
103  vtkSMSessionProxyManager* GetActiveSessionProxyManager();
104 
109  vtkSMSessionProxyManager* GetSessionProxyManager(vtkSMSession* session);
110 
112 
117  vtkSMProxy* NewProxy(
118  const char* groupName, const char* proxyName, const char* subProxyName = nullptr);
119  void RegisterProxy(const char* groupname, const char* name, vtkSMProxy* proxy);
120  vtkSMProxy* GetProxy(const char* groupname, const char* name);
121  void UnRegisterProxy(const char* groupname, const char* name, vtkSMProxy*);
122  const char* GetProxyName(const char* groupname, unsigned int idx);
123  const char* GetProxyName(const char* groupname, vtkSMProxy* proxy);
125 
126  vtkSetMacro(BlockProxyDefinitionUpdates, bool);
127  vtkGetMacro(BlockProxyDefinitionUpdates, bool);
128  vtkBooleanMacro(BlockProxyDefinitionUpdates, bool);
129  void UpdateProxyDefinitions();
130 
132 
136  void SetUndoStackBuilder(vtkSMUndoStackBuilder* builder);
137  vtkGetObjectMacro(UndoStackBuilder, vtkSMUndoStackBuilder);
139 
141 
145  vtkGetObjectMacro(PluginManager, vtkSMPluginManager);
147 
149 
153  vtkGetObjectMacro(ReaderFactory, vtkSMReaderFactory);
155 
157 
161  vtkGetObjectMacro(WriterFactory, vtkSMWriterFactory);
163 
164  enum eventId
165  {
166  ActiveSessionChanged = 9753
167  };
168 
170  {
172  const char* GroupName;
173  const char* ProxyName;
174  // Set when the register/unregister event if fired for registration of
175  // a compound proxy definition.
176  unsigned int Type;
177 
178  enum
179  {
180  PROXY = 0x1,
181  COMPOUND_PROXY_DEFINITION = 0x2,
182  LINK = 0x3,
183  };
184  };
185 
187  {
189  const char* PropertyName;
190  };
191 
193  {
196  };
197 
199  {
202  };
203 
212  std::string GetUniqueProxyName(
213  const char* groupname, const char* prefix, bool alwaysAppend = true);
214 
215 protected:
217  ~vtkSMProxyManager() override;
218 #ifndef __WRAP__
219  static vtkSMProxyManager* New();
220 #endif
221 
223 
227  void ConnectionsUpdated(vtkObject*, unsigned long, void*);
228 
233 
235 
236 private:
237  class vtkPXMInternal;
238  vtkPXMInternal* PXMStorage;
239 
240  static vtkSmartPointer<vtkSMProxyManager> Singleton;
241 
242  vtkSMProxyManager(const vtkSMProxyManager&) = delete;
243  void operator=(const vtkSMProxyManager&) = delete;
244 };
245 
246 #endif
vtkSMWriterFactory * WriterFactory
builds server manager undo sets and pushes them on the undo stack.
vtkSMReaderFactory * ReaderFactory
manages ParaView plugins.
#define VTKREMOTINGSERVERMANAGER_EXPORT
vtkSMSession is the default ParaView session.
Definition: vtkSMSession.h:22
int vtkIdType
is a factory for creating a reader proxy based on the filename/extension.
singleton/facade to vtkSMSessionProxyManager
vtkSMPluginManager * PluginManager
superclass for most server manager classes
Definition: vtkSMObject.h:17
vtkSMUndoStackBuilder * UndoStackBuilder
The vtkSMSessionProxyManager is esponsible for creating and managing proxies for a given session...
is a factory or creating a writer based on the data type information from the output port...
proxy for a VTK object(s) on a server
Definition: vtkSMProxy.h:140
is used to locate proxies referred to in state xmls while loading state files.
Utility class to load state from XML.
This is used by vtkPVXMLParser to represent an XML document starting at the root element.
void PrintSelf(ostream &os, vtkIndent indent) override