VAPoR  3.0.0
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

float getDefaultDataMax (string vname)
 
float getDefaultDataMin (string vname)
 
void mapBoxToVox (Box *box, int refLevel, int lod, int timestep, size_t voxExts[6])
 
 DataStatus ()
 
 ~DataStatus ()
 
bool reset (DataMgrV3_0 *dm, size_t cachesize)
 

Static Public Member Functions

static DataStatusgetInstance ()
 
static const double * getLocalExtents ()
 
static const double * getFullSizes ()
 
static const double * getFullStretchedSizes ()
 
static const double * getStretchedLocalExtents ()
 
static size_t getMinTimestep ()
 
static size_t getMaxTimestep ()
 
static int getNumTimesteps ()
 
static int getActiveVarNum (int dim, string varname)
 
static double getVoxelSize (size_t timestep, string varname, int refLevel, int dir)
 
static int getNumActiveVariables3D ()
 
static int getNumActiveVariables2D ()
 
static int getNumActiveVariables ()
 
static float getDefaultLODFidelity2D ()
 
static float getDefaultRefinementFidelity2D ()
 
static float getDefaultLODFidelity3D ()
 
static float getDefaultRefinementFidelity3D ()
 
static void setDefaultLODFidelity2D (float q)
 
static void setDefaultLODFidelity3D (float q)
 
static void setDefaultRefinementFidelity2D (float q)
 
static void setDefaultRefinementFidelity3D (float q)
 
static int getDefaultFidelitySettings (int dim, vector< int > &lods, vector< int > &refs)
 
static void setFidelityDefault (RenderParams *rp)
 
static bool convertToLonLat (double coords[], int npoints=1)
 
static bool convertFromLonLat (double coords[], int npoints=1)
 
static bool convertLocalToLonLat (int timestep, double coords[], int npoints=1)
 
static bool convertLocalFromLonLat (int timestep, double coords[], int npoints=1)
 
static int GetExtents (size_t timestep, vector< double > &minExts, vector< double > &maxExts)
 
static const vector< double > getStretchFactors ()
 
static void stretchCoords (vector< double > &coords)
 
static void stretchCoords (double coords[3])
 
static double getMaxStretchedSize ()
 
static void localToStretched (const double fromCoords[3], double toCoords[3])
 
static int maxXFormPresent (string varname, size_t timestep)
 
static int maxLODPresent (string varname, size_t timestep)
 
static bool useLowerAccuracy ()
 
static void setUseLowerAccuracy (bool val)
 
static bool dataIsPresent (int timestep)
 
static int mapVoxToUser (size_t timestep, string varname, const size_t vcoords[3], double uCoords[3], int reflevel)
 
static void mapUserToVox (size_t timestep, string varname, const double uCoords[3], size_t vCoords[3], int reflevel)
 
static void stretchExtents (vector< double > factor)
 
static size_t getCacheMB ()
 

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.

Constructor & Destructor Documentation

VAPoR::DataStatus::DataStatus ( )
VAPoR::DataStatus::~DataStatus ( )

Member Function Documentation

static bool VAPoR::DataStatus::convertFromLonLat ( double  coords[],
int  npoints = 1 
)
static

Convert lon/lat coordinates to user coordinates in-place. Return false if can't do it.

Parameters
static bool VAPoR::DataStatus::convertLocalFromLonLat ( int  timestep,
double  coords[],
int  npoints = 1 
)
static

Map Longitude/latitude to local user coordinates If the timestep is negative, then the coords use non-time-varying extents.

Parameters
[in]timestepTime step to use for conversion
static bool VAPoR::DataStatus::convertLocalToLonLat ( int  timestep,
double  coords[],
int  npoints = 1 
)
static

Convert local user point coordinates to lon/lat in-place. Return false if can't do it. If the timestep is negative, then the coords use non-time-varying extents.

Parameters
[in]timestepTime step to use for conversion
static bool VAPoR::DataStatus::convertToLonLat ( double  coords[],
int  npoints = 1 
)
static

