44 #include "TextureData.hh" 61 indexMappingProperty_(
"f:textureindex")
71 propertyMap_[0] =
"No Texture";
126 for (
int i = 0 ; i < (int)
textures_.size() ; ++i )
163 tex.name( _textureName );
164 tex.glName( _glName );
165 tex.filename( _filename );
166 tex.dimension(_dimension);
169 tex.type( VERTEXBASED );
175 textureMap_[ tex.id() ] = tex.glName();
176 propertyMap_[ tex.id() ] = tex.name().toStdString();
183 _texture.glName( _glName );
186 textureMap_[ _texture.id() ] = _texture.glName();
187 propertyMap_[ _texture.id() ] = _texture.name().toStdString();
189 return _texture.id();
195 if ( textureid != -1) {
196 std::cerr <<
"Texture exists!" << std::endl;
203 tex.name( _textureName );
204 tex.filename(
"MultiTexture");
206 tex.type(MULTITEXTURE);
218 if ( textureid == -1) {
219 std::cerr <<
"setImage: Unknown Texture!" << std::endl;
223 textures_[textureid].textureImageId(_id);
278 std::cerr <<
"Invalid Texture" << _textureName.toStdString() << std::endl;
294 for (
int i = 0 ; i < (int)
textures_.size() ; ++i ) {
295 if ( (
textures_[i].name() == _textureName) || (
textures_[i].visibleName() == _textureName) ) {
331 return &propertyMap_;
int addTexture(QString _textureName, uint _dimension, GLuint _glName)
Add a Texture without file backing.
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.
bool setImage(QString _textureName, int _id)
Stores the given image in the texture information.
std::map< int, std::string > * propertyMap()
Get pointer to the propertyMap.
int getTextureIndex(QString _textureName)
Get the index of a given texture.
bool enableTexture(QString _textureName, bool _exclusive=false)
Enable a given texture.
TextureData()
Constructor.
std::map< int, GLuint > * textureMap()
Get pointer to the textureMap.
bool isEnabled(QString _textureName)
Check if a texture is enabled.
~TextureData()
Destructor.
Texture & texture(QString _textureName)
Get the texture object.
std::vector< Texture > textures_
vector containing all textures of an object
bool textureExists(QString _textureName)
Check if a texture exists.
void disableTexture(QString _textureName)
Disable a given texture.
int nextInternalID_
internal id for the next texture