src/gl/partrenderer.cpp

changeset 200
ca23936b455b
parent 199
6988973515d2
child 201
5d201ee4a9c3
equal deleted inserted replaced
199:6988973515d2 200:ca23936b455b
23 #include <QMessageBox> 23 #include <QMessageBox>
24 #include <QAbstractButton> 24 #include <QAbstractButton>
25 #include "geometry.h" 25 #include "geometry.h"
26 #include "partrenderer.h" 26 #include "partrenderer.h"
27 #include "model.h" 27 #include "model.h"
28 #include "gl/compiler.h"
28 29
29 static constexpr double MIN_ZOOM = -3.0; 30 static constexpr double MIN_ZOOM = -3.0;
30 static constexpr double MAX_ZOOM = 3.0; 31 static constexpr double MAX_ZOOM = 3.0;
31 QOpenGLFunctions glfunc; 32 QOpenGLFunctions glfunc;
32 33
350 this->viewMatrix * glm::mat4_cast(this->modelQuaternion), 351 this->viewMatrix * glm::mat4_cast(this->modelQuaternion),
351 this->projectionMatrix, 352 this->projectionMatrix,
352 viewportVector); 353 viewportVector);
353 } 354 }
354 355
355 ldraw::id_t PartRenderer::pick(QPoint where) 356 ModelId PartRenderer::pick(QPoint where)
356 { 357 {
357 // y is flipped, take that into account 358 // y is flipped, take that into account
358 where.setY(this->height() - where.y()); 359 where.setY(this->height() - where.y());
359 // Since we are dealing with pixel data right from the framebuffer, its size 360 // Since we are dealing with pixel data right from the framebuffer, its size
360 // will be affected by High DPI scaling. We need to take this into account 361 // will be affected by High DPI scaling. We need to take this into account
400 } 401 }
401 402
402 /** 403 /**
403 * @return the currently highlighted object 404 * @return the currently highlighted object
404 */ 405 */
405 ldraw::id_t PartRenderer::getHighlightedObject() const 406 ModelId PartRenderer::getHighlightedObject() const
406 { 407 {
407 return this->highlighted; 408 return this->highlighted;
408 } 409 }

mercurial