Convert user point coordinates to lon/lat in-place. Return false if can't do it.

Parameters
static bool VAPoR::DataStatus::dataIsPresent ( int  timestep)
static

Determine if any data is present at a timestep

Parameters
[in]timestepTime Step to be checked
Returns
true if any variable is present at the time step
static int VAPoR::DataStatus::getActiveVarNum ( int  dim,
string  varname 
)
static

Determine the index of a specified variable name

Parameters
[in]dimensionof variable (2 or 3)
[in]varnamename of variable
Returns
index of specified variable or -1 if it does not exist.
static size_t VAPoR::DataStatus::getCacheMB ( )
inlinestatic

Definition at line 325 of file datastatus.h.

float VAPoR::DataStatus::getDefaultDataMax ( string  vname)

Determine the default maximum value of a variable. This is its minimum value at lowest resolution and first time step, or zero for a derived variable.

Parameters
[in]vnamevariable name
Returns
default minimum value
float VAPoR::DataStatus::getDefaultDataMin ( string  vname)

Determine the default minimum value of a variable. This is its minimum value at lowest resolution and first time step, or zero for a derived variable.

Parameters
[in]vnamevariable name
Returns
default minimum value
static int VAPoR::DataStatus::getDefaultFidelitySettings ( int  dim,
vector< int > &  lods,
vector< int > &  refs 
)
inlinestatic

Obtain the default fidelity settings for 2D or 3D variables. Provides a mapping from fidelity to both lod and refinement, also returns the default fidelity level.

Parameters
[in]dimDimension (2 or 3).
[out]lodsThe sequence of lod levels that are associated with fidelity levels.
[out]refsThe sequence of refinement levels that are associated with fidelity levels
Returns
Default fidelity level for the specified dimension.

Definition at line 191 of file datastatus.h.

static float VAPoR::DataStatus::getDefaultLODFidelity2D ( )
inlinestatic

Obtain the current default LOD floating point level for 2D variables This value, when multiplied by the region size, specifies the default compression ratio, So that, for example, if the defaultLOD value is 10., then the default compression ratio for a 25MB region would be 250:1, and the nearest available compression ratio would be used.

See also
getDefaultRefinementFidelity2D(), getDefaultLODFidelity3D(), getDefaultRefinementFidelity3D(), getDefaultLODFidelity2D()
setDefaultRefinementFidelity2D(), setDefaultLODFidelity3D(), setDefaultRefinementFidelity3D(), setDefaultLODFidelity2D()
Returns
default floating point value

Definition at line 137 of file datastatus.h.

static float VAPoR::DataStatus::getDefaultLODFidelity3D ( )
inlinestatic
static float VAPoR::DataStatus::getDefaultRefinementFidelity2D ( )
inlinestatic

Obtain the current default Refinement floating point level for 2D variables. This value, when reduced by the logarithm (base 2) of the region size in megabytes, is the actual (integer) default refinement level. For example, if the default floating refinement level is 5., and the region size is 4MB, then the default refinement level would be 5. -2. = 3.

See also
getDefaultRefinementFidelity2D(), getDefaultLODFidelity3D(), getDefaultRefinementFidelity3D(), getDefaultLODFidelity2D()
setDefaultRefinementFidelity2D(), setDefaultLODFidelity3D(), setDefaultRefinementFidelity3D(), setDefaultLODFidelity2D()
Returns
default floating point value

Definition at line 146 of file datastatus.h.

static float VAPoR::DataStatus::getDefaultRefinementFidelity3D ( )
inlinestatic

Obtain the current default Refinement floating point level for 3D variables.

See also
getDefaultRefinementFidelity2D(), getDefaultLODFidelity3D(), getDefaultRefinementFidelity3D(), getDefaultLODFidelity2D()
setDefaultRefinementFidelity2D(), setDefaultLODFidelity3D(), setDefaultRefinementFidelity3D(), setDefaultLODFidelity2D()
Returns
default floating point value

