Commit 99cf943e authored by Dirk Wilden's avatar Dirk Wilden

updated textureInterface so that we are able to save textures

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@8922 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 071b0b99
......@@ -185,6 +185,36 @@ class TextureInterface {
*/
virtual void textureChangeImage( QString /*_textureName*/ , QImage& /*_image*/ ) {};
/** \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
*/
virtual void textureGetImage( QString /*_textureName*/ , QImage& /*_image*/ , int /*_id*/ ) {};
/** \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
*/
virtual void textureGetImage( QString /*_textureName*/ , QImage& /*_image*/ ) {};
/** \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
*/
virtual void getCurrentTexture( int /*_id*/, QString& /*_textureName*/ ) {};
/** \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
* @param _textureName this returns the names of all sub textures that are combined under the given multi texture
*/
virtual void getSubTextures( int /*_id*/, QString /*_multiTextureName*/, QStringList& /*_subTextures*/ ) {};
private slots :
/** \brief update the texture with the given Name ( if this plugin provides this texture ) for all meshes
*
......@@ -300,6 +330,36 @@ class TextureInterface {
* @param _mode New mode flags for the given texture
*/
virtual void slotSetTextureMode(QString /*_textureName*/ ,QString /*_mode*/) {};
/** \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
*/
virtual void slotTextureGetImage( QString /*_textureName*/ , QImage& /*_image*/ , int /*_id*/ ) {};
/** \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
*/
virtual void slotTextureGetImage( QString /*_textureName*/ , QImage& /*_image*/ ) {};
/** \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
*/
virtual void slotGetCurrentTexture( int /*_id*/, QString& /*_textureName*/ ) {};
/** \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
* @param _textureName this returns the names of all sub textures that are combined under the given multi texture
*/
virtual void slotGetSubTextures( int /*_id*/, QString /*_multiTextureName*/, QStringList& /*_subTextures*/ ) {};
/** @} */
};
......
......@@ -220,6 +220,18 @@ signals:
/// Change the image for a given texture
void textureChangeImage( QString _textureName , QImage& _image , int _id );
///fetch texture image
void textureGetImage( QString _textureName , QImage& _image );
///fetch texture image
void textureGetImage( QString _textureName , QImage& _image , int _id );
///get current texture
void getCurrentTexture( int _id, QString& _textureName );
/// get a multi-texture's sub textures
void getSubTextures( int _id, QString _multiTextureName, QStringList& _subTextures );
/// If an ini File is opened, this signal is send to Plugins capable of handling ini files
void iniLoad( INIFile&, int );
......@@ -323,6 +335,18 @@ signals:
///Called by plugins if texture image should be changed
void slotTextureChangeImage( QString _textureName , QImage& _image , int _id );
///Called by plugins if texture image should be fetched
void slotTextureGetImage( QString _textureName , QImage& _image );
///Called by plugins if texture image should be fetched
void slotTextureGetImage( QString _textureName , QImage& _image , int _id );
///Called by plugins if current texture should be retrieved
void slotGetCurrentTexture( int _id, QString& _textureName );
///Called by plugins if a multi-texture's sub textures should be fetched
void slotGetSubTextures( int _id, QString _multiTextureName, QStringList& _subTextures );
/// Called if a backup is requested by the plugins
void backupRequest( int _id , QString _name );
......
......@@ -294,6 +294,30 @@ void Core::slotTextureChangeImage( QString _textureName , QImage& _image , int _
emit textureChangeImage( _textureName , _image , _id );
}
/** Called by plugins if texture image should be fetched
*/
void Core::slotTextureGetImage( QString _textureName , QImage& _image ) {
emit textureGetImage( _textureName ,_image );
}
/** Called by plugins if texture image should be fetched
*/
void Core::slotTextureGetImage( QString _textureName , QImage& _image , int _id ) {
emit textureGetImage( _textureName , _image , _id );
}
/** Called by plugins if current texture name should be returned
*/
void Core::slotGetCurrentTexture( int _id, QString& _textureName ){
emit getCurrentTexture( _id, _textureName );
}
/** Called by plugins if texture image should be fetched
*/
void Core::slotGetSubTextures( int _id, QString _multiTextureName, QStringList& _subTextures ){
emit getSubTextures( _id, _multiTextureName, _subTextures );
}
//========================================================================================
// === Backup Communication ============================
//========================================================================================
......
......@@ -999,8 +999,39 @@ void Core::loadPlugin(QString filename, bool silent, QObject* _plugin){
connect(this , SIGNAL(addMultiTexture(QString,QString,QString,int,int&) ),
plugin , SLOT(slotMultiTextureAdded( QString,QString,QString,int,int&) ),Qt::DirectConnection);
}
if ( checkSignal( plugin , "textureGetImage(QString,QImage&,int)" ) )
connect(plugin , SIGNAL(textureGetImage(QString,QImage&,int)),
this , SLOT(slotTextureGetImage(QString,QImage&,int)),Qt::DirectConnection);
if ( checkSlot( plugin , "slotTextureGetImage(QString,QImage&,int)" ) )
connect(this , SIGNAL(textureGetImage(QString,QImage&,int)),
plugin , SLOT(slotTextureGetImage(QString,QImage&,int)),Qt::DirectConnection);
if ( checkSignal( plugin , "textureGetImage(QString,QImage&)" ) )
connect(plugin , SIGNAL(textureGetImage(QString,QImage&)),
this , SLOT(slotTextureGetImage(QString,QImage&)),Qt::DirectConnection);
if ( checkSlot( plugin , "slotTextureGetImage(QString,QImage&)" ) )
connect(this , SIGNAL(textureGetImage(QString,QImage&)),
plugin , SLOT(slotTextureGetImage(QString,QImage&)),Qt::DirectConnection);
if ( checkSignal( plugin , "getCurrentTexture(int,QString&)" ) )
connect(plugin , SIGNAL(getCurrentTexture(int,QString&)),
this , SLOT(slotGetCurrentTexture(int,QString&)),Qt::DirectConnection);
if ( checkSlot( plugin , "slotGetCurrentTexture(int,QString&)" ) )
connect(this , SIGNAL(getCurrentTexture(int,QString&)),
plugin , SLOT(slotGetCurrentTexture(int,QString&)),Qt::DirectConnection);
if ( checkSignal( plugin , "getSubTextures(int,QString,QStringList&)" ) )
connect(plugin , SIGNAL(getSubTextures(int,QString,QStringList&)),
this , SLOT(slotGetSubTextures(int,QString,QStringList&)),Qt::DirectConnection);
if ( checkSlot( plugin , "slotGetSubTextures(int,QString,QStringList&)" ) )
connect(this , SIGNAL(getSubTextures(int,QString,QStringList&)),
plugin , SLOT(slotGetSubTextures(int,QString,QStringList&)),Qt::DirectConnection);
}
//Check if the plugin supports Backup-Interface
BackupInterface* backupPlugin = qobject_cast< BackupInterface * >(plugin);
if ( backupPlugin ) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment