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

3D or 2D box with options for orientation angles and extents changing in time. Intended to be used in any Params class More...

#include <Box.h>

Inheritance diagram for VAPoR::Box:
VAPoR::ParamsBase

Public Member Functions

 Box ()
 
virtual ~Box ()
 
int GetUserExtents (double extents[6], size_t timestep)
 
int GetUserExtents (vector< double > minExts, vector< double >maxExts, size_t timestep)
 
int GetUserExtents (float extents[6], size_t timestep)
 
int GetLocalExtents (double extents[6], int timestep=-1)
 
int GetLocalExtents (float extents[6], int timestep=-1)
 
int GetStretchedLocalExtents (double extents[6], int timestep=-1)
 
const vector< double > GetLocalExtents ()
 
int SetLocalExtents (const vector< double > &extents, Params *p, int timestep=-1)
 
int SetLocalExtents (const double extents[6], Params *p, int timestep=-1)
 
int SetLocalExtents (const float extents[6], Params *p, int timestep=-1)
 
int SetStretchedLocalExtents (const double extents[6], Params *p, int timestep=-1)
 
const vector< double > GetAngles ()
 
int GetAngles (double ang[3])
 
int GetAngles (float ang[3])
 
int SetAngles (const double angles[3], Params *p)
 
int SetAngles (const float angles[3], Params *p)
 
void SetAngles (const vector< double > &vals, Params *p)
 
const vector< long > GetTimes ()
 
void SetTimes (const vector< long > &times, Params *p)
 
void Trim (Params *p, int numTimes=1)
 
bool IsPlanar ()
 
void SetPlanar (bool value, Params *p)
 
int GetOrientation ()
 
void SetOrientation (long value, Params *p)
 
- 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 ()
 

Internal

Internal methods not intended for general use

void calcContainingBoxExtents (double extents[6], bool rotated=false)
 
void calcContainingStretchedBoxExtents (double extents[6], bool rotated=false)
 
void calcRotatedBoxExtents (double extents[6])
 
void calcRotatedStretchedBoxExtents (double extents[6])
 
bool cropToBox (const double boxExts[6], Params *p)
 
bool intersectRotatedBox (double boxexts[6], double pointFound[3], double probeCoords[2])
 
bool fitToBox (const double boxExts[6], Params *p)
 
void setBoxToExtents (const double extents[6], Params *pParams)
 
int interceptBox (const double boxExts[6], double intercept[6][3])
 
void getRotatedVoxelExtents (string varname, float voxdims[2], int numRefinements)
 
void rotateAndRenormalize (int axis, double rotVal, Params *p)
 
static ParamsBaseCreateDefaultInstance ()
 

Additional Inherited Members

- Public Types inherited from VAPoR::ParamsBase
typedef int ParamsBaseType
 
- 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)
 

Detailed Description

3D or 2D box with options for orientation angles and extents changing in time. Intended to be used in any Params class

Author
Alan Norton
Version
3.0
Date
March 2014

The Box class supports various rectangular boxes, possibly rotated, used in VAPOR to specify extents and also used in Manipulators. Each Box is based on coordinates in "local extents", i.e. coordinates relative to the full extents of the VDC data at the current time step. To convert to user coordinates requires translating the local box extents by the user coordinates of the minimum x, y, and z user coordinates of the VDC.

Definition at line 43 of file Box.h.

Constructor & Destructor Documentation

VAPoR::Box::Box ( )
virtual VAPoR::Box::~Box ( )
inlinevirtual

Definition at line 47 of file Box.h.

Member Function Documentation

void VAPoR::Box::calcContainingBoxExtents ( double  extents[6],
bool  rotated = false 
)
inline

method supports rotated boxes such as probe Specifies an axis-aligned box containing the rotated box. By default it just finds the box extents. Caller must supply extents array, which gets its values filled in.

Parameters
[out]float[6]Extents of containing box [in] rotated indicates if the box is possibly rotated

Definition at line 240 of file Box.h.

void VAPoR::Box::calcContainingStretchedBoxExtents ( double  extents[6],
bool  rotated = false 
)
inline

method supports rotated boxes such as probe Specifies an axis-aligned box containing the stretched rotated box. By default it just finds the box extents. Caller must supply extents array, which gets its values filled in.

Parameters
[out]float[6]Extents of containing box [in] rotated indicates if the box is possibly rotated

Definition at line 250 of file Box.h.

void VAPoR::Box::calcRotatedBoxExtents ( double  extents[6])

