Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
vtkSMStateLoader Class Reference

Utility class to load state from XML. More...

#include <vtkSMStateLoader.h>

Inheritance diagram for vtkSMStateLoader:
Inheritance graph
[legend]
Collaboration diagram for vtkSMStateLoader:
Collaboration graph
[legend]

Public Types

typedef vtkSMDeserializerXML Superclass
 
- Public Types inherited from vtkSMDeserializerXML
typedef vtkSMDeserializer Superclass
 
- Public Types inherited from vtkSMDeserializer
typedef vtkObject Superclass
 

Public Member Functions

virtual const char * GetClassName ()
 
virtual int IsA (const char *type)
 
void PrintSelf (ostream &os, vtkIndent indent) override
 
int LoadState (vtkPVXMLElement *rootElement, bool keepOriginalId=false)
 Load the state from the given root element. More...
 
void SetProxyLocator (vtkSMProxyLocator *loc)
 Get/Set the proxy locator to use. More...
 
virtual vtkSMProxyLocatorGetProxyLocator ()
 Get/Set the proxy locator to use. More...
 
virtual void SetKeepIdMapping (int)
 Allow the loader to keep the mapping between the id from the loaded state to the current proxy attributed id. More...
 
virtual int GetKeepIdMapping ()
 Allow the loader to keep the mapping between the id from the loaded state to the current proxy attributed id. More...
 
virtual void KeepIdMappingOn ()
 Allow the loader to keep the mapping between the id from the loaded state to the current proxy attributed id. More...
 
virtual void KeepIdMappingOff ()
 Allow the loader to keep the mapping between the id from the loaded state to the current proxy attributed id. More...
 
- Public Member Functions inherited from vtkSMDeserializer
void SetSession (vtkSMSession *session)
 Convenience method for setting the SessionProxyManager. More...
 
vtkSMSessionGetSession ()
 Provides access to the session. More...
 
vtkSMSessionProxyManagerGetSessionProxyManager ()
 Get/Set the proxy manager on which this deserializer is expected to operate. More...
 
void SetSessionProxyManager (vtkSMSessionProxyManager *)
 Get/Set the proxy manager on which this deserializer is expected to operate. More...
 
- Public Member Functions inherited from vtkObject
 vtkBaseTypeMacro (vtkObject, vtkObjectBase)
 
virtual void DebugOn ()
 
virtual void DebugOff ()
 
bool GetDebug ()
 
void SetDebug (bool debugFlag)
 
virtual void Modified ()
 
virtual vtkMTimeType GetMTime ()
 
void RemoveObserver (unsigned long tag)
 
void RemoveObservers (unsigned long event)
 
void RemoveObservers (const char *event)
 
void RemoveAllObservers ()
 
int HasObserver (unsigned long event)
 
int HasObserver (const char *event)
 
int InvokeEvent (unsigned long event)
 
int InvokeEvent (const char *event)
 
unsigned long AddObserver (unsigned long event, vtkCommand *, float priority=0.0f)
 
unsigned long AddObserver (const char *event, vtkCommand *, float priority=0.0f)
 
vtkCommandGetCommand (unsigned long tag)
 
void RemoveObserver (vtkCommand *)
 
void RemoveObservers (unsigned long event, vtkCommand *)
 
void RemoveObservers (const char *event, vtkCommand *)
 
int HasObserver (unsigned long event, vtkCommand *)
 
int HasObserver (const char *event, vtkCommand *)
 
unsigned long AddObserver (unsigned long event, U observer, void(T::*callback)(), float priority=0.0f)
 
unsigned long AddObserver (unsigned long event, U observer, void(T::*callback)(vtkObject *, unsigned long, void *), float priority=0.0f)
 
unsigned long AddObserver (unsigned long event, U observer, bool(T::*callback)(vtkObject *, unsigned long, void *), float priority=0.0f)
 
int InvokeEvent (unsigned long event, void *callData)
 
int InvokeEvent (const char *event, void *callData)
 
unsigned long AddObserver (unsigned long event, vtkCommand *, float priority=0.0f)
 
unsigned long AddObserver (const char *event, vtkCommand *, float priority=0.0f)
 
vtkCommandGetCommand (unsigned long tag)
 
void RemoveObserver (vtkCommand *)
 
void RemoveObservers (unsigned long event, vtkCommand *)
 
void RemoveObservers (const char *event, vtkCommand *)
 
int HasObserver (unsigned long event, vtkCommand *)
 
int HasObserver (const char *event, vtkCommand *)
 
unsigned long AddObserver (unsigned long event, U observer, void(T::*callback)(), float priority=0.0f)
 
unsigned long AddObserver (unsigned long event, U observer, void(T::*callback)(vtkObject *, unsigned long, void *), float priority=0.0f)
 
unsigned long AddObserver (unsigned long event, U observer, bool(T::*callback)(vtkObject *, unsigned long, void *), float priority=0.0f)
 
int InvokeEvent (unsigned long event, void *callData)
 
int InvokeEvent (const char *event, void *callData)
 
- Public Member Functions inherited from vtkObjectBase
const char * GetClassName () const
 
virtual void Delete ()
 
virtual void FastDelete ()
 
void Print (ostream &os)
 
virtual void Register (vtkObjectBase *o)
 
virtual void UnRegister (vtkObjectBase *o)
 
void SetReferenceCount (int)
 
virtual void PrintHeader (ostream &os, vtkIndent indent)
 
virtual void PrintTrailer (ostream &os, vtkIndent indent)
 
int GetReferenceCount ()
 
void PrintRevisions (ostream &)
 
virtual void PrintHeader (ostream &os, vtkIndent indent)
 
virtual void PrintTrailer (ostream &os, vtkIndent indent)
 
int GetReferenceCount ()
 
void PrintRevisions (ostream &)
 

Static Public Member Functions

static vtkSMStateLoaderNew ()
 
static int IsTypeOf (const char *type)
 
static vtkSMStateLoaderSafeDownCast (vtkObject *o)
 
- Static Public Member Functions inherited from vtkSMDeserializerXML
static vtkSMDeserializerXMLNew ()
 
static int IsTypeOf (const char *type)
 
static vtkSMDeserializerXMLSafeDownCast (vtkObject *o)
 
- Static Public Member Functions inherited from vtkSMDeserializer
static int IsTypeOf (const char *type)
 
static vtkSMDeserializerSafeDownCast (vtkObject *o)
 
- Static Public Member Functions inherited from vtkObject
static vtkObjectNew ()
 
static void BreakOnError ()
 
static void SetGlobalWarningDisplay (int val)
 
static void GlobalWarningDisplayOn ()
 
static void GlobalWarningDisplayOff ()
 
static int GetGlobalWarningDisplay ()
 
static void SetGlobalWarningDisplay (int val)
 
static void GlobalWarningDisplayOn ()
 
static void GlobalWarningDisplayOff ()
 
static int GetGlobalWarningDisplay ()
 
- Static Public Member Functions inherited from vtkObjectBase
static vtkTypeBool IsTypeOf (const char *name)
 
static vtkObjectBaseNew ()
 
static vtkObjectBaseNew ()
 

Protected Member Functions

virtual int LoadStateInternal (vtkPVXMLElement *rootElement)
 The rootElement must be the <ServerManagerState/> xml element. More...
 
void CreatedNewProxy (vtkTypeUInt32 id, vtkSMProxy *proxy) override
 Called after a new proxy is created. More...
 
vtkSMProxyCreateProxy (const char *xmlgroup, const char *xmlname, const char *subProxyName=nullptr) override
 Overridden so that when new views are to be created, we create views suitable for the connection. More...
 
virtual int HandleProxyCollection (vtkPVXMLElement *collectionElement)
 
virtual void HandleCustomProxyDefinitions (vtkPVXMLElement *element)
 
int HandleLinks (vtkPVXMLElement *linksElement)
 
virtual int BuildProxyCollectionInformation (vtkPVXMLElement *)
 
virtual bool UpdateRegistrationInfo (std::string &group, std::string &name, vtkSMProxy *proxy)
 Update a proxy's registration group and name before it gets registered. More...
 
