Commit 7a1314ff authored by Alexander Wiebel's avatar Alexander Wiebel

[CLEAN #381] removed now useless function

parent 8decd1e5
...@@ -88,12 +88,6 @@ namespace wge ...@@ -88,12 +88,6 @@ namespace wge
*/ */
osg::Vec3 WGE_EXPORT unprojectFromScreen( const osg::Vec3 screen, osg::ref_ptr< osg::Camera > camera ); osg::Vec3 WGE_EXPORT unprojectFromScreen( const osg::Vec3 screen, osg::ref_ptr< osg::Camera > camera );
/**
* Conversion of WVector3D to osg::Vec3
* \param v the vector to convert.
*/
osg::Vec3 wv3D2ov3( wmath::WVector3D v );
/** /**
* creates the same color as the atlas colormap shader from the index * creates the same color as the atlas colormap shader from the index
* *
...@@ -180,11 +174,6 @@ inline osg::Vec3 wge::osgVec3( const wmath::WPosition& pos ) ...@@ -180,11 +174,6 @@ inline osg::Vec3 wge::osgVec3( const wmath::WPosition& pos )
return osg::Vec3( pos[0], pos[1], pos[2] ); return osg::Vec3( pos[0], pos[1], pos[2] );
} }
inline osg::Vec3 wge::wv3D2ov3( wmath::WVector3D v )
{
return osg::Vec3( v[0], v[1], v[2] );
}
inline osg::Matrixd wge::toOSGMatrix( const wmath::WMatrix<double>& matrix ) inline osg::Matrixd wge::toOSGMatrix( const wmath::WMatrix<double>& matrix )
{ {
WAssert( ( matrix.getNbRows() == 3 || matrix.getNbRows() == 4 ) && ( matrix.getNbCols() == 3 || matrix.getNbCols() == 4 ), WAssert( ( matrix.getNbRows() == 3 || matrix.getNbRows() == 4 ) && ( matrix.getNbCols() == 3 || matrix.getNbCols() == 4 ),
......
...@@ -510,7 +510,7 @@ void WMNavSlices::setSlicePosFromPick( WPickInfo pickInfo ) ...@@ -510,7 +510,7 @@ void WMNavSlices::setSlicePosFromPick( WPickInfo pickInfo )
osg::Vec3 endPosWorld = wge::unprojectFromScreen( endPosScreen, m_viewer->getCamera() ); osg::Vec3 endPosWorld = wge::unprojectFromScreen( endPosScreen, m_viewer->getCamera() );
osg::Vec3 moveDirWorld = endPosWorld - startPosWorld; osg::Vec3 moveDirWorld = endPosWorld - startPosWorld;
float diff = wge::wv3D2ov3( normal ) * moveDirWorld; float diff = normal * moveDirWorld;
// recognize also small values. // recognize also small values.
if( diff < 0 && diff > -1 ) if( diff < 0 && diff > -1 )
...@@ -628,7 +628,7 @@ osg::ref_ptr<osg::Geometry> WMNavSlices::createGeometry( int slice ) ...@@ -628,7 +628,7 @@ osg::ref_ptr<osg::Geometry> WMNavSlices::createGeometry( int slice )
vertices.push_back( wmath::WPosition( xPos, m_bb.second[1], m_bb.first[2] ) ); vertices.push_back( wmath::WPosition( xPos, m_bb.second[1], m_bb.first[2] ) );
for( size_t i = 0; i < nbVerts; ++i ) for( size_t i = 0; i < nbVerts; ++i )
{ {
sliceVertices->push_back( wge::wv3D2ov3( vertices[i] ) ); sliceVertices->push_back( vertices[i] );
} }
sliceGeometry->setVertexArray( sliceVertices ); sliceGeometry->setVertexArray( sliceVertices );
...@@ -641,7 +641,7 @@ osg::ref_ptr<osg::Geometry> WMNavSlices::createGeometry( int slice ) ...@@ -641,7 +641,7 @@ osg::ref_ptr<osg::Geometry> WMNavSlices::createGeometry( int slice )
osg::Vec3Array* texCoords = new osg::Vec3Array; osg::Vec3Array* texCoords = new osg::Vec3Array;
for( size_t i = 0; i < nbVerts; ++i ) for( size_t i = 0; i < nbVerts; ++i )
{ {
texCoords->push_back( wge::wv3D2ov3( grid->worldCoordToTexCoord( vertices[i] ) ) ); texCoords->push_back( grid->worldCoordToTexCoord( vertices[i] ) );
} }
sliceGeometry->setTexCoordArray( c, texCoords ); sliceGeometry->setTexCoordArray( c, texCoords );
++c; ++c;
...@@ -655,7 +655,7 @@ osg::ref_ptr<osg::Geometry> WMNavSlices::createGeometry( int slice ) ...@@ -655,7 +655,7 @@ osg::ref_ptr<osg::Geometry> WMNavSlices::createGeometry( int slice )
osg::Vec3Array* texCoords = new osg::Vec3Array; osg::Vec3Array* texCoords = new osg::Vec3Array;
for( size_t i = 0; i < nbVerts; ++i ) for( size_t i = 0; i < nbVerts; ++i )
{ {
texCoords->push_back( wge::wv3D2ov3( grid->worldCoordToTexCoord( vertices[i] ) ) ); texCoords->push_back( grid->worldCoordToTexCoord( vertices[i] ) );
} }
sliceGeometry->setTexCoordArray( c, texCoords ); sliceGeometry->setTexCoordArray( c, texCoords );
++c; ++c;
...@@ -672,7 +672,7 @@ osg::ref_ptr<osg::Geometry> WMNavSlices::createGeometry( int slice ) ...@@ -672,7 +672,7 @@ osg::ref_ptr<osg::Geometry> WMNavSlices::createGeometry( int slice )
vertices.push_back( wmath::WPosition( m_bb.second[0], yPos, m_bb.first[2] ) ); vertices.push_back( wmath::WPosition( m_bb.second[0], yPos, m_bb.first[2] ) );
for( size_t i = 0; i < nbVerts; ++i ) for( size_t i = 0; i < nbVerts; ++i )
{ {
sliceVertices->push_back( wge::wv3D2ov3( vertices[i] ) ); sliceVertices->push_back( vertices[i] );
} }
sliceGeometry->setVertexArray( sliceVertices ); sliceGeometry->setVertexArray( sliceVertices );
...@@ -684,7 +684,7 @@ osg::ref_ptr<osg::Geometry> WMNavSlices::createGeometry( int slice ) ...@@ -684,7 +684,7 @@ osg::ref_ptr<osg::Geometry> WMNavSlices::createGeometry( int slice )
osg::Vec3Array* texCoords = new osg::Vec3Array; osg::Vec3Array* texCoords = new osg::Vec3Array;
for( size_t i = 0; i < nbVerts; ++i ) for( size_t i = 0; i < nbVerts; ++i )
{ {
texCoords->push_back( wge::wv3D2ov3( grid->worldCoordToTexCoord( vertices[i] ) ) ); texCoords->push_back( grid->worldCoordToTexCoord( vertices[i] ) );
} }
sliceGeometry->setTexCoordArray( c, texCoords ); sliceGeometry->setTexCoordArray( c, texCoords );
++c; ++c;
...@@ -698,7 +698,7 @@ osg::ref_ptr<osg::Geometry> WMNavSlices::createGeometry( int slice ) ...@@ -698,7 +698,7 @@ osg::ref_ptr<osg::Geometry> WMNavSlices::createGeometry( int slice )
osg::Vec3Array* texCoords = new osg::Vec3Array; osg::Vec3Array* texCoords = new osg::Vec3Array;
for( size_t i = 0; i < nbVerts; ++i ) for( size_t i = 0; i < nbVerts; ++i )
{ {
texCoords->push_back( wge::wv3D2ov3( grid->worldCoordToTexCoord( vertices[i] ) ) ); texCoords->push_back( grid->worldCoordToTexCoord( vertices[i] ) );
} }
sliceGeometry->setTexCoordArray( c, texCoords ); sliceGeometry->setTexCoordArray( c, texCoords );
++c; ++c;
...@@ -714,7 +714,7 @@ osg::ref_ptr<osg::Geometry> WMNavSlices::createGeometry( int slice ) ...@@ -714,7 +714,7 @@ osg::ref_ptr<osg::Geometry> WMNavSlices::createGeometry( int slice )
vertices.push_back( wmath::WPosition( m_bb.second[0], m_bb.first[1], zPos ) ); vertices.push_back( wmath::WPosition( m_bb.second[0], m_bb.first[1], zPos ) );
for( size_t i = 0; i < nbVerts; ++i ) for( size_t i = 0; i < nbVerts; ++i )
{ {
sliceVertices->push_back( wge::wv3D2ov3( vertices[i] ) ); sliceVertices->push_back( vertices[i] );
} }
sliceGeometry->setVertexArray( sliceVertices ); sliceGeometry->setVertexArray( sliceVertices );
...@@ -727,7 +727,7 @@ osg::ref_ptr<osg::Geometry> WMNavSlices::createGeometry( int slice ) ...@@ -727,7 +727,7 @@ osg::ref_ptr<osg::Geometry> WMNavSlices::createGeometry( int slice )
osg::Vec3Array* texCoords = new osg::Vec3Array; osg::Vec3Array* texCoords = new osg::Vec3Array;
for( size_t i = 0; i < nbVerts; ++i ) for( size_t i = 0; i < nbVerts; ++i )
{ {
texCoords->push_back( wge::wv3D2ov3( grid->worldCoordToTexCoord( vertices[i] ) ) ); texCoords->push_back( grid->worldCoordToTexCoord( vertices[i] ) );
} }
sliceGeometry->setTexCoordArray( c, texCoords ); sliceGeometry->setTexCoordArray( c, texCoords );
++c; ++c;
...@@ -742,7 +742,7 @@ osg::ref_ptr<osg::Geometry> WMNavSlices::createGeometry( int slice ) ...@@ -742,7 +742,7 @@ osg::ref_ptr<osg::Geometry> WMNavSlices::createGeometry( int slice )
for( size_t i = 0; i < nbVerts; ++i ) for( size_t i = 0; i < nbVerts; ++i )
{ {
texCoords->push_back( wge::wv3D2ov3( grid->worldCoordToTexCoord( vertices[i] ) ) ); texCoords->push_back( grid->worldCoordToTexCoord( vertices[i] ) );
} }
sliceGeometry->setTexCoordArray( c, texCoords ); sliceGeometry->setTexCoordArray( c, texCoords );
++c; ++c;
...@@ -818,7 +818,7 @@ osg::ref_ptr<osg::Geometry> WMNavSlices::createCrossGeometry( int slice ) ...@@ -818,7 +818,7 @@ osg::ref_ptr<osg::Geometry> WMNavSlices::createCrossGeometry( int slice )
for( size_t i = 0; i < vertices.size(); ++i ) for( size_t i = 0; i < vertices.size(); ++i )
{ {
crossVertices->push_back( wge::wv3D2ov3( vertices[i] ) ); crossVertices->push_back( vertices[i] );
} }
colorArray->push_back( osg::Vec3( 1.0f, 0.0f, 0.0f ) ); colorArray->push_back( osg::Vec3( 1.0f, 0.0f, 0.0f ) );
......
...@@ -275,10 +275,10 @@ void WMArbitraryPlane::updatePlane() ...@@ -275,10 +275,10 @@ void WMArbitraryPlane::updatePlane()
osg::ref_ptr<osg::Geometry> planeGeometry = osg::ref_ptr<osg::Geometry>( new osg::Geometry() ); osg::ref_ptr<osg::Geometry> planeGeometry = osg::ref_ptr<osg::Geometry>( new osg::Geometry() );
osg::Vec3Array* planeVertices = new osg::Vec3Array; osg::Vec3Array* planeVertices = new osg::Vec3Array;
planeVertices->push_back( wge::wv3D2ov3( v0 ) ); planeVertices->push_back( v0 );
planeVertices->push_back( wge::wv3D2ov3( v1 ) ); planeVertices->push_back( v1 );
planeVertices->push_back( wge::wv3D2ov3( v2 ) ); planeVertices->push_back( v2 );
planeVertices->push_back( wge::wv3D2ov3( v3 ) ); planeVertices->push_back( v3 );
planeGeometry->setVertexArray( planeVertices ); planeGeometry->setVertexArray( planeVertices );
osg::DrawElementsUInt* quad = new osg::DrawElementsUInt( osg::PrimitiveSet::QUADS, 0 ); osg::DrawElementsUInt* quad = new osg::DrawElementsUInt( osg::PrimitiveSet::QUADS, 0 );
...@@ -298,10 +298,10 @@ void WMArbitraryPlane::updatePlane() ...@@ -298,10 +298,10 @@ void WMArbitraryPlane::updatePlane()
boost::shared_ptr< WGridRegular3D > grid = WKernel::getRunningKernel()->getSelectionManager()->getGrid(); boost::shared_ptr< WGridRegular3D > grid = WKernel::getRunningKernel()->getSelectionManager()->getGrid();
osg::Vec3Array* texCoords = new osg::Vec3Array; osg::Vec3Array* texCoords = new osg::Vec3Array;
texCoords->push_back( wge::wv3D2ov3( grid->worldCoordToTexCoord( v0 ) ) ); texCoords->push_back( grid->worldCoordToTexCoord( v0 ) );
texCoords->push_back( wge::wv3D2ov3( grid->worldCoordToTexCoord( v1 ) ) ); texCoords->push_back( grid->worldCoordToTexCoord( v1 ) );
texCoords->push_back( wge::wv3D2ov3( grid->worldCoordToTexCoord( v2 ) ) ); texCoords->push_back( grid->worldCoordToTexCoord( v2 ) );
texCoords->push_back( wge::wv3D2ov3( grid->worldCoordToTexCoord( v3 ) ) ); texCoords->push_back( grid->worldCoordToTexCoord( v3 ) );
planeGeometry->setTexCoordArray( c, texCoords ); planeGeometry->setTexCoordArray( c, texCoords );
++c; ++c;
...@@ -313,10 +313,10 @@ void WMArbitraryPlane::updatePlane() ...@@ -313,10 +313,10 @@ void WMArbitraryPlane::updatePlane()
osg::Vec3Array* texCoords = new osg::Vec3Array; osg::Vec3Array* texCoords = new osg::Vec3Array;
texCoords->push_back( wge::wv3D2ov3( grid->worldCoordToTexCoord( v0 ) ) ); texCoords->push_back( grid->worldCoordToTexCoord( v0 ) );
texCoords->push_back( wge::wv3D2ov3( grid->worldCoordToTexCoord( v1 ) ) ); texCoords->push_back( grid->worldCoordToTexCoord( v1 ) );
texCoords->push_back( wge::wv3D2ov3( grid->worldCoordToTexCoord( v2 ) ) ); texCoords->push_back( grid->worldCoordToTexCoord( v2 ) );
texCoords->push_back( wge::wv3D2ov3( grid->worldCoordToTexCoord( v3 ) ) ); texCoords->push_back( grid->worldCoordToTexCoord( v3 ) );
planeGeometry->setTexCoordArray( c, texCoords ); planeGeometry->setTexCoordArray( c, texCoords );
++c; ++c;
......
...@@ -185,11 +185,6 @@ void WMLineGuidedSlice::create() ...@@ -185,11 +185,6 @@ void WMLineGuidedSlice::create()
WKernel::getRunningKernel()->getGraphicsEngine()->getScene()->insert( m_rootNode ); WKernel::getRunningKernel()->getGraphicsEngine()->getScene()->insert( m_rootNode );
} }
osg::Vec3 wv3D2ov3( wmath::WVector3D v ) // WVector3D to osg::Vec3 conversion
{
return osg::Vec3( v[0], v[1], v[2] );
}
void WMLineGuidedSlice::setSlicePosFromPick( WPickInfo pickInfo ) void WMLineGuidedSlice::setSlicePosFromPick( WPickInfo pickInfo )
{ {
if( pickInfo.getName() == "Line Guided Slice" ) if( pickInfo.getName() == "Line Guided Slice" )
...@@ -258,7 +253,7 @@ osg::ref_ptr<osg::Geometry> WMLineGuidedSlice::createGeometry() ...@@ -258,7 +253,7 @@ osg::ref_ptr<osg::Geometry> WMLineGuidedSlice::createGeometry()
const size_t nbVerts = 4; const size_t nbVerts = 4;
for( size_t i = 0; i < nbVerts; ++i ) for( size_t i = 0; i < nbVerts; ++i )
{ {
sliceVertices->push_back( wv3D2ov3( vertices[i] ) ); sliceVertices->push_back( vertices[i] );
} }
sliceGeometry->setVertexArray( sliceVertices ); sliceGeometry->setVertexArray( sliceVertices );
...@@ -271,7 +266,7 @@ osg::ref_ptr<osg::Geometry> WMLineGuidedSlice::createGeometry() ...@@ -271,7 +266,7 @@ osg::ref_ptr<osg::Geometry> WMLineGuidedSlice::createGeometry()
texCoords->clear(); texCoords->clear();
for( size_t i = 0; i < nbVerts; ++i ) for( size_t i = 0; i < nbVerts; ++i )
{ {
texCoords->push_back( wv3D2ov3( grid->worldCoordToTexCoord( vertices[i] + wmath::WVector3D( 0.5, 0.5, 0.5 ) ) ) ); texCoords->push_back( grid->worldCoordToTexCoord( vertices[i] + wmath::WVector3D( 0.5, 0.5, 0.5 ) ) );
} }
sliceGeometry->setTexCoordArray( counter, texCoords ); sliceGeometry->setTexCoordArray( counter, texCoords );
++counter; ++counter;
......
...@@ -629,7 +629,7 @@ void WMMarchingCubes::updateGraphicsForCallback() ...@@ -629,7 +629,7 @@ void WMMarchingCubes::updateGraphicsForCallback()
for( size_t i = 0; i < m_triMesh->vertSize(); ++i ) for( size_t i = 0; i < m_triMesh->vertSize(); ++i )
{ {
osg::Vec3 vertPos = m_triMesh->getVertex( i ); osg::Vec3 vertPos = m_triMesh->getVertex( i );
texCoords->push_back( wge::wv3D2ov3( grid->worldCoordToTexCoord( wmath::WPosition( vertPos[0], vertPos[1], vertPos[2] ) ) ) ); texCoords->push_back( grid->worldCoordToTexCoord( wmath::WPosition( vertPos[0], vertPos[1], vertPos[2] ) ) );
} }
surfaceGeometry->setTexCoordArray( c, texCoords ); surfaceGeometry->setTexCoordArray( c, texCoords );
...@@ -660,7 +660,7 @@ void WMMarchingCubes::updateGraphicsForCallback() ...@@ -660,7 +660,7 @@ void WMMarchingCubes::updateGraphicsForCallback()
for( size_t i = 0; i < m_triMesh->vertSize(); ++i ) for( size_t i = 0; i < m_triMesh->vertSize(); ++i )
{ {
osg::Vec3 vertPos = m_triMesh->getVertex( i ); osg::Vec3 vertPos = m_triMesh->getVertex( i );
texCoords->push_back( wge::wv3D2ov3( grid->worldCoordToTexCoord( wmath::WPosition( vertPos[0], vertPos[1], vertPos[2] ) ) ) ); texCoords->push_back( grid->worldCoordToTexCoord( wmath::WPosition( vertPos[0], vertPos[1], vertPos[2] ) ) );
} }
surfaceGeometry->setTexCoordArray( c, texCoords ); surfaceGeometry->setTexCoordArray( c, texCoords );
} }
......
...@@ -490,7 +490,7 @@ void WMSplineSurface::updateGraphics() ...@@ -490,7 +490,7 @@ void WMSplineSurface::updateGraphics()
for ( size_t i = 0; i < m_triMesh->vertSize(); ++i ) for ( size_t i = 0; i < m_triMesh->vertSize(); ++i )
{ {
osg::Vec3 vertPos = m_triMesh->getVertex( i ); osg::Vec3 vertPos = m_triMesh->getVertex( i );
texCoords->push_back( wge::wv3D2ov3( grid->worldCoordToTexCoord( wmath::WPosition( vertPos[0], vertPos[1], vertPos[2] ) ) ) ); texCoords->push_back( grid->worldCoordToTexCoord( wmath::WPosition( vertPos[0], vertPos[1], vertPos[2] ) ) );
} }
surfaceGeometry->setTexCoordArray( c, texCoords ); surfaceGeometry->setTexCoordArray( c, texCoords );
} }
......
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