ParaView
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 =========================================================================*/
114 #ifndef vtkSMSessionProxyManager_h
115 #define vtkSMSessionProxyManager_h
116 
117 #include "vtkPVServerManagerCoreModule.h" //needed for exports
118 #include "vtkSMMessageMinimal.h" // needed for vtkSMMessage.
119 #include "vtkSMSessionObject.h"
120 
121 class vtkCollection;
122 class vtkEventForwarderCommand;
123 class vtkPVXMLElement;
125 class vtkSMDocumentation;
126 class vtkSMLink;
127 class vtkSMProperty;
128 class vtkSMProxy;
130 class vtkSMProxyIterator;
131 class vtkSMProxyLocator;
132 class vtkSMProxyManagerObserver;
133 class vtkSMProxyManagerProxySet;
134 class vtkSMSession;
135 class vtkSMStateLoader;
136 class vtkStringList;
137 class vtkSMPipelineState;
138 class vtkSMStateLocator;
140 
142 struct vtkClientServerID;
143 
144 class VTKPVSERVERMANAGERCORE_EXPORT vtkSMSessionProxyManager : public vtkSMSessionObject
145 {
146 public:
148 
152  static vtkSMSessionProxyManager* New(vtkSMSession* session);
154  void PrintSelf(ostream& os, vtkIndent indent);
156 
160  static vtkTypeUInt32 GetReservedGlobalID();
161 
171  vtkSMProxy* NewProxy(
172  const char* groupName, const char* proxyName, const char* subProxyName = NULL);
173 
180  vtkSMDocumentation* GetProxyDocumentation(const char* groupName, const char* proxyName);
181 
190  vtkSMDocumentation* GetPropertyDocumentation(
191  const char* groupName, const char* proxyName, const char* propertyName);
192 
205  void RegisterProxy(const char* groupname, const char* name, vtkSMProxy* proxy);
206 
211  vtkStdString RegisterProxy(const char* groupname, vtkSMProxy* proxy);
212 
214 
218  vtkSMProxy* GetProxy(const char* groupname, const char* name);
219  vtkSMProxy* GetProxy(const char* name);
221 
226  void GetProxies(const char* groupname, const char* name, vtkCollection* collection);
227  void GetProxies(const char* groupname, vtkCollection* collection)
228  {
229  this->GetProxies(groupname, NULL, collection);
230  }
231 
236  vtkSMProxy* GetPrototypeProxy(const char* groupname, const char* name);
237 
241  unsigned int GetNumberOfProxies(const char* groupname);
242 
247  const char* GetProxyName(const char* groupname, unsigned int idx);
248 
255  const char* GetProxyName(const char* groupname, vtkSMProxy* proxy);
256 
263  void GetProxyNames(const char* groupname, vtkSMProxy* proxy, vtkStringList* names);
264 
269  vtkStdString GetUniqueProxyName(const char* groupname, const char* prefix);
270 
276  const char* IsProxyInGroup(vtkSMProxy* proxy, const char* groupname);
277 
279 
283  void UnRegisterProxy(const char* groupname, const char* name, vtkSMProxy*);
284  void UnRegisterProxy(const char* name);
286 
291  void UnRegisterProxy(vtkSMProxy* proxy);
292 
296  void UnRegisterProxies();
297 
299 
305  void UpdateRegisteredProxies(const char* groupname, int modified_only = 1);
306  void UpdateRegisteredProxies(int modified_only = 1);
308 
310 
317  void UpdateRegisteredProxiesInOrder(int modified_only = 1);
318  void UpdateProxyInOrder(vtkSMProxy* proxy);
320 
324  int GetNumberOfLinks();
325 
329  const char* GetLinkName(int index);
330 
335  void RegisterLink(const char* linkname, vtkSMLink* link);
336 
340  void UnRegisterLink(const char* linkname);
341 
346  vtkSMLink* GetRegisteredLink(const char* linkname);
347 
352  const char* GetRegisteredLinkName(vtkSMLink* link);
353 
357  void UnRegisterAllLinks();
358 
367  void RegisterCustomProxyDefinition(const char* group, const char* name, vtkPVXMLElement* top);
368 
375  void UnRegisterCustomProxyDefinition(const char* group, const char* name);
376 
383  void UnRegisterCustomProxyDefinitions();
384 
388  vtkPVXMLElement* GetProxyDefinition(const char* group, const char* name);
389 
391 
394  void LoadCustomProxyDefinitions(const char* filename);
395  void LoadCustomProxyDefinitions(vtkPVXMLElement* root);
397 
401  void SaveCustomProxyDefinitions(vtkPVXMLElement* root);
402 
404 
408  void LoadXMLState(const char* filename, vtkSMStateLoader* loader = NULL);
409  void LoadXMLState(
410  vtkPVXMLElement* rootElement, vtkSMStateLoader* loader = NULL, bool keepOriginalIds = false);
412 
417  void SaveXMLState(const char* filename);
418 
425  vtkPVXMLElement* SaveXMLState();
426 
432  void InstantiateGroupPrototypes(const char* groupName);
433 
437  void InstantiatePrototypes();
438 
442  bool HasDefinition(const char* groupName, const char* proxyName);
443 
448  int AreProxiesModified();
449 
451 
459  vtkPVXMLElement* GetProxyHints(const char* xmlgroup, const char* xmlname);
460  vtkPVXMLElement* GetPropertyHints(
461  const char* groupName, const char* proxyName, const char* propertyName);
463 
465 
472  vtkGetMacro(UpdateInputProxies, int);
474 
478  bool LoadConfigurationXML(const char* xmlcontents);
479 
481 
486  vtkGetObjectMacro(ProxyDefinitionManager, vtkSMProxyDefinitionManager);
488 
494  vtkSMProxySelectionModel* GetSelectionModel(const char* name);
495 
499  vtkIdType GetNumberOfSelectionModel();
500 
504  vtkSMProxySelectionModel* GetSelectionModelAt(int idx);
505 
507 
512  void RegisterSelectionModel(const char* name, vtkSMProxySelectionModel*);
513  void UnRegisterSelectionModel(const char* name);
515 
521  void UpdateFromRemote();
522 
524 
530  bool IsStateUpdateNotificationEnabled();
531  void DisableStateUpdateNotification();
532  void EnableStateUpdateNotification();
533  void TriggerStateUpdate();
535 
542  virtual const vtkSMMessage* GetFullState();
543 
547  virtual void LoadState(const vtkSMMessage* msg, vtkSMProxyLocator* locator);
548 
553  vtkSMProxy* FindProxy(const char* reggroup, const char* xmlgroup, const char* xmltype);
554 
555 protected:
558 
559  friend class vtkSMProxy;
561  friend class vtkSMProxyIterator;
562  friend class vtkSMProxyManagerObserver;
563 
568  vtkSMProxy* NewProxy(vtkPVXMLElement* element, const char* groupname, const char* proxyname,
569  const char* subProxyName = NULL);
570 
575  vtkPVXMLElement* GetProxyElement(
576  const char* groupName, const char* proxyName, const char* subProxyName = NULL);
577 
581  virtual void ExecuteEvent(vtkObject* obj, unsigned long event, void* data);
582 
586  void RemovePrototype(const char* groupname, const char* proxyname);
587 
589 
592  void MarkProxyAsModified(vtkSMProxy*);
593  void UnMarkProxyAsModified(vtkSMProxy*);
595 
599  void SaveRegisteredLinks(vtkPVXMLElement* root);
600 
607  vtkPVXMLElement* AddInternalState(vtkPVXMLElement* parentElement);
608 
612  void CollectReferredProxies(vtkSMProxyManagerProxySet& setOfProxies, vtkSMProxy* proxy);
613 
616  vtkEventForwarderCommand* Forwarder;
619 
620 private:
622  vtkSMProxyManagerObserver* Observer;
623 
624 #ifndef __WRAP__
625  static vtkSMSessionProxyManager* New() { return NULL; }
626 #endif
627 
628 private:
629  vtkSMSessionProxyManager(const vtkSMSessionProxyManager&) VTK_DELETE_FUNCTION;
630  void operator=(const vtkSMSessionProxyManager&) VTK_DELETE_FUNCTION;
631 };
632 
633 #endif
634 
635 // 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...
vtkSMSession is the default ParaView session.
Definition: vtkSMSession.h:35
superclass for all SM properties
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
void PrintSelf(ostream &os, vtkIndent indent)
is used to locate proxies referred to in state xmls while loading state files.
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()
Class used to retreive a given message state based on its GlobalID.
iterates over all registered proxies (and groups)