Provide texture support for a plugin. More...
#include <OpenFlipper/BasePlugin/TextureInterface.hh>
Signals | |
| virtual void | addTexture (QString, QString, uint, int) |
| Emit this Signal if a texture has been added (Property Name,filename,Dimension). | |
| virtual void | addTexture (QString, QString, uint) |
| Emit this Signal if a texture has been added (Property Name,filename,Dimension). | |
| virtual void | addMultiTexture (QString, QString, QString, int, int &) |
| Emit this Signal if you want to add a texture for a multitexturing mode. | |
| virtual void | updateTexture (QString, int) |
| Tell Plugins to update the given texture for the given identifier. | |
| virtual void | updateAllTextures () |
| Tell Plugins to update all textures. | |
| virtual void | updatedTextures (QString, int) |
| emit this signal if you updated a texture | |
| virtual void | switchTexture (QString, int) |
| emit this signal if you want to switch the texture of a specific object | |
| virtual void | switchTexture (QString) |
| emit this signal if you want to switch the global texture | |
| virtual void | setTextureMode (QString, QString) |
| emit this signal if you want to set a special mode for this texture (Clamping,...) | |
| virtual void | setTextureMode (QString, QString, int) |
| emit this signal if you want to set a special mode for this texture (Clamping,...) | |
| virtual void | textureChangeImage (QString, QImage &, int) |
| Change the texture image of a given texture. | |
| virtual void | textureChangeImage (QString, QImage &) |
| Change the texture image of a given global texture. | |
| virtual void | textureGetImage (QString, QImage &, int) |
| get the texture image of a given texture | |
| virtual void | textureGetImage (QString, QImage &) |
| Get the texture image of a given global texture. | |
| virtual void | textureIndex (QString, int, int &) |
| Get the texture index of a given texture. | |
| virtual void | textureName (int, int, QString &) |
| get the name of the texture with given texture index | |
| virtual void | getCurrentTexture (int, QString &) |
| get the name of the texture which is currently enabled | |
| virtual void | getSubTextures (int, QString, QStringList &) |
| get the names of all sub-textures under the given multiTexture | |
Public Member Functions | |
| virtual | ~TextureInterface () |
| Destructor. | |
Private Slots | |
| virtual void | slotUpdateTexture (QString, int) |
| update the texture with the given Name ( if this plugin provides this texture ) for all meshes | |
| virtual void | slotUpdateAllTextures () |
| update all textures provided by this plugin | |
| virtual void | slotTextureUpdated (QString, int) |
| A texture has been updated. | |
| virtual void | slotSwitchTexture (QString, int) |
| This slot is called when a plugin requests to switch an objects texture. | |
| virtual void | slotSwitchTexture (QString) |
| This slot is called when a plugin requests to switch to a different texture mode. | |
Functions handled by textureControlPlugin | |
| virtual void | slotTextureAdded (QString, QString, uint, int) |
| A texture has been added by a plugin. | |
| virtual void | slotTextureAdded (QString, QString, uint) |
| A texture has been added by a plugin. | |
| virtual void | slotMultiTextureAdded (QString, QString, QString, int, int &) |
| A multiTexture has been added by a plugin. | |
| virtual void | slotSetTextureMode (QString, QString, int) |
| Texturemode for texture should be changed. | |
| virtual void | slotTextureChangeImage (QString, QImage &, int) |
| Changes the texture image of a given texture. | |
| virtual void | slotTextureChangeImage (QString, QImage &) |
| Changes the texture image of a given global texture. | |
| virtual void | slotSetTextureMode (QString, QString) |
| Texturemode for texture should be changed. | |
| virtual void | slotTextureGetImage (QString, QImage &, int) |
| fetches the texture image of a given texture | |
| virtual void | slotTextureGetImage (QString, QImage &) |
| fetches the texture image of a given global texture | |
| virtual void | slotTextureIndex (QString, int, int &) |
| Get the texture index of a given texture. | |
| virtual void | slotTextureName (int, int, QString &) |
| get the name of the texture with given texture index | |
| virtual void | slotGetCurrentTexture (int, QString &) |
| fetches the name of the texture which is currently enabled | |
| virtual void | slotGetSubTextures (int, QString, QStringList &) |
| fetches the names of all sub-textures under the given multiTexture | |
Provide texture support for a plugin.
This Interface should be used by plugins which will provide a texture. The texture coordinates have to be written into a mesh property. You do not need to write texture information into the texture coordinates of the mesh. As other plugins may provide textures to, the visualization of the textures is handled by the main application (or a texture control plugin).
Definition at line 70 of file TextureInterface.hh.
| virtual void TextureInterface::addMultiTexture | ( | QString | , | |
| QString | , | |||
| QString | , | |||
| int | , | |||
| int & | ||||
| ) | [inline, virtual, signal] |
Emit this Signal if you want to add a texture for a multitexturing mode.
Emit this signal if a texture should be added to a multitexturing mode.
The first parameter defines a texturegroup which collects all textures that should be painted in the multitexturing mode. This group does not have to exist on the first call but will be created automatically.
The second parameter defines the single textures name used in the gui.
| _textureGroup | Multitexturing group using this texture | |
| _name | Name of the property which contains the tex coords (double or vec2d) | |
| _filename | Filename of the texture (either local in OpenFlippers texture dir or global ( "./Textures/<name>") | |
| _id | Id of the object which should use that texture | |
| _textureId | The new internal id of the texture( This id is object related!!). Use this id in your mesh as the texture index (Use mesh->set_texture_index on the face using this texture). |
Definition at line 110 of file TextureInterface.hh.
| virtual void TextureInterface::addTexture | ( | QString | , | |
| QString | , | |||
| uint | ||||
| ) | [inline, virtual, signal] |
Emit this Signal if a texture has been added (Property Name,filename,Dimension).
Emit this signal if a global texture has been added
| _name | Name of the property which contains the tex coords (double or vec2d) | |
| _filename | Filename of the texture (either local in OpenFlippers texture dir or global ( "./Textures/<name>") | |
| _dimension | 1D texture ( currenty only supports 1 ) |
Definition at line 92 of file TextureInterface.hh.
| virtual void TextureInterface::addTexture | ( | QString | , | |
| QString | , | |||
| uint | , | |||
| int | ||||
| ) | [inline, virtual, signal] |
Emit this Signal if a texture has been added (Property Name,filename,Dimension).
Emit this signal if a texture for a specific object has been added
| _name | Name of the property which contains the tex coords (double or vec2d) | |
| _filename | Filename of the texture (either local in OpenFlippers texture dir or global ( "./Textures/<name>") | |
| _dimension | 1D texture ( currenty only supports 1 ) | |
| _id | id of an object |
Definition at line 82 of file TextureInterface.hh.
| virtual void TextureInterface::getCurrentTexture | ( | int | , | |
| QString & | ||||
| ) | [inline, virtual, signal] |
get the name of the texture which is currently enabled
| _id | Id of the object where the current texture should be fetched from | |
| _textureName | this returns the name of the texture |
Definition at line 228 of file TextureInterface.hh.
| virtual void TextureInterface::getSubTextures | ( | int | , | |
| QString | , | |||
| QStringList & | ||||
| ) | [inline, virtual, signal] |
get the names of all sub-textures under the given multiTexture
| _id | Id of the object where the current texture should be fetched from | |
| _multiTextureName | name of a multi texture | |
| _textureName | this returns the names of all sub textures that are combined under the given multi texture |
Definition at line 236 of file TextureInterface.hh.
| virtual void TextureInterface::setTextureMode | ( | QString | , | |
| QString | , | |||
| int | ||||
| ) | [inline, virtual, signal] |
emit this signal if you want to set a special mode for this texture (Clamping,...)
for info about the _mode parameter see setTextureMode(QString,QString)
| _textureName | Name of your Texture | |
| _mode | colon seperated String describing your settings (e.g. clamp,abs ) | |
| _id | id of an object |
Definition at line 171 of file TextureInterface.hh.
| virtual void TextureInterface::setTextureMode | ( | QString | , | |
| QString | ||||
| ) | [inline, virtual, signal] |
emit this signal if you want to set a special mode for this texture (Clamping,...)
emit this signal if you want to set a special mode for this texture
Supported Mode Flags :
Clamping : clamp=true/false
Min Value for clamping : clamp_min=value
Max Value for clamping : clamp_max=value
Use only absolute values : abs=true/false
repeat texture : repeat=true/false
Maximum value for repeat : max_val=value
center texture : center=true/false
Visible name in ui : visiblename=Name
type : the texture coordinate type ( vertexbased: each vertex has only one texture coordinate ; halfedgebased: each vertex has a texture coordinate per face; environmentmap: Texturecoords are generated by opengl (sphere map) )
The system works like this :
First the abolute value of the property is taken if requested. Then this value is clamped against the given values. if the texture should be repeated, the values are translated such that the minimum is at zero and than scaled such that the maximum is at max_val. If its not repeated, the decision is to center the values around 0.5 or not. If not centered, the values are mapped directly to 0..1 .If centered, the negative values are mapped to 0..0.5 and the positive values to 0.5..1.
| _textureName | Name of your Texture | |
| _mode | colon seperated String describing your settings (e.g. clamp,abs ) |
Definition at line 161 of file TextureInterface.hh.
| virtual void TextureInterface::slotGetCurrentTexture | ( | int | , | |
| QString & | ||||
| ) | [inline, private, virtual, slot] |
fetches the name of the texture which is currently enabled
| _id | Id of the object where the current texture should be fetched from | |
| _textureName | this returns the name of the texture |
Definition at line 390 of file TextureInterface.hh.
| virtual void TextureInterface::slotGetSubTextures | ( | int | , | |
| QString | , | |||
| QStringList & | ||||
| ) | [inline, private, virtual, slot] |
fetches the names of all sub-textures under the given multiTexture
| _id | Id of the object where the current texture should be fetched from | |
| _multiTextureName | name of a multi texture | |
| _textureName | this returns the names of all sub textures that are combined under the given multi texture |
Definition at line 398 of file TextureInterface.hh.
| virtual void TextureInterface::slotMultiTextureAdded | ( | QString | , | |
| QString | , | |||
| QString | , | |||
| int | , | |||
| int & | ||||
| ) | [inline, private, virtual, slot] |
A multiTexture has been added by a plugin.
This slot is called when a Multi Texture has been added by a plugin.
| _name | Name of the Added texture (has to be equal to the property name) | |
| _filename | Filename of the Texture Image to be used | |
| _id | Id of the object which should use the texture | |
| _textureId | The new id of the texture( This id is object related!!) |
Definition at line 319 of file TextureInterface.hh.
| virtual void TextureInterface::slotSetTextureMode | ( | QString | , | |
| QString | ||||
| ) | [inline, private, virtual, slot] |
Texturemode for texture should be changed.
A plugin has updated the Texture settings for a texture
| _textureName | The name of the updated texture | |
| _mode | New mode flags for the given texture |
Definition at line 352 of file TextureInterface.hh.
| virtual void TextureInterface::slotSetTextureMode | ( | QString | , | |
| QString | , | |||
| int | ||||
| ) | [inline, private, virtual, slot] |
Texturemode for texture should be changed.
A plugin has updated the Texture settings for a texture
| _textureName | The name of the updated texture | |
| _mode | New mode flags for the given texture | |
| _id | id of an object |
Definition at line 329 of file TextureInterface.hh.
| virtual void TextureInterface::slotSwitchTexture | ( | QString | ) | [inline, private, virtual, slot] |
This slot is called when a plugin requests to switch to a different texture mode.
| _textureName | Name of the Texture |
Definition at line 272 of file TextureInterface.hh.
| virtual void TextureInterface::slotSwitchTexture | ( | QString | , | |
| int | ||||
| ) | [inline, private, virtual, slot] |
This slot is called when a plugin requests to switch an objects texture.
| _textureName | Name of the Texture | |
| _id | id of an object |
Definition at line 266 of file TextureInterface.hh.
| virtual void TextureInterface::slotTextureAdded | ( | QString | , | |
| QString | , | |||
| uint | ||||
| ) | [inline, private, virtual, slot] |
A texture has been added by a plugin.
This slot is called when a global texture has been added by a plugin.
| _textureName | Name of the Added texture (has to be equal to the property name) | |
| _filename | Filename of the Texture Image to be used | |
| dimension | Dimension of the Texture (currently only 1D and 2D Textures are supported |
Definition at line 308 of file TextureInterface.hh.
| virtual void TextureInterface::slotTextureAdded | ( | QString | , | |
| QString | , | |||
| uint | , | |||
| int | ||||
| ) | [inline, private, virtual, slot] |
A texture has been added by a plugin.
This slot is called when a texture for a specific object has been added by a plugin.
| _textureName | Name of the Added texture (has to be equal to the property name) | |
| _filename | Filename of the Texture Image to be used | |
| _dimension | Dimension of the Texture (currently only 1D and 2D Textures are supported | |
| _id | id of an object |
Definition at line 298 of file TextureInterface.hh.
| virtual void TextureInterface::slotTextureChangeImage | ( | QString | , | |
| QImage & | ||||
| ) | [inline, private, virtual, slot] |
Changes the texture image of a given global texture.
| _textureName | The name of the texture which should be changed | |
| _image | The new image for the texture |
Definition at line 344 of file TextureInterface.hh.
| virtual void TextureInterface::slotTextureChangeImage | ( | QString | , | |
| QImage & | , | |||
| int | ||||
| ) | [inline, private, virtual, slot] |
Changes the texture image of a given texture.
| _textureName | The name of the texture which should be changed | |
| _image | The new image for the texture | |
| _id | Id of the object where the texture should be changed |
Definition at line 337 of file TextureInterface.hh.
| virtual void TextureInterface::slotTextureGetImage | ( | QString | , | |
| QImage & | ||||
| ) | [inline, private, virtual, slot] |
fetches the texture image of a given global texture
| _textureName | The name of the texture which should be addressed | |
| _image | reference to the image for the texture |
Definition at line 367 of file TextureInterface.hh.
| virtual void TextureInterface::slotTextureGetImage | ( | QString | , | |
| QImage & | , | |||
| int | ||||
| ) | [inline, private, virtual, slot] |
fetches the texture image of a given texture
| _textureName | The name of the texture which should be addressed | |
| _image | reference to the image for the texture | |
| _id | Id of the object where the texture should be fetched from |
Definition at line 360 of file TextureInterface.hh.
| virtual void TextureInterface::slotTextureIndex | ( | QString | , | |
| int | , | |||
| int & | ||||
| ) | [inline, private, virtual, slot] |
Get the texture index of a given texture.
| _textureName | The name of the texture which should be addressed | |
| _id | Id of the object where the texture is defined on | |
| _index | the index of the texture (used for multiTexturing) |
Definition at line 375 of file TextureInterface.hh.
| virtual void TextureInterface::slotTextureName | ( | int | , | |
| int | , | |||
| QString & | ||||
| ) | [inline, private, virtual, slot] |
get the name of the texture with given texture index
| _id | Id of the object where the texture should be fetched from | |
| _textureIndex | texture index of the wanted texture | |
| _textureName | this returns the name of the texture |
Definition at line 383 of file TextureInterface.hh.
| virtual void TextureInterface::slotTextureUpdated | ( | QString | , | |
| int | ||||
| ) | [inline, private, virtual, slot] |
A texture has been updated.
A plugin has updated a Texture
| _textureName | The name of the updated texture | |
| _identifier | -1 if all objects updated, otherwise the identifier of the object |
Definition at line 259 of file TextureInterface.hh.
| virtual void TextureInterface::slotUpdateTexture | ( | QString | , | |
| int | ||||
| ) | [inline, private, virtual, slot] |
update the texture with the given Name ( if this plugin provides this texture ) for all meshes
This function is called if the texture of the object is about to be shown and the object has changed since the last rendering of the texture.
| _textureName | Name of the Texture to be updated | |
| _identifier | The id of the object to update |
Definition at line 247 of file TextureInterface.hh.
| virtual void TextureInterface::textureChangeImage | ( | QString | , | |
| QImage & | ||||
| ) | [inline, virtual, signal] |
Change the texture image of a given global texture.
| _textureName | The name of the texture which should be changed | |
| _image | The new image for the texture |
Definition at line 186 of file TextureInterface.hh.
| virtual void TextureInterface::textureChangeImage | ( | QString | , | |
| QImage & | , | |||
| int | ||||
| ) | [inline, virtual, signal] |
Change the texture image of a given texture.
| _textureName | The name of the texture which should be changed | |
| _image | The new image for the texture | |
| _id | Id of the object where the texture should be changed |
Definition at line 179 of file TextureInterface.hh.
| virtual void TextureInterface::textureGetImage | ( | QString | , | |
| QImage & | ||||
| ) | [inline, virtual, signal] |
Get the texture image of a given global texture.
| _textureName | The name of the texture which should be addressed | |
| _image | reference to the image for the texture |
Definition at line 201 of file TextureInterface.hh.
| virtual void TextureInterface::textureGetImage | ( | QString | , | |
| QImage & | , | |||
| int | ||||
| ) | [inline, virtual, signal] |
get the texture image of a given texture
| _textureName | The name of the texture which should be addressed | |
| _image | reference to the image for the texture | |
| _id | Id of the object where the texture should be fetched from |
Definition at line 194 of file TextureInterface.hh.
| virtual void TextureInterface::textureIndex | ( | QString | , | |
| int | , | |||
| int & | ||||
| ) | [inline, virtual, signal] |
Get the texture index of a given texture.
| _textureName | The name of the texture which should be addressed | |
| _id | Id of the object where the texture is defined on | |
| _index | the index of the texture (used for multiTexturing) |
Definition at line 209 of file TextureInterface.hh.
| virtual void TextureInterface::textureName | ( | int | , | |
| int | , | |||
| QString & | ||||
| ) | [inline, virtual, signal] |
get the name of the texture with given texture index
When using multiTexturing you can retrieve the texture index of a face with 'mesh->texture_index' This function maps the texture index to the name of the actual texture that is used to texture the face.
| _id | Id of the object where the texture should be fetched from | |
| _textureIndex | texture index of the wanted texture | |
| _textureName | this returns the name of the texture |
Definition at line 221 of file TextureInterface.hh.
| virtual void TextureInterface::updatedTextures | ( | QString | , | |
| int | ||||
| ) | [inline, virtual, signal] |
emit this signal if you updated a texture
Give the name of the texture and the id of the object or -1 if all objects were update
Definition at line 124 of file TextureInterface.hh.
1.6.3