vtkSMStateLoader.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: ParaView
4  Module: vtkSMStateLoader.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 =========================================================================*/
25 #ifndef vtkSMStateLoader_h
26 #define vtkSMStateLoader_h
27 
28 #include "vtkRemotingServerManagerModule.h" //needed for exports
29 #include "vtkSMDeserializerXML.h"
30 
31 #include <map> // needed for API
32 #include <string> // needed for API
33 
34 class vtkPVXMLElement;
35 class vtkSMProxy;
36 class vtkSMProxyLocator;
37 
38 struct vtkSMStateLoaderInternals;
39 
41 {
42 public:
43  static vtkSMStateLoader* New();
45  void PrintSelf(ostream& os, vtkIndent indent) override;
46 
50  int LoadState(vtkPVXMLElement* rootElement, bool keepOriginalId = false);
51 
53 
57  void SetProxyLocator(vtkSMProxyLocator* loc);
58  vtkGetObjectMacro(ProxyLocator, vtkSMProxyLocator);
60 
62 
66  vtkSetMacro(KeepIdMapping, int);
67  vtkGetMacro(KeepIdMapping, int);
68  vtkBooleanMacro(KeepIdMapping, int);
70 
72 
78  vtkTypeUInt32* GetMappingArray(int& size);
79 
80 protected:
82  ~vtkSMStateLoader() override;
84 
91  virtual int LoadStateInternal(vtkPVXMLElement* rootElement);
92 
104  void CreatedNewProxy(vtkTypeUInt32 id, vtkSMProxy* proxy) override;
105 
111  const char* xmlgroup, const char* xmlname, const char* subProxyName = NULL) override;
112 
113  virtual int HandleProxyCollection(vtkPVXMLElement* collectionElement);
114  virtual void HandleCustomProxyDefinitions(vtkPVXMLElement* element);
115  int HandleLinks(vtkPVXMLElement* linksElement);
116  virtual int BuildProxyCollectionInformation(vtkPVXMLElement*);
117 
119 
126  virtual void RegisterProxy(vtkTypeUInt32 id, vtkSMProxy* proxy);
127  virtual void RegisterProxyInternal(const char* group, const char* name, vtkSMProxy* proxy);
129 
139  virtual bool UpdateRegistrationInfo(std::string& group, std::string& name, vtkSMProxy* proxy);
140 
146  vtkPVXMLElement* LocateProxyElement(vtkTypeUInt32 id) override;
147 
152  vtkPVXMLElement* LocateProxyElementInternal(vtkPVXMLElement* root, vtkTypeUInt32 id);
153 
157  virtual bool VerifyXMLVersion(vtkPVXMLElement* rootElement);
158 
163  vtkSMProxy* LocateExistingProxyUsingRegistrationName(vtkTypeUInt32 id);
164 
168 
169 private:
170  vtkSMStateLoader(const vtkSMStateLoader&) = delete;
171  void operator=(const vtkSMStateLoader&) = delete;
172 
173  vtkSMStateLoaderInternals* Internal;
174 };
175 
176 #endif
vtkSMProxy * CreateProxy(const char *xmlgroup, const char *xmlname, const char *subProxyName=NULL) override
Create a new proxy of the given group and name.
vtkPVXMLElement * ServerManagerStateElement
vtkSMProxyLocator * ProxyLocator
void PrintSelf(ostream &os, vtkIndent indent) override
#define VTKREMOTINGSERVERMANAGER_EXPORT
virtual void CreatedNewProxy(vtkTypeUInt32 id, vtkSMProxy *proxy)
Called after a new proxy has been created.
static vtkSMDeserializerXML * New()
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.
deserializes proxies from their XML states.
Utility class to load state from XML.
This is used by vtkPVXMLParser to represent an XML document starting at the root element.
virtual vtkPVXMLElement * LocateProxyElement(vtkTypeUInt32 id)
Locate the XML for the proxy with the given id.