Developer Documentation

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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
54 #include <OpenFlipper/common/Types.hh>
55
56 #if QT_VERSION >= 0x050000
57 #include <QtWidgets>
58 #else
59 #include <QtGui>
60 #endif
61
62 #include <QMenuBar>
63
64
73 class TextureInterface {
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
TextureInterface::slotSetTextureMode
virtual void slotSetTextureMode(QString _textureName, QString _mode)
Texturemode for texture should be changed.
Definition: TextureInterface.hh:398
TextureInterface::slotTextureAdded
virtual void slotTextureAdded(QString _textureName, QString _filename, uint _dimension)
A texture has been added by a plugin.
Definition: TextureInterface.hh:349
TextureInterface::slotSwitchTexture
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...
Definition: TextureInterface.hh:311
TextureInterface::getCurrentTexture
virtual void getCurrentTexture(int _id, QString &_textureName)
get the name of the texture which is currently enabled
Definition: TextureInterface.hh:265
TextureInterface::textureName
virtual void textureName(int _id, int _textureIndex, QString &_textureName)
get the name of the texture with given texture index
Definition: TextureInterface.hh:247
TextureInterface::slotTextureAdded
virtual void slotTextureAdded(QString _textureName, QString _filename, uint _dimension, int _id)
A texture has been added by a plugin.
Definition: TextureInterface.hh:338
TextureInterface::setTextureMode
virtual void setTextureMode(QString _textureName, QString _mode)
emit this signal if you want to set a special mode for this texture (Clamping,...) ...
Definition: TextureInterface.hh:176
TextureInterface::slotTextureIndex
virtual void slotTextureIndex(QString _textureName, int _id, int &_index)
Get the texture index of a given texture.
Definition: TextureInterface.hh:421
TextureInterface::slotTextureChangeImage
virtual void slotTextureChangeImage(QString _textureName, QImage &_image)
Changes the texture image of a given global texture.
Definition: TextureInterface.hh:390
TextureInterface::slotTextureGetImage
virtual void slotTextureGetImage(QString _textureName, QImage &_image)
fetches the texture image of a given global texture
Definition: TextureInterface.hh:413
TextureInterface::slotGetCurrentTexture
virtual void slotGetCurrentTexture(int _id, QString &_textureName)
fetches the name of the texture which is currently enabled
Definition: TextureInterface.hh:464
TextureInterface::updateAllTextures
virtual void updateAllTextures()
Tell Plugins to update all textures.
Definition: TextureInterface.hh:125
TextureInterface::~TextureInterface
virtual ~TextureInterface()
Destructor.
Definition: TextureInterface.hh:316
TextureInterface::slotTextureChangeImage
virtual void slotTextureChangeImage(QString _textureName, QImage &_image, int _id)
Changes the texture image of a given texture.
Definition: TextureInterface.hh:383
TextureInterface::switchTexture
virtual void switchTexture(QString _textureName)
emit this signal if you want to switch the global texture This signal can be called from any thread...
Definition: TextureInterface.hh:141
TextureInterface::slotSetTextureMode
virtual void slotSetTextureMode(QString _textureName, QString _mode, int _id)
Texturemode for texture should be changed.
Definition: TextureInterface.hh:375
TextureInterface::slotSwitchTexture
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...
Definition: TextureInterface.hh:304
TextureInterface::addTexture
virtual void addTexture(QString _name, QString _filename, uint _dimension, int _id)
Emit this Signal if a texture has been added (Property Name,filename,Dimension)
Definition: TextureInterface.hh:86
TextureInterface::textureChangeImage
virtual void textureChangeImage(QString _textureName, QImage &_image)
Change the texture image of a given global texture.
Definition: TextureInterface.hh:202
TextureInterface::slotTextureFilename
virtual void slotTextureFilename(int _id, QString _textureName, QString &_textureFilename)
get the filename of the texture with given texture name
Definition: TextureInterface.hh:450
TextureInterface::textureIndex
virtual void textureIndex(QString _textureName, int _id, int &_index)
Get the texture index of a given texture.
Definition: TextureInterface.hh:225
TextureInterface::textureGetImage
virtual void textureGetImage(QString _textureName, QImage &_image)
Get the texture image of a given global texture.
Definition: TextureInterface.hh:217
TextureInterface::textureChangeImage
virtual void textureChangeImage(QString _textureName, QImage &_image, int _id)
Change the texture image of a given texture.
Definition: TextureInterface.hh:195
TextureInterface::setTextureMode
virtual void setTextureMode(QString _textureName, QString _mode, int _id)
emit this signal if you want to set a special mode for this texture (Clamping,...) ...
Definition: TextureInterface.hh:187
TextureInterface::updatedTextures
virtual void updatedTextures(QString, int)
emit this signal if you updated a texture
Definition: TextureInterface.hh:131
TextureInterface::switchTexture
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...
Definition: TextureInterface.hh:136
TextureInterface::slotUpdateTexture
virtual void slotUpdateTexture(QString _textureName, int _identifier)
update the texture with the given Name ( if this plugin provides this texture ) for all meshes ...
Definition: TextureInterface.hh:284
TextureInterface::slotNumberOfTextures
virtual void slotNumberOfTextures(int _id, int &_numTextures)
get the number of textures per object
Definition: TextureInterface.hh:457
TextureInterface::textureIndexPropertyName
virtual void textureIndexPropertyName(int _id, QString &_propertyName)
Get the name of the texture index property.
Definition: TextureInterface.hh:234
TextureInterface::textureGetImage
virtual void textureGetImage(QString _textureName, QImage &_image, int _id)
get the texture image of a given texture
Definition: TextureInterface.hh:210
TextureInterface::textureFilename
virtual void textureFilename(int _id, QString _textureName, QString &_textureFilename)
get the filename of the texture with given texture index
Definition: TextureInterface.hh:258
TextureInterface::slotMultiTextureAdded
virtual void slotMultiTextureAdded(QString _textureGroup, QString _name, QString _filename, int _id, int &_textureId)
A multiTexture has been added by a plugin.
Definition: TextureInterface.hh:365
TextureInterface
Provide texture support for a plugin.
Definition: TextureInterface.hh:73
TextureInterface::slotTextureUpdated
virtual void slotTextureUpdated(QString _textureName, int _identifier)
A texture has been updated.
Definition: TextureInterface.hh:296
TextureInterface::slotGetSubTextures
virtual void slotGetSubTextures(int _id, QString _multiTextureName, QStringList &_subTextures)
fetches the names of all sub-textures under the given multiTexture
Definition: TextureInterface.hh:472
Types.hh
TextureInterface::slotTextureName
virtual void slotTextureName(int _id, int _textureIndex, QString &_textureName)
get the name of the texture with given texture index
Definition: TextureInterface.hh:438
TextureInterface::updateTexture
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 ...
Definition: TextureInterface.hh:121
TextureInterface::getSubTextures
virtual void getSubTextures(int _id, QString _multiTextureName, QStringList &_subTextures)
get the names of all sub-textures under the given multiTexture
Definition: TextureInterface.hh:273
TextureInterface::addTexture
virtual void addTexture(QString _name, QString _filename, uint _dimension)
Emit this Signal if a texture has been added (Property Name,filename,Dimension)
Definition: TextureInterface.hh:97
TextureInterface::addMultiTexture
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.
Definition: TextureInterface.hh:116
TextureInterface::slotUpdateAllTextures
virtual void slotUpdateAllTextures()
update all textures provided by this plugin
Definition: TextureInterface.hh:288
TextureInterface::slotTextureGetImage
virtual void slotTextureGetImage(QString _textureName, QImage &_image, int _id)
fetches the texture image of a given texture
Definition: TextureInterface.hh:406
TextureInterface::slotTextureIndexPropertyName
virtual void slotTextureIndexPropertyName(int _id, QString &_propertyName)
Get the name of the texture index property.
Definition: TextureInterface.hh:430