Developer Documentation
TextureData Class Reference
Inheritance diagram for TextureData:
PerObjectData

Public Member Functions

 TextureData ()
 Constructor.
 
 ~TextureData ()
 Destructor.
 
virtual PerObjectDatacopyPerObjectData ()
 Copy Function. More...
 
bool textureExists (QString _textureName)
 Check if a texture exists. More...
 
bool isEnabled (QString _textureName)
 Check if a texture is enabled. More...
 
bool enableTexture (QString _textureName, bool _exclusive=false)
 Enable a given texture. More...
 
void disableTexture (QString _textureName)
 Disable a given texture. More...
 
int addTexture (QString _textureName, uint _dimension, GLuint _glName)
 Add a Texture without file backing.
 
int addTexture (QString _textureName, QString _filename, uint _dimension, GLuint _glName)
 Add a Texture. More...
 
int addTexture (Texture _texture, GLuint _glName)
 Add a Texture ( Based on an existing specification )
 
bool addMultiTexture (QString _textureName)
 Adds a new multiTexture ( This texture will only contain a list of enabled textures for multitexturing )
 
bool setImage (QString _textureName, int _id)
 Stores the given image in the texture information.
 
Texturetexture (QString _textureName)
 Get the texture object. More...
 
std::vector< Texture > & textures ()
 Get reference to the texture vector. More...
 
std::map< int, GLuint > * textureMap ()
 Get pointer to the textureMap. More...
 
std::map< int, std::string > * propertyMap ()
 Get pointer to the propertyMap. More...
 
- Public Member Functions inherited from PerObjectData
 PerObjectData ()
 You have to provide your own constructor for your object.
 

Private Member Functions

int getTextureIndex (QString _textureName)
 Get the index of a given texture. More...
 

Private Attributes

std::map< int, GLuint > textureMap_
 
std::map< int, std::string > propertyMap_
 
int nextInternalID_
 internal id for the next texture
 
std::vector< Texturetextures_
 vector containing all textures of an object
 
Texture noTexture
 

Detailed Description

Definition at line 189 of file TextureData.hh.

Member Function Documentation

◆ addTexture()

int TextureData::addTexture ( QString  _textureName,
QString  _filename,
uint  _dimension,
GLuint  _glName 
)

Add a Texture.

Parameters
_textureNamename of the texture
_filenamefilename of the texture
_dimensiondimension of the texture
_glNameglName for the texture
Returns
persistent id of the texture

Definition at line 158 of file TextureData.cc.

◆ copyPerObjectData()

virtual PerObjectData* TextureData::copyPerObjectData ( )
inlinevirtual

Copy Function.

You have to reimplement this function to allow the core to create a copies of your Object. By default it will return 0;

The function has to create a deep copy of the object, as it will also be used to create backups. If you use pointer inside your class, remember to not copy the pointer only but also the data!

Reimplemented from PerObjectData.

Definition at line 200 of file TextureData.hh.

◆ disableTexture()

void TextureData::disableTexture ( QString  _textureName)

Disable a given texture.

Parameters
_textureNamename of the texture

Definition at line 140 of file TextureData.cc.

◆ enableTexture()

bool TextureData::enableTexture ( QString  _textureName,
bool  _exclusive = false 
)

Enable a given texture.

Parameters
_textureNamename of the texture
_exclusivedisable other textures?

Definition at line 116 of file TextureData.cc.

◆ getTextureIndex()

int TextureData::getTextureIndex ( QString  _textureName)
private

Get the index of a given texture.

Parameters
_textureNamename of the texture
Returns
index in texture vector or -1 if not found

Definition at line 290 of file TextureData.cc.

◆ isEnabled()

bool TextureData::isEnabled ( QString  _textureName)

Check if a texture is enabled.

Parameters
_textureNamename of the texture
Returns
returns wether the texture is enabled

Definition at line 99 of file TextureData.cc.

◆ propertyMap()

std::map< int, std::string > * TextureData::propertyMap ( )

Get pointer to the propertyMap.

This map is used to store the available Textures and map them to their corresponding properties.

Returns
propertyMap

Definition at line 330 of file TextureData.cc.

◆ texture()

Texture & TextureData::texture ( QString  _textureName)

Get the texture object.

get texture object of a given texture

Parameters
_textureNamename of the texture
Returns
corresponding texture object

Definition at line 271 of file TextureData.cc.

◆ textureExists()

bool TextureData::textureExists ( QString  _textureName)

Check if a texture exists.

Parameters
_textureNamename of the texture
Returns
returns wether the texture exists

Definition at line 87 of file TextureData.cc.

◆ textureMap()

std::map< int, GLuint > * TextureData::textureMap ( )

Get pointer to the textureMap.

This map maps all available textures for the object which this class belongs to to their GLuint. The MeshNode will use this map to activate one texture for each face.

Returns
textureMap

Definition at line 320 of file TextureData.cc.

◆ textures()

std::vector< Texture > & TextureData::textures ( )

Get reference to the texture vector.

Returns
texture vector

Definition at line 310 of file TextureData.cc.


The documentation for this class was generated from the following files: