50 #define TEXTURECONTROL_1D_TEXTURE_HANDLING_C
52 #include "TextureControl.hh"
53 #include "TextureMath.hh"
55 template<
typename MeshT >
59 double max = -FLT_MIN;
65 for (
typename MeshT::VertexIter v_it = _mesh.vertices_begin() ; v_it != _mesh.vertices_end(); ++v_it) {
67 max = std::max( _mesh.property(_texProp,*v_it) , max);
68 min = std::min( _mesh.property(_texProp,*v_it) , min);
73 if ( !_mesh.has_vertex_texcoords2D() )
74 _mesh.request_vertex_texcoords2D();
78 for (
typename MeshT::VertexIter v_it = _mesh.vertices_begin(); v_it != _mesh.vertices_end(); ++v_it) {
80 double value = _mesh.property(_texProp, *v_it);
86 _mesh.set_texcoord2D( *v_it,
ACG::Vec2f(
float(value),
float(value) ) );
90 template<
typename MeshT >
94 double max = -FLT_MIN;
99 for (
typename MeshT::HalfedgeIter h_it = _mesh.halfedges_begin() ; h_it != _mesh.halfedges_end(); ++h_it) {
101 max = std::max( _mesh.property(_texProp,*h_it) , max);
102 min = std::min( _mesh.property(_texProp,*h_it) , min);
106 if ( !_mesh.has_halfedge_texcoords2D() )
107 _mesh.request_halfedge_texcoords2D();
111 for (
typename MeshT::HalfedgeIter h_it = _mesh.halfedges_begin(); h_it != _mesh.halfedges_end(); ++h_it) {
114 double value = _mesh.property(_texProp, *h_it);
120 _mesh.set_texcoord2D( *h_it,
ACG::Vec2f(
float(value),
float(value) ) );
TexParameters parameters
Parameters of the texture.
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...
double transform(const double _input) const
Modify given values based on the specified parameters given to the constructor.