vtkPVXMLElementLocateProxyElement (vtkTypeUInt32 id) override
 Return the xml element for the state of the proxy with the given id. More...
 
vtkPVXMLElementLocateProxyElementInternal (vtkPVXMLElement *root, vtkTypeUInt32 id)
 Used by LocateProxyElement(). More...
 
virtual bool VerifyXMLVersion (vtkPVXMLElement *rootElement)
 Checks the root element for version. More...
 
vtkSMProxyLocateExistingProxyUsingRegistrationName (vtkTypeUInt32 id)
 Returns the first proxy already registered using any of the registration (group, name) assigned to the proxy with the given id in the state file. More...
 
virtual void RegisterProxy (vtkTypeUInt32 id, vtkSMProxy *proxy)
 This method scans through the internal data structure built during BuildProxyCollectionInformation() and registers the proxy. More...
 
virtual void RegisterProxyInternal (const char *group, const char *name, vtkSMProxy *proxy)
 This method scans through the internal data structure built during BuildProxyCollectionInformation() and registers the proxy. More...
 
- Protected Member Functions inherited from vtkSMDeserializerXML
 vtkSMDeserializerXML ()
 
 ~vtkSMDeserializerXML () override
 
vtkSMProxyNewProxy (vtkTypeUInt32 id, vtkSMProxyLocator *locator) override
 Create a new proxy with the id if possible. More...
 
virtual int LoadProxyState (vtkPVXMLElement *element, vtkSMProxy *, vtkSMProxyLocator *locator)
 TEMPORARY. More...
 
- Protected Member Functions inherited from vtkSMDeserializer
 vtkSMDeserializer ()
 
 ~vtkSMDeserializer () override
 
- Protected Member Functions inherited from vtkObject
 vtkObject ()
 
virtual ~vtkObject ()
 
void RegisterInternal (vtkObjectBase *, vtkTypeBool check) VTK_OVERRIDE
 
void UnRegisterInternal (vtkObjectBase *, vtkTypeBool check) VTK_OVERRIDE
 
void InternalGrabFocus (vtkCommand *mouseEvents, vtkCommand *keypressEvents=NULL)
 
void InternalReleaseFocus ()
 
void InternalGrabFocus (vtkCommand *mouseEvents, vtkCommand *keypressEvents=NULL)
 
void InternalReleaseFocus ()
 
- Protected Member Functions inherited from vtkObjectBase
 vtkObjectBase ()
 
virtual ~vtkObjectBase ()
 
virtual void CollectRevisions (ostream &)
 
virtual void ReportReferences (vtkGarbageCollector *)
 
 vtkObjectBase (const vtkObjectBase &)
 
void operator= (const vtkObjectBase &)
 

Protected Attributes

vtkPVXMLElementServerManagerStateElement
 
vtkSMProxyLocatorProxyLocator
 
int KeepIdMapping
 
- Protected Attributes inherited from vtkSMDeserializer
vtkWeakPointer< vtkSMSessionProxyManagerSessionProxyManager
 
- Protected Attributes inherited from vtkObject
bool Debug
 
vtkTimeStamp MTime
 
vtkSubjectHelper * SubjectHelper
 
- Protected Attributes inherited from vtkObjectBase
vtkAtomicInt32 ReferenceCount
 
vtkWeakPointerBase ** WeakPointers
 
vtkTypeUInt32 * GetMappingArray (int &size)
 Return an array of ids. More...
 
 vtkSMStateLoader ()
 Return an array of ids. More...
 
 ~vtkSMStateLoader () override
 Return an array of ids. More...
 

Detailed Description

Utility class to load state from XML.

vtkSMStateLoader can load server manager state from a given vtkPVXMLElement. This element is usually populated by a vtkPVXMLParser.

See also
vtkPVXMLParser vtkPVXMLElement

Definition at line 28 of file vtkSMStateLoader.h.

Member Typedef Documentation

◆ Superclass

Definition at line 32 of file vtkSMStateLoader.h.

Constructor & Destructor Documentation

◆ vtkSMStateLoader()

vtkSMStateLoader::vtkSMStateLoader ( )
protected

