src/main.cpp

changeset 352
59a31dd8a33a
parent 351
9e3c1f838406
child 353
c229d38f04c6
equal deleted inserted replaced
351:9e3c1f838406 352:59a31dd8a33a
224 menu->addAction(action); 224 menu->addAction(action);
225 } 225 }
226 } 226 }
227 227
228 template<typename Fn> 228 template<typename Fn>
229 static void forModel(const DocumentManager* documents, Fn&& fn) 229 static void forEachModel(const DocumentManager* documents, Fn&& fn)
230 { 230 {
231 forValueInMap(*documents, [&fn](const DocumentManager::ModelInfo& info) 231 forValueInMap(*documents, [&fn](const DocumentManager::ModelInfo& info)
232 { 232 {
233 ModelData* modelSpecificData = qobject_cast<ModelData*>(info.payload); 233 ModelData* modelSpecificData = qobject_cast<ModelData*>(info.payload);
234 if (modelSpecificData != nullptr) { 234 if (modelSpecificData != nullptr) {
240 static void updateRenderPreferences( 240 static void updateRenderPreferences(
241 Ui_MainWindow* ui, 241 Ui_MainWindow* ui,
242 const gl::RenderPreferences* renderPreferences, 242 const gl::RenderPreferences* renderPreferences,
243 const DocumentManager* documents) 243 const DocumentManager* documents)
244 { 244 {
245 forModel(documents, [&renderPreferences](const void*, const ModelData* data){ 245 forEachModel(documents, [&renderPreferences](const void*, const ModelData* data){
246 if (data->canvas != nullptr) { 246 if (data->canvas != nullptr) {
247 data->canvas->setRenderPreferences(*renderPreferences); 247 data->canvas->setRenderPreferences(*renderPreferences);
248 data->canvas->setLayerEnabled(data->axesLayer.get(), renderPreferences->drawAxes); 248 data->canvas->setLayerEnabled(data->axesLayer.get(), renderPreferences->drawAxes);
249 } 249 }
250 }); 250 });

mercurial