TextureInterface.hh 25.1 KB
Newer Older
1
/*===========================================================================*\
Jan Möbius's avatar
Jan Möbius committed
2 3
*                                                                            *
*                              OpenFlipper                                   *
Martin Schultz's avatar
Martin Schultz committed
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
 *           Copyright (c) 2001-2015, RWTH-Aachen University                 *
 *           Department of Computer Graphics and Multimedia                  *
 *                          All rights reserved.                             *
 *                            www.openflipper.org                            *
 *                                                                           *
 *---------------------------------------------------------------------------*
 * This file is part of OpenFlipper.                                         *
 *---------------------------------------------------------------------------*
 *                                                                           *
 * Redistribution and use in source and binary forms, with or without        *
 * modification, are permitted provided that the following conditions        *
 * are met:                                                                  *
 *                                                                           *
 * 1. Redistributions of source code must retain the above copyright notice, *
 *    this list of conditions and the following disclaimer.                  *
 *                                                                           *
 * 2. Redistributions in binary form must reproduce the above copyright      *
 *    notice, this list of conditions and the following disclaimer in the    *
 *    documentation and/or other materials provided with the distribution.   *
 *                                                                           *
 * 3. Neither the name of the copyright holder nor the names of its          *
 *    contributors may be used to endorse or promote products derived from   *
 *    this software without specific prior written permission.               *
 *                                                                           *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS       *
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED *
 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A           *
 * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER *
 * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,  *
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,       *
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR        *
 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF    *
 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING      *
 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS        *
 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.              *
Jan Möbius's avatar
Jan Möbius committed
39
*                                                                            *
40 41
\*===========================================================================*/

42
#pragma once
Matthias Möller's avatar
Matthias Möller committed
43

44
#include <OpenFlipper/common/Types.hh>
Matthias Möller's avatar
Matthias Möller committed
45

46
#include <QStringList>
Jan Möbius's avatar
 
Jan Möbius committed
47

Jan Möbius's avatar
 
Jan Möbius committed
48
 /**
Mike Kremer's avatar
Mike Kremer committed
49 50
  * \brief Provide texture support for a plugin.
  *
Jan Möbius's avatar
 
Jan Möbius committed
51 52
  * 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
Jan Möbius's avatar
 
Jan Möbius committed
53
  * coordinates of the mesh. As other plugins may provide textures to, the visualization of the
Jan Möbius's avatar
 
Jan Möbius committed
54 55 56 57
  * textures is handled by the main application (or a texture control plugin).
 */
