VAPoR  0.1
Public Member Functions | Static Public Member Functions | Static Public Attributes | 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 VAPoR::ParsedXml

Public Member Functions

 Box ()
 
int GetUserExtents (double extents[6], 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)
 
const vector< double > & GetLocalExtents ()
 
int SetLocalExtents (const vector< double > &extents, int timestep=-1)
 
int SetLocalExtents (const double extents[6], int timestep=-1)
 
int SetLocalExtents (const float extents[6], int timestep=-1)
 
const vector< double > & GetAngles ()
 
int GetAngles (double ang[3])
 
int GetAngles (float ang[3])
 
int SetAngles (const double angles[3])
 
int SetAngles (const float angles[3])
 
void SetAngles (const vector< double > &vals)
 
const vector< long > & GetTimes ()
 
void SetTimes (const vector< long > &times)
 
void Trim (int numTimes=1)
 
- 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 ()
 
virtual ParamsBasedeepCopy (ParamNode *newRoot=0)
 
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)
 
ParamNodeGetRootNode ()
 
virtual ParamNodebuildNode ()
 
void SetFlagDirty (const string &flag)
 
const string & GetName ()
 
ParamsBaseType GetParamsBaseTypeId ()
 
virtual void SetRootParamNode (ParamNode *pn)
 
- Public Member Functions inherited from VAPoR::ParsedXml
virtual ~ParsedXml ()
 
virtual bool elementStartHandler (ExpatParseMgr *, int, std::string &, const char **)=0
 
virtual bool elementEndHandler (ExpatParseMgr *, int, std::string &)=0
 
virtual bool charHandler (ExpatParseMgr *, const XML_Char *, int)
 

Static Public Member Functions

static ParamsBaseCreateDefaultInstance ()
 
- 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 bool IsParamsTag (const string &tag)
 

Static Public Attributes

static const string _boxTag
 
static const string _anglesTag
 
static const string _extentsTag
 
static const string _timesTag
 

Additional Inherited Members

- Public Types inherited from VAPoR::ParamsBase
typedef int ParamsBaseType
 
- Public Attributes inherited from VAPoR::ParsedXml
ParsedXmlpreviousClass
 
- Protected Member Functions inherited from VAPoR::ParamsBase
virtual ParamNodegetCurrentParamNode ()
 
virtual void setCurrentParamNode (ParamNode *pn)
 
ParamNodeGetCurrentNode ()
 
ParamNodePush (string &tag, ParamsBase *pBase=0)
 
ParamNodePop ()
 
void Remove (const string &name)
 
const map< string, string > & GetAttributes ()
 
void Clear ()
 
- Protected Attributes inherited from VAPoR::ParamsBase
string _paramsBaseName
 
int _parseDepth
 
- Static Protected Attributes inherited from VAPoR::ParamsBase
static vector< ParamsBase * > dummyParamsBaseInstances
 
static const string _emptyString
 
static map< string, int > classIdFromTagMap
 
static map< int, string > tagFromClassIdMap
 
static map< int, BaseCreateFcn > createDefaultFcnMap
 
static int numParamsClasses
 
static int numEmbedClasses
 
- Static Protected Attributes inherited from VAPoR::ParsedXml
static const string _stringType
 
static const string _longType
 
static const string _doubleType
 
static const string _typeAttr
 

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
$Revision$
Date
$Date$

Definition at line 34 of file Box.h.

Constructor & Destructor Documentation

VAPoR::Box::Box ( )

Member Function Documentation

static ParamsBase* VAPoR::Box::CreateDefaultInstance ( )
inlinestatic

Definition at line 38 of file Box.h.

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 95 of file Box.h.

References _anglesTag.

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 102 of file Box.h.

References _anglesTag.

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 112 of file Box.h.

References _anglesTag.

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 69 of file Box.h.

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 146 of file Box.h.

References _timesTag.

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 ( 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::SetAngles ( const double  angles[3])
inline

Set the angles from a double array

Parameters
[in]angdouble[3] array of three doubles for theta, phi, psi
Return values
intzero on success

Definition at line 122 of file Box.h.

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

Set the angles from a float array

Parameters
[in]anglesfloat[3] array of three floats for theta, phi, psi
Return values
intzero on success

Definition at line 130 of file Box.h.

void VAPoR::Box::SetAngles ( const vector< double > &  vals)
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.

Definition at line 137 of file Box.h.

int VAPoR::Box::SetLocalExtents ( const vector< double > &  extents,
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. param[in] extents vector<double>& Six doubles that will be new extents param[in] timestep int Specified time step, or -1 for generic times

Return values
intzero if successful.
int VAPoR::Box::SetLocalExtents ( const double  extents[6],
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. param[in] double extents6] 6 doubles that will be new extents param[in] int timestep specified time step, or -1 for generic times

Return values
intzero if successful.
int VAPoR::Box::SetLocalExtents ( const float  extents[6],
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. param[in] float extents[6] param[in] int timestep specified time step, or -1 for generic times

Return values
intzero if successful.
void VAPoR::Box::SetTimes ( const vector< long > &  times)
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
[out]constvector<long>& vector of times

Definition at line 155 of file Box.h.

References _timesTag.

void VAPoR::Box::Trim ( int  numTimes = 1)
inline

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

Parameters
[in]numTimesint resulting length of times and extentss.

Definition at line 159 of file Box.h.

References _extentsTag, and _timesTag.

Member Data Documentation

const string VAPoR::Box::_anglesTag
static

Definition at line 170 of file Box.h.

Referenced by GetAngles().

const string VAPoR::Box::_boxTag
static

Definition at line 169 of file Box.h.

const string VAPoR::Box::_extentsTag
static

Definition at line 171 of file Box.h.

Referenced by Trim().

const string VAPoR::Box::_timesTag
static

Definition at line 172 of file Box.h.

Referenced by GetTimes(), SetTimes(), and Trim().


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