[Sketcher] Create DSH for drawing B-splines by interpolation

Only creates 1-degree splines by describing knots.

This commit is part of a project funded by the Open Toolchain Foundation under the title "Open Toolchain Foundation - Curve drawing tool in Sketcher Workbench"
This commit is contained in:
Ajinkya Dahale
2023-02-20 07:47:43 +05:30
committed by abdullahtahiriyo
parent 852fd2b5d5
commit fc05c6bae3
4 changed files with 530 additions and 4 deletions

View File

@@ -56,6 +56,7 @@
#include "DrawSketchHandlerArcOfHyperbola.h"
#include "DrawSketchHandlerArcOfParabola.h"
#include "DrawSketchHandlerBSpline.h"
#include "DrawSketchHandlerBSplineByInterpolation.h"
#include "DrawSketchHandlerCarbonCopy.h"
#include "DrawSketchHandlerCircle.h"
#include "DrawSketchHandlerEllipse.h"
@@ -947,9 +948,14 @@ void CmdSketcherCompCreateBSpline::activated(int iMsg)
{
if (iMsg == 0) {
ActivateHandler(getActiveGuiDocument(), new DrawSketchHandlerBSpline(iMsg));
} else if (iMsg == 1) {
}
else if (iMsg == 1) {
ActivateHandler(getActiveGuiDocument(), new DrawSketchHandlerBSpline(iMsg));
} else {
}
else if (iMsg == 2) {
ActivateHandler(getActiveGuiDocument(), new DrawSketchHandlerBSplineByInterpolation(0));
}
else {
return;
}
@@ -974,6 +980,9 @@ Gui::Action * CmdSketcherCompCreateBSpline::createAction()
QAction* periodicbspline = pcAction->addAction(QString());
periodicbspline->setIcon(Gui::BitmapFactory().iconFromTheme("Sketcher_Create_Periodic_BSpline"));
QAction* bsplinebyknot = pcAction->addAction(QString());
bsplinebyknot->setIcon(Gui::BitmapFactory().iconFromTheme("Sketcher_Create_BSplineByKnot"));
_pcAction = pcAction;
languageChange();