Commit 7a1314ff by Alexander Wiebel

[CLEAN #381] removed now useless function

parent 8decd1e5
......@@ -89,12 +89,6 @@ namespace wge
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
*
* \param index unsigned char that indexes the color
......@@ -180,11 +174,6 @@ inline osg::Vec3 wge::osgVec3( const wmath::WPosition& pos )
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 )
{
WAssert( ( matrix.getNbRows() == 3 || matrix.getNbRows() == 4 ) && ( matrix.getNbCols() == 3 || matrix.getNbCols() == 4 ),
......
......@@ -510,7 +510,7 @@ void WMNavSlices::setSlicePosFromPick( WPickInfo pickInfo )
osg::Vec3 endPosWorld = wge::unprojectFromScreen( endPosScreen, m_viewer->getCamera() );
osg::Vec3 moveDirWorld = endPosWorld - startPosWorld;
float diff = wge::wv3D2ov3( normal ) * moveDirWorld;
float diff = normal * moveDirWorld;
// recognize also small values.
if( diff < 0 && diff > -1 )
......@@ -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] ) );
for( size_t i = 0; i < nbVerts; ++i )
{
sliceVertices->push_back( wge::wv3D2ov3( vertices[i] ) );
sliceVertices->push_back( vertices[i] );
}
sliceGeometry->setVertexArray( sliceVertices );
......@@ -641,7 +641,7 @@ osg::ref_ptr<osg::Geometry> WMNavSlices::createGeometry( int slice )
osg::Vec3Array* texCoords = new osg::Vec3Array;
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 );
++c;
......@@ -655,7 +655,7 @@ osg::ref_ptr<osg::Geometry> WMNavSlices::createGeometry( int slice )
osg::Vec3Array* texCoords = new osg::Vec3Array;
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 );
++c;
......@@ -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] ) );
for( size_t i = 0; i < nbVerts; ++i )
{
sliceVertices->push_back( wge::wv3D2ov3( vertices[i] ) );
sliceVertices->push_back( vertices[i] );
}
sliceGeometry->setVertexArray( sliceVertices );
......@@ -684,7 +684,7 @@ osg::ref_ptr<osg::Geometry> WMNavSlices::createGeometry( int slice )
osg::Vec3Array* texCoords = new osg::Vec3Array;
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 );
++c;
......@@ -698,7 +698,7 @@ osg::ref_ptr<osg::Geometry> WMNavSlices::createGeometry( int slice )
osg::Vec3Array* texCoords = new osg::Vec3Array;
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 );
++c;
......@@ -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 ) );
for( size_t i = 0; i < nbVerts; ++i )
{
sliceVertices->push_back( wge::wv3D2ov3( vertices[i] ) );
sliceVertices->push_back( vertices[i] );
}
sliceGeometry->setVertexArray( sliceVertices );
......@@ -727,7 +727,7 @@ osg::ref_ptr<osg::Geometry> WMNavSlices::createGeometry( int slice )
osg::Vec3Array* texCoords = new osg::Vec3Array;
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 );
++c;
......@@ -742,7 +742,7 @@ osg::ref_ptr<osg::Geometry> WMNavSlices::createGeometry( int slice )
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 );
++c;
......@@ -818,7 +818,7 @@ osg::ref_ptr<osg::Geometry> WMNavSlices::createCrossGeometry( int slice )
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 ) );
......
......@@ -275,10 +275,10 @@ void WMArbitraryPlane::updatePlane()
osg::ref_ptr<osg::Geometry> planeGeometry = osg::ref_ptr<osg::Geometry>( new osg::Geometry() );
osg::Vec3Array* planeVertices = new osg::Vec3Array;
planeVertices->push_back( wge::wv3D2ov3( v0 ) );
planeVertices->push_back( wge::wv3D2ov3( v1 ) );
planeVertices->push_back( wge::wv3D2ov3( v2 ) );
planeVertices->push_back( wge::wv3D2ov3( v3 ) );
planeVertices->push_back( v0 );
planeVertices->push_back( v1 );
planeVertices->push_back( v2 );
planeVertices->push_back( v3 );
planeGeometry->setVertexArray( planeVertices );
osg::DrawElementsUInt* quad = new osg::DrawElementsUInt( osg::PrimitiveSet::QUADS, 0 );
......@@ -298,10 +298,10 @@ void WMArbitraryPlane::updatePlane()
boost::shared_ptr< WGridRegular3D > grid = WKernel::getRunningKernel()->getSelectionManager()->getGrid();
osg::Vec3Array* texCoords = new osg::Vec3Array;
texCoords->push_back( wge::wv3D2ov3( grid->worldCoordToTexCoord( v0 ) ) );
texCoords->push_back( wge::wv3D2ov3( grid->worldCoordToTexCoord( v1 ) ) );
texCoords->push_back( wge::wv3D2ov3( grid->worldCoordToTexCoord( v2 ) ) );
texCoords->push_back( wge::wv3D2ov3( grid->worldCoordToTexCoord( v3 ) ) );
texCoords->push_back( grid->worldCoordToTexCoord( v0 ) );
texCoords->push_back( grid->worldCoordToTexCoord( v1 ) );
texCoords->push_back( grid->worldCoordToTexCoord( v2 ) );
texCoords->push_back( grid->worldCoordToTexCoord( v3 ) );
planeGeometry->setTexCoordArray( c, texCoords );
++c;
......@@ -313,10 +313,10 @@ void WMArbitraryPlane::updatePlane()
osg::Vec3Array* texCoords = new osg::Vec3Array;
texCoords->push_back( wge::wv3D2ov3( grid->worldCoordToTexCoord( v0 ) ) );
texCoords->push_back( wge::wv3D2ov3( grid->worldCoordToTexCoord( v1 ) ) );
texCoords->push_back( wge::wv3D2ov3( grid->worldCoordToTexCoord( v2 ) ) );
texCoords->push_back( wge::wv3D2ov3( grid->worldCoordToTexCoord( v3 ) ) );
texCoords->push_back( grid->worldCoordToTexCoord( v0 ) );
texCoords->push_back( grid->worldCoordToTexCoord( v1 ) );
texCoords->push_back( grid->worldCoordToTexCoord( v2 ) );
texCoords->push_back( grid->worldCoordToTexCoord( v3 ) );
planeGeometry->setTexCoordArray( c, texCoords );
++c;
......
......@@ -185,11 +185,6 @@ void WMLineGuidedSlice::create()
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 )
{
if( pickInfo.getName() == "Line Guided Slice" )
......@@ -258,7 +253,7 @@ osg::ref_ptr<osg::Geometry> WMLineGuidedSlice::createGeometry()
const size_t nbVerts = 4;
for( size_t i = 0; i < nbVerts; ++i )
{
sliceVertices->push_back( wv3D2ov3( vertices[i] ) );
sliceVertices->push_back( vertices[i] );
}
sliceGeometry->setVertexArray( sliceVertices );
......@@ -271,7 +266,7 @@ osg::ref_ptr<osg::Geometry> WMLineGuidedSlice::createGeometry()
texCoords->clear();
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 );
++counter;
......
......@@ -629,7 +629,7 @@ void WMMarchingCubes::updateGraphicsForCallback()
for( size_t i = 0; i < m_triMesh->vertSize(); ++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 );
......@@ -660,7 +660,7 @@ void WMMarchingCubes::updateGraphicsForCallback()
for( size_t i = 0; i < m_triMesh->vertSize(); ++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 );
}
......
......@@ -490,7 +490,7 @@ void WMSplineSurface::updateGraphics()
for ( size_t i = 0; i < m_triMesh->vertSize(); ++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 );
}
......
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