From: <jl...@us...> - 2009-07-22 12:34:37
|
Revision: 4085 http://hugin.svn.sourceforge.net/hugin/?rev=4085&view=rev Author: jlegg Date: 2009-07-22 12:34:34 +0000 (Wed, 22 Jul 2009) Log Message: ----------- Call Panorama::imageChanged for images indirectly affected by setting linked variables. Fixes updating linked lens values in the GUI. Modified Paths: -------------- hugin/branches/gsoc2009_layout/src/hugin_base/panodata/Panorama.cpp Modified: hugin/branches/gsoc2009_layout/src/hugin_base/panodata/Panorama.cpp =================================================================== --- hugin/branches/gsoc2009_layout/src/hugin_base/panodata/Panorama.cpp 2009-07-22 09:33:59 UTC (rev 4084) +++ hugin/branches/gsoc2009_layout/src/hugin_base/panodata/Panorama.cpp 2009-07-22 12:34:34 UTC (rev 4085) @@ -261,7 +261,24 @@ return; // update a single variable, and everything linked to it. state.images[imgNr].setVar(var.getName(), var.getValue()); - imageChanged(imgNr); /// @todo call imageChange on linked images too. + // call imageChanged for the images affected by this. +#define image_variable( name, type, default_value ) \ + if (PTOVariableConverterFor##name::checkApplicability(var.getName())) \ + {\ + for (std::size_t i = 0; i < getNrOfImages(); i++)\ + {\ + if (state.images[imgNr].name##isLinkedWith(state.images[i]))\ + {\ + imageChanged(i);\ + }\ + }\ + }\ + else +#include "image_variables.h" +#undef image_variable + {// this is for the final else. + DEBUG_ERROR("Unknown variable " << var.getName()); + } state.needsOptimization = true; } @@ -1110,8 +1127,17 @@ #include "image_variables.h" #undef image_variable - /// @todo make the linked images change as well. - imageChanged(imgNr); + // mark the potentially changed images. +#define image_variable( name, type, default_value ) \ + for (std::size_t i = 0; i < getNrOfImages(); i++)\ + {\ + if(state.images[imgNr].name##isLinkedWith(state.images[i]))\ + {\ + imageChanged(i);\ + }\ + } +#include "image_variables.h" +#undef image_variable } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |