fixed issue with "empty" elements [walls, stairs, elevators] during tool selection
minor ui changes
This commit is contained in:
@@ -95,7 +95,7 @@ MainController::MainController() {
|
|||||||
connect(mw, &MainWindow::onGridShowEdges, [&] (const bool show) {mw->getMapView3D()->getGridRenderer()->setShowEdges(show);} );
|
connect(mw, &MainWindow::onGridShowEdges, [&] (const bool show) {mw->getMapView3D()->getGridRenderer()->setShowEdges(show);} );
|
||||||
|
|
||||||
|
|
||||||
mapModel->load("../IndoorMap/maps/SHL37.xml");
|
mapModel->load("../IndoorMap/maps/SHL38_no_elev.xml");
|
||||||
//mapModel->resize(0.983, 0.983, 1, -0.2, -0.3, 0);
|
//mapModel->resize(0.983, 0.983, 1, -0.2, -0.3, 0);
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -62,6 +62,7 @@ public:
|
|||||||
} else {
|
} else {
|
||||||
//p.setPenBrush(Qt::gray, Qt::NoBrush);
|
//p.setPenBrush(Qt::gray, Qt::NoBrush);
|
||||||
//p.drawCircle(elevator->center);
|
//p.drawCircle(elevator->center);
|
||||||
|
p.drawCircle_px(elevator->center, 3);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -48,6 +48,7 @@ public:
|
|||||||
void paint(Painter& p) override {
|
void paint(Painter& p) override {
|
||||||
|
|
||||||
QBrush brush;
|
QBrush brush;
|
||||||
|
QPen pen;
|
||||||
|
|
||||||
// fill-style (depends on the mode)
|
// fill-style (depends on the mode)
|
||||||
switch (fo.method) {
|
switch (fo.method) {
|
||||||
@@ -65,8 +66,14 @@ public:
|
|||||||
brush.setColor(QColor(255,0,0));
|
brush.setColor(QColor(255,0,0));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (hasFocus()) {
|
||||||
|
brush.setStyle(Qt::BrushStyle::FDiagPattern);
|
||||||
|
}
|
||||||
|
|
||||||
// outline + filled area
|
// outline + filled area
|
||||||
p.setPenBrush(Qt::black, brush);
|
pen.setColor(Qt::black);
|
||||||
|
pen.setWidth( hasFocus() ? 2 : 1 );
|
||||||
|
p.setPenBrush(pen, brush);
|
||||||
p.drawPolygon(fo.poly.points);
|
p.drawPolygon(fo.poly.points);
|
||||||
|
|
||||||
// selected endpoints?
|
// selected endpoints?
|
||||||
|
|||||||
@@ -113,7 +113,8 @@ protected:
|
|||||||
|
|
||||||
/** finish creating new elements */
|
/** finish creating new elements */
|
||||||
void disableMe() {
|
void disableMe() {
|
||||||
finalizeCurrent();
|
//finalizeCurrent();
|
||||||
|
deleteCurrent();
|
||||||
delete this; // see dtor!
|
delete this; // see dtor!
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -17,17 +17,22 @@ private:
|
|||||||
public:
|
public:
|
||||||
|
|
||||||
ToolNewElevator(Tools& tools, MapLayer* layer) : ToolNewElement(tools, layer) {
|
ToolNewElevator(Tools& tools, MapLayer* layer) : ToolNewElement(tools, layer) {
|
||||||
create();
|
;
|
||||||
|
}
|
||||||
|
|
||||||
|
void becomesActive() override {
|
||||||
|
create(); // start adding an new element
|
||||||
|
showHelp();
|
||||||
|
}
|
||||||
|
|
||||||
|
void becomesInactive() override {
|
||||||
|
deleteCurrent(); // delete the currently pending and not yet finished elevator
|
||||||
}
|
}
|
||||||
|
|
||||||
const std::string getName() const override {
|
const std::string getName() const override {
|
||||||
return "new Elevator";
|
return "new Elevator";
|
||||||
}
|
}
|
||||||
|
|
||||||
void becomesActive() override {
|
|
||||||
showHelp();
|
|
||||||
}
|
|
||||||
|
|
||||||
void createEmptyElement() override {
|
void createEmptyElement() override {
|
||||||
|
|
||||||
foEL = new Floorplan::Elevator();
|
foEL = new Floorplan::Elevator();
|
||||||
|
|||||||
@@ -14,17 +14,22 @@ private:
|
|||||||
public:
|
public:
|
||||||
|
|
||||||
ToolNewStair(Tools& tools, MapLayer* layer) : ToolNewElement(tools, layer) {
|
ToolNewStair(Tools& tools, MapLayer* layer) : ToolNewElement(tools, layer) {
|
||||||
create();
|
;
|
||||||
|
}
|
||||||
|
|
||||||
|
void becomesActive() override {
|
||||||
|
create(); // start adding an new element
|
||||||
|
emit onHelpTextChange("click for the stair's starting point");
|
||||||
|
}
|
||||||
|
|
||||||
|
void becomesInactive() override {
|
||||||
|
deleteCurrent(); // delete the currently pending and not yet finished stair
|
||||||
}
|
}
|
||||||
|
|
||||||
const std::string getName() const override {
|
const std::string getName() const override {
|
||||||
return "new Stair";
|
return "new Stair";
|
||||||
}
|
}
|
||||||
|
|
||||||
void becomesActive() override {
|
|
||||||
emit onHelpTextChange("click for the stair's starting point");
|
|
||||||
}
|
|
||||||
|
|
||||||
void createEmptyElement() override {
|
void createEmptyElement() override {
|
||||||
|
|
||||||
foEL = new Floorplan::StairFreeform();
|
foEL = new Floorplan::StairFreeform();
|
||||||
|
|||||||
@@ -15,7 +15,15 @@ private:
|
|||||||
public:
|
public:
|
||||||
|
|
||||||
ToolNewWall(Tools& tools, MapLayer* layer) : ToolNewElement(tools, layer) {
|
ToolNewWall(Tools& tools, MapLayer* layer) : ToolNewElement(tools, layer) {
|
||||||
create();
|
;
|
||||||
|
}
|
||||||
|
|
||||||
|
void becomesActive() override {
|
||||||
|
create(); // start adding an new element
|
||||||
|
}
|
||||||
|
|
||||||
|
void becomesInactive() override {
|
||||||
|
deleteCurrent(); // delete the currently pending and not yet finished wall element
|
||||||
}
|
}
|
||||||
|
|
||||||
const std::string getName() const override {
|
const std::string getName() const override {
|
||||||
|
|||||||
@@ -173,6 +173,7 @@ void ToolBoxWidget::onMainToolChanged() {
|
|||||||
btnDoor->setStyleSheet( dynamic_cast<ToolNewDoor*>(t) ? styleSel : styleNor );
|
btnDoor->setStyleSheet( dynamic_cast<ToolNewDoor*>(t) ? styleSel : styleNor );
|
||||||
btnWall->setStyleSheet( dynamic_cast<ToolNewWall*>(t) ? styleSel : styleNor );
|
btnWall->setStyleSheet( dynamic_cast<ToolNewWall*>(t) ? styleSel : styleNor );
|
||||||
btnElevator->setStyleSheet( dynamic_cast<ToolNewElevator*>(t) ? styleSel : styleNor );
|
btnElevator->setStyleSheet( dynamic_cast<ToolNewElevator*>(t) ? styleSel : styleNor );
|
||||||
|
btnStair->setStyleSheet( dynamic_cast<ToolNewStair*>(t) ? styleSel : styleNor );
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user