Commit d79df05e authored by Alexander Wiebel's avatar Alexander Wiebel

[FIX] removed unnecessary functions

parent f2ec2d61
......@@ -200,25 +200,12 @@ osg::Vec4 WTriangleMesh::getVertColor( size_t index ) const
return ( *m_vertColors )[index];
}
WPosition WTriangleMesh::getVertexAsPosition( size_t index ) const
{
WAssert( index < m_countVerts, "get vertex as position: index out of range" );
return WPosition( ( *m_verts )[index][0], ( *m_verts )[index][1], ( *m_verts )[index][2] );
}
WPosition WTriangleMesh::getNormalAsPosition( size_t index ) const
WVector3d WTriangleMesh::getNormal( size_t index ) const
{
WAssert( index < m_countVerts, "get normal as position: index out of range" );
return WPosition( ( *m_vertNormals )[index][0], ( *m_vertNormals )[index][1], ( *m_vertNormals )[index][2] );
}
WPosition WTriangleMesh::getVertexAsPosition( size_t triangleIndex, size_t vertNum )
{
WAssert( triangleIndex < m_countTriangles, "get vertex as position: index out of range" );
osg::Vec3 v = getTriVert( triangleIndex, vertNum );
return WPosition( v[0], v[1], v[2] );
}
void WTriangleMesh::removeVertex( size_t index )
{
WAssert( index < m_countVerts, "remove vertex: index out of range" );
......
......@@ -213,7 +213,7 @@ public:
*
* \return vertex array
*/
osg::ref_ptr< const osg::Vec3Array >getVertexArray() const;
osg::ref_ptr< const osg::Vec3Array > getVertexArray() const;
/**
* Returns a reference pointer to the texture coordinate array.
......@@ -235,14 +235,14 @@ public:
* \param forceRecalc
* \return pointer to the vertex normal array
*/
osg::ref_ptr< osg::Vec3Array >getVertexNormalArray( bool forceRecalc = false );
osg::ref_ptr< osg::Vec3Array > getVertexNormalArray( bool forceRecalc = false );
/**
* getter
*
* \return pointer to the vertex color array
*/
osg::ref_ptr< osg::Vec4Array >getVertexColorArray();
osg::ref_ptr< osg::Vec4Array > getVertexColorArray();
/**
* Returns a const reference to the vertex ids of the triangles.
......@@ -257,7 +257,7 @@ public:
* \param forceRecalc
* \return pointer to the triangle normal array
*/
osg::ref_ptr< osg::Vec3Array >getTriangleNormalArray( bool forceRecalc = false );
osg::ref_ptr< osg::Vec3Array > getTriangleNormalArray( bool forceRecalc = false );
/**
......@@ -285,30 +285,13 @@ public:
*/
osg::Vec3 getTriVert( size_t triId, size_t vertNum );
/**
* getter
*
* \param index
* \return vertex
*/
WPosition getVertexAsPosition( size_t index ) const;
/**
* getter
*
* \param index
* \return normal
*/
WPosition getNormalAsPosition( size_t index ) const;
/**
* getter
*
* \param triangleIndex
* \param vertNum
* \return vertex
*/
WPosition getVertexAsPosition( size_t triangleIndex, size_t vertNum );
WVector3d getNormal( size_t index ) const;
/**
* getter
......
......@@ -134,7 +134,7 @@ void WMExportGeometry::writeFile()
std::stringstream points;
for( size_t i = 0; i < mesh->vertSize(); ++i )
{
WPosition pos = mesh->getVertexAsPosition( i );
WPosition pos = mesh->getVertex( i );
points << "" << pos[0] << " " << pos[1] << " " << pos[2];
if( i < mesh->vertSize() - 1 )
{
......
......@@ -290,7 +290,7 @@ bool WMSplineSurface::save() const
// dataFile << "POINTS " << m_triMesh->vertSize() << " float\n";
// for( size_t i = 0; i < m_triMesh->vertSize(); ++i )
// {
// point = m_triMesh->getVertexAsPosition( i );
// point = m_triMesh->getVertex( i );
// if( !( myIsfinite( point[0] ) && myIsfinite( point[1] ) && myIsfinite( point[2] ) ) )
// {
// WLogger::getLogger()->addLogMessage( "Will not write file from data that contains NAN or INF.", "Marching Cubes", LL_ERROR );
......
......@@ -193,7 +193,7 @@ void WMWebglSupport::colorTriMeshGray()
for( size_t i = 0; i < m_triMesh->vertSize(); ++i )
{
// get vertex position
WPosition pos = m_triMesh->getVertexAsPosition( i );
WPosition pos = m_triMesh->getVertex( i );
// get color value for that vertex from texture
//double value = m_datasetScalar->interpolate( pos, &success );
......@@ -218,7 +218,7 @@ void WMWebglSupport::colorTriMeshRGB()
for( size_t i = 0; i < m_triMesh->vertSize(); ++i )
{
// get vertex position
WPosition pos = m_triMesh->getVertexAsPosition( i );
WPosition pos = m_triMesh->getVertex( i );
// get color value for that vertex from texture
WVector3d value = m_datasetVector->interpolate( pos, &success );
......
......@@ -182,7 +182,7 @@ bool WMWriteMesh::saveVTKASCII() const
dataFile << "POINTS " << m_triMesh->vertSize() << " float\n";
for( size_t i = 0; i < m_triMesh->vertSize(); ++i )
{
point = m_triMesh->getVertexAsPosition( i );
point = m_triMesh->getVertex( i );
if( !( myIsfinite( point[0] ) && myIsfinite( point[1] ) && myIsfinite( point[2] ) ) )
{
WLogger::getLogger()->addLogMessage( "Will not write file from data that contains NAN or INF.", "Write Mesh", LL_ERROR );
......@@ -257,7 +257,7 @@ bool WMWriteMesh::saveJson() const
WPosition point;
for( size_t i = 0; i < m_triMesh->vertSize() - 1; ++i )
{
point = m_triMesh->getVertexAsPosition( i );
point = m_triMesh->getVertex( i );
if( !( myIsfinite( point[0] ) && myIsfinite( point[1] ) && myIsfinite( point[2] ) ) )
{
WLogger::getLogger()->addLogMessage( "Will not write file from data that contains NAN or INF.", "Write Mesh", LL_ERROR );
......@@ -265,14 +265,14 @@ bool WMWriteMesh::saveJson() const
}
dataFile << point[0] << "," << point[1] << "," << point[2] << ",";
}
point = m_triMesh->getVertexAsPosition( m_triMesh->vertSize() - 1 );
point = m_triMesh->getVertex( m_triMesh->vertSize() - 1 );
dataFile << point[0] << "," << point[1] << "," << point[2] << "],\n";
dataFile << ( " \"normals\" : [" );
WPosition normal;
for( size_t i = 0; i < m_triMesh->vertSize() - 1; ++i )
{
normal = m_triMesh->getNormalAsPosition( i );
normal = m_triMesh->getNormal( i );
if( !( myIsfinite( normal[0] ) && myIsfinite( normal[1] ) && myIsfinite( normal[2] ) ) )
{
WLogger::getLogger()->addLogMessage( "Will not write file from data that contains NAN or INF.", "Write Mesh", LL_ERROR );
......@@ -280,7 +280,7 @@ bool WMWriteMesh::saveJson() const
}
dataFile << normal[0] << "," << normal[1] << "," << normal[2] << ",";
}
normal = m_triMesh->getNormalAsPosition( m_triMesh->vertSize() - 1 );
normal = m_triMesh->getNormal( m_triMesh->vertSize() - 1 );
dataFile << normal[0] << "," << normal[1] << "," << normal[2] << "],\n";
dataFile << ( " \"indices\" : [" );
......
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