vtkSMSessionProxyManager.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: ParaView
4  Module: vtkSMSessionProxyManager.h
5 
6  Copyright (c) Kitware, Inc.
7  All rights reserved.
8  See Copyright.txt or http://www.paraview.org/HTML/Copyright.html for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
113 #ifndef vtkSMSessionProxyManager_h
114 #define vtkSMSessionProxyManager_h
115 
116 #include "vtkRemotingServerManagerModule.h" // needed for exports
117 #include "vtkSMMessageMinimal.h" // needed for vtkSMMessage.
118 #include "vtkSMSessionObject.h"
119 
120 #include <string> // needed for std::string
121 
122 class vtkCollection;
124 class vtkPVXMLElement;
126 class vtkSMDocumentation;
128 class vtkSMLink;
129 class vtkSMProperty;
130 class vtkSMProxy;
132 class vtkSMProxyIterator;
133 class vtkSMProxyLocator;
134 class vtkSMProxyManagerObserver;
135 class vtkSMProxyManagerProxySet;
136 class vtkSMSession;
137 class vtkSMStateLoader;
138 class vtkStringList;
139 class vtkSMPipelineState;
140 class vtkSMStateLocator;
142 
144 struct vtkClientServerID;
145 
146 class VTKREMOTINGSERVERMANAGER_EXPORT vtkSMSessionProxyManager : public vtkSMSessionObject
147 {
148 public:
150 
154  static vtkSMSessionProxyManager* New(vtkSMSession* session);
156  void PrintSelf(ostream& os, vtkIndent indent) override;
158 
162  static vtkTypeUInt32 GetReservedGlobalID();
163 
173  vtkSMProxy* NewProxy(
174  const char* groupName, const char* proxyName, const char* subProxyName = NULL);
175 
182  vtkSMDocumentation* GetProxyDocumentation(const char* groupName, const char* proxyName);
183 
192  vtkSMDocumentation* GetPropertyDocumentation(
193  const char* groupName, const char* proxyName, const char* propertyName);
194 
207  void RegisterProxy(const char* groupname, const char* name, vtkSMProxy* proxy);
208 
213  std::string RegisterProxy(const char* groupname, vtkSMProxy* proxy);
214 
216 
220  vtkSMProxy* GetProxy(const char* groupname, const char* name);
221  vtkSMProxy* GetProxy(const char* name);
223 
228  void GetProxies(const char* groupname, const char* name, vtkCollection* collection);
229  void GetProxies(const char* groupname, vtkCollection* collection)
230  {
231  this->GetProxies(groupname, NULL, collection);
232  }
233 
242  vtkSMProxy* GetPrototypeProxy(const char* groupname, const char* name);
243 
247  unsigned int GetNumberOfProxies(const char* groupname);
248 
253  const char* GetProxyName(const char* groupname, unsigned int idx);
254 
261  const char* GetProxyName(const char* groupname, vtkSMProxy* proxy);
262 
269  void GetProxyNames(const char* groupname, vtkSMProxy* proxy, vtkStringList* names);
270 
277  std::string GetUniqueProxyName(
278  const char* groupname, const char* prefix, bool alwaysAppend = true);
279 
285  const char* IsProxyInGroup(vtkSMProxy* proxy, const char* groupname);
286 
288 
292  void UnRegisterProxy(const char* groupname, const char* name, vtkSMProxy*);
293  void UnRegisterProxy(const char* name);
295 
300  void UnRegisterProxy(vtkSMProxy* proxy);
301 
305  void UnRegisterProxies();
306 
308 
314  void UpdateRegisteredProxies(const char* groupname, int modified_only = 1);
315  void UpdateRegisteredProxies(int modified_only = 1);
317 
319 
326  void UpdateRegisteredProxiesInOrder(int modified_only = 1);
327  void UpdateProxyInOrder(vtkSMProxy* proxy);
329 
333  int GetNumberOfLinks();
334 
338  const char* GetLinkName(int index);
339 
344  void RegisterLink(const char* linkname, vtkSMLink* link);
345 
349  void UnRegisterLink(const char* linkname);
350 
355  vtkSMLink* GetRegisteredLink(const char* linkname);
356 
361  const char* GetRegisteredLinkName(vtkSMLink* link);
362 
366  void UnRegisterAllLinks();
367 
376  void RegisterCustomProxyDefinition(const char* group, const char* name, vtkPVXMLElement* top);
377 
384  void UnRegisterCustomProxyDefinition(const char* group, const char* name);
385 
392  void UnRegisterCustomProxyDefinitions();
393 
397  vtkPVXMLElement* GetProxyDefinition(const char* group, const char* name);
398 
400 
403  void LoadCustomProxyDefinitions(const char* filename);
404  void LoadCustomProxyDefinitions(vtkPVXMLElement* root);
406 
410  void SaveCustomProxyDefinitions(vtkPVXMLElement* root);
411 
413 
419  void LoadXMLState(const char* filename, vtkSMStateLoader* loader = NULL);
420  void LoadXMLState(
421  vtkPVXMLElement* rootElement, vtkSMStateLoader* loader = NULL, bool keepOriginalIds = false);
423 
428  vtkGetMacro(InLoadXMLState, bool);
429 
435  bool SaveXMLState(const char* filename);
436 
443  vtkPVXMLElement* SaveXMLState();
444 
448  void SaveRegisteredLinks(vtkPVXMLElement* root);
449 
455  void InstantiateGroupPrototypes(const char* groupName);
456 
460  void InstantiatePrototypes();
461 
465  void ClearPrototypes();
466 
470  bool HasDefinition(const char* groupName, const char* proxyName);
471 
476  int AreProxiesModified();
477 
479 
487  vtkPVXMLElement* GetProxyHints(const char* xmlgroup, const char* xmlname);
488  vtkPVXMLElement* GetPropertyHints(
489  const char* groupName, const char* proxyName, const char* propertyName);
491 
493 
500  vtkGetMacro(UpdateInputProxies, int);
502 
506  bool LoadConfigurationXML(const char* xmlcontents);
507 
509 
514  vtkGetObjectMacro(ProxyDefinitionManager, vtkSMProxyDefinitionManager);
516 
522  vtkSMProxySelectionModel* GetSelectionModel(const char* name);
523 
527  vtkIdType GetNumberOfSelectionModel();
528 
532  vtkSMProxySelectionModel* GetSelectionModelAt(int idx);
533 
535 
540  void RegisterSelectionModel(const char* name, vtkSMProxySelectionModel*);
541  void UnRegisterSelectionModel(const char* name);
543 
549  void UpdateFromRemote();
550 
552 
558  bool IsStateUpdateNotificationEnabled();
559  void DisableStateUpdateNotification();
560  void EnableStateUpdateNotification();
561  void TriggerStateUpdate();
563 
570  virtual const vtkSMMessage* GetFullState();
571 
575  virtual void LoadState(const vtkSMMessage* msg, vtkSMProxyLocator* locator);
576 
581  vtkSMProxy* FindProxy(const char* reggroup, const char* xmlgroup, const char* xmltype);
582 
586  vtkGetObjectMacro(ExportDepot, vtkSMExportProxyDepot);
587 
588 protected:
590  ~vtkSMSessionProxyManager() override;
591 
592  friend class vtkSMProxy;
594  friend class vtkSMProxyIterator;
595  friend class vtkSMProxyManagerObserver;
596 
601  vtkSMProxy* NewProxy(vtkPVXMLElement* element, const char* groupname, const char* proxyname,
602  const char* subProxyName = NULL);
603 
608  vtkPVXMLElement* GetProxyElement(
609  const char* groupName, const char* proxyName, const char* subProxyName = NULL);
610 
614  virtual void ExecuteEvent(vtkObject* obj, unsigned long event, void* data);
615 
619  void RemovePrototype(const char* groupname, const char* proxyname);
620 
622 
625  void MarkProxyAsModified(vtkSMProxy*);
626  void UnMarkProxyAsModified(vtkSMProxy*);
628 
635  vtkPVXMLElement* AddInternalState(vtkPVXMLElement* parentElement);
636 
640  void CollectReferredProxies(vtkSMProxyManagerProxySet& setOfProxies, vtkSMProxy* proxy);
641 
647 
648 private:
650  vtkSMProxyManagerObserver* Observer;
651  bool InLoadXMLState;
652 
653  vtkSMExportProxyDepot* ExportDepot;
654 
655 #ifndef __WRAP__
656  static vtkSMSessionProxyManager* New() { return NULL; }
657 #endif
658 
659 private:
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
vtkSMProxyDefinitionManager * ProxyDefinitionManager
vtkSMProxyDefinitionManager is a remote-object that represents the vtkSIProxyDefinitionManager instan...
access proxies that define catalyst export state
vtkSMSession is the default ParaView session.
Definition: vtkSMSession.h:35
superclass for all SM properties
int vtkIdType
void GetProxies(const char *groupname, vtkCollection *collection)
vtkSMPipelineState * PipelineState
vtkEventForwarderCommand * Forwarder
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
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:152
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.
static vtkSMSessionObject * New()
Manages allocation and freeing for a string list.
Definition: vtkStringList.h:30
Class used to retrieve a given message state based on its GlobalID.
iterates over all registered proxies (and groups)