If the box is rotated, this method calculated the minimal axis-aligned extents containing all 8 corners of the box.

Parameters
[out]doubleextents[6] is smallest extents containing the box.
void VAPoR::Box::calcRotatedStretchedBoxExtents ( double  extents[6])

If the box is rotated, this method calculated the minimal axis-aligned extents of a stretched box containing all 8 corners of the box.

Parameters
[out]doubleextents[6] is smallest extents containing the box.
static ParamsBase* VAPoR::Box::CreateDefaultInstance ( )
inlinestatic

Required static method for extensibility:

Return values
ParamsBase*pointer to a default Params instance

Definition at line 232 of file Box.h.

bool VAPoR::Box::cropToBox ( const double  boxExts[6],
Params p 
)
bool VAPoR::Box::fitToBox ( const double  boxExts[6],
Params p 
)
const vector<double> VAPoR::Box::GetAngles ( )
inline

Get the three orientation angles (theta, phi, psi) Defaults to empty vector if no angles are set.

Return values
constvector<double> vector of length 3 of angles.

Definition at line 126 of file Box.h.

int VAPoR::Box::GetAngles ( double  ang[3])
inline

Get the angles as a double array

Parameters
[out]doubleangles[3] array of three doubles for theta, phi, psi
Return values
intzero if successful

Definition at line 133 of file Box.h.

int VAPoR::Box::GetAngles ( float  ang[3])
inline

Get the angles as a float array

Parameters
[out]angles[3]float array of three floats for theta, phi, psi
Return values
zeroif successful

Definition at line 143 of file Box.h.

int VAPoR::Box::GetLocalExtents ( double  extents[6],
int  timestep = -1 
)

Get the local box extents as a double array. If timestep is >= 0, then get it just for the specified timestep

Parameters
[out]extents[6]double Returned extents
[in]timestepint Specific time step being retrieved, or -1 for generic time steps
Return values
intzero if successful.
int VAPoR::Box::GetLocalExtents ( float  extents[6],
int  timestep = -1 
)

Get the local box extents as a float array. If timestep is >= 0, then get it just for the specified timestep

Parameters
[out]extents[6]float Returned extents
[in]timestepint Specific time step being retrieved, or -1 for generic time steps int zero if successful.
const vector<double> VAPoR::Box::GetLocalExtents ( )
inline

Get the local box extents as a vector. First 6 values are default; additional values are associated with non-default regions

See also
GetTimes()
Parameters
[out]extentsconst vector<double>& returned extents

Definition at line 90 of file Box.h.

int VAPoR::Box::GetOrientation ( )
inline

Indicate the orientation of a (2D) box This is 0,1, or 2 based on the axis orthogonal to the box. For 3D boxes this is -1.

Definition at line 215 of file Box.h.

void VAPoR::Box::getRotatedVoxelExtents ( string  varname,
float  voxdims[2],
int  numRefinements 
)
int VAPoR::Box::GetStretchedLocalExtents ( double  extents[6],
int  timestep = -1 
)

Get the stretched local box extents as a float array. If timestep is >= 0, then get it just for the specified timestep

Parameters
[out]extents[6]float Returned extents
[in]timestepint Specific time step being retrieved, or -1 for generic time steps int zero if successful.
const vector<long> VAPoR::Box::GetTimes ( )
inline

Get the time(s) as a long vector. The first one should be negative, marking the default extents. Subsequent times are nonnegative integers indicating times for nondefault extents. Number of times should be 1/6 of the number of extents values

See also
GetExtents()
Return values
vector<long>&vector of longs

Definition at line 180 of file Box.h.

int VAPoR::Box::GetUserExtents ( double  extents[6],
size_t  timestep 
)

Get the box user extents as a double array at a specified time step >= 0

Parameters
[out]extents[6]double Returned extents
[in]timestepsize_t Specific time step being retrieved
Return values
intzero if successful.
int VAPoR::Box::GetUserExtents ( vector< double >  minExts,
vector< double >  maxExts,
size_t  timestep 
)

Get the box user extents as vector<double> at a specified time step >= 0

Parameters
[out]extents[6]double Returned extents
[in]timestepsize_t Specific time step being retrieved
Return values
intzero if successful.
int VAPoR::Box::GetUserExtents ( float  extents[6],
size_t  timestep 
)

Get the user box extents as a float array at specified time step for the specified timestep