class TextureInterface {
   signals :
Jan Möbius's avatar
 
Jan Möbius committed
58

Jan Möbius's avatar
 
Jan Möbius committed
59
      /** \brief Emit this Signal if a texture has been added (Property Name,filename,Dimension)
Dirk Wilden's avatar
Dirk Wilden committed
60 61
       *
       *  Emit this signal if a texture for a specific object has been added
62
       *  This signal can be called from any thread.\n
Dirk Wilden's avatar
Dirk Wilden committed
63 64
       *
       *  @param  _name Name of the property which contains the tex coords (double or vec2d)
65
       *  @param _filename Filename of the texture (either local in OpenFlippers texture dir or global ( "./Textures/<name>")
Dirk Wilden's avatar
Dirk Wilden committed
66 67 68
       *  @param _dimension 1D texture ( currenty only supports 1 )
       *  @param _id id of an object
       */
69
      virtual void addTexture( QString _name , QString _filename , uint _dimension , int _id ) {};
Dirk Wilden's avatar
Dirk Wilden committed
70

71 72 73 74 75 76 77 78 79 80 81 82
     /** \brief Emit this Signal if a texture has been added (Property Name,image,Dimension)
      *
      *  Emit this signal if a texture for a specific object has been added
      *  This signal can be called from any thread.\n
      *
      *  @param  _name Name of the property which contains the tex coords (double or vec2d)
      *  @param _image A QImage which is used to provide the image data
      *  @param _dimension 1D texture ( currenty only supports 1 )
      *  @param _id id of an object
      */
     virtual void addTexture( QString _name , QImage _image , uint _dimension , int _id ) {};

Dirk Wilden's avatar
Dirk Wilden committed
83 84 85
      /** \brief Emit this Signal if a texture has been added (Property Name,filename,Dimension)
       *
       *  Emit this signal if a global texture has been added
86
       *  This signal can be called from any thread.\n
Jan Möbius's avatar
 
Jan Möbius committed
87
       *
Jan Möbius's avatar
 
Jan Möbius committed
88
       *  @param  _name Name of the property which contains the tex coords (double or vec2d)
89
       *  @param _filename Filename of the texture (either local in OpenFlippers texture dir or global ( "./Textures/<name>")
Jan Möbius's avatar
 
Jan Möbius committed
90 91
       *  @param _dimension 1D texture ( currenty only supports 1 )
       */
92
      virtual void addTexture( QString _name , QString _filename , uint _dimension ) {};
Jan Möbius's avatar
 
Jan Möbius committed
93

94 95 96 97 98 99 100 101 102 103 104
      /** \brief Emit this Signal if a texture has been added (Property Name,image,Dimension)
       *
       *  Emit this signal if a global texture has been added
       *  This signal can be called from any thread.\n
       *
       *  @param  _name Name of the property which contains the tex coords (double or vec2d)
       *  @param _image A QImage which is used to provide the image data
       *  @param _dimension 1D texture ( currenty only supports 1 )
       */
      virtual void addTexture( QString _name , QImage _image , uint _dimension ) {};
  
105 106 107
      /** \brief 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.
Jan Möbius's avatar
Jan Möbius committed
108
       *
109
       *  The first parameter defines a texturegroup which collects all textures
Jan Möbius's avatar
Jan Möbius committed
110 111 112
       *  that should be painted in the multitexturing mode. This group does not
       *  have to exist on the first call but will be created automatically.
       *
113 114
       *  The second parameter defines the single textures name used in the gui.\n
       *  This signal can be called from any thread.\n
115 116 117 118 119
       *
       *  @param _textureGroup Multitexturing group using this texture
       *  @param _name         Name of the property which contains the tex coords (double or vec2d)
       *  @param _filename     Filename of the texture (either local in OpenFlippers texture dir or global ( "./Textures/<name>")
       *  @param _id           Id of the object which should use that texture
Jan Möbius's avatar
Jan Möbius committed
120
       *  @param _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).
121
       */
122
      virtual void addMultiTexture( QString _textureGroup , QString _name , QString _filename , int _id , int& _textureId ) {};
123

124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142
      /** \brief 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.\n
       *  This signal can be called from any thread.\n
       *
       *  @param _textureGroup Multitexturing group using this texture
       *  @param _name         Name of the property which contains the tex coords (double or vec2d)
       *  @param _image        A QImage which is used to provide the image data
       *  @param _id           Id of the object which should use that texture
       *  @param _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).
       */
      virtual void addMultiTexture( QString _textureGroup , QString _name , QImage _image , int _id , int& _textureId ) {};

Jan Möbius's avatar
 
Jan Möbius committed
143
      /** \brief Tell Plugins to update the given texture for the given identifier
144
       * This signal can be called from any thread.\n
Jan Möbius's avatar
 
Jan Möbius committed
145
       */
146
      virtual void updateTexture( QString _textureName  , int _identifier) {};
Jan Möbius's avatar
 
Jan Möbius committed
147

Jan Möbius's avatar
 
Jan Möbius committed
148 149 150
      /** \brief Tell Plugins to update all textures
       */
      virtual void updateAllTextures( ) {};
Jan Möbius's avatar
 
Jan Möbius committed
151 152 153 154

      /** \brief 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
Jan Möbius's avatar
 
Jan Möbius committed
155 156
      */
      virtual void updatedTextures( QString , int ) {};
Jan Möbius's avatar
 
Jan Möbius committed
157

Dirk Wilden's avatar
Dirk Wilden committed
158
      /** \brief emit this signal if you want to switch the texture of a specific object
159
       * This signal can be called from any thread.\n
Dirk Wilden's avatar
Dirk Wilden committed
160
       */
161
      virtual void switchTexture( QString _textureName , int _id  ) {};
Dirk Wilden's avatar
Dirk Wilden committed
162 163

