VAPoR  3.0.0
Static Public Member Functions | List of all members
VAPoR::InstanceParams Class Reference

A class for describing the renderer instances in use in VAPOR. More...

#include <instanceparams.h>

Inheritance diagram for VAPoR::InstanceParams:
VAPoR::BasicParams VAPoR::Params VetsUtil::MyBase VAPoR::ParamsBase

Static Public Member Functions

static int AddInstance (const std::string rendererName, int viznum, RenderParams *p)
 
static int RemoveSelectedInstance (int viz)
 
static int GetSelectedIndex (int viz)
 
static int GetSelectedInstance (int viz, int *pType, int *instance)
 
static int SetSelectedIndex (int viz, int index)
 
static RenderParamsGetSelectedRenderParams (int viz)
 
static RenderParamsGetRenderParamsInstance (int viz, int renIndex)
 
static int GetNumInstances (int viz)
 
- Static Public Member Functions inherited from VAPoR::Params
static bool IsRenderingEnabled (int winnum)
 
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 ParamsGetParamsInstance (int pType, int winnum=-1, int instance=-1)
 
static ParamsGetParamsInstance (const std::string tag, int winnum=-1, int instance=-1)
 
static ParamsGetCurrentParamsInstance (int pType, int winnum)
 
static ParamsGetDefaultParams (ParamsBase::ParamsBaseType pType)
 
static ParamsGetDefaultParams (const string &tag)
 
static void SetDefaultParams (int pType, Params *p)
 
static void SetDefaultParams (const string &tag, Params *p)
 
static ParamsCreateDefaultParams (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 ()
 
- Static Public Member Functions inherited from VetsUtil::MyBase
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 Public Member Functions inherited from VAPoR::ParamsBase
static ParamsBaseType GetTypeFromTag (const string &tag)
 
static const string GetTagFromType (ParamsBaseType t)
 
static ParamsBaseCreateDefaultParamsBase (int pType)
 
static ParamsBaseCreateDefaultParamsBase (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)
 

Internal

Internal methods not intended for general use

static int AddVizWin (int viznum)
 
static void UndoRedo (bool isUndo, int, Params *beforeP, Params *afterP, Params *auxBP=0, Params *auxAP=0)
 
static int RemoveVizWin (int viznum)
 
static ParamsBaseCreateDefaultInstance ()
 
static int changeType (InstanceParams *p1, InstanceParams *p2, int *viz, int *type)
 
static ParamNodegetVizNode (int viz)
 
static int renumberInstances (int viz, int changedType)
 
 InstanceParams (XmlNode *parent, int winnum)
 
virtual ~InstanceParams ()
 Destructor. More...
 
virtual void Validate (int type)
 
virtual void restart ()
 Method to initialize a new InstanceParams instance. More...
 
const std::string getShortName ()
 

Additional Inherited Members

- Public Types inherited from VetsUtil::MyBase
typedef void(* ErrMsgCB_T) (const char *msg, int err_code)
 
typedef void(* DiagMsgCB_T) (const char *msg)
 
- Public Types inherited from VAPoR::ParamsBase
typedef int ParamsBaseType
 
- Public Member Functions inherited from VAPoR::BasicParams
 BasicParams (XmlNode *parent, const string &name)
 
- Public Member Functions inherited from VAPoR::Params
 Params (const Params &p)
 Default copy constructor. More...
 
virtual ~Params ()
 
bool isRenderParams () const
 
bool isBasicParams () const
 
virtual int GetVizNum ()
 
virtual int SetLocal (bool lg)
 
virtual bool IsLocal ()
 
virtual BoxGetBox ()
 
 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)
 
- Public Member Functions inherited from VetsUtil::MyBase
 MyBase ()
 
const string & getClassName () const
 
- Public Member Functions inherited from VAPoR::ParamsBase
 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...
 
ParamNodeGetRootNode () 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)
 
ParamsBaseGetParamsBase (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 ParamNodebuildNode ()
 
ParamNodeGetCurrentNode ()
 
ParamNodePush (string &tag, ParamsBase *pBase=0)
 
ParamNodePop ()
 
void Remove (const string &name)
 
const map< string, string > & GetAttributes ()
 
void Clear ()
 
- Static Public Attributes inherited from VetsUtil::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 VAPoR::Params
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)
 
