VAPoR
3.0.0
|
A pure virtual class for managing parameters used in visualization. More...
#include <params.h>
Public Member Functions | |
Params (const Params &p) | |
Default copy constructor. More... | |
virtual | ~Params () |
virtual const std::string | getShortName ()=0 |
virtual void | Validate (int type)=0 |
bool | isRenderParams () const |
bool | isBasicParams () const |
virtual void | restart ()=0 |
virtual int | GetVizNum () |
virtual int | SetLocal (bool lg) |
virtual bool | IsLocal () |
virtual Box * | GetBox () |
![]() | |
MyBase () | |
const string & | getClassName () const |
![]() | |
ParamsBase (XmlNode *parent, const string &name) | |
ParamsBase (const string &name) | |
Default constructor. More... | |
ParamsBase (const ParamsBase &pbase) | |
Copy constructor. More... | |
virtual | ~ParamsBase () |
destructor..destroys the xml tree based at the root node. More... | |
ParamNode * | GetRootNode () const |
const string | GetName () const |
virtual long | GetValueLong (const string &tag, const vector< long > &defaultVal=_emptyLongVec) |
virtual double | GetValueDouble (const string &tag, const vector< double > &defaultVal=_emptyDoubleVec) |
virtual const string | GetValueString (const string &tag, const string &defaultVal=_emptyString) |
virtual const vector< long > | GetValueLongVec (const string &tag, const vector< long > &defaultVal=_emptyLongVec) |
virtual const vector< double > | GetValueDoubleVec (const string &tag, const vector< double > &defaultVal=_emptyDoubleVec) |
virtual void | GetValueStringVec (const string &tag, vector< string > &vec, const vector< string > &defaultVal=_emptyStringVec) |
virtual int | SetValueLong (string tag, const char *description, long value, Params *p) |
virtual int | SetValueLong (string tag, const char *description, const vector< long > &value, Params *p) |
virtual int | SetValueDouble (string tag, const char *description, double value, Params *p) |
virtual int | SetValueDouble (string tag, const char *description, const vector< double > &value, Params *p) |
virtual int | SetValueString (string tag, const char *description, const string &value, Params *p) |
virtual int | SetValueStringVec (string tag, const char *description, const vector< string > &value, Params *p) |
ParamsBaseType | GetParamsBaseTypeId () |
virtual void | SetRootParamNode (ParamNode *pn) |
ParamsBase * | GetParamsBase (const vector< string > &path) const |
int | SetParamsBase (const vector< string > &path, ParamsBase *pbase) |
int | RemoveParamsBase (const vector< string > &path, ParamsBase *pbase) |
void | SetParent (XmlNode *parent) |
virtual bool | elementStartHandler (ExpatParseMgr *pm, int depth, string &tag, const char **attribs) |
virtual bool | elementEndHandler (ExpatParseMgr *pm, int depth, string &tag) |
virtual ParamNode * | buildNode () |
ParamNode * | GetCurrentNode () |
ParamNode * | Push (string &tag, ParamsBase *pBase=0) |
ParamNode * | Pop () |
void | Remove (const string &name) |
const map< string, string > & | GetAttributes () |
void | Clear () |
Static Public Member Functions | |
static bool | IsRenderingEnabled (int winnum) |
![]() | |
static void | SetErrMsg (const char *format,...) |
Record a formatted error message. More... | |
static void | SetErrMsg (int errcode, const char *format,...) |
Record a formatted error message and an error code. More... | |
static const char * | GetErrMsg () |
static void | SetErrCode (int err_code) |
Record an error code. More... | |
static int | GetErrCode () |
Retrieve the current error code. More... | |
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. More... | |
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 ParamsBaseType | GetTypeFromTag (const string &tag) |
static const string | GetTagFromType (ParamsBaseType t) |
static ParamsBase * | CreateDefaultParamsBase (int pType) |
static ParamsBase * | CreateDefaultParamsBase (const string &tag) |
static int | RegisterParamsBaseClass (const string &tag, BaseCreateFcn fcn, bool isParams) |
static int | ReregisterParamsBaseClass (const string &tag, const string &newtag, bool isParams) |
static int | GetNumParamsClasses () |
static int | GetNumBasicParamsClasses () |
static bool | IsParamsTag (const string &tag) |
Protected Member Functions | |
virtual int | SetValueLong (string tag, const char *description, long value) |
virtual int | SetValueLong (string tag, const char *description, const vector< long > &value) |
virtual int | SetValueDouble (string tag, const char *description, double value) |
virtual int | SetValueDouble (string tag, const char *description, const vector< double > &value) |
virtual int | SetValueString (string tag, const char *description, const string &value) |
virtual int | SetValueStringVec (string tag, const char *description, const vector< string > &value) |
![]() | |
void | SetClassName (const string &name) |
Internal | |
Params (XmlNode *parent, const string &name, int winNum) | |
Params (int winNum, const string &name) | |
Deprecated constructor, needed for built-in classes that do not have associated XML node: More... | |
virtual int | GetInstanceIndex () |
virtual void | SetVizNum (int vnum) |
static int | GetCurrentParamsInstanceIndex (int pType, int winnum) |
static int | GetCurrentParamsInstanceIndex (const std::string tag, int winnum) |
static void | SetCurrentParamsInstanceIndex (int pType, int winnum, int instance) |
static Params * | GetParamsInstance (int pType, int winnum=-1, int instance=-1) |
static Params * | GetParamsInstance (const std::string tag, int winnum=-1, int instance=-1) |
static Params * | GetCurrentParamsInstance (int pType, int winnum) |
static Params * | GetDefaultParams (ParamsBase::ParamsBaseType pType) |
static Params * | GetDefaultParams (const string &tag) |
static void | SetDefaultParams (int pType, Params *p) |
static void | SetDefaultParams (const string &tag, Params *p) |
static Params * | CreateDefaultParams (int pType) |
static int | GetNumParamsInstances (int pType, int winnum) |
static int | GetNumParamsInstances (const std::string tag, int winnum) |
static void | AppendParamsInstance (int pType, int winnum, Params *p) |
static void | AppendParamsInstance (const std::string tag, int winnum, Params *p) |
static void | RemoveParamsInstance (int pType, int winnum, int instance) |
static vector< Params * > & | GetAllParamsInstances (int pType, int winnum) |
static int | GetAllParamsInstances (string tag, vector< Params * > &) |
static int | DeleteVisualizer (int viznum) |
static vector< Params * > & | GetAllParamsInstances (const std::string tag, int winnum) |
static map< int, vector< Params * > > * | cloneAllParamsInstances (int winnum) |
static vector< Params * > * | cloneAllDefaultParams () |
Additional Inherited Members | |
![]() | |
typedef void(* | ErrMsgCB_T) (const char *msg, int err_code) |
typedef void(* | DiagMsgCB_T) (const char *msg) |
![]() | |
typedef int | ParamsBaseType |
![]() | |
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 |
A pure virtual class for managing parameters used in visualization.
Params classes provide containers for parameters used by the various renderers in VAPOR The parameters all all represented as an XML tree. Each Params instance has a ParamNode root and the ParamNode class provides methods for setting and getting the values from the XML representation. The Params class is also the basic entity that is used in Undo/Redo by the Command class, so that all changes in state occurring during the VAPOR application can be represented as a change in the state of a Params instance. The state of each Params instance is automatically saved and restored with the VAPOR Session file, using the XML representation.
Instructions for VAPOR Params implementers:
Implementers of VAPOR Params classes should implement a Params class with all of the state described by its ParamNode root.
Instructions for VAPOR application implementers:
Terminology:
VAPoR::Params::Params | ( | XmlNode * | parent, |
const string & | name, | ||
int | winNum | ||
) |
|
inline |
VAPoR::Params::Params | ( | const Params & | p | ) |
Default copy constructor.
|
virtual |
Destroy object
parent
constructor parameter.
|
inlinestatic |
Static method that appends a new instance to the list of existing Params instances for a particular visualizer. Useful for application developers.
[in] | pType | ParamsBase TypeId of the params class |
[in] | winnum | index of specified visualizer window |
[in] | p | pointer to Params instance being appended |
|
inlinestatic |
Static method that appends a new instance to the list of existing Params instances for a particular visualizer. Based on the XML tag of the Params class. Useful for application developers.
|
static |
Static method that produces clones of all the default Params instances for a particular visualizer. Useful for application developers.
[in] | winnum | index of specified visualizer window |
std::vector | of default Params pointers associated with the window, indexed by ParamsBase TypeIDs |
|
static |
|
static |
Static method that constructs a default Params instance. Useful for application developers.
[in] | pType | ParamsBase TypeId of the params class |
Pointer | to new default Params instance |
|
static |
|
inlinestatic |
Static method that produces a list of all the Params instances of a type for a particular visualizer. Useful for application developers.
[in] | pType | ParamsBase TypeId of the params class. |
[in] | winnum | index of specified visualizer window. |
vector | of the Params pointers associated with the window . |
|
static |
Static method that produces a list of all the Params instances of a type for any visualizer (but not the default params) Useful for application developers.
[in] | pType | ParamsBase TypeId of the params class. |
[out] | vector<Params*> | vector of all params of the specified type |
int | indicates size of result vector. |
|
inlinestatic |
Static method that produces a list of all the Params instances for a particular visualizer, based on the XML Tag of the Params class. Useful for application developers.
[in] | tag | XML tag associated with Params class |
[in] | winnum | index of specified visualizer window |
vector | of the Params pointers associated with the window |
|
inlinevirtual |
Virtual method to return the Box associated with a Params class. By default returns NULL. All params classes that use a box to define data extents should reimplement this method. Needed to support manipulators.
Reimplemented in VAPoR::RegionParams, VAPoR::IsolineParams, and VAPoR::ArrowParams.
|
inlinestatic |
Static method that returns the instance that is current in the identified window. Useful for application developers.
[in] | pType | ParamsBase TypeId of the params class |
[in] | winnum | index of identified window |
Pointer | to specified Params instance |
Definition at line 212 of file params.h.
References IsLocal().
|
inlinestatic |
Static method that identifies the instance that is current in the identified window. Useful for application developers.
[in] | pType | ParamsBase is the typeID of the params class |
[in] | winnum | index of identified window |
instance | index that is current |
|
inlinestatic |
Static method that identifies the instance that is current in the identified window. Useful for application developers. Uses tag
to identify the Params class.
[in] | tag | Tag (name) of the params class |
[in] | winnum | index of identified window |
instance | index that is current |
|
inlinestatic |
Static method that returns the default Params instance. Useful for application developers. With non-render params this is the global Params instance.
[in] | pType | ParamsBase TypeId of the params class |
Pointer | to specified Params instance |
Definition at line 224 of file params.h.
Referenced by VAPoR::DataStatus::getStretchFactors().
|
inlinestatic |
|
virtual |
virtual method indicates instance index, only used with RenderParams Implementers need not implement this method. Should only be used if the Params instance has been installed by AppendParamsInstance() or InsertParamsInstance() Returns -1 if the Params instance is not installed.
integer | instance index |
Referenced by VAPoR::Command::CaptureEnd().
|
static |
Static method that tells how many instances of a Params class exist for a particular visualizer. Useful for application developers.
[in] | pType | ParamsBase TypeId of the params class |
[in] | winnum | index of specified visualizer window |
number | of instances that exist |
|
inlinestatic |
Static method that tells how many instances of a Params class exist for a particular visualizer. Based on the XML tag of the Params class. Useful for application developers.
[in] | tag | XML tag associated with Params class |
[in] | winnum | index of specified visualizer window |
number | of instances that exist |
|
static |
Static method that finds the Params instance. Useful for application developers. if instance
is -1, and winnum is >=0 the current instance in the specified window is found. if winnum
is -1, the default instance is found.
[in] | pType | ParamsBase TypeId of the params class |
[in] | winnum | index of window |
[in] | instance | index |
|
inlinestatic |
Static method that finds the Params instance based on tag. Useful for application developers. if instance
is -1, the current instance is found. if winnum
is -1, the default instance is found.
[in] | tag | XML Tag (name) of the params class |
[in] | winnum | index of window |
[in] | instance | index |
|
pure virtual |
Pure virtual method specifying short name e.g. to display on the associated tab. This is not the tag!
string | name to identify associated tab |
Implemented in VAPoR::InstanceParams, VAPoR::VizWinParams, VAPoR::MouseModeParams, VAPoR::RegionParams, VAPoR::ViewpointParams, VAPoR::ArrowParams, VAPoR::IsolineParams, and VAPoR::HelloParams.
|
inlinevirtual |
Identify the visualizer associated with this instance. With global or default or Basic Params this is -1
Definition at line 433 of file params.h.
Referenced by VAPoR::Command::CaptureEnd().
bool VAPoR::Params::isBasicParams | ( | ) | const |
|
inlinevirtual |
Indicate whether a Params is local or not. Only used by non-render params
is | true if local |
Definition at line 455 of file params.h.
Referenced by GetCurrentParamsInstance().
|
static |
Static method that tells whether or not any renderer is enabled in a visualizer. Useful for application developers.
[in] | winnum | index of specified visualizer window |
True | if any renderer is enabled |
bool VAPoR::Params::isRenderParams | ( | ) | const |
method indicating whether a Params is a RenderParams instance. Default returns false. Useful for application developers.
returns | true if it is a RenderParams |
|
static |
Static method that removes an instance from the list of existing Params instances for a particular visualizer. Useful for application developers.
[in] | pType | ParamsBase TypeId of the params class |
[in] | winnum | index of specified visualizer window |
[in] | instance | index of instance to remove |
|
pure virtual |
Pure virtual method, sets a Params instance to its default state, without any data present. Params implementers should assign valid values to all elements in the Params class in this method.
Implemented in VAPoR::VizWinParams, VAPoR::InstanceParams, VAPoR::ViewpointParams, VAPoR::RegionParams, VAPoR::MouseModeParams, VAPoR::IsolineParams, VAPoR::ArrowParams, and VAPoR::HelloParams.
|
inlinestatic |
Static method that specifies the instance that is current in the identified window. For non-Render Params, the current instance should always be 0;
[in] | pType | ParamsBase TypeId of the params class |
[in] | winnum | index of identified window |
[in] | instance | index of instance to be made current |
|
inlinestatic |
|
inlinestatic |
|
inlinevirtual |
Specify whether a [non-render]params is local or global. The local/global setting provides a means of controlling the sharing or non-sharing of parameters between different visualizers. A params instance is local if it applies only to in a single visualizer. Global params instances are applied in all other (non-local) visualizers. For example if there are three visualizers, Visualizer 0, 1, and 2, and suppose that the ViewpointParams associated with Visualizer 0 is Local, while the ViewpointParams associated with Visualizers 1 and 2 are both Global. In that case the viewpoint settings for Visualizer 0 can differ from the settings in Visualizer 1 and 2. However Visualizer 1 and 2 will share the same (global) viewpoint.
[in] | lg | boolean is true if is local |
|
inlineprotectedvirtual |
Method for setting a single double value associated with a tag. This will capture the state of the Params before the value is set, then set the value(s), then Validate(), and finally capture the state of the Params after the Validate() Returns 0 if successful, -1 if the value cannot be set
[in] | string | tag |
[in] | char* | description |
[in] | double | value |
int | zero if successful |
|
inlineprotectedvirtual |
Method for setting double values associated with a tag. This will capture the state of the Params before the values are set, then set the value(s), then Validate(), and finally capture the state of the Params after the Validate(). Returns 0 if successful, -1 if the value cannot be set
[in] | string | tag |
[in] | char* | description |
[in] | vector<double> | value |
int | zero if successful |
|
inlineprotectedvirtual |
Method for setting a single long value associated with a tag. This will capture the state of the Params before the value is set, then set the value(s), then Validate(), and finally capture the state of the Params after the Validate()
[in] | string | tag |
[in] | long | value |
[in] | char* | description |
int | zero if successful |
|
inlineprotectedvirtual |
Method for setting long values associated with a tag. This will capture the state of the Params before the value is set, then set the value(s), then Validate(), and finally capture the state of the Params after the Validate() Returns 0 if successful, -1 if the value cannot be set
[in] | string | tag |
[in] | char* | description |
[in] | vector<long> | value |
int | zero if successful |
|
inlineprotectedvirtual |
Method for setting a single string value associated with a tag. This will capture the state of the Params before the value is set, then set the value, then Validate(), and finally capture the state of the Params after the Validate() Returns 0 if successful, -1 if the value cannot be set
[in] | string | tag |
[in] | char* | description |
[in] | string | value |
int | zero if successful |
|
inlineprotectedvirtual |
Method for setting string values associated with a tag. This will capture the state of the Params before the values are set, then set the value(s), then Validate(), and finally capture the state of the Params after the Validate() returns 0 if successful, -1 if the value cannot be set.
[in] | string | tag |
[in] | char* | description |
[in] | vector<string> | value |
int | zero if successful |
|
inlinevirtual |
|
pure virtual |
Pure virtual method for validation of all settings It is required that implementers of Params classes write this method so that it checks the values of all parameters in the Params instance, ensuring that they are consistent with the current DataMgr When the type argument is 0, this method sets all parameters to their default values associated with the current Data Manager. When the type argument is 1, the method changes only those parameters that are inconsistent with the current Data Manager, setting them to values that are consistent. When the type argument is 2 the method can assume that the DataMgr has not changed so the values that change with DataMgr (such as the variable names) do not need to be checked.
[in] | int | type |
Implemented in VAPoR::VizWinParams, VAPoR::InstanceParams, VAPoR::ViewpointParams, VAPoR::RegionParams, VAPoR::MouseModeParams, VAPoR::IsolineParams, VAPoR::ArrowParams, and VAPoR::HelloParams.