Developer Documentation
TextureInterface.hh
1 /*===========================================================================*\
2 * *
3 * OpenFlipper *
4  * Copyright (c) 2001-2015, RWTH-Aachen University *
5  * Department of Computer Graphics and Multimedia *
6  * All rights reserved. *
7  * www.openflipper.org *
8  * *
9  *---------------------------------------------------------------------------*
10  * This file is part of OpenFlipper. *
11  *---------------------------------------------------------------------------*
12  * *
13  * Redistribution and use in source and binary forms, with or without *
14  * modification, are permitted provided that the following conditions *
15  * are met: *
16  * *
17  * 1. Redistributions of source code must retain the above copyright notice, *
18  * this list of conditions and the following disclaimer. *
19  * *
20  * 2. Redistributions in binary form must reproduce the above copyright *
21  * notice, this list of conditions and the following disclaimer in the *
22  * documentation and/or other materials provided with the distribution. *
23  * *
24  * 3. Neither the name of the copyright holder nor the names of its *
25  * contributors may be used to endorse or promote products derived from *
26  * this software without specific prior written permission. *
27  * *
28  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS *
29  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED *
30  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A *
31  * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER *
32  * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, *
33  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, *
34  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR *
35  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF *
36  * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING *
37  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
38  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
39 * *
40 \*===========================================================================*/
41 
42 #pragma once
43 
45 
46 #include <QStringList>
47 
57  signals :
58 
69  virtual void addTexture( QString _name , QString _filename , uint _dimension , int _id ) {};
70 
81  virtual void addTexture( QString _name , QImage _image , uint _dimension , int _id ) {};
82 
92  virtual void addTexture( QString _name , QString _filename , uint _dimension ) {};
93 
103  virtual void addTexture( QString _name , QImage _image , uint _dimension ) {};
104 
122  virtual void addMultiTexture( QString _textureGroup , QString _name , QString _filename , int _id , int& _textureId ) {};
123 
141  virtual void addMultiTexture( QString _textureGroup , QString _name , QImage _image , int _id , int& _textureId ) {};
142 
146  virtual void updateTexture( QString _textureName , int _identifier) {};
147 
150  virtual void updateAllTextures( ) {};
151 
156  virtual void updatedTextures( QString , int ) {};
157 
161  virtual void switchTexture( QString _textureName , int _id ) {};
162 
166  virtual void switchTexture( QString _textureName ) {};
167 
201  virtual void setTextureMode(QString _textureName ,QString _mode) {};
202 
212  virtual void setTextureMode(QString _textureName ,QString _mode, int _id ) {};
213 
220  virtual void textureChangeImage( QString _textureName , QImage& _image , int _id ) {};
221 
227  virtual void textureChangeImage( QString _textureName , QImage& _image ) {};
228 
235  virtual void textureGetImage( QString _textureName , QImage& _image , int _id ) {};
236 
242  virtual void textureGetImage( QString _textureName , QImage& _image ) {};
243 
250  virtual void textureIndex( QString _textureName, int _id, int& _index) {};
251 
259  virtual void textureIndexPropertyName( int _id, QString& _propertyName) {};
260 
272  virtual void textureName( int _id, int _textureIndex, QString& _textureName ) {};
273 
283  virtual void textureFilename( int _id, QString _textureName, QString& _textureFilename ) {};
284 
290  virtual void getCurrentTexture( int _id, QString& _textureName ) {};
291 
298  virtual void getSubTextures( int _id, QString _multiTextureName, QStringList& _subTextures ) {};
299 
300  private slots :
309  virtual void slotUpdateTexture( QString _textureName , int _identifier) {};
310 
313  virtual void slotUpdateAllTextures( ) {};
314 
321  virtual void slotTextureUpdated( QString _textureName , int _identifier ) {};
322 
329  virtual void slotSwitchTexture( QString _textureName, int _id ) {};
330 
336  virtual void slotSwitchTexture( QString _textureName ) {};
337 
338  public :
339 
341  virtual ~TextureInterface() {};
342 
343  //===========================================================================
349  //===========================================================================
350 
351  private slots :
352 
363  virtual void slotTextureAdded( QString _textureName , QString _filename , uint _dimension, int _id ) {};
364 
374  virtual void slotTextureAdded( QString _textureName , QString _filename , uint _dimension ) {};
375 
390  virtual void slotMultiTextureAdded( QString _textureGroup , QString _name ,
391  QString _filename , int _id , int& _textureId ) {};
392 
400  virtual void slotSetTextureMode(QString _textureName ,QString _mode, int _id ) {};
401 
408  virtual void slotTextureChangeImage( QString _textureName , QImage& _image , int _id ) {};
409 
415  virtual void slotTextureChangeImage( QString _textureName , QImage& _image ) {};
416 
423  virtual void slotSetTextureMode(QString _textureName ,QString _mode) {};
424 
431  virtual void slotTextureGetImage( QString _textureName , QImage& _image , int _id ) {};
432 
438  virtual void slotTextureGetImage( QString _textureName , QImage& _image ) {};
439 
446  virtual void slotTextureIndex( QString _textureName, int _id, int& _index) {};
447 
455  virtual void slotTextureIndexPropertyName( int _id, QString& _propertyName) {};
456 
463  virtual void slotTextureName( int _id, int _textureIndex, QString& _textureName ) {};
464 
475  virtual void slotTextureFilename( int _id, QString _textureName, QString& _textureFilename ) {};
476 
482  virtual void slotNumberOfTextures( int _id, int& _numTextures ) {};
483 
489  virtual void slotGetCurrentTexture( int _id, QString& _textureName ) {};
490 
497  virtual void slotGetSubTextures( int _id, QString _multiTextureName, QStringList& _subTextures ) {};
498 
500 };
501 
502 Q_DECLARE_INTERFACE(TextureInterface,"OpenFlipper.TextureInterface/1.0")
503 
virtual void setTextureMode(QString _textureName, QString _mode, int _id)
emit this signal if you want to set a special mode for this texture (Clamping,...) ...
virtual void slotGetSubTextures(int _id, QString _multiTextureName, QStringList &_subTextures)
fetches the names of all sub-textures under the given multiTexture
virtual void updateAllTextures()
Tell Plugins to update all textures.
virtual void textureGetImage(QString _textureName, QImage &_image)
Get the texture image of a given global texture.
virtual void textureChangeImage(QString _textureName, QImage &_image, int _id)
Change the texture image of a given texture.
virtual void slotUpdateAllTextures()
update all textures provided by this plugin
virtual void addTexture(QString _name, QImage _image, uint _dimension, int _id)
Emit this Signal if a texture has been added (Property Name,image,Dimension)
virtual void textureFilename(int _id, QString _textureName, QString &_textureFilename)
get the filename of the texture with given texture index
virtual void slotMultiTextureAdded(QString _textureGroup, QString _name, QString _filename, int _id, int &_textureId)
A multiTexture has been added by a plugin.
virtual void slotTextureIndex(QString _textureName, int _id, int &_index)
Get the texture index of a given texture.
virtual void switchTexture(QString _textureName, int _id)
emit this signal if you want to switch the texture of a specific object This signal can be called fro...
virtual void addMultiTexture(QString _textureGroup, QString _name, QImage _image, int _id, int &_textureId)
Emit this Signal if you want to add a texture for a multitexturing mode.
virtual void getSubTextures(int _id, QString _multiTextureName, QStringList &_subTextures)
get the names of all sub-textures under the given multiTexture
virtual void slotSwitchTexture(QString _textureName, int _id)
This slot is called when a plugin requests to switch an objects texture This signal can be called fro...
virtual void slotTextureAdded(QString _textureName, QString _filename, uint _dimension, int _id)
A texture has been added by a plugin.
virtual void textureIndex(QString _textureName, int _id, int &_index)
Get the texture index of a given texture.
virtual void slotTextureChangeImage(QString _textureName, QImage &_image)
Changes the texture image of a given global texture.
virtual void slotTextureChangeImage(QString _textureName, QImage &_image, int _id)
Changes the texture image of a given texture.
virtual void updatedTextures(QString, int)
emit this signal if you updated a texture
virtual void slotTextureIndexPropertyName(int _id, QString &_propertyName)
Get the name of the texture index property.
virtual void slotTextureUpdated(QString _textureName, int _identifier)
A texture has been updated.
virtual void slotTextureGetImage(QString _textureName, QImage &_image)
fetches the texture image of a given global texture
virtual void addMultiTexture(QString _textureGroup, QString _name, QString _filename, int _id, int &_textureId)
Emit this Signal if you want to add a texture for a multitexturing mode.
virtual void slotTextureName(int _id, int _textureIndex, QString &_textureName)
get the name of the texture with given texture index
virtual void slotTextureFilename(int _id, QString _textureName, QString &_textureFilename)
get the filename of the texture with given texture name
virtual void addTexture(QString _name, QString _filename, uint _dimension, int _id)
Emit this Signal if a texture has been added (Property Name,filename,Dimension)
virtual ~TextureInterface()
Destructor.
virtual void slotSwitchTexture(QString _textureName)
This slot is called when a plugin requests to switch to a different texture mode This signal can be c...
virtual void slotTextureAdded(QString _textureName, QString _filename, uint _dimension)
A texture has been added by a plugin.
virtual void slotSetTextureMode(QString _textureName, QString _mode)
Texturemode for texture should be changed.
virtual void setTextureMode(QString _textureName, QString _mode)
emit this signal if you want to set a special mode for this texture (Clamping,...) ...
virtual void textureIndexPropertyName(int _id, QString &_propertyName)
Get the name of the texture index property.
virtual void textureChangeImage(QString _textureName, QImage &_image)
Change the texture image of a given global texture.
virtual void textureGetImage(QString _textureName, QImage &_image, int _id)
get the texture image of a given texture
virtual void slotTextureGetImage(QString _textureName, QImage &_image, int _id)
fetches the texture image of a given texture
virtual void addTexture(QString _name, QImage _image, uint _dimension)
Emit this Signal if a texture has been added (Property Name,image,Dimension)
virtual void updateTexture(QString _textureName, int _identifier)
Tell Plugins to update the given texture for the given identifier This signal can be called from any ...
virtual void slotGetCurrentTexture(int _id, QString &_textureName)
fetches the name of the texture which is currently enabled
virtual void slotUpdateTexture(QString _textureName, int _identifier)
update the texture with the given Name ( if this plugin provides this texture ) for all meshes ...
virtual void getCurrentTexture(int _id, QString &_textureName)
get the name of the texture which is currently enabled
virtual void switchTexture(QString _textureName)
emit this signal if you want to switch the global texture This signal can be called from any thread...
virtual void slotNumberOfTextures(int _id, int &_numTextures)
get the number of textures per object
virtual void textureName(int _id, int _textureIndex, QString &_textureName)
get the name of the texture with given texture index
virtual void addTexture(QString _name, QString _filename, uint _dimension)
Emit this Signal if a texture has been added (Property Name,filename,Dimension)
virtual void slotSetTextureMode(QString _textureName, QString _mode, int _id)
Texturemode for texture should be changed.
Provide texture support for a plugin.