25 #ifndef WDATASETSCALAR_H
26 #define WDATASETSCALAR_H
32 #include <boost/thread.hpp>
35 #include <boost/shared_ptr.hpp>
38 #include "datastructures/WValueSetHistogram.h"
40 #include "WDataSetSingle.h"
53 typedef boost::shared_ptr< WDataSetScalar >
SPtr;
58 typedef boost::shared_ptr< const WDataSetScalar >
ConstSPtr;
68 boost::shared_ptr< WGrid > newGrid );
127 virtual const std::string
getName()
const;
145 boost::shared_ptr< const WValueSetHistogram >
getHistogram(
size_t buckets = 1000 );
167 template<
typename T > T
getValueAt(
int x,
int y,
int z )
const;
177 double getValueAt(
int x,
int y,
int z )
const;
199 std::map< size_t, boost::shared_ptr< WValueSetHistogram > >
m_histograms;
210 boost::shared_ptr< WGridRegular3D > grid = boost::dynamic_pointer_cast<
WGridRegular3D >(
m_grid );
212 size_t id = x + y * grid->
getNbCoordsX() + z * grid->getNbCoordsX() * grid->getNbCoordsY();
214 T v = vs->getScalar(
id );
218 #endif // WDATASETSCALAR_H
boost::shared_ptr< WGrid > m_grid
Stores the reference of the WGrid of this DataSetSingle instance.
A grid that has parallelepiped cells which all have the same proportion.
static boost::shared_ptr< WPrototyped > getPrototype()
Returns a prototype instantiated with the true type of the deriving class.
virtual ~WDataSetScalar()
Destroys this DataSet instance.
virtual const std::string getName() const
Gets the name of this prototype.
double interpolate(const WPosition &pos, bool *success) const
Interpolate the value fo the valueset at the given position.
boost::mutex m_histogramLock
The lock used for securely creating m_histogram on demand.
std::map< size_t, boost::shared_ptr< WValueSetHistogram > > m_histograms
The histograms for later use.
This only is a 3d double vector.
WDataSetScalar()
Construct an empty and unusable instance.
boost::shared_ptr< WValueSetBase > m_valueSet
Stores the reference of the WValueSet of this DataSetSingle instance.
A data set consisting of a set of values based on a grid.
static boost::shared_ptr< WPrototyped > m_prototype
The prototype as singleton.
virtual const std::string getDescription() const
Gets the description for this prototype.
double getMin() const
Returns the smallest of the scalars stored in the data set.
boost::shared_ptr< WDataSetSingle > SPtr
Convenience typedef for a boost::shared_ptr.
T getValueAt(int x, int y, int z) const
Get the value stored at a certain grid position of the data set.
Base Class for all value set types.
boost::shared_ptr< const WValueSetHistogram > getHistogram(size_t buckets=1000)
Returns the histogram of this dataset's valueset.
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.
This data set type contains scalars as values.
unsigned int getNbCoordsX() const
Returns the number of samples in x direction.
boost::shared_ptr< const WDataSetScalar > ConstSPtr
const shared_ptr abbreviation
boost::shared_ptr< WDataSetScalar > SPtr
shared_ptr abbreviation
T getValueAt(size_t id)
Get the value stored at position of the value set.