Commit d846424c authored by schurade's avatar schurade
Browse files

[CHANGE] some work on the cluster display voxel, coloring modes, selection modes

parent a047054c
......@@ -151,49 +151,18 @@ std::vector< size_t >WHierarchicalTreeVoxels::findClustersForBranchLength( float
std::list<size_t>worklist;
std::vector<size_t>returnVector;
std::vector<bool>distanceCheckVector( m_clusterCount, false );
std::vector<int>distanceCheckVector( m_clusterCount, 0 );
for ( size_t i = 0; i < m_clusterCount; ++i )
for ( size_t i = m_leafCount; i < m_clusterCount; ++i )
{
if ( ( ( m_containsLeafes[i].size() >= minSize ) && ( ( m_customData[m_parents[i]] - m_customData[i] ) > value ) ) ||
distanceCheckVector[m_children[i].first] || distanceCheckVector[m_children[i].second] )
if ( ( distanceCheckVector[m_children[i].first] > 0 ) || ( distanceCheckVector[m_children[i].second] > 0 ) )
{
distanceCheckVector[i] = true;
distanceCheckVector[i] = 2;
}
}
worklist.push_back( m_clusterCount - 1 );
while ( !worklist.empty() )
{
size_t current = worklist.front();
worklist.pop_front();
if ( m_containsLeafes[current].size() > 1 )
else if ( ( ( m_containsLeafes[i].size() >= minSize ) && ( ( m_customData[m_parents[i]] - m_customData[i] ) > value ) ) )
{
size_t left = m_children[current].first;
size_t right = m_children[current].second;
if ( distanceCheckVector[left] && distanceCheckVector[right] )
{
worklist.push_back( left );
worklist.push_back( right );
}
else
{
if ( ( m_containsLeafes[left].size() < minSize ) && ( m_containsLeafes[right].size() >= minSize ) )
{
worklist.push_back( right );
}
else if ( ( m_containsLeafes[right].size() < minSize ) && ( m_containsLeafes[left].size() > minSize ) )
{
worklist.push_back( left );
}
else
{
returnVector.push_back( current );
}
}
distanceCheckVector[i] = 1;
returnVector.push_back( i );
}
}
return returnVector;
......
......@@ -156,35 +156,50 @@ WColor wge::createColorFromHSV( int h, float s, float v )
}
}
WColor wge::getNthHSVColor( int n, int parts )
WColor wge::getNthHSVColor( int n )
{
parts = (std::max)( 1, parts );
if ( parts > 360 )
int h = 0;
float s = 1.0;
float v = 1.0;
if ( ( n & 1 ) == 1 )
{
parts = 360;
h += 180;
}
int frac = 360 / parts;
if ( parts > 320 )
if ( ( n & 2 ) == 2 )
{
h += 90;
}
if ( ( n & 4 ) == 4 )
{
h += 45;
}
if ( ( n & 8 ) == 8 )
{
h += 202;
h = h % 360;
}
if ( ( n & 16 ) == 16 )
{
return createColorFromHSV( n * frac );
v -= .25;
}
else
if ( ( n & 32 ) == 32 )
{
int preset[320] = {
0, 180, 90, 270, 45, 225, 135, 315, 22, 202, 112, 292, 67, 247, 157, 337, 11, 191, 101, 281, 56, 236, 146, 326, 33, 213, 123, 303, 78, 258,
168, 348, 5, 185, 95, 275, 50, 230, 140, 320, 27, 207, 117, 297, 72, 252, 162, 342, 16, 196, 106, 286, 61, 241, 151, 331, 38, 218, 128,
308, 83, 263, 173, 353, 2, 182, 92, 272, 47, 227, 137, 317, 24, 204, 114, 294, 69, 249, 159, 339, 13, 193, 103, 283, 58, 238, 148, 328, 35,
215, 125, 305, 80, 260, 170, 350, 7, 187, 97, 277, 52, 232, 142, 322, 29, 209, 119, 299, 74, 254, 164, 344, 18, 198, 108, 288, 63, 243,
153, 333, 40, 220, 130, 310, 85, 265, 175, 355, 1, 181, 91, 271, 46, 226, 136, 316, 23, 203, 113, 293, 68, 248, 158, 338, 12, 192, 102,
282, 57, 237, 147, 327, 34, 214, 124, 304, 79, 259, 169, 349, 6, 186, 96, 276, 51, 231, 141, 321, 28, 208, 118, 298, 73, 253, 163, 343, 17,
197, 107, 287, 62, 242, 152, 332, 39, 219, 129, 309, 84, 264, 174, 354, 3, 183, 93, 273, 48, 228, 138, 318, 25, 205, 115, 295, 70, 250,
160, 340, 14, 194, 104, 284, 59, 239, 149, 329, 36, 216, 126, 306, 81, 261, 171, 351, 8, 188, 98, 278, 53, 233, 143, 323, 30, 210, 120,
300, 75, 255, 165, 345, 19, 199, 109, 289, 64, 244, 154, 334, 41, 221, 131, 311, 86, 266, 176, 356, 4, 184, 94, 274, 49, 229, 139, 319, 26,
206, 116, 296, 71, 251, 161, 341, 15, 195, 105, 285, 60, 240, 150, 330, 37, 217, 127, 307, 82, 262, 172, 352, 9, 189, 99, 279, 54, 234,
144, 324, 31, 211, 121, 301, 76, 256, 166, 346, 20, 200, 110, 290, 65, 245, 155, 335, 42, 222, 132, 312, 87, 267, 177, 357
};
return createColorFromHSV( preset[n] );
s -= .25;
}
if ( ( n & 64 ) == 64 )
{
v -= .25;
}
if ( ( n & 128 ) == 128 )
{
s -= 0.25;
}
if ( ( n & 256 ) == 256 )
{
v -= 0.25;
}
return createColorFromHSV( h, s, v );
}
......@@ -92,7 +92,7 @@ namespace wge
* \param parts partition size
* \return the color
*/
WColor WGE_EXPORT getNthHSVColor( int n, int parts = 10 );
WColor WGE_EXPORT getNthHSVColor( int n );
/**
* This method converts an WMatrix to the corresponding osg::Matrixd.
......
......@@ -589,8 +589,8 @@ void WMClusterDisplay::handleBiggestClustersChanged()
for ( size_t k = 0; k < m_biggestClusters.size(); ++k )
{
size_t current = m_biggestClusters[k];
setColor( m_tree.getLeafesForCluster( current ), wge::getNthHSVColor( k, m_biggestClusters.size() ) );
m_tree.colorCluster( current, wge::getNthHSVColor( k, m_biggestClusters.size() ) );
setColor( m_tree.getLeafesForCluster( current ), wge::getNthHSVColor( k ) );
m_tree.colorCluster( current, wge::getNthHSVColor( k ) );
}
m_dendrogramDirty = true;
......@@ -627,8 +627,8 @@ void WMClusterDisplay::handleRoiChanged()
for ( size_t k = 0; k < m_biggestClusters.size(); ++k )
{
size_t current = m_biggestClusters[k];
setColor( m_tree.getLeafesForCluster( current ), wge::getNthHSVColor( k, m_biggestClusters.size() ) );
m_tree.colorCluster( current, wge::getNthHSVColor( k, m_biggestClusters.size() ) );
setColor( m_tree.getLeafesForCluster( current ), wge::getNthHSVColor( k ) );
m_tree.colorCluster( current, wge::getNthHSVColor( k ) );
}
m_widgetDirty = true;
......@@ -722,7 +722,7 @@ void WMClusterDisplay::updateWidgets()
newButton1->managed( m_wm );
m_wm->addChild( newButton1 );
m_biggestClustersButtonList.push_back( newButton1 );
newButton1->setBackgroundColor( wge::getNthHSVColor( i, m_biggestClusters.size() ) );
newButton1->setBackgroundColor( wge::getNthHSVColor( i ) );
osg::ref_ptr<WOSGButton> newButton = osg::ref_ptr<WOSGButton>( new WOSGButton( std::string( "" ),
osgWidget::Box::VERTICAL, true, true ) );
......@@ -732,7 +732,7 @@ void WMClusterDisplay::updateWidgets()
newButton->managed( m_wm );
m_wm->addChild( newButton );
m_biggestClustersButtonList.push_back( newButton );
newButton->setBackgroundColor( wge::getNthHSVColor( i, m_biggestClusters.size() ) );
newButton->setBackgroundColor( wge::getNthHSVColor( i ) );
}
osg::ref_ptr<WOSGButton> newButton1 = osg::ref_ptr<WOSGButton>( new WOSGButton( std::string( "" ),
osgWidget::Box::VERTICAL, true, false ) );
......@@ -933,14 +933,12 @@ void WMClusterDisplay::colorClusters( size_t current )
}
int n = 0;
int parts = finalList.size();
for ( size_t i = 0; i < finalList.size(); ++i )
{
size_t cluster = finalList[i];
m_tree.colorCluster( cluster, wge::getNthHSVColor( n, parts ) );
setColor( m_tree.getLeafesForCluster( cluster ), wge::getNthHSVColor( n++, parts ) );
m_tree.colorCluster( cluster, wge::getNthHSVColor( n ) );
setColor( m_tree.getLeafesForCluster( cluster ), wge::getNthHSVColor( n++ ) );
}
m_fiberDrawable->setBitfield( m_tree.getOutputBitfield( finalList ) );
......
......@@ -55,8 +55,7 @@ WMClusterDisplayVoxels::WMClusterDisplayVoxels():
m_moduleNode( new WGEGroupNode() ),
m_dendrogramNode( new WGEGroupNode() ),
m_meshNode( new WGEGroupNode() ),
m_widgetDirty( false ),
m_biggestClusterButtonsChanged( false ),
m_selectionChanged( false ),
m_dendrogramDirty( false )
{
}
......@@ -110,45 +109,56 @@ void WMClusterDisplayVoxels::properties()
m_propClusterFile = m_properties->addProperty( "Cluster file", "", boost::filesystem::path( "/SCR/schurade/data/david/whole/avg.txt" ) );
m_propReadTrigger = m_properties->addProperty( "Do read", "Press!", WPVBaseTypes::PV_TRIGGER_READY, m_propCondition );
m_propLevelsFromTop = m_properties->addProperty( "Levels from top", "", 0, m_propCondition );
m_propHideOutliers = m_properties->addProperty( "Hide outliers", "", false, m_propCondition );
m_propSelectedCluster = m_properties->addProperty( "Selected Cluster", "", 0, m_propCondition );
// Group selection
m_groupSelection = m_properties->addPropertyGroup( "Cluster selections", "Groups the different cluster selection methods" ); //NOLINT
m_propSelectedCluster = m_groupSelection->addProperty( "Selected Cluster", "", 0, m_propCondition );
m_propSelectedCluster->setMin( 0 );
m_propSelectedCluster->setMax( 0 );
m_propXBiggestClusters = m_properties->addProperty( "Biggest Clusters", "", 5, m_propCondition );
m_propXBiggestClusters = m_groupSelection->addProperty( "Biggest Clusters", "", 5, m_propCondition );
m_propXBiggestClusters->setMin( 1 );
m_propXBiggestClusters->setMax( 1000 );
m_propXClusters = m_properties->addProperty( "X Clusters", "", 5, m_propCondition );
m_propXClusters = m_groupSelection->addProperty( "X Clusters", "", 5, m_propCondition );
m_propXClusters->setMin( 1 );
m_propXClusters->setMax( 1000 );
m_propValue = m_properties->addProperty( "Similarity Value", "", 1.0, m_propCondition );
m_propValue = m_groupSelection->addProperty( "Similarity Value", "", 1.0, m_propCondition );
m_propValue->setMin( 0.0 );
m_propValue->setMax( 1.0 );
m_propMinBranchLength = m_properties->addProperty( "Minimum branch length", "", 0.1, m_propCondition );
m_propLevelsFromTop = m_groupSelection->addProperty( "Levels from top", "", 0, m_propCondition );
m_propHideOutliers = m_groupSelection->addProperty( "Hide outliers", "", false, m_propCondition );
m_propSelectedLoadedPartion = m_groupSelection->addProperty( "Loaded Partition", "Activates a predetermined partition, loaded from file", 0, m_propCondition ); // NOLINT
m_propSelectedLoadedPartion->setMin( 1 );
m_propSelectedLoadedPartion->setMax( 1 );
m_propShowSelectedButtons = m_groupSelection->addProperty( "Show Buttons", "Shows/Hides the buttons for selected cluster on the left side", true, m_propCondition ); //NOLINT
// Group branch length
m_groupMinBranchLength = m_properties->addPropertyGroup( "Branch length", "Cluster Selection depending on the distance of a cluster to it's parent" ); //NOLINT
m_propMinBranchLength = m_groupMinBranchLength->addProperty( "Minimum branch length", "", 0.1, m_propCondition );
m_propMinBranchLength->setMin( 0.0 );
m_propMinBranchLength->setMax( 1.0 );
m_propMinBranchSize = m_properties->addProperty( "Minimum branch size", "", 50, m_propCondition );
m_propMinBranchSize = m_groupMinBranchLength->addProperty( "Minimum branch size", "", 50, m_propCondition );
m_propMinBranchSize->setMin( 1 );
m_propMinBranchSize->setMax( 500 );
m_propSelectedLoadedPartion = m_properties->addProperty( "Loaded Partition", "Activates a predetermined partition, loaded from file", 0, m_propCondition ); // NOLINT
m_propSelectedLoadedPartion->setMin( 1 );
m_propSelectedLoadedPartion->setMax( 1 );
m_propShowVoxelTriangulation = m_properties->addProperty( "Triangulate", "", false, m_propCondition );
m_showNotInClusters = m_properties->addProperty( "Show non active", "", false, m_propCondition );
// Group Triangulation
m_groupTriangulation = m_properties->addPropertyGroup( "Triangulation", "Groups the triangulation properties" ); //NOLINT
m_propShowVoxelTriangulation = m_groupTriangulation->addProperty( "Triangulate", "", false, m_propCondition );
m_showNotInClusters = m_groupTriangulation->addProperty( "Show non active", "", false, m_propCondition );
// Group Dendrogram
m_groupDendrogram = m_properties->addPropertyGroup( "Dendrogram", "Properties only related to the dendrogram." );
m_propShowDendrogram = m_groupDendrogram->addProperty( "Show dendrogram", "", true, m_propCondition );
m_propPlotHeightByLevel = m_groupDendrogram->addProperty( "Height by Level or Value", "", false, m_propCondition );
m_propMinSizeToColor = m_groupDendrogram->addProperty( "Min size to show", "Specifies a minimum size for a cluster to be drawn", 1, m_propCondition ); // NOLINT
......@@ -170,6 +180,12 @@ void WMClusterDisplayVoxels::properties()
m_propDendrogramOffsetY->setMin( -9000 );
m_propDendrogramOffsetY->setMax( 1000 );
m_groupSelection->setHidden( true );
m_groupMinBranchLength->setHidden( true );
m_groupTriangulation->setHidden( true );
m_groupDendrogram->setHidden( true );
// Info properties
m_infoCountLeafes = m_infoProperties->addProperty( "Count voxels", "", 0 );
m_infoCountClusters = m_infoProperties->addProperty( "Count clusters", "", 0 );
m_infoMaxLevel = m_infoProperties->addProperty( "Max Level", "", 0 );
......@@ -264,6 +280,12 @@ void WMClusterDisplayVoxels::moduleMain()
{
m_propReadTrigger->setHidden( true );
m_propClusterFile->setHidden( true );
m_groupSelection->setHidden( false );
m_groupMinBranchLength->setHidden( false );
m_groupTriangulation->setHidden( false );
m_groupDendrogram->setHidden( false );
break;
}
}
......@@ -276,7 +298,7 @@ void WMClusterDisplayVoxels::moduleMain()
setPropertyBoundaries();
initWidgets();
m_widgetDirty = true;
m_selectionChanged = true;
updateWidgets();
m_dendrogramGeode = new WDendrogramGeode( &m_tree, m_rootCluster, 1000, 500 );
......@@ -308,18 +330,21 @@ void WMClusterDisplayVoxels::moduleMain()
{
m_activatedClusters.clear();
m_activatedClusters.push_back( m_propSelectedCluster->get( true ) );
m_currentDisplayMode = CDV_SINGLE;
updateAll();
}
if( m_propXBiggestClusters->changed() )
{
m_activatedClusters = m_tree.findXBiggestClusters2( m_propSelectedCluster->get(), m_propXBiggestClusters->get( true ) );
m_currentDisplayMode = CDV_BIGGEST;
updateAll();
}
if( m_propXClusters->changed() )
{
m_activatedClusters = m_tree.findXClusters( m_propSelectedCluster->get(), m_propXClusters->get( true ) );
m_currentDisplayMode = CDV_X;
updateAll();
}
......@@ -327,43 +352,50 @@ void WMClusterDisplayVoxels::moduleMain()
if ( m_propValue->changed() )
{
m_activatedClusters = m_tree.findClustersForValue( m_propValue->get( true ) );
m_currentDisplayMode = CDV_SIMILARITY;
updateAll();
}
if ( m_propMinBranchLength->changed() || m_propMinBranchSize->changed() )
{
m_activatedClusters = m_tree.findClustersForBranchLength( m_propMinBranchLength->get( true ), m_propMinBranchSize->get( true ) );
m_currentDisplayMode = CDV_MINBRANCHLENGTH;
updateAll();
}
if ( m_propLevelsFromTop->changed() || m_propHideOutliers->changed() )
{
m_activatedClusters = m_tree.downXLevelsFromTop( m_propLevelsFromTop->get( true ), m_propHideOutliers->get( true ) );
m_currentDisplayMode = CDV_LEVELSFROMTOP;
updateAll();
}
if ( m_propSelectedLoadedPartion->changed() )
{
m_activatedClusters = m_loadedPartitions[ m_propSelectedLoadedPartion->get( true ) - 1 ];
m_currentDisplayMode = CDV_LOADED;
updateAll();
}
if( m_propShowVoxelTriangulation->changed() )
if( m_propShowVoxelTriangulation->changed( true ) )
{
m_propShowVoxelTriangulation->get( true );
createMesh();
renderMesh();
}
if ( m_propMinSizeToColor->changed() )
if ( m_showNotInClusters->changed( true ) )
{
updateAll();
}
if ( m_propMinSizeToColor->changed( true ) )
{
m_propMinSizeToColor->get( true );
handleMinSizeChanged();
}
if ( m_propShowDendrogram->changed() || m_propResizeWithWindow->changed() || m_propDendrogramSizeX->changed() ||
m_propDendrogramSizeY->changed() || m_propDendrogramOffsetX->changed() || m_propDendrogramOffsetY->changed() ||
m_propPlotHeightByLevel->changed() )
if ( m_propShowDendrogram->changed( true ) || m_propResizeWithWindow->changed( true ) || m_propDendrogramSizeX->changed( true ) ||
m_propDendrogramSizeY->changed( true ) || m_propDendrogramOffsetX->changed( true ) || m_propDendrogramOffsetY->changed( true ) ||
m_propPlotHeightByLevel->changed( true ) || m_propShowSelectedButtons->changed( true ) )
{
m_dendrogramDirty = true;
}
......@@ -376,24 +408,18 @@ void WMClusterDisplayVoxels::moduleMain()
void WMClusterDisplayVoxels::updateAll()
{
debugLog() << "start erasing clusters";
// set colors for cluster in the tree
m_tree.colorCluster( m_tree.getClusterCount() - 1, WColor( 0.3, 0.3, 0.3, 1.0 ) );
debugLog() << "end erasing clusters";
debugLog() << "start color clusters";
for ( size_t k = 0; k < m_activatedClusters.size(); ++k )
{
size_t current = m_activatedClusters[k];
m_tree.colorCluster( current, wge::getNthHSVColor( k, m_activatedClusters.size() ) );
m_tree.colorCluster( current, wge::getNthHSVColor( k ) );
}
debugLog() << "end color clusters";
debugLog() << "start label voxels";
// redraw the texture
m_data.clear();
m_data.resize( m_grid->size(), 0 );
std::vector<size_t> vox = m_tree.getVoxelsForCluster( m_tree.getClusterCount() - 1 );
if ( m_showNotInClusters->get() )
{
for ( size_t k = 0; k < vox.size(); ++k )
......@@ -401,7 +427,6 @@ void WMClusterDisplayVoxels::updateAll()
m_data[vox[k]] = 999999;
}
}
for ( size_t i = 0; i < m_activatedClusters.size(); ++i )
{
std::vector<size_t> voxels = m_tree.getVoxelsForCluster( m_activatedClusters[i] );
......@@ -411,9 +436,6 @@ void WMClusterDisplayVoxels::updateAll()
m_data[voxels[k]] = i + 1;
}
}
debugLog() << "end label voxels";
debugLog() << "start fill texture";
unsigned char* data = m_texture->getImage()->data();
for ( size_t i = 0; i < m_grid->size(); ++i )
{
......@@ -425,7 +447,7 @@ void WMClusterDisplayVoxels::updateAll()
}
else if ( m_data[i] != 0 )
{
WColor color = wge::getNthHSVColor( m_data[i] - 1, m_activatedClusters.size() );
WColor color = wge::getNthHSVColor( m_data[i] - 1 );
data[i * 3 ] = color[0] * 255;
data[i * 3 + 1] = color[1] * 255;
data[i * 3 + 2] = color[2] * 255;
......@@ -437,16 +459,14 @@ void WMClusterDisplayVoxels::updateAll()
data[i * 3 + 2] = 0.0;
}
}
m_texture->dirtyTextureObject();
debugLog() << "end fill texture";
createMesh();
renderMesh();
m_selectionChanged = true;
m_dendrogramDirty = true;
m_widgetDirty = true;
m_biggestClusterButtonsChanged = true;
}
void WMClusterDisplayVoxels::handleMinSizeChanged()
......@@ -593,7 +613,7 @@ void WMClusterDisplayVoxels::renderMesh()
// ------------------------------------------------
// colors
osg::Vec4Array* colors = new osg::Vec4Array;
colors->push_back( wge::getNthHSVColor( i, m_triMeshes.size() ) );
colors->push_back( wge::getNthHSVColor( i ) );
surfaceGeometry->setColorArray( colors );
surfaceGeometry->setColorBinding( osg::Geometry::BIND_OVERALL );
......@@ -619,7 +639,7 @@ void WMClusterDisplayVoxels::renderMesh()
m_outputGeodes.push_back( outputGeode );
}
}
if ( m_showNotInClusters->get() )
if ( m_propShowVoxelTriangulation->get( true ) && m_showNotInClusters->get() )
{
osg::Geometry* surfaceGeometry = new osg::Geometry();
osg::ref_ptr< osg::Geode >outputGeode = osg::ref_ptr< osg::Geode >( new osg::Geode );
......@@ -715,6 +735,8 @@ void WMClusterDisplayVoxels::updateWidgets()
int height = viewer->getCamera()->getViewport()->height();
int width = viewer->getCamera()->getViewport()->width();
int rows = height / 20;
if ( ( height != m_oldViewHeight ) || width != m_oldViewWidth )
{
m_oldViewHeight = height;
......@@ -723,12 +745,12 @@ void WMClusterDisplayVoxels::updateWidgets()
m_dendrogramDirty = true;
}
if ( !widgetClicked() && !m_widgetDirty && !m_dendrogramDirty )
if ( !widgetClicked() && !m_dendrogramDirty )
{
return;
}
if ( m_biggestClusterButtonsChanged )
if ( m_selectionChanged || m_propShowSelectedButtons->changed( true ) )
{
for ( size_t i = 0; i < m_activeClustersButtonList.size(); ++i )
{
......@@ -736,50 +758,25 @@ void WMClusterDisplayVoxels::updateWidgets()
}
m_activeClustersButtonList.clear();
for ( size_t i = 0; i < m_activatedClusters.size(); ++i )
if ( m_propShowSelectedButtons->get() )
{
osg::ref_ptr<WOSGButton> newButton1 = osg::ref_ptr<WOSGButton>( new WOSGButton( std::string( "" ),
osgWidget::Box::VERTICAL, true, false ) );
newButton1->setPosition( osg::Vec3( 10.f, i * 20.f, 0 ) );
newButton1->setId( 10000000 + m_activatedClusters[i] );
newButton1->setLabel( std::string( " S " ) );
newButton1->managed( m_wm );
m_wm->addChild( newButton1 );
m_activeClustersButtonList.push_back( newButton1 );
newButton1->setBackgroundColor( wge::getNthHSVColor( i, m_activatedClusters.size() ) );
osg::ref_ptr<WOSGButton> newButton = osg::ref_ptr<WOSGButton>( new WOSGButton( std::string( "" ),
osgWidget::Box::VERTICAL, true, true ) );
newButton->setPosition( osg::Vec3( 35.f, i * 20.f, 0 ) );
newButton->setId( m_activatedClusters[i] );
//newButton->setLabel( boost::lexical_cast<std::string>( m_tree.size( m_activatedClusters[i] ) ) );
newButton->setLabel( boost::lexical_cast<std::string>( m_activatedClusters[i] ) );
newButton->managed( m_wm );
m_wm->addChild( newButton );
m_activeClustersButtonList.push_back( newButton );
newButton->setBackgroundColor( wge::getNthHSVColor( i, m_activatedClusters.size() ) );
}
osg::ref_ptr<WOSGButton> newButton1 = osg::ref_ptr<WOSGButton>( new WOSGButton( std::string( "" ),
osgWidget::Box::VERTICAL, true, false ) );
newButton1->setPosition( osg::Vec3( 10.f, m_activatedClusters.size() * 20.f, 0 ) );
newButton1->setId( 10000000 + m_propSelectedCluster->get() );
newButton1->setLabel( std::string( " S " ) );
newButton1->managed( m_wm );
m_wm->addChild( newButton1 );
m_activeClustersButtonList.push_back( newButton1 );
newButton1->setBackgroundColor( WColor( 0.4, 0.4, 0.4, 1.0 ) );
osg::ref_ptr<WOSGButton> newButton = osg::ref_ptr<WOSGButton>( new WOSGButton( std::string( "" ),
for ( size_t i = 0; i < m_activatedClusters.size(); ++i )
{
osg::ref_ptr<WOSGButton> newButton = osg::ref_ptr<WOSGButton>( new WOSGButton( std::string( "" ),
osgWidget::Box::VERTICAL, true, true ) );
newButton->setPosition( osg::Vec3( 35.f, m_activatedClusters.size() * 20.f, 0 ) );
newButton->setId( m_propSelectedCluster->get() );
newButton->setLabel( boost::lexical_cast<std::string>( m_tree.size( m_propSelectedCluster->get() ) ) );
newButton->managed( m_wm );
m_wm->addChild( newButton );
m_activeClustersButtonList.push_back( newButton );
newButton->setBackgroundColor( WColor( 0.4, 0.4, 0.4, 1.0 ) );
m_biggestClusterButtonsChanged = false;
newButton->setPosition( osg::Vec3( 5.f + ( i / rows ) * 60, ( i % rows ) * 20.f, 0 ) );
newButton->setId( m_activatedClusters[i] );
//newButton->setLabel( boost::lexical_cast<std::string>( m_tree.size( m_activatedClusters[i] ) ) );
newButton->setLabel( boost::lexical_cast<std::string>( m_activatedClusters[i] ) );
newButton->managed( m_wm );
m_wm->addChild( newButton );
m_activeClustersButtonList.push_back( newButton );
newButton->setBackgroundColor( wge::getNthHSVColor( i ) );
}
}
m_selectionChanged = false;
}
m_wm->resizeAllWindows();