VAPoR  0.1
Public Member Functions | Static Public Member Functions | List of all members
VAPoR::DataStatus Class Reference

A class for describing the currently loaded dataset. More...

#include <datastatus.h>

Public Member Functions

const float * getLocalExtents ()
 
const float * getFullSizes ()
 
const float * getFullStretchedSizes ()
 
const float * getStretchedExtents ()
 
size_t getMinTimestep ()
 
size_t getMaxTimestep ()
 
int getVDCType ()
 
bool dataIsPresent3D (int sesvarnum, int timestep)
 
bool dataIsPresent2D (int sesvarnum, int timestep)
 
bool dataIsPresent3D (int timestep)
 
bool dataIsPresent2D (int timestep)
 
bool dataIsPresent (int timestep)
 
bool dataIsPresent3D ()
 
bool dataIsPresent2D ()
 
double getDataMax3D (int sesvarNum, int timestep, bool mustGet=true)
 
double getDataMax2D (int sesvarNum, int timestep, bool mustGet=true)
 
double getDataMin3D (int sesvarNum, int timestep, bool mustGet=true)
 
double getDataMin2D (int sesvarNum, int timestep, bool mustGet=true)
 
double getDefaultDataMax3D (int varnum, bool mustGet=true)
 
double getDefaultDataMin3D (int varnum, bool mustGet=true)
 
double getDefaultDataMax2D (int varnum, bool mustGet=true)
 
double getDefaultDataMin2D (int varnum, bool mustGet=true)
 
int maxXFormPresent3D (int sesvarnum, int timestep)
 
int maxXFormPresent2D (int sesvarnum, int timestep)
 
int maxLODPresent3D (int sesvarnum, int timestep)
 
int maxLODPresent2D (int sesvarnum, int timestep)
 
int maxXFormPresent (const string &varname, int timestep)
 
int maxLODPresent (const string &varname, int timestep)
 
bool variableIsPresent3D (int varnum)
 
bool variableIsPresent2D (int varnum)
 
bool fieldDataOK (int refLevel, int lod, int tstep, int varx, int vary, int varz)
 
int getNumTimesteps ()
 
int getNumTransforms ()
 
int getNumLODs ()
 
void setDataMissing3D (int timestep, int refLevel, int lod, int sessionVarNum)
 
void setDataMissing2D (int timestep, int refLevel, int lod, int sessionVarNum)
 
int getActiveVarNum3D (std::string varname) const
 
int getActiveVarNum2D (std::string varname) const
 
DataMgrgetDataMgr ()
 
void invalidateDataMgr ()
 Invalidate current data manager: More...
 

Static Public Member Functions

static DataStatusgetInstance ()
 
static bool checkVarMinMax (MapperFunction *mf, int sesVarNum, bool is3D, bool useDefault, float minmax[2], int ts=0)
 
static std::string & getVariableName3D (int sesvarNum)
 
static std::string & getVariableName2D (int sesvarNum)
 
static int getSessionVariableNum3D (const std::string &str)
 
static int getSessionVariableNum2D (const std::string &str)
 
static int getNumActiveVariables3D ()
 
static int getNumActiveVariables2D ()
 
static int mapActiveToSessionVarNum3D (int varnum)
 
static int mapActiveToSessionVarNum2D (int varnum)
 
static int mapSessionToActiveVarNum3D (int sesvar)
 
static int mapSessionToActiveVarNum2D (int sesvar)
 
static std::string & getActiveVarName3D (int activevarnum)
 
static std::string & getActiveVarName2D (int activevarnum)
 
static bool warnIfDataMissing ()
 
static bool trackMouse ()
 
static bool useLowerAccuracy ()
 
static bool useQuadInterpolation ()
 

Detailed Description

A class for describing the currently loaded dataset.

Author
Alan Norton
Version
$Revision$
Date
$Date$

The DataStatus class keeps track of available variables, timesteps, resolutions, and data ranges. It is constructed by the Session whenever a new metadata is loaded. It keeps a lazily evaluated value of min/max of each variable for each timestep. Variables can be referenced using the variable name, the session variable num (a numbering all the variables in the session) or by the active variable num. Active variables are all those in the metadata plus all the derived variables, and are a subset of the session variables. Session variables are those that were specified in the session plus those that are derived, and these may not all be available in the metadata. To support using active variables and session variable nums, mappings are provided between active names/nums and session nums, and also between variable names and their 2D and 3D session variable numbers and active variable numbers.

Definition at line 51 of file datastatus.h.

Member Function Documentation

static bool VAPoR::DataStatus::checkVarMinMax ( MapperFunction mf,
int  sesVarNum,
bool  is3D,
bool  useDefault,
float  minmax[2],
int  ts = 0 
)
static

Obtain actual min and max of variable at lowest accuracy level Used when the values are actually needed in a mapperFunction

Parameters
[in]mfMapperFunction that will save the values
[in]sesVarNumis session variable num
[in]is3Dindicates if variable is 3D
[out]minmaxmin and max value of variable (may not be the range in MapperFunction)
[in]useDefaultindicates that default is OK (first time step, lowest accuracy)
[in]tstime step, ignored if default is true
Returns
bool true if this is the first use of this variable in this mapper function
bool VAPoR::DataStatus::dataIsPresent ( int  timestep)
inline

Indicates whether any variable exists at a particular timestep.

Parameters
[in]inttimestep Time step
Return values
trueif the data exists

Definition at line 144 of file datastatus.h.

bool VAPoR::DataStatus::dataIsPresent2D ( int  sesvarnum,
int  timestep 
)
inline

Indicates whether a 2D session variable exists at a particular timestep.

Parameters
[in]intsesvarnum 2D Session variable number
[in]inttimestep Time step
Return values
trueif the data exists

Definition at line 108 of file datastatus.h.

bool VAPoR::DataStatus::dataIsPresent2D ( int  timestep)
inline

Indicates whether any 2D variable exists at a particular timestep.

Parameters
[in]inttimestep Time step
Return values
trueif the data exists

Definition at line 131 of file datastatus.h.

bool VAPoR::DataStatus::dataIsPresent2D ( )
inline

Indicates whether any 2D variable exists at any timestep.

Return values
trueif the data exists

Definition at line 169 of file datastatus.h.

bool VAPoR::DataStatus::dataIsPresent3D ( int  sesvarnum,
int  timestep 
)
inline

Indicates whether a 3D session variable exists at a particular timestep.

Parameters
[in]intsesvarnum 3D Session variable number
[in]inttimestep Time step
Return values
trueif the data exists

Definition at line 97 of file datastatus.h.

bool VAPoR::DataStatus::dataIsPresent3D ( int  timestep)
inline

Indicates whether any 3D variable exists at a particular timestep.

Parameters
[in]inttimestep Time step
Return values
trueif the data exists

Definition at line 118 of file datastatus.h.

bool VAPoR::DataStatus::dataIsPresent3D ( )
inline

Indicates whether any 3D variable exists at any timestep.

Return values
trueif the data exists

Definition at line 160 of file datastatus.h.

bool VAPoR::DataStatus::fieldDataOK ( int  refLevel,
int  lod,
int  tstep,
int  varx,
int  vary,
int  varz 
)

Verify that up to three field variables are present at specified resolution, lod, and timestep. Ignores a variable if varnum is < 0. Accepts lowered refinement level or lod if user has specified use of lower accuracy when requested accuracy is not available.

Parameters
[in]intrefLevel is requested refinement level
[in]intLOD is requested LOD level
[in]intvarx is session variable number of x component, -1 to ignore
[in]intvary is session variable number of y component, -1 to ignore
[in]intvarz is session variable number of z component, -1 to ignore
Return values
trueif the variable exists at resolution and timestep
static std::string& VAPoR::DataStatus::getActiveVarName2D ( int  activevarnum)
inlinestatic

Static method finds the name that corresponds to an active 2D variable num. Should be the same as getting it from the metadata directly, if it's in metadata. If no such index, returns first variable in VDC.

Parameters
[in]intactivevarnum active variable number
Return values
std::stringname of variable

Definition at line 465 of file datastatus.h.

static std::string& VAPoR::DataStatus::getActiveVarName3D ( int  activevarnum)
inlinestatic

Static method finds the name that corresponds to an active 3D variable num. Should be the same as getting it from the metadata directly, if it's in metadata. If no such index, returns first variable in VDC.

Parameters
[in]intactivevarnum active variable number
Return values
std::stringname of variable

Definition at line 456 of file datastatus.h.

int VAPoR::DataStatus::getActiveVarNum2D ( std::string  varname) const

Method finds the active variable number associated with a 2D variable name.

Parameters
[in]std::stringvarname Name of variable
Return values
intactive variable number
int VAPoR::DataStatus::getActiveVarNum3D ( std::string  varname) const

Method finds the active variable number associated with a 3D variable name.

