Commit bb70ff25 authored by Joshua Santana's avatar Joshua Santana
Browse files

[REFAC] set color bar scale minimum value to minimum cluster size in dataset

parent 92ae49ab
......@@ -76,6 +76,7 @@ void WCsvConverter::setOutputFromCSV( )
m_indexes->update( m_protonData );
float maxEdep = 0.0;
float minEdep = 1.0;
for( WDataSetCSV::Content::iterator dataRow = data->begin(); dataRow < data->end(); dataRow++ )
{
......@@ -93,7 +94,7 @@ void WCsvConverter::setOutputFromCSV( )
addVertex( dataRow );
addColor( plainColor );
addEdepAndSize( dataRow, &maxEdep );
addEdepAndSize( dataRow, &maxEdep, &minEdep );
addEventID( dataRow );
}
......@@ -102,7 +103,7 @@ void WCsvConverter::setOutputFromCSV( )
return;
}
normalizeEdeps( m_vectors->getEdeps(), m_vectors->getColors(), maxEdep );
normalizeEdeps( m_vectors->getEdeps(), m_vectors->getColors(), maxEdep, minEdep );
createOutputPoints();
createOutputFibers();
......@@ -125,7 +126,7 @@ boost::shared_ptr< std::vector<unsigned char> > WCsvConverter::sampleTransferFun
return data;
}
void WCsvConverter::normalizeEdeps( SPFloatVector edeps, SPFloatVector colorArray, float maxEdep )
void WCsvConverter::normalizeEdeps( SPFloatVector edeps, SPFloatVector colorArray, float maxEdep, float minEdep )
{
if( m_protonData->isColumnAvailable( WSingleSelectorName::getEdep() ) )
{
......@@ -134,6 +135,7 @@ void WCsvConverter::normalizeEdeps( SPFloatVector edeps, SPFloatVector colorArra
setTransferFunction( data );
float maxClusterSize = getClusterSize( maxEdep );
float minClusterSize = getClusterSize( minEdep );
for( std::vector< float >::iterator currentEdep = edeps->begin();
currentEdep != edeps->end();
......@@ -156,6 +158,7 @@ void WCsvConverter::normalizeEdeps( SPFloatVector edeps, SPFloatVector colorArra
m_colorBar->getProperties()->getProperty( "Max scale value" )->set( 0.0 );
m_colorBar->getProperties()->getProperty( "Max scale value" )->set( maxClusterSize );
m_colorBar->getProperties()->getProperty( "Min scale value" )->set( minClusterSize );
m_colorBar->getProperties()->getProperty( "Description" )->set( std::string( "Clustersize " ) );
bool activated = m_propertyStatus->getVisualizationPropertyHandler()->getColorFromEdep()->get();
......@@ -231,7 +234,7 @@ void WCsvConverter::addColor( WColor plainColor )
}
}
void WCsvConverter::addEdepAndSize( WDataSetCSV::Content::iterator dataRow, float* maxEdep )
void WCsvConverter::addEdepAndSize( WDataSetCSV::Content::iterator dataRow, float* maxEdep, float* minEdep )
{
if( !m_protonData->isColumnAvailable( WSingleSelectorName::getEdep() ) )
{
......@@ -244,6 +247,11 @@ void WCsvConverter::addEdepAndSize( WDataSetCSV::Content::iterator dataRow, floa
*maxEdep = edep;
}
if( edep < *minEdep )
{
*minEdep = edep;
}
m_vectors->getEdeps()->push_back( edep );
}
......
......@@ -156,8 +156,9 @@ private:
* \param edeps vector containing energy deposition values
* \param colorArray vector containing colors per vertex
* \param maxEdep maximum energy deposition
* \param minEdep minimum energy deposition
*/
void normalizeEdeps( SPFloatVector edeps, SPFloatVector colorArray, float maxEdep );
void normalizeEdeps( SPFloatVector edeps, SPFloatVector colorArray, float maxEdep, float minEdep );
/**
......@@ -187,8 +188,9 @@ private:
*
* \param dataRow each row of the csv file (content of row)
* \param maxEdep a pointer to the current maximum of the edep
* \param minEdep a pointer to the current minimum of the edep
*/
void addEdepAndSize( WDataSetCSV::Content::iterator dataRow, float* maxEdep );
void addEdepAndSize( WDataSetCSV::Content::iterator dataRow, float* maxEdep, float* minEdep );
/**
* Create eventID for Fiber renderer
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment