Commit 140e1222 authored by Matthias Möller's avatar Matthias Möller
Browse files

OM3 iterators

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@17209 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 0e19658b
...@@ -1911,7 +1911,7 @@ void TextureControlPlugin::getCoordinates1D(QString _textureName, int _id, std:: ...@@ -1911,7 +1911,7 @@ void TextureControlPlugin::getCoordinates1D(QString _textureName, int _id, std::
} }
for ( TriMesh::VertexIter v_it = mesh->vertices_begin() ; v_it != mesh->vertices_end(); ++v_it) for ( TriMesh::VertexIter v_it = mesh->vertices_begin() ; v_it != mesh->vertices_end(); ++v_it)
_x.push_back( mesh->property(coordProp,v_it) ); _x.push_back( mesh->property(coordProp,*v_it) );
} // end of if vertex based for tri meshes } // end of if vertex based for tri meshes
else if ( texData->texture(_textureName).type() == HALFEDGEBASED ) else if ( texData->texture(_textureName).type() == HALFEDGEBASED )
...@@ -1925,7 +1925,7 @@ void TextureControlPlugin::getCoordinates1D(QString _textureName, int _id, std:: ...@@ -1925,7 +1925,7 @@ void TextureControlPlugin::getCoordinates1D(QString _textureName, int _id, std::
} }
for ( TriMesh::HalfedgeIter h_it = mesh->halfedges_begin() ; h_it != mesh->halfedges_end(); ++h_it) for ( TriMesh::HalfedgeIter h_it = mesh->halfedges_begin() ; h_it != mesh->halfedges_end(); ++h_it)
_x.push_back( mesh->property(coordProp,h_it) ); _x.push_back( mesh->property(coordProp,*h_it) );
} // end of if halfedge based for tri meshes } // end of if halfedge based for tri meshes
} // end of if tri mesh } // end of if tri mesh
...@@ -1944,7 +1944,7 @@ void TextureControlPlugin::getCoordinates1D(QString _textureName, int _id, std:: ...@@ -1944,7 +1944,7 @@ void TextureControlPlugin::getCoordinates1D(QString _textureName, int _id, std::
} }
for ( PolyMesh::VertexIter v_it = mesh->vertices_begin() ; v_it != mesh->vertices_end(); ++v_it) for ( PolyMesh::VertexIter v_it = mesh->vertices_begin() ; v_it != mesh->vertices_end(); ++v_it)
_x.push_back( mesh->property(coordProp,v_it) ); _x.push_back( mesh->property(coordProp,*v_it) );
} // end of if vertex based for poly meshes } // end of if vertex based for poly meshes
else if ( texData->texture(_textureName).type() == HALFEDGEBASED ) else if ( texData->texture(_textureName).type() == HALFEDGEBASED )
{ {
...@@ -1957,7 +1957,7 @@ void TextureControlPlugin::getCoordinates1D(QString _textureName, int _id, std:: ...@@ -1957,7 +1957,7 @@ void TextureControlPlugin::getCoordinates1D(QString _textureName, int _id, std::
} }
for ( PolyMesh::HalfedgeIter h_it = mesh->halfedges_begin() ; h_it != mesh->halfedges_end(); ++h_it) for ( PolyMesh::HalfedgeIter h_it = mesh->halfedges_begin() ; h_it != mesh->halfedges_end(); ++h_it)
_x.push_back( mesh->property(coordProp,h_it) ); _x.push_back( mesh->property(coordProp,*h_it) );
} // end of if halfedge based for poly meshes } // end of if halfedge based for poly meshes
}// end of if poly mesh }// end of if poly mesh
#ifdef ENABLE_OPENVOLUMEMESH_HEXAHEDRAL_SUPPORT #ifdef ENABLE_OPENVOLUMEMESH_HEXAHEDRAL_SUPPORT
......
...@@ -57,8 +57,8 @@ void TextureControlPlugin::copyTexture ( Texture& _texture , MeshT& _mesh, OpenM ...@@ -57,8 +57,8 @@ void TextureControlPlugin::copyTexture ( Texture& _texture , MeshT& _mesh, OpenM
// Keep track of absolute values! // Keep track of absolute values!
for ( typename MeshT::VertexIter v_it = _mesh.vertices_begin() ; v_it != _mesh.vertices_end(); ++v_it) { for ( typename MeshT::VertexIter v_it = _mesh.vertices_begin() ; v_it != _mesh.vertices_end(); ++v_it) {
max = std::max( _mesh.property(_texProp,v_it) , max); max = std::max( _mesh.property(_texProp,*v_it) , max);
min = std::min( _mesh.property(_texProp,v_it) , min); min = std::min( _mesh.property(_texProp,*v_it) , min);
} }
...@@ -70,13 +70,13 @@ void TextureControlPlugin::copyTexture ( Texture& _texture , MeshT& _mesh, OpenM ...@@ -70,13 +70,13 @@ void TextureControlPlugin::copyTexture ( Texture& _texture , MeshT& _mesh, OpenM
for ( typename MeshT::VertexIter v_it = _mesh.vertices_begin(); v_it != _mesh.vertices_end(); ++v_it) { for ( typename MeshT::VertexIter v_it = _mesh.vertices_begin(); v_it != _mesh.vertices_end(); ++v_it) {
// Get the value of the property // Get the value of the property
double value = _mesh.property(_texProp, v_it); double value = _mesh.property(_texProp, *v_it);
// Mangle it with the predefined user options (including absolute, clamping, ...) // Mangle it with the predefined user options (including absolute, clamping, ...)
value = convert.transform(value); value = convert.transform(value);
// Write result to the OpenMesh texture coordinates ( 2d accessing the diagonal of a 2d texture) // Write result to the OpenMesh texture coordinates ( 2d accessing the diagonal of a 2d texture)
_mesh.set_texcoord2D( v_it, ACG::Vec2f(float(value), float(value) ) ); _mesh.set_texcoord2D( *v_it, ACG::Vec2f(float(value), float(value) ) );
} }
} }
...@@ -91,8 +91,8 @@ void TextureControlPlugin::copyTexture ( Texture& _texture , MeshT& _mesh, OpenM ...@@ -91,8 +91,8 @@ void TextureControlPlugin::copyTexture ( Texture& _texture , MeshT& _mesh, OpenM
// Keep track of absolute values! // Keep track of absolute values!
for ( typename MeshT::HalfedgeIter h_it = _mesh.halfedges_begin() ; h_it != _mesh.halfedges_end(); ++h_it) { for ( typename MeshT::HalfedgeIter h_it = _mesh.halfedges_begin() ; h_it != _mesh.halfedges_end(); ++h_it) {
max = std::max( _mesh.property(_texProp,h_it) , max); max = std::max( _mesh.property(_texProp,*h_it) , max);
min = std::min( _mesh.property(_texProp,h_it) , min); min = std::min( _mesh.property(_texProp,*h_it) , min);
} }
...@@ -104,13 +104,13 @@ void TextureControlPlugin::copyTexture ( Texture& _texture , MeshT& _mesh, OpenM ...@@ -104,13 +104,13 @@ void TextureControlPlugin::copyTexture ( Texture& _texture , MeshT& _mesh, OpenM
for ( typename MeshT::HalfedgeIter h_it = _mesh.halfedges_begin(); h_it != _mesh.halfedges_end(); ++h_it) { for ( typename MeshT::HalfedgeIter h_it = _mesh.halfedges_begin(); h_it != _mesh.halfedges_end(); ++h_it) {
// Get the value of the property // Get the value of the property
double value = _mesh.property(_texProp, h_it); double value = _mesh.property(_texProp, *h_it);
// Mangle it with the predefined user options (including absolute, clamping, ...) // Mangle it with the predefined user options (including absolute, clamping, ...)
value = convert.transform(value); value = convert.transform(value);
// Write result to the OpenMesh texture coordinates ( 2d accessing the diagonal of a 2d texture) // Write result to the OpenMesh texture coordinates ( 2d accessing the diagonal of a 2d texture)
_mesh.set_texcoord2D( h_it, ACG::Vec2f(float(value), float(value) ) ); _mesh.set_texcoord2D( *h_it, ACG::Vec2f(float(value), float(value) ) );
} }
} }
...@@ -53,10 +53,10 @@ void TextureControlPlugin::copyTexture ( Texture& /*_texture*/, MeshT& _mesh, Op ...@@ -53,10 +53,10 @@ void TextureControlPlugin::copyTexture ( Texture& /*_texture*/, MeshT& _mesh, Op
for ( typename MeshT::VertexIter v_it = _mesh.vertices_begin(); v_it != _mesh.vertices_end(); ++v_it) { for ( typename MeshT::VertexIter v_it = _mesh.vertices_begin(); v_it != _mesh.vertices_end(); ++v_it) {
// Get the value of the property // Get the value of the property
OpenMesh::Vec2d value = _mesh.property(_texProp, v_it); OpenMesh::Vec2d value = _mesh.property(_texProp, *v_it);
// Write result to the openmesh texture coordinates // Write result to the openmesh texture coordinates
_mesh.set_texcoord2D( v_it, ACG::Vec2f(float(value[0]), float(value[1]) ) ); _mesh.set_texcoord2D( *v_it, ACG::Vec2f(float(value[0]), float(value[1]) ) );
} }
} }
...@@ -69,10 +69,10 @@ void TextureControlPlugin::copyTexture ( Texture& /*_texture*/, MeshT& _mesh, Op ...@@ -69,10 +69,10 @@ void TextureControlPlugin::copyTexture ( Texture& /*_texture*/, MeshT& _mesh, Op
for ( typename MeshT::HalfedgeIter h_it = _mesh.halfedges_begin(); h_it != _mesh.halfedges_end(); ++h_it) { for ( typename MeshT::HalfedgeIter h_it = _mesh.halfedges_begin(); h_it != _mesh.halfedges_end(); ++h_it) {
// Get the value of the property // Get the value of the property
OpenMesh::Vec2d value = _mesh.property(_texProp, h_it); OpenMesh::Vec2d value = _mesh.property(_texProp, *h_it);
// Write result to the openmesh texture coordinates // Write result to the openmesh texture coordinates
_mesh.set_texcoord2D( h_it, ACG::Vec2f(float(value[0]), float(value[1]) ) ); _mesh.set_texcoord2D( *h_it, ACG::Vec2f(float(value[0]), float(value[1]) ) );
} }
} }
......
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