Commit 2c1363c6 authored by Sebastian Eichelbaum's avatar Sebastian Eichelbaum
Browse files

[CHANGE] - removed in-place normalize() calls in dataHandler

parent 0cd56b48
......@@ -328,8 +328,7 @@ WPosition_2 WDataSetFibers::getTangent( size_t fiber, size_t vertex ) const
tangent = pointBefore - pointNext;
}
tangent.normalize();
return tangent;
return normalize( tangent );
}
/**
......
......@@ -89,7 +89,7 @@ namespace wtracking
double p;
double z;
WVector3d_2 d = grid->getDirectionX();
d.normalize();
d = normalize( d );
double c = dot( d, v ) / grid->getOffsetX() + 0.5;
p = c >= 0.0 ? modf( c, &z ) : 1.0 + modf( c, &z );
if( fabs( p ) < TRACKING_EPS || fabs( p - 1 ) < TRACKING_EPS )
......@@ -97,7 +97,7 @@ namespace wtracking
return true;
}
d = grid->getDirectionY();
d.normalize();
d = normalize( d );
c = dot( d, v ) / grid->getOffsetY() + 0.5;
p = c >= 0.0 ? modf( c, &z ) : 1.0 + modf( c, &z );
if( fabs( p ) < TRACKING_EPS || fabs( p - 1 ) < TRACKING_EPS )
......@@ -105,7 +105,7 @@ namespace wtracking
return true;
}
d = grid->getDirectionZ();
d.normalize();
d = normalize( d );
c = dot( d, v ) / grid->getOffsetZ() + 0.5;
p = c >= 0.0 ? modf( c, &z ) : 1.0 + modf( c, &z );
if( fabs( p ) < TRACKING_EPS || fabs( p - 1 ) < TRACKING_EPS )
......
......@@ -322,8 +322,8 @@ public:
WVector3d_2 x( 0.707, 0.707, 0.0 );
WVector3d_2 y( -0.707, 0.707, 0.0 );
WVector3d_2 z( 0.0, 0.0, 1.0 );
x.normalize();
y.normalize();
x = normalize( x );
y = normalize( y );
y *= 2.0;
z *= 1.5;
......@@ -358,8 +358,8 @@ public:
WVector3d_2 x( 0.707, 0.707, 0.0 );
WVector3d_2 y( -0.707, 0.707, 0.0 );
WVector3d_2 z( 0.0, 0.0, 1.0 );
x.normalize();
y.normalize();
x = normalize( x );
y = normalize( y );
y *= 2.0;
z *= 1.5;
......@@ -542,8 +542,8 @@ public:
WVector3d_2 x( 0.707, 0.707, 0.0 );
WVector3d_2 y( -0.707, 0.707, 0.0 );
WVector3d_2 z( 0.0, 0.0, 1.0 );
x.normalize();
y.normalize();
x = normalize( x );
y = normalize( y );
y *= 2.0;
z *= 1.5;
......
......@@ -60,8 +60,8 @@ public:
WVector3d_2 x( 0.707, 0.707, 0.0 );
WVector3d_2 y( -0.707, 0.707, 0.0 );
WVector3d_2 z( 0.0, 0.0, 1.0 );
x.normalize();
y.normalize();
x = normalize( x );
y = normalize( y );
boost::shared_ptr< WDataSetSingle > ds = buildTestData( WVector3d_2( 0.0, 1.0, 0.0 ) );
// test the test
......@@ -126,8 +126,8 @@ public:
WVector3d_2 x( 0.707, 0.707, 0.0 );
WVector3d_2 y( -0.707, 0.707, 0.0 );
WVector3d_2 z( 0.0, 0.0, 1.0 );
x.normalize();
y.normalize();
x = normalize( x );
y = normalize( y );
WVector3d_2 v( 1.0, 0.0, 0.0 );
......@@ -146,7 +146,7 @@ public:
v = WVector3d_2( 2.9741, 3.527, 1.992 );
WVector3d_2 dir( 3, 4, -2.003 );
dir.normalize();
dir = normalize( dir );
double t = wtracking::WTrackingUtility::getDistanceToBoundary( g, v, dir );
WVector3d_2 res = v + dir * t;
TS_ASSERT( wtracking::WTrackingUtility::onBoundary( g, res ) );
......@@ -165,8 +165,8 @@ public:
WVector3d_2 x( 0.707, 0.707, 0.0 );
WVector3d_2 y( -0.707, 0.707, 0.0 );
WVector3d_2 z( 0.0, 0.0, 1.0 );
x.normalize();
y.normalize();
x = normalize( x );
y = normalize( y );
boost::shared_ptr< WDataSetSingle > ds = buildTestData( WVector3d_2( 0.0, 1.0, 0.0 ) );
boost::shared_ptr< WGridRegular3D > g = boost::shared_dynamic_cast< WGridRegular3D >( ds->getGrid() );
......@@ -197,7 +197,7 @@ private:
WVector3d_2 simpleDirFunc( wtracking::WTrackingUtility::DataSetPtr, wtracking::WTrackingUtility::JobType const& )
{
WVector3d_2 v( 1.0, 1.0, 0.0 );
v.normalize();
v = normalize( v );
return v;
}
......@@ -212,8 +212,8 @@ private:
WVector3d_2 y( -0.707, 0.707, 0.0 );
WVector3d_2 z( 0.0, 0.0, 1.0 );
x.normalize();
y.normalize();
x = normalize( x );
y = normalize( y );
y *= 2.0;
z *= 1.5;
......@@ -234,7 +234,7 @@ private:
WGridTransformOrtho t( mat );
boost::shared_ptr< WGrid > g( new WGridRegular3D( 5, 5, 5, t ) );
data.normalize();
data = normalize( data );
boost::shared_ptr< std::vector< double > > v = boost::shared_ptr< std::vector< double > >( new std::vector< double > ( 5 * 5 * 5 * 3 ) );
for( std::size_t k = 0; k < 5 * 5 * 5; ++k )
......@@ -411,8 +411,8 @@ public:
WVector3d_2 x( 0.707, 0.707, 0.0 );
WVector3d_2 y( -0.707, 0.707, 0.0 );
WVector3d_2 z( 0.0, 0.0, 1.0 );
x.normalize();
y.normalize();
x = normalize( x );
y = normalize( y );
y *= 2.0;
z *= 1.5;
......@@ -534,8 +534,8 @@ public:
WVector3d_2 x( 0.707, 0.707, 0.0 );
WVector3d_2 y( -0.707, 0.707, 0.0 );
WVector3d_2 z( 0.0, 0.0, 1.0 );
x.normalize();
y.normalize();
x = normalize( x );
y = normalize( y );
boost::shared_ptr< WDataSetSingle > ds = buildTestData( WVector3d_2( 1.0, 0.0, 0.0 ), 7 );
boost::shared_ptr< WGridRegular3D > g = boost::shared_dynamic_cast< WGridRegular3D >( ds->getGrid() );
......@@ -578,8 +578,8 @@ private:
WVector3d_2 x( 0.707, 0.707, 0.0 );
WVector3d_2 y( -0.707, 0.707, 0.0 );
WVector3d_2 z( 0.0, 0.0, 1.0 );
x.normalize();
y.normalize();
x = normalize( x );
y = normalize( y );
y *= 2.0;
z *= 1.5;
......@@ -599,7 +599,7 @@ private:
WGridTransformOrtho t( mat );
boost::shared_ptr< WGrid > g( new WGridRegular3D( n, n, n, t ) );
data.normalize();
data = normalize( data );
boost::shared_ptr< std::vector< double > > v = boost::shared_ptr< std::vector< double > >( new std::vector< double >( n * n * n * 3 ) );
for( std::size_t k = 0; k < static_cast< std::size_t >( n * n * n ); ++k )
......
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