Definition at line 158 of file datastatus.h.

static int VAPoR::DataStatus::GetExtents ( size_t  timestep,
vector< double > &  minExts,
vector< double > &  maxExts 
)
static

Obtain the time-varying extents, based on the domain-defining variables. Return 0 on success.

static const double* VAPoR::DataStatus::getFullSizes ( )
inlinestatic

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

Return values
constdouble[3] sizes array

Definition at line 70 of file datastatus.h.

static const double* VAPoR::DataStatus::getFullStretchedSizes ( )
inlinestatic

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

Return values
constdouble[3] sizes array

Definition at line 75 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 56 of file datastatus.h.

static const double* VAPoR::DataStatus::getLocalExtents ( )
inlinestatic

Obtain the full extents of the current data in local coordinates. Values in this array are in the order: minx, miny, minz, maxx, maxy, maxz. By definition, the first three are zero.

Return values
constdouble[6] extents array

Definition at line 65 of file datastatus.h.

static double VAPoR::DataStatus::getMaxStretchedSize ( )
inlinestatic

Find the max domain extent in stretched coords

Return values
floatmaximum stretched extent

Definition at line 259 of file datastatus.h.

References VetsUtil::Max().

static size_t VAPoR::DataStatus::getMaxTimestep ( )
inlinestatic

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

Return values
size_tvalue of largest time step

Definition at line 88 of file datastatus.h.

static size_t VAPoR::DataStatus::getMinTimestep ( )
inlinestatic

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

Return values
size_tvalue of smallest time step

Definition at line 84 of file datastatus.h.

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

Determine the number of active variables. This includes variables in the VDC as well as any derived variables

Returns
number of active variables

Definition at line 116 of file datastatus.h.

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

Determine the number of active 2D variables. This includes 2D variables in the VDC as well as any 2D derived variables

Returns
number of active 2D variables

Definition at line 113 of file datastatus.h.

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

Determine the number of active 3D variables. This includes 3D variables in the VDC as well as any 3D derived variables

Returns
number of active 3D variables

Definition at line 110 of file datastatus.h.

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

Indicates the number of time steps in the current VDC.

Returns
integer number of timesteps

Definition at line 92 of file datastatus.h.

static const double* VAPoR::DataStatus::getStretchedLocalExtents ( )
inlinestatic

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

Return values
constdouble[6] extents array

Definition at line 80 of file datastatus.h.

static const vector<double> VAPoR::DataStatus::getStretchFactors ( )
inlinestatic

Return the current scene stretch factors

Return values
constfloat* current stretch factors

Definition at line 241 of file datastatus.h.

References VAPoR::Params::GetDefaultParams().

Referenced by VAPoR::Viewpoint::getStretchedCamPosLocal(), VAPoR::Viewpoint::getStretchedRotCtrLocal(), VAPoR::Viewpoint::setStretchedCamPosLocal(), and VAPoR::Viewpoint::setStretchedRotCtrLocal().

static double VAPoR::DataStatus::getVoxelSize ( size_t  timestep,
string  varname,
int  refLevel,
int  dir 
)
static

Determine the size of a voxel in user coordinates, along a specific dimension, or its maximum or minimum dimension

Parameters
[in]timestepof variable used to determine dimensions
[in]varnameVariable name used for determining dimension.
[in]reflevelRefinement level at which voxel is measured, or -1 for maximum ref level
[in]diris 0,1,2 for x,y,z dimension. Dir is -1 for maximum, -2 for minimum.
static void VAPoR::DataStatus::localToStretched ( const double  fromCoords[3],
double  toCoords[3] 
)
static

Convert local user coordinates to stretched local user coordinates

Parameters
[in]fromCoordslocal user coordinates
[out]toCoordsstretched local user coordinates
void VAPoR::DataStatus::mapBoxToVox ( Box box,
int  refLevel,
int  lod,
int  timestep,
size_t  voxExts[6] 
)

