32 #include <boost/bind/bind.hpp>
33 #include <boost/thread/locks.hpp>
34 #include <boost/thread/mutex.hpp>
35 #include <osg/Drawable>
37 #include <osg/Geometry>
38 #include <osg/LineWidth>
39 #include <osgText/Text>
41 #include "WMHistogramView.xpm"
42 #include "WMMultiHistogramView.h"
43 #include "core/common/WPathHelper.h"
44 #include "core/common/WStringUtils.h"
45 #include "core/graphicsEngine/WGERequirement.h"
46 #include "core/kernel/WKernel.h"
47 #include "core/ui/WUI.h"
48 #include "core/ui/WUIViewEventHandler.h"
49 #include "core/ui/WUIViewWidget.h"
74 return WMHistogramView_xpm;
78 return "MultiHistogramView";
83 return "Draws histograms of one or more datasets.";
90 for( std::size_t k = 0; k <
m_input.size(); ++k )
92 m_input[ k ] = std::shared_ptr< WModuleInputData< WDataSetSingle > >(
96 "A dataset to show in the histogram viewer." ) );
111 std::shared_ptr< WItemSelection > selections(
new WItemSelection() );
115 selections->addItem(
"Bars",
"Draws transparent bars on top of each other." );
118 selections->addItem(
"Parallel Bars",
"Draws bars of the datasets next to each other per bin." );
121 selections->addItem(
"Cumulative Bars",
"Draws stacked bars." );
124 selections->addItem(
"Curves",
"Draws curves." );
127 selections->addItem(
"Cumulative Curves",
"Draws stacked curves." );
130 selections->addItem(
"Stairs",
"Draws 'stairs'." );
133 selections->addItem(
"Cumulative Stairs",
"Draws stacked 'staris'" );
144 for( std::size_t k = 0; k <
m_colors.size(); ++k )
147 std::string(
"Choose a color for the histogram of input dataset " )
205 for( std::size_t k = 0; k <
m_input.size(); ++k )
225 boost::placeholders::_1,
226 boost::placeholders::_2,
227 boost::placeholders::_3,
228 boost::placeholders::_4 ) );
242 errorLog() <<
"Could not acquire scene node from widget.";
247 errorLog() <<
"Could not create widget for the histogram.";
266 bool dataChanged =
false;
267 bool hasData =
false;
268 for( std::size_t k = 0; k <
m_data.size(); ++k )
270 dataChanged = dataChanged || (
m_input[ k ]->getData() &&
m_data[ k ] !=
m_input[ k ]->getData() );
271 hasData = hasData || (
m_input[ k ]->getData() ||
m_data[ k ] );
279 bool colorChanged =
false;
280 for( std::size_t k = 0; k <
m_colors.size(); ++k )
282 colorChanged = colorChanged |
m_colors[ k ]->changed();
287 infoLog() <<
"Recalculating histogram.";
290 for( std::size_t k = 0; k <
m_data.size(); ++k )
319 debugLog() <<
"Finished. Good bye!";
327 errorLog() <<
"BUG: There is no geometry generation function for this style!";
347 double min = std::numeric_limits< double >::max();
348 double max = std::numeric_limits< double >::min();
349 for( std::size_t k = 0; k <
m_data.size(); ++k )
355 if( min >
m_data[ k ]->getValueSet()->getMinimumValue() )
357 min =
m_data[ k ]->getValueSet()->getMinimumValue();
359 if( max <
m_data[ k ]->getValueSet()->getMaximumValue() )
361 max =
m_data[ k ]->getValueSet()->getMaximumValue();
366 for( std::size_t k = 0; k <
m_data.size(); ++k )
374 for( std::size_t j = 0; j <
m_data[ k ]->getValueSet()->size(); ++j )
392 double max = std::numeric_limits< double >::min();
395 for( std::size_t j = 0; j <
m_histograms[ 0 ]->size(); ++j )
399 for( std::size_t k = 0; k <
m_data.size(); ++k )
407 val = std::max( val,
static_cast< double >(
m_histograms[ k ]->at( j ) ) );
421 std::size_t numData = 0;
422 for( std::size_t k = 0; k <
m_data.size(); ++k )
430 double const onenth = 1.0 / numData;
437 std::vector< std::size_t > accu(
m_histograms[ 0 ]->size(), 0 );
447 for(
int k =
m_data.size() - 1; k >= 0; --k )
458 osg::ref_ptr< osg::Geode > geode =
new osg::Geode();
459 geode->setDataVariance( osg::Object::STATIC );
461 osg::ref_ptr< osg::Vec2Array > quadVertices =
new osg::Vec2Array;
462 osg::ref_ptr< osg::Vec2Array > quadTexCoords =
new osg::Vec2Array;
463 osg::ref_ptr< osg::Vec4Array > quadColors =
new osg::Vec4Array;
465 osg::ref_ptr< osg::Vec2Array > lineVertices =
new osg::Vec2Array;
466 osg::ref_ptr< osg::Vec4Array > lineColors =
new osg::Vec4Array;
469 WColor color =
m_colors[ k ]->get(
true );
470 WColor lighterColor = WColor( color[ 0 ] * 1.1, color[ 1 ] * 1.1, color[ 2 ] * 1.1, 1.0 );
471 WColor darkerColor = WColor( color[ 0 ] * 0.9, color[ 1 ] * 0.9, color[ 2 ] * 0.9, 1.0 );
473 if( type == 1 && h != 0 )
475 color[ 3 ] = lighterColor[ 3 ] = darkerColor[ 3 ] = 0.8;
477 quadColors->push_back( color );
480 for( std::size_t j = 0; j <
m_histograms[ k ]->size(); ++j )
483 std::pair< double, double > barPosHistoCoordsX =
m_histograms[ k ]->getIntervalForIndex( j );
484 WVector2d barLowerLeft( barPosHistoCoordsX.first, accu[ j ] );
493 double newWidth = onenth * ( barUpperRight[ 0 ] - barLowerLeft[ 0 ] );
494 barLowerLeft[ 0 ] = barLowerLeft[ 0 ] + newWidth * h;
495 barUpperRight[ 0 ] = barLowerLeft[ 0 ] + newWidth;
507 quadTexCoords->push_back(
WVector2d( barPosHistoCoordsX.first, 0.0 ) );
508 quadTexCoords->push_back(
WVector2d( barPosHistoCoordsX.second, 0.0 ) );
509 quadTexCoords->push_back(
WVector2d( barPosHistoCoordsX.second, 0.0 ) );
510 quadTexCoords->push_back(
WVector2d( barPosHistoCoordsX.first, 0.0 ) );
521 lineColors->push_back( lighterColor );
522 lineColors->push_back( lighterColor );
523 lineColors->push_back( lighterColor );
524 lineColors->push_back( lighterColor );
525 lineColors->push_back( darkerColor );
526 lineColors->push_back( darkerColor );
536 osg::ref_ptr< osg::Geometry > geometry =
new osg::Geometry;
538 geometry->addPrimitiveSet(
new osg::DrawArrays( osg::PrimitiveSet::QUADS, 0, 4 *
m_histograms[ k ]->size() ) );
539 geometry->setVertexArray( quadVertices );
540 geometry->setColorArray( quadColors );
541 geometry->setColorBinding( osg::Geometry::BIND_OVERALL );
542 geometry->setTexCoordArray( 0, quadTexCoords );
545 geometry->setUseDisplayList(
false );
546 geometry->setUseVertexBufferObjects(
true );
548 geode->addDrawable( geometry );
553 osg::ref_ptr< osg::Geometry > geometry =
new osg::Geometry;
555 geometry->addPrimitiveSet(
new osg::DrawArrays( osg::PrimitiveSet::LINES, 0, 6 *
m_histograms[ k ]->size() ) );
556 geometry->setVertexArray( lineVertices );
557 geometry->setColorArray( lineColors );
558 geometry->setColorBinding( osg::Geometry::BIND_PER_VERTEX );
561 geometry->setUseDisplayList(
false );
562 geometry->setUseVertexBufferObjects(
true );
564 geode->addDrawable( geometry );
570 osg::StateSet* state = geode->getOrCreateStateSet();
571 state->setMode( GL_LIGHTING, osg::StateAttribute::OFF | osg::StateAttribute::PROTECTED );
574 state->setMode( GL_DEPTH_TEST, osg::StateAttribute::OFF );
579 state->setMode( GL_BLEND, osg::StateAttribute::ON );
580 state->setRenderingHint( osg::StateSet::TRANSPARENT_BIN );
584 state->setMode( GL_BLEND, osg::StateAttribute::OFF );
586 state->setRenderBinDetails( 1001 +
m_data.size() - k,
"RenderBin" );
595 std::vector< std::size_t > accu(
m_histograms[ 0 ]->size(), 0 );
605 for( std::size_t k = 0; k <
m_data.size(); ++k )
616 osg::ref_ptr< osg::Geode > geode =
new osg::Geode();
617 geode->setDataVariance( osg::Object::STATIC );
619 osg::ref_ptr< osg::Vec2Array > quadVertices =
new osg::Vec2Array;
620 osg::ref_ptr< osg::Vec2Array > quadTexCoords =
new osg::Vec2Array;
621 osg::ref_ptr< osg::Vec4Array > quadColors =
new osg::Vec4Array;
623 osg::ref_ptr< osg::Vec2Array > lineVertices =
new osg::Vec2Array;
624 osg::ref_ptr< osg::Vec4Array > lineColors =
new osg::Vec4Array;
627 WColor color =
m_colors[ k ]->get(
true );
637 c[ 2 ] = 0.8 + c[ 2 ] * 0.2;
638 c[ 1 ] = 0.8 + c[ 1 ] * 0.2;
639 c[ 0 ] = 0.8 + c[ 0 ] * 0.2;
642 quadColors->push_back( c );
643 lineColors->push_back( color );
646 for( std::size_t j = 0; j <
m_histograms[ k ]->size() - 1; ++j )
649 double quadLeft =
m_histograms[ k ]->getIntervalForIndex( j ).first +
m_histograms[ k ]->getIntervalForIndex( j ).second;
651 double quadRight =
m_histograms[ k ]->getIntervalForIndex( j + 1 ).first +
m_histograms[ k ]->getIntervalForIndex( j + 1 ).second;
655 quad[ 0 ] =
WVector2d( quadLeft, accu[ j ] );
656 quad[ 1 ] =
WVector2d( quadRight, accu[ j + 1 ] );
661 for( std::size_t i = 0; i < 4; ++i )
664 quadVertices->push_back( quad[ i ] );
668 quadTexCoords->push_back(
WVector2d( quadLeft, 0.0 ) );
669 quadTexCoords->push_back(
WVector2d( quadRight, 0.0 ) );
670 quadTexCoords->push_back(
WVector2d( quadRight, 0.0 ) );
671 quadTexCoords->push_back(
WVector2d( quadLeft, 0.0 ) );
676 lineVertices->push_back( quad[ 3 ] );
678 lineVertices->push_back( quad[ 2 ] );
683 for( std::size_t j = 0; j <
m_histograms[ k ]->size(); ++j )
691 osg::ref_ptr< osg::Geometry > geometry =
new osg::Geometry;
693 geometry->addPrimitiveSet(
new osg::DrawArrays( osg::PrimitiveSet::QUADS, 0, 4 *
m_histograms[ k ]->size() - 4 ) );
694 geometry->setVertexArray( quadVertices );
695 geometry->setColorArray( quadColors );
696 geometry->setColorBinding( osg::Geometry::BIND_OVERALL );
697 geometry->setTexCoordArray( 0, quadTexCoords );
700 geometry->setUseDisplayList(
false );
701 geometry->setUseVertexBufferObjects(
true );
703 geode->addDrawable( geometry );
708 osg::ref_ptr< osg::Geometry > geometry =
new osg::Geometry;
710 geometry->addPrimitiveSet(
new osg::DrawArrays( osg::PrimitiveSet::LINE_STRIP, 0,
m_histograms[ k ]->size() ) );
711 geometry->setVertexArray( lineVertices );
712 geometry->setColorArray( lineColors );
713 geometry->setColorBinding( osg::Geometry::BIND_OVERALL );
716 geometry->setUseDisplayList(
false );
717 geometry->setUseVertexBufferObjects(
true );
719 geode->addDrawable( geometry );
723 osg::StateSet* state = geode->getOrCreateStateSet();
724 state->setMode( GL_LIGHTING, osg::StateAttribute::OFF | osg::StateAttribute::PROTECTED );
727 state->setMode( GL_DEPTH_TEST, osg::StateAttribute::OFF );
732 state->setMode( GL_BLEND, osg::StateAttribute::ON );
733 state->setRenderingHint( osg::StateSet::TRANSPARENT_BIN );
737 state->setMode( GL_BLEND, osg::StateAttribute::OFF );
740 state->setRenderBinDetails( 1001 +
m_data.size() - k,
"RenderBin" );
749 std::vector< std::size_t > accu(
m_histograms[ 0 ]->size(), 0 );
758 for(
int k =
m_data.size() - 1; k >= 0; --k )
769 osg::ref_ptr< osg::Geode > geode =
new osg::Geode();
770 geode->setDataVariance( osg::Object::STATIC );
772 osg::ref_ptr< osg::Vec2Array > lineVertices =
new osg::Vec2Array;
773 osg::ref_ptr< osg::Vec4Array > lineColors =
new osg::Vec4Array;
776 WColor color =
m_colors[ k ]->get(
true );
778 lineColors->push_back( color );
781 for( std::size_t j = 0; j <
m_histograms[ k ]->size(); ++j )
784 std::pair< double, double > barPosHistoCoordsX =
m_histograms[ k ]->getIntervalForIndex( j );
785 WVector2d barLowerLeft( barPosHistoCoordsX.first, accu[ j ] );
795 lineVertices->push_back( barLowerLeft );
797 lineVertices->push_back(
WVector2d( barLowerLeft[ 0 ], barUpperRight[ 1 ] ) );
798 lineVertices->push_back( barUpperRight );
801 lineVertices->push_back(
WVector2d( barUpperRight[ 0 ], barLowerLeft[ 1 ] ) );
812 osg::ref_ptr< osg::Geometry > geometry =
new osg::Geometry;
814 geometry->addPrimitiveSet(
new osg::DrawArrays( osg::PrimitiveSet::LINE_STRIP, 0, 2 *
m_histograms[ k ]->size() + 2 ) );
815 geometry->setVertexArray( lineVertices );
816 geometry->setColorArray( lineColors );
817 geometry->setColorBinding( osg::Geometry::BIND_OVERALL );
820 geometry->setUseDisplayList(
false );
821 geometry->setUseVertexBufferObjects(
true );
823 geode->addDrawable( geometry );
827 osg::StateSet* state = geode->getOrCreateStateSet();
828 state->setMode( GL_LIGHTING, osg::StateAttribute::OFF | osg::StateAttribute::PROTECTED );
831 state->setMode( GL_DEPTH_TEST, osg::StateAttribute::OFF );
833 state->setRenderBinDetails( 1001 +
m_data.size() - k,
"RenderBin" );
841 if( intervalLength < 0.0 )
843 throw WException(
"Error in label spacing calculation!" );
847 double const minDistance = 2 * textSize;
849 if( availableSpace < minDistance )
856 double l = intervalLength;
871 double f[ 9 ] = { 0.1, 0.2, 0.25, 0.5, 1.0, 2.0, 2.5, 5.0, 10.0 };
876 distance = f[ k ] * fact * availableSpace / intervalLength;
879 while( distance < minDistance && k < 9 );
880 return f[ k ] * fact;
887 double textSize = 12;
908 textSize = 8 *
static_cast< int >( std::abs( std::log10(
m_frameSpacing[ 0 ] ) ) + 1 );
911 int factorXStart = 0;
1004 m_frameNode->setDataVariance( osg::Object::STATIC );
1006 osg::ref_ptr< osg::Vec2Array > lineVertices =
new osg::Vec2Array;
1007 osg::ref_ptr< osg::Vec4Array > lineColors =
new osg::Vec4Array;
1010 WColor
const frameColor( 0.2, 0.2, 0.2, 0.8 );
1011 lineColors->push_back( frameColor );
1034 osgText::Text* text =
new osgText::Text;
1038 text->setColor( frameColor );
1039 text->setCharacterSize( 12 );
1040 text->setAlignment( osgText::TextBase::CENTER_TOP );
1041 text->setPosition(
WVector3d( textPos[ 0 ], textPos[ 1 ], 0.0 ) );
1042 text->setLayout( osgText::Text::LEFT_TO_RIGHT );
1056 osgText::Text* text =
new osgText::Text;
1060 text->setColor( frameColor );
1061 text->setCharacterSize( 12 );
1062 text->setAlignment( osgText::TextBase::RIGHT_CENTER );
1063 text->setPosition(
WVector3d( textPos[ 0 ], textPos[ 1 ], 0.0 ) );
1064 text->setLayout( osgText::Text::LEFT_TO_RIGHT );
1072 osg::ref_ptr< osg::Geometry > geometry =
new osg::Geometry;
1074 geometry->addPrimitiveSet(
new osg::DrawArrays( osg::PrimitiveSet::LINES, 0, 4 + 2 * numLabels ) );
1075 geometry->setVertexArray( lineVertices );
1076 geometry->setColorArray( lineColors );
1077 geometry->setColorBinding( osg::Geometry::BIND_OVERALL );
1080 geometry->setUseDisplayList(
false );
1081 geometry->setUseVertexBufferObjects(
true );
1087 osg::StateSet* state =
m_frameNode->getOrCreateStateSet();
1088 state->setMode( GL_LIGHTING, osg::StateAttribute::OFF | osg::StateAttribute::PROTECTED );
1091 state->setMode( GL_DEPTH_TEST, osg::StateAttribute::OFF );
1093 state->setRenderBinDetails( 1002 +
m_data.size(),
"RenderBin" );
1094 state->setMode( GL_BLEND, osg::StateAttribute::OFF );
1114 osg::StateSet* state =
m_infoNode->getOrCreateStateSet();
1115 state->setMode( GL_LIGHTING, osg::StateAttribute::OFF | osg::StateAttribute::PROTECTED );
1116 state->setMode( GL_DEPTH_TEST, osg::StateAttribute::OFF );
1117 state->setMode( GL_BLEND, osg::StateAttribute::OFF );
1118 state->setRenderBinDetails( 1002 +
m_data.size(),
"RenderBin" );
1122 for( bin = 0;
m_histograms[ 0 ]->getIntervalForIndex( bin ).second < m[ 0 ]; ++bin )
1132 for( std::size_t k = 0; k <
m_data.size(); ++k )
1141 osgText::Text* text =
new osgText::Text;
1144 text->setColor(
m_colors[ k ]->get(
false ) );
1145 text->setCharacterSize( 12 );
1146 text->setAlignment( osgText::TextBase::RIGHT_CENTER );
1147 text->setPosition( textPos );
1148 text->setLayout( osgText::Text::LEFT_TO_RIGHT );
1159 osgText::Text* text =
new osgText::Text;
1160 std::stringstream s;
1161 s <<
"[" <<
m_histograms[ 0 ]->getIntervalForIndex( bin ).first
1162 <<
"," <<
m_histograms[ 0 ]->getIntervalForIndex( bin ).second
1166 text->setColor( WColor( 0.0, 0.0, 0.0, 1.0 ) );
1167 text->setCharacterSize( 12 );
1168 text->setAlignment( osgText::TextBase::RIGHT_CENTER );
1169 text->setPosition( textPos );
1170 text->setLayout( osgText::Text::LEFT_TO_RIGHT );
1171 text->setText( s.str() );
1178 osg::StateSet* markerState =
m_markerNode->getOrCreateStateSet();
1179 markerState->setMode( GL_LIGHTING, osg::StateAttribute::OFF | osg::StateAttribute::PROTECTED );
1180 markerState->setMode( GL_DEPTH_TEST, osg::StateAttribute::OFF );
1181 markerState->setMode( GL_BLEND, osg::StateAttribute::OFF );
1182 markerState->setRenderBinDetails( 1000,
"RenderBin" );
1184 osg::ref_ptr< osg::Vec2Array > quadVertices =
new osg::Vec2Array;
1185 osg::ref_ptr< osg::Vec4Array > quadColors =
new osg::Vec4Array;
1188 quadColors->push_back( WColor( 0.95, 0.95, 0.95, 1.0 ) );
1199 osg::Geometry* geometry =
new osg::Geometry;
1201 geometry->addPrimitiveSet(
new osg::DrawArrays( osg::PrimitiveSet::QUADS, 0, 4 ) );
1202 geometry->setVertexArray( quadVertices );
1203 geometry->setColorArray( quadColors );
1204 geometry->setColorBinding( osg::Geometry::BIND_OVERALL );
1207 geometry->setUseDisplayList(
false );
1208 geometry->setUseVertexBufferObjects(
true );
1223 errorLog() <<
"This histogram style is not yet implemented.";
virtual void wait() const
Wait for the condition.
void setResetable(bool resetable=true, bool autoReset=true)
Sets the resetable flag.
virtual void add(std::shared_ptr< WCondition > condition)
Adds another condition to the set of conditions to wait for.
Class to encapsulate boost::condition_variable_any.
This is a simple but thread-safe counter.
std::shared_ptr< WCondition > getValueChangeCondition()
Returns the condition denoting a value change.
This requirement ensures an up and running WGE.
Container which associate values with (uniform width) bins (aka intervals or buckets).
A class containing a list of named items.
static WKernel * getRunningKernel()
Returns pointer to the currently running kernel.
std::shared_ptr< WUI > getUI() const
Getter for the associated UI.
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.
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.
Requirements m_requirements
The list of requirements.
virtual void properties()
Initialize properties in this function.
wlog::WStreamedLogger debugLog() const
Logger instance for comfortable debug logging.
void addConnector(std::shared_ptr< WModuleInputConnector > con)
Adds the specified connector to the list of inputs.
std::shared_ptr< WProperties > m_properties
The property object for the module.
void ready()
Call this whenever your module is ready and can react on property changes.
WConditionSet m_moduleState
The internal state of the module.
wlog::WStreamedLogger errorLog() const
Logger instance for comfortable error logging.
wlog::WStreamedLogger infoLog() const
Logger instance for comfortable info logging.
virtual void connectors()
Initialize connectors in this function.
static Fonts getAllFonts()
The paths to all fonts supported.
WBoolFlag m_shutdownFlag
Condition getting fired whenever the thread should quit.
This requirement ensures an up and running UI which properly implements the WUI interface.
An event handler for a custom widget which eases interaction with GUIEvents within your module.
void addTo(WPropSelection prop)
Add the PC_SELECTONLYONE constraint to the property.
std::string toString(const T &value)
Convert a given value to a string.