44 #define TEXTURECONTROL_1D_TEXTURE_HANDLING_C 46 #include "TextureControl.hh" 47 #include "TextureMath.hh" 49 template<
typename MeshT >
53 double max = -FLT_MIN;
59 for (
typename MeshT::VertexIter v_it = _mesh.vertices_begin() ; v_it != _mesh.vertices_end(); ++v_it) {
61 max = std::max( _mesh.property(_texProp,*v_it) , max);
62 min = std::min( _mesh.property(_texProp,*v_it) , min);
67 if ( !_mesh.has_vertex_texcoords2D() )
68 _mesh.request_vertex_texcoords2D();
72 for (
typename MeshT::VertexIter v_it = _mesh.vertices_begin(); v_it != _mesh.vertices_end(); ++v_it) {
74 double value = _mesh.property(_texProp, *v_it);
80 _mesh.set_texcoord2D( *v_it,
ACG::Vec2f(
float(value),
float(value) ) );
84 template<
typename MeshT >
88 double max = -FLT_MIN;
93 for (
typename MeshT::HalfedgeIter h_it = _mesh.halfedges_begin() ; h_it != _mesh.halfedges_end(); ++h_it) {
95 max = std::max( _mesh.property(_texProp,*h_it) , max);
96 min = std::min( _mesh.property(_texProp,*h_it) , min);
100 if ( !_mesh.has_halfedge_texcoords2D() )
101 _mesh.request_halfedge_texcoords2D();
105 for (
typename MeshT::HalfedgeIter h_it = _mesh.halfedges_begin(); h_it != _mesh.halfedges_end(); ++h_it) {
108 double value = _mesh.property(_texProp, *h_it);
114 _mesh.set_texcoord2D( *h_it,
ACG::Vec2f(
float(value),
float(value) ) );
TexParameters parameters
Parameters of the texture.
double transform(const double _input) const
Modify given values based on the specified parameters given to the constructor.
void copyTexture(Texture &_texture, MeshT &_mesh, OpenMesh::VPropHandleT< double > _texProp)
Copy the supplied 1D vertex property to both coordinates of the 2D vertex OM texture property...