25 #ifndef WHISTOGRAM2D_H
26 #define WHISTOGRAM2D_H
32 #include <boost/array.hpp>
33 #include <core/graphicsEngine/WGETexture.h>
35 #include "WHistogramND.h"
47 typedef std::shared_ptr< WHistogram2D >
SPtr;
59 WHistogram2D(
double minX,
double maxX,
double minY,
double maxY,
size_t bucketsX,
size_t bucketsY );
90 virtual size_t operator()(
size_t i,
size_t j )
const;
124 void insert(
double x,
double y );
145 typedef Eigen::Matrix< size_t, Eigen::Dynamic, Eigen::Dynamic >
BinType;
osg::ref_ptr< WGETexture< TextureType > > RPtr
Convenience type for OSG reference pointer on WGETextures.
Uniform two dimensional histogram for double values.
virtual size_t operator()(SizeArray index) const
Get the count of the specified bucket.
std::shared_ptr< WHistogram2D > SPtr
Convenience type for a shared_ptr on this type.
BinType m_bins
Storing the bucket counts, how often a value occurs.
~WHistogram2D()
Cleans up!
WGETexture2D::RPtr getTexture()
Copy-convert this into a texture.
TArray m_intervalWidth
For each dimension this stores the uniform interval width.
virtual boost::array< std::pair< double, double >, 2 > getIntervalForIndex(SizeArray index) const
Returns the actual (right-open) interval in each dimension associated with the given index.
void insert(TArray values)
Given a value the corresponding bucket is determined and incremented by one.
WHistogram2D(double minX, double maxX, double minY, double maxY, size_t bucketsX, size_t bucketsY)
Creates a two dimensional histogram field, bounded by the given limits, containing the demanded numbe...
Eigen::Matrix< size_t, Eigen::Dynamic, Eigen::Dynamic > BinType
Shorthand for data structure storing bucket information.
WGETexture2D::RPtr getSphereTexture()
Copy-convert this into a spherical texture.
virtual double getBucketSize(SizeArray index) const
Return the measure of one specific bucket.
This template should handly arbitrary N-dimensional histograms.
boost::array< double, N > TArray
Shorthand for N-dimensional values of type T.
boost::array< size_t, N > SizeArray
Shorthand for N-dimensional indices, counter, etc.