src/gl/partrenderer.cpp

changeset 309
d862721d19a3
parent 291
42b4953dff85
child 311
fab454611f9b
equal deleted inserted replaced
308:daa8770b9d26 309:d862721d19a3
430 this->viewMatrix * this->modelMatrix, 430 this->viewMatrix * this->modelMatrix,
431 this->projectionMatrix, 431 this->projectionMatrix,
432 viewportVector); 432 viewportVector);
433 } 433 }
434 434
435 ModelId PartRenderer::pick(QPoint where) 435 ElementId PartRenderer::pick(QPoint where)
436 { 436 {
437 // y is flipped, take that into account 437 // y is flipped, take that into account
438 where.setY(this->height() - where.y()); 438 where.setY(this->height() - where.y());
439 // Since we are dealing with pixel data right from the framebuffer, its size 439 // Since we are dealing with pixel data right from the framebuffer, its size
440 // will be affected by High DPI scaling. We need to take this into account 440 // will be affected by High DPI scaling. We need to take this into account
487 ModelId PartRenderer::getHighlightedObject() const 487 ModelId PartRenderer::getHighlightedObject() const
488 { 488 {
489 return this->highlighted; 489 return this->highlighted;
490 } 490 }
491 491
492 void PartRenderer::setSelection(const QSet<ModelId>& selection) 492 void PartRenderer::setSelection(const QSet<ElementId>& selection)
493 { 493 {
494 Q_ASSERT(not selection.contains({0})); 494 Q_ASSERT(not selection.contains({0}));
495 gl::setModelShaderSelectedObjects(&this->shaders, selection); 495 gl::setModelShaderSelectedObjects(&this->shaders, selection);
496 this->update(); 496 this->update();
497 } 497 }

mercurial