- Protected Member Functions inherited from VetsUtil::MyBase
void SetClassName (const string &name)
 

Detailed Description

A class for describing the renderer instances in use in VAPOR.

Author
Alan Norton
Version
3.0
Date
May 2014

This BasicParams class tracks the set of all renderer instances, including the current selection. It does not track the "current" instance, because that information can be retrieved from the Params class. Whenever a renderer instance is added, removed, or selected, methods on this class must be called, and this class supports undo and redo of those operations. It is also notified when a visualizer is added or removed. Methods are also provided to retrieve the state in this class because the Renderer Instance Table will refresh itself based on the current state of this class. This Params class tracks the following state: The RenderParams instance added or removed during the most recent update (as a ParamNode) The current visualizers For each visualizer, all of the RenderParams instances (enabled or not) for that visualizer, identified by type and instance index and name. The ordering of these instances (e.g. as displayed in the instance table for that visualizer) The currently selected instance In order to support undo this class also tracks the previous current index of the same type as the newly selected instance (on removeInstance, use instead the instance index that was removed)

The XML subtree of this node is as follows:

Root Visualizers ParamNode(parent of identified RenderParams ParamNode ): Two child nodes The ParamNode is only needed after Add or Remove instance operations, otherwise NULL. VizNN VizMM etc. where NN, MM are visualizer indices: One child node for each visualizer. (SelectedChildIndex, PreviousCurrentInstanceIndex) Name1, Name2 etc. (long 2-vector of selected instance index, previousCurrentIndex), plus names of instances in the order in which they appear. Indices and type a vector<long>, the Name's are child nodes. The 2-vector has tag _selectionInfoTag (type1, index1) etc. (vector<long> Integers indicating ParamsBaseTypeId, instance index for the instance Name(s) vector<long> tag is _instanceInfoTag. Note that which instance of a given type is "current" is kept in the Params class.

Definition at line 82 of file instanceparams.h.

Constructor & Destructor Documentation

VAPoR::InstanceParams::InstanceParams ( XmlNode *  parent,
int  winnum 
)

Constructor

Parameters
[in]intwinnum The window number, -1 since it's global
virtual VAPoR::InstanceParams::~InstanceParams ( )
virtual

Destructor.

Member Function Documentation

static int VAPoR::InstanceParams::AddInstance ( const std::string  rendererName,
int  viznum,
RenderParams p 
)
static

Static method used to add a instance to the list of instances for a visualizer On error returns -1. Otherwise returns the instance index, which is the total number of instances minus 1. The instance that is added is selected, and becomes the current instance of its type (Tag)

Parameters
[in]rendererNamerender name associated with the instance
[in]intvisualizer index (as returned by ControlExec::NewVisualizer)
[in]RenderParams*RenderParams instance that is being added.
Return values
intinstance index associated with this visualizer
static int VAPoR::InstanceParams::AddVizWin ( int  viznum)
inlinestatic

Static method that should be called whenever a new visualizer is created This must agree with the VizWinParams state, so InstanceParams::AddVizWin() is invoked by VizWinParams::AddVizWin() If specified visualizer is already there, return 0; if not build the default node representing the visualizer.

Parameters
[in]viznumVisualizer index.
Return values
0if successful.

Definition at line 169 of file instanceparams.h.

static int VAPoR::InstanceParams::changeType ( InstanceParams p1,
InstanceParams p2,
int *  viz,
int *  type 
)
static
static ParamsBase* VAPoR::InstanceParams::CreateDefaultInstance ( )
inlinestatic

Required static method (for extensibility):

Return values
ParamsBase*pointer to a default Params instance

Definition at line 194 of file instanceparams.h.

static int VAPoR::InstanceParams::GetNumInstances ( int  viz)
static

Static method indicates the number of renderer instances for a visualizer

