50 #include "TextureData.hh"
67 indexMappingProperty_(
"f:textureindex")
77 propertyMap_[0] =
"No Texture";
132 for (
int i = 0 ; i < (int)
textures_.size() ; ++i )
169 tex.name( _textureName );
170 tex.glName( _glName );
171 tex.filename( _filename );
172 tex.dimension(_dimension);
175 tex.type( VERTEXBASED );
181 textureMap_[ tex.id() ] = tex.glName();
182 propertyMap_[ tex.id() ] = tex.name().toStdString();
189 _texture.glName( _glName );
192 textureMap_[ _texture.id() ] = _texture.glName();
193 propertyMap_[ _texture.id() ] = _texture.name().toStdString();
195 return _texture.id();
201 if ( textureid != -1) {
202 std::cerr <<
"Texture exists!" << std::endl;
209 tex.name( _textureName );
210 tex.filename(
"MultiTexture");
212 tex.type(MULTITEXTURE);
224 if ( textureid == -1) {
225 std::cerr <<
"setImage: Unknown Texture!" << std::endl;
229 textures_[textureid].textureImageId(_id);
284 std::cerr <<
"Invalid Texture" << _textureName.toStdString() << std::endl;
300 for (
int i = 0 ; i < (int)
textures_.size() ; ++i ) {
301 if ( (
textures_[i].name() == _textureName) || (
textures_[i].visibleName() == _textureName) ) {
337 return &propertyMap_;
bool isEnabled(QString _textureName)
Check if a texture is enabled.
TextureData()
Constructor.
bool addMultiTexture(QString _textureName)
Adds a new multiTexture ( This texture will only contain a list of enabled textures for multitexturin...
std::vector< Texture > & textures()
Get reference to the texture vector.
~TextureData()
Destructor.
std::map< int, GLuint > * textureMap()
Get pointer to the textureMap.
int addTexture(QString _textureName, QString _filename, uint _dimension, GLuint _glName)
Add a Texture.
Texture & texture(QString _textureName)
Get the texture object.
int nextInternalID_
internal id for the next texture
bool enableTexture(QString _textureName, bool _exclusive=false)
Enable a given texture.
std::map< int, std::string > * propertyMap()
Get pointer to the propertyMap.
int getTextureIndex(QString _textureName)
Get the index of a given texture.
bool setImage(QString _textureName, int _id)
Stores the given image in the texture information.
void disableTexture(QString _textureName)
Disable a given texture.
bool textureExists(QString _textureName)
Check if a texture exists.
std::vector< Texture > textures_
vector containing all textures of an object