Parameters
[in]std::stringvarname Name of variable
Return values
intactive variable number
double VAPoR::DataStatus::getDataMax2D ( int  sesvarNum,
int  timestep,
bool  mustGet = true 
)

Indicates the largest value of a 2D variable at a timestep. Returns 1 if the data bounds have not yet been calculated, for example, if the variable is derived, the bounds will not be known until the input data has been retrieved and the derived variable has been calculated.

Parameters
[in]intsesvarNum 2D session variable number
[in]inttimestep Time Step
[in]boolmustGet indicates that data will be retrieved if max not known
Return values
doublemaximum value
double VAPoR::DataStatus::getDataMax3D ( int  sesvarNum,
int  timestep,
bool  mustGet = true 
)

Indicates the largest value of a 3D variable at a timestep. Returns 1 if the data bounds have not yet been calculated, for example if the variable is derived, the bounds will not be known until the input data has been retrieved and the derived variable has been calculated.

Parameters
[in]intsesvarNum session variable number
[in]inttimestep Time Step
[in]boolmustGet indicates that data will be retrieved if max not known
Return values
doublemaximum value
DataMgr* VAPoR::DataStatus::getDataMgr ( )
inline

Returns the current data manager (if it exists). Returns null if it does not exist.

Return values
DataMgr*pointer to current Data Manager

Definition at line 482 of file datastatus.h.

double VAPoR::DataStatus::getDataMin2D ( int  sesvarNum,
int  timestep,
bool  mustGet = true 
)

Indicates the smallest value of a 2D variable at a timestep. Returns -1 if the data bounds have not yet been calculated; for example, if the variable is derived, the bounds will not be known until the input data has been retrieved and the derived variable has been calculated.

Parameters
[in]sesvarNum2D session variable number
[in]timestepTime Step
[in]boolmustGet indicates that data will be retrieved if min not known
Return values
doubleminimum value
double VAPoR::DataStatus::getDataMin3D ( int  sesvarNum,
int  timestep,
bool  mustGet = true 
)

Indicates the smallest value of a 3D variable at a timestep. Returns -1 if the data bounds have not yet been calculated; for example, if the variable is derived, the bounds will not be known until the input data has been retrieved and the derived variable has been calculated.

Parameters
[in]intsesvarNum 3D session variable number
[in]inttimestep Time Step
[in]boolmustGet indicates that data will be retrieved if min not known
Return values
doubleminimum value
double VAPoR::DataStatus::getDefaultDataMax2D ( int  varnum,
bool  mustGet = true 
)

Indicates the default maximum value of a 2D variable. This is usually the maximum value at the first time step.

Parameters
[in]intvarnum Session variable number
Return values
doublemaximum value
double VAPoR::DataStatus::getDefaultDataMax3D ( int  varnum,
bool  mustGet = true 
)

Indicates the default maximum value of a 3D variable. This is usually the maximum value at the first time step.

Parameters
[in]intvarnum 3D Session variable number
Return values
doublemaximum value
double VAPoR::DataStatus::getDefaultDataMin2D ( int  varnum,
bool  mustGet = true 
)

Indicates the default minimum value of a 2D variable. This is usually the minimum value at the first time step.

Parameters
[in]intvarnum Session variable number
Return values
doubleminimum value
double VAPoR::DataStatus::getDefaultDataMin3D ( int  varnum,
bool  mustGet = true 
)

Indicates the default minimum value of a 3D variable. This is usually the minimum value at the first time step.

Parameters
[in]intvarnum Session variable number
Return values
doubleminimum value
const float* VAPoR::DataStatus::getFullSizes ( )
inline

Obtain the full size of the data in user coordinates. Values in this array are in the order: sizex, sizey, sizez

Return values
constfloat[3] size array

Definition at line 70 of file datastatus.h.

const float* VAPoR::DataStatus::getFullStretchedSizes ( )
inline

Obtain the full stretched size of the data in user coordinates. Values in this array are in the order: sizex, sizey, sizez

Return values
constfloat[3] stretched size array

Definition at line 74 of file datastatus.h.

static DataStatus* VAPoR::DataStatus::getInstance ( )
inlinestatic

static getInstance() method is used to obtain the singleton instance of the Datastatus.

Return values
currentDataStatus instance

Definition at line 58 of file datastatus.h.

const float* VAPoR::DataStatus::getLocalExtents ( )
inline

Obtain the full extents of the data in user coordinates. Values in this array are in the order: minx, miny, minz, maxx, maxy, maxz.