Parameters
[out]extents[6]float Returned extents
[in]timestepsize_t Specific time step being retrieved int zero if successful.
int VAPoR::Box::interceptBox ( const double  boxExts[6],
double  intercept[6][3] 
)
bool VAPoR::Box::intersectRotatedBox ( double  boxexts[6],
double  pointFound[3],
double  probeCoords[2] 
)
bool VAPoR::Box::IsPlanar ( )
inline

Indicate whether or not the box is constrained to be planar. This is true for 2D boxes and for Probe, if the probe is set to be planar.

Definition at line 203 of file Box.h.

void VAPoR::Box::rotateAndRenormalize ( int  axis,
double  rotVal,
Params p 
)
int VAPoR::Box::SetAngles ( const double  angles[3],
Params p 
)
inline

Set the angles from a double array

Parameters
[in]angdouble[3] array of three doubles for theta, phi, psi
[in]Params*params that owns this box
Return values
intzero on success

Definition at line 154 of file Box.h.

int VAPoR::Box::SetAngles ( const float  angles[3],
Params p 
)
inline

Set the angles from a float array

Parameters
[in]anglesfloat[3] array of three floats for theta, phi, psi
[in]Params*params that owns this box
Return values
intzero on success

Definition at line 163 of file Box.h.

void VAPoR::Box::SetAngles ( const vector< double > &  vals,
Params p 
)
inline

Set the three orientation angles (theta, phi, psi) from a vector of doubles

Parameters
[in]valsconst vector<double>& vector of length 3 of angles.
[in]Params*params that owns this box

Definition at line 171 of file Box.h.

void VAPoR::Box::setBoxToExtents ( const double  extents[6],
Params pParams 
)
int VAPoR::Box::SetLocalExtents ( const vector< double > &  extents,
Params p,
int  timestep = -1 
)

Specify the local extents. If time step is -1, then set the generic extents. Otherwise set the extents for a specific timestep.

Parameters
[in]extentsvector<double>& Six doubles that will be new extents
[in]Params*params that owns this box
[in]timestepint Specified time step, or -1 for generic times
Return values
intzero if successful.
int VAPoR::Box::SetLocalExtents ( const double  extents[6],
Params p,
int  timestep = -1 
)

Specify the local extents as a double array. If time step is -1, then set the generic extents. Otherwise set the extents for a specific timestep.

Parameters
[in]doubleextents[6] 6 doubles that will be new extents
[in]Params*params that owns this box
[in]inttimestep specified time step, or -1 for generic times
Return values
intzero if successful.
int VAPoR::Box::SetLocalExtents ( const float  extents[6],
Params p,
int  timestep = -1 
)

Specify the local extents as a float array. If time step is -1, then set the generic extents. Otherwise set the extents for a specific timestep.

Parameters
[in]floatextents[6]
[in]Params*params that owns this box
[in]inttimestep specified time step, or -1 for generic times
Return values
intzero if successful.
void VAPoR::Box::SetOrientation ( long  value,
Params p 
)
inline

Set the value of the orientation state, indicating the axis orthogonal to a 2D box (or -1 for 3D boxes)

Parameters
[in]valuelong indicates the orientation value
[in]Params*params that owns this box

Definition at line 222 of file Box.h.

void VAPoR::Box::SetPlanar ( bool  value,
Params p 
)
inline

Set the value of the planar state, indicating whether or not the box is constrained to be planar

Parameters
[in]valuebool indicates whether or be planar
[in]Params*params that owns this box

Definition at line 209 of file Box.h.

int VAPoR::Box::SetStretchedLocalExtents ( const double  extents[6],
Params p,
int  timestep = -1 
)

Specify the stretched local extents as a float array. If time step is -1, then set the generic extents. Otherwise set the extents for a specific timestep.

Parameters
[in]floatextents[6]
[in]Params*params that owns this box
[in]inttimestep specified time step, or -1 for generic times
Return values
intzero if successful.
void VAPoR::Box::SetTimes ( const vector< long > &  times,
Params p 
)
inline

Set the time(s) as a long vector. The first one should be negative, marking the default extents. Subsequent times are nonnegative integers indicating times for nondefault extents. This vector should be the same size as the extents vector.

Parameters
[in]Params*params that owns this box
[in]constvector<long>& vector of times

Definition at line 190 of file Box.h.

void VAPoR::Box::Trim ( Params p,
int  numTimes = 1 
)

Trim both the times and extents vectors to same length. Default is to length 1

Parameters
[in]Params*params that owns this box
[in]numTimesint resulting length of times and extentss.

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