performance enhancements
better 2D drawing
This commit is contained in:
@@ -21,19 +21,19 @@ MapView2D::MapView2D(QWidget *parent) : QWidget(parent) {
|
||||
setFocusPolicy(Qt::StrongFocus);
|
||||
setRenderHeight(0);
|
||||
|
||||
|
||||
colorPoints = new ColorPoints2D();
|
||||
elements.push_back(colorPoints);
|
||||
elementsB.push_back(colorPoints);
|
||||
|
||||
pathToDest = new Path2D();
|
||||
pathToDest->setColor(Qt::blue);
|
||||
pathToDest->setWidth(10);
|
||||
elements.push_back(pathToDest);
|
||||
elementsB.push_back(pathToDest);
|
||||
|
||||
pathWalked = new Path2D();
|
||||
pathToDest->setColor(Qt::black);
|
||||
pathToDest->setWidth(5);
|
||||
elements.push_back(pathWalked);
|
||||
|
||||
elementsB.push_back(pathWalked);
|
||||
|
||||
// buttons
|
||||
//menu = new QWidget(this);
|
||||
@@ -90,11 +90,11 @@ void MapView2D::setMap(WiFiCalibrationDataModel* mdl, Floorplan::IndoorMap* map)
|
||||
|
||||
for (Floorplan::Floor* floor : map->floors) {
|
||||
Floor2D* f = new Floor2D(floor);
|
||||
elements.push_back(f);
|
||||
elementsA.push_back(f);
|
||||
}
|
||||
|
||||
wifiCalib = new WiFiCalibTool(mdl, map);
|
||||
elements.push_back(wifiCalib);
|
||||
elementsB.push_back(wifiCalib);
|
||||
|
||||
scaler.setCenterM(Point2(70, 35));
|
||||
|
||||
@@ -177,9 +177,8 @@ void MapView2D::paintEvent(QPaintEvent*) {
|
||||
qp.fillRect(0, 0, width(), height(), Qt::white);
|
||||
|
||||
// render elements
|
||||
for (Renderable2D* r : elements) {
|
||||
r->render(qp, scaler, renderParams);
|
||||
}
|
||||
for (Renderable2D* r : elementsA) {r->render(qp, scaler, renderParams);}
|
||||
for (Renderable2D* r : elementsB) {r->render(qp, scaler, renderParams);}
|
||||
|
||||
qp.end();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user