Commit aabbb167 authored by Jan Möbius's avatar Jan Möbius
Browse files

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 fe7b21a5
...@@ -156,6 +156,21 @@ class TextureInterface { ...@@ -156,6 +156,21 @@ class TextureInterface {
*/ */
virtual void setTextureMode(QString /*_textureName*/ ,QString /*_mode*/, int /*_id*/ ) {}; 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 : private slots :
/** \brief update the texture with the given Name ( if this plugin provides this texture ) for all meshes /** \brief update the texture with the given Name ( if this plugin provides this texture ) for all meshes
* *
...@@ -249,6 +264,21 @@ class TextureInterface { ...@@ -249,6 +264,21 @@ class TextureInterface {
*/ */
virtual void slotSetTextureMode(QString /*_textureName*/ ,QString /*_mode*/, int /*_id*/ ) {}; 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 /** \brief Texturemode for texture should be changed
* *
* A plugin has updated the Texture settings for a texture * A plugin has updated the Texture settings for a texture
......
...@@ -182,6 +182,12 @@ signals: ...@@ -182,6 +182,12 @@ signals:
/// Switch Texture Plugins to a given Mode /// Switch Texture Plugins to a given Mode
void switchTexture( QString ); 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 /// If an ini File is opened, this signal is send to Plugins capable of handling ini files
void iniLoad( INIFile&, int ); void iniLoad( INIFile&, int );
...@@ -276,6 +282,12 @@ signals: ...@@ -276,6 +282,12 @@ signals:
/// Tells Plugins to switch to the given Texture /// Tells Plugins to switch to the given Texture
void slotSwitchTexture( QString _textureName ); 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 /// Called if a backup is requested by the plugins
void backupRequest( int _id , QString _name ); void backupRequest( int _id , QString _name );
......
...@@ -259,6 +259,19 @@ void Core::slotSwitchTexture( QString _textureName ) { ...@@ -259,6 +259,19 @@ void Core::slotSwitchTexture( QString _textureName ) {
emit switchTexture(_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 ============================ // === Backup Communication ============================
//======================================================================================== //========================================================================================
......
...@@ -856,6 +856,24 @@ void Core::loadPlugin(QString filename, bool silent){ ...@@ -856,6 +856,24 @@ void Core::loadPlugin(QString filename, bool silent){
connect(this , SIGNAL(switchTexture(QString )), connect(this , SIGNAL(switchTexture(QString )),
plugin , SLOT(slotSwitchTexture(QString )),Qt::DirectConnection); 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&)" ) ) if ( checkSignal( plugin , "addMultiTexture(QString,QString,QString,int,int&)" ) )
connect(plugin , SIGNAL(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); this , SLOT(slotMultiTextureAdded(QString,QString,QString,int,int&) ),Qt::DirectConnection);
......
<?xml version = '1.0' encoding = 'UTF-8'?> <?xml version = '1.0' encoding = 'UTF-8'?>
<!DOCTYPE KDevPrjSession> <!DOCTYPE KDevPrjSession>
<KDevPrjSession> <KDevPrjSession>
<DocsAndViews NumberOfDocuments="1" > <DocsAndViews NumberOfDocuments="6" >
<Doc0 NumberOfViews="1" URL="file:///data/home1/moebius/projects/OpenFlipper/Plugin-Scissor/ScissorPlugin.hh" > <Doc0 NumberOfViews="1" URL="file:///data/home1/moebius/projects/OpenFlipper/OpenFlipper/widgets/glWidget/QtBaseViewer.cc" >
<View0 Encoding="" line="56" Type="Source" /> <View0 Encoding="" line="52" Type="Source" />
</Doc0> </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> </DocsAndViews>
<pluginList> <pluginList>
<kdevdebugger> <kdevdebugger>
...@@ -26,8 +41,8 @@ ...@@ -26,8 +41,8 @@
<subversion base="" /> <subversion base="" />
</kdevsubversion> </kdevsubversion>
<kdevvalgrind> <kdevvalgrind>
<executable path="" params="" /> <executable path="/data/home1/moebius/projects/OpenFlipper/build-debug/Build/bin/OpenFlipper" params="" />
<valgrind path="" params="" /> <valgrind path="/usr/bin/valgrind" params=" --tool=memcheck --leak-check=yes" />
<calltree path="" params="" /> <calltree path="" params="" />
<kcachegrind path="" /> <kcachegrind path="" />
</kdevvalgrind> </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