diff --git a/TextureControl.cc b/TextureControl.cc index 7b334447f9241e23740fdf4d3372ef8768a7c1b3..20331c66bcac5e9bd2a7c3c9dc2e0c2305fddaac 100644 --- a/TextureControl.cc +++ b/TextureControl.cc @@ -41,6 +41,7 @@ #include #include "OpenFlipper/BasePlugin/PluginFunctions.hh" +#include "OpenFlipper/BasePlugin/PluginFunctionsViewControls.hh" #include "OpenFlipper/common/GlobalOptions.hh" #include @@ -195,7 +196,7 @@ void TextureControlPlugin::addedEmptyObject( int _id ) { } template< typename MeshT > -void TextureControlPlugin::handleFileOpenTextures( MeshT*& _mesh , int _objectId, TextureData& _textureData ) { +void TextureControlPlugin::handleFileOpenTextures( MeshT*& _mesh , int _objectId ) { // ================================================================================ // Create a backup of the original per Vertex texture Coordinates @@ -252,7 +253,9 @@ void TextureControlPlugin::handleFileOpenTextures( MeshT*& _mesh , int _objectId for ( TriMesh::FaceIter f_it = _mesh->faces_begin(); f_it != _mesh->faces_end(); ++f_it) _mesh->property(newIndexProperty, f_it ) = newMapping[_mesh->texture_index( f_it )]; - // We use a different property for storing the IndexProperty to prevent overwriting them + // ================================================================================================= + // We use a different property for storing the IndexProperty to prevent overwriting the original one + // ================================================================================================= slotSetTextureMode("OBJ Data","indexProperty=TextureControl: OriginalFileIndexMapping", _objectId); doSwitchTexture("OBJ Data",_objectId); @@ -341,11 +344,11 @@ void TextureControlPlugin::fileOpened( int _id ) { if( obj->dataType( DATA_TRIANGLE_MESH ) ) { TriMesh* mesh = PluginFunctions::triMesh(obj); if ( mesh ) - handleFileOpenTextures(mesh,_id,*texData); + handleFileOpenTextures(mesh,_id); } else if ( obj->dataType( DATA_POLY_MESH ) ) { PolyMesh* mesh = PluginFunctions::polyMesh(obj); if ( mesh ) - handleFileOpenTextures(mesh,_id,*texData); + handleFileOpenTextures(mesh,_id); } } @@ -1057,10 +1060,11 @@ void TextureControlPlugin::switchDrawMode( TextureType _type ) { switch (_type) { case MULTITEXTURE: case HALFEDGEBASED: - PluginFunctions::setDrawMode( ACG::SceneGraph::DrawModes::SOLID_2DTEXTURED_FACE_SHADED ); + PluginFunctions::setDrawMode( ACG::SceneGraph::DrawModes::SOLID_2DTEXTURED_FACE_SHADED, PluginFunctions::ALL_VIEWERS ); + std::cerr << "A" << std::endl; break; case VERTEXBASED: - PluginFunctions::setDrawMode( ACG::SceneGraph::DrawModes::SOLID_TEXTURED_SHADED ); + PluginFunctions::setDrawMode( ACG::SceneGraph::DrawModes::SOLID_TEXTURED_SHADED , PluginFunctions::ALL_VIEWERS); break; case UNSET: emit log(LOGERR,"Switching drawmode for unknonw Texture Type!"); diff --git a/TextureControl.hh b/TextureControl.hh index 2e1ffe2a97413ece85837619b967fc86a5b5014f..61cd53a06c9596ba3d82d72973e0ada908082a03 100644 --- a/TextureControl.hh +++ b/TextureControl.hh @@ -162,7 +162,7 @@ class TextureControlPlugin : public QObject, BaseInterface, TextureInterface, Me /// Handles data stored in new opened files ( e.g. Texture Information ) template< typename MeshT > - void handleFileOpenTextures( MeshT*& _mesh , int _objectId , TextureData& _textureData ); + void handleFileOpenTextures( MeshT*& _mesh , int _objectId ); /** \brief parse texture mode settings * Parses the string _mode and changes the settings in _texture according to the string.