25 #ifndef WMMULTIHISTOGRAMVIEW_H
26 #define WMMULTIHISTOGRAMVIEW_H
32 #include <boost/thread.hpp>
35 #include "core/common/WCounter.h"
36 #include "core/common/WHistogramBasic.h"
37 #include "core/common/math/linearAlgebra/WMatrixFixed.h"
38 #include "core/dataHandler/WDataSetSingle.h"
39 #include "core/graphicsEngine/WGEGroupNode.h"
40 #include "core/kernel/WModule.h"
41 #include "core/kernel/WModuleInputData.h"
42 #include "core/kernel/WModuleOutputData.h"
43 #include "core/ui/WUIViewWidget.h"
70 virtual const std::string
getName()
const;
84 virtual std::shared_ptr< WModule >
factory()
const;
132 void handleResize(
int x,
int y,
int width,
int height );
226 double findOptimalSpacing(
double intervalLength,
double availableSpace,
double textSize );
320 std::vector< std::shared_ptr< WModuleInputData< WDataSetSingle > > >
m_input;
323 std::vector< std::shared_ptr< WDataSetSingle > >
m_data;
This is a simple but thread-safe counter.
A module that draws a histogram of one or mode scalar datasets in a custom widget.
void createFrame()
Creates the geometry for the frame and the ticks/labels.
virtual void requirements()
Initialize requirements for this module.
WMMultiHistogramView()
Constuctor.
int m_instanceID
The number of this WMHistogram instance. Used to generate a unique window title for every instance of...
WVector2d m_frameLowerLeft
The lower left vertex of the frame box in histogram coordinates.
osg::ref_ptr< osg::Geode > m_infoNode
Draws histogram bin info to the top right corner of the window.
void redraw()
Redraws the histogram and add it to the main geode.
void calculateFramePosition()
Finds a good position of the frame relative to the lower left corner of the window.
void createGeometryBars(int type)
Creates the geometry for histogram bars.
virtual std::shared_ptr< WModule > factory() const
Due to the prototype design pattern used to build modules, this method returns a new instance of this...
WVector2d windowSpaceToHistogramSpace(WVector2d const &v)
This is the inverse of histogramSpaceToWindowSpace.
std::vector< boost::function< void(void) > > m_geometryFunctions
A vector containing functions to use for histogram geometry generation.
void calculateFrameSize()
Finds a good size for the frame, depending on the chosen spacing for axis labels.
virtual void moduleMain()
Entry point after loading the module.
virtual void properties()
Initialize the properties for this module.
std::vector< WPropColor > m_colors
A vector of color properties for the datasets.
std::shared_ptr< WCondition > m_propCondition
A condition for property updates.
boost::mutex m_redrawMutex
Whenever a redraw is made this mutex should be used.
void handleMouseMove(WVector2f pos)
Called on every mouse move event from the custom widget.
osg::ref_ptr< osg::Geode > m_frameNode
Draws the frame and ticks/labels.
void calculateHistograms()
This simply calculates a histogram per dataset, where the bin sizes and positions are the same for ea...
void createGeometryStairs(int type)
Creates the geometry for stairs (i.e.
void handleResize(int x, int y, int width, int height)
Called on every resize event from the custom widget.
virtual const std::string getDescription() const
Gives back a description of this module.
void createNothing()
This simply prints a NYI message to the errorLog.
WVector2d m_frameSpacing
The spacing between labels at the histogram axis in histogram coordinates.
virtual const std::string getName() const
Gives back the name of this module.
std::vector< std::shared_ptr< WDataSetSingle > > m_data
A vector of current datasets.
int m_windowHeight
The height of the window.
osg::ref_ptr< WGEGroupNode > m_mainNode
The scene node of the custom window. All geometry nodes are added as children of this node.
WPropInt m_histoBins
A property that is used to set the number of bins to use.
WUIViewWidget::SPtr m_widget
Holds the reference to the custom widget used for displaying the histogram.
double findOptimalSpacing(double intervalLength, double availableSpace, double textSize)
This finds a suitable spacing of ticks to use for an axis with a certain length and value interval.
WVector2d m_frameUpperRight
The upper right vertex of the frame box in histogram coordinates.
void createInfo(WVector2f mousePos)
Writes the values of the currently selected histogram bin to the top right corner of the window.
int m_windowWidth
The width of the window.
WVector2d m_histogramUpperRight
The upper right corner of the histogram in histogram coordinates.
WVector2d histogramSpaceToWindowSpace(WVector2d const &v)
This transforms histogram space coordinates to window coordinates.
static WCounter m_instanceCounter
The instance counter used to get the instance ID.
std::vector< std::shared_ptr< WModuleInputData< WDataSetSingle > > > m_input
A vector of input connectors.
virtual const char ** getXPMIcon() const
Get the icon for this module in XPM format.
std::vector< std::shared_ptr< WHistogramBasic > > m_histograms
A vector of histograms, one histogram per input.
WVector2d m_histogramLowerLeft
The lower left corner of the histogram in histogram coordinates.
virtual ~WMMultiHistogramView()
Destructor.
boost::mutex m_createInfoMutex
Whenever a new info node is made this mutex should be used.
WVector2d m_framePosition
The space to the left and under the frame in window coordinates.
double const m_frameSize
The distance between the histogram frame and the top resp. right side of the window in relative windo...
void createGeometryCurves(int type)
Creates the geometry for curves.
virtual void connectors()
Initialize the connectors this module is using.
WPropSelection m_styleSelection
Allows to select which one of the geometry generation functions should be used.
void updateHistogramMax(bool cumulative)
This updates the maximum value of the histograms.
WVector2d m_mousePos
The position of the mouse cursor in window coordinates.
osg::ref_ptr< osg::Geode > m_markerNode
Draws a marker showing the currently selected histogram bin.
A fixed size matrix class.
Class representing a single module of OpenWalnut.