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
44 #include <OpenFlipper/common/Types.hh>
45
46 #include <QStringList>
47
56 class TextureInterface {
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
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:497
TextureInterface::slotSetTextureMode
virtual void slotSetTextureMode(QString _textureName, QString _mode, int _id)
Texturemode for texture should be changed.
Definition: TextureInterface.hh:400
TextureInterface::slotTextureAdded
virtual void slotTextureAdded(QString _textureName, QString _filename, uint _dimension, int _id)
A texture has been added by a plugin.
Definition: TextureInterface.hh:363
TextureInterface::textureFilename
virtual void textureFilename(int _id, QString _textureName, QString &_textureFilename)
get the filename of the texture with given texture index
Definition: TextureInterface.hh:283
TextureInterface::slotTextureName
virtual void slotTextureName(int _id, int _textureIndex, QString &_textureName)
get the name of the texture with given texture index
Definition: TextureInterface.hh:463
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:92
TextureInterface::addTexture
virtual void addTexture(QString _name, QImage _image, uint _dimension, int _id)
Emit this Signal if a texture has been added (Property Name,image,Dimension)
Definition: TextureInterface.hh:81
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:166
TextureInterface::slotTextureFilename
virtual void slotTextureFilename(int _id, QString _textureName, QString &_textureFilename)
get the filename of the texture with given texture name
Definition: TextureInterface.hh:475
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:146
TextureInterface::getCurrentTexture
virtual void getCurrentTexture(int _id, QString &_textureName)
get the name of the texture which is currently enabled
Definition: TextureInterface.hh:290
TextureInterface
Provide texture support for a plugin.
Definition: TextureInterface.hh:56
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:329
TextureInterface::updatedTextures
virtual void updatedTextures(QString, int)
emit this signal if you updated a texture
Definition: TextureInterface.hh:156
TextureInterface::textureName
virtual void textureName(int _id, int _textureIndex, QString &_textureName)
get the name of the texture with given texture index
Definition: TextureInterface.hh:272
TextureInterface::textureGetImage
virtual void textureGetImage(QString _textureName, QImage &_image)
Get the texture image of a given global texture.
Definition: TextureInterface.hh:242
TextureInterface::addMultiTexture
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.
Definition: TextureInterface.hh:141
TextureInterface::slotGetCurrentTexture
virtual void slotGetCurrentTexture(int _id, QString &_textureName)
fetches the name of the texture which is currently enabled
Definition: TextureInterface.hh:489
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:298
TextureInterface::textureGetImage
virtual void textureGetImage(QString _textureName, QImage &_image, int _id)
get the texture image of a given texture
Definition: TextureInterface.hh:235
TextureInterface::slotTextureChangeImage
virtual void slotTextureChangeImage(QString _textureName, QImage &_image, int _id)
Changes the texture image of a given texture.
Definition: TextureInterface.hh:408
TextureInterface::~TextureInterface
virtual ~TextureInterface()
Destructor.
Definition: TextureInterface.hh:341
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:212
TextureInterface::slotSetTextureMode
virtual void slotSetTextureMode(QString _textureName, QString _mode)
Texturemode for texture should be changed.
Definition: TextureInterface.hh:423
TextureInterface::slotTextureIndexPropertyName
virtual void slotTextureIndexPropertyName(int _id, QString &_propertyName)
Get the name of the texture index property.
Definition: TextureInterface.hh:455
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:201
TextureInterface::textureChangeImage
virtual void textureChangeImage(QString _textureName, QImage &_image, int _id)
Change the texture image of a given texture.
Definition: TextureInterface.hh:220
TextureInterface::textureChangeImage
virtual void textureChangeImage(QString _textureName, QImage &_image)
Change the texture image of a given global texture.
Definition: TextureInterface.hh:227
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:336
TextureInterface::slotNumberOfTextures
virtual void slotNumberOfTextures(int _id, int &_numTextures)
get the number of textures per object
Definition: TextureInterface.hh:482
TextureInterface::slotUpdateAllTextures
virtual void slotUpdateAllTextures()
update all textures provided by this plugin
Definition: TextureInterface.hh:313
TextureInterface::textureIndexPropertyName
virtual void textureIndexPropertyName(int _id, QString &_propertyName)
Get the name of the texture index property.
Definition: TextureInterface.hh:259
Types.hh
TextureInterface::slotTextureAdded
virtual void slotTextureAdded(QString _textureName, QString _filename, uint _dimension)
A texture has been added by a plugin.
Definition: TextureInterface.hh:374
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:161
TextureInterface::slotTextureGetImage
virtual void slotTextureGetImage(QString _textureName, QImage &_image, int _id)
fetches the texture image of a given texture
Definition: TextureInterface.hh:431
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:122
TextureInterface::updateAllTextures
virtual void updateAllTextures()
Tell Plugins to update all textures.
Definition: TextureInterface.hh:150
TextureInterface::slotTextureGetImage
virtual void slotTextureGetImage(QString _textureName, QImage &_image)
fetches the texture image of a given global texture
Definition: TextureInterface.hh:438
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:390
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:69
TextureInterface::slotTextureUpdated
virtual void slotTextureUpdated(QString _textureName, int _identifier)
A texture has been updated.
Definition: TextureInterface.hh:321
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:309
TextureInterface::slotTextureIndex
virtual void slotTextureIndex(QString _textureName, int _id, int &_index)
Get the texture index of a given texture.
Definition: TextureInterface.hh:446
TextureInterface::textureIndex
virtual void textureIndex(QString _textureName, int _id, int &_index)
Get the texture index of a given texture.
Definition: TextureInterface.hh:250
TextureInterface::addTexture
virtual void addTexture(QString _name, QImage _image, uint _dimension)
Emit this Signal if a texture has been added (Property Name,image,Dimension)
Definition: TextureInterface.hh:103
TextureInterface::slotTextureChangeImage
virtual void slotTextureChangeImage(QString _textureName, QImage &_image)
Changes the texture image of a given global texture.
Definition: TextureInterface.hh:415