Developer Documentation

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
Public Member Functions | Private Member Functions | Private Attributes | List of all members
TextureData Class Reference
Inheritance diagram for TextureData:

## Public Member Functions
| TextureData ()
| Constructor.
| ~TextureData ()
| Destructor.
virtual PerObjectData * | copyPerObjectData ()
| 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, 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.
Texture & | texture (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< Texture > | textures_
| vector containing all textures of an object
Texture | noTexture

## Detailed Description

Definition at line 195 of file TextureData.hh.

## Member Function Documentation

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

Add a Texture.

Parameters

  _textureName | name of the texture
  _filename | filename of the texture
  _dimension | dimension of the texture
  _glName | glName for the texture

Returns
  persistent id of the texture

Definition at line 164 of file TextureData.cc.

virtual PerObjectData* TextureData::copyPerObjectData | ( |  | ) |
| inline virtual

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 206 of file TextureData.hh.

void TextureData::disableTexture | ( | QString | _textureName | ) |

Disable a given texture.

Parameters

  _textureName | name of the texture

Definition at line 146 of file TextureData.cc.

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

Enable a given texture.

Parameters

  _textureName | name of the texture
  _exclusive | disable other textures?

Definition at line 122 of file TextureData.cc.

int TextureData::getTextureIndex | ( | QString | _textureName | ) |
| private

Get the index of a given texture.

Parameters

  _textureName | name of the texture

Returns
  index in texture vector or -1 if not found

Definition at line 296 of file TextureData.cc.

bool TextureData::isEnabled | ( | QString | _textureName | ) |

Check if a texture is enabled.

Parameters

  _textureName | name of the texture

Returns
  returns wether the texture is enabled

Definition at line 105 of file TextureData.cc.

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 336 of file TextureData.cc.

Texture & TextureData::texture | ( | QString | _textureName | ) |

Get the texture object.

get texture object of a given texture

Parameters

  _textureName | name of the texture

Returns
  corresponding texture object

Definition at line 277 of file TextureData.cc.

bool TextureData::textureExists | ( | QString | _textureName | ) |

Check if a texture exists.

Parameters

  _textureName | name of the texture

Returns
  returns wether the texture exists

Definition at line 93 of file TextureData.cc.

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 326 of file TextureData.cc.

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

Get reference to the texture vector.

Returns
  texture vector

Definition at line 316 of file TextureData.cc.

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

- Plugin-TextureControl/TextureData.hh
- Plugin-TextureControl/TextureData.cc