TextureInterface.hh 25.7 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
\*===========================================================================*/

/*===========================================================================*\
Jan Möbius's avatar
Jan Möbius committed
43 44 45 46 47
*                                                                            *
*   $Revision$                                                       *
*   $LastChangedBy$                                                *
*   $Date$                     *
*                                                                            *
48
\*===========================================================================*/
Jan Möbius's avatar
 
Jan Möbius committed
49 50


Jan Möbius's avatar
 
Jan Möbius committed
51 52
#ifndef TEXTUREINTERFACE_HH
#define TEXTUREINTERFACE_HH
Jan Möbius's avatar
 
Jan Möbius committed
53

Matthias Möller's avatar
Matthias Möller committed
54
 #include <OpenFlipper/common/Types.hh>
Matthias Möller's avatar
Matthias Möller committed
55 56 57
 
  #include <QtWidgets>

Jan Möbius's avatar
 
Jan Möbius committed
58
 #include <QMenuBar>
Matthias Möller's avatar
Matthias Möller committed
59

Jan Möbius's avatar
 
Jan Möbius committed
60

Jan Möbius's avatar
 
Jan Möbius committed
61
 /**
Mike Kremer's avatar
Mike Kremer committed
62 63
  * \brief Provide texture support for a plugin.
  *
Jan Möbius's avatar
 
Jan Möbius committed
64 65
  * 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
66
  * coordinates of the mesh. As other plugins may provide textures to, the visualization of the
Jan Möbius's avatar
 
Jan Möbius committed
67 68 69 70
  * textures is handled by the main application (or a texture control plugin).
 */
class TextureInterface {
   signals :
Jan Möbius's avatar
 
Jan Möbius committed
71

Jan Möbius's avatar
 
Jan Möbius committed
72
      /** \brief Emit this Signal if a texture has been added (Property Name,filename,Dimension)
Dirk Wilden's avatar
Dirk Wilden committed
73 74
       *
       *  Emit this signal if a texture for a specific object has been added
75
       *  This signal can be called from any thread.\n
Dirk Wilden's avatar
Dirk Wilden committed
76 77
       *
       *  @param  _name Name of the property which contains the tex coords (double or vec2d)
78
       *  @param _filename Filename of the texture (either local in OpenFlippers texture dir or global ( "./Textures/<name>")
Dirk Wilden's avatar
Dirk Wilden committed
79 80 81
       *  @param _dimension 1D texture ( currenty only supports 1 )
       *  @param _id id of an object
       */
82
      virtual void addTexture( QString _name , QString _filename , uint _dimension , int _id ) {};
Dirk Wilden's avatar
Dirk Wilden committed
83

84 85 86 87 88 89 90 91 92 93 94 95
     /** \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
96 97 98
      /** \brief Emit this Signal if a texture has been added (Property Name,filename,Dimension)
       *
       *  Emit this signal if a global texture has been added
99
       *  This signal can be called from any thread.\n
Jan Möbius's avatar
 
Jan Möbius committed
100
       *
Jan Möbius's avatar
 
Jan Möbius committed
101
       *  @param  _name Name of the property which contains the tex coords (double or vec2d)
102
       *  @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
103 104
       *  @param _dimension 1D texture ( currenty only supports 1 )
       */
105
      virtual void addTexture( QString _name , QString _filename , uint _dimension ) {};
Jan Möbius's avatar
 
Jan Möbius committed
106

107 108 109 110 111 112 113 114 115 116 117
      /** \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 ) {};
  
118 119 120
      /** \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
121
       *
122
       *  The first parameter defines a texturegroup which collects all textures
Jan Möbius's avatar
Jan Möbius committed
123 124 125
       *  that should be painted in the multitexturing mode. This group does not
       *  have to exist on the first call but will be created automatically.
       *
126 127
       *  The second parameter defines the single textures name used in the gui.\n
       *  This signal can be called from any thread.\n
128 129 130 131 132
       *
       *  @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
133
       *  @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).
134
       */
135
      virtual void addMultiTexture( QString _textureGroup , QString _name , QString _filename , int _id , int& _textureId ) {};
136

137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155
      /** \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
156
      /** \brief Tell Plugins to update the given texture for the given identifier
157
       * This signal can be called from any thread.\n
Jan Möbius's avatar
 
Jan Möbius committed
158
       */
159
      virtual void updateTexture( QString _textureName  , int _identifier) {};
Jan Möbius's avatar
 
Jan Möbius committed
160

Jan Möbius's avatar
 
Jan Möbius committed
161 162 163
      /** \brief Tell Plugins to update all textures
       */
      virtual void updateAllTextures( ) {};
Jan Möbius's avatar
 
Jan Möbius committed
164 165 166 167

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

Dirk Wilden's avatar
Dirk Wilden committed
171
      /** \brief emit this signal if you want to switch the texture of a specific object
172
       * This signal can be called from any thread.\n
Dirk Wilden's avatar
Dirk Wilden committed
173
       */
174
      virtual void switchTexture( QString _textureName , int _id  ) {};
Dirk Wilden's avatar
Dirk Wilden committed
175 176

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

Jan Möbius's avatar
 
Jan Möbius committed
181
      /** \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
182
       *
Jan Möbius's avatar
 
Jan Möbius committed
183
       *  emit this signal if you want to set a special mode for this texture
Jan Möbius's avatar
 
Jan Möbius committed
184
       *
185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209
       * 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
210
       * This signal can be called from any thread.\n
Jan Möbius's avatar
 
Jan Möbius committed
211
       *  @param _textureName Name of your Texture
Jan Möbius's avatar
 
Jan Möbius committed
212
       *  @param _mode colon separated String describing your settings (e.g. clamp,abs )
Jan Möbius's avatar
 
Jan Möbius committed
213
      */
214
      virtual void setTextureMode(QString _textureName ,QString _mode) {};
Jan Möbius's avatar
 
Jan Möbius committed
215

Dirk Wilden's avatar
Dirk Wilden committed
216 217 218
      /** \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)
219
       * This signal can be called from any thread.\n
Dirk Wilden's avatar
Dirk Wilden committed
220 221
       *
       *  @param _textureName Name of your Texture
Jan Möbius's avatar
 
Jan Möbius committed
222
       *  @param _mode colon separated String describing your settings (e.g. clamp,abs )
Dirk Wilden's avatar
Dirk Wilden committed
223 224
       *  @param _id id of an object
       */
225
      virtual void setTextureMode(QString _textureName ,QString _mode, int _id ) {};
Dirk Wilden's avatar
Dirk Wilden committed
226

227 228 229 230 231 232
      /** \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
       */
233
      virtual void textureChangeImage( QString _textureName , QImage& _image , int _id ) {};
234 235 236 237 238 239