      /** \brief emit this signal if you want to switch the global texture
164
       * This signal can be called from any thread.\n
Dirk Wilden's avatar
Dirk Wilden committed
165
       */
166
      virtual void switchTexture( QString _textureName ) {};
Jan Möbius's avatar
 
Jan Möbius committed
167

Jan Möbius's avatar
 
Jan Möbius committed
168
      /** \brief emit this signal if you want to set a special mode for this texture (Clamping,...)
Jan Möbius's avatar
 
Jan Möbius committed
169
       *
Jan Möbius's avatar
 
Jan Möbius committed
170
       *  emit this signal if you want to set a special mode for this texture
Jan Möbius's avatar
 
Jan Möbius committed
171
       *
172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196
       * The values are modified in the following way:\n
       *
       * First the absolute value of the property is taken if requested:\n
       * abs=true/false \n
       *
       * Then this value is clamped against the given values:\n
       * clamp=true/false \n
       * clamp_min=value \n
       * clamp_max=value \n
       *
       * If the texture should be repeated, the values are translated such that the minimum is at min_val(0.0 by default)
       * and than scaled such that the maximum is at max_val. This data is than passed to the rendering: \n
       * repeat=true/false \n
       * min_val=value \n
       * max_val=value \n
       *
       * If the texture should not be repeated you could choose to center the data around 0.5. The negative values are than mapped to 0..0.5
       * and the positive values to 0.5..1:\n
       * center=true/false\n
       *
       * Otherwise, the values are mapped directly to 0..1. You can also disable that final scaling with:\n
       * scale=true/false\n
       *
       * Examples:\n
       * Pass texture without modification: abs=false,clamp=false,repeat=false,center=false,scale=false\n
197
       * This signal can be called from any thread.\n
Jan Möbius's avatar
 
Jan Möbius committed
198
       *  @param _textureName Name of your Texture
Jan Möbius's avatar
 
Jan Möbius committed
199
       *  @param _mode colon separated String describing your settings (e.g. clamp,abs )
Jan Möbius's avatar
 
Jan Möbius committed
200
      */
201
      virtual void setTextureMode(QString _textureName ,QString _mode) {};
Jan Möbius's avatar
 
Jan Möbius committed
202

Dirk Wilden's avatar
Dirk Wilden committed
203 204 205
      /** \brief 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)
206
       * This signal can be called from any thread.\n
Dirk Wilden's avatar
Dirk Wilden committed
207 208
       *
       *  @param _textureName Name of your Texture
Jan Möbius's avatar
 
Jan Möbius committed
209
       *  @param _mode colon separated String describing your settings (e.g. clamp,abs )
Dirk Wilden's avatar
Dirk Wilden committed
210 211
       *  @param _id id of an object
       */
212
      virtual void setTextureMode(QString _textureName ,QString _mode, int _id ) {};
Dirk Wilden's avatar
Dirk Wilden committed
213

214 215 216 217 218 219
      /** \brief Change the texture image of a given texture
       *
       *  @param _textureName The name of the texture which should be changed
       *  @param _image The new image for the texture
       *  @param _id Id of the object where the texture should be changed
       */
220
      virtual void textureChangeImage( QString _textureName , QImage& _image , int _id ) {};
221 222 223 224 225 226

      /** \brief Change the texture image of a given global texture
       *
       *  @param _textureName The name of the texture which should be changed
       *  @param _image The new image for the texture
       */
227
      virtual void textureChangeImage( QString _textureName , QImage& _image ) {};
228

229 230 231 232 233 234
      /** \brief get the texture image of a given texture
       *
       *  @param _textureName The name of the texture which should be addressed
       *  @param _image reference to the image for the texture
       *  @param _id Id of the object where the texture should be fetched from
       */
235
      virtual void textureGetImage( QString _textureName , QImage& _image , int _id ) {};
236 237 238 239 240 241

