vtkSMSessionProxyManager.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Kitware Inc.
2 // SPDX-License-Identifier: BSD-3-Clause
101 #ifndef vtkSMSessionProxyManager_h
102 #define vtkSMSessionProxyManager_h
103 
104 #include "vtkRemotingServerManagerModule.h" // needed for exports
105 #include "vtkSMMessageMinimal.h" // needed for vtkSMMessage.
106 #include "vtkSMSessionObject.h"
107 #include "vtkSmartPointer.h" // needed for vtkSmartPointer
108 
109 #include <set> // needed for std::set
110 #include <string> // needed for std::string
111 
112 class vtkCollection;
114 class vtkPVXMLElement;
116 class vtkSMDocumentation;
117 class vtkSMLink;
118 class vtkSMProperty;
119 class vtkSMProxy;
121 class vtkSMProxyIterator;
122 class vtkSMProxyLocator;
123 class vtkSMProxyManagerObserver;
124 class vtkSMProxyManagerProxySet;
125 class vtkSMSession;
126 class vtkSMStateLoader;
127 class vtkStringList;
128 class vtkSMPipelineState;
129 class vtkSMStateLocator;
131 
133 struct vtkClientServerID;
134 
136 {
137 public:
139 
143  static vtkSMSessionProxyManager* New(vtkSMSession* session);
145  void PrintSelf(ostream& os, vtkIndent indent) override;
147 
151  static vtkTypeUInt32 GetReservedGlobalID();
152 
162  vtkSMProxy* NewProxy(
163  const char* groupName, const char* proxyName, const char* subProxyName = nullptr);
164 
171  vtkSMDocumentation* GetProxyDocumentation(const char* groupName, const char* proxyName);
172 
181  vtkSMDocumentation* GetPropertyDocumentation(
182  const char* groupName, const char* proxyName, const char* propertyName);
183 
196  void RegisterProxy(const char* groupname, const char* name, vtkSMProxy* proxy);
197 
202  std::string RegisterProxy(const char* groupname, vtkSMProxy* proxy);
203 
205 
209  vtkSMProxy* GetProxy(const char* groupname, const char* name);
210  vtkSMProxy* GetProxy(const char* name);
212 
217  void GetProxies(const char* groupname, const char* name, vtkCollection* collection);
218  void GetProxies(const char* groupname, vtkCollection* collection)
219  {
220  this->GetProxies(groupname, nullptr, collection);
221  }
222 
231  vtkSMProxy* GetPrototypeProxy(const char* groupname, const char* name);
232 
236  unsigned int GetNumberOfProxies(const char* groupname);
237 
242  const char* GetProxyName(const char* groupname, unsigned int idx);
243 
250  const char* GetProxyName(const char* groupname, vtkSMProxy* proxy);
251 
258  void GetProxyNames(const char* groupname, vtkSMProxy* proxy, vtkStringList* names);
259 
266  std::string GetUniqueProxyName(
267  const char* groupname, const char* prefix, bool alwaysAppend = true);
268 
274  const char* IsProxyInGroup(vtkSMProxy* proxy, const char* groupname);
275 
277 
281  void UnRegisterProxy(const char* groupname, const char* name, vtkSMProxy*);
282  void UnRegisterProxy(const char* name);
284 
289  void UnRegisterProxy(vtkSMProxy* proxy);
290 
294  void UnRegisterProxies();
295 
297 
303  void UpdateRegisteredProxies(const char* groupname, int modified_only = 1);
304  void UpdateRegisteredProxies(int modified_only = 1);
306 
308 
315  void UpdateRegisteredProxiesInOrder(int modified_only = 1);
316  void UpdateProxyInOrder(vtkSMProxy* proxy);
318 
322  int GetNumberOfLinks();
323 
327  const char* GetLinkName(int index);
328 
333  void RegisterLink(const char* linkname, vtkSMLink* link);
334 
338  void UnRegisterLink(const char* linkname);
339 
344  vtkSMLink* GetRegisteredLink(const char* linkname);
345 
350  const char* GetRegisteredLinkName(vtkSMLink* link);
351 
355  void UnRegisterAllLinks();
356 
365  void RegisterCustomProxyDefinition(const char* group, const char* name, vtkPVXMLElement* top);
366 
373  void UnRegisterCustomProxyDefinition(const char* group, const char* name);
374 
381  void UnRegisterCustomProxyDefinitions();
382 
386  vtkPVXMLElement* GetProxyDefinition(const char* group, const char* name);
387 
389 
392  void LoadCustomProxyDefinitions(const char* filename);
393  void LoadCustomProxyDefinitions(vtkPVXMLElement* root);
395 
399  void SaveCustomProxyDefinitions(vtkPVXMLElement* root);
400 
402 
408  void LoadXMLState(const char* filename, vtkSMStateLoader* loader = nullptr,
409  vtkTypeUInt32 location = 0x10 /*vtkPVSession::CLIENT*/);
410  void LoadXMLState(
411  vtkPVXMLElement* rootElement, vtkSMStateLoader* loader = nullptr, bool keepOriginalIds = false);
413 
418  vtkGetMacro(InLoadXMLState, bool);
419 
423  bool SaveString(const char* string, const char* filename, vtkTypeUInt32 location);
424 
428  std::string LoadString(const char* filename, vtkTypeUInt32 location);
429 
435  bool SaveXMLState(const char* filename, vtkTypeUInt32 location = 0x10 /*vtkPVSession::CLIENT*/);
436 
443  vtkPVXMLElement* SaveXMLState();
444 
446 
458  const std::set<vtkSMProxy*>& restrictionSet, bool forceRestriction = false);
460 
464  void SaveRegisteredLinks(vtkPVXMLElement* root);
465 
471  void InstantiateGroupPrototypes(const char* groupName);
472 
476  void InstantiatePrototypes();
477 
481  void ClearPrototypes();
482 
486  bool HasDefinition(const char* groupName, const char* proxyName);
487 
492  int AreProxiesModified();
493 
495 
503  vtkPVXMLElement* GetProxyHints(const char* xmlgroup, const char* xmlname);
504  vtkPVXMLElement* GetPropertyHints(
505  const char* groupName, const char* proxyName, const char* propertyName);
507 
509 
516  vtkGetMacro(UpdateInputProxies, int);
518 
522  bool LoadConfigurationXML(const char* xmlcontents);
523 
525 
530  vtkGetObjectMacro(ProxyDefinitionManager, vtkSMProxyDefinitionManager);
532 
538  vtkSMProxySelectionModel* GetSelectionModel(const char* name);
539 
543  vtkIdType GetNumberOfSelectionModel();
544 
548  vtkSMProxySelectionModel* GetSelectionModelAt(int idx);
549 
551 
556  void RegisterSelectionModel(const char* name, vtkSMProxySelectionModel*);
557  void UnRegisterSelectionModel(const char* name);
559 
565  void UpdateFromRemote();
566 
568 
574  bool IsStateUpdateNotificationEnabled();
575  void DisableStateUpdateNotification();
576  void EnableStateUpdateNotification();
577  void TriggerStateUpdate();
579 
586  virtual const vtkSMMessage* GetFullState();
587 
591  virtual void LoadState(const vtkSMMessage* msg, vtkSMProxyLocator* locator);
592 
597  vtkSMProxy* FindProxy(const char* reggroup, const char* xmlgroup, const char* xmltype);
598 
599 protected:
601  ~vtkSMSessionProxyManager() override;
602 
603  friend class vtkSMProxy;
605  friend class vtkSMProxyIterator;
606  friend class vtkSMProxyManagerObserver;
607 
612  vtkSMProxy* NewProxy(vtkPVXMLElement* element, const char* groupname, const char* proxyname,
613  const char* subProxyName = nullptr);
614 
619  vtkPVXMLElement* GetProxyElement(
620  const char* groupName, const char* proxyName, const char* subProxyName = nullptr);
621 
625  virtual void ExecuteEvent(vtkObject* obj, unsigned long event, void* data);
626 
630  void RemovePrototype(const char* groupname, const char* proxyname);
631 
633 
636  void MarkProxyAsModified(vtkSMProxy*);
637  void UnMarkProxyAsModified(vtkSMProxy*);
639 
643  void CollectReferredProxies(vtkSMProxyManagerProxySet& setOfProxies, vtkSMProxy* proxy);
644 
650 
651 private:
653  vtkSMProxyManagerObserver* Observer;
654  bool InLoadXMLState;
655 
656 #ifndef __WRAP__
657  static vtkSMSessionProxyManager* New() { return nullptr; }
658 #endif
659 
661  void operator=(const vtkSMSessionProxyManager&) = delete;
662 };
663 
664 #endif
665 
666 // VTK-HeaderTest-Exclude: vtkSMSessionProxyManager.h
superclass for any server manager classes that are related to a session
location
vtkSMProxyDefinitionManager * ProxyDefinitionManager
vtkSMProxyDefinitionManager is a remote-object that represents the vtkSIProxyDefinitionManager instan...
#define VTKREMOTINGSERVERMANAGER_EXPORT
vtkSMSession is the default ParaView session.
Definition: vtkSMSession.h:22
superclass for all SM properties
int vtkIdType
void GetProxies(const char *groupname, vtkCollection *collection)
vtkSMPipelineState * PipelineState
vtkEventForwarderCommand * Forwarder
name
Header class that setup every thing in order to use Protobuf messages in a transparent manner...
class that manage the state of the processing pipeline
vtkSmartPointer< vtkPVXMLElement > GetXMLState()
Returns the XML state for the proxy manager.
iterates over all proxy definitions from which the vtkSMProxyManager can use to create new proxy...
The vtkSMSessionProxyManager is esponsible for creating and managing proxies for a given session...
a proxy excapsulation a pipeline of proxies.
proxy for a VTK object(s) on a server
Definition: vtkSMProxy.h:140
top
is used to locate proxies referred to in state xmls while loading state files.
void PrintSelf(ostream &os, vtkIndent indent) override
class providing access to the documentation for a vtkSMProxy.
Utility class to load state from XML.
This is used by vtkPVXMLParser to represent an XML document starting at the root element.
Identifier for a ClientServer object.
index
static vtkSMSessionObject * New()
Manages allocation and freeing for a string list.
Definition: vtkStringList.h:18
Class used to retrieve a given message state based on its GlobalID.
iterates over all registered proxies (and groups)