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 #include "vtkSmartPointer.h" // needed for vtkSmartPointer
120 
121 #include <set> // needed for std::set
122 #include <string> // needed for std::string
123 
124 class vtkCollection;
126 class vtkPVXMLElement;
128 class vtkSMDocumentation;
129 class vtkSMLink;
130 class vtkSMProperty;
131 class vtkSMProxy;
133 class vtkSMProxyIterator;
134 class vtkSMProxyLocator;
135 class vtkSMProxyManagerObserver;
136 class vtkSMProxyManagerProxySet;
137 class vtkSMSession;
138 class vtkSMStateLoader;
139 class vtkStringList;
140 class vtkSMPipelineState;
141 class vtkSMStateLocator;
143 
145 struct vtkClientServerID;
146 
148 {
149 public:
151 
155  static vtkSMSessionProxyManager* New(vtkSMSession* session);
157  void PrintSelf(ostream& os, vtkIndent indent) override;
159 
163  static vtkTypeUInt32 GetReservedGlobalID();
164 
174  vtkSMProxy* NewProxy(
175  const char* groupName, const char* proxyName, const char* subProxyName = NULL);
176 
183  vtkSMDocumentation* GetProxyDocumentation(const char* groupName, const char* proxyName);
184 
193  vtkSMDocumentation* GetPropertyDocumentation(
194  const char* groupName, const char* proxyName, const char* propertyName);
195 
208  void RegisterProxy(const char* groupname, const char* name, vtkSMProxy* proxy);
209 
214  std::string RegisterProxy(const char* groupname, vtkSMProxy* proxy);
215 
217 
221  vtkSMProxy* GetProxy(const char* groupname, const char* name);
222  vtkSMProxy* GetProxy(const char* name);
224 
229  void GetProxies(const char* groupname, const char* name, vtkCollection* collection);
230  void GetProxies(const char* groupname, vtkCollection* collection)
231  {
232  this->GetProxies(groupname, NULL, collection);
233  }
234 
243  vtkSMProxy* GetPrototypeProxy(const char* groupname, const char* name);
244 
248  unsigned int GetNumberOfProxies(const char* groupname);
249 
254  const char* GetProxyName(const char* groupname, unsigned int idx);
255 
262  const char* GetProxyName(const char* groupname, vtkSMProxy* proxy);
263 
270  void GetProxyNames(const char* groupname, vtkSMProxy* proxy, vtkStringList* names);
271 
278  std::string GetUniqueProxyName(
279  const char* groupname, const char* prefix, bool alwaysAppend = true);
280 
286  const char* IsProxyInGroup(vtkSMProxy* proxy, const char* groupname);
287 
289 
293  void UnRegisterProxy(const char* groupname, const char* name, vtkSMProxy*);
294  void UnRegisterProxy(const char* name);
296 
301  void UnRegisterProxy(vtkSMProxy* proxy);
302 
306  void UnRegisterProxies();
307 
309 
315  void UpdateRegisteredProxies(const char* groupname, int modified_only = 1);
316  void UpdateRegisteredProxies(int modified_only = 1);
318 
320 
327  void UpdateRegisteredProxiesInOrder(int modified_only = 1);
328  void UpdateProxyInOrder(vtkSMProxy* proxy);
330 
334  int GetNumberOfLinks();
335 
339  const char* GetLinkName(int index);
340 
345  void RegisterLink(const char* linkname, vtkSMLink* link);
346 
350  void UnRegisterLink(const char* linkname);
351 
356  vtkSMLink* GetRegisteredLink(const char* linkname);
357 
362  const char* GetRegisteredLinkName(vtkSMLink* link);
363 
367  void UnRegisterAllLinks();
368 
377  void RegisterCustomProxyDefinition(const char* group, const char* name, vtkPVXMLElement* top);
378 
385  void UnRegisterCustomProxyDefinition(const char* group, const char* name);
386 
393  void UnRegisterCustomProxyDefinitions();
394 
398  vtkPVXMLElement* GetProxyDefinition(const char* group, const char* name);
399 
401 
404  void LoadCustomProxyDefinitions(const char* filename);
405  void LoadCustomProxyDefinitions(vtkPVXMLElement* root);
407 
411  void SaveCustomProxyDefinitions(vtkPVXMLElement* root);
412 
414 
420  void LoadXMLState(const char* filename, vtkSMStateLoader* loader = NULL);
421  void LoadXMLState(
422  vtkPVXMLElement* rootElement, vtkSMStateLoader* loader = NULL, bool keepOriginalIds = false);
424 
429  vtkGetMacro(InLoadXMLState, bool);
430 
436  bool SaveXMLState(const char* filename);
437 
444  vtkPVXMLElement* SaveXMLState();
445 
447 
456  vtkSmartPointer<vtkPVXMLElement> GetXMLState(const std::set<vtkSMProxy*>& restrictionSet);
458 
462  void SaveRegisteredLinks(vtkPVXMLElement* root);
463 
469  void InstantiateGroupPrototypes(const char* groupName);
470 
474  void InstantiatePrototypes();
475 
479  void ClearPrototypes();
480 
484  bool HasDefinition(const char* groupName, const char* proxyName);
485 
490  int AreProxiesModified();
491 
493 
501  vtkPVXMLElement* GetProxyHints(const char* xmlgroup, const char* xmlname);
502  vtkPVXMLElement* GetPropertyHints(
503  const char* groupName, const char* proxyName, const char* propertyName);
505 
507 
514  vtkGetMacro(UpdateInputProxies, int);
516 
520  bool LoadConfigurationXML(const char* xmlcontents);
521 
523 
528  vtkGetObjectMacro(ProxyDefinitionManager, vtkSMProxyDefinitionManager);
530 
536  vtkSMProxySelectionModel* GetSelectionModel(const char* name);
537 
541  vtkIdType GetNumberOfSelectionModel();
542 
546  vtkSMProxySelectionModel* GetSelectionModelAt(int idx);
547 
549 
554  void RegisterSelectionModel(const char* name, vtkSMProxySelectionModel*);
555  void UnRegisterSelectionModel(const char* name);
557 
563  void UpdateFromRemote();
564 
566 
572  bool IsStateUpdateNotificationEnabled();
573  void DisableStateUpdateNotification();
574  void EnableStateUpdateNotification();
575  void TriggerStateUpdate();
577 
584  virtual const vtkSMMessage* GetFullState();
585 
589  virtual void LoadState(const vtkSMMessage* msg, vtkSMProxyLocator* locator);
590 
595  vtkSMProxy* FindProxy(const char* reggroup, const char* xmlgroup, const char* xmltype);
596 
597 protected:
599  ~vtkSMSessionProxyManager() override;
600 
601  friend class vtkSMProxy;
603  friend class vtkSMProxyIterator;
604  friend class vtkSMProxyManagerObserver;
605 
610  vtkSMProxy* NewProxy(vtkPVXMLElement* element, const char* groupname, const char* proxyname,
611  const char* subProxyName = NULL);
612 
617  vtkPVXMLElement* GetProxyElement(
618  const char* groupName, const char* proxyName, const char* subProxyName = NULL);
619 
623  virtual void ExecuteEvent(vtkObject* obj, unsigned long event, void* data);
624 
628  void RemovePrototype(const char* groupname, const char* proxyname);
629 
631 
634  void MarkProxyAsModified(vtkSMProxy*);
635  void UnMarkProxyAsModified(vtkSMProxy*);
637 
641  void CollectReferredProxies(vtkSMProxyManagerProxySet& setOfProxies, vtkSMProxy* proxy);
642 
648 
649 private:
651  vtkSMProxyManagerObserver* Observer;
652  bool InLoadXMLState;
653 
654 #ifndef __WRAP__
655  static vtkSMSessionProxyManager* New() { return NULL; }
656 #endif
657 
658 private:
660  void operator=(const vtkSMSessionProxyManager&) = delete;
661 };
662 
663 #endif
664 
665 // 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...
#define VTKREMOTINGSERVERMANAGER_EXPORT
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
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:152
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:30
Class used to retrieve a given message state based on its GlobalID.
iterates over all registered proxies (and groups)