Commit 29efacae authored by schurade's avatar schurade

[FIX] made the cluster display module working with the new roi structure

parent a73d8acb
......@@ -88,7 +88,7 @@ void WFiberDrawable::drawFibers( osg::RenderInfo& renderInfo ) const //NOLINT
state.disableAllVertexArrays();
state.setVertexPointer( 3, GL_FLOAT , 0, &( *m_verts )[0] );
state.setColorPointer( 3 , GL_FLOAT , 0, &( *m_colors )[0] );
state.setNormalPointer( GL_FLOAT , 0, &( *m_tangents )[0] );
//state.setNormalPointer( GL_FLOAT , 0, &( *m_tangents )[0] );
for ( size_t i = 0; i < m_active->size(); ++i )
{
if ( (*m_active)[i] )
......
......@@ -61,6 +61,9 @@ void WRMBranch::propertyChanged()
void WRMBranch::addRoi( osg::ref_ptr< WROI > roi )
{
m_rois.push_back( roi );
boost::function< void() > changeRoiSignal = boost::bind( &WRMBranch::setDirty, this );
roi->addChangeNotifier( changeRoiSignal );
setDirty();
}
......
//---------------------------------------------------------------------------
//
// Project: OpenWalnut ( http://www.openwalnut.org )
//
// Copyright 2009 OpenWalnut Community, BSV@Uni-Leipzig and CNCF@MPI-CBS
// For more information see http://www.openwalnut.org/copying
//
// This file is part of OpenWalnut.
//
// OpenWalnut is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// OpenWalnut is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with OpenWalnut. If not, see <http://www.gnu.org/licenses/>.
//
//---------------------------------------------------------------------------
#include <iostream>
#include "../../graphicsEngine/WGEUtils.h"
#include "WDendrogramGeode.h"
/**
* Class implements a dendrogram as an osg geode
*/
WDendrogramGeode::WDendrogramGeode( WHierarchicalTree* tree, size_t cluster, size_t minClusterSize,
float xSize, float ySize, float xOffset, float yOffset ) :
osg::Geode(),
m_tree( tree ),
m_rootCluster( cluster ),
m_minClusterSize( minClusterSize ),
m_xSize( xSize ),
m_ySize( ySize ),
m_xOff( xOffset ),
m_yOff( yOffset )
{
create();
}
WDendrogramGeode::~WDendrogramGeode()
{
}
void WDendrogramGeode::create()
{
m_colors = osg::ref_ptr<osg::Vec4Array>( new osg::Vec4Array );
m_vertexArray = new osg::Vec3Array;
m_lineArray = new osg::DrawElementsUInt( osg::PrimitiveSet::LINES, 0 );
float xMax = static_cast<float>( m_tree->size( m_rootCluster ) - 1 );
float yMax = m_tree->getLevel( m_rootCluster );
m_xMult = m_xSize / xMax;
m_yMult = m_ySize / yMax;
layout( m_rootCluster, 0.0f, static_cast<float>( m_tree->size( m_rootCluster ) - 1 ) );
for ( size_t i = 0; i < m_vertexArray->size(); ++i )
{
(*m_vertexArray)[i].x() = (*m_vertexArray)[i].x() * m_xMult + m_xOff;
(*m_vertexArray)[i].y() = (*m_vertexArray)[i].y() * m_yMult + m_yOff;
}
osg::ref_ptr< osg::Geometry > geometry = osg::ref_ptr< osg::Geometry >( new osg::Geometry() );
geometry->setVertexArray( m_vertexArray );
geometry->addPrimitiveSet( m_lineArray );
geometry->setColorArray( m_colors );
geometry->setColorBinding( osg::Geometry::BIND_PER_VERTEX );
osg::StateSet* state = geometry->getOrCreateStateSet();
state->setMode( GL_LIGHTING, osg::StateAttribute::OFF | osg::StateAttribute::PROTECTED );
addDrawable( geometry );
}
void WDendrogramGeode::layout( size_t cluster, float left, float right )
{
float height = m_tree->getLevel( cluster );
float size = right - left;
if ( m_tree->getLevel( cluster ) > 0 )
{
size_t leftCluster = m_tree->getChildren( cluster ).first;
size_t rightCluster = m_tree->getChildren( cluster ).second;
float leftHeight = m_tree->getLevel( leftCluster );
float leftSize = static_cast<float>( m_tree->size( leftCluster ) );
float rightHeight = m_tree->getLevel( rightCluster );
float rightSize = static_cast<float>( m_tree->size( rightCluster ) );
if ( ( leftSize >= m_minClusterSize ) && ( rightSize < m_minClusterSize ) )
//if ( rightSize < 2 )
{
// left cluster is much bigger, draw only left
m_vertexArray->push_back( osg::Vec3( ( left + size / 2.0 ), height, 0 ) );
m_vertexArray->push_back( osg::Vec3( ( left + size / 2.0 ), leftHeight, 0 ) );
m_lineArray->push_back( m_vertexArray->size() - 2 );
m_lineArray->push_back( m_vertexArray->size() - 1 );
m_colors->push_back( wge::osgColor( m_tree->getColor( cluster ) ) );
m_colors->push_back( wge::osgColor( m_tree->getColor( cluster ) ) );
layout( leftCluster, left, right );
}
else if ( ( rightSize >= m_minClusterSize ) && ( leftSize < m_minClusterSize ) )
//else if ( leftSize < 2 )
{
// right cluster is much bigger, draw only right
m_vertexArray->push_back( osg::Vec3( ( left + size / 2.0 ), height, 0 ) );
m_vertexArray->push_back( osg::Vec3( ( left + size / 2.0 ), rightHeight, 0 ) );
m_lineArray->push_back( m_vertexArray->size() - 2 );
m_lineArray->push_back( m_vertexArray->size() - 1 );
m_colors->push_back( wge::osgColor( m_tree->getColor( cluster ) ) );
m_colors->push_back( wge::osgColor( m_tree->getColor( cluster ) ) );
layout( rightCluster, left, right );
}
else
{
float mult = size / ( leftSize + rightSize );
m_vertexArray->push_back( osg::Vec3( ( left + leftSize * mult / 2.0 ), height, 0 ) );
m_vertexArray->push_back( osg::Vec3( ( right - rightSize * mult / 2.0 ), height, 0 ) );
m_lineArray->push_back( m_vertexArray->size() - 2 );
m_lineArray->push_back( m_vertexArray->size() - 1 );
m_vertexArray->push_back( osg::Vec3( ( left + leftSize * mult / 2.0 ), leftHeight, 0 ) );
m_vertexArray->push_back( osg::Vec3( ( right - rightSize * mult / 2.0 ), rightHeight, 0 ) );
m_colors->push_back( wge::osgColor( m_tree->getColor( cluster ) ) );
m_colors->push_back( wge::osgColor( m_tree->getColor( cluster ) ) );
m_colors->push_back( wge::osgColor( m_tree->getColor( cluster ) ) );
m_colors->push_back( wge::osgColor( m_tree->getColor( cluster ) ) );
m_lineArray->push_back( m_vertexArray->size() - 4 );
m_lineArray->push_back( m_vertexArray->size() - 2 );
m_lineArray->push_back( m_vertexArray->size() - 3 );
m_lineArray->push_back( m_vertexArray->size() - 1 );
layout( leftCluster, left, left + leftSize * mult );
layout( rightCluster, right - rightSize * mult, right );
}
}
}
size_t WDendrogramGeode::getClickedCluster( int xClick, int yClick )
{
m_xClicked = ( xClick - m_xOff ) / m_xSize * ( m_tree->size( m_rootCluster ) - 1 );
m_yClicked = ( yClick - m_yOff ) / m_ySize * ( m_tree->getLevel( m_rootCluster ) - 1 );
getClickClusterRecursive( m_rootCluster, 0.0f, static_cast<float>( m_tree->size( m_rootCluster ) - 1 ) );
//std::cout << xClick << "," << yClick << " : " << m_xClicked << "," << m_yClicked << std::endl;
return m_clickedCluster;
}
void WDendrogramGeode::getClickClusterRecursive( size_t cluster, float left, float right )
{
int height = m_tree->getLevel( cluster );
if ( height == m_yClicked )
{
m_clickedCluster = cluster;
return;
}
int size = right - left;
if ( m_tree->getLevel( cluster ) > 0 )
{
size_t leftCluster = m_tree->getChildren( cluster ).first;
size_t rightCluster = m_tree->getChildren( cluster ).second;
float leftSize = static_cast<float>( m_tree->size( leftCluster ) );
float rightSize = static_cast<float>( m_tree->size( rightCluster ) );
if ( ( leftSize >= m_minClusterSize ) && ( rightSize < m_minClusterSize ) )
{
// left cluster is much bigger, draw only left
getClickClusterRecursive( leftCluster, left, right );
}
else if ( ( rightSize >= m_minClusterSize ) && ( leftSize < m_minClusterSize ) )
{
// right cluster is much bigger, draw only right
getClickClusterRecursive( rightCluster, left, right );
}
else
{
float mult = size / ( leftSize + rightSize );
if ( m_xClicked < left + leftSize * mult )
{
getClickClusterRecursive( leftCluster, left, left + leftSize * mult );
}
else
{
getClickClusterRecursive( rightCluster, right - rightSize * mult, right );
}
}
}
}
//---------------------------------------------------------------------------
//
// Project: OpenWalnut ( http://www.openwalnut.org )
//
// Copyright 2009 OpenWalnut Community, BSV@Uni-Leipzig and CNCF@MPI-CBS
// For more information see http://www.openwalnut.org/copying
//
// This file is part of OpenWalnut.
//
// OpenWalnut is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// OpenWalnut is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with OpenWalnut. If not, see <http://www.gnu.org/licenses/>.
//
//---------------------------------------------------------------------------
#ifndef WDENDROGRAMGEODE_H
#define WDENDROGRAMGEODE_H
#include <osg/Geode>
#include <osg/Vec3>
#include <osg/Geometry>
#include <osg/MatrixTransform>
#include <osg/PositionAttitudeTransform>
#include "WHierarchicalTree.h"
/**
* Class creates a dendrogram from a hierarchical clustering
*/
class WDendrogramGeode : public osg::Geode
{
public:
/**
* constructor
*
* \param tree reference to the tree object to work on
* \param cluster root cluster for the dendrogram
* \param minClusterSize minimum for cluster to be drawn, when i the whole tree is drawn
* \param xSize number of pixel to scale the tree on along the x axis
* \param ySize number of pixel to scale the tree on along the y axis
* \param xOffset translation alogn the x axis
* \param yOffset translation alogn the y axis
*
*/
WDendrogramGeode( WHierarchicalTree* tree, size_t cluster, size_t minClusterSize = 1, float xSize = 1000.f,
float ySize = 500.f, float xOffset = 0.0f, float yOffset = 0.0f );
/**
* destructor
*/
~WDendrogramGeode();
/**
* calculate which cluster was clicked from given pixel coordinates
* \param xClick the x coordinate
* \param yClick the y coordinate
* \return the cluster id, will return the root cluster if no cluster can be determinded
*/
size_t getClickedCluster( int xClick, int yClick );
protected:
private:
/**
* helper function the starts the layout process from the input data in the constructor
*/
void create();
/**
* recursive funtion that lays out the tree from top to bottom
* \param cluster the current cluster to work on
* \param left left border of the current subcluster
* \param right right border of the current subcluster
*/
void layout( size_t cluster, float left, float right );
/**
* recurse function that follows the layout to determine the cluster from pixel coordinates
*
* \param cluster cluster to check against coordinates
* \param left left boundary of cluster
* \param right right boundary of cluster
*/
void getClickClusterRecursive( size_t cluster, float left, float right );
WHierarchicalTree* m_tree; //!< the tree to work on
size_t m_rootCluster; //!< top cluster to draw the tree from
osg::ref_ptr<osg::Vec4Array> m_colors; //!< color array
osg::Vec3Array* m_vertexArray; //!< vertex array
osg::DrawElementsUInt* m_lineArray; //!< line array
size_t m_minClusterSize; //!< minimum cluster size to be considered while laying out the dendrogram
float m_xSize; //!< x size in pixel of the final dendrogram
float m_ySize; //!< y size in pixel of the final dendrogram
float m_xOff; //!< x offset
float m_yOff; //!< y offset
float m_xMult; //!< helper variable for the recursive function
float m_yMult; //!< helper variable for the recursive function
int m_xClicked; //!< stores the click position for use int he recursive function
int m_yClicked; //!< stores the click position for use int he recursive function
size_t m_clickedCluster; //!< the clicked cluster
};
#endif // WDENDROGRAMGEODE_H
......@@ -87,7 +87,7 @@ void WHierarchicalTree::addCluster( size_t cluster1, size_t cluster2, size_t lev
++m_clusterCount;
}
boost::shared_ptr< std::vector<bool> >WHierarchicalTree::getOutputBitfield( size_t cluster )
boost::shared_ptr< std::vector<bool> > WHierarchicalTree::getOutputBitfield( size_t cluster )
{
boost::shared_ptr< std::vector< bool > > bf;
// only a single fiber selected
......@@ -311,7 +311,6 @@ std::vector<size_t> WHierarchicalTree::getBestClustersFittingRoi( float ratio, s
float WHierarchicalTree::getRatio( size_t cluster )
{
boost::shared_ptr< std::vector< bool > > roiSelection = WKernel::getRunningKernel()->getRoiManager()->getRoiBitfield();
std::vector<size_t>fibersInCluster = getLeafesForCluster( cluster );
size_t countFibersInCluster = fibersInCluster.size();
......@@ -319,7 +318,7 @@ float WHierarchicalTree::getRatio( size_t cluster )
for ( size_t i = 0; i < countFibersInCluster; ++i )
{
if ( ( *roiSelection )[fibersInCluster[i]] )
if ( ( *m_roiSelection )[fibersInCluster[i]] )
{
++fibersFromClusterActive;
}
......
......@@ -187,6 +187,12 @@ public:
*/
size_t size( size_t cluster );
/**
* setter
* \param bitfield
*/
void setRoiBitField( boost::shared_ptr< std::vector<bool> > bitfield );
protected:
private:
/**
......@@ -247,6 +253,11 @@ private:
* a color value for each cluster
*/
std::vector<WColor>m_colors;
/**
* stores a pointer to the bitfield by the current roi setting
*/
boost::shared_ptr< std::vector<bool> > m_roiSelection;
};
inline size_t WHierarchicalTree::getLeafCount()
......@@ -320,5 +331,9 @@ inline WColor WHierarchicalTree::getColor( size_t cluster )
return m_colors[cluster];
}
inline void WHierarchicalTree::setRoiBitField( boost::shared_ptr< std::vector<bool> > bitfield )
{
m_roiSelection = bitfield;
}
#endif // WHIERARCHICALTREE_H
......@@ -211,6 +211,7 @@ bool WMClusterDisplay::loadTreeAscii( std::string fileName )
{
return true;
}
debugLog() << "something is wrong with the tree file";
return false;
}
......@@ -416,6 +417,9 @@ void WMClusterDisplay::moduleMain()
}
}
m_fiberSelector = boost::shared_ptr<WFiberSelector>( new WFiberSelector( m_dataSet ) );
m_tree.setRoiBitField( m_fiberSelector->getBitfield() );
m_propTreeFile->setHidden( true );
m_readTriggerProp->setHidden( true );
......@@ -430,18 +434,17 @@ void WMClusterDisplay::moduleMain()
m_propSelectedClusterOffset->setMin( 0 - m_tree.getLevel( m_propSelectedCluster->get() ) );
initWidgets();
WKernel::getRunningKernel()->getRoiManager()->setExternalBitfield( m_tree.getOutputBitfield( m_propSelectedCluster->get( true ) ) );
WKernel::getRunningKernel()->getRoiManager()->setUseExternalBitfield( m_active->get( true ) );
createFiberGeode();
m_widgetDirty = true;
updateWidgets();
WKernel::getRunningKernel()->getRoiManager()->getProperties()->getProperty( "dirty" )->getUpdateCondition()->subscribeSignal(
boost::bind( &WMClusterDisplay::handleRoiChanged, this ) );
m_dendrogramGeode = new WDendrogram( &m_tree, m_rootCluster, 1000, 500 );
m_dendrogramGeode = new WDendrogramGeode( &m_tree, m_rootCluster, 1000, 500 );
m_camera->addChild( m_dendrogramGeode );
m_propSelectedCluster->get( true );
m_propSubClusters->get( true );
m_propSubLevelsToColor->get( true );
......@@ -500,7 +503,7 @@ void WMClusterDisplay::moduleMain()
if ( m_active->changed() )
{
WKernel::getRunningKernel()->getRoiManager()->setUseExternalBitfield( m_active->get( true ) );
//WKernel::getRunningKernel()->getRoiManager()->setUseExternalBitfield( m_active->get( true ) );
}
}
con.disconnect();
......@@ -517,9 +520,10 @@ void WMClusterDisplay::handleSelectedClusterChanged()
m_propSelectedClusterOffset->get( true );
m_propMinSizeToColor->setMax( m_tree.size( m_biggestClusters.back() ) );
WKernel::getRunningKernel()->getRoiManager()->setExternalBitfield( m_tree.getOutputBitfield( m_rootCluster ) );
m_fiberDrawable->setBitfield( m_tree.getOutputBitfield( m_rootCluster ) );
m_propSubLevelsToColor->setMax( m_tree.getLevel( m_rootCluster ) );
//colorClusters( m_propSelectedCluster->get( true ) );
colorClusters( m_propSelectedCluster->get( true ) );
m_dendrogramDirty = true;
}
......@@ -567,7 +571,6 @@ void WMClusterDisplay::handleOffsetChanged()
++minusOff;
}
}
WKernel::getRunningKernel()->getRoiManager()->setExternalBitfield( m_tree.getOutputBitfield( m_rootCluster ) );
m_propSubLevelsToColor->setMax( m_tree.getLevel( m_rootCluster ) );
m_dendrogramDirty = true;
......@@ -579,8 +582,6 @@ void WMClusterDisplay::handleBiggestClustersChanged()
m_propMinSizeToColor->setMax( m_tree.size( m_biggestClusters.back() ) );
WKernel::getRunningKernel()->getRoiManager()->setExternalBitfield( m_tree.getOutputBitfield( m_biggestClusters ) );
m_tree.colorCluster( m_tree.getClusterCount() - 1, WColor( 0.3, 0.3, 0.3, 1.0 ) );
setColor( m_tree.getLeafesForCluster( m_rootCluster ), WColor( 0.3, 0.3, 0.3, 1.0 ) );
......@@ -594,11 +595,12 @@ void WMClusterDisplay::handleBiggestClustersChanged()
m_dendrogramDirty = true;
m_widgetDirty = true;
m_biggestClusterButtonsChanged = true;
m_fiberDrawable->setBitfield( m_tree.getOutputBitfield( m_biggestClusters ) );
}
void WMClusterDisplay::handleColoringChanged()
{
WKernel::getRunningKernel()->getRoiManager()->setExternalBitfield( m_tree.getOutputBitfield( m_propSelectedCluster->get( true ) ) );
m_propSubLevelsToColor->get( true );
m_propMinSizeToColor->get( true );
colorClusters( m_propSelectedCluster->get( true ) );
......@@ -612,32 +614,28 @@ void WMClusterDisplay::handleMinSizeChanged()
void WMClusterDisplay::handleRoiChanged()
{
WKernel::getRunningKernel()->getRunningKernel()->getRoiManager()->dirty( true );
if ( m_active->get() )
{
m_biggestClusters = m_tree.getBestClustersFittingRoi( m_propBoxClusterRatio->get( true ), m_propMaxSubClusters->get( true ) );
WKernel::getRunningKernel()->getRoiManager()->setExternalBitfield( m_tree.getOutputBitfield( m_biggestClusters ) );
m_tree.colorCluster( m_tree.getClusterCount() - 1, WColor( 0.3, 0.3, 0.3, 1.0 ) );
setColor( m_tree.getLeafesForCluster( m_rootCluster ), WColor( 0.3, 0.3, 0.3, 1.0 ) );
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() ) );
}
m_widgetDirty = true;
m_biggestClusterButtonsChanged = true;
m_dendrogramDirty = true;
}
if ( ( m_propMaxSubClusters->get( true ) == 1 ) && ( m_biggestClusters.size() > 0 ) )
{
m_propSelectedCluster->set( m_biggestClusters[0] );
m_tree.colorCluster( m_tree.getClusterCount() - 1, WColor( 0.3, 0.3, 0.3, 1.0 ) );
setColor( m_tree.getLeafesForCluster( m_rootCluster ), WColor( 0.3, 0.3, 0.3, 1.0 ) );
m_tree.colorCluster( m_propSelectedCluster->get(), WColor( 1.0, 0.3, 0.3, 1.0 ) );
setColor( m_tree.getLeafesForCluster( m_propSelectedCluster->get() ), WColor( 1.0, 0.3, 0.3, 1.0 ) );
}
m_fiberDrawable->setBitfield( m_tree.getOutputBitfield( m_biggestClusters ) );
}
void WMClusterDisplay::updateWidgets()
......@@ -773,12 +771,12 @@ void WMClusterDisplay::updateWidgets()
{
if ( m_propResizeWithWindow->get( true ) )
{
m_dendrogramGeode = new WDendrogram( &m_tree, m_tree.getClusterCount() - 1,
m_dendrogramGeode = new WDendrogramGeode( &m_tree, m_tree.getClusterCount() - 1,
m_propMinSizeToColor->get(), width - 120, height / 2 , 100 );
}
else
{
m_dendrogramGeode = new WDendrogram( &m_tree, m_tree.getClusterCount() - 1,
m_dendrogramGeode = new WDendrogramGeode( &m_tree, m_tree.getClusterCount() - 1,
m_propMinSizeToColor->get(), dwidth, dheight, dxOff, dyOff );
}
m_camera->addChild( m_dendrogramGeode );
......@@ -862,7 +860,8 @@ bool WMClusterDisplay::widgetClicked()
}
}
WKernel::getRunningKernel()->getRoiManager()->setExternalBitfield( m_tree.getOutputBitfield( activeClusters ) );
m_fiberDrawable->setBitfield( m_tree.getOutputBitfield( activeClusters ) );
//WKernel::getRunningKernel()->getRoiManager()->setExternalBitfield( m_tree.getOutputBitfield( activeClusters ) );
}
return clicked;
}
......@@ -943,7 +942,8 @@ void WMClusterDisplay::colorClusters( size_t current )
setColor( m_tree.getLeafesForCluster( cluster ), wge::getNthHSVColor( n++, parts ) );
}
WKernel::getRunningKernel()->getRoiManager()->setExternalBitfield( m_tree.getOutputBitfield( finalList ) );
m_fiberDrawable->setBitfield( m_tree.getOutputBitfield( finalList ) );
//WKernel::getRunningKernel()->getRoiManager()->setExternalBitfield( m_tree.getOutputBitfield( finalList ) );
m_biggestClusters.clear();
m_biggestClusterButtonsChanged = true;
......@@ -951,9 +951,9 @@ void WMClusterDisplay::colorClusters( size_t current )
void WMClusterDisplay::setColor( std::vector<size_t> clusters, WColor color )
{
boost::shared_ptr< std::vector< float > >colorField = WKernel::getRunningKernel()->getRoiManager()->getCustomColors();
boost::shared_ptr< std::vector< size_t > > starts = WKernel::getRunningKernel()->getRoiManager()->getStarts();
boost::shared_ptr< std::vector< size_t > > lengths = WKernel::getRunningKernel()->getRoiManager()->getLengths();
boost::shared_ptr< std::vector< float > >colorField = m_dataSet->getColorScheme( "Custom Color" )->getColor();
boost::shared_ptr< std::vector< size_t > > starts = m_fiberSelector->getStarts();
boost::shared_ptr< std::vector< size_t > > lengths = m_fiberSelector->getLengths();
for ( size_t i = 0; i < clusters.size(); ++i )
{
......@@ -979,3 +979,31 @@ void WMClusterDisplay::dendrogramClick( WPickInfo pickInfo )
m_propSelectedCluster->set( m_dendrogramGeode->getClickedCluster( x, y ) );
}
void WMClusterDisplay::createFiberGeode()
{
m_fiberDrawable = osg::ref_ptr< WFiberDrawable >( new WFiberDrawable );
m_fiberDrawable->setBoundingBox( osg::BoundingBox( m_dataSet->getBoundingBox().first[0],
m_dataSet->getBoundingBox().first[1],
m_dataSet->getBoundingBox().first[2],
m_dataSet->getBoundingBox().second[0],
m_dataSet->getBoundingBox().second[1],
m_dataSet->getBoundingBox().second[2] ) );
m_fiberDrawable->setStartIndexes( m_dataSet->getLineStartIndexes() );
m_fiberDrawable->setPointsPerLine( m_dataSet->getLineLengths() );
m_fiberDrawable->setVerts( m_dataSet->getVertices() );
m_fiberDrawable->setTangents( m_dataSet->getTangents() );
m_fiberDrawable->setColor( m_dataSet->getColorScheme( "Custom Color" )->getColor() );
m_fiberDrawable->setBitfield( m_fiberSelector->getBitfield() );
m_fiberDrawable->setUseDisplayList(<