      /** \brief Get the texture image of a given global texture
       *
       *  @param _textureName The name of the texture which should be addressed
       *  @param _image reference to the image for the texture
       */
242
      virtual void textureGetImage( QString _textureName , QImage& _image ) {};
243 244 245 246 247 248 249

      /** \brief Get the texture index of a given texture
       *
       *  @param _textureName The name of the texture which should be addressed
       *  @param _id Id of the object where the texture is defined on
       *  @param _index the index of the texture (used for multiTexturing)
       */
250
      virtual void textureIndex( QString _textureName, int _id, int& _index) {};
251
      
252 253 254 255 256 257 258
      /** \brief Get the name of the texture index property
       *
       *  Get the name of the property that holds the texture index (face property).
       *
       *  @param _id The id of the mesh object
       *  @param _propertyName The name of the property that holds the texture indices
       */
259
      virtual void textureIndexPropertyName( int _id, QString& _propertyName) {};
260
      
261 262
       /** \brief get the name of the texture with given texture index
       *
263
       *  When using multiTexturing you can retrieve the texture index of a face with 'mesh.texture_index(Handle)'
264
       *  This function maps the texture index to the name of the actual texture that is used to texture
265 266
       *  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.
267 268 269 270 271
       *
       *  @param _id Id of the object where the texture should be fetched from
       *  @param _textureIndex texture index of the wanted texture
       *  @param _textureName this returns the name of the texture
       */
272
      virtual void textureName( int _id, int _textureIndex, QString& _textureName ) {};
273 274 275 276 277 278 279 280 281 282
      
      /** \brief 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.
       *
       *  @param _id Id of the object where the texture should be fetched from
       *  @param _textureName The name of the texture whose filename will be fetched
       *  @param _textureFilename this returns the name of the texture
       */
283
      virtual void textureFilename( int _id, QString _textureName, QString& _textureFilename ) {};
284

285 286 287 288 289
       /** \brief get the name of the texture which is currently enabled
       *
       *  @param _id Id of the object where the current texture should be fetched from
       *  @param _textureName this returns the name of the texture
       */
290
      virtual void getCurrentTexture( int _id, QString& _textureName ) {};
291 292 293 294 295
      
       /** \brief get the names of all sub-textures under the given multiTexture
       *
       *  @param _id Id of the object where the current texture should be fetched from
       *  @param _multiTextureName name of a multi texture
Jan Möbius's avatar
Jan Möbius committed
296
       *  @param _subTextures this returns the names of all sub textures that are combined under the given multi texture
297
       */
298
      virtual void getSubTextures( int _id, QString _multiTextureName, QStringList& _subTextures ) {};
299

Jan Möbius's avatar
 
Jan Möbius committed
300 301
   private slots :
      /** \brief update the texture with the given Name ( if this plugin provides this texture ) for all meshes
302 303 304 305
       *
       * 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.
       *
Jan Möbius's avatar
 
Jan Möbius committed
306 307 308
       * @param _textureName Name of the Texture to be updated
       * @param _identifier The id of the object to update
      */
309
      virtual void slotUpdateTexture( QString _textureName , int _identifier) {};
Jan Möbius's avatar
 
Jan Möbius committed
310

Jan Möbius's avatar
 
Jan Möbius committed
311 312 313
      /** \brief update all textures provided by this plugin
       */
      virtual void slotUpdateAllTextures( ) {};
Jan Möbius's avatar
 
Jan Möbius committed
314

315 316 317 318 319 320
      /** \brief A texture has been updated
       *
       *  A plugin has updated a Texture
       *  @param _textureName The name of the updated texture
       *  @param _identifier -1 if all objects updated, otherwise the identifier of the object
       */
321
      virtual void slotTextureUpdated( QString _textureName , int _identifier ) {};
322 323

      /** \brief This slot is called when a plugin requests to switch an objects texture
324
       * This signal can be called from any thread.\n
325 326 327 328
       *
       * @param _textureName Name of the Texture
       * @param _id id of an object
       */
329
      virtual void slotSwitchTexture( QString _textureName, int _id ) {};
330 331

