Sketcher: Rectangle DSH

This commit is contained in:
Paddle
2023-10-17 19:02:15 +02:00
committed by abdullahtahiriyo
parent 29f17f9c6d
commit 74e8990044
15 changed files with 4129 additions and 683 deletions

View File

@@ -153,8 +153,9 @@ CONSTRUCTION_UPDATE_ACTION(CmdSketcherCreateRectangle, "Sketcher_CreateRectangle
void CmdSketcherCreateRectangle::activated(int iMsg)
{
Q_UNUSED(iMsg);
ActivateHandler(getActiveGuiDocument(),
new DrawSketchHandlerBox(DrawSketchHandlerBox::Diagonal));
ActivateHandler(
getActiveGuiDocument(),
new DrawSketchHandlerRectangle(ConstructionMethods::RectangleConstructionMethod::Diagonal));
}
bool CmdSketcherCreateRectangle::isActive()
@@ -184,7 +185,8 @@ void CmdSketcherCreateRectangleCenter::activated(int iMsg)
{
Q_UNUSED(iMsg);
ActivateHandler(getActiveGuiDocument(),
new DrawSketchHandlerBox(DrawSketchHandlerBox::CenterAndCorner));
new DrawSketchHandlerRectangle(
ConstructionMethods::RectangleConstructionMethod::CenterAndCorner));
}
bool CmdSketcherCreateRectangleCenter::isActive()
@@ -216,7 +218,10 @@ CONSTRUCTION_UPDATE_ACTION(CmdSketcherCreateOblong, "Sketcher_CreateOblong")
void CmdSketcherCreateOblong::activated(int iMsg)
{
Q_UNUSED(iMsg);
ActivateHandler(getActiveGuiDocument(), new DrawSketchHandlerOblong());
ActivateHandler(
getActiveGuiDocument(),
new DrawSketchHandlerRectangle(ConstructionMethods::RectangleConstructionMethod::Diagonal,
true));
}
bool CmdSketcherCreateOblong::isActive()
@@ -244,14 +249,19 @@ void CmdSketcherCompCreateRectangles::activated(int iMsg)
{
if (iMsg == 0) {
ActivateHandler(getActiveGuiDocument(),
new DrawSketchHandlerBox(DrawSketchHandlerBox::Diagonal));
new DrawSketchHandlerRectangle(
ConstructionMethods::RectangleConstructionMethod::Diagonal));
}
else if (iMsg == 1) {
ActivateHandler(getActiveGuiDocument(),
new DrawSketchHandlerBox(DrawSketchHandlerBox::CenterAndCorner));
new DrawSketchHandlerRectangle(
ConstructionMethods::RectangleConstructionMethod::CenterAndCorner));
}
else if (iMsg == 2) {
ActivateHandler(getActiveGuiDocument(), new DrawSketchHandlerOblong());
ActivateHandler(getActiveGuiDocument(),
new DrawSketchHandlerRectangle(
ConstructionMethods::RectangleConstructionMethod::Diagonal,
true));
}
else {
return;