44 #include "TextureData.hh" 45 #include "ImageStorage.hh" 62 indexMappingProperty_(
"f:textureindex")
72 propertyMap_[0] =
"No Texture";
78 for(
const int&
id:managedImageId_)
80 imageStore().removeImage(
id);
130 for (
int i = 0 ; i < (int)
textures_.size() ; ++i )
167 tex.name( _textureName );
168 tex.glName( _glName );
169 tex.filename( _filename );
170 tex.dimension(_dimension);
173 tex.type( VERTEXBASED );
179 textureMap_[ tex.id() ] = tex.glName();
180 propertyMap_[ tex.id() ] = tex.name().toStdString();
187 _texture.glName( _glName );
190 textureMap_[ _texture.id() ] = _texture.glName();
191 propertyMap_[ _texture.id() ] = _texture.name().toStdString();
193 return _texture.id();
199 if ( textureid != -1) {
200 std::cerr <<
"Texture exists!" << std::endl;
207 tex.name( _textureName );
208 tex.filename(
"MultiTexture");
210 tex.type(MULTITEXTURE);
222 if ( textureid == -1) {
223 std::cerr <<
"setImage: Unknown Texture!" << std::endl;
227 textures_[textureid].textureImageId(_id);
282 std::cerr <<
"Invalid Texture" << _textureName.toStdString() << std::endl;
298 for (
int i = 0 ; i < (int)
textures_.size() ; ++i ) {
299 if ( (
textures_[i].name() == _textureName) || (
textures_[i].visibleName() == _textureName) ) {
335 return &propertyMap_;
338 void TextureData::addManagedImageId(
int _imageId){
339 managedImageId_.push_back(_imageId);
void disableTexture(QString _textureName)
Disable a given texture.
bool enableTexture(QString _textureName, bool _exclusive=false)
Enable a given texture.
int getTextureIndex(QString _textureName)
Get the index of a given texture.
std::vector< Texture > textures_
vector containing all textures of an object
TextureData()
Constructor.
bool textureExists(QString _textureName)
Check if a texture exists.
~TextureData()
Destructor.
int nextInternalID_
internal id for the next texture
std::map< int, GLuint > * textureMap()
Get pointer to the textureMap.
std::vector< Texture > & textures()
Get reference to the texture vector.
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::map< int, std::string > * propertyMap()
Get pointer to the propertyMap.
bool isEnabled(QString _textureName)
Check if a texture is enabled.
Texture & texture(QString _textureName)
Get the texture object.
bool setImage(QString _textureName, int _id)
Stores the given image in the texture information.