      /** \brief This slot is called when a plugin requests to switch to a different texture mode
332
       * This signal can be called from any thread.\n
333 334 335
       *
       * @param _textureName Name of the Texture
      */
336
      virtual void slotSwitchTexture( QString _textureName ) {};
337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352

   public :

      /// Destructor
      virtual ~TextureInterface() {};

   //===========================================================================
    /** @name Functions handled by textureControlPlugin
     *
     * Normally you dont have to do anything when these functions are called.
     * Texturecontrol handles visualization and updates of textures.
    * @{ */
   //===========================================================================

  private slots :

Jan Möbius's avatar
 
Jan Möbius committed
353 354
      /** \brief A texture has been added by a plugin.
       *
355 356
       * This slot is called when a texture for a specific object has been added by a plugin.\n
       * This slot will be executed on the main thread.\n
Dirk Wilden's avatar
Dirk Wilden committed
357 358 359 360 361 362
       *
       * @param _textureName Name of the Added texture (has to be equal to the property name)
       * @param _filename Filename of the Texture Image to be used
       * @param _dimension Dimension of the Texture (currently only 1D and 2D Textures are supported
       * @param _id id of an object
       */
363
      virtual void slotTextureAdded( QString _textureName , QString _filename , uint _dimension, int _id ) {};
Dirk Wilden's avatar
Dirk Wilden committed
364 365 366

      /** \brief A texture has been added by a plugin.
       *
367 368
       * This slot is called when a global texture has been added by a plugin.\n
       * This slot will be executed on the main thread.\n
Dirk Wilden's avatar
Dirk Wilden committed
369
       *
Jan Möbius's avatar
 
Jan Möbius committed
370 371
       * @param _textureName Name of the Added texture (has to be equal to the property name)
       * @param _filename Filename of the Texture Image to be used
372
       * @param _dimension Dimension of the Texture (currently only 1D and 2D Textures are supported
Jan Möbius's avatar
 
Jan Möbius committed
373
       */
374
      virtual void slotTextureAdded( QString _textureName , QString _filename , uint _dimension ) {};
Jan Möbius's avatar
 
Jan Möbius committed
375

376 377
      /** \brief A multiTexture has been added by a plugin.
       *
Jan Möbius's avatar
Jan Möbius committed
378
       * This slot is called when a multi Texture has been added by a plugin.
379
       *
Jan Möbius's avatar
Jan Möbius committed
380
       * A multi texture has a global name which is defined as the texture group and consists of
381 382
       * mutliple sub textures which have their own names but are all used when the group is active.\n
       * This slot will be executed on the main thread.\n
Jan Möbius's avatar
Jan Möbius committed
383 384 385
       *
       * @param _textureGroup Name of the texture group that is associated with the texture.
       * @param _name      Name of the Added texture (has to be equal to the property name)
386 387 388 389
       * @param _filename Filename of the Texture Image to be used
       * @param _id Id of the object which should use the texture
       * @param _textureId    The new id of the texture( This id is object related!!)
       */
390 391
      virtual void slotMultiTextureAdded( QString _textureGroup , QString _name ,
                                          QString _filename , int _id , int& _textureId ) {};
392

Dirk Wilden's avatar
Dirk Wilden committed
393 394 395 396 397 398 399
      /** \brief Texturemode for texture should be changed
       *
       *  A plugin has updated the Texture settings for a texture
       *  @param _textureName The name of the updated texture
       *  @param _mode New mode flags for the given texture
       *  @param _id id of an object
       */
400
      virtual void slotSetTextureMode(QString _textureName ,QString _mode, int _id ) {};
Dirk Wilden's avatar
Dirk Wilden committed
401

402 403 404 405 406 407
      /** \brief Changes the texture image of a given texture
       *
       *  @param _textureName The name of the texture which should be changed
       *  @param _image The new image for the texture
       *  @param _id Id of the object where the texture should be changed
       */
408
      virtual void slotTextureChangeImage( QString _textureName , QImage& _image , int _id ) {};
409 410 411 412 413 414