      /** \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
       */
240
      virtual void textureChangeImage( QString _textureName , QImage& _image ) {};
241

242 243 244 245 246 247
      /** \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
       */
248
      virtual void textureGetImage( QString _textureName , QImage& _image , int _id ) {};
249 250 251 252 253 254

      /** \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
       */
255
      virtual void textureGetImage( QString _textureName , QImage& _image ) {};
256 257 258 259 260 261 262

      /** \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)
       */
263
      virtual void textureIndex( QString _textureName, int _id, int& _index) {};
264
      
265 266 267 268 269 270 271
      /** \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
       */
272
      virtual void textureIndexPropertyName( int _id, QString& _propertyName) {};
273
      
274 275
       /** \brief get the name of the texture with given texture index
       *
276
       *  When using multiTexturing you can retrieve the texture index of a face with 'mesh.texture_index(Handle)'
277
       *  This function maps the texture index to the name of the actual texture that is used to texture
278 279
       *  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.
280 281 282 283 284
       *
       *  @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
       */
285
      virtual void textureName( int _id, int _textureIndex, QString& _textureName ) {};
286 287 288 289 290 291 292 293 294 295
      
      /** \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
       */
296
      virtual void textureFilename( int _id, QString _textureName, QString& _textureFilename ) {};
297

298 299 300 301 302
       /** \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
       */
303
      virtual void getCurrentTexture( int _id, QString& _textureName ) {};
304 305 306 307 308
      
       /** \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
309
       *  @param _subTextures this returns the names of all sub textures that are combined under the given multi texture
310
       */
311
      virtual void getSubTextures( int _id, QString _multiTextureName, QStringList& _subTextures ) {};
312

Jan Möbius's avatar
 
Jan Möbius committed
313 314
   private slots :
      /** \brief update the texture with the given Name ( if this plugin provides this texture ) for all meshes
315 316 317 318
       *
       * 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
319 320 321
       * @param _textureName Name of the Texture to be updated
       * @param _identifier The id of the object to update
      */
322
      virtual void slotUpdateTexture( QString _textureName , int _identifier) {};
Jan Möbius's avatar
 
Jan Möbius committed
323

Jan Möbius's avatar
 
Jan Möbius committed
324 325 326
      /** \brief update all textures provided by this plugin
       */
      virtual void slotUpdateAllTextures( ) {};
Jan Möbius's avatar
 
Jan Möbius committed
327

328 329 330 331 332 333
      /** \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
       */
334
      virtual void slotTextureUpdated( QString _textureName , int _identifier ) {};
335 336

