Commit 7b757bff authored by Mathias Goldau's avatar Mathias Goldau
Browse files

[FIX #230] There was an warning from clang about an unused-function:...

[FIX #230] There was an warning from clang about an unused-function: intervalDistance. Although the function it self was used it has resided inside an anoynmous namespace WITHIN A HEADER file. That was the reason, when ever one included the header file a NEW anonymous namespace was generated which INDEED led to the unused function. However moving this helper function into the private implementation everything is right now.
parent 846dd4bc
......@@ -168,6 +168,17 @@ public:
protected:
private:
/**
* Checks if the two given intervals intersect and computes the distance between them.
*
* \param a0 lower bound of the first interval
* \param a1 upper bound of the first interval
* \param b0 lower bound of the second interval
* \param b1 upper bound if the second interval
*
* \return The distance between those intervals if they don't overlap, zero otherwise
*/
double intervalDistance( double a0, double a1, double b0, double b1 ) const;
};
template< class VT >
......@@ -223,33 +234,18 @@ inline bool WBoundingBoxImpl< VT >::intersects( const WBoundingBoxImpl< VT > &bb
return osg::BoundingBoxImpl< VT >::intersects( bb );
}
/**
* Anonymous namespace, just to be DRY in minDistance.
*/
namespace
template< class VT >
inline double WBoundingBoxImpl< VT >::intervalDistance( double a0, double a1, double b0, double b1 ) const
{
/**
* Checks if the two given intervals intersect and computes the distance between them.
*
* \param a0 lower bound of the first interval
* \param a1 upper bound of the first interval
* \param b0 lower bound of the second interval
* \param b1 upper bound if the second interval
*
* \return The distance between those intervals if they don't overlap, zero otherwise
*/
inline double intervalDistance( double a0, double a1, double b0, double b1 )
if( a1 < b0 )
{
if( a1 < b0 )
{
return b0 - a1;
}
else if( b1 < a0 )
{
return a0 - b1;
}
return 0.0;
return b0 - a1;
}
else if( b1 < a0 )
{
return a0 - b1;
}
return 0.0;
}
template< class VT >
......
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