Commit 064af1b7 authored by Dirk Wilden's avatar Dirk Wilden

updated TextureInterface

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@5646 383ad7c9-94d9-4d36-a494-682f7c89f535
parent dd296385
......@@ -94,11 +94,13 @@ class TextureInterface {
*/
virtual void updatedTextures( QString , int ) {};
/** \brief emit this signal if you want to switch the viewer to a specific texture mode
*
* Give the name of the texture and the id of the object or -1 if all objects were update
*/
virtual void switchTexture( QString ) {};
/** \brief emit this signal if you want to switch the texture of a specific object
*/
virtual void switchTexture( QString /*_textureName*/ , int /*_id*/ ) {};
/** \brief emit this signal if you want to switch the global texture
*/
virtual void switchTexture( QString /*_textureName*/ ) {};
/** \brief emit this signal if you want to set a special mode for this texture (Clamping,...)
*
......@@ -123,6 +125,16 @@ class TextureInterface {
*/
virtual void setTextureMode(QString /*_textureName*/ ,QString /*_mode*/) {};
/** \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)
*
* @param _textureName Name of your Texture
* @param _mode colon seperated String describing your settings (e.g. clamp,abs )
* @param _id id of an object
*/
virtual void setTextureMode(QString /*_textureName*/ ,QString /*_mode*/, int /*_id*/ ) {};
private slots :
/** \brief update the texture with the given Name ( if this plugin provides this texture ) for all meshes
* @param _textureName Name of the Texture to be updated
......@@ -163,6 +175,15 @@ class TextureInterface {
*/
virtual void slotTextureUpdated( QString /*_textureName*/ , int /*_identifier*/ ) {};
/** \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
*/
virtual void slotSetTextureMode(QString /*_textureName*/ ,QString /*_mode*/, int /*_id*/ ) {};
/** \brief Texturemode for texture should be changed
*
* A plugin has updated the Texture settings for a texture
......@@ -171,6 +192,13 @@ class TextureInterface {
*/
virtual void slotSetTextureMode(QString /*_textureName*/ ,QString /*_mode*/) {};
/** \brief This slot is called when a plugin requests to switch an objects texture
*
* @param _textureName Name of the Texture
* @param _id id of an object
*/
virtual void slotSwitchTexture( QString /*_textureName*/, int /*_id*/ ) {};
/** \brief This slot is called when a plugin requests to switch to a different texture mode
*
* @param _textureName Name of the Texture
......
......@@ -152,6 +152,9 @@ signals:
/// This signal is emitted if the object has been changed (source/target)
void objectSelectionChanged( int );
/// The texture with the given name and filename has been added
void addTexture( QString, QString , uint, int );
/// The texture with the given name and filename has been added
void addTexture( QString, QString , uint );
......@@ -164,9 +167,15 @@ signals:
/// This Signal is send to the plugins if a texture has been updated
void updatedTextures( QString , int );
/// A texture mode should be changed
void setTextureMode(QString _textureName ,QString _mode, int _id);
/// A texture mode should be changed
void setTextureMode(QString _textureName ,QString _mode);
/// Switch Texture Plugins to a given Mode
void switchTexture( QString, int );
/// Switch Texture Plugins to a given Mode
void switchTexture( QString );
......@@ -234,6 +243,9 @@ signals:
/// Add a new and invisible picking mode to the examiner_widget_
void slotAddHiddenPickMode( const std::string _mode );
/// Called by a plugin if it creates a texture
void slotAddTexture( QString _textureName , QString _filename , uint _dimension , int _id );
/// Called by a plugin if it creates a texture
void slotAddTexture( QString _textureName , QString _filename , uint _dimension );
......@@ -246,9 +258,15 @@ signals:
/// A Texture has been updated
void slotTextureUpdated( QString _textureName , int _identifier );
/// A texture mode should be changed
void slotSetTextureMode(QString _textureName ,QString _mode, int _id);
/// A texture mode should be changed
void slotSetTextureMode(QString _textureName ,QString _mode);
/// Tells Plugins to switch to the given Texture
void slotSwitchTexture( QString _textureName, int _id );
/// Tells Plugins to switch to the given Texture
void slotSwitchTexture( QString _textureName );
......
......@@ -155,6 +155,13 @@ void Core::slotObjectPropertiesChanged( int _id )
//========================================================================================
/** Called by a plugin if it created a texture. The information is passed to all plugins. If a texture control plugin is available it has to react on the signal.\n
* See in the documentation of the texture plugin interfaces for further detail.
*/
void Core::slotAddTexture( QString _textureName , QString _filename, uint _dimension, int _id) {
emit addTexture(_textureName , _filename,_dimension,_id);
}
/** Called by a plugin if it created a texture. The information is passed to all plugins. If a texture control plugin is available it has to react on the signal.\n
* See in the documentation of the texture plugin interfaces for further detail.
*/
......@@ -186,6 +193,23 @@ void Core::slotUpdateAllTextures( ){
emit updateAllTextures();
}
/** Called by a plugin if the parameters of a texture should be changed. The information is passed to all plugins. A Texturecontrol plugin should react on this event.\n
* See in the documentation of the texture plugin interfaces for further detail.
*/
void Core::slotSetTextureMode(QString _textureName, QString _mode, int _id) {
if ( OpenFlipper::Options::doSlotDebugging() ) {
if ( sender() != 0 ) {
if ( sender()->metaObject() != 0 ) {
emit log(LOGINFO,"slotSetTextureMode( " + _textureName + " , " + _mode + " , " + QString::number(_id) + " ) called by " +
QString( sender()->metaObject()->className() ) );
}
}
}
emit setTextureMode(_textureName,_mode,_id);
}
/** Called by a plugin if the parameters of a texture should be changed. The information is passed to all plugins. A Texturecontrol plugin should react on this event.\n
* See in the documentation of the texture plugin interfaces for further detail.
*/
......@@ -218,6 +242,12 @@ void Core::slotTextureUpdated( QString _textureName , int _identifier ) {
emit updatedTextures(_textureName,_identifier);
}
/** Called by plugins if texture mode should be switched
*/
void Core::slotSwitchTexture( QString _textureName, int _id ) {
emit switchTexture(_textureName, _id);
}
/** Called by plugins if texture mode should be switched
*/
void Core::slotSwitchTexture( QString _textureName ) {
......
......@@ -804,6 +804,14 @@ void Core::loadPlugin(QString filename, bool silent){
if ( texturePlugin && OpenFlipper::Options::gui() ) {
supported = supported + "Textures ";
if ( checkSignal(plugin,"addTexture(QString,QString,uint,int)") )
connect(plugin , SIGNAL(addTexture( QString , QString , uint , int )),
this , SLOT(slotAddTexture(QString, QString, uint, int)),Qt::DirectConnection);
if ( checkSlot( plugin , "slotTextureAdded(QString,QString,uint,int)" ) )
connect(this , SIGNAL(addTexture(QString,QString, uint, int)),
plugin , SLOT(slotTextureAdded(QString,QString, uint, int)),Qt::DirectConnection);
if ( checkSignal(plugin,"addTexture(QString,QString,uint)") )
connect(plugin , SIGNAL(addTexture( QString , QString , uint )),
this , SLOT(slotAddTexture(QString, QString, uint)),Qt::DirectConnection);
......@@ -836,6 +844,14 @@ void Core::loadPlugin(QString filename, bool silent){
connect(this , SIGNAL(updatedTextures( QString , int )),
plugin , SLOT(slotTextureUpdated( QString, int ) ));
if ( checkSignal(plugin,"setTextureMode(QString,QString,int)") )
connect(plugin , SIGNAL(setTextureMode(QString, QString, int )),
this , SLOT(slotSetTextureMode(QString, QString, int )),Qt::DirectConnection );
if ( checkSlot( plugin , "slotSetTextureMode(QString,QString,int)" ) )
connect(this , SIGNAL(setTextureMode(QString, QString, int )),
plugin , SLOT(slotSetTextureMode(QString, QString, int )),Qt::DirectConnection );
if ( checkSignal(plugin,"setTextureMode(QString,QString)") )
connect(plugin , SIGNAL(setTextureMode(QString ,QString )),
this , SLOT(slotSetTextureMode(QString ,QString )),Qt::DirectConnection );
......@@ -844,6 +860,14 @@ void Core::loadPlugin(QString filename, bool silent){
connect(this , SIGNAL(setTextureMode(QString ,QString )),
plugin , SLOT(slotSetTextureMode(QString ,QString )),Qt::DirectConnection );
if ( checkSignal(plugin,"switchTexture(QString,int)") )
connect(plugin , SIGNAL(switchTexture(QString, int )),
this , SLOT(slotSwitchTexture(QString, int )),Qt::DirectConnection);
if ( checkSlot( plugin , "slotSwitchTexture(QString,int)" ) )
connect(this , SIGNAL(switchTexture(QString, int )),
plugin , SLOT(slotSwitchTexture(QString, int )),Qt::DirectConnection);
if ( checkSignal(plugin,"switchTexture(QString)") )
connect(plugin , SIGNAL(switchTexture(QString )),
this , SLOT(slotSwitchTexture(QString )),Qt::DirectConnection);
......
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