Parameters
[in]vizis the visualizer index
Return values
intis the number of renderer instances
static RenderParams* VAPoR::InstanceParams::GetRenderParamsInstance ( int  viz,
int  renIndex 
)
static

Static method identifies the RenderParams* with specified index

Parameters
[in]vizis the visualizer index
[in]renindexis the renderer index
Return values
RenderParams*is the RenderParams* associated with the index
static int VAPoR::InstanceParams::GetSelectedIndex ( int  viz)
inlinestatic

Static method identifies index of the selected instance for a visualizer The returned index is the child index of the selected instance

Parameters
[in]indexis visualizer index associated with the instance
Return values
-1if error, otherwise returns the current instance index

Definition at line 111 of file instanceparams.h.

static int VAPoR::InstanceParams::GetSelectedInstance ( int  viz,
int *  pType,
int *  instance 
)
static

Static method identifies the selected params by returning the ParamType and instance index

Parameters
[in]intviz visualizer index
[out]int*(ParamsBaseType) pType
[out]int*instance
Return values
-1if error
static RenderParams* VAPoR::InstanceParams::GetSelectedRenderParams ( int  viz)
static

Static method determines the RenderParams that is selected

Parameters
[in]vizis the visualizer index
Return values
RenderParams*is the RenderParams* that is selected.
const std::string VAPoR::InstanceParams::getShortName ( )
inlinevirtual

Pure virtual method on Params. Provide a short name suitable for use in the GUI

Return values
stringname

Implements VAPoR::Params.

Definition at line 197 of file instanceparams.h.

static ParamNode* VAPoR::InstanceParams::getVizNode ( int  viz)
static
static int VAPoR::InstanceParams::RemoveSelectedInstance ( int  viz)
static

Static method used to remove the selected instance from the set of instances for a particular visualizer The selected instance becomes the next instance, unless there is no next instance, in which case it becomes the previous instance. The current instance (for the renderer type) is also modified in accordance with Params::RemoveParams or the previous instance if next instance does not exist. Similarly if the instance is the selected instance.

Parameters
[in]indexis visualizer index associated with the instance
Return values
intindicates 0 if successful
static int VAPoR::InstanceParams::RemoveVizWin ( int  viznum)
static

Static method that should be called whenever a visualizer is deleted This must agree with the VizWinParams state, so InstanceParams::RemoveVizWin() is invoked by VizWinParams::RemoveVizWin()

Parameters
[in]viznumVisualizer index.
Return values
0if successful.
static int VAPoR::InstanceParams::renumberInstances ( int  viz,
int  changedType 
)
static
Parameters
[in]intviz visualizer index
[in]intposition of the insertion or removal
[in]boolisInsert true if insertion, false if removal
virtual void VAPoR::InstanceParams::restart ( )
virtual

Method to initialize a new InstanceParams instance.

Implements VAPoR::Params.

static int VAPoR::InstanceParams::SetSelectedIndex ( int  viz,
int  index 
)
inlinestatic

Static method causes an instance to be selected.

Parameters
[in]indexis visualizer index associated with the instance
[in]int(child) index to be selected
Return values
0if successful.

Definition at line 125 of file instanceparams.h.

static void VAPoR::InstanceParams::UndoRedo ( bool  isUndo,
int  ,
Params beforeP,
Params afterP,
Params auxBP = 0,
Params auxAP = 0 
)
static

Static method invoked during Undo and Redo of Instance params This performs undo and redo of creation and destruction of Params instances, as well as resetting of the current instance. This function must be passed in Command::CaptureStart

See also
UndoRedoHelpCB_T
Parameters
[in]isUndoindicates whether an Undo or Redo is being performed
[in]instanceis not used for this Params
[in]beforePis a copy of the InstanceParams at the start of the Command
[in]afterPis a copy of the InstanceParams at the end of the Command
[in]auxBPis not currently used by this Params
[in]auxAPis not currently used by this Params
virtual void VAPoR::InstanceParams::Validate ( int  type)
virtual

Method to validate all values in a InstanceParams instance

Parameters
[in]booldefault indicates whether or not to set to default values associated with the current DataMgr
See also
DataMgr

Implements VAPoR::Params.


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