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 = nullptr);
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, nullptr, 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 = nullptr);
421  void LoadXMLState(
422  vtkPVXMLElement* rootElement, vtkSMStateLoader* loader = nullptr, bool keepOriginalIds = false);
424 
429  vtkGetMacro(InLoadXMLState, bool);
430 
436  bool SaveXMLState(const char* filename);
437 
444  vtkPVXMLElement* SaveXMLState();
445 
447 
459  const std::set<vtkSMProxy*>& restrictionSet, bool forceRestriction = false);
461 
465  void SaveRegisteredLinks(vtkPVXMLElement* root);
466 
472  void InstantiateGroupPrototypes(const char* groupName);
473 
477  void InstantiatePrototypes();
478 
482  void ClearPrototypes();
483 
487  bool HasDefinition(const char* groupName, const char* proxyName);
488 
493  int AreProxiesModified();
494 
496 
504  vtkPVXMLElement* GetProxyHints(const char* xmlgroup, const char* xmlname);
505  vtkPVXMLElement* GetPropertyHints(
506  const char* groupName, const char* proxyName, const char* propertyName);
508 
510 
517  vtkGetMacro(UpdateInputProxies, int);
519 
523  bool LoadConfigurationXML(const char* xmlcontents);
524 
526 
531  vtkGetObjectMacro(ProxyDefinitionManager, vtkSMProxyDefinitionManager);
533 
539  vtkSMProxySelectionModel* GetSelectionModel(const char* name);
540 
544  vtkIdType GetNumberOfSelectionModel();
545 
549  vtkSMProxySelectionModel* GetSelectionModelAt(int idx);
550 
552 
557  void RegisterSelectionModel(const char* name, vtkSMProxySelectionModel*);
558  void UnRegisterSelectionModel(const char* name);
560 
566  void UpdateFromRemote();
567 
569 
575  bool IsStateUpdateNotificationEnabled();
576  void DisableStateUpdateNotification();
577  void EnableStateUpdateNotification();
578  void TriggerStateUpdate();
580 
587  virtual const vtkSMMessage* GetFullState();
588 
592  virtual void LoadState(const vtkSMMessage* msg, vtkSMProxyLocator* locator);
593 
598  vtkSMProxy* FindProxy(const char* reggroup, const char* xmlgroup, const char* xmltype);
599 
600 protected:
602  ~vtkSMSessionProxyManager() override;
603 
604  friend class vtkSMProxy;
606  friend class vtkSMProxyIterator;
607  friend class vtkSMProxyManagerObserver;
608 
613  vtkSMProxy* NewProxy(vtkPVXMLElement* element, const char* groupname, const char* proxyname,
614  const char* subProxyName = nullptr);
615 
620  vtkPVXMLElement* GetProxyElement(
621  const char* groupName, const char* proxyName, const char* subProxyName = nullptr);
622 
626  virtual void ExecuteEvent(vtkObject* obj, unsigned long event, void* data);
627 
631  void RemovePrototype(const char* groupname, const char* proxyname);
632 
634 
637  void MarkProxyAsModified(vtkSMProxy*);
638  void UnMarkProxyAsModified(vtkSMProxy*);
640 
644  void CollectReferredProxies(vtkSMProxyManagerProxySet& setOfProxies, vtkSMProxy* proxy);
645 
651 
652 private:
654  vtkSMProxyManagerObserver* Observer;
655  bool InLoadXMLState;
656 
657 #ifndef __WRAP__
658  static vtkSMSessionProxyManager* New() { return nullptr; }
659 #endif
660 
662  void operator=(const vtkSMSessionProxyManager&) = delete;
663 };
664 
665 #endif
666 
667 // 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:34
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)