performance enhancements
memory enhancements prevent starting sensors more than once fix for wifi lag issues map scaling for huge buildings
This commit is contained in:
@@ -108,14 +108,26 @@ void MapView3D::initializeGL() {
|
||||
glEnable(GL_DEPTH_TEST);
|
||||
glEnable(GL_CULL_FACE);
|
||||
|
||||
// start background update timer
|
||||
timer.start(Settings::MapView::msPerFrame.ms(), this);
|
||||
|
||||
// OpenGL is now initialized
|
||||
isGLInitialized = true;
|
||||
|
||||
}
|
||||
|
||||
void MapView3D::setVisible(bool visible) {
|
||||
|
||||
// inform parent
|
||||
QOpenGLWidget::setVisible(visible);
|
||||
|
||||
if (!visible) {
|
||||
// stop background update timer
|
||||
timer.stop();
|
||||
} else {
|
||||
// start background update timer
|
||||
timer.start(Settings::MapView3D::msPerFrame.ms(), this);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void MapView3D::paintGL() {
|
||||
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
||||
draw();
|
||||
|
||||
@@ -140,6 +140,8 @@ public:
|
||||
|
||||
void toggleRenderMode();
|
||||
|
||||
void setVisible(bool visible) override;
|
||||
|
||||
public slots:
|
||||
|
||||
void mousePressEvent(QMouseEvent*);
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
//#include "../gl/GLTriangles.h"
|
||||
#include "../Renderable.h"
|
||||
|
||||
#include "../../../../Settings.h"
|
||||
#include "../../../../nav/Node.h"
|
||||
|
||||
class ColorPoints : public Renderable {
|
||||
@@ -31,6 +32,9 @@ public:
|
||||
|
||||
points.clear();
|
||||
|
||||
// do not display?
|
||||
if (grid->getNumNodes() > Settings::MapView3D::maxColorPoints) {return;}
|
||||
|
||||
float min = +INFINITY;
|
||||
float max = -INFINITY;
|
||||
|
||||
@@ -62,6 +66,9 @@ public:
|
||||
|
||||
points.clear();
|
||||
|
||||
// do not display?
|
||||
if (particles.size() > Settings::MapView3D::maxColorPoints) {return;}
|
||||
|
||||
// group particles by grid-point
|
||||
std::unordered_map<GridPoint, float> weights;
|
||||
for (const K::Particle<T>& p : particles) {
|
||||
|
||||
Reference in New Issue
Block a user