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 /*===========================================================================*\
43 * *
44 * $Revision$ *
45 * $LastChangedBy$ *
46 * $Date$ *
47 * *
48 \*===========================================================================*/
49 
50 
51 #ifndef TEXTUREINTERFACE_HH
52 #define TEXTUREINTERFACE_HH
53 
55 
56 #if QT_VERSION >= 0x050000
57  #include <QtWidgets>
58 #else
59  #include <QtGui>
60 #endif
61 
62  #include <QMenuBar>
63 
64 
74  signals :
75 
86  virtual void addTexture( QString _name , QString _filename , uint _dimension , int _id ) {};
87 
97  virtual void addTexture( QString _name , QString _filename , uint _dimension ) {};
98 
116  virtual void addMultiTexture( QString _textureGroup , QString _name , QString _filename , int _id , int& _textureId ) {};
117 
121  virtual void updateTexture( QString _textureName , int _identifier) {};
122 
125  virtual void updateAllTextures( ) {};
126 
131  virtual void updatedTextures( QString , int ) {};
132 
136  virtual void switchTexture( QString _textureName , int _id ) {};
137 
141  virtual void switchTexture( QString _textureName ) {};
142 
176  virtual void setTextureMode(QString _textureName ,QString _mode) {};
177 
187  virtual void setTextureMode(QString _textureName ,QString _mode, int _id ) {};
188 
195  virtual void textureChangeImage( QString _textureName , QImage& _image , int _id ) {};
196 
202  virtual void textureChangeImage( QString _textureName , QImage& _image ) {};
203 
210  virtual void textureGetImage( QString _textureName , QImage& _image , int _id ) {};
211 
217  virtual void textureGetImage( QString _textureName , QImage& _image ) {};
218 
225  virtual void textureIndex( QString _textureName, int _id, int& _index) {};
226 
234  virtual void textureIndexPropertyName( int _id, QString& _propertyName) {};
235 
247  virtual void textureName( int _id, int _textureIndex, QString& _textureName ) {};
248 
258  virtual void textureFilename( int _id, QString _textureName, QString& _textureFilename ) {};
259 
265  virtual void getCurrentTexture( int _id, QString& _textureName ) {};
266 
273  virtual void getSubTextures( int _id, QString _multiTextureName, QStringList& _subTextures ) {};
274 
275  private slots :
284  virtual void slotUpdateTexture( QString _textureName , int _identifier) {};
285 
288  virtual void slotUpdateAllTextures( ) {};
289 
296  virtual void slotTextureUpdated( QString _textureName , int _identifier ) {};
297 
304  virtual void slotSwitchTexture( QString _textureName, int _id ) {};
305 
311  virtual void slotSwitchTexture( QString _textureName ) {};
312 
313  public :
314 
316  virtual ~TextureInterface() {};
317 
318  //===========================================================================
324  //===========================================================================
325 
326  private slots :
327 
338  virtual void slotTextureAdded( QString _textureName , QString _filename , uint _dimension, int _id ) {};
339 
349  virtual void slotTextureAdded( QString _textureName , QString _filename , uint _dimension ) {};
350 
365  virtual void slotMultiTextureAdded( QString _textureGroup , QString _name ,
366  QString _filename , int _id , int& _textureId ) {};
367 
375  virtual void slotSetTextureMode(QString _textureName ,QString _mode, int _id ) {};
376 
383  virtual void slotTextureChangeImage( QString _textureName , QImage& _image , int _id ) {};
384 
390  virtual void slotTextureChangeImage( QString _textureName , QImage& _image ) {};
391 
398  virtual void slotSetTextureMode(QString _textureName ,QString _mode) {};
399 
406  virtual void slotTextureGetImage( QString _textureName , QImage& _image , int _id ) {};
407 
413  virtual void slotTextureGetImage( QString _textureName , QImage& _image ) {};
414 
421  virtual void slotTextureIndex( QString _textureName, int _id, int& _index) {};
422 
430  virtual void slotTextureIndexPropertyName( int _id, QString& _propertyName) {};
431 
438  virtual void slotTextureName( int _id, int _textureIndex, QString& _textureName ) {};
439 
450  virtual void slotTextureFilename( int _id, QString _textureName, QString& _textureFilename ) {};
451 
457  virtual void slotNumberOfTextures( int _id, int& _numTextures ) {};
458 
464  virtual void slotGetCurrentTexture( int _id, QString& _textureName ) {};
465 
472  virtual void slotGetSubTextures( int _id, QString _multiTextureName, QStringList& _subTextures ) {};
473 
475 };
476 
477 Q_DECLARE_INTERFACE(TextureInterface,"OpenFlipper.TextureInterface/1.0")
478 
479 #endif // TEXTUREINTERFACE_HH
virtual void getSubTextures(int _id, QString _multiTextureName, QStringList &_subTextures)
get the names of all sub-textures under the given multiTexture
virtual void slotTextureFilename(int _id, QString _textureName, QString &_textureFilename)
get the filename of the texture with given texture name
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 updatedTextures(QString, int)
emit this signal if you updated a texture
virtual void textureGetImage(QString _textureName, QImage &_image, int _id)
get the texture image of a given texture
virtual void textureChangeImage(QString _textureName, QImage &_image)
Change the texture image of a given global texture.
virtual void slotTextureGetImage(QString _textureName, QImage &_image, int _id)
fetches the texture image of a given texture
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 slotTextureAdded(QString _textureName, QString _filename, uint _dimension, int _id)
A texture has been added by a plugin.
virtual void slotTextureChangeImage(QString _textureName, QImage &_image, int _id)
Changes the texture image of a given texture.
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 slotTextureName(int _id, int _textureIndex, QString &_textureName)
get the name of the texture with given texture index
virtual void updateAllTextures()
Tell Plugins to update all textures.
virtual void slotTextureGetImage(QString _textureName, QImage &_image)
fetches the texture image of a given global texture
virtual void slotNumberOfTextures(int _id, int &_numTextures)
get the number of textures per object
virtual ~TextureInterface()
Destructor.
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 slotSetTextureMode(QString _textureName, QString _mode, int _id)
Texturemode for texture should be changed.
virtual void textureIndex(QString _textureName, int _id, int &_index)
Get the texture index of a given texture.
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 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)
Texturemode for texture should be changed.
virtual void slotGetCurrentTexture(int _id, QString &_textureName)
fetches the name of the texture which is currently enabled
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 getCurrentTexture(int _id, QString &_textureName)
get the name of the texture which is currently enabled
virtual void setTextureMode(QString _textureName, QString _mode)
emit this signal if you want to set a special mode for this texture (Clamping,...) ...
virtual void slotTextureUpdated(QString _textureName, int _identifier)
A texture has been updated.
Provide texture support for a plugin.
virtual void textureFilename(int _id, QString _textureName, QString &_textureFilename)
get the filename of the texture with given texture index
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 slotTextureIndexPropertyName(int _id, QString &_propertyName)
Get the name of the texture index property.
virtual void slotTextureIndex(QString _textureName, int _id, int &_index)
Get the texture index of a given texture.
virtual void slotUpdateAllTextures()
update all textures provided by this plugin
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 textureGetImage(QString _textureName, QImage &_image)
Get the texture image of a given global texture.
virtual void slotGetSubTextures(int _id, QString _multiTextureName, QStringList &_subTextures)
fetches the names of all sub-textures under the given multiTexture
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, int _id)
Emit this Signal if a texture has been added (Property Name,filename,Dimension)
virtual void textureChangeImage(QString _textureName, QImage &_image, int _id)
Change the texture image of a given texture.
virtual void slotTextureChangeImage(QString _textureName, QImage &_image)
Changes the texture image of a given global texture.
virtual void slotMultiTextureAdded(QString _textureGroup, QString _name, QString _filename, int _id, int &_textureId)
A multiTexture has been added by a plugin.
virtual void slotTextureAdded(QString _textureName, QString _filename, uint _dimension)
A texture has been added by a plugin.
virtual void textureIndexPropertyName(int _id, QString &_propertyName)
Get the name of the texture index property.