Return an array of ids.

The ids are stored in the following order and the size of the array is provided as argument. [key, value, key, value, ...] The array is kept internally using a std::vector

◆ ~vtkSMStateLoader()

vtkSMStateLoader::~vtkSMStateLoader ( )
overrideprotected

Return an array of ids.

The ids are stored in the following order and the size of the array is provided as argument. [key, value, key, value, ...] The array is kept internally using a std::vector

Member Function Documentation

◆ New()

static vtkSMStateLoader* vtkSMStateLoader::New ( )
static

◆ GetClassName()

virtual const char* vtkSMStateLoader::GetClassName ( )
virtual

Reimplemented from vtkSMDeserializerXML.

Reimplemented in vtkSMInsituStateLoader.

◆ IsTypeOf()

static int vtkSMStateLoader::IsTypeOf ( const char *  type)
static

◆ IsA()

virtual int vtkSMStateLoader::IsA ( const char *  type)
virtual

Reimplemented from vtkSMDeserializerXML.

Reimplemented in vtkSMInsituStateLoader.

◆ SafeDownCast()

static vtkSMStateLoader* vtkSMStateLoader::SafeDownCast ( vtkObject o)
static

◆ PrintSelf()

void vtkSMStateLoader::PrintSelf ( ostream &  os,
vtkIndent  indent 
)
overridevirtual

Reimplemented from vtkSMDeserializerXML.

◆ LoadState()

int vtkSMStateLoader::LoadState ( vtkPVXMLElement rootElement,
bool  keepOriginalId = false 
)

Load the state from the given root element.

◆ SetProxyLocator()

void vtkSMStateLoader::SetProxyLocator ( vtkSMProxyLocator loc)

Get/Set the proxy locator to use.

Default is vtkSMProxyLocator will be used.

◆ GetProxyLocator()

virtual vtkSMProxyLocator* vtkSMStateLoader::GetProxyLocator ( )
virtual

Get/Set the proxy locator to use.

Default is vtkSMProxyLocator will be used.

◆ SetKeepIdMapping()

virtual void vtkSMStateLoader::SetKeepIdMapping ( int  )
virtual

Allow the loader to keep the mapping between the id from the loaded state to the current proxy attributed id.

◆ GetKeepIdMapping()

virtual int vtkSMStateLoader::GetKeepIdMapping ( )
virtual

Allow the loader to keep the mapping between the id from the loaded state to the current proxy attributed id.

◆ KeepIdMappingOn()

virtual void vtkSMStateLoader::KeepIdMappingOn ( )
virtual

Allow the loader to keep the mapping between the id from the loaded state to the current proxy attributed id.

◆ KeepIdMappingOff()

virtual void vtkSMStateLoader::KeepIdMappingOff ( )
virtual

Allow the loader to keep the mapping between the id from the loaded state to the current proxy attributed id.

◆ GetMappingArray()

vtkTypeUInt32* vtkSMStateLoader::GetMappingArray ( int size)

Return an array of ids.

The ids are stored in the following order and the size of the array is provided as argument. [key, value, key, value, ...] The array is kept internally using a std::vector

◆ LoadStateInternal()

virtual int vtkSMStateLoader::LoadStateInternal ( vtkPVXMLElement rootElement)
protectedvirtual

The rootElement must be the <ServerManagerState/> xml element.

If rootElement is not a <ServerManagerState/> element, then we try to locate the first <ServerManagerState/> nested element and load that. Load the state from the given root element.

◆ CreatedNewProxy()

void vtkSMStateLoader::CreatedNewProxy ( vtkTypeUInt32  id,
vtkSMProxy proxy 
)
overrideprotectedvirtual

Called after a new proxy is created.

The main responsibility of this method is to ensure that proxy gets a GlobalId (either automatically or using the id from the state if LoadState() was called with keepOriginalId set to true). It also called vtkSMProxy::UpdateVTKObjects() and vtkSMProxy::UpdatePipelineInformation() (if applicable) to ensure that the state loaded on the proxy is "pushed" and any info properties updated. We also create a list to track the order in which proxies are created. This order is a dependency order too and hence helps us register proxies in order of dependencies.