Map corners of box to voxel coordinates. Result is zero if box does not lie in data domain.

Parameters
[in]boxis Box to be mapped
[in]refLevelis refinement level to be used in the mapping
[in]lodis LOD level to be used for the mapping
[in]timestepis time step to use in the mapping
[out]voxExtsVoxel extents of box, zeroes if not in data bounds
static void VAPoR::DataStatus::mapUserToVox ( size_t  timestep,
string  varname,
const double  uCoords[3],
size_t  vCoords[3],
int  reflevel 
)
static

Perform a mapping of User coordinates to Voxel coordinates based on a specified variable

Parameters
[in]timesteptime step used in mapping
[in]varnamevariable used in mapping
[in]uCoordsUser coordinates
[out]vCoordsvoxel coordinates
[in]reflevelRefinement level used in the mapping
static int VAPoR::DataStatus::mapVoxToUser ( size_t  timestep,
string  varname,
const size_t  vcoords[3],
double  uCoords[3],
int  reflevel 
)
static

Perform a mapping of Voxel coordinates to user coordinates based on a specified variable

Parameters
[in]timesteptime step used in mapping
[in]varnamevariable used in mapping
[in]vCoordsvoxel coordinates
[out]uCoordsuser coordinates
[in]reflevelRefinement level used in the mapping
static int VAPoR::DataStatus::maxLODPresent ( string  varname,
size_t  timestep 
)
static

Determine the maximum compression level present for a variable at a timestep

Parameters
[in]varnamevariable name
[in]timestepTime Step
Returns
maximum compression level (LOD) present
static int VAPoR::DataStatus::maxXFormPresent ( string  varname,
size_t  timestep 
)
static

Determine the maximum refinement level present for a variable at a timestep

Parameters
[in]varnamevariable name
[in]timestepTime Step
Returns
maximum refinement level (transform) present
bool VAPoR::DataStatus::reset ( DataMgrV3_0 dm,
size_t  cachesize 
)

Reset the datastatus when a new datamgr is opened. This must be called whenever the data manager changes or when any new variables are defined.

Parameters
[in]dmNew data manager
[in]cachesizecache size in megabytes
static void VAPoR::DataStatus::setDefaultLODFidelity2D ( float  q)
inlinestatic
static void VAPoR::DataStatus::setDefaultLODFidelity3D ( float  q)
inlinestatic
static void VAPoR::DataStatus::setDefaultRefinementFidelity2D ( float  q)
inlinestatic
static void VAPoR::DataStatus::setDefaultRefinementFidelity3D ( float  q)
inlinestatic
static void VAPoR::DataStatus::setFidelityDefault ( RenderParams rp)
static

Set the fidelity default settings to match the current fidelity settings in a RenderParams

Parameters
[in]rpRenderParams instance whose lod and refinement will be used for setting fidelity.
static void VAPoR::DataStatus::setUseLowerAccuracy ( bool  val)
inlinestatic

Turn on or off the option of using lower accuracy when requested accuracy is not available

Parameters
[in]valTrue to turn on this option

Definition at line 281 of file datastatus.h.

static void VAPoR::DataStatus::stretchCoords ( vector< double > &  coords)
inlinestatic

Stretch a 3-vector based on current stretch factors

Parameters

Definition at line 247 of file datastatus.h.

static void VAPoR::DataStatus::stretchCoords ( double  coords[3])
inlinestatic

Stretch a 3-vector based on current stretch factor

Parameters

Definition at line 253 of file datastatus.h.

static void VAPoR::DataStatus::stretchExtents ( vector< double >  factor)
inlinestatic

Update DataStatus based on a stretch factor. This must be called whenver the stretch factor changes.

Parameters
factor3-vector of new stretch factors

Definition at line 316 of file datastatus.h.

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

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

Return values
booltrue if lower accuracy is requested.

Definition at line 278 of file datastatus.h.


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