Commit c2fd5e51 authored by Mike Kremer's avatar Mike Kremer

Added signal/slot to texture interface that allows plugins to fetch the...

Added signal/slot to texture interface that allows plugins to fetch the current texture index property name.

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@10207 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 5f35224c
...@@ -208,6 +208,15 @@ class TextureInterface { ...@@ -208,6 +208,15 @@ class TextureInterface {
*/ */
virtual void textureIndex( QString /*_textureName*/, int /*_id*/, int& /*_index*/) {}; virtual void textureIndex( QString /*_textureName*/, int /*_id*/, int& /*_index*/) {};
/** \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
*/
virtual void textureIndexPropertyName( int /*_id*/, QString& /*_propertyName*/) {};
/** \brief get the name of the texture with given texture index /** \brief get the name of the texture with given texture index
* *
* When using multiTexturing you can retrieve the texture index of a face with 'mesh.texture_index(Handle)' * When using multiTexturing you can retrieve the texture index of a face with 'mesh.texture_index(Handle)'
...@@ -386,6 +395,15 @@ class TextureInterface { ...@@ -386,6 +395,15 @@ class TextureInterface {
*/ */
virtual void slotTextureIndex( QString /*_textureName*/, int /*_id*/, int& /*_index*/) {}; virtual void slotTextureIndex( QString /*_textureName*/, int /*_id*/, int& /*_index*/) {};
/** \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
*/
virtual void slotTextureIndexPropertyName( int /*_id*/, QString& /*_propertyName*/) {};
/** \brief get the name of the texture with given texture index /** \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 _id Id of the object where the texture should be fetched from
......
...@@ -235,6 +235,9 @@ signals: ...@@ -235,6 +235,9 @@ signals:
/// get the texture index /// get the texture index
void textureIndex( QString _textureName, int _id, int& _index); void textureIndex( QString _textureName, int _id, int& _index);
/// get the texture index property name
void textureIndexPropertyName( int _id, QString& _propertyName);
/// get the texture name /// get the texture name
void textureName( int _id, int _textureIndex, QString& _textureName); void textureName( int _id, int _textureIndex, QString& _textureName);
...@@ -384,6 +387,9 @@ signals: ...@@ -384,6 +387,9 @@ signals:
///Called by plugins if texture index should be fetched ///Called by plugins if texture index should be fetched
void slotTextureIndex( QString _textureName, int _id, int& _index); void slotTextureIndex( QString _textureName, int _id, int& _index);
///Called by plugins if texture index property name should be fetched
void slotTextureIndexPropertyName( int _id, QString& _propertyName);
///Called by plugins if texture name should be fetched ///Called by plugins if texture name should be fetched
void slotTextureName( int _id, int _textureIndex, QString& _textureName); void slotTextureName( int _id, int _textureIndex, QString& _textureName);
......
...@@ -313,6 +313,12 @@ void Core::slotTextureIndex( QString _textureName, int _id, int& _index){ ...@@ -313,6 +313,12 @@ void Core::slotTextureIndex( QString _textureName, int _id, int& _index){
emit textureIndex( _textureName, _id, _index); emit textureIndex( _textureName, _id, _index);
} }
/** Called by plugins if texture index property name should be fetched
*/
void Core::slotTextureIndexPropertyName( int _id, QString& _propertyName){
emit textureIndexPropertyName( _id, _propertyName);
}
/** Called by plugins if texture name should be fetched /** Called by plugins if texture name should be fetched
*/ */
void Core::slotTextureName( int _id, int _textureIndex, QString& _textureName){ void Core::slotTextureName( int _id, int _textureIndex, QString& _textureName){
......
...@@ -1030,6 +1030,14 @@ void Core::loadPlugin(QString filename, bool silent, QObject* _plugin){ ...@@ -1030,6 +1030,14 @@ void Core::loadPlugin(QString filename, bool silent, QObject* _plugin){
connect(this , SIGNAL(textureIndex(QString,int,int&)), connect(this , SIGNAL(textureIndex(QString,int,int&)),
plugin , SLOT(slotTextureIndex(QString,int,int&)),Qt::DirectConnection); plugin , SLOT(slotTextureIndex(QString,int,int&)),Qt::DirectConnection);
if ( checkSignal( plugin , "textureIndexPropertyName(int,QString&)" ) )
connect(plugin , SIGNAL(textureIndexPropertyName(int,QString&)),
this , SLOT(slotTextureIndexPropertyName(int,QString&)),Qt::DirectConnection);
if ( checkSlot( plugin , "slotTextureIndexPropertyName(int,QString&)" ) )
connect(this , SIGNAL(textureIndexPropertyName(int,QString&)),
plugin , SLOT(slotTextureIndexPropertyName(int,QString&)),Qt::DirectConnection);
if ( checkSignal( plugin , "textureName(int,int,QString&)" ) ) if ( checkSignal( plugin , "textureName(int,int,QString&)" ) )
connect(plugin , SIGNAL(textureName(int,int,QString&)), connect(plugin , SIGNAL(textureName(int,int,QString&)),
this , SLOT(slotTextureName(int,int,QString&)),Qt::DirectConnection); this , SLOT(slotTextureName(int,int,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