Commit bb71e714 authored by Alexander Wiebel's avatar Alexander Wiebel
Browse files

[ADD] Added function that returns not only the most interval but all...

[ADD] Added function that returns not only the most interval but all candidates for lower bounds of intervals.
Will be needed for implementation of http://dx.doi.org/10.2312/PE.EuroVisShort.EuroVisShort2013.091-095 and http://dx.doi.org/10.2312/eurovisshort.20141164
parent 53d9a27f
......@@ -382,7 +382,7 @@ void WMPickingDVR::moduleMain()
//WYSIWYP: Calculate the largest interval
if( strRenderMode == WMPICKINGDVR_WYSIWYP )
{
std::pair<int, int> bounds = calculateIntervalWYSIWYP( vecAlphaAcc );
std::pair<int, int> bounds = getWYSIWYPBounds( vecAlphaAcc );
//Calculate Position
if( bounds.first >= 0 )
......@@ -495,7 +495,15 @@ void WMPickingDVR::updateModuleGUI( std::string strRenderMode )
}
}
std::pair<int, int> WMPickingDVR::calculateIntervalWYSIWYP( std::vector<double> vecAlphaAcc )
std::pair<int, int> WMPickingDVR::getWYSIWYPBounds( const std::vector<double>& vecAlphaAcc )
{
std::vector<int> dummyVector;
return calculateIntervalsWYSIWYP( vecAlphaAcc, dummyVector );
}
std::pair<int, int> WMPickingDVR::calculateIntervalsWYSIWYP( const std::vector<double>& vecAlphaAcc,
std::vector<int>& vecIndicesLowerBounds )
{
//Derivative Variables
std::vector<double> vecFirstDerivative;
......@@ -503,8 +511,7 @@ std::pair<int, int> WMPickingDVR::calculateIntervalWYSIWYP( std::vector<double>
calculateDerivativesWYSIWYP( vecAlphaAcc, vecFirstDerivative, vecSecondDerivative );
//Create Intervals
std::vector<int> vecIndicesLowerBounds;
// Upper bounds temporary variable ... will not be returned
std::vector<int> vecIndicesUpperBounds;
//Calculate Interval Boundaries
......@@ -552,6 +559,7 @@ std::pair<int, int> WMPickingDVR::calculateIntervalWYSIWYP( std::vector<double>
}
}
debugLog() << "Start of largest interval " << sampleLo;
return std::make_pair( sampleLo, sampleUp );
}
......
......@@ -123,7 +123,19 @@ private:
*
* \result lower and upper bounds of the determined interval
*/
std::pair<int, int> calculateIntervalWYSIWYP( std::vector<double> vecAlphaAcc );
std::pair<int, int> getWYSIWYPBounds( const std::vector<double>& vecAlphaAcc );
/**
* Calculates the object intervals according
* to WYSIWYP (http://dx.doi.org/10.1109/TVCG.2012.292)
*
* \param vecAlphaAcc The accumulated alpha values at the samples along the viewing ray
* \param vecIndicesLowerBounds Returns the lower bounds of all intervals.
*
* \result lower and upper bounds of the most visible interval
*/
std::pair<int, int> calculateIntervalsWYSIWYP( const std::vector<double>& vecAlphaAcc,
std::vector<int>& vecIndicesLowerBounds );
/**
* Computes the first and second derivatives of a vector of values
......
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