Return values
constfloat[6] extents array

Definition at line 66 of file datastatus.h.

size_t VAPoR::DataStatus::getMaxTimestep ( )
inline

Returns the maximum time step for which there is any data.

Return values
size_tvalue of largest time step

Definition at line 87 of file datastatus.h.

size_t VAPoR::DataStatus::getMinTimestep ( )
inline

Returns the minimum time step for which there is any data.

Return values
size_tvalue of smallest time step

Definition at line 83 of file datastatus.h.

static int VAPoR::DataStatus::getNumActiveVariables2D ( )
inlinestatic

Static method indicates the number of active 2D variables.

Return values
intnumber of active 2D variables

Definition at line 425 of file datastatus.h.

static int VAPoR::DataStatus::getNumActiveVariables3D ( )
inlinestatic

Static method indicates the number of active 3D variables.

Return values
intnumber of active 3D variables

Definition at line 421 of file datastatus.h.

int VAPoR::DataStatus::getNumLODs ( )
inline

Indicates the number of levels of detail in the VDC.

Return values
intnumber of LOD's

Definition at line 362 of file datastatus.h.

int VAPoR::DataStatus::getNumTimesteps ( )
inline

Indicates the number of time steps in the current VDC.

Return values
intnumber of timesteps

Definition at line 354 of file datastatus.h.

int VAPoR::DataStatus::getNumTransforms ( )
inline

Indicates the number of refinement levels in the VDC.

Return values
intnumber of refinement levels

Definition at line 358 of file datastatus.h.

static int VAPoR::DataStatus::getSessionVariableNum2D ( const std::string &  str)
static

Identify the 2D session variable num of a name, or -1 if it's not in session.

Parameters
[in]strstd::string variable name
Return values
int2D session variable number
static int VAPoR::DataStatus::getSessionVariableNum3D ( const std::string &  str)
static

Identify the 3D session variable num of a name, or -1 if it's not in session.

Parameters
[in]strstd::string variable name
Return values
int3D session variable number
const float* VAPoR::DataStatus::getStretchedExtents ( )
inline

Return the extents of the data in user coordinates multiplied by current stretch factors.

Return values
float[6]stretched extents array

Definition at line 79 of file datastatus.h.

static std::string& VAPoR::DataStatus::getVariableName2D ( int  sesvarNum)
inlinestatic

Static method to determine the 2D session variable name associated with session index.

Parameters
[in]intsesvarNum 2D Session variable number
Return values
std::stringvariable name.

Definition at line 407 of file datastatus.h.

static std::string& VAPoR::DataStatus::getVariableName3D ( int  sesvarNum)
inlinestatic

Static method to determine the 3D session variable name associated with session index.

Parameters
[in]intsesvarNum 3D Session variable number
Return values
std::stringvariable name.

Definition at line 402 of file datastatus.h.

int VAPoR::DataStatus::getVDCType ( )
inline

Tells whether the current VDC is type 1 or 2

Return values
integerVDC type

Definition at line 91 of file datastatus.h.

void VAPoR::DataStatus::invalidateDataMgr ( )
inline

Invalidate current data manager:

Definition at line 485 of file datastatus.h.

static int VAPoR::DataStatus::mapActiveToSessionVarNum2D ( int  varnum)
inlinestatic

Static method maps a 2D active variable num to a session variable num.

Parameters
[in]varnumactive 2D variable number
Return values
intsession variable number

Definition at line 437 of file datastatus.h.

static int VAPoR::DataStatus::mapActiveToSessionVarNum3D ( int  varnum)
inlinestatic

Static method maps a 3D active variable num to a session variable num.

Parameters
[in]varnumactive 3D variable number
Return values
intsession variable number

Definition at line 430 of file datastatus.h.

static int VAPoR::DataStatus::mapSessionToActiveVarNum2D ( int  sesvar)
static

Static method maps a 2D session variable num to an active variable num.

Parameters
[in]sesvarsession 2D variable number
Return values
intactive 2D variable number
static int VAPoR::DataStatus::mapSessionToActiveVarNum3D ( int  sesvar)
static

Static method maps a 3D session variable num to an active variable num.

Parameters
[in]sesvarsession 3D variable number
Return values
intactive 3D variable number
int VAPoR::DataStatus::maxLODPresent ( const string &  varname,
int  timestep 
)
inline

Indicates the maximum LOD level of a variable that is present at a specified time step. Returns -1 if no data is present.

