object responsible for managing XML proxies definitions More...
#include <vtkSIProxyDefinitionManager.h>
Classes | |
struct | RegisteredDefinitionInformation |
Information object used in Event notification. More... | |
Public Types | |
enum | Events { ProxyDefinitionsUpdated = 2000, CompoundProxyDefinitionsUpdated = 2001 } |
enum | { ALL_DEFINITIONS = 0, CORE_DEFINITIONS = 1, CUSTOM_DEFINITIONS = 2 } |
Return a new configured iterator for traversing a set of proxy definition for all the available groups. More... | |
typedef vtkSIObject | Superclass |
Public Types inherited from vtkSIObject | |
typedef vtkObject | Superclass |
Public Member Functions | |
virtual const char * | GetClassName () |
virtual int | IsA (const char *type) |
void | PrintSelf (ostream &os, vtkIndent indent) override |
bool | HasDefinition (const char *groupName, const char *proxyName) |
Return true if the XML Definition was found. More... | |
void | RemoveCustomProxyDefinition (const char *group, const char *name) |
Given its name, remove a custom proxy definition. More... | |
void | ClearCustomProxyDefinitions () |
Remove all registered custom proxy definitions. More... | |
void | SaveCustomProxyDefinitions (vtkPVXMLElement *root) |
Save registered custom proxy definitions. More... | |
VTK_NEWINSTANCE vtkPVProxyDefinitionIterator * | NewIterator (int scope=ALL_DEFINITIONS) |
Return a NEW instance of vtkPVProxyDefinitionIterator configured to get through all the definition available for the requested scope. More... | |
vtkPVProxyDefinitionIterator * | NewSingleGroupIterator (const char *groupName, int scope=ALL_DEFINITIONS) |
Return a new configured iterator for traversing a set of proxy definition for only one GroupName. More... | |
void | EnableXMLProxyDefnitionUpdate (bool) |
Deactivate the modification of the ProxyDefinitions for that given vtkSIProxyDefinitionManager to make sure update only come from the remote server and not plugin loaded on the client. More... | |
void | Push (vtkSMMessage *msg) override |
Push a new state to the underneath implementation The provided implementation just store the message and return it at the Pull one. More... | |
void | Pull (vtkSMMessage *msg) override |
Pull the current state of the underneath implementation The provided implementation update the given message with the one that has been previously pushed. More... | |
vtkPVXMLElement * | GetProxyDefinition (const char *group, const char *name, bool throwError) |
Returns a registered proxy definition or return a nullptr otherwise. More... | |
vtkPVXMLElement * | GetProxyDefinition (const char *group, const char *name) |
Returns a registered proxy definition or return a nullptr otherwise. More... | |
vtkPVXMLElement * | GetCollapsedProxyDefinition (const char *group, const char *name, const char *subProxyName, bool throwError) |
Returns the same thing as GetProxyDefinition in a flatten manner. More... | |
vtkPVXMLElement * | GetCollapsedProxyDefinition (const char *group, const char *name, const char *subProxyName) |
Returns the same thing as GetProxyDefinition in a flatten manner. More... | |
void | AddCustomProxyDefinition (const char *group, const char *name, vtkPVXMLElement *top) |
Add a custom proxy definition. More... | |
void | AddCustomProxyDefinition (const char *groupName, const char *proxyName, const char *xmlcontents) |
Add a custom proxy definition. More... | |
void | LoadCustomProxyDefinitions (vtkPVXMLElement *root) |
Load custom proxy definitions and register them. More... | |
void | LoadCustomProxyDefinitionsFromString (const char *xmlContent) |
Load custom proxy definitions and register them. More... | |
bool | LoadConfigurationXML (vtkPVXMLElement *root) |
Loads server-manager configuration xml. More... | |
bool | LoadConfigurationXMLFromString (const char *xmlContent) |
Loads server-manager configuration xml. More... | |
Public Member Functions inherited from vtkSIObject | |
virtual void | AboutToDelete () |
This method is called before the deletion of the SIObject. More... | |
virtual void | Initialize (vtkPVSessionCore *session) |
Initializes the instance. More... | |
vtkClientServerInterpreter * | GetInterpreter () |
Provides access to the Interpreter. More... | |
vtkSIObject * | GetSIObject (vtkTypeUInt32 globalid) const |
Convenience method to obtain a vtkSIObject subclass given its global id. More... | |
vtkObject * | GetRemoteObject (vtkTypeUInt32 globalid) |
Convenience method to obtain a vtkObject subclass given its global id. More... | |
virtual void | SetGlobalID (vtkTypeUInt32) |
Get/Set the global id for this object. More... | |
virtual vtkTypeUInt32 | GetGlobalID () |
Get/Set the global id for this object. 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) |
vtkCommand * | GetCommand (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) |
vtkCommand * | GetCommand (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 vtkSIProxyDefinitionManager * | New () |
static int | IsTypeOf (const char *type) |
static vtkSIProxyDefinitionManager * | SafeDownCast (vtkObject *o) |
static vtkTypeUInt32 | GetReservedGlobalID () |
Returns the ID reserved for the proxy definition manager. More... | |
static void | PatchXMLProperty (vtkPVXMLElement *propElement) |
For now we dynamically convert InformationHelper into the correct si_class and attribute sets. More... | |
Static Public Member Functions inherited from vtkSIObject | |
static vtkSIObject * | New () |
static int | IsTypeOf (const char *type) |
static vtkSIObject * | SafeDownCast (vtkObject *o) |
Static Public Member Functions inherited from vtkObject | |
static vtkObject * | New () |
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 vtkObjectBase * | New () |
static vtkObjectBase * | New () |
Protected Member Functions | |
vtkSIProxyDefinitionManager () | |
~vtkSIProxyDefinitionManager () override | |
void | AttachEnsurePluginLoadedToProxies (vtkPVXMLElement *proxy, const std::string &ensurePluginLoaded) |
Helper method that add a EnsurePluginLoaded XML element with name ensurePluginLoaded for a provided proxy definition. More... | |
void | AttachShowInMenuHintsToProxy (vtkPVXMLElement *proxy) |
Helper method that add a ShowInMenu Hint for a proxy definition. More... | |
void | AttachShowInMenuHintsToProxyFromProxyGroups (vtkPVXMLElement *root) |
Helper method that add a ShowInMenu Hint for any proxy definition that lie in a sources or filters group. More... | |
void | AddElement (const char *groupName, const char *proxyName, vtkPVXMLElement *element) |
Called by the XML parser to add an element from which a proxy can be created. More... | |
bool | AddCustomProxyDefinitionInternal (const char *group, const char *name, vtkPVXMLElement *top) |
Implementation for add custom proxy definition. More... | |
void | MergeProxyDefinition (vtkPVXMLElement *element, vtkPVXMLElement *elementToFill) |
Integrate a ProxyDefinition into another ProxyDefinition by merging them. More... | |
void | InvalidateCollapsedDefinition () |
Method used to clear the Flatten version of the definition. More... | |
vtkPVXMLElement * | GetProxyElement (const char *groupName, const char *proxyName) |
Given the proxy name and group name, returns the XML element for the proxy. More... | |
vtkPVXMLElement * | ExtractSubProxy (vtkPVXMLElement *proxyDefinition, const char *subProxyName) |
Convenient method used to extract sub-proxy definition inside a proxy definition. More... | |
void | InvokeCustomDefitionsUpdated () |
Called when custom definitions are updated. More... | |
bool | LoadConfigurationXML (vtkPVXMLElement *root, bool attachShowInMenuHints, bool invoke=true, const std::string &ensurePluginLoaded="") |
Loads server-manager configuration xml. More... | |
bool | LoadConfigurationXMLFromString (const char *xmlContent, bool attachShowInMenuHints, bool invoke=true, const std::string &ensurePluginLoaded="") |
Loads server-manager configuration xml. More... | |
void | OnPluginLoaded (vtkObject *caller, unsigned long event, void *calldata) |
Callback called when a plugin is loaded. More... | |
void | HandlePlugin (vtkPVPlugin *) |
Callback called when a plugin is loaded. More... | |
Protected Member Functions inherited from vtkSIObject | |
vtkSIObject () | |
~vtkSIObject () 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 &) |
Additional Inherited Members | |
Protected Attributes inherited from vtkSIObject | |
vtkWeakPointer< vtkClientServerInterpreter > | Interpreter |
vtkWeakPointer< vtkPVSessionCore > | SessionCore |
vtkSMMessage * | LastPushedMessage |
vtkTypeUInt32 | GlobalID |
Protected Attributes inherited from vtkObject | |
bool | Debug |
vtkTimeStamp | MTime |
vtkSubjectHelper * | SubjectHelper |
Protected Attributes inherited from vtkObjectBase | |
vtkAtomicInt32 | ReferenceCount |
vtkWeakPointerBase ** | WeakPointers |
object responsible for managing XML proxies definitions
vtkSIProxyDefinitionManager is a class that manages XML proxies definition. It maintains a map of vtkPVXMLElement (populated by the XML parser) from which it can extract Hint, Documentation, Properties, Domains definition.
This class fires the following events:
vtkSIProxyDefinitionManager::ProxyDefinitionsUpdated
- Fired any time any definitions are updated. If a group of definitions are being updated (i.e. a new definition is registered, or unregistered, or modified) then this event gets fired after all of them are updated. vtkSIProxyDefinitionManager::CompoundProxyDefinitionsUpdated
- Fired when a custom proxy definition is updated. Similar to ProxyDefinitionsUpdated this is fired after collective updates, if applicable. Note whenever CompoundProxyDefinitionsUpdated is fired, ProxyDefinitionsUpdated is also fired. vtkCommand::RegisterEvent
- Fired when a new proxy definition is registered or an old one modified (through extensions). This is fired for regular proxies as well as custom proxy definitions. vtkCommand::UnRegisterEvent
- Fired when a proxy definition is removed. Since this class only support removing custom proxies, this event is fired only when a custom proxy is removed. Definition at line 40 of file vtkSIProxyDefinitionManager.h.
Definition at line 44 of file vtkSIProxyDefinitionManager.h.
Enumerator | |
---|---|
ProxyDefinitionsUpdated | |
CompoundProxyDefinitionsUpdated |
Definition at line 148 of file vtkSIProxyDefinitionManager.h.
anonymous enum |
Return a new configured iterator for traversing a set of proxy definition for all the available groups.
Scope values: 0 : ALL (default in case) 1 : CORE_DEFINITIONS 2 : CUSTOM_DEFINITIONS
Enumerator | |
---|---|
ALL_DEFINITIONS | |
CORE_DEFINITIONS | |
CUSTOM_DEFINITIONS |
Definition at line 163 of file vtkSIProxyDefinitionManager.h.
|
protected |
|
overrideprotected |
|
static |
|
virtual |
Reimplemented from vtkSIObject.
Reimplemented from vtkSIObject.
|
static |
|
overridevirtual |
Reimplemented from vtkSIObject.
|
static |
Returns the ID reserved for the proxy definition manager.
|
static |
For now we dynamically convert InformationHelper into the correct si_class and attribute sets.
THIS CODE SHOULD BE REMOVED once InformationHelper have been removed from legacy XML
vtkPVXMLElement* vtkSIProxyDefinitionManager::GetProxyDefinition | ( | const char * | group, |
const char * | name, | ||
bool | throwError | ||
) |
Returns a registered proxy definition or return a nullptr otherwise.
Moreover, error can be throw if the definition was not found if the flag throwError is true.
|
inline |
Returns a registered proxy definition or return a nullptr otherwise.
Moreover, error can be throw if the definition was not found if the flag throwError is true.
Definition at line 67 of file vtkSIProxyDefinitionManager.h.
Return true if the XML Definition was found.
vtkPVXMLElement* vtkSIProxyDefinitionManager::GetCollapsedProxyDefinition | ( | const char * | group, |
const char * | name, | ||
const char * | subProxyName, | ||
bool | throwError | ||
) |
Returns the same thing as GetProxyDefinition in a flatten manner.
By flatten, we mean that the class hierarchy has been walked and merged into a single vtkPVXMLElement definition.
|
inline |
Returns the same thing as GetProxyDefinition in a flatten manner.
By flatten, we mean that the class hierarchy has been walked and merged into a single vtkPVXMLElement definition.
Definition at line 87 of file vtkSIProxyDefinitionManager.h.
void vtkSIProxyDefinitionManager::AddCustomProxyDefinition | ( | const char * | group, |
const char * | name, | ||
vtkPVXMLElement * | top | ||
) |
Add a custom proxy definition.
Custom definitions are NOT ALLOWED to overrive or overlap any ProxyDefinition that has been defined by parsing server manager proxy configuration files. This can be a compound proxy definition (look at vtkSMCompoundSourceProxy.h) or a regular proxy definition. For all practical purposes, there's no difference between a proxy definition added using this method or by parsing a server manager configuration file.
void vtkSIProxyDefinitionManager::AddCustomProxyDefinition | ( | const char * | groupName, |
const char * | proxyName, | ||
const char * | xmlcontents | ||
) |
Add a custom proxy definition.
Custom definitions are NOT ALLOWED to overrive or overlap any ProxyDefinition that has been defined by parsing server manager proxy configuration files. This can be a compound proxy definition (look at vtkSMCompoundSourceProxy.h) or a regular proxy definition. For all practical purposes, there's no difference between a proxy definition added using this method or by parsing a server manager configuration file.
void vtkSIProxyDefinitionManager::RemoveCustomProxyDefinition | ( | const char * | group, |
const char * | name | ||
) |
Given its name, remove a custom proxy definition.
Note that this can only be used to remove definitions added using AddCustomProxyDefinition(), cannot be used to remove definitions loaded using vtkSMXMLParser.
void vtkSIProxyDefinitionManager::ClearCustomProxyDefinitions | ( | ) |
Remove all registered custom proxy definitions.
Note that this can only be used to remove definitions added using AddCustomProxyDefinition(), cannot be used to remove definitions loaded using vtkSMXMLParser.
void vtkSIProxyDefinitionManager::LoadCustomProxyDefinitions | ( | vtkPVXMLElement * | root | ) |
Load custom proxy definitions and register them.
void vtkSIProxyDefinitionManager::LoadCustomProxyDefinitionsFromString | ( | const char * | xmlContent | ) |
Load custom proxy definitions and register them.
void vtkSIProxyDefinitionManager::SaveCustomProxyDefinitions | ( | vtkPVXMLElement * | root | ) |
Save registered custom proxy definitions.
The caller must release the reference to the returned vtkPVXMLElement.
bool vtkSIProxyDefinitionManager::LoadConfigurationXML | ( | vtkPVXMLElement * | root | ) |
Loads server-manager configuration xml.
bool vtkSIProxyDefinitionManager::LoadConfigurationXMLFromString | ( | const char * | xmlContent | ) |
Loads server-manager configuration xml.
VTK_NEWINSTANCE vtkPVProxyDefinitionIterator* vtkSIProxyDefinitionManager::NewIterator | ( | int | scope = ALL_DEFINITIONS | ) |
Return a NEW instance of vtkPVProxyDefinitionIterator configured to get through all the definition available for the requested scope.
Possible scope defined as enum inside vtkSIProxyDefinitionManager: ALL_DEFINITIONS=0 / CORE_DEFINITIONS=1 / CUSTOM_DEFINITIONS=2 Some extra restriction can be set directly on the iterator itself by setting a set of GroupName...
vtkPVProxyDefinitionIterator* vtkSIProxyDefinitionManager::NewSingleGroupIterator | ( | const char * | groupName, |
int | scope = ALL_DEFINITIONS |
||
) |
Return a new configured iterator for traversing a set of proxy definition for only one GroupName.
Possible scope defined as enum inside vtkSIProxyDefinitionManager: ALL_DEFINITIONS=0 / CORE_DEFINITIONS=1 / CUSTOM_DEFINITIONS=2
void vtkSIProxyDefinitionManager::EnableXMLProxyDefnitionUpdate | ( | bool | ) |
Deactivate the modification of the ProxyDefinitions for that given vtkSIProxyDefinitionManager to make sure update only come from the remote server and not plugin loaded on the client.
|
overridevirtual |
Push a new state to the underneath implementation The provided implementation just store the message and return it at the Pull one.
Reimplemented from vtkSIObject.
|
overridevirtual |
Pull the current state of the underneath implementation The provided implementation update the given message with the one that has been previously pushed.
Reimplemented from vtkSIObject.
|
protected |
Helper method that add a EnsurePluginLoaded XML element with name ensurePluginLoaded for a provided proxy definition.
|
protected |
Helper method that add a ShowInMenu Hint for a proxy definition.
This allow that given proxy to show up inside the Sources/Filters menu inside the UI.
|
protected |
Helper method that add a ShowInMenu Hint for any proxy definition that lie in a sources or filters group.
|
protected |
Loads server-manager configuration xml.
Those method are protected as they allow to automatically add some extra hints for those loaded definition set. This is essentially used when proxy get loaded as legacy proxy don't have those expected Hints. If invoke is true, these method will invoke ProxyDefinitionsUpdated
at the end. FIXME: Once those pluging get updated, this extra hint attachment might be removed. Set ensurePluginLoaded to a non empty string to add the EnsurePluginLoaded XML tag to each proxy
|
protected |
Loads server-manager configuration xml.
Those method are protected as they allow to automatically add some extra hints for those loaded definition set. This is essentially used when proxy get loaded as legacy proxy don't have those expected Hints. If invoke is true, these method will invoke ProxyDefinitionsUpdated
at the end. FIXME: Once those pluging get updated, this extra hint attachment might be removed. Set ensurePluginLoaded to a non empty string to add the EnsurePluginLoaded XML tag to each proxy
|
protected |
Callback called when a plugin is loaded.
|
protected |
Callback called when a plugin is loaded.
|
protected |
Called by the XML parser to add an element from which a proxy can be created.
Called during parsing.
|
protected |
Implementation for add custom proxy definition.
|
protected |
Integrate a ProxyDefinition into another ProxyDefinition by merging them.
If properties are overridden is the last property that will last. So when we build a merged definition hierarchy, we should start from the root and go down.
|
protected |
Method used to clear the Flatten version of the definition.
This will force its recomputation when needed. This should be called each time new definition get added. (Not the Custom one since those should NOT conflict with the core definitions.)
|
protected |
Given the proxy name and group name, returns the XML element for the proxy.
|
protected |
Convenient method used to extract sub-proxy definition inside a proxy definition.
If (subProxyName == nullptr) return proxyDefinition;
|
protected |
Called when custom definitions are updated.
Fires appropriate events.