src/ui/canvas.cpp

changeset 198
eb9d900dc79a
parent 197
0e729e681a2c
child 200
ca23936b455b
equal deleted inserted replaced
197:0e729e681a2c 198:eb9d900dc79a
424 { 424 {
425 this->gridProgram->setGridColor(this->isDark ? Qt::white : Qt::black); 425 this->gridProgram->setGridColor(this->isDark ? Qt::white : Qt::black);
426 } 426 }
427 } 427 }
428 428
429 /**
430 * @brief Clears the selection.
431 */
432 void Canvas::clearSelection()
433 {
434 this->selection.clear();
435 gl::setModelShaderSelectedObjects(&this->shaders, this->selection);
436 Q_EMIT selectionChanged(this->selection);
437 this->update();
438 }
439
440 /**
441 * @brief Adds an object to selection.
442 * @param id ID of object to add
443 */
444 void Canvas::addToSelection(ldraw::id_t id)
445 {
446 this->selection.insert(id);
447 gl::setModelShaderSelectedObjects(&this->shaders, this->selection);
448 Q_EMIT selectionChanged(this->selection);
449 this->update();
450 }
451
452 void Canvas::setOverpaintCallback(Canvas::OverpaintCallback fn) 429 void Canvas::setOverpaintCallback(Canvas::OverpaintCallback fn)
453 { 430 {
454 this->overpaintCallback = fn; 431 this->overpaintCallback = fn;
455 } 432 }

mercurial