      /** \brief This slot is called when a plugin requests to switch an objects texture
337
       * This signal can be called from any thread.\n
338 339 340 341
       *
       * @param _textureName Name of the Texture
       * @param _id id of an object
       */
342
      virtual void slotSwitchTexture( QString _textureName, int _id ) {};
343 344

      /** \brief This slot is called when a plugin requests to switch to a different texture mode
345
       * This signal can be called from any thread.\n
346 347 348
       *
       * @param _textureName Name of the Texture
      */
349
      virtual void slotSwitchTexture( QString _textureName ) {};
350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365

   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
366 367
      /** \brief A texture has been added by a plugin.
       *
368 369
       * 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
370 371 372 373 374 375
       *
       * @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
       */
376
      virtual void slotTextureAdded( QString _textureName , QString _filename , uint _dimension, int _id ) {};
Dirk Wilden's avatar
Dirk Wilden committed
377 378 379

      /** \brief A texture has been added by a plugin.
       *
380 381
       * 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
382
       *
Jan Möbius's avatar
 
Jan Möbius committed
383 384
       * @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
385
       * @param _dimension Dimension of the Texture (currently only 1D and 2D Textures are supported
Jan Möbius's avatar
 
Jan Möbius committed
386
       */
387
      virtual void slotTextureAdded( QString _textureName , QString _filename , uint _dimension ) {};
Jan Möbius's avatar
 
Jan Möbius committed
388

389 390
      /** \brief A multiTexture has been added by a plugin.
       *
Jan Möbius's avatar
Jan Möbius committed
391
       * This slot is called when a multi Texture has been added by a plugin.
392
       *
Jan Möbius's avatar
Jan Möbius committed
393
       * A multi texture has a global name which is defined as the texture group and consists of
394 395
       * 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
396 397 398
       *
       * @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)
399 400 401 402
       * @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!!)
       */
403 404
      virtual void slotMultiTextureAdded( QString _textureGroup , QString _name ,
                                          QString _filename , int _id , int& _textureId ) {};
405

Dirk Wilden's avatar
Dirk Wilden committed
406 407 408 409 410 411 412
      /** \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
       */
413
      virtual void slotSetTextureMode(QString _textureName ,QString _mode, int _id ) {};
Dirk Wilden's avatar
Dirk Wilden committed
414

415 416 417 418 419 420
      /** \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
       */
421
      virtual void slotTextureChangeImage( QString _textureName , QImage& _image , int _id ) {};
422 423 424 425 426 427

      /** \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
       */
428
      virtual void slotTextureChangeImage( QString _textureName , QImage& _image ) {};
429

Jan Möbius's avatar
 
Jan Möbius committed
430
      /** \brief Texturemode for texture should be changed
Jan Möbius's avatar
 
Jan Möbius committed
431
       *
Jan Möbius's avatar
 
Jan Möbius committed
432 433 434 435
       *  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
       */
436
      virtual void slotSetTextureMode(QString _textureName ,QString _mode) {};
437 438 439 440 441 442 443
      
      /** \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
       */
444
      virtual void slotTextureGetImage( QString _textureName , QImage& _image , int _id ) {};
445 446 447 448 449 450

      /** \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
       */
451
      virtual void slotTextureGetImage( QString _textureName , QImage& _image ) {};
452
      
453 454 455 456 457 458
      /** \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)
       */
459
      virtual void slotTextureIndex( QString _textureName, int _id, int& _index) {};
460
      
461 462 463 464 465 466 467
      /** \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
       */
468
      virtual void slotTextureIndexPropertyName( int _id, QString& _propertyName) {};
469
      
470 471 472 473 474 475
       /** \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
       */
476
      virtual void slotTextureName( int _id, int _textureIndex, QString& _textureName ) {};
477 478 479 480 481 482 483 484 485 486 487
      
      /** \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
       */
488
      virtual void slotTextureFilename( int _id, QString _textureName, QString& _textureFilename ) {};
489 490 491 492 493 494
      
      /** \brief get the number of textures per object
       *
       *  @param _id Id of the object
       *  @param _numTextures returns the number of textures
       */
495
      virtual void slotNumberOfTextures( int _id, int& _numTextures ) {};
496

497 498 499 500 501
       /** \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
       */
502
      virtual void slotGetCurrentTexture( int _id, QString& _textureName ) {};
503 504 505 506 507
      
       /** \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
508
       *  @param _subTextures this returns the names of all sub textures that are combined under the given multi texture
509
       */
510
      virtual void slotGetSubTextures( int _id, QString _multiTextureName, QStringList& _subTextures ) {};
Jan Möbius's avatar
 
Jan Möbius committed
511

512
   /** @} */
Jan Möbius's avatar
 
Jan Möbius committed
513 514 515
};

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

Jan Möbius's avatar
 
Jan Möbius committed
517
#endif // TEXTUREINTERFACE_HH