Parameters
[in]conststring& varname Variable name
[in]inttimestep Time Step
Return values
intmaximum LOD

Definition at line 311 of file datastatus.h.

int VAPoR::DataStatus::maxLODPresent2D ( int  sesvarnum,
int  timestep 
)

Indicates the maximum LOD level of a 2D variable that is present at a specified time step. Returns -1 if no data is present.

Parameters
[in]intsesvarnum Session variable number
[in]inttimestep Time Step
Return values
intmaximum LOD
int VAPoR::DataStatus::maxLODPresent3D ( int  sesvarnum,
int  timestep 
)

Indicates the maximum LOD level of a 3D variable that is present at a specified time step. Returns -1 if no data is present.

Parameters
[in]intsesvarnum Session variable number
[in]inttimestep Time Step
Return values
intmaximum LOD
int VAPoR::DataStatus::maxXFormPresent ( const string &  varname,
int  timestep 
)
inline

Indicates the maximum refinement level of a variable that is present at a specified time step. Returns -1 if no data is present.

Parameters
[in]conststring& varname Variable name
[in]inttimestep Time Step
Return values
intmaximum refinement level

Definition at line 293 of file datastatus.h.

int VAPoR::DataStatus::maxXFormPresent2D ( int  sesvarnum,
int  timestep 
)

Indicates the maximum refinement level of a 2D variable that is present at a specified time step. Returns -1 if no data is present.

Parameters
[in]intsesvarnum Session variable number
[in]inttimestep Time Step
Return values
intmaximum refinement level
int VAPoR::DataStatus::maxXFormPresent3D ( int  sesvarnum,
int  timestep 
)

Indicates the maximum refinement level of a 3D variable that is present at a specified time step. Returns -1 if no data is present.

Parameters
[in]intsesvarnum Session variable number
[in]inttimestep Time Step
Return values
intmaximum refinement level
void VAPoR::DataStatus::setDataMissing2D ( int  timestep,
int  refLevel,
int  lod,
int  sessionVarNum 
)
inline

Specify that a 2D variable is not available at a particular refinement, LOD, timestep. Avoids repeated error messages when requested data is not found. param[in] int timestep Time Step param[in] int refLevel Refinement level param[in] int lod Level of Detail param[in] int sessionVarNum Session Variable Number

Definition at line 387 of file datastatus.h.

References VAPoR::MetadataVDC::GetVDCType().

void VAPoR::DataStatus::setDataMissing3D ( int  timestep,
int  refLevel,
int  lod,
int  sessionVarNum 
)
inline

Specify that a 3D variable is not available at a particular refinement, LOD, timestep. Avoids repeated error messages when requested data is not found. param[in] int timestep Time Step param[in] int refLevel Refinement level param[in] int lod Level of Detail param[in] int sessionVarNum Session Variable Number

Definition at line 370 of file datastatus.h.

References VAPoR::MetadataVDC::GetVDCType().

static bool VAPoR::DataStatus::trackMouse ( )
inlinestatic

Method indicates if user requested mouse tracking in TF editors

Return values
booltrue if tracking is requested.

Definition at line 493 of file datastatus.h.

static bool VAPoR::DataStatus::useLowerAccuracy ( )
inlinestatic

Method indicates if user requests using lower accuracy, when specified LOD or refinement is not available.

Return values
booltrue if lower accuracy is requested.

Definition at line 497 of file datastatus.h.

static bool VAPoR::DataStatus::useQuadInterpolation ( )
inlinestatic

Method indicates if user requests the use of quadratic interpolation in the vertical coordinate.

Return values
booltrue if quadratic interpolation is requested

Definition at line 501 of file datastatus.h.

bool VAPoR::DataStatus::variableIsPresent2D ( int  varnum)
inline

Indicates if a 2D variable is present at any time step. Returns false if no data is present.

Parameters
[in]intvarnum 2D session variable number
Return values
boolis true if it is present.

Definition at line 336 of file datastatus.h.

bool VAPoR::DataStatus::variableIsPresent3D ( int  varnum)
inline

Indicates if a 3D variable is present at any time step. Returns false if no data is present.

Parameters
[in]intvarnum 3D session variable number
Return values
boolis true if it is present.

Definition at line 327 of file datastatus.h.

static bool VAPoR::DataStatus::warnIfDataMissing ( )
inlinestatic

Method indicates if user requested a warning when data is missing.

Return values
booltrue if warning is requested.

Definition at line 489 of file datastatus.h.


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