src/mainwindow.cpp

changeset 1113
5f3139c802bf
parent 1103
ac7db4c076c3
child 1114
ffd49a28f49e
equal deleted inserted replaced
1112:d1d8be74275b 1113:5f3139c802bf
278 // Ensure that the current grid - and only the current grid - is selected. 278 // Ensure that the current grid - and only the current grid - is selected.
279 int grid = m_config.grid(); 279 int grid = m_config.grid();
280 ui.actionGridCoarse->setChecked (grid == Grid::Coarse); 280 ui.actionGridCoarse->setChecked (grid == Grid::Coarse);
281 ui.actionGridMedium->setChecked (grid == Grid::Medium); 281 ui.actionGridMedium->setChecked (grid == Grid::Medium);
282 ui.actionGridFine->setChecked (grid == Grid::Fine); 282 ui.actionGridFine->setChecked (grid == Grid::Fine);
283 283 emit gridChanged();
284 // Recompile all Bézier curves, the changing grid affects their precision.
285 for (LDObjectIterator<LDBezierCurve> it (m_currentDocument); it.isValid(); ++it)
286 renderer()->compileObject (it);
287 } 284 }
288 285
289 // --------------------------------------------------------------------------------------------------------------------- 286 // ---------------------------------------------------------------------------------------------------------------------
290 // 287 //
291 void MainWindow::updateTitle() 288 void MainWindow::updateTitle()
435 } 432 }
436 433
437 // The select() method calls may have selected additional items (i.e. invertnexts) 434 // The select() method calls may have selected additional items (i.e. invertnexts)
438 // Update it all now. 435 // Update it all now.
439 updateSelection(); 436 updateSelection();
440
441 // Update the GL renderer
442 for (LDObject* obj : priorSelection + selectedObjects())
443 renderer()->compileObject (obj);
444
445 renderer()->update(); 437 renderer()->update();
446 } 438 }
447 439
448 // --------------------------------------------------------------------------------------------------------------------- 440 // ---------------------------------------------------------------------------------------------------------------------
449 // 441 //
476 { 468 {
477 if (not obj->isColored()) 469 if (not obj->isColored())
478 continue; // uncolored object 470 continue; // uncolored object
479 471
480 obj->setColor (color); 472 obj->setColor (color);
481 renderer()->compileObject (obj);
482 } 473 }
483 474
484 endAction(); 475 endAction();
485 refresh(); 476 refresh();
486 } 477 }
503 // --------------------------------------------------------------------------------------------------------------------- 494 // ---------------------------------------------------------------------------------------------------------------------
504 // 495 //
505 void MainWindow::doFullRefresh() 496 void MainWindow::doFullRefresh()
506 { 497 {
507 buildObjectList(); 498 buildObjectList();
508 renderer()->hardRefresh(); 499 renderer()->update();
509 } 500 }
510 501
511 // --------------------------------------------------------------------------------------------------------------------- 502 // ---------------------------------------------------------------------------------------------------------------------
512 // 503 //
513 // Builds the object list and tells the GL renderer to do a soft update. 504 // Builds the object list and tells the GL renderer to do a soft update.
1145 { 1136 {
1146 if (document->isFrozen()) 1137 if (document->isFrozen())
1147 { 1138 {
1148 document->setFrozen(false); 1139 document->setFrozen(false);
1149 print ("Opened %1", document->name()); 1140 print ("Opened %1", document->name());
1150 1141 getRendererForDocument(document);
1151 // Cache files are not compiled by the GL renderer. Now that this file is open for editing, it needs to be compiled.
1152 getRendererForDocument(document)->compiler()->compileModel(document);
1153 updateDocumentList(); 1142 updateDocumentList();
1154 } 1143 }
1155 } 1144 }
1156 1145
1157 // --------------------------------------------------------------------------------------------------------------------- 1146 // ---------------------------------------------------------------------------------------------------------------------

mercurial