Provide texture support for a plugin. More...
#include <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. | |
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. | |
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. The second parameter defines the single textures name.
| _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 id of the texture( This id is object related!!) |
Definition at line 107 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::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 168 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 158 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 266 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 299 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 276 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 219 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 213 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 255 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 245 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 291 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 284 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 206 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 194 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 183 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 176 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 121 of file TextureInterface.hh.