VAPOR3 3.9.4
|
A singleton class for managing Params instances. More...
#include <ParamsMgr.h>
Public Member Functions | |
ParamsMgr (std::vector< string > appParamNames=std::vector< string >(), std::vector< string > appRenderParamNames=std::vector< string >()) | |
virtual | ~ParamsMgr () |
virtual void | LoadState () |
virtual void | LoadState (const XmlNode *node) |
virtual int | LoadState (string stateFile) |
void | AddDataMgr (string dataSetName, DataMgr *dataMgr) |
void | RemoveVisualizer (string winName) |
void | RemoveDataMgr (string dataSetName) |
vector< string > | GetDataMgrNames () const |
ViewpointParams * | CreateVisualizerParamsInstance (string winName) |
void | RemoveVisualizerParamsInstance (string winName) |
RenderParams * | CreateRenderParamsInstance (string winName, string dataSetName, string classType, string instName) |
RenderParams * | CreateRenderParamsInstance (string winName, string dataSetName, string instName, const RenderParams *rp) |
void | RemoveRenderParamsInstance (string winName, string dataSetName, string classType, string instName) |
RenderParams * | GetRenderParams (string winName, string dataSetName, string classType, string instName) const |
void | GetRenderParams (string winName, string dataSetName, vector< RenderParams * > &rParams) const |
void | GetRenderParams (string winName, vector< RenderParams * > &rParams) const |
void | GetRenderParams (vector< RenderParams * > &rParams) const |
void | GetRenderParamNames (string winName, string dataSetName, string classType, vector< string > &instNames) const |
void | GetRenderParamNames (string winName, string dataSetName, vector< string > &instNames) const |
void | GetRenderParamNames (string winName, vector< string > &instNames) const |
void | GetRenderParamNames (vector< string > &instNames) const |
bool | RenderParamsLookup (string instName, string &winName, string &dataSetName, string &className) const |
vector< string > | GetVisualizerNames () const |
vector< string > | GetRenderParamsClassNames (string winName) const |
vector< string > | GetRenderParamsClassNames (string winName, string dataSetName) const |
vector< string > | GetRenderParamInstances (string winName, string dataSetName, string classType) const |
vector< string > | GetRenderParamInstances (string winName, string classType) const |
ViewpointParams * | GetViewpointParams (string winName) const |
RegionParams * | GetRegionParams (string winName) const |
AnnotationParams * | GetAnnotationParams (string winName) const |
DatasetsParams * | GetDatasetsParams () const |
ParamsBase * | GetParams (string classType) |
RenderParams * | GetAppRenderParams (string dataSetName, string classType) |
void | GetAppRenderParams (string dataSetName, vector< RenderParams * > &appRenderParams) const |
int | SaveToFile (string path) const |
void | BeginSaveStateGroup (string description) |
void | EndSaveStateGroup () |
void | IntermediateChange () |
void | SetSaveStateEnabled (bool enabled) |
bool | GetSaveStateEnabled () const |
void | SetSaveStateUndoEnabled (bool enabled) |
bool | GetSaveStateUndoEnabled () const |
Get whether updating the undo list is enabled. | |
bool | Undo () |
bool | Redo () |
void | UndoRedoClear () |
string | GetTopUndoDesc () const |
Return description string for event at top of undo stack. | |
string | GetTopRedoDesc () const |
Return description string for event at top of redo stack. | |
size_t | UndoSize () const |
size_t | RedoSize () const |
void | RegisterStateChangeFlag (bool *flag) |
void | RegisterStateChangeCB (std::function< void()> callback) |
void | RegisterIntermediateStateChangeCB (std::function< void()> callback) |
void | RebaseStateSave () |
const XmlNode * | GetXMLRoot () const |
bool | StateChanged () |
Public Member Functions inherited from Wasp::MyBase | |
MyBase () | |
const string & | getClassName () const |
Static Public Member Functions | |
static vector< string > | GetRenderParamsClassNamesAvail () |
Static Public Member Functions inherited from Wasp::MyBase | |
static void | SetErrMsg (const char *format,...) |
Record a formatted error message. | |
static void | SetErrMsg (int errcode, const char *format,...) |
Record a formatted error message and an error code. | |
static const char * | GetErrMsg () |
static void | SetErrCode (int err_code) |
Record an error code. | |
static int | GetErrCode () |
Retrieve the current error code. | |
static void | SetErrMsgCB (ErrMsgCB_T cb) |
static ErrMsgCB_T | GetErrMsgCB () |
static void | SetErrMsgFilePtr (FILE *fp) |
static const FILE * | SetErrMsgFilePtr () |
static void | SetDiagMsg (const char *format,...) |
Record a formatted diagnostic message. | |
static const char * | GetDiagMsg () |
static void | SetDiagMsgCB (DiagMsgCB_T cb) |
static DiagMsgCB_T | GetDiagMsgCB () |
static void | SetDiagMsgFilePtr (FILE *fp) |
static bool | EnableErrMsg (bool enable) |
static bool | GetEnableErrMsg () |
Additional Inherited Members | |
Public Types inherited from Wasp::MyBase | |
typedef void(* | ErrMsgCB_T) (const char *msg, int err_code) |
typedef void(* | DiagMsgCB_T) (const char *msg) |
Static Public Attributes inherited from Wasp::MyBase | |
static char * | ErrMsg |
static int | ErrCode |
static int | ErrMsgSize |
static FILE * | ErrMsgFilePtr |
static ErrMsgCB_T | ErrMsgCB |
static char * | DiagMsg |
static int | DiagMsgSize |
static FILE * | DiagMsgFilePtr |
static DiagMsgCB_T | DiagMsgCB |
static bool | Enabled |
Protected Member Functions inherited from Wasp::MyBase | |
void | SetClassName (const string &name) |
A singleton class for managing Params instances.
Definition at line 53 of file ParamsMgr.h.
VAPoR::ParamsMgr::ParamsMgr | ( | std::vector< string > | appParamNames = std::vector< string >() , |
std::vector< string > | appRenderParamNames = std::vector< string >() |
||
) |
ParamsMgr constructor
[in] | appParamsNames | A vector of unique ParamsBase class names previously registered with ParamsRegistrar(). The ParamsMgr will construct these application-defined classes as needed. If any of the class names in appParamsNames were not previously registered via ParamsRegistrar() they will be ignored. |
[in] | appRenderParamsNames | A vector of unique RenderParams class names previously registered with RenParamsRegistrar(). The ParamsMgr will construct these application-defined render params classes as needed. If any of the class names in appRenderParamsNames were not previously registered via RenParamsRegistrar() they will be ignored. |
|
virtual |
Destroy object
void VAPoR::ParamsMgr::AddDataMgr | ( | string | dataSetName, |
DataMgr * | dataMgr | ||
) |
|
inline |
Begin state save group
Changes in state can be undone (redone) one at a time using Undo() and Redo(), or can be grouped to together into a collection. This method announces the start of such a collection group. The group will be completed when EndSaveStateGroup() is called. When a subsequent call to Undo() or Redo() is made all of the state changes made within the group are undone (redone) at once. Groups may be nested, in which case the outermost group prevails.
[in] | description | A descriptive name for the group |
Definition at line 434 of file ParamsMgr.h.
RenderParams * VAPoR::ParamsMgr::CreateRenderParamsInstance | ( | string | winName, |
string | dataSetName, | ||
string | classType, | ||
string | instName | ||
) |
Create a new rendering params instances
This method will create a new instance of an object derived from the RenderParams class. The object will be created with the RenParamsFactory and its type must have been registered with RenParamsRegistrar. The new RenderParams instance will be associated with the window named by winName
.
[in] | winName | Window name to associate the new RenderParams object with. |
[in] | classType | Class name used to register the derived RenderParams object with. |
[in] | instName | Name to associate with the new object. |
ptr | Returns a pointer to the newly created object on success, and NULL on failure. This method will fail if the data set dataSetName was not previously bound with AddDataMgr() exist, or if classType does not refer to a valid RenderParams derived class. |
RenderParams * VAPoR::ParamsMgr::CreateRenderParamsInstance | ( | string | winName, |
string | dataSetName, | ||
string | instName, | ||
const RenderParams * | rp | ||
) |
Create a render params instance from an existing one
Copies the RenderParams instance rp
into the hierarchy and associates it with the visualizer winName
and gives it the name instName
. If a RenderParams instance is already associated with winName
and instName
the existing RenderParams instance is destroyed.
[in] | winName | Window name to associate the new RenderParams object with. |
[in] | instName | Name to associate with the new object. |
[in] | rp | Pointer to a valid RenderParams instance to insert |
pointer | Pointer to the newly created RenderParams instance |
ViewpointParams * VAPoR::ParamsMgr::CreateVisualizerParamsInstance | ( | string | winName | ) |
Create a new ViewpointParams instances
This method will create a new ViewpointParams instance
[in] | winName | Window name to associate the new RenderParams object with. |
ptr | Returns a pointer to the newly created object on success, and NULL on failure. |
|
inline |
|
inline |
Obtain the AnnotationParams that are applicable in a particular Visualizer window.
Return the AnnotationParams instance associated with the window named by winName
in the current session state
ptr | AnnotationParams instance that is applicable. |
Definition at line 351 of file ParamsMgr.h.
|
inline |
Optain any render paramers registered by the application
This method returns params that have been registered on the ParamsMgr via RegisterAppParams() for the data set named by dataSetName
;
[in] | dataSetName | |
[in] | classType |
params | Pointer to requested params on success, or NULL on failure. Fails if classType was not registred with the constructor or RenParamsRegistrar |
Definition at line 389 of file ParamsMgr.h.
void VAPoR::ParamsMgr::GetAppRenderParams | ( | string | dataSetName, |
vector< RenderParams * > & | appRenderParams | ||
) | const |
Optain any render paramers registered by the application for a given data set
This method returns params that have been registered on the ParamsMgr via RegisterAppParams() for the data set named by dataSetName
;
[in] | dataSetName | |
[out] | appRenderParams | a vector of application render params associated with dataSetName |
vector< string > VAPoR::ParamsMgr::GetDataMgrNames | ( | ) | const |
Return list of all DataMgr names
Return a list of all DataMgr names bound with AddDataMgr()
|
inline |
Obtain the DatasetsParams that are applicable in a particular Visualizer window.
ptr | DatasetsParams instance that is applicable. |
Definition at line 358 of file ParamsMgr.h.
|
inline |
Optain any paramers registered by the application
This method returns params that have been registered on the ParamsMgr via the constructor
params | Pointer to requested params on success, or NULL on failure. Fails if classType was not registred with the constructor or ParamsRegistrar |
Definition at line 371 of file ParamsMgr.h.
Referenced by EventRouter::GetAnimationParams(), EventRouter::GetCurrentTimeStep(), and EventRouter::GetStateParams().
|
inline |
Obtain the RegionParams that are applicable in a particular Visualizer window.
Return the RegionParams instance associated with the window named by winName
in the current session state
ptr | RegionParams instance that is applicable. |
Definition at line 341 of file ParamsMgr.h.
vector< string > VAPoR::ParamsMgr::GetRenderParamInstances | ( | string | winName, |
string | classType | ||
) | const |
vector< string > VAPoR::ParamsMgr::GetRenderParamInstances | ( | string | winName, |
string | dataSetName, | ||
string | classType | ||
) | const |
Returns renderer instance names defined on window winName
for renderer type classname
This method returns the instance names of all RenderParams of type classType
that are associated with the window winName
in the current session state.
void VAPoR::ParamsMgr::GetRenderParamNames | ( | string | winName, |
string | dataSetName, | ||
string | classType, | ||
vector< string > & | instNames | ||
) | const |
Return all render param instance names
Return all of the RenderParam instance names associated with the visualizer (window) named winName
, the data set named dataSetName
, and the Params class type classType
The returned names are guaranteed to be unique.
void VAPoR::ParamsMgr::GetRenderParamNames | ( | string | winName, |
string | dataSetName, | ||
vector< string > & | instNames | ||
) | const |
void VAPoR::ParamsMgr::GetRenderParamNames | ( | string | winName, |
vector< string > & | instNames | ||
) | const |
void VAPoR::ParamsMgr::GetRenderParamNames | ( | vector< string > & | instNames | ) | const |
RenderParams * VAPoR::ParamsMgr::GetRenderParams | ( | string | winName, |
string | dataSetName, | ||
string | classType, | ||
string | instName | ||
) | const |
Return a previously created RenderParams instance
This method returns from the session state a previously created RenderParams instance. If the identified RenderParams instance does not exist this A NULL is returned, but no error is generated.
\params [in] winName Window name that the RenderParams instance is associated with.
[in] | classType | Class name used to register the derived RenderParams object with. |
[in] | instName | Name associated with the object to destroy. |
ptr | If the identified RenderParams instance exists in the session state it is returned, otherwise NULL is returned. The latter case does not generate an error |
void VAPoR::ParamsMgr::GetRenderParams | ( | string | winName, |
string | dataSetName, | ||
vector< RenderParams * > & | rParams | ||
) | const |
void VAPoR::ParamsMgr::GetRenderParams | ( | string | winName, |
vector< RenderParams * > & | rParams | ||
) | const |
void VAPoR::ParamsMgr::GetRenderParams | ( | vector< RenderParams * > & | rParams | ) | const |
vector< string > VAPoR::ParamsMgr::GetRenderParamsClassNames | ( | string | winName | ) | const |
Returns renderer types (aka class names) defined for window winName
This method returns a list of all RenderParams types associated with the window winName
in the session state
vector< string > VAPoR::ParamsMgr::GetRenderParamsClassNames | ( | string | winName, |
string | dataSetName | ||
) | const |
Returns renderer types (aka class names) defined for window winName
associated with a data set named by dataSetName
. This method returns a list of all RenderParams types associated with the window winName
in the session state
|
inlinestatic |
Returns available renderer types (aka class names)
This method returns a list of all registered RenderParams types (class names)
Definition at line 307 of file ParamsMgr.h.
|
inline |
Definition at line 447 of file ParamsMgr.h.
|
inline |
Get whether updating the undo list is enabled.
Definition at line 456 of file ParamsMgr.h.
string VAPoR::ParamsMgr::GetTopRedoDesc | ( | ) | const |
Return description string for event at top of redo stack.
string VAPoR::ParamsMgr::GetTopUndoDesc | ( | ) | const |
Return description string for event at top of undo stack.
ViewpointParams * VAPoR::ParamsMgr::GetViewpointParams | ( | string | winName | ) | const |
Obtain the ViewpointParams that are applicable in a particular Visualizer window.
Return the ViewpointParams instance associated with the window named by winName
in the current session state
ptr | ViewpointParams instance that is applicable. |
vector< string > VAPoR::ParamsMgr::GetVisualizerNames | ( | ) | const |
Returns all defined window (aka visualizer names).
This method will return all defined window names in the session state
names | A vector of window names, possibly an empty vector if none exist. |
|
inline |
Definition at line 516 of file ParamsMgr.h.
|
inline |
Call callbacks registered for intermediate changes. These are changes inside of Save State Groups that the rendering should still be updated to show.
Definition at line 443 of file ParamsMgr.h.
|
virtual |
Load the default state
This method resets the entire parameter state to the default values.
|
virtual |
|
virtual |
Load the parameter state from a file
This method resets the entire parameter state to the state specified by the file named by stateFile
. Any unrecognized nodes in stateFile
will be ignored.
|
inline |
Reinit state saving
Definition at line 514 of file ParamsMgr.h.
bool VAPoR::ParamsMgr::Redo | ( | ) |
Restore state to state that existed prior to the last Undo()
status | Returns true on success, false if the state is unchanged |
|
inline |
Definition at line 486 of file ParamsMgr.h.
|
inline |
Intermediate changes are changes inside of Save State Groups that the rendering should still be updated to show.
Definition at line 509 of file ParamsMgr.h.
|
inline |
Register a state change callback
This method is similar to RegisterStateChangeFlag(). However, instead of setting a boolean flag, the function specified by callback
will be invoked on state changes
Definition at line 505 of file ParamsMgr.h.
|
inline |
Register a boolean flag to capture state changes
This method registers the address of boolean flag whose value will be set whenever the parameter state changes. It is the user's responsbility to clear (set to false) the flag. Note, for changes grouped tegoer with BeginSaveStateGroup() the flag will not be set until after EndSaveStateGroup() is called, and in the case of nested groups, not until the last EndSaveStateGroup() invocation.
Definition at line 497 of file ParamsMgr.h.
void VAPoR::ParamsMgr::RemoveDataMgr | ( | string | dataSetName | ) |
Remove a DataMgr instance previously.
This method removes the association of a DataMgr instance with the data set name dataSetName
, previously made by AddDataMgr()
void VAPoR::ParamsMgr::RemoveRenderParamsInstance | ( | string | winName, |
string | dataSetName, | ||
string | classType, | ||
string | instName | ||
) |
Remove a previously created RenderParams instance
This method removes from the session state a previously created RenderParams instance. If the identified RenderParams instance does not exist this method is a no-op.
\params [in] winName Window name that the RenderParams instance is associated with.
[in] | classType | Class name used to register the derived RenderParams object with. |
[in] | instName | Name associated with the object to destroy. |
void VAPoR::ParamsMgr::RemoveVisualizer | ( | string | winName | ) |
Remove a previously created Window instance
[in] | winName | Window name to remove |
void VAPoR::ParamsMgr::RemoveVisualizerParamsInstance | ( | string | winName | ) |
Remove a previously created ViewpointParams instance
[in] | winName | Window name to remove |
bool VAPoR::ParamsMgr::RenderParamsLookup | ( | string | instName, |
string & | winName, | ||
string & | dataSetName, | ||
string & | className | ||
) | const |
Lookup window, data set, and class name from a render instance name
This method returns the window name winName
, data set name dataSetName
, and render params type className
that are associated with the render instance name instName
.
status | True on success, false if instName is not a previously defined render instance name |
int VAPoR::ParamsMgr::SaveToFile | ( | string | path | ) | const |
Save current state to a file
Save the current state of the parameter database to an XML file
[in] | path | Path to file |
|
inline |
Definition at line 445 of file ParamsMgr.h.
|
inline |
Enable/Disable adding params changes to the undo list. When enabled, behaves as normal. When disabled, params are saved as normal, however the undo list is not updated. An example use case is to store a computed value in the params database.
Definition at line 453 of file ParamsMgr.h.
|
inline |
Return true if any state changes made since last call
This method returns a boolean indicating whether any changes have been made to the parameter state since the last time the method was called. The first time StateChanged() is called it will return true;
Definition at line 525 of file ParamsMgr.h.
bool VAPoR::ParamsMgr::Undo | ( | ) |
Restore state to previously saved state
status | Returns true on success, false if the state is unchanged |
void VAPoR::ParamsMgr::UndoRedoClear | ( | ) |
|
inline |
Return number states saved that can be undone with Undo()
Definition at line 484 of file ParamsMgr.h.