      /** \brief Changes the texture image of a given global texture
       *
       *  @param _textureName The name of the texture which should be changed
       *  @param _image The new image for the texture
       */
415
      virtual void slotTextureChangeImage( QString _textureName , QImage& _image ) {};
416

Jan Möbius's avatar
 
Jan Möbius committed
417
      /** \brief Texturemode for texture should be changed
Jan Möbius's avatar
 
Jan Möbius committed
418
       *
Jan Möbius's avatar
 
Jan Möbius committed
419 420 421 422
       *  A plugin has updated the Texture settings for a texture
       *  @param _textureName The name of the updated texture
       *  @param _mode New mode flags for the given texture
       */
423
      virtual void slotSetTextureMode(QString _textureName ,QString _mode) {};
424 425 426 427 428 429 430
      
      /** \brief fetches the texture image of a given texture
       *
       *  @param _textureName The name of the texture which should be addressed
       *  @param _image reference to the image for the texture
       *  @param _id Id of the object where the texture should be fetched from
       */
431
      virtual void slotTextureGetImage( QString _textureName , QImage& _image , int _id ) {};
432 433 434 435 436 437

      /** \brief fetches the texture image of a given global texture
       *
       *  @param _textureName The name of the texture which should be addressed
       *  @param _image reference to the image for the texture
       */
438
      virtual void slotTextureGetImage( QString _textureName , QImage& _image ) {};
439
      
440 441 442 443 444 445
      /** \brief Get the texture index of a given texture
       *
       *  @param _textureName The name of the texture which should be addressed
       *  @param _id Id of the object where the texture is defined on
       *  @param _index the index of the texture (used for multiTexturing)
       */
446
      virtual void slotTextureIndex( QString _textureName, int _id, int& _index) {};
447
      
448 449 450 451 452 453 454
      /** \brief Get the name of the texture index property
       *
       *  Get the name of the property that holds the texture index (face property).
       *
       *  @param _id The id of the mesh object
       *  @param _propertyName The name of the property that holds the texture indices
       */
455
      virtual void slotTextureIndexPropertyName( int _id, QString& _propertyName) {};
456
      
457 458 459 460 461 462
       /** \brief get the name of the texture with given texture index
       *
       *  @param _id Id of the object where the texture should be fetched from
       *  @param _textureIndex texture index of the wanted texture
       *  @param _textureName this returns the name of the texture
       */
463
      virtual void slotTextureName( int _id, int _textureIndex, QString& _textureName ) {};
464 465 466 467 468 469 470 471 472 473 474
      
      /** \brief 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.
       *
       *  @param _id Id of the object where the texture should be fetched from
       *  @param _textureName texture name of the wanted texture
       *  @param _textureFilename this returns the filename of the texture
       */
475
      virtual void slotTextureFilename( int _id, QString _textureName, QString& _textureFilename ) {};
476 477 478 479 480 481
      
      /** \brief get the number of textures per object
       *
       *  @param _id Id of the object
       *  @param _numTextures returns the number of textures
       */
482
      virtual void slotNumberOfTextures( int _id, int& _numTextures ) {};
483

484 485 486 487 488
       /** \brief fetches the name of the texture which is currently enabled
       *
       *  @param _id Id of the object where the current texture should be fetched from
       *  @param _textureName this returns the name of the texture
       */
489
      virtual void slotGetCurrentTexture( int _id, QString& _textureName ) {};
490 491 492 493 494
      
       /** \brief fetches the names of all sub-textures under the given multiTexture
       *
       *  @param _id Id of the object where the current texture should be fetched from
       *  @param _multiTextureName name of a multi texture
Jan Möbius's avatar
Jan Möbius committed
495
       *  @param _subTextures this returns the names of all sub textures that are combined under the given multi texture
496
       */
497
      virtual void slotGetSubTextures( int _id, QString _multiTextureName, QStringList& _subTextures ) {};
Jan Möbius's avatar
 
Jan Möbius committed
498

499
   /** @} */
Jan Möbius's avatar
 
Jan Möbius committed
500 501 502
};

Q_DECLARE_INTERFACE(TextureInterface,"OpenFlipper.TextureInterface/1.0")
Jan Möbius's avatar
 
Jan Möbius committed
503