Reimplemented from vtkSMDeserializerXML.

◆ CreateProxy()

vtkSMProxy* vtkSMStateLoader::CreateProxy ( const char *  xmlgroup,
const char *  xmlname,
const char *  subProxyName = nullptr 
)
overrideprotectedvirtual

Overridden so that when new views are to be created, we create views suitable for the connection.

Reimplemented from vtkSMDeserializerXML.

◆ HandleProxyCollection()

virtual int vtkSMStateLoader::HandleProxyCollection ( vtkPVXMLElement collectionElement)
protectedvirtual

◆ HandleCustomProxyDefinitions()

virtual void vtkSMStateLoader::HandleCustomProxyDefinitions ( vtkPVXMLElement element)
protectedvirtual

◆ HandleLinks()

int vtkSMStateLoader::HandleLinks ( vtkPVXMLElement linksElement)
protected

◆ BuildProxyCollectionInformation()

virtual int vtkSMStateLoader::BuildProxyCollectionInformation ( vtkPVXMLElement )
protectedvirtual

◆ RegisterProxy()

virtual void vtkSMStateLoader::RegisterProxy ( vtkTypeUInt32  id,
vtkSMProxy proxy 
)
protectedvirtual

This method scans through the internal data structure built during BuildProxyCollectionInformation() and registers the proxy.

The DS keeps info about each proxy ID and the groups and names the proxy should be registered as (as indicated in the state file).

◆ RegisterProxyInternal()

virtual void vtkSMStateLoader::RegisterProxyInternal ( const char *  group,
const char *  name,
vtkSMProxy proxy 
)
protectedvirtual

This method scans through the internal data structure built during BuildProxyCollectionInformation() and registers the proxy.

The DS keeps info about each proxy ID and the groups and names the proxy should be registered as (as indicated in the state file).

◆ UpdateRegistrationInfo()

virtual bool vtkSMStateLoader::UpdateRegistrationInfo ( std::string group,
std::string name,
vtkSMProxy proxy 
)
protectedvirtual

Update a proxy's registration group and name before it gets registered.

Default implementation handles helper group group names. Returns false to skip registering the proxy.

Parameters
[in,out]groupproxy registration group
[in,out]nameproxy registration name
[in]proxyproxy being registered
Returns
true to continue registering the proxy, false to skip registering it.

◆ LocateProxyElement()

vtkPVXMLElement* vtkSMStateLoader::LocateProxyElement ( vtkTypeUInt32  id)
overrideprotectedvirtual

Return the xml element for the state of the proxy with the given id.

This is used by NewProxy() when the proxy with the given id is not located in the internal CreatedProxies map.

Reimplemented from vtkSMDeserializerXML.

◆ LocateProxyElementInternal()

vtkPVXMLElement* vtkSMStateLoader::LocateProxyElementInternal ( vtkPVXMLElement root,
vtkTypeUInt32  id 
)
protected

Used by LocateProxyElement().

Recursively tries to locate the proxy state element for the proxy.

◆ VerifyXMLVersion()

virtual bool vtkSMStateLoader::VerifyXMLVersion ( vtkPVXMLElement rootElement)
protectedvirtual

Checks the root element for version.

If failed, return false.

◆ LocateExistingProxyUsingRegistrationName()

vtkSMProxy* vtkSMStateLoader::LocateExistingProxyUsingRegistrationName ( vtkTypeUInt32  id)
protected

Returns the first proxy already registered using any of the registration (group, name) assigned to the proxy with the given id in the state file.

Member Data Documentation

◆ ServerManagerStateElement

vtkPVXMLElement* vtkSMStateLoader::ServerManagerStateElement
protected

Definition at line 153 of file vtkSMStateLoader.h.

◆ ProxyLocator

vtkSMProxyLocator* vtkSMStateLoader::ProxyLocator
protected

Definition at line 154 of file vtkSMStateLoader.h.

◆ KeepIdMapping

int vtkSMStateLoader::KeepIdMapping
protected

Definition at line 155 of file vtkSMStateLoader.h.


The documentation for this class was generated from the following file: