Ignore children in list.

--HG--
branch : feature
This commit is contained in:
Roman Telezhynskyi 2015-06-24 17:44:21 +03:00
parent b866e7b91e
commit bb89e681a2
9 changed files with 54 additions and 9 deletions

View File

@ -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<VisToolCutArc *>(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

View File

@ -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

View File

@ -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<VisToolCutSpline *>(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.

View File

@ -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

View File

@ -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<VisToolCutSplinePath *>(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.

View File

@ -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

View File

@ -70,6 +70,7 @@ void VToolCutArc::setDialog()
DialogCutArc *dialogTool = qobject_cast<DialogCutArc*>(dialog);
SCASSERT(dialogTool != nullptr);
const QSharedPointer<VPointF> point = VAbstractTool::data.GeometricObject<VPointF>(id);
dialogTool->SetChildrenId(curve1id, curve2id);
dialogTool->SetFormula(formula);
dialogTool->setArcId(curveCutId);
dialogTool->SetPointName(point->name());

View File

@ -69,6 +69,7 @@ void VToolCutSpline::setDialog()
DialogCutSpline *dialogTool = qobject_cast<DialogCutSpline*>(dialog);
SCASSERT(dialogTool != nullptr);
const QSharedPointer<VPointF> point = VAbstractTool::data.GeometricObject<VPointF>(id);
dialogTool->SetChildrenId(curve1id, curve2id);
dialogTool->SetFormula(formula);
dialogTool->setSplineId(curveCutId);
dialogTool->SetPointName(point->name());

View File

@ -72,6 +72,7 @@ void VToolCutSplinePath::setDialog()
DialogCutSplinePath *dialogTool = qobject_cast<DialogCutSplinePath*>(dialog);
SCASSERT(dialogTool != nullptr);
const QSharedPointer<VPointF> point = VAbstractTool::data.GeometricObject<VPointF>(id);
dialogTool->SetChildrenId(curve1id, curve2id);
dialogTool->SetFormula(formula);
dialogTool->setSplinePathId(curveCutId);
dialogTool->SetPointName(point->name());