|
| 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 () |
|
|
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 methods not intended for general use
|
| 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 () |
|
A pure virtual class for managing parameters used in visualization.
- Author
- Alan Norton
- Version
- 3.0
- Date
- March, 2014
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.
- The Params class is derived from ParamsBase, which provides the association between a Params class and its representation as a set of (key,value) pairs. All the parameters in a ParamsBase instance are stored in an XML tree, and can be retrieved based on the value of the associated tag (key). Params instances have additional capabilities (not found in ParamsBase instances), including the Undo/Redo support and the ability to be associated with a tab in the gui. When it is desired to contain a class within a Params class (such as a Transfer Function within a RenderParams) then the embedded class should be derived from ParamsBase, so that its state will be represented in the state of the containing Params instance.
- In the VAPOR GUI, each tab corresponds to a Params subclass, and the renderer tabs correspond to subclasses of RenderParams, a subclass of Params. Several Params classes (BasicParams) have a unique instance and are not associated with tabs in the GUI. The BasicParams classes are used for Undo/Redo and for saving/restoring session state. At run time there is a collection of Params instances that describe the full state of the application. These Params instances can be retrieved using GetParamsInstance() and GetDefaultParams(). There is one default instance of each Params class. This instance is initially in the default state after data is loaded, but can be modified later. There is in addition one instance of Region, Animation, and Viewpoint params for each Visualizer, that represents the state of the local params for that visualizer. There are in addition one or more instances of each RenderParams Class for each visualizer, depending on how many instances have been created.
- See also
- Command, ParamsBase, ParamNode, RenderParams
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.
- If the Params class corresponds to a renderer, the Params class should be derived from RenderParams.
- The implementer should also provide Get and Set methods for all of the parameters in the new Params class.
- The Get methods can directly access the corresponding ParamNode methods that retrieve data from the XML tree.
- The Set methods should invoke the methods Params::SetValueLong(), Params::SetValueDouble(), Params::SetValueString(), and Params::SetValueStringVec(), so that changes in the Params state will automatically be captured in the Undo/Redo queue, and so that values that are set are confirmed to be valid based on the current DataMgr.
- Params implementers must also implement the various pure virtual methods described below.
Instructions for VAPOR application implementers:
- Application code (such as scripting and GUI applications) must be aware of the various Params instances that are in use. Methods for accessing these instances are provided as static methods on Params described below. These methods allow retrieval of Params instances based on the type of Params, the visualizer that it is associated with, and the instance index of RenderParams.
Terminology:
- Type: Each Params subclass has a unique string type, that also serves as the XML tag associated with the Params
- Instance index: Each RenderParams has an instance index, allowing control of multiple RenderParams instances in the same rendering.
- Visualizer: A visualizer is an OpenGL rendering window. These are numbered by positive integers. Each RenderParams instance is associated with a particular visualizer. Params instances that are not RenderParams can apply in one or more visualizer.
- Current Instance: When there are multiple instances of a RenderParams, one of them is the "Current Instance". The current instance determines the values that are displayed in the GUI, and is also used as the default instance when referenced by another Params instance.
Definition at line 129 of file params.h.
virtual int VAPoR::Params::SetLocal |
( |
bool |
lg | ) |
|
|
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.
- Parameters
-
[in] | lg | boolean is true if is local |
Definition at line 449 of file params.h.
virtual void VAPoR::Params::Validate |
( |
int |
type | ) |
|
|
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.
- The Validate(2) method is invoked after a SetValue is issued, so that the state of the Params object should be valid even after erroneous values have been set.
- Parameters
-
- See also
- DataMgr
Implemented in VAPoR::VizWinParams, VAPoR::InstanceParams, VAPoR::ViewpointParams, VAPoR::RegionParams, VAPoR::MouseModeParams, VAPoR::IsolineParams, VAPoR::ArrowParams, and VAPoR::HelloParams.