Signals | Public Member Functions | Private Slots

TextureInterface Class Reference

Provide texture support for a plugin. More...

#include <OpenFlipper/BasePlugin/TextureInterface.hh>

Inheritance diagram for TextureInterface:
Inheritance graph
[legend]

List of all members.

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 textureIndexPropertyName (int, QString &)
 Get the name of the texture index property.
virtual void textureName (int, int, QString &)
 get the name of the texture with given texture index
virtual void textureFilename (int, QString, QString &)
 get the filename 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

Normally you dont have to do anything when these functions are called. Texturecontrol handles visualization and updates of textures.

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 slotTextureIndexPropertyName (int, QString &)
 Get the name of the texture index property.
virtual void slotTextureName (int, int, QString &)
 get the name of the texture with given texture index
virtual void slotTextureFilename (int, QString, QString &)
 get the filename of the texture with given texture name
virtual void slotNumberOfTextures (int, int &)
 get the number of textures per object
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

Detailed Description

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 59 of file TextureInterface.hh.


Member Function Documentation

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.

Parameters:
_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).

Reimplemented in FileOBJPlugin, and FileVTKPlugin.

Definition at line 99 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

Parameters:
_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 )

Reimplemented in LaplaceLengthPlugin, and MeanCurvaturePlugin.

Definition at line 81 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

Parameters:
_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 71 of file TextureInterface.hh.

virtual void TextureInterface::getCurrentTexture ( int  ,
QString &   
) [inline, virtual, signal]

get the name of the texture which is currently enabled

Parameters:
_id Id of the object where the current texture should be fetched from
_textureName this returns the name of the texture

Reimplemented in FileOBJPlugin, and FileVTKPlugin.

Definition at line 238 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

Parameters:
_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

Reimplemented in FileOBJPlugin, and FileVTKPlugin.

Definition at line 246 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.

Parameters:
_textureName Name of your Texture
_mode colon seperated String describing your settings (e.g. clamp,abs )

Reimplemented in LaplaceLengthPlugin, and MeanCurvaturePlugin.

Definition at line 150 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)

Parameters:
_textureName Name of your Texture
_mode colon seperated String describing your settings (e.g. clamp,abs )
_id id of an object

Reimplemented in FileOBJPlugin, and FileVTKPlugin.

Definition at line 160 of file TextureInterface.hh.

virtual void TextureInterface::slotGetCurrentTexture ( int  ,
QString &   
) [inline, private, virtual, slot]

fetches the name of the texture which is currently enabled

Parameters:
_id Id of the object where the current texture should be fetched from
_textureName this returns the name of the texture

Definition at line 428 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

Parameters:
_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 436 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.

Parameters:
_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 329 of file TextureInterface.hh.

virtual void TextureInterface::slotNumberOfTextures ( int  ,
int &   
) [inline, private, virtual, slot]

get the number of textures per object

Parameters:
_id Id of the object
_numTextures returns the number of textures

Definition at line 421 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

Parameters:
_textureName The name of the updated texture
_mode New mode flags for the given texture

Definition at line 362 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

Parameters:
_textureName The name of the updated texture
_mode New mode flags for the given texture
_id id of an object

Definition at line 339 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.

Parameters:
_textureName Name of the 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.

Parameters:
_textureName Name of the Texture

Definition at line 282 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.

Parameters:
_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 308 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.

Parameters:
_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 318 of file TextureInterface.hh.

virtual void TextureInterface::slotTextureChangeImage ( QString  ,
QImage &  ,
int   
) [inline, private, virtual, slot]

Changes the texture image of a given texture.

Parameters:
_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 347 of file TextureInterface.hh.

virtual void TextureInterface::slotTextureChangeImage ( QString  ,
QImage &   
) [inline, private, virtual, slot]

Changes the texture image of a given global texture.

Parameters:
_textureName The name of the texture which should be changed
_image The new image for the texture

Definition at line 354 of file TextureInterface.hh.

virtual void TextureInterface::slotTextureFilename ( int  ,
QString  ,
QString &   
) [inline, private, virtual, slot]

get the filename of the texture with given texture name

Get the filename to texture with name _textureName. Retrieve texture names via signal textureName(int,int,QString&) using the object's id and the texture index.

Parameters:
_id Id of the object where the texture should be fetched from
_textureName texture name of the wanted texture
_textureFilename this returns the filename of the texture

Definition at line 414 of file TextureInterface.hh.

virtual void TextureInterface::slotTextureGetImage ( QString  ,
QImage &  ,
int   
) [inline, private, virtual, slot]

fetches the texture image of a given texture

Parameters:
_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 370 of file TextureInterface.hh.

virtual void TextureInterface::slotTextureGetImage ( QString  ,
QImage &   
) [inline, private, virtual, slot]

fetches the texture image of a given global texture

Parameters:
_textureName The name of the texture which should be addressed
_image reference to the image for the texture

Definition at line 377 of file TextureInterface.hh.

virtual void TextureInterface::slotTextureIndex ( QString  ,
int  ,
int &   
) [inline, private, virtual, slot]

Get the texture index of a given texture.

Parameters:
_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 385 of file TextureInterface.hh.

virtual void TextureInterface::slotTextureIndexPropertyName ( int  ,
QString &   
) [inline, private, virtual, slot]

Get the name of the texture index property.

Get the name of the property that holds the texture index (face property).

Parameters:
_id The id of the mesh object
_propertyName The name of the property that holds the texture indices

Definition at line 394 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

Parameters:
_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 402 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

Parameters:
_textureName The name of the updated texture
_identifier -1 if all objects updated, otherwise the identifier of the object

Definition at line 269 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.

Parameters:
_textureName Name of the Texture to be updated
_identifier The id of the object to update

Reimplemented in LaplaceLengthPlugin, and MeanCurvaturePlugin.

Definition at line 257 of file TextureInterface.hh.

virtual void TextureInterface::textureChangeImage ( QString  ,
QImage &  ,
int   
) [inline, virtual, signal]

Change the texture image of a given texture.

Parameters:
_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 168 of file TextureInterface.hh.

virtual void TextureInterface::textureChangeImage ( QString  ,
QImage &   
) [inline, virtual, signal]

Change the texture image of a given global texture.

Parameters:
_textureName The name of the texture which should be changed
_image The new image for the texture

Definition at line 175 of file TextureInterface.hh.

virtual void TextureInterface::textureFilename ( int  ,
QString  ,
QString &   
) [inline, virtual, signal]

get the filename of the texture with given texture index

Get the filename of a given texture with name _textureName. Retrieve the texture's name via signal textureName(int,int,QString&) first.

Parameters:
_id Id of the object where the texture should be fetched from
_textureName The name of the texture whose filename will be fetched
_textureFilename this returns the name of the texture

Reimplemented in FileOBJPlugin, and FileVTKPlugin.

Definition at line 231 of file TextureInterface.hh.

virtual void TextureInterface::textureGetImage ( QString  ,
QImage &   
) [inline, virtual, signal]

Get the texture image of a given global texture.

Parameters:
_textureName The name of the texture which should be addressed
_image reference to the image for the texture

Definition at line 190 of file TextureInterface.hh.

virtual void TextureInterface::textureGetImage ( QString  ,
QImage &  ,
int   
) [inline, virtual, signal]

get the texture image of a given texture

Parameters:
_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 183 of file TextureInterface.hh.

virtual void TextureInterface::textureIndex ( QString  ,
int  ,
int &   
) [inline, virtual, signal]

Get the texture index of a given texture.

Parameters:
_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)

Reimplemented in FileOBJPlugin, and FileVTKPlugin.

Definition at line 198 of file TextureInterface.hh.

virtual void TextureInterface::textureIndexPropertyName ( int  ,
QString &   
) [inline, virtual, signal]

Get the name of the texture index property.

Get the name of the property that holds the texture index (face property).

Parameters:
_id The id of the mesh object
_propertyName The name of the property that holds the texture indices

Reimplemented in FileOBJPlugin, and FileVTKPlugin.

Definition at line 207 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(Handle)' This function maps the texture index to the name of the actual texture that is used to texture the face. Note that some plugins may change the mesh's internal property name for the texture index such that mesh.texture_index(Handle) won't return a valid texture index.

Parameters:
_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

Reimplemented in FileOBJPlugin, and FileVTKPlugin.

Definition at line 220 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

Reimplemented in LaplaceLengthPlugin, and MeanCurvaturePlugin.

Definition at line 113 of file TextureInterface.hh.


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