OpenWalnut
1.4.0
|
This data set type contains scalars as values. More...
#include <WDataSetScalar.h>
Public Types | |
typedef boost::shared_ptr < WDataSetScalar > | SPtr |
shared_ptr abbreviation | |
typedef boost::shared_ptr < const WDataSetScalar > | ConstSPtr |
const shared_ptr abbreviation | |
Public Member Functions | |
WDataSetScalar (boost::shared_ptr< WValueSetBase > newValueSet, boost::shared_ptr< WGrid > newGrid) | |
Constructs an instance out of an appropriate value set and a grid. | |
WDataSetScalar () | |
Construct an empty and unusable instance. | |
virtual | ~WDataSetScalar () |
Destroys this DataSet instance. | |
virtual WDataSetSingle::SPtr | clone (boost::shared_ptr< WValueSetBase > newValueSet) const |
Creates a copy (clone) of this instance but allows one to change the valueset. | |
virtual WDataSetSingle::SPtr | clone (boost::shared_ptr< WGrid > newGrid) const |
Creates a copy (clone) of this instance but allows one to change the grid. | |
virtual WDataSetSingle::SPtr | clone () const |
Creates a copy (clone) of this instance. | |
double | getMax () const |
Returns the largest of the scalars stored in the data set. | |
double | getMin () const |
Returns the smallest of the scalars stored in the data set. | |
virtual const std::string | getName () const |
Gets the name of this prototype. | |
virtual const std::string | getDescription () const |
Gets the description for this prototype. | |
boost::shared_ptr< const WValueSetHistogram > | getHistogram (size_t buckets=1000) |
Returns the histogram of this dataset's valueset. | |
double | interpolate (const WPosition &pos, bool *success) const |
Interpolate the value fo the valueset at the given position. | |
template<typename T > | |
T | getValueAt (int x, int y, int z) const |
Get the value stored at a certain grid position of the data set. | |
double | getValueAt (int x, int y, int z) const |
Get the value stored at a certain grid position of the data set. | |
Static Public Member Functions | |
static boost::shared_ptr < WPrototyped > | getPrototype () |
Returns a prototype instantiated with the true type of the deriving class. | |
Static Protected Attributes | |
static boost::shared_ptr < WPrototyped > | m_prototype = boost::shared_ptr< WPrototyped >() |
The prototype as singleton. | |
Private Attributes | |
std::map< size_t, boost::shared_ptr < WValueSetHistogram > > | m_histograms |
The histograms for later use. | |
boost::mutex | m_histogramLock |
The lock used for securely creating m_histogram on demand. |
This data set type contains scalars as values.
Definition at line 43 of file WDataSetScalar.h.
typedef boost::shared_ptr< const WDataSetScalar > WDataSetScalar::ConstSPtr |
const shared_ptr abbreviation
Reimplemented from WDataSetSingle.
Definition at line 54 of file WDataSetScalar.h.
typedef boost::shared_ptr< WDataSetScalar > WDataSetScalar::SPtr |
shared_ptr abbreviation
Reimplemented from WDataSetSingle.
Definition at line 49 of file WDataSetScalar.h.
WDataSetScalar::WDataSetScalar | ( | boost::shared_ptr< WValueSetBase > | newValueSet, |
boost::shared_ptr< WGrid > | newGrid | ||
) |
Constructs an instance out of an appropriate value set and a grid.
Computes the maximum an minimum values stored as member variables.
newValueSet | the scalar value set to use |
newGrid | the grid which maps world space to the value set |
Definition at line 38 of file WDataSetScalar.cpp.
Construct an empty and unusable instance.
This is needed for the prototype mechanism.
Definition at line 48 of file WDataSetScalar.cpp.
Referenced by clone(), and getPrototype().
WDataSetScalar::~WDataSetScalar | ( | ) | [virtual] |
Destroys this DataSet instance.
Definition at line 54 of file WDataSetScalar.cpp.
WDataSetSingle::SPtr WDataSetScalar::clone | ( | boost::shared_ptr< WValueSetBase > | newValueSet | ) | const [virtual] |
Creates a copy (clone) of this instance but allows one to change the valueset.
Unlike copy construction, this is a very useful function if you want to keep the dynamic type of your dataset even if you just have a WDataSetSingle.
newValueSet | the new valueset. |
Reimplemented from WDataSetSingle.
Definition at line 58 of file WDataSetScalar.cpp.
References WDataSetSingle::getGrid(), and WDataSetScalar().
WDataSetSingle::SPtr WDataSetScalar::clone | ( | boost::shared_ptr< WGrid > | newGrid | ) | const [virtual] |
Creates a copy (clone) of this instance but allows one to change the grid.
Unlike copy construction, this is a very useful function if you want to keep the dynamic type of your dataset even if you just have a WDataSetSingle.
newGrid | the new grid. |
Reimplemented from WDataSetSingle.
Definition at line 63 of file WDataSetScalar.cpp.
References WDataSetSingle::getValueSet(), and WDataSetScalar().
WDataSetSingle::SPtr WDataSetScalar::clone | ( | ) | const [virtual] |
Creates a copy (clone) of this instance.
Unlike copy construction, this is a very useful function if you want to keep the dynamic type of your dataset even if you just have a WDataSetSingle.
Reimplemented from WDataSetSingle.
Definition at line 68 of file WDataSetScalar.cpp.
References WDataSetSingle::getGrid(), WDataSetSingle::getValueSet(), and WDataSetScalar().
std::string const WDataSetScalar::getDescription | ( | ) | const [virtual] |
Gets the description for this prototype.
Reimplemented from WDataSetSingle.
Definition at line 78 of file WDataSetScalar.cpp.
boost::shared_ptr< const WValueSetHistogram > WDataSetScalar::getHistogram | ( | size_t | buckets = 1000 | ) |
Returns the histogram of this dataset's valueset.
If it does not exist yet, it will be created and cached. It does NOT make use of the WValueSetHistogram down scaling feature even though the number of buckets might be lower than the default as the down scaling might introduce errors. To use down-scaling, grab the default histogram and call WValueSetHistogram( getHistogram(), buckets ) manually.
buckets | the number of buckets inside the histogram. |
Definition at line 164 of file WDataSetScalar.cpp.
References m_histogramLock, m_histograms, and WDataSetSingle::m_valueSet.
double WDataSetScalar::getMax | ( | ) | const |
Returns the largest of the scalars stored in the data set.
Definition at line 83 of file WDataSetScalar.cpp.
References WDataSetSingle::m_valueSet.
double WDataSetScalar::getMin | ( | ) | const |
Returns the smallest of the scalars stored in the data set.
Definition at line 88 of file WDataSetScalar.cpp.
References WDataSetSingle::m_valueSet.
std::string const WDataSetScalar::getName | ( | ) | const [virtual] |
Gets the name of this prototype.
Reimplemented from WDataSetSingle.
Definition at line 73 of file WDataSetScalar.cpp.
boost::shared_ptr< WPrototyped > WDataSetScalar::getPrototype | ( | ) | [static] |
Returns a prototype instantiated with the true type of the deriving class.
Reimplemented from WDataSetSingle.
Definition at line 93 of file WDataSetScalar.cpp.
References m_prototype, and WDataSetScalar().
T WDataSetScalar::getValueAt | ( | int | x, |
int | y, | ||
int | z | ||
) | const |
Get the value stored at a certain grid position of the data set.
x | index in x direction |
y | index in y direction |
z | index in z direction |
Definition at line 156 of file WDataSetScalar.cpp.
References WGridRegular3DTemplate< T >::getNbCoordsX(), and WDataSetSingle::m_grid.
Referenced by interpolate().
double WDataSetScalar::getValueAt | ( | int | x, |
int | y, | ||
int | z | ||
) | const |
Get the value stored at a certain grid position of the data set.
x | index in x direction |
y | index in y direction |
z | index in z direction |
double WDataSetScalar::interpolate | ( | const WPosition & | pos, |
bool * | success | ||
) | const |
Interpolate the value fo the valueset at the given position.
If interpolation fails, the success parameter will be false and the value returned zero.
pos | The position for wich we would like to get a value. |
success | indicates whether the interpolation was successful |
Definition at line 103 of file WDataSetScalar.cpp.
References getValueAt(), WDataSetSingle::m_grid, and WDataSetSingle::m_valueSet.
Referenced by WDataSetTimeSeries::interpolate(), WDataSetScalarTest::testInterpolate(), and WDataSetScalarTest::testInterpolateInRotatedGrid().
boost::mutex WDataSetScalar::m_histogramLock [private] |
The lock used for securely creating m_histogram on demand.
Definition at line 200 of file WDataSetScalar.h.
Referenced by getHistogram().
std::map< size_t, boost::shared_ptr< WValueSetHistogram > > WDataSetScalar::m_histograms [private] |
The histograms for later use.
Each histogram for a requested bucket count gets cached.
Definition at line 195 of file WDataSetScalar.h.
Referenced by getHistogram().
boost::shared_ptr< WPrototyped > WDataSetScalar::m_prototype = boost::shared_ptr< WPrototyped >() [static, protected] |
The prototype as singleton.
Reimplemented from WDataSetSingle.
Definition at line 189 of file WDataSetScalar.h.
Referenced by getPrototype().