diff --git a/src/libs/vtools/dialogs/tools/dialogcutarc.cpp b/src/libs/vtools/dialogs/tools/dialogcutarc.cpp index 3a18f7d56..371119754 100644 --- a/src/libs/vtools/dialogs/tools/dialogcutarc.cpp +++ b/src/libs/vtools/dialogs/tools/dialogcutarc.cpp @@ -43,7 +43,8 @@ * @param parent parent widget */ DialogCutArc::DialogCutArc(const VContainer *data, const quint32 &toolId, QWidget *parent) - : DialogTool(data, toolId, parent), ui(new Ui::DialogCutArc), formula(QString()), formulaBaseHeight(0) + : DialogTool(data, toolId, parent), ui(new Ui::DialogCutArc), formula(QString()), formulaBaseHeight(0), + ch1(NULL_ID), ch2(NULL_ID) { ui->setupUi(this); InitFormulaUI(ui); @@ -56,7 +57,7 @@ DialogCutArc::DialogCutArc(const VContainer *data, const quint32 &toolId, QWidge flagFormula = false; CheckState(); - FillComboBoxArcs(ui->comboBoxArc); + FillComboBoxArcs(ui->comboBoxArc, FillComboBox::NoChildren, ch1, ch2); FillComboBoxLineColors(ui->comboBoxColor); connect(ui->toolButtonExprLength, &QPushButton::clicked, this, &DialogCutArc::FXLength); @@ -157,7 +158,7 @@ void DialogCutArc::closeEvent(QCloseEvent *event) */ void DialogCutArc::setArcId(const quint32 &value) { - setCurrentArcId(ui->comboBoxArc, value, FillComboBox::NoChildren); + setCurrentArcId(ui->comboBoxArc, value, FillComboBox::NoChildren, ch1, ch2); VisToolCutArc *path = qobject_cast(vis); SCASSERT(path != nullptr); @@ -176,6 +177,14 @@ void DialogCutArc::SetColor(const QString &value) ChangeCurrentData(ui->comboBoxColor, value); } +//--------------------------------------------------------------------------------------------------------------------- +void DialogCutArc::SetChildrenId(const quint32 &ch1, const quint32 &ch2) +{ + this->ch1 = ch1; + this->ch2 = ch2; + FillComboBoxArcs(ui->comboBoxArc, FillComboBox::NoChildren, ch1, ch2); +} + //--------------------------------------------------------------------------------------------------------------------- /** * @brief SetFormula set string with formula length diff --git a/src/libs/vtools/dialogs/tools/dialogcutarc.h b/src/libs/vtools/dialogs/tools/dialogcutarc.h index 47273ab5a..2c5922ecd 100644 --- a/src/libs/vtools/dialogs/tools/dialogcutarc.h +++ b/src/libs/vtools/dialogs/tools/dialogcutarc.h @@ -57,6 +57,8 @@ public: QString GetColor() const; void SetColor(const QString &value); + + void SetChildrenId(const quint32 &ch1, const quint32 &ch2); public slots: virtual void ChosenObject(quint32 id, const SceneObject &type); /** @@ -85,6 +87,9 @@ private: /** @brief formulaBaseHeight base height defined by dialogui */ int formulaBaseHeight; + + quint32 ch1; + quint32 ch2; }; #endif // DIALOGCUTARC_H diff --git a/src/libs/vtools/dialogs/tools/dialogcutspline.cpp b/src/libs/vtools/dialogs/tools/dialogcutspline.cpp index 0a2943e1e..3adf155de 100644 --- a/src/libs/vtools/dialogs/tools/dialogcutspline.cpp +++ b/src/libs/vtools/dialogs/tools/dialogcutspline.cpp @@ -42,7 +42,8 @@ * @param parent parent widget */ DialogCutSpline::DialogCutSpline(const VContainer *data, const quint32 &toolId, QWidget *parent) - :DialogTool(data, toolId, parent), ui(new Ui::DialogCutSpline), formula(QString()), formulaBaseHeight(0) + :DialogTool(data, toolId, parent), ui(new Ui::DialogCutSpline), formula(QString()), formulaBaseHeight(0), + ch1(NULL_ID), ch2(NULL_ID) { ui->setupUi(this); InitFormulaUI(ui); @@ -55,7 +56,7 @@ DialogCutSpline::DialogCutSpline(const VContainer *data, const quint32 &toolId, flagFormula = false; CheckState(); - FillComboBoxSplines(ui->comboBoxSpline); + FillComboBoxSplines(ui->comboBoxSpline, FillComboBox::NoChildren, ch1, ch2); FillComboBoxLineColors(ui->comboBoxColor); connect(ui->toolButtonExprLength, &QPushButton::clicked, this, &DialogCutSpline::FXLength); @@ -114,7 +115,7 @@ void DialogCutSpline::SetFormula(const QString &value) */ void DialogCutSpline::setSplineId(const quint32 &value) { - setCurrentSplineId(ui->comboBoxSpline, value, FillComboBox::NoChildren); + setCurrentSplineId(ui->comboBoxSpline, value, FillComboBox::NoChildren, ch1, ch2); VisToolCutSpline *path = qobject_cast(vis); SCASSERT(path != nullptr); @@ -133,6 +134,14 @@ void DialogCutSpline::SetColor(const QString &value) ChangeCurrentData(ui->comboBoxColor, value); } +//--------------------------------------------------------------------------------------------------------------------- +void DialogCutSpline::SetChildrenId(const quint32 &ch1, const quint32 &ch2) +{ + this->ch1 = ch1; + this->ch2 = ch2; + FillComboBoxSplines(ui->comboBoxSpline, FillComboBox::NoChildren, ch1, ch2); +} + //--------------------------------------------------------------------------------------------------------------------- /** * @brief ChoosedObject gets id and type of selected object. Save right data and ignore wrong. diff --git a/src/libs/vtools/dialogs/tools/dialogcutspline.h b/src/libs/vtools/dialogs/tools/dialogcutspline.h index 1ac8d2cce..b2203e85d 100644 --- a/src/libs/vtools/dialogs/tools/dialogcutspline.h +++ b/src/libs/vtools/dialogs/tools/dialogcutspline.h @@ -56,6 +56,8 @@ public: QString GetColor() const; void SetColor(const QString &value); + + void SetChildrenId(const quint32 &ch1, const quint32 &ch2); public slots: virtual void ChosenObject(quint32 id, const SceneObject &type); /** @@ -81,6 +83,9 @@ private: /** @brief formulaBaseHeight base height defined by dialogui */ int formulaBaseHeight; + + quint32 ch1; + quint32 ch2; }; #endif // DIALOGCUTSPLINE_H diff --git a/src/libs/vtools/dialogs/tools/dialogcutsplinepath.cpp b/src/libs/vtools/dialogs/tools/dialogcutsplinepath.cpp index be67d4cde..aae622330 100644 --- a/src/libs/vtools/dialogs/tools/dialogcutsplinepath.cpp +++ b/src/libs/vtools/dialogs/tools/dialogcutsplinepath.cpp @@ -42,7 +42,8 @@ * @param parent parent widget */ DialogCutSplinePath::DialogCutSplinePath(const VContainer *data, const quint32 &toolId, QWidget *parent) - :DialogTool(data, toolId, parent), ui(new Ui::DialogCutSplinePath), formula(QString()), formulaBaseHeight(0) + :DialogTool(data, toolId, parent), ui(new Ui::DialogCutSplinePath), formula(QString()), formulaBaseHeight(0), + ch1(NULL_ID), ch2(NULL_ID) { ui->setupUi(this); InitFormulaUI(ui); @@ -55,7 +56,7 @@ DialogCutSplinePath::DialogCutSplinePath(const VContainer *data, const quint32 & flagFormula = false; CheckState(); - FillComboBoxSplinesPath(ui->comboBoxSplinePath); + FillComboBoxSplinesPath(ui->comboBoxSplinePath, FillComboBox::NoChildren, ch1, ch2); FillComboBoxLineColors(ui->comboBoxColor); connect(ui->toolButtonExprLength, &QPushButton::clicked, this, &DialogCutSplinePath::FXLength); @@ -114,7 +115,7 @@ void DialogCutSplinePath::SetFormula(const QString &value) */ void DialogCutSplinePath::setSplinePathId(const quint32 &value) { - setCurrentSplinePathId(ui->comboBoxSplinePath, value, FillComboBox::NoChildren); + setCurrentSplinePathId(ui->comboBoxSplinePath, value, FillComboBox::NoChildren, ch1, ch2); VisToolCutSplinePath *path = qobject_cast(vis); SCASSERT(path != nullptr); @@ -133,6 +134,14 @@ void DialogCutSplinePath::SetColor(const QString &value) ChangeCurrentData(ui->comboBoxColor, value); } +//--------------------------------------------------------------------------------------------------------------------- +void DialogCutSplinePath::SetChildrenId(const quint32 &ch1, const quint32 &ch2) +{ + this->ch1 = ch1; + this->ch2 = ch2; + FillComboBoxSplinesPath(ui->comboBoxSplinePath, FillComboBox::NoChildren, ch1, ch2); +} + //--------------------------------------------------------------------------------------------------------------------- /** * @brief ChoosedObject gets id and type of selected object. Save right data and ignore wrong. diff --git a/src/libs/vtools/dialogs/tools/dialogcutsplinepath.h b/src/libs/vtools/dialogs/tools/dialogcutsplinepath.h index b9bbc8727..0976b5e1f 100644 --- a/src/libs/vtools/dialogs/tools/dialogcutsplinepath.h +++ b/src/libs/vtools/dialogs/tools/dialogcutsplinepath.h @@ -56,6 +56,8 @@ public: QString GetColor() const; void SetColor(const QString &value); + + void SetChildrenId(const quint32 &ch1, const quint32 &ch2); public slots: virtual void ChosenObject(quint32 id, const SceneObject &type); /** @@ -81,6 +83,9 @@ private: /** @brief formulaBaseHeight base height defined by dialogui */ int formulaBaseHeight; + + quint32 ch1; + quint32 ch2; }; #endif // DIALOGCUTSPLINEPATH_H diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcutarc.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcutarc.cpp index 848567df2..f74a444f4 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcutarc.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcutarc.cpp @@ -70,6 +70,7 @@ void VToolCutArc::setDialog() DialogCutArc *dialogTool = qobject_cast(dialog); SCASSERT(dialogTool != nullptr); const QSharedPointer point = VAbstractTool::data.GeometricObject(id); + dialogTool->SetChildrenId(curve1id, curve2id); dialogTool->SetFormula(formula); dialogTool->setArcId(curveCutId); dialogTool->SetPointName(point->name()); diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcutspline.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcutspline.cpp index a36753332..753fefba9 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcutspline.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcutspline.cpp @@ -69,6 +69,7 @@ void VToolCutSpline::setDialog() DialogCutSpline *dialogTool = qobject_cast(dialog); SCASSERT(dialogTool != nullptr); const QSharedPointer point = VAbstractTool::data.GeometricObject(id); + dialogTool->SetChildrenId(curve1id, curve2id); dialogTool->SetFormula(formula); dialogTool->setSplineId(curveCutId); dialogTool->SetPointName(point->name()); diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcutsplinepath.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcutsplinepath.cpp index 062fc6889..37a43ea9a 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcutsplinepath.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcutsplinepath.cpp @@ -72,6 +72,7 @@ void VToolCutSplinePath::setDialog() DialogCutSplinePath *dialogTool = qobject_cast(dialog); SCASSERT(dialogTool != nullptr); const QSharedPointer point = VAbstractTool::data.GeometricObject(id); + dialogTool->SetChildrenId(curve1id, curve2id); dialogTool->SetFormula(formula); dialogTool->setSplinePathId(curveCutId); dialogTool->SetPointName(point->name());