Commit fe5481db authored by Jan Möbius's avatar Jan Möbius

Extended textureControl Interface to directly exchange the texture image

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@5996 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 4e9ee87d
......@@ -156,6 +156,21 @@ class TextureInterface {
*/
virtual void setTextureMode(QString /*_textureName*/ ,QString /*_mode*/, int /*_id*/ ) {};
/** \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
*/
virtual void textureChangeImage( QString /*_textureName*/ , QImage& /*_image*/ , int /*_id*/ ) {};
/** \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
*/
virtual void textureChangeImage( QString /*_textureName*/ , QImage& /*_image*/ ) {};
private slots :
/** \brief update the texture with the given Name ( if this plugin provides this texture ) for all meshes
*
......@@ -249,6 +264,21 @@ class TextureInterface {
*/
virtual void slotSetTextureMode(QString /*_textureName*/ ,QString /*_mode*/, int /*_id*/ ) {};
/** \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
*/
virtual void slotTextureChangeImage( QString /*_textureName*/ , QImage& /*_image*/ , int /*_id*/ ) {};
/** \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
*/
virtual void slotTextureChangeImage( QString /*_textureName*/ , QImage& /*_image*/ ) {};
/** \brief Texturemode for texture should be changed
*
* A plugin has updated the Texture settings for a texture
......
......@@ -182,6 +182,12 @@ signals:
/// Switch Texture Plugins to a given Mode
void switchTexture( QString );
/// Change the image for a given texture
void textureChangeImage( QString _textureName , QImage& _image );
/// Change the image for a given texture
void textureChangeImage( QString _textureName , QImage& _image , int _id );
/// If an ini File is opened, this signal is send to Plugins capable of handling ini files
void iniLoad( INIFile&, int );
......@@ -276,6 +282,12 @@ signals:
/// Tells Plugins to switch to the given Texture
void slotSwitchTexture( QString _textureName );
///Called by plugins if texture image should be changed
void slotTextureChangeImage( QString _textureName , QImage& _image );
///Called by plugins if texture image should be changed
void slotTextureChangeImage( QString _textureName , QImage& _image , int _id );
/// Called if a backup is requested by the plugins
void backupRequest( int _id , QString _name );
......
......@@ -259,6 +259,19 @@ void Core::slotSwitchTexture( QString _textureName ) {
emit switchTexture(_textureName);
}
/** Called by plugins if texture image should be changed
*/
void Core::slotTextureChangeImage( QString _textureName , QImage& _image ) {
emit textureChangeImage( _textureName ,_image );
}
/** Called by plugins if texture image should be changed
*/
void Core::slotTextureChangeImage( QString _textureName , QImage& _image , int _id ) {
emit textureChangeImage( _textureName , _image , _id );
}
//========================================================================================
// === Backup Communication ============================
//========================================================================================
......
......@@ -856,6 +856,24 @@ void Core::loadPlugin(QString filename, bool silent){
connect(this , SIGNAL(switchTexture(QString )),
plugin , SLOT(slotSwitchTexture(QString )),Qt::DirectConnection);
if ( checkSignal( plugin , "textureChangeImage(QString,QImage&,int)" ) )
connect(this , SIGNAL(textureChangeImage(QString,QImage&,int)),
plugin , SLOT(slotTextureChangeImage(QString,QImage&,int)),Qt::DirectConnection);
if ( checkSlot( plugin , "slotTextureChangeImage(QString,QImage&,int)" ) )
connect(this , SIGNAL(textureChangeImage(QString,QImage&,int)),
plugin , SLOT(slotTextureChangeImage(QString,QImage&,int)),Qt::DirectConnection);
if ( checkSignal( plugin , "textureChangeImage(QString,QImage&)" ) )
connect(this , SIGNAL(textureChangeImage(QString,QImage&)),
plugin , SLOT(slotTextureChangeImage(QString,QImage&)),Qt::DirectConnection);
if ( checkSlot( plugin , "slotTextureChangeImage(QString,QImage&)" ) )
connect(this , SIGNAL(textureChangeImage(QString,QImage&)),
plugin , SLOT(slotTextureChangeImage(QString,QImage&)),Qt::DirectConnection);
if ( checkSignal( plugin , "addMultiTexture(QString,QString,QString,int,int&)" ) )
connect(plugin , SIGNAL(addMultiTexture(QString,QString,QString,int,int&) ),
this , SLOT(slotMultiTextureAdded(QString,QString,QString,int,int&) ),Qt::DirectConnection);
......
<?xml version = '1.0' encoding = 'UTF-8'?>
<!DOCTYPE KDevPrjSession>
<KDevPrjSession>
<DocsAndViews NumberOfDocuments="1" >
<Doc0 NumberOfViews="1" URL="file:///data/home1/moebius/projects/OpenFlipper/Plugin-Scissor/ScissorPlugin.hh" >
<View0 Encoding="" line="56" Type="Source" />
<DocsAndViews NumberOfDocuments="6" >
<Doc0 NumberOfViews="1" URL="file:///data/home1/moebius/projects/OpenFlipper/OpenFlipper/widgets/glWidget/QtBaseViewer.cc" >
<View0 Encoding="" line="52" Type="Source" />
</Doc0>
<Doc1 NumberOfViews="1" URL="file:///data/home1/moebius/projects/OpenFlipper/OpenFlipper/widgets/coreWidget/CoreWidget.cc" >
<View0 Encoding="" line="93" Type="Source" />
</Doc1>
<Doc2 NumberOfViews="1" URL="file:///data/home1/moebius/projects/OpenFlipper/Plugin-Merge/MergePlugin.hh" >
<View0 Encoding="" line="0" Type="Source" />
</Doc2>
<Doc3 NumberOfViews="1" URL="file:///data/home1/moebius/projects/OpenFlipper/Plugin-Merge/MergePluginT.cc" >
<View0 Encoding="" line="357" Type="Source" />
</Doc3>
<Doc4 NumberOfViews="1" URL="file:///data/home1/moebius/projects/OpenFlipper/OpenFlipper/widgets/coreWidget/keyHandling.cc" >
<View0 Encoding="" line="164" Type="Source" />
</Doc4>
<Doc5 NumberOfViews="1" URL="file:///data/home1/moebius/projects/OpenFlipper/Plugin-TextureControl/TextureData.cc" >
<View0 Encoding="" line="61" Type="Source" />
</Doc5>
</DocsAndViews>
<pluginList>
<kdevdebugger>
......@@ -26,8 +41,8 @@
<subversion base="" />
</kdevsubversion>
<kdevvalgrind>
<executable path="" params="" />
<valgrind path="" params="" />
<executable path="/data/home1/moebius/projects/OpenFlipper/build-debug/Build/bin/OpenFlipper" params="" />
<valgrind path="/usr/bin/valgrind" params=" --tool=memcheck --leak-check=yes" />
<calltree path="" params="" />
<kcachegrind path="" />
</kdevvalgrind>
......
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