Refactoring.
--HG-- branch : feature
This commit is contained in:
parent
4572da85c8
commit
cf2aea280d
|
@ -40,10 +40,10 @@ class VContainer;
|
||||||
* Note. If created to many parser for different purpes in the same time parser can work wrong.
|
* Note. If created to many parser for different purpes in the same time parser can work wrong.
|
||||||
* Example:
|
* Example:
|
||||||
* DialogEditWrongFormula *dialog = new DialogEditWrongFormula(data);
|
* DialogEditWrongFormula *dialog = new DialogEditWrongFormula(data);
|
||||||
* dialog->setFormula(formula);
|
* dialog->SetFormula(formula);
|
||||||
* if (dialog->exec() == QDialog::Accepted)
|
* if (dialog->exec() == QDialog::Accepted)
|
||||||
* {
|
* {
|
||||||
* formula = dialog->getFormula();
|
* formula = dialog->GetFormula();
|
||||||
* //Need delete dialog here because parser in dialog don't allow use correct separator for parsing here.
|
* //Need delete dialog here because parser in dialog don't allow use correct separator for parsing here.
|
||||||
* //Don't know why.
|
* //Don't know why.
|
||||||
* delete dialog;
|
* delete dialog;
|
||||||
|
|
|
@ -56,7 +56,7 @@ VFormula &VFormula::operator=(const VFormula &formula)
|
||||||
{
|
{
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
this->formula = formula.getFormula();
|
this->formula = formula.GetFormula();
|
||||||
this->value = formula.getStringValue();
|
this->value = formula.getStringValue();
|
||||||
this->checkZero = formula.getCheckZero();
|
this->checkZero = formula.getCheckZero();
|
||||||
this->data = formula.getData();
|
this->data = formula.getData();
|
||||||
|
@ -69,7 +69,7 @@ VFormula &VFormula::operator=(const VFormula &formula)
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
VFormula::VFormula(const VFormula &formula)
|
VFormula::VFormula(const VFormula &formula)
|
||||||
:formula(formula.getFormula()), value(formula.getStringValue()), checkZero(formula.getCheckZero()),
|
:formula(formula.GetFormula()), value(formula.getStringValue()), checkZero(formula.getCheckZero()),
|
||||||
data(formula.getData()), toolId(formula.getToolId()), postfix(formula.getPostfix()), _error(formula.error()),
|
data(formula.getData()), toolId(formula.getToolId()), postfix(formula.getPostfix()), _error(formula.error()),
|
||||||
dValue(formula.getDoubleValue())
|
dValue(formula.getDoubleValue())
|
||||||
{}
|
{}
|
||||||
|
@ -78,7 +78,7 @@ VFormula::VFormula(const VFormula &formula)
|
||||||
bool VFormula::operator==(const VFormula &formula) const
|
bool VFormula::operator==(const VFormula &formula) const
|
||||||
{
|
{
|
||||||
bool isEqual = false;
|
bool isEqual = false;
|
||||||
if (this->formula == formula.getFormula() && this->value == formula.getStringValue() &&
|
if (this->formula == formula.GetFormula() && this->value == formula.getStringValue() &&
|
||||||
this->checkZero == formula.getCheckZero() && this->data == formula.getData() &&
|
this->checkZero == formula.getCheckZero() && this->data == formula.getData() &&
|
||||||
this->toolId == formula.getToolId() && this->postfix == formula.getPostfix() &&
|
this->toolId == formula.getToolId() && this->postfix == formula.getPostfix() &&
|
||||||
this->_error == formula.error() && qFuzzyCompare(this->dValue, formula.getDoubleValue()))
|
this->_error == formula.error() && qFuzzyCompare(this->dValue, formula.getDoubleValue()))
|
||||||
|
@ -94,7 +94,7 @@ bool VFormula::operator!=(const VFormula &formula) const
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
QString VFormula::getFormula(FormulaType type) const
|
QString VFormula::GetFormula(FormulaType type) const
|
||||||
{
|
{
|
||||||
if (type == FormulaType::ToUser)
|
if (type == FormulaType::ToUser)
|
||||||
{
|
{
|
||||||
|
@ -107,7 +107,7 @@ QString VFormula::getFormula(FormulaType type) const
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VFormula::setFormula(const QString &value, FormulaType type)
|
void VFormula::SetFormula(const QString &value, FormulaType type)
|
||||||
{
|
{
|
||||||
if (formula != value)
|
if (formula != value)
|
||||||
{
|
{
|
||||||
|
|
|
@ -46,8 +46,8 @@ public:
|
||||||
bool operator==(const VFormula &formula) const;
|
bool operator==(const VFormula &formula) const;
|
||||||
bool operator!=(const VFormula &formula) const;
|
bool operator!=(const VFormula &formula) const;
|
||||||
|
|
||||||
QString getFormula(FormulaType type = FormulaType::ToUser) const;
|
QString GetFormula(FormulaType type = FormulaType::ToUser) const;
|
||||||
void setFormula(const QString &value, FormulaType type = FormulaType::ToUser);
|
void SetFormula(const QString &value, FormulaType type = FormulaType::ToUser);
|
||||||
|
|
||||||
QString getStringValue() const;
|
QString getStringValue() const;
|
||||||
qreal getDoubleValue() const;
|
qreal getDoubleValue() const;
|
||||||
|
|
|
@ -183,10 +183,10 @@ void DialogAlongLine::SaveData()
|
||||||
formula = ui->plainTextEditFormula->toPlainText();
|
formula = ui->plainTextEditFormula->toPlainText();
|
||||||
formula.replace("\n", " ");
|
formula.replace("\n", " ");
|
||||||
|
|
||||||
line->setPoint1Id(getFirstPointId());
|
line->setPoint1Id(GetFirstPointId());
|
||||||
line->setPoint2Id(getSecondPointId());
|
line->setPoint2Id(GetSecondPointId());
|
||||||
line->setLength(formula);
|
line->setLength(formula);
|
||||||
line->setLineStyle(VAbstractTool::LineStyleToPenStyle(getTypeLine()));
|
line->setLineStyle(VAbstractTool::LineStyleToPenStyle(GetTypeLine()));
|
||||||
line->RefreshGeometry();
|
line->RefreshGeometry();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -199,10 +199,10 @@ void DialogAlongLine::closeEvent(QCloseEvent *event)
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief setSecondPointId set id second point of line
|
* @brief SetSecondPointId set id second point of line
|
||||||
* @param value id
|
* @param value id
|
||||||
*/
|
*/
|
||||||
void DialogAlongLine::setSecondPointId(const quint32 &value)
|
void DialogAlongLine::SetSecondPointId(const quint32 &value)
|
||||||
{
|
{
|
||||||
setCurrentPointId(ui->comboBoxSecondPoint, value);
|
setCurrentPointId(ui->comboBoxSecondPoint, value);
|
||||||
line->setPoint2Id(value);
|
line->setPoint2Id(value);
|
||||||
|
@ -210,10 +210,10 @@ void DialogAlongLine::setSecondPointId(const quint32 &value)
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief setFirstPointId set id first point of line
|
* @brief SetFirstPointId set id first point of line
|
||||||
* @param value id
|
* @param value id
|
||||||
*/
|
*/
|
||||||
void DialogAlongLine::setFirstPointId(const quint32 &value)
|
void DialogAlongLine::SetFirstPointId(const quint32 &value)
|
||||||
{
|
{
|
||||||
setCurrentPointId(ui->comboBoxFirstPoint, value);
|
setCurrentPointId(ui->comboBoxFirstPoint, value);
|
||||||
line->setPoint1Id(value);
|
line->setPoint1Id(value);
|
||||||
|
@ -221,10 +221,10 @@ void DialogAlongLine::setFirstPointId(const quint32 &value)
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief setFormula set string of formula
|
* @brief SetFormula set string of formula
|
||||||
* @param value formula
|
* @param value formula
|
||||||
*/
|
*/
|
||||||
void DialogAlongLine::setFormula(const QString &value)
|
void DialogAlongLine::SetFormula(const QString &value)
|
||||||
{
|
{
|
||||||
formula = qApp->FormulaToUser(value);
|
formula = qApp->FormulaToUser(value);
|
||||||
// increase height if needed.
|
// increase height if needed.
|
||||||
|
@ -239,33 +239,33 @@ void DialogAlongLine::setFormula(const QString &value)
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief setTypeLine set type of line
|
* @brief SetTypeLine set type of line
|
||||||
* @param value type
|
* @param value type
|
||||||
*/
|
*/
|
||||||
void DialogAlongLine::setTypeLine(const QString &value)
|
void DialogAlongLine::SetTypeLine(const QString &value)
|
||||||
{
|
{
|
||||||
ChangeCurrentData(ui->comboBoxLineType, value);
|
ChangeCurrentData(ui->comboBoxLineType, value);
|
||||||
line->setLineStyle(VAbstractTool::LineStyleToPenStyle(value));
|
line->setLineStyle(VAbstractTool::LineStyleToPenStyle(value));
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
QString DialogAlongLine::getLineColor() const
|
QString DialogAlongLine::GetLineColor() const
|
||||||
{
|
{
|
||||||
return GetLineColor(ui->comboBoxLineColor);
|
return GetComboBoxCurrentData(ui->comboBoxLineColor);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void DialogAlongLine::setLineColor(const QString &value)
|
void DialogAlongLine::SetLineColor(const QString &value)
|
||||||
{
|
{
|
||||||
ChangeCurrentData(ui->comboBoxLineColor, value);
|
ChangeCurrentData(ui->comboBoxLineColor, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief setPointName set name of point
|
* @brief SetPointName set name of point
|
||||||
* @param value name
|
* @param value name
|
||||||
*/
|
*/
|
||||||
void DialogAlongLine::setPointName(const QString &value)
|
void DialogAlongLine::SetPointName(const QString &value)
|
||||||
{
|
{
|
||||||
pointName = value;
|
pointName = value;
|
||||||
ui->lineEditNamePoint->setText(pointName);
|
ui->lineEditNamePoint->setText(pointName);
|
||||||
|
@ -273,40 +273,40 @@ void DialogAlongLine::setPointName(const QString &value)
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief getTypeLine return type of line
|
* @brief GetTypeLine return type of line
|
||||||
* @return type
|
* @return type
|
||||||
*/
|
*/
|
||||||
QString DialogAlongLine::getTypeLine() const
|
QString DialogAlongLine::GetTypeLine() const
|
||||||
{
|
{
|
||||||
return GetTypeLine(ui->comboBoxLineType);
|
return GetComboBoxCurrentData(ui->comboBoxLineType);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief getFormula return string of formula
|
* @brief GetFormula return string of formula
|
||||||
* @return formula
|
* @return formula
|
||||||
*/
|
*/
|
||||||
QString DialogAlongLine::getFormula() const
|
QString DialogAlongLine::GetFormula() const
|
||||||
{
|
{
|
||||||
return qApp->FormulaFromUser(formula);
|
return qApp->FormulaFromUser(formula);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief getFirstPointId return id first point of line
|
* @brief GetFirstPointId return id first point of line
|
||||||
* @return id
|
* @return id
|
||||||
*/
|
*/
|
||||||
quint32 DialogAlongLine::getFirstPointId() const
|
quint32 DialogAlongLine::GetFirstPointId() const
|
||||||
{
|
{
|
||||||
return getCurrentObjectId(ui->comboBoxFirstPoint);
|
return getCurrentObjectId(ui->comboBoxFirstPoint);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief getSecondPointId return id second point of line
|
* @brief GetSecondPointId return id second point of line
|
||||||
* @return id
|
* @return id
|
||||||
*/
|
*/
|
||||||
quint32 DialogAlongLine::getSecondPointId() const
|
quint32 DialogAlongLine::GetSecondPointId() const
|
||||||
{
|
{
|
||||||
return getCurrentObjectId(ui->comboBoxSecondPoint);
|
return getCurrentObjectId(ui->comboBoxSecondPoint);
|
||||||
}
|
}
|
||||||
|
|
|
@ -48,22 +48,22 @@ public:
|
||||||
DialogAlongLine(const VContainer *data, const quint32 &toolId, QWidget *parent = nullptr);
|
DialogAlongLine(const VContainer *data, const quint32 &toolId, QWidget *parent = nullptr);
|
||||||
~DialogAlongLine();
|
~DialogAlongLine();
|
||||||
|
|
||||||
void setPointName(const QString &value);
|
void SetPointName(const QString &value);
|
||||||
|
|
||||||
QString getTypeLine() const;
|
QString GetTypeLine() const;
|
||||||
void setTypeLine(const QString &value);
|
void SetTypeLine(const QString &value);
|
||||||
|
|
||||||
QString getLineColor() const;
|
QString GetLineColor() const;
|
||||||
void setLineColor(const QString &value);
|
void SetLineColor(const QString &value);
|
||||||
|
|
||||||
QString getFormula() const;
|
QString GetFormula() const;
|
||||||
void setFormula(const QString &value);
|
void SetFormula(const QString &value);
|
||||||
|
|
||||||
quint32 getFirstPointId() const;
|
quint32 GetFirstPointId() const;
|
||||||
void setFirstPointId(const quint32 &value);
|
void SetFirstPointId(const quint32 &value);
|
||||||
|
|
||||||
quint32 getSecondPointId() const;
|
quint32 GetSecondPointId() const;
|
||||||
void setSecondPointId(const quint32 &value);
|
void SetSecondPointId(const quint32 &value);
|
||||||
public slots:
|
public slots:
|
||||||
virtual void ChosenObject(quint32 id, const SceneObject &type);
|
virtual void ChosenObject(quint32 id, const SceneObject &type);
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -157,7 +157,7 @@ void DialogArc::SetF2(const QString &value)
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
QString DialogArc::GetColor() const
|
QString DialogArc::GetColor() const
|
||||||
{
|
{
|
||||||
return GetLineColor(ui->comboBoxColor);
|
return GetComboBoxCurrentData(ui->comboBoxColor);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
|
@ -200,10 +200,10 @@ void DialogBisector::ChosenObject(quint32 id, const SceneObject &type)
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief setPointName set name of point
|
* @brief SetPointName set name of point
|
||||||
* @param value name
|
* @param value name
|
||||||
*/
|
*/
|
||||||
void DialogBisector::setPointName(const QString &value)
|
void DialogBisector::SetPointName(const QString &value)
|
||||||
{
|
{
|
||||||
pointName = value;
|
pointName = value;
|
||||||
ui->lineEditNamePoint->setText(pointName);
|
ui->lineEditNamePoint->setText(pointName);
|
||||||
|
@ -211,10 +211,10 @@ void DialogBisector::setPointName(const QString &value)
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief setTypeLine set type of line
|
* @brief SetTypeLine set type of line
|
||||||
* @param value type
|
* @param value type
|
||||||
*/
|
*/
|
||||||
void DialogBisector::setTypeLine(const QString &value)
|
void DialogBisector::SetTypeLine(const QString &value)
|
||||||
{
|
{
|
||||||
ChangeCurrentData(ui->comboBoxLineType, value);
|
ChangeCurrentData(ui->comboBoxLineType, value);
|
||||||
line->setLineStyle(VAbstractTool::LineStyleToPenStyle(value));
|
line->setLineStyle(VAbstractTool::LineStyleToPenStyle(value));
|
||||||
|
@ -222,10 +222,10 @@ void DialogBisector::setTypeLine(const QString &value)
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief setFormula set string of formula
|
* @brief SetFormula set string of formula
|
||||||
* @param value formula
|
* @param value formula
|
||||||
*/
|
*/
|
||||||
void DialogBisector::setFormula(const QString &value)
|
void DialogBisector::SetFormula(const QString &value)
|
||||||
{
|
{
|
||||||
formula = qApp->FormulaToUser(value);
|
formula = qApp->FormulaToUser(value);
|
||||||
// increase height if needed.
|
// increase height if needed.
|
||||||
|
@ -240,10 +240,10 @@ void DialogBisector::setFormula(const QString &value)
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief setFirstPointId set id of first point
|
* @brief SetFirstPointId set id of first point
|
||||||
* @param value id
|
* @param value id
|
||||||
*/
|
*/
|
||||||
void DialogBisector::setFirstPointId(const quint32 &value)
|
void DialogBisector::SetFirstPointId(const quint32 &value)
|
||||||
{
|
{
|
||||||
setCurrentPointId(ui->comboBoxFirstPoint, value);
|
setCurrentPointId(ui->comboBoxFirstPoint, value);
|
||||||
line->setPoint1Id(value);
|
line->setPoint1Id(value);
|
||||||
|
@ -251,10 +251,10 @@ void DialogBisector::setFirstPointId(const quint32 &value)
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief setSecondPointId set id of second point
|
* @brief SetSecondPointId set id of second point
|
||||||
* @param value id
|
* @param value id
|
||||||
*/
|
*/
|
||||||
void DialogBisector::setSecondPointId(const quint32 &value)
|
void DialogBisector::SetSecondPointId(const quint32 &value)
|
||||||
{
|
{
|
||||||
setCurrentPointId(ui->comboBoxSecondPoint, value);
|
setCurrentPointId(ui->comboBoxSecondPoint, value);
|
||||||
line->setPoint2Id(value);
|
line->setPoint2Id(value);
|
||||||
|
@ -262,23 +262,23 @@ void DialogBisector::setSecondPointId(const quint32 &value)
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief setThirdPointId set id of third point
|
* @brief SetThirdPointId set id of third point
|
||||||
* @param value id
|
* @param value id
|
||||||
*/
|
*/
|
||||||
void DialogBisector::setThirdPointId(const quint32 &value)
|
void DialogBisector::SetThirdPointId(const quint32 &value)
|
||||||
{
|
{
|
||||||
setCurrentPointId(ui->comboBoxThirdPoint, value);
|
setCurrentPointId(ui->comboBoxThirdPoint, value);
|
||||||
line->setPoint3Id(value);
|
line->setPoint3Id(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
QString DialogBisector::getLineColor() const
|
QString DialogBisector::GetLineColor() const
|
||||||
{
|
{
|
||||||
return GetLineColor(ui->comboBoxLineColor);
|
return GetComboBoxCurrentData(ui->comboBoxLineColor);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void DialogBisector::setLineColor(const QString &value)
|
void DialogBisector::SetLineColor(const QString &value)
|
||||||
{
|
{
|
||||||
ChangeCurrentData(ui->comboBoxLineColor, value);
|
ChangeCurrentData(ui->comboBoxLineColor, value);
|
||||||
}
|
}
|
||||||
|
@ -291,11 +291,11 @@ void DialogBisector::SaveData()
|
||||||
formula = ui->plainTextEditFormula->toPlainText();
|
formula = ui->plainTextEditFormula->toPlainText();
|
||||||
formula.replace("\n", " ");
|
formula.replace("\n", " ");
|
||||||
|
|
||||||
line->setPoint1Id(getFirstPointId());
|
line->setPoint1Id(GetFirstPointId());
|
||||||
line->setPoint2Id(getSecondPointId());
|
line->setPoint2Id(GetSecondPointId());
|
||||||
line->setPoint3Id(getThirdPointId());
|
line->setPoint3Id(GetThirdPointId());
|
||||||
line->setLength(formula);
|
line->setLength(formula);
|
||||||
line->setLineStyle(VAbstractTool::LineStyleToPenStyle(getTypeLine()));
|
line->setLineStyle(VAbstractTool::LineStyleToPenStyle(GetTypeLine()));
|
||||||
line->RefreshGeometry();
|
line->RefreshGeometry();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -308,50 +308,50 @@ void DialogBisector::closeEvent(QCloseEvent *event)
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief getTypeLine return type of line
|
* @brief GetTypeLine return type of line
|
||||||
* @return type
|
* @return type
|
||||||
*/
|
*/
|
||||||
QString DialogBisector::getTypeLine() const
|
QString DialogBisector::GetTypeLine() const
|
||||||
{
|
{
|
||||||
return GetTypeLine(ui->comboBoxLineType);
|
return GetComboBoxCurrentData(ui->comboBoxLineType);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief getFormula return string of formula
|
* @brief GetFormula return string of formula
|
||||||
* @return formula
|
* @return formula
|
||||||
*/
|
*/
|
||||||
QString DialogBisector::getFormula() const
|
QString DialogBisector::GetFormula() const
|
||||||
{
|
{
|
||||||
return qApp->FormulaFromUser(formula);
|
return qApp->FormulaFromUser(formula);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief getFirstPointId return id of first point
|
* @brief GetFirstPointId return id of first point
|
||||||
* @return id
|
* @return id
|
||||||
*/
|
*/
|
||||||
quint32 DialogBisector::getFirstPointId() const
|
quint32 DialogBisector::GetFirstPointId() const
|
||||||
{
|
{
|
||||||
return getCurrentObjectId(ui->comboBoxFirstPoint);
|
return getCurrentObjectId(ui->comboBoxFirstPoint);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief getSecondPointId return id of second point
|
* @brief GetSecondPointId return id of second point
|
||||||
* @return id
|
* @return id
|
||||||
*/
|
*/
|
||||||
quint32 DialogBisector::getSecondPointId() const
|
quint32 DialogBisector::GetSecondPointId() const
|
||||||
{
|
{
|
||||||
return getCurrentObjectId(ui->comboBoxSecondPoint);
|
return getCurrentObjectId(ui->comboBoxSecondPoint);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief getThirdPointId return id of third point
|
* @brief GetThirdPointId return id of third point
|
||||||
* @return id
|
* @return id
|
||||||
*/
|
*/
|
||||||
quint32 DialogBisector::getThirdPointId() const
|
quint32 DialogBisector::GetThirdPointId() const
|
||||||
{
|
{
|
||||||
return getCurrentObjectId(ui->comboBoxThirdPoint);
|
return getCurrentObjectId(ui->comboBoxThirdPoint);
|
||||||
}
|
}
|
||||||
|
|
|
@ -49,25 +49,25 @@ public:
|
||||||
DialogBisector(const VContainer *data, const quint32 &toolId, QWidget *parent = nullptr);
|
DialogBisector(const VContainer *data, const quint32 &toolId, QWidget *parent = nullptr);
|
||||||
~DialogBisector();
|
~DialogBisector();
|
||||||
|
|
||||||
void setPointName(const QString &value);
|
void SetPointName(const QString &value);
|
||||||
|
|
||||||
QString getTypeLine() const;
|
QString GetTypeLine() const;
|
||||||
void setTypeLine(const QString &value);
|
void SetTypeLine(const QString &value);
|
||||||
|
|
||||||
QString getFormula() const;
|
QString GetFormula() const;
|
||||||
void setFormula(const QString &value);
|
void SetFormula(const QString &value);
|
||||||
|
|
||||||
quint32 getFirstPointId() const;
|
quint32 GetFirstPointId() const;
|
||||||
void setFirstPointId(const quint32 &value);
|
void SetFirstPointId(const quint32 &value);
|
||||||
|
|
||||||
quint32 getSecondPointId() const;
|
quint32 GetSecondPointId() const;
|
||||||
void setSecondPointId(const quint32 &value);
|
void SetSecondPointId(const quint32 &value);
|
||||||
|
|
||||||
quint32 getThirdPointId() const;
|
quint32 GetThirdPointId() const;
|
||||||
void setThirdPointId(const quint32 &value);
|
void SetThirdPointId(const quint32 &value);
|
||||||
|
|
||||||
QString getLineColor() const;
|
QString GetLineColor() const;
|
||||||
void setLineColor(const QString &value);
|
void SetLineColor(const QString &value);
|
||||||
public slots:
|
public slots:
|
||||||
virtual void ChosenObject(quint32 id, const SceneObject &type);
|
virtual void ChosenObject(quint32 id, const SceneObject &type);
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -81,33 +81,33 @@ DialogCurveIntersectAxis::~DialogCurveIntersectAxis()
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void DialogCurveIntersectAxis::setPointName(const QString &value)
|
void DialogCurveIntersectAxis::SetPointName(const QString &value)
|
||||||
{
|
{
|
||||||
pointName = value;
|
pointName = value;
|
||||||
ui->lineEditNamePoint->setText(pointName);
|
ui->lineEditNamePoint->setText(pointName);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
QString DialogCurveIntersectAxis::getTypeLine() const
|
QString DialogCurveIntersectAxis::GetTypeLine() const
|
||||||
{
|
{
|
||||||
return GetTypeLine(ui->comboBoxLineType);
|
return GetComboBoxCurrentData(ui->comboBoxLineType);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void DialogCurveIntersectAxis::setTypeLine(const QString &value)
|
void DialogCurveIntersectAxis::SetTypeLine(const QString &value)
|
||||||
{
|
{
|
||||||
ChangeCurrentData(ui->comboBoxLineType, value);
|
ChangeCurrentData(ui->comboBoxLineType, value);
|
||||||
line->setLineStyle(VAbstractTool::LineStyleToPenStyle(value));
|
line->setLineStyle(VAbstractTool::LineStyleToPenStyle(value));
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
QString DialogCurveIntersectAxis::getAngle() const
|
QString DialogCurveIntersectAxis::GetAngle() const
|
||||||
{
|
{
|
||||||
return qApp->FormulaFromUser(formulaAngle);
|
return qApp->FormulaFromUser(formulaAngle);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void DialogCurveIntersectAxis::setAngle(const QString &value)
|
void DialogCurveIntersectAxis::SetAngle(const QString &value)
|
||||||
{
|
{
|
||||||
formulaAngle = qApp->FormulaToUser(value);
|
formulaAngle = qApp->FormulaToUser(value);
|
||||||
// increase height if needed. TODO : see if I can get the max number of caracters in one line
|
// increase height if needed. TODO : see if I can get the max number of caracters in one line
|
||||||
|
@ -117,18 +117,18 @@ void DialogCurveIntersectAxis::setAngle(const QString &value)
|
||||||
this->DeployAngleTextEdit();
|
this->DeployAngleTextEdit();
|
||||||
}
|
}
|
||||||
ui->plainTextEditFormula->setPlainText(formulaAngle);
|
ui->plainTextEditFormula->setPlainText(formulaAngle);
|
||||||
line->setAngle(formulaAngle);
|
line->SetAngle(formulaAngle);
|
||||||
MoveCursorToEnd(ui->plainTextEditFormula);
|
MoveCursorToEnd(ui->plainTextEditFormula);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
quint32 DialogCurveIntersectAxis::getBasePointId() const
|
quint32 DialogCurveIntersectAxis::GetBasePointId() const
|
||||||
{
|
{
|
||||||
return getCurrentObjectId(ui->comboBoxAxisPoint);
|
return getCurrentObjectId(ui->comboBoxAxisPoint);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void DialogCurveIntersectAxis::setBasePointId(const quint32 &value)
|
void DialogCurveIntersectAxis::SetBasePointId(const quint32 &value)
|
||||||
{
|
{
|
||||||
setCurrentPointId(ui->comboBoxAxisPoint, value);
|
setCurrentPointId(ui->comboBoxAxisPoint, value);
|
||||||
line->setAxisPointId(value);
|
line->setAxisPointId(value);
|
||||||
|
@ -148,13 +148,13 @@ void DialogCurveIntersectAxis::setCurveId(const quint32 &value)
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
QString DialogCurveIntersectAxis::getLineColor() const
|
QString DialogCurveIntersectAxis::GetLineColor() const
|
||||||
{
|
{
|
||||||
return GetLineColor(ui->comboBoxLineColor);
|
return GetComboBoxCurrentData(ui->comboBoxLineColor);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void DialogCurveIntersectAxis::setLineColor(const QString &value)
|
void DialogCurveIntersectAxis::SetLineColor(const QString &value)
|
||||||
{
|
{
|
||||||
ChangeCurrentData(ui->comboBoxLineColor, value);
|
ChangeCurrentData(ui->comboBoxLineColor, value);
|
||||||
}
|
}
|
||||||
|
@ -169,7 +169,7 @@ void DialogCurveIntersectAxis::ShowDialog(bool click)
|
||||||
/*We will ignore click if poinet is in point circle*/
|
/*We will ignore click if poinet is in point circle*/
|
||||||
VMainGraphicsScene *scene = qApp->getCurrentScene();
|
VMainGraphicsScene *scene = qApp->getCurrentScene();
|
||||||
SCASSERT(scene != nullptr);
|
SCASSERT(scene != nullptr);
|
||||||
const QSharedPointer<VPointF> point = data->GeometricObject<VPointF>(getBasePointId());
|
const QSharedPointer<VPointF> point = data->GeometricObject<VPointF>(GetBasePointId());
|
||||||
QLineF line = QLineF(point->toQPointF(), scene->getScenePos());
|
QLineF line = QLineF(point->toQPointF(), scene->getScenePos());
|
||||||
|
|
||||||
//Radius of point circle, but little bigger. Need handle with hover sizes.
|
//Radius of point circle, but little bigger. Need handle with hover sizes.
|
||||||
|
@ -180,7 +180,7 @@ void DialogCurveIntersectAxis::ShowDialog(bool click)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this->setModal(true);
|
this->setModal(true);
|
||||||
this->setAngle(line->Angle());//Show in dialog angle what user choose
|
this->SetAngle(line->Angle());//Show in dialog angle what user choose
|
||||||
emit ToolTip("");
|
emit ToolTip("");
|
||||||
timerFormula->start();
|
timerFormula->start();
|
||||||
this->show();
|
this->show();
|
||||||
|
@ -268,9 +268,9 @@ void DialogCurveIntersectAxis::SaveData()
|
||||||
formulaAngle.replace("\n", " ");
|
formulaAngle.replace("\n", " ");
|
||||||
|
|
||||||
line->setPoint1Id(getCurveId());
|
line->setPoint1Id(getCurveId());
|
||||||
line->setAxisPointId(getBasePointId());
|
line->setAxisPointId(GetBasePointId());
|
||||||
line->setAngle(formulaAngle);
|
line->SetAngle(formulaAngle);
|
||||||
line->setLineStyle(VAbstractTool::LineStyleToPenStyle(getTypeLine()));
|
line->setLineStyle(VAbstractTool::LineStyleToPenStyle(GetTypeLine()));
|
||||||
line->RefreshGeometry();
|
line->RefreshGeometry();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -45,22 +45,22 @@ public:
|
||||||
DialogCurveIntersectAxis(const VContainer *data, const quint32 &toolId, QWidget *parent = nullptr);
|
DialogCurveIntersectAxis(const VContainer *data, const quint32 &toolId, QWidget *parent = nullptr);
|
||||||
~DialogCurveIntersectAxis();
|
~DialogCurveIntersectAxis();
|
||||||
|
|
||||||
void setPointName(const QString &value);
|
void SetPointName(const QString &value);
|
||||||
|
|
||||||
QString getTypeLine() const;
|
QString GetTypeLine() const;
|
||||||
void setTypeLine(const QString &value);
|
void SetTypeLine(const QString &value);
|
||||||
|
|
||||||
QString getAngle() const;
|
QString GetAngle() const;
|
||||||
void setAngle(const QString &value);
|
void SetAngle(const QString &value);
|
||||||
|
|
||||||
quint32 getBasePointId() const;
|
quint32 GetBasePointId() const;
|
||||||
void setBasePointId(const quint32 &value);
|
void SetBasePointId(const quint32 &value);
|
||||||
|
|
||||||
quint32 getCurveId() const;
|
quint32 getCurveId() const;
|
||||||
void setCurveId(const quint32 &value);
|
void setCurveId(const quint32 &value);
|
||||||
|
|
||||||
QString getLineColor() const;
|
QString GetLineColor() const;
|
||||||
void setLineColor(const QString &value);
|
void SetLineColor(const QString &value);
|
||||||
|
|
||||||
virtual void ShowDialog(bool click);
|
virtual void ShowDialog(bool click);
|
||||||
public slots:
|
public slots:
|
||||||
|
|
|
@ -159,10 +159,10 @@ void DialogCutArc::setArcId(const quint32 &value)
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief setFormula set string with formula length
|
* @brief SetFormula set string with formula length
|
||||||
* @param value string with formula
|
* @param value string with formula
|
||||||
*/
|
*/
|
||||||
void DialogCutArc::setFormula(const QString &value)
|
void DialogCutArc::SetFormula(const QString &value)
|
||||||
{
|
{
|
||||||
formula = qApp->FormulaToUser(value);
|
formula = qApp->FormulaToUser(value);
|
||||||
// increase height if needed.
|
// increase height if needed.
|
||||||
|
@ -177,10 +177,10 @@ void DialogCutArc::setFormula(const QString &value)
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief setPointName set name point on arc
|
* @brief SetPointName set name point on arc
|
||||||
* @param value name
|
* @param value name
|
||||||
*/
|
*/
|
||||||
void DialogCutArc::setPointName(const QString &value)
|
void DialogCutArc::SetPointName(const QString &value)
|
||||||
{
|
{
|
||||||
pointName = value;
|
pointName = value;
|
||||||
ui->lineEditNamePoint->setText(pointName);
|
ui->lineEditNamePoint->setText(pointName);
|
||||||
|
@ -188,10 +188,10 @@ void DialogCutArc::setPointName(const QString &value)
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief getFormula return string with formula length
|
* @brief GetFormula return string with formula length
|
||||||
* @return formula
|
* @return formula
|
||||||
*/
|
*/
|
||||||
QString DialogCutArc::getFormula() const
|
QString DialogCutArc::GetFormula() const
|
||||||
{
|
{
|
||||||
return qApp->FormulaFromUser(formula);
|
return qApp->FormulaFromUser(formula);
|
||||||
}
|
}
|
||||||
|
|
|
@ -49,10 +49,10 @@ public:
|
||||||
DialogCutArc(const VContainer *data, const quint32 &toolId, QWidget *parent = nullptr);
|
DialogCutArc(const VContainer *data, const quint32 &toolId, QWidget *parent = nullptr);
|
||||||
~DialogCutArc();
|
~DialogCutArc();
|
||||||
|
|
||||||
void setPointName(const QString &value);
|
void SetPointName(const QString &value);
|
||||||
|
|
||||||
QString getFormula() const;
|
QString GetFormula() const;
|
||||||
void setFormula(const QString &value);
|
void SetFormula(const QString &value);
|
||||||
|
|
||||||
quint32 getArcId() const;
|
quint32 getArcId() const;
|
||||||
void setArcId(const quint32 &value);
|
void setArcId(const quint32 &value);
|
||||||
|
|
|
@ -80,10 +80,10 @@ DialogCutSpline::~DialogCutSpline()
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief setPointName set name of point
|
* @brief SetPointName set name of point
|
||||||
* @param value name
|
* @param value name
|
||||||
*/
|
*/
|
||||||
void DialogCutSpline::setPointName(const QString &value)
|
void DialogCutSpline::SetPointName(const QString &value)
|
||||||
{
|
{
|
||||||
pointName = value;
|
pointName = value;
|
||||||
ui->lineEditNamePoint->setText(pointName);
|
ui->lineEditNamePoint->setText(pointName);
|
||||||
|
@ -91,10 +91,10 @@ void DialogCutSpline::setPointName(const QString &value)
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief setFormula set string of formula
|
* @brief SetFormula set string of formula
|
||||||
* @param value formula
|
* @param value formula
|
||||||
*/
|
*/
|
||||||
void DialogCutSpline::setFormula(const QString &value)
|
void DialogCutSpline::SetFormula(const QString &value)
|
||||||
{
|
{
|
||||||
formula = qApp->FormulaToUser(value);
|
formula = qApp->FormulaToUser(value);
|
||||||
// increase height if needed. TODO : see if I can get the max number of caracters in one line
|
// increase height if needed. TODO : see if I can get the max number of caracters in one line
|
||||||
|
@ -181,10 +181,10 @@ void DialogCutSpline::ShowVisualization()
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief getFormula return string of formula
|
* @brief GetFormula return string of formula
|
||||||
* @return formula
|
* @return formula
|
||||||
*/
|
*/
|
||||||
QString DialogCutSpline::getFormula() const
|
QString DialogCutSpline::GetFormula() const
|
||||||
{
|
{
|
||||||
return qApp->FormulaFromUser(formula);
|
return qApp->FormulaFromUser(formula);
|
||||||
}
|
}
|
||||||
|
|
|
@ -48,10 +48,10 @@ public:
|
||||||
DialogCutSpline(const VContainer *data, const quint32 &toolId, QWidget *parent = nullptr);
|
DialogCutSpline(const VContainer *data, const quint32 &toolId, QWidget *parent = nullptr);
|
||||||
~DialogCutSpline();
|
~DialogCutSpline();
|
||||||
|
|
||||||
void setPointName(const QString &value);
|
void SetPointName(const QString &value);
|
||||||
|
|
||||||
QString getFormula() const;
|
QString GetFormula() const;
|
||||||
void setFormula(const QString &value);
|
void SetFormula(const QString &value);
|
||||||
|
|
||||||
quint32 getSplineId() const;
|
quint32 getSplineId() const;
|
||||||
void setSplineId(const quint32 &value);
|
void setSplineId(const quint32 &value);
|
||||||
|
|
|
@ -80,10 +80,10 @@ DialogCutSplinePath::~DialogCutSplinePath()
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief setPointName set name of point
|
* @brief SetPointName set name of point
|
||||||
* @param value name
|
* @param value name
|
||||||
*/
|
*/
|
||||||
void DialogCutSplinePath::setPointName(const QString &value)
|
void DialogCutSplinePath::SetPointName(const QString &value)
|
||||||
{
|
{
|
||||||
pointName = value;
|
pointName = value;
|
||||||
ui->lineEditNamePoint->setText(pointName);
|
ui->lineEditNamePoint->setText(pointName);
|
||||||
|
@ -91,10 +91,10 @@ void DialogCutSplinePath::setPointName(const QString &value)
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief setFormula set string of formula
|
* @brief SetFormula set string of formula
|
||||||
* @param value formula
|
* @param value formula
|
||||||
*/
|
*/
|
||||||
void DialogCutSplinePath::setFormula(const QString &value)
|
void DialogCutSplinePath::SetFormula(const QString &value)
|
||||||
{
|
{
|
||||||
formula = qApp->FormulaToUser(value);
|
formula = qApp->FormulaToUser(value);
|
||||||
// increase height if needed. TODO : see if I can get the max number of caracters in one line
|
// increase height if needed. TODO : see if I can get the max number of caracters in one line
|
||||||
|
@ -181,10 +181,10 @@ void DialogCutSplinePath::ShowVisualization()
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief getFormula return string of formula
|
* @brief GetFormula return string of formula
|
||||||
* @return formula
|
* @return formula
|
||||||
*/
|
*/
|
||||||
QString DialogCutSplinePath::getFormula() const
|
QString DialogCutSplinePath::GetFormula() const
|
||||||
{
|
{
|
||||||
return qApp->FormulaFromUser(formula);
|
return qApp->FormulaFromUser(formula);
|
||||||
}
|
}
|
||||||
|
|
|
@ -48,10 +48,10 @@ public:
|
||||||
DialogCutSplinePath(const VContainer *data, const quint32 &toolId, QWidget *parent = nullptr);
|
DialogCutSplinePath(const VContainer *data, const quint32 &toolId, QWidget *parent = nullptr);
|
||||||
~DialogCutSplinePath();
|
~DialogCutSplinePath();
|
||||||
|
|
||||||
void setPointName(const QString &value);
|
void SetPointName(const QString &value);
|
||||||
|
|
||||||
QString getFormula() const;
|
QString GetFormula() const;
|
||||||
void setFormula(const QString &value);
|
void SetFormula(const QString &value);
|
||||||
|
|
||||||
quint32 getSplinePathId() const;
|
quint32 getSplinePathId() const;
|
||||||
void setSplinePathId(const quint32 &value);
|
void setSplinePathId(const quint32 &value);
|
||||||
|
|
|
@ -121,7 +121,7 @@ void DialogEditWrongFormula::closeEvent(QCloseEvent *event)
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void DialogEditWrongFormula::setFormula(const QString &value)
|
void DialogEditWrongFormula::SetFormula(const QString &value)
|
||||||
{
|
{
|
||||||
formula = qApp->FormulaToUser(value);
|
formula = qApp->FormulaToUser(value);
|
||||||
// increase height if needed. TODO : see if I can get the max number of caracters in one line
|
// increase height if needed. TODO : see if I can get the max number of caracters in one line
|
||||||
|
@ -147,7 +147,7 @@ void DialogEditWrongFormula::setPostfix(const QString &value)
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
QString DialogEditWrongFormula::getFormula() const
|
QString DialogEditWrongFormula::GetFormula() const
|
||||||
{
|
{
|
||||||
return qApp->FormulaFromUser(formula);
|
return qApp->FormulaFromUser(formula);
|
||||||
}
|
}
|
||||||
|
|
|
@ -51,8 +51,8 @@ public:
|
||||||
explicit DialogEditWrongFormula(const VContainer *data, const quint32 &toolId, QWidget *parent = nullptr);
|
explicit DialogEditWrongFormula(const VContainer *data, const quint32 &toolId, QWidget *parent = nullptr);
|
||||||
~DialogEditWrongFormula();
|
~DialogEditWrongFormula();
|
||||||
|
|
||||||
QString getFormula() const;
|
QString GetFormula() const;
|
||||||
void setFormula(const QString &value);
|
void SetFormula(const QString &value);
|
||||||
void setCheckZero(bool value);
|
void setCheckZero(bool value);
|
||||||
void setPostfix(const QString &value);
|
void setPostfix(const QString &value);
|
||||||
public slots:
|
public slots:
|
||||||
|
|
|
@ -154,10 +154,10 @@ void DialogEndLine::ChosenObject(quint32 id, const SceneObject &type)
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief setPointName set name of point
|
* @brief SetPointName set name of point
|
||||||
* @param value name
|
* @param value name
|
||||||
*/
|
*/
|
||||||
void DialogEndLine::setPointName(const QString &value)
|
void DialogEndLine::SetPointName(const QString &value)
|
||||||
{
|
{
|
||||||
pointName = value;
|
pointName = value;
|
||||||
ui->lineEditNamePoint->setText(pointName);
|
ui->lineEditNamePoint->setText(pointName);
|
||||||
|
@ -165,10 +165,10 @@ void DialogEndLine::setPointName(const QString &value)
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief setTypeLine set type of line
|
* @brief SetTypeLine set type of line
|
||||||
* @param value type
|
* @param value type
|
||||||
*/
|
*/
|
||||||
void DialogEndLine::setTypeLine(const QString &value)
|
void DialogEndLine::SetTypeLine(const QString &value)
|
||||||
{
|
{
|
||||||
ChangeCurrentData(ui->comboBoxLineType, value);
|
ChangeCurrentData(ui->comboBoxLineType, value);
|
||||||
line->setLineStyle(VAbstractTool::LineStyleToPenStyle(value));
|
line->setLineStyle(VAbstractTool::LineStyleToPenStyle(value));
|
||||||
|
@ -176,10 +176,10 @@ void DialogEndLine::setTypeLine(const QString &value)
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief setFormula set string of formula
|
* @brief SetFormula set string of formula
|
||||||
* @param value formula
|
* @param value formula
|
||||||
*/
|
*/
|
||||||
void DialogEndLine::setFormula(const QString &value)
|
void DialogEndLine::SetFormula(const QString &value)
|
||||||
{
|
{
|
||||||
formulaLength = qApp->FormulaToUser(value);
|
formulaLength = qApp->FormulaToUser(value);
|
||||||
// increase height if needed. TODO : see if I can get the max number of caracters in one line
|
// increase height if needed. TODO : see if I can get the max number of caracters in one line
|
||||||
|
@ -195,10 +195,10 @@ void DialogEndLine::setFormula(const QString &value)
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief setAngle set angle of line
|
* @brief SetAngle set angle of line
|
||||||
* @param value angle in degree
|
* @param value angle in degree
|
||||||
*/
|
*/
|
||||||
void DialogEndLine::setAngle(const QString &value)
|
void DialogEndLine::SetAngle(const QString &value)
|
||||||
{
|
{
|
||||||
formulaAngle = qApp->FormulaToUser(value);
|
formulaAngle = qApp->FormulaToUser(value);
|
||||||
// increase height if needed. TODO : see if I can get the max number of caracters in one line
|
// increase height if needed. TODO : see if I can get the max number of caracters in one line
|
||||||
|
@ -208,29 +208,29 @@ void DialogEndLine::setAngle(const QString &value)
|
||||||
this->DeployAngleTextEdit();
|
this->DeployAngleTextEdit();
|
||||||
}
|
}
|
||||||
ui->plainTextEditAngle->setPlainText(formulaAngle);
|
ui->plainTextEditAngle->setPlainText(formulaAngle);
|
||||||
line->setAngle(formulaAngle);
|
line->SetAngle(formulaAngle);
|
||||||
MoveCursorToEnd(ui->plainTextEditAngle);
|
MoveCursorToEnd(ui->plainTextEditAngle);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief setBasePointId set id base point of line
|
* @brief SetBasePointId set id base point of line
|
||||||
* @param value id
|
* @param value id
|
||||||
*/
|
*/
|
||||||
void DialogEndLine::setBasePointId(const quint32 &value)
|
void DialogEndLine::SetBasePointId(const quint32 &value)
|
||||||
{
|
{
|
||||||
setCurrentPointId(ui->comboBoxBasePoint, value);
|
setCurrentPointId(ui->comboBoxBasePoint, value);
|
||||||
line->setPoint1Id(value);
|
line->setPoint1Id(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
QString DialogEndLine::getLineColor() const
|
QString DialogEndLine::GetLineColor() const
|
||||||
{
|
{
|
||||||
return GetLineColor(ui->comboBoxLineColor);
|
return GetComboBoxCurrentData(ui->comboBoxLineColor);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void DialogEndLine::setLineColor(const QString &value)
|
void DialogEndLine::SetLineColor(const QString &value)
|
||||||
{
|
{
|
||||||
ChangeCurrentData(ui->comboBoxLineColor, value);
|
ChangeCurrentData(ui->comboBoxLineColor, value);
|
||||||
}
|
}
|
||||||
|
@ -249,7 +249,7 @@ void DialogEndLine::ShowDialog(bool click)
|
||||||
/*We will ignore click if poinet is in point circle*/
|
/*We will ignore click if poinet is in point circle*/
|
||||||
VMainGraphicsScene *scene = qApp->getCurrentScene();
|
VMainGraphicsScene *scene = qApp->getCurrentScene();
|
||||||
SCASSERT(scene != nullptr);
|
SCASSERT(scene != nullptr);
|
||||||
const QSharedPointer<VPointF> point = data->GeometricObject<VPointF>(getBasePointId());
|
const QSharedPointer<VPointF> point = data->GeometricObject<VPointF>(GetBasePointId());
|
||||||
QLineF line = QLineF(point->toQPointF(), scene->getScenePos());
|
QLineF line = QLineF(point->toQPointF(), scene->getScenePos());
|
||||||
|
|
||||||
//Radius of point circle, but little bigger. Need handle with hover sizes.
|
//Radius of point circle, but little bigger. Need handle with hover sizes.
|
||||||
|
@ -260,7 +260,7 @@ void DialogEndLine::ShowDialog(bool click)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this->setModal(true);
|
this->setModal(true);
|
||||||
this->setAngle(line->Angle());//Show in dialog angle what user choose
|
this->SetAngle(line->Angle());//Show in dialog angle what user choose
|
||||||
emit ToolTip("");
|
emit ToolTip("");
|
||||||
timerFormula->start();
|
timerFormula->start();
|
||||||
this->show();
|
this->show();
|
||||||
|
@ -291,10 +291,10 @@ void DialogEndLine::SaveData()
|
||||||
formulaAngle = ui->plainTextEditAngle->toPlainText();
|
formulaAngle = ui->plainTextEditAngle->toPlainText();
|
||||||
formulaAngle.replace("\n", " ");
|
formulaAngle.replace("\n", " ");
|
||||||
|
|
||||||
line->setPoint1Id(getBasePointId());
|
line->setPoint1Id(GetBasePointId());
|
||||||
line->setLength(formulaLength);
|
line->setLength(formulaLength);
|
||||||
line->setAngle(formulaAngle);
|
line->SetAngle(formulaAngle);
|
||||||
line->setLineStyle(VAbstractTool::LineStyleToPenStyle(getTypeLine()));
|
line->setLineStyle(VAbstractTool::LineStyleToPenStyle(GetTypeLine()));
|
||||||
line->RefreshGeometry();
|
line->RefreshGeometry();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -318,40 +318,40 @@ DialogEndLine::~DialogEndLine()
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief getTypeLine return type of line
|
* @brief GetTypeLine return type of line
|
||||||
* @return type
|
* @return type
|
||||||
*/
|
*/
|
||||||
QString DialogEndLine::getTypeLine() const
|
QString DialogEndLine::GetTypeLine() const
|
||||||
{
|
{
|
||||||
return GetTypeLine(ui->comboBoxLineType);
|
return GetComboBoxCurrentData(ui->comboBoxLineType);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief getFormula return string of formula
|
* @brief GetFormula return string of formula
|
||||||
* @return formula
|
* @return formula
|
||||||
*/
|
*/
|
||||||
QString DialogEndLine::getFormula() const
|
QString DialogEndLine::GetFormula() const
|
||||||
{
|
{
|
||||||
return qApp->FormulaFromUser(formulaLength);
|
return qApp->FormulaFromUser(formulaLength);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief getAngle return formula angle of line
|
* @brief GetAngle return formula angle of line
|
||||||
* @return angle formula
|
* @return angle formula
|
||||||
*/
|
*/
|
||||||
QString DialogEndLine::getAngle() const
|
QString DialogEndLine::GetAngle() const
|
||||||
{
|
{
|
||||||
return qApp->FormulaFromUser(formulaAngle);
|
return qApp->FormulaFromUser(formulaAngle);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief getBasePointId return id base point of line
|
* @brief GetBasePointId return id base point of line
|
||||||
* @return id
|
* @return id
|
||||||
*/
|
*/
|
||||||
quint32 DialogEndLine::getBasePointId() const
|
quint32 DialogEndLine::GetBasePointId() const
|
||||||
{
|
{
|
||||||
return getCurrentObjectId(ui->comboBoxBasePoint);
|
return getCurrentObjectId(ui->comboBoxBasePoint);
|
||||||
}
|
}
|
||||||
|
|
|
@ -48,22 +48,22 @@ public:
|
||||||
DialogEndLine(const VContainer *data, const quint32 &toolId, QWidget *parent = nullptr);
|
DialogEndLine(const VContainer *data, const quint32 &toolId, QWidget *parent = nullptr);
|
||||||
~DialogEndLine();
|
~DialogEndLine();
|
||||||
|
|
||||||
void setPointName(const QString &value);
|
void SetPointName(const QString &value);
|
||||||
|
|
||||||
QString getTypeLine() const;
|
QString GetTypeLine() const;
|
||||||
void setTypeLine(const QString &value);
|
void SetTypeLine(const QString &value);
|
||||||
|
|
||||||
QString getFormula() const;
|
QString GetFormula() const;
|
||||||
void setFormula(const QString &value);
|
void SetFormula(const QString &value);
|
||||||
|
|
||||||
QString getAngle() const;
|
QString GetAngle() const;
|
||||||
void setAngle(const QString &value);
|
void SetAngle(const QString &value);
|
||||||
|
|
||||||
quint32 getBasePointId() const;
|
quint32 GetBasePointId() const;
|
||||||
void setBasePointId(const quint32 &value);
|
void SetBasePointId(const quint32 &value);
|
||||||
|
|
||||||
QString getLineColor() const;
|
QString GetLineColor() const;
|
||||||
void setLineColor(const QString &value);
|
void SetLineColor(const QString &value);
|
||||||
|
|
||||||
virtual void ShowDialog(bool click);
|
virtual void ShowDialog(bool click);
|
||||||
public slots:
|
public slots:
|
||||||
|
|
|
@ -79,10 +79,10 @@ DialogHeight::~DialogHeight()
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief setPointName set name of point
|
* @brief SetPointName set name of point
|
||||||
* @param value name
|
* @param value name
|
||||||
*/
|
*/
|
||||||
void DialogHeight::setPointName(const QString &value)
|
void DialogHeight::SetPointName(const QString &value)
|
||||||
{
|
{
|
||||||
pointName = value;
|
pointName = value;
|
||||||
ui->lineEditNamePoint->setText(pointName);
|
ui->lineEditNamePoint->setText(pointName);
|
||||||
|
@ -90,10 +90,10 @@ void DialogHeight::setPointName(const QString &value)
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief setTypeLine set type of line
|
* @brief SetTypeLine set type of line
|
||||||
* @param value type
|
* @param value type
|
||||||
*/
|
*/
|
||||||
void DialogHeight::setTypeLine(const QString &value)
|
void DialogHeight::SetTypeLine(const QString &value)
|
||||||
{
|
{
|
||||||
ChangeCurrentData(ui->comboBoxLineType, value);
|
ChangeCurrentData(ui->comboBoxLineType, value);
|
||||||
line->setLineStyle(VAbstractTool::LineStyleToPenStyle(value));
|
line->setLineStyle(VAbstractTool::LineStyleToPenStyle(value));
|
||||||
|
@ -101,10 +101,10 @@ void DialogHeight::setTypeLine(const QString &value)
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief setBasePointId set id base point of height
|
* @brief SetBasePointId set id base point of height
|
||||||
* @param value id
|
* @param value id
|
||||||
*/
|
*/
|
||||||
void DialogHeight::setBasePointId(const quint32 &value)
|
void DialogHeight::SetBasePointId(const quint32 &value)
|
||||||
{
|
{
|
||||||
setCurrentPointId(ui->comboBoxBasePoint, value);
|
setCurrentPointId(ui->comboBoxBasePoint, value);
|
||||||
line->setPoint1Id(value);
|
line->setPoint1Id(value);
|
||||||
|
@ -112,10 +112,10 @@ void DialogHeight::setBasePointId(const quint32 &value)
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief setP1LineId set id first point of line
|
* @brief SetP1LineId set id first point of line
|
||||||
* @param value id
|
* @param value id
|
||||||
*/
|
*/
|
||||||
void DialogHeight::setP1LineId(const quint32 &value)
|
void DialogHeight::SetP1LineId(const quint32 &value)
|
||||||
{
|
{
|
||||||
setCurrentPointId(ui->comboBoxP1Line, value);
|
setCurrentPointId(ui->comboBoxP1Line, value);
|
||||||
line->setLineP1Id(value);
|
line->setLineP1Id(value);
|
||||||
|
@ -123,23 +123,23 @@ void DialogHeight::setP1LineId(const quint32 &value)
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief setP2LineId set id second point of line
|
* @brief SetP2LineId set id second point of line
|
||||||
* @param value id
|
* @param value id
|
||||||
*/
|
*/
|
||||||
void DialogHeight::setP2LineId(const quint32 &value)
|
void DialogHeight::SetP2LineId(const quint32 &value)
|
||||||
{
|
{
|
||||||
setCurrentPointId(ui->comboBoxP2Line, value);
|
setCurrentPointId(ui->comboBoxP2Line, value);
|
||||||
line->setLineP2Id(value);
|
line->setLineP2Id(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
QString DialogHeight::getLineColor() const
|
QString DialogHeight::GetLineColor() const
|
||||||
{
|
{
|
||||||
return GetLineColor(ui->comboBoxLineColor);
|
return GetComboBoxCurrentData(ui->comboBoxLineColor);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void DialogHeight::setLineColor(const QString &value)
|
void DialogHeight::SetLineColor(const QString &value)
|
||||||
{
|
{
|
||||||
ChangeCurrentData(ui->comboBoxLineColor, value);
|
ChangeCurrentData(ui->comboBoxLineColor, value);
|
||||||
}
|
}
|
||||||
|
@ -208,10 +208,10 @@ void DialogHeight::SaveData()
|
||||||
{
|
{
|
||||||
pointName = ui->lineEditNamePoint->text();
|
pointName = ui->lineEditNamePoint->text();
|
||||||
|
|
||||||
line->setPoint1Id(getBasePointId());
|
line->setPoint1Id(GetBasePointId());
|
||||||
line->setLineP1Id(getP1LineId());
|
line->setLineP1Id(GetP1LineId());
|
||||||
line->setLineP2Id(getP2LineId());
|
line->setLineP2Id(GetP2LineId());
|
||||||
line->setLineStyle(VAbstractTool::LineStyleToPenStyle(getTypeLine()));
|
line->setLineStyle(VAbstractTool::LineStyleToPenStyle(GetTypeLine()));
|
||||||
line->RefreshGeometry();
|
line->RefreshGeometry();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -272,40 +272,40 @@ void DialogHeight::ShowVisualization()
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief getTypeLine return type of line
|
* @brief GetTypeLine return type of line
|
||||||
* @return type
|
* @return type
|
||||||
*/
|
*/
|
||||||
QString DialogHeight::getTypeLine() const
|
QString DialogHeight::GetTypeLine() const
|
||||||
{
|
{
|
||||||
return GetTypeLine(ui->comboBoxLineType);
|
return GetComboBoxCurrentData(ui->comboBoxLineType);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief getBasePointId return id base point of height
|
* @brief GetBasePointId return id base point of height
|
||||||
* @return id
|
* @return id
|
||||||
*/
|
*/
|
||||||
quint32 DialogHeight::getBasePointId() const
|
quint32 DialogHeight::GetBasePointId() const
|
||||||
{
|
{
|
||||||
return getCurrentObjectId(ui->comboBoxBasePoint);
|
return getCurrentObjectId(ui->comboBoxBasePoint);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief getP1LineId return id first point of line
|
* @brief GetP1LineId return id first point of line
|
||||||
* @return id id
|
* @return id id
|
||||||
*/
|
*/
|
||||||
quint32 DialogHeight::getP1LineId() const
|
quint32 DialogHeight::GetP1LineId() const
|
||||||
{
|
{
|
||||||
return getCurrentObjectId(ui->comboBoxP1Line);
|
return getCurrentObjectId(ui->comboBoxP1Line);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief getP2LineId return id second point of line
|
* @brief GetP2LineId return id second point of line
|
||||||
* @return id
|
* @return id
|
||||||
*/
|
*/
|
||||||
quint32 DialogHeight::getP2LineId() const
|
quint32 DialogHeight::GetP2LineId() const
|
||||||
{
|
{
|
||||||
return getCurrentObjectId(ui->comboBoxP2Line);
|
return getCurrentObjectId(ui->comboBoxP2Line);
|
||||||
}
|
}
|
||||||
|
|
|
@ -48,22 +48,22 @@ public:
|
||||||
DialogHeight(const VContainer *data, const quint32 &toolId, QWidget *parent = nullptr);
|
DialogHeight(const VContainer *data, const quint32 &toolId, QWidget *parent = nullptr);
|
||||||
~DialogHeight();
|
~DialogHeight();
|
||||||
|
|
||||||
void setPointName(const QString &value);
|
void SetPointName(const QString &value);
|
||||||
|
|
||||||
QString getTypeLine() const;
|
QString GetTypeLine() const;
|
||||||
void setTypeLine(const QString &value);
|
void SetTypeLine(const QString &value);
|
||||||
|
|
||||||
quint32 getBasePointId() const;
|
quint32 GetBasePointId() const;
|
||||||
void setBasePointId(const quint32 &value);
|
void SetBasePointId(const quint32 &value);
|
||||||
|
|
||||||
quint32 getP1LineId() const;
|
quint32 GetP1LineId() const;
|
||||||
void setP1LineId(const quint32 &value);
|
void SetP1LineId(const quint32 &value);
|
||||||
|
|
||||||
quint32 getP2LineId() const;
|
quint32 GetP2LineId() const;
|
||||||
void setP2LineId(const quint32 &value);
|
void SetP2LineId(const quint32 &value);
|
||||||
|
|
||||||
QString getLineColor() const;
|
QString GetLineColor() const;
|
||||||
void setLineColor(const QString &value);
|
void SetLineColor(const QString &value);
|
||||||
public slots:
|
public slots:
|
||||||
virtual void ChosenObject(quint32 id, const SceneObject &type);
|
virtual void ChosenObject(quint32 id, const SceneObject &type);
|
||||||
virtual void PointNameChanged();
|
virtual void PointNameChanged();
|
||||||
|
|
|
@ -78,10 +78,10 @@ DialogLine::~DialogLine()
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief setSecondPoint set id second point
|
* @brief SetSecondPoint set id second point
|
||||||
* @param value id
|
* @param value id
|
||||||
*/
|
*/
|
||||||
void DialogLine::setSecondPoint(const quint32 &value)
|
void DialogLine::SetSecondPoint(const quint32 &value)
|
||||||
{
|
{
|
||||||
setCurrentPointId(ui->comboBoxSecondPoint, value);
|
setCurrentPointId(ui->comboBoxSecondPoint, value);
|
||||||
line->setPoint2Id(value);
|
line->setPoint2Id(value);
|
||||||
|
@ -89,33 +89,33 @@ void DialogLine::setSecondPoint(const quint32 &value)
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief setTypeLine set type of line
|
* @brief SetTypeLine set type of line
|
||||||
* @param value type
|
* @param value type
|
||||||
*/
|
*/
|
||||||
void DialogLine::setTypeLine(const QString &value)
|
void DialogLine::SetTypeLine(const QString &value)
|
||||||
{
|
{
|
||||||
ChangeCurrentData(ui->comboBoxLineType, value);
|
ChangeCurrentData(ui->comboBoxLineType, value);
|
||||||
line->setLineStyle(VAbstractTool::LineStyleToPenStyle(value));
|
line->setLineStyle(VAbstractTool::LineStyleToPenStyle(value));
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
QString DialogLine::getLineColor() const
|
QString DialogLine::GetLineColor() const
|
||||||
{
|
{
|
||||||
return GetLineColor(ui->comboBoxLineColor);
|
return GetComboBoxCurrentData(ui->comboBoxLineColor);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void DialogLine::setLineColor(const QString &value)
|
void DialogLine::SetLineColor(const QString &value)
|
||||||
{
|
{
|
||||||
ChangeCurrentData(ui->comboBoxLineColor, value);
|
ChangeCurrentData(ui->comboBoxLineColor, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief setFirstPoint set id first point
|
* @brief SetFirstPoint set id first point
|
||||||
* @param value id
|
* @param value id
|
||||||
*/
|
*/
|
||||||
void DialogLine::setFirstPoint(const quint32 &value)
|
void DialogLine::SetFirstPoint(const quint32 &value)
|
||||||
{
|
{
|
||||||
setCurrentPointId(ui->comboBoxFirstPoint, value);
|
setCurrentPointId(ui->comboBoxFirstPoint, value);
|
||||||
line->setPoint1Id(value);
|
line->setPoint1Id(value);
|
||||||
|
@ -164,9 +164,9 @@ void DialogLine::ShowVisualization()
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void DialogLine::SaveData()
|
void DialogLine::SaveData()
|
||||||
{
|
{
|
||||||
line->setPoint1Id(getFirstPoint());
|
line->setPoint1Id(GetFirstPoint());
|
||||||
line->setPoint2Id(getSecondPoint());
|
line->setPoint2Id(GetSecondPoint());
|
||||||
line->setLineStyle(VAbstractTool::LineStyleToPenStyle(getTypeLine()));
|
line->setLineStyle(VAbstractTool::LineStyleToPenStyle(GetTypeLine()));
|
||||||
line->RefreshGeometry();
|
line->RefreshGeometry();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -211,30 +211,30 @@ void DialogLine::ChosenObject(quint32 id, const SceneObject &type)
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief getFirstPoint return id first point
|
* @brief GetFirstPoint return id first point
|
||||||
* @return id
|
* @return id
|
||||||
*/
|
*/
|
||||||
quint32 DialogLine::getFirstPoint() const
|
quint32 DialogLine::GetFirstPoint() const
|
||||||
{
|
{
|
||||||
return qvariant_cast<quint32>(ui->comboBoxFirstPoint->currentData());
|
return qvariant_cast<quint32>(ui->comboBoxFirstPoint->currentData());
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief getSecondPoint return id second point
|
* @brief GetSecondPoint return id second point
|
||||||
* @return id
|
* @return id
|
||||||
*/
|
*/
|
||||||
quint32 DialogLine::getSecondPoint() const
|
quint32 DialogLine::GetSecondPoint() const
|
||||||
{
|
{
|
||||||
return qvariant_cast<quint32>(ui->comboBoxSecondPoint->currentData());
|
return qvariant_cast<quint32>(ui->comboBoxSecondPoint->currentData());
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief getTypeLine return type of line
|
* @brief GetTypeLine return type of line
|
||||||
* @return type
|
* @return type
|
||||||
*/
|
*/
|
||||||
QString DialogLine::getTypeLine() const
|
QString DialogLine::GetTypeLine() const
|
||||||
{
|
{
|
||||||
return GetTypeLine(ui->comboBoxLineType);
|
return GetComboBoxCurrentData(ui->comboBoxLineType);
|
||||||
}
|
}
|
||||||
|
|
|
@ -48,17 +48,17 @@ public:
|
||||||
DialogLine(const VContainer *data, const quint32 &toolId, QWidget *parent = nullptr);
|
DialogLine(const VContainer *data, const quint32 &toolId, QWidget *parent = nullptr);
|
||||||
~DialogLine();
|
~DialogLine();
|
||||||
|
|
||||||
quint32 getFirstPoint() const;
|
quint32 GetFirstPoint() const;
|
||||||
void setFirstPoint(const quint32 &value);
|
void SetFirstPoint(const quint32 &value);
|
||||||
|
|
||||||
quint32 getSecondPoint() const;
|
quint32 GetSecondPoint() const;
|
||||||
void setSecondPoint(const quint32 &value);
|
void SetSecondPoint(const quint32 &value);
|
||||||
|
|
||||||
QString getTypeLine() const;
|
QString GetTypeLine() const;
|
||||||
void setTypeLine(const QString &value);
|
void SetTypeLine(const QString &value);
|
||||||
|
|
||||||
QString getLineColor() const;
|
QString GetLineColor() const;
|
||||||
void setLineColor(const QString &value);
|
void SetLineColor(const QString &value);
|
||||||
public slots:
|
public slots:
|
||||||
virtual void ChosenObject(quint32 id, const SceneObject &type);
|
virtual void ChosenObject(quint32 id, const SceneObject &type);
|
||||||
virtual void PointNameChanged();
|
virtual void PointNameChanged();
|
||||||
|
|
|
@ -165,10 +165,10 @@ void DialogLineIntersect::SaveData()
|
||||||
{
|
{
|
||||||
pointName = ui->lineEditNamePoint->text();
|
pointName = ui->lineEditNamePoint->text();
|
||||||
|
|
||||||
line->setPoint1Id(getP1Line1());
|
line->setPoint1Id(GetP1Line1());
|
||||||
line->setLine1P2Id(getP2Line1());
|
line->setLine1P2Id(GetP2Line1());
|
||||||
line->setLine2P1Id(getP1Line2());
|
line->setLine2P1Id(GetP1Line2());
|
||||||
line->setLine2P2Id(getP2Line2());
|
line->setLine2P2Id(GetP2Line2());
|
||||||
line->RefreshGeometry();
|
line->RefreshGeometry();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -263,10 +263,10 @@ void DialogLineIntersect::CheckState()
|
||||||
*/
|
*/
|
||||||
bool DialogLineIntersect::CheckIntersecion()
|
bool DialogLineIntersect::CheckIntersecion()
|
||||||
{
|
{
|
||||||
const QSharedPointer<VPointF> p1L1 = data->GeometricObject<VPointF>(getP1Line1());
|
const QSharedPointer<VPointF> p1L1 = data->GeometricObject<VPointF>(GetP1Line1());
|
||||||
const QSharedPointer<VPointF> p2L1 = data->GeometricObject<VPointF>(getP2Line1());
|
const QSharedPointer<VPointF> p2L1 = data->GeometricObject<VPointF>(GetP2Line1());
|
||||||
const QSharedPointer<VPointF> p1L2 = data->GeometricObject<VPointF>(getP1Line2());
|
const QSharedPointer<VPointF> p1L2 = data->GeometricObject<VPointF>(GetP1Line2());
|
||||||
const QSharedPointer<VPointF> p2L2 = data->GeometricObject<VPointF>(getP2Line2());
|
const QSharedPointer<VPointF> p2L2 = data->GeometricObject<VPointF>(GetP2Line2());
|
||||||
|
|
||||||
QLineF line1(p1L1->toQPointF(), p2L1->toQPointF());
|
QLineF line1(p1L1->toQPointF(), p2L1->toQPointF());
|
||||||
QLineF line2(p1L2->toQPointF(), p2L2->toQPointF());
|
QLineF line2(p1L2->toQPointF(), p2L2->toQPointF());
|
||||||
|
@ -284,10 +284,10 @@ bool DialogLineIntersect::CheckIntersecion()
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief setP2Line2 set id second point of second line
|
* @brief SetP2Line2 set id second point of second line
|
||||||
* @param value id
|
* @param value id
|
||||||
*/
|
*/
|
||||||
void DialogLineIntersect::setP2Line2(const quint32 &value)
|
void DialogLineIntersect::SetP2Line2(const quint32 &value)
|
||||||
{
|
{
|
||||||
setCurrentPointId(ui->comboBoxP2Line2, value);
|
setCurrentPointId(ui->comboBoxP2Line2, value);
|
||||||
line->setLine2P2Id(value);
|
line->setLine2P2Id(value);
|
||||||
|
@ -295,10 +295,10 @@ void DialogLineIntersect::setP2Line2(const quint32 &value)
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief setP1Line2 set id first point of second line
|
* @brief SetP1Line2 set id first point of second line
|
||||||
* @param value id
|
* @param value id
|
||||||
*/
|
*/
|
||||||
void DialogLineIntersect::setP1Line2(const quint32 &value)
|
void DialogLineIntersect::SetP1Line2(const quint32 &value)
|
||||||
{
|
{
|
||||||
setCurrentPointId(ui->comboBoxP1Line2, value);
|
setCurrentPointId(ui->comboBoxP1Line2, value);
|
||||||
line->setLine2P1Id(value);
|
line->setLine2P1Id(value);
|
||||||
|
@ -306,10 +306,10 @@ void DialogLineIntersect::setP1Line2(const quint32 &value)
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief setP2Line1 set id second point of first line
|
* @brief SetP2Line1 set id second point of first line
|
||||||
* @param value id
|
* @param value id
|
||||||
*/
|
*/
|
||||||
void DialogLineIntersect::setP2Line1(const quint32 &value)
|
void DialogLineIntersect::SetP2Line1(const quint32 &value)
|
||||||
{
|
{
|
||||||
setCurrentPointId(ui->comboBoxP2Line1, value);
|
setCurrentPointId(ui->comboBoxP2Line1, value);
|
||||||
line->setLine1P2Id(value);
|
line->setLine1P2Id(value);
|
||||||
|
@ -317,10 +317,10 @@ void DialogLineIntersect::setP2Line1(const quint32 &value)
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief setP1Line1 set id first point of first line
|
* @brief SetP1Line1 set id first point of first line
|
||||||
* @param value id
|
* @param value id
|
||||||
*/
|
*/
|
||||||
void DialogLineIntersect::setP1Line1(const quint32 &value)
|
void DialogLineIntersect::SetP1Line1(const quint32 &value)
|
||||||
{
|
{
|
||||||
setCurrentPointId(ui->comboBoxP1Line1, value);
|
setCurrentPointId(ui->comboBoxP1Line1, value);
|
||||||
line->setPoint1Id(value);
|
line->setPoint1Id(value);
|
||||||
|
@ -328,10 +328,10 @@ void DialogLineIntersect::setP1Line1(const quint32 &value)
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief setPointName set name of point
|
* @brief SetPointName set name of point
|
||||||
* @param value name of point
|
* @param value name of point
|
||||||
*/
|
*/
|
||||||
void DialogLineIntersect::setPointName(const QString &value)
|
void DialogLineIntersect::SetPointName(const QString &value)
|
||||||
{
|
{
|
||||||
pointName = value;
|
pointName = value;
|
||||||
ui->lineEditNamePoint->setText(pointName);
|
ui->lineEditNamePoint->setText(pointName);
|
||||||
|
@ -339,40 +339,40 @@ void DialogLineIntersect::setPointName(const QString &value)
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief getP1Line1 return id first point of first line
|
* @brief GetP1Line1 return id first point of first line
|
||||||
* @return id
|
* @return id
|
||||||
*/
|
*/
|
||||||
quint32 DialogLineIntersect::getP1Line1() const
|
quint32 DialogLineIntersect::GetP1Line1() const
|
||||||
{
|
{
|
||||||
return getCurrentObjectId(ui->comboBoxP1Line1);
|
return getCurrentObjectId(ui->comboBoxP1Line1);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief getP2Line1 return id second point of first line
|
* @brief GetP2Line1 return id second point of first line
|
||||||
* @return id
|
* @return id
|
||||||
*/
|
*/
|
||||||
quint32 DialogLineIntersect::getP2Line1() const
|
quint32 DialogLineIntersect::GetP2Line1() const
|
||||||
{
|
{
|
||||||
return getCurrentObjectId(ui->comboBoxP2Line1);
|
return getCurrentObjectId(ui->comboBoxP2Line1);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief getP1Line2 return id first point of second line
|
* @brief GetP1Line2 return id first point of second line
|
||||||
* @return id
|
* @return id
|
||||||
*/
|
*/
|
||||||
quint32 DialogLineIntersect::getP1Line2() const
|
quint32 DialogLineIntersect::GetP1Line2() const
|
||||||
{
|
{
|
||||||
return getCurrentObjectId(ui->comboBoxP1Line2);
|
return getCurrentObjectId(ui->comboBoxP1Line2);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief getP2Line2 return id second point of second line
|
* @brief GetP2Line2 return id second point of second line
|
||||||
* @return id
|
* @return id
|
||||||
*/
|
*/
|
||||||
quint32 DialogLineIntersect::getP2Line2() const
|
quint32 DialogLineIntersect::GetP2Line2() const
|
||||||
{
|
{
|
||||||
return getCurrentObjectId(ui->comboBoxP2Line2);
|
return getCurrentObjectId(ui->comboBoxP2Line2);
|
||||||
}
|
}
|
||||||
|
|
|
@ -48,19 +48,19 @@ public:
|
||||||
DialogLineIntersect(const VContainer *data, const quint32 &toolId, QWidget *parent = nullptr);
|
DialogLineIntersect(const VContainer *data, const quint32 &toolId, QWidget *parent = nullptr);
|
||||||
~DialogLineIntersect();
|
~DialogLineIntersect();
|
||||||
|
|
||||||
quint32 getP1Line1() const;
|
quint32 GetP1Line1() const;
|
||||||
void setP1Line1(const quint32 &value);
|
void SetP1Line1(const quint32 &value);
|
||||||
|
|
||||||
quint32 getP2Line1() const;
|
quint32 GetP2Line1() const;
|
||||||
void setP2Line1(const quint32 &value);
|
void SetP2Line1(const quint32 &value);
|
||||||
|
|
||||||
quint32 getP1Line2() const;
|
quint32 GetP1Line2() const;
|
||||||
void setP1Line2(const quint32 &value);
|
void SetP1Line2(const quint32 &value);
|
||||||
|
|
||||||
quint32 getP2Line2() const;
|
quint32 GetP2Line2() const;
|
||||||
void setP2Line2(const quint32 &value);
|
void SetP2Line2(const quint32 &value);
|
||||||
|
|
||||||
void setPointName(const QString &value);
|
void SetPointName(const QString &value);
|
||||||
public slots:
|
public slots:
|
||||||
virtual void ChosenObject(quint32 id, const SceneObject &type);
|
virtual void ChosenObject(quint32 id, const SceneObject &type);
|
||||||
void PointChanged();
|
void PointChanged();
|
||||||
|
|
|
@ -89,33 +89,33 @@ DialogLineIntersectAxis::~DialogLineIntersectAxis()
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void DialogLineIntersectAxis::setPointName(const QString &value)
|
void DialogLineIntersectAxis::SetPointName(const QString &value)
|
||||||
{
|
{
|
||||||
pointName = value;
|
pointName = value;
|
||||||
ui->lineEditNamePoint->setText(pointName);
|
ui->lineEditNamePoint->setText(pointName);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
QString DialogLineIntersectAxis::getTypeLine() const
|
QString DialogLineIntersectAxis::GetTypeLine() const
|
||||||
{
|
{
|
||||||
return GetTypeLine(ui->comboBoxLineType);
|
return GetComboBoxCurrentData(ui->comboBoxLineType);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void DialogLineIntersectAxis::setTypeLine(const QString &value)
|
void DialogLineIntersectAxis::SetTypeLine(const QString &value)
|
||||||
{
|
{
|
||||||
ChangeCurrentData(ui->comboBoxLineType, value);
|
ChangeCurrentData(ui->comboBoxLineType, value);
|
||||||
line->setLineStyle(VAbstractTool::LineStyleToPenStyle(value));
|
line->setLineStyle(VAbstractTool::LineStyleToPenStyle(value));
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
QString DialogLineIntersectAxis::getAngle() const
|
QString DialogLineIntersectAxis::GetAngle() const
|
||||||
{
|
{
|
||||||
return qApp->FormulaFromUser(formulaAngle);
|
return qApp->FormulaFromUser(formulaAngle);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void DialogLineIntersectAxis::setAngle(const QString &value)
|
void DialogLineIntersectAxis::SetAngle(const QString &value)
|
||||||
{
|
{
|
||||||
formulaAngle = qApp->FormulaToUser(value);
|
formulaAngle = qApp->FormulaToUser(value);
|
||||||
// increase height if needed. TODO : see if I can get the max number of caracters in one line
|
// increase height if needed. TODO : see if I can get the max number of caracters in one line
|
||||||
|
@ -125,57 +125,57 @@ void DialogLineIntersectAxis::setAngle(const QString &value)
|
||||||
this->DeployAngleTextEdit();
|
this->DeployAngleTextEdit();
|
||||||
}
|
}
|
||||||
ui->plainTextEditFormula->setPlainText(formulaAngle);
|
ui->plainTextEditFormula->setPlainText(formulaAngle);
|
||||||
line->setAngle(formulaAngle);
|
line->SetAngle(formulaAngle);
|
||||||
MoveCursorToEnd(ui->plainTextEditFormula);
|
MoveCursorToEnd(ui->plainTextEditFormula);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
quint32 DialogLineIntersectAxis::getBasePointId() const
|
quint32 DialogLineIntersectAxis::GetBasePointId() const
|
||||||
{
|
{
|
||||||
return getCurrentObjectId(ui->comboBoxAxisPoint);
|
return getCurrentObjectId(ui->comboBoxAxisPoint);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void DialogLineIntersectAxis::setBasePointId(const quint32 &value)
|
void DialogLineIntersectAxis::SetBasePointId(const quint32 &value)
|
||||||
{
|
{
|
||||||
setCurrentPointId(ui->comboBoxAxisPoint, value);
|
setCurrentPointId(ui->comboBoxAxisPoint, value);
|
||||||
line->setAxisPointId(value);
|
line->setAxisPointId(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
quint32 DialogLineIntersectAxis::getFirstPointId() const
|
quint32 DialogLineIntersectAxis::GetFirstPointId() const
|
||||||
{
|
{
|
||||||
return getCurrentObjectId(ui->comboBoxFirstLinePoint);
|
return getCurrentObjectId(ui->comboBoxFirstLinePoint);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void DialogLineIntersectAxis::setFirstPointId(const quint32 &value)
|
void DialogLineIntersectAxis::SetFirstPointId(const quint32 &value)
|
||||||
{
|
{
|
||||||
setCurrentPointId(ui->comboBoxFirstLinePoint, value);
|
setCurrentPointId(ui->comboBoxFirstLinePoint, value);
|
||||||
line->setPoint1Id(value);
|
line->setPoint1Id(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
quint32 DialogLineIntersectAxis::getSecondPointId() const
|
quint32 DialogLineIntersectAxis::GetSecondPointId() const
|
||||||
{
|
{
|
||||||
return getCurrentObjectId(ui->comboBoxSecondLinePoint);
|
return getCurrentObjectId(ui->comboBoxSecondLinePoint);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void DialogLineIntersectAxis::setSecondPointId(const quint32 &value)
|
void DialogLineIntersectAxis::SetSecondPointId(const quint32 &value)
|
||||||
{
|
{
|
||||||
setCurrentPointId(ui->comboBoxSecondLinePoint, value);
|
setCurrentPointId(ui->comboBoxSecondLinePoint, value);
|
||||||
line->setPoint2Id(value);
|
line->setPoint2Id(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
QString DialogLineIntersectAxis::getLineColor() const
|
QString DialogLineIntersectAxis::GetLineColor() const
|
||||||
{
|
{
|
||||||
return GetLineColor(ui->comboBoxLineColor);
|
return GetComboBoxCurrentData(ui->comboBoxLineColor);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void DialogLineIntersectAxis::setLineColor(const QString &value)
|
void DialogLineIntersectAxis::SetLineColor(const QString &value)
|
||||||
{
|
{
|
||||||
ChangeCurrentData(ui->comboBoxLineColor, value);
|
ChangeCurrentData(ui->comboBoxLineColor, value);
|
||||||
}
|
}
|
||||||
|
@ -190,7 +190,7 @@ void DialogLineIntersectAxis::ShowDialog(bool click)
|
||||||
/*We will ignore click if poinet is in point circle*/
|
/*We will ignore click if poinet is in point circle*/
|
||||||
VMainGraphicsScene *scene = qApp->getCurrentScene();
|
VMainGraphicsScene *scene = qApp->getCurrentScene();
|
||||||
SCASSERT(scene != nullptr);
|
SCASSERT(scene != nullptr);
|
||||||
const QSharedPointer<VPointF> point = data->GeometricObject<VPointF>(getBasePointId());
|
const QSharedPointer<VPointF> point = data->GeometricObject<VPointF>(GetBasePointId());
|
||||||
QLineF line = QLineF(point->toQPointF(), scene->getScenePos());
|
QLineF line = QLineF(point->toQPointF(), scene->getScenePos());
|
||||||
|
|
||||||
//Radius of point circle, but little bigger. Need handle with hover sizes.
|
//Radius of point circle, but little bigger. Need handle with hover sizes.
|
||||||
|
@ -201,7 +201,7 @@ void DialogLineIntersectAxis::ShowDialog(bool click)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this->setModal(true);
|
this->setModal(true);
|
||||||
this->setAngle(line->Angle());//Show in dialog angle what user choose
|
this->SetAngle(line->Angle());//Show in dialog angle what user choose
|
||||||
emit ToolTip("");
|
emit ToolTip("");
|
||||||
timerFormula->start();
|
timerFormula->start();
|
||||||
this->show();
|
this->show();
|
||||||
|
@ -331,11 +331,11 @@ void DialogLineIntersectAxis::SaveData()
|
||||||
formulaAngle = ui->plainTextEditFormula->toPlainText();
|
formulaAngle = ui->plainTextEditFormula->toPlainText();
|
||||||
formulaAngle.replace("\n", " ");
|
formulaAngle.replace("\n", " ");
|
||||||
|
|
||||||
line->setPoint1Id(getFirstPointId());
|
line->setPoint1Id(GetFirstPointId());
|
||||||
line->setPoint2Id(getSecondPointId());
|
line->setPoint2Id(GetSecondPointId());
|
||||||
line->setAxisPointId(getBasePointId());
|
line->setAxisPointId(GetBasePointId());
|
||||||
line->setAngle(formulaAngle);
|
line->SetAngle(formulaAngle);
|
||||||
line->setLineStyle(VAbstractTool::LineStyleToPenStyle(getTypeLine()));
|
line->setLineStyle(VAbstractTool::LineStyleToPenStyle(GetTypeLine()));
|
||||||
line->RefreshGeometry();
|
line->RefreshGeometry();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -45,25 +45,25 @@ public:
|
||||||
DialogLineIntersectAxis(const VContainer *data, const quint32 &toolId, QWidget *parent = nullptr);
|
DialogLineIntersectAxis(const VContainer *data, const quint32 &toolId, QWidget *parent = nullptr);
|
||||||
~DialogLineIntersectAxis();
|
~DialogLineIntersectAxis();
|
||||||
|
|
||||||
void setPointName(const QString &value);
|
void SetPointName(const QString &value);
|
||||||
|
|
||||||
QString getTypeLine() const;
|
QString GetTypeLine() const;
|
||||||
void setTypeLine(const QString &value);
|
void SetTypeLine(const QString &value);
|
||||||
|
|
||||||
QString getAngle() const;
|
QString GetAngle() const;
|
||||||
void setAngle(const QString &value);
|
void SetAngle(const QString &value);
|
||||||
|
|
||||||
quint32 getBasePointId() const;
|
quint32 GetBasePointId() const;
|
||||||
void setBasePointId(const quint32 &value);
|
void SetBasePointId(const quint32 &value);
|
||||||
|
|
||||||
quint32 getFirstPointId() const;
|
quint32 GetFirstPointId() const;
|
||||||
void setFirstPointId(const quint32 &value);
|
void SetFirstPointId(const quint32 &value);
|
||||||
|
|
||||||
quint32 getSecondPointId() const;
|
quint32 GetSecondPointId() const;
|
||||||
void setSecondPointId(const quint32 &value);
|
void SetSecondPointId(const quint32 &value);
|
||||||
|
|
||||||
QString getLineColor() const;
|
QString GetLineColor() const;
|
||||||
void setLineColor(const QString &value);
|
void SetLineColor(const QString &value);
|
||||||
|
|
||||||
virtual void ShowDialog(bool click);
|
virtual void ShowDialog(bool click);
|
||||||
public slots:
|
public slots:
|
||||||
|
|
|
@ -177,11 +177,11 @@ void DialogNormal::SaveData()
|
||||||
formula.replace("\n", " ");
|
formula.replace("\n", " ");
|
||||||
angle = ui->doubleSpinBoxAngle->value();
|
angle = ui->doubleSpinBoxAngle->value();
|
||||||
|
|
||||||
line->setPoint1Id(getFirstPointId());
|
line->setPoint1Id(GetFirstPointId());
|
||||||
line->setPoint2Id(getSecondPointId());
|
line->setPoint2Id(GetSecondPointId());
|
||||||
line->setLength(formula);
|
line->setLength(formula);
|
||||||
line->setAngle(angle);
|
line->SetAngle(angle);
|
||||||
line->setLineStyle(VAbstractTool::LineStyleToPenStyle(getTypeLine()));
|
line->setLineStyle(VAbstractTool::LineStyleToPenStyle(GetTypeLine()));
|
||||||
line->RefreshGeometry();
|
line->RefreshGeometry();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -194,33 +194,33 @@ void DialogNormal::closeEvent(QCloseEvent *event)
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief setSecondPointId set id of second point
|
* @brief SetSecondPointId set id of second point
|
||||||
* @param value id
|
* @param value id
|
||||||
*/
|
*/
|
||||||
void DialogNormal::setSecondPointId(const quint32 &value)
|
void DialogNormal::SetSecondPointId(const quint32 &value)
|
||||||
{
|
{
|
||||||
setCurrentPointId(ui->comboBoxSecondPoint, value);
|
setCurrentPointId(ui->comboBoxSecondPoint, value);
|
||||||
line->setPoint2Id(value);
|
line->setPoint2Id(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
QString DialogNormal::getLineColor() const
|
QString DialogNormal::GetLineColor() const
|
||||||
{
|
{
|
||||||
return GetLineColor(ui->comboBoxLineColor);
|
return GetComboBoxCurrentData(ui->comboBoxLineColor);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void DialogNormal::setLineColor(const QString &value)
|
void DialogNormal::SetLineColor(const QString &value)
|
||||||
{
|
{
|
||||||
ChangeCurrentData(ui->comboBoxLineColor, value);
|
ChangeCurrentData(ui->comboBoxLineColor, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief setFirstPointId set id of first point
|
* @brief SetFirstPointId set id of first point
|
||||||
* @param value id
|
* @param value id
|
||||||
*/
|
*/
|
||||||
void DialogNormal::setFirstPointId(const quint32 &value)
|
void DialogNormal::SetFirstPointId(const quint32 &value)
|
||||||
{
|
{
|
||||||
setCurrentPointId(ui->comboBoxFirstPoint, value);
|
setCurrentPointId(ui->comboBoxFirstPoint, value);
|
||||||
line->setPoint1Id(value);
|
line->setPoint1Id(value);
|
||||||
|
@ -228,22 +228,22 @@ void DialogNormal::setFirstPointId(const quint32 &value)
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief setAngle set aditional angle of normal
|
* @brief SetAngle set aditional angle of normal
|
||||||
* @param value angle in degree
|
* @param value angle in degree
|
||||||
*/
|
*/
|
||||||
void DialogNormal::setAngle(const qreal &value)
|
void DialogNormal::SetAngle(const qreal &value)
|
||||||
{
|
{
|
||||||
angle = value;
|
angle = value;
|
||||||
ui->doubleSpinBoxAngle->setValue(angle);
|
ui->doubleSpinBoxAngle->setValue(angle);
|
||||||
line->setAngle(angle);
|
line->SetAngle(angle);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief setFormula set string of formula
|
* @brief SetFormula set string of formula
|
||||||
* @param value formula
|
* @param value formula
|
||||||
*/
|
*/
|
||||||
void DialogNormal::setFormula(const QString &value)
|
void DialogNormal::SetFormula(const QString &value)
|
||||||
{
|
{
|
||||||
formula = qApp->FormulaToUser(value);
|
formula = qApp->FormulaToUser(value);
|
||||||
// increase height if needed.
|
// increase height if needed.
|
||||||
|
@ -258,10 +258,10 @@ void DialogNormal::setFormula(const QString &value)
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief setTypeLine set type of line
|
* @brief SetTypeLine set type of line
|
||||||
* @param value type
|
* @param value type
|
||||||
*/
|
*/
|
||||||
void DialogNormal::setTypeLine(const QString &value)
|
void DialogNormal::SetTypeLine(const QString &value)
|
||||||
{
|
{
|
||||||
ChangeCurrentData(ui->comboBoxLineType, value);
|
ChangeCurrentData(ui->comboBoxLineType, value);
|
||||||
line->setLineStyle(VAbstractTool::LineStyleToPenStyle(value));
|
line->setLineStyle(VAbstractTool::LineStyleToPenStyle(value));
|
||||||
|
@ -269,10 +269,10 @@ void DialogNormal::setTypeLine(const QString &value)
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief setPointName set name of point
|
* @brief SetPointName set name of point
|
||||||
* @param value name
|
* @param value name
|
||||||
*/
|
*/
|
||||||
void DialogNormal::setPointName(const QString &value)
|
void DialogNormal::SetPointName(const QString &value)
|
||||||
{
|
{
|
||||||
pointName = value;
|
pointName = value;
|
||||||
ui->lineEditNamePoint->setText(pointName);
|
ui->lineEditNamePoint->setText(pointName);
|
||||||
|
@ -280,50 +280,50 @@ void DialogNormal::setPointName(const QString &value)
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief getTypeLine return type of line
|
* @brief GetTypeLine return type of line
|
||||||
* @return type
|
* @return type
|
||||||
*/
|
*/
|
||||||
QString DialogNormal::getTypeLine() const
|
QString DialogNormal::GetTypeLine() const
|
||||||
{
|
{
|
||||||
return GetTypeLine(ui->comboBoxLineType);
|
return GetComboBoxCurrentData(ui->comboBoxLineType);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief getFormula return string of formula
|
* @brief GetFormula return string of formula
|
||||||
* @return formula
|
* @return formula
|
||||||
*/
|
*/
|
||||||
QString DialogNormal::getFormula() const
|
QString DialogNormal::GetFormula() const
|
||||||
{
|
{
|
||||||
return qApp->FormulaFromUser(formula);
|
return qApp->FormulaFromUser(formula);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief getAngle return aditional angle of normal
|
* @brief GetAngle return aditional angle of normal
|
||||||
* @return angle in degree
|
* @return angle in degree
|
||||||
*/
|
*/
|
||||||
qreal DialogNormal::getAngle() const
|
qreal DialogNormal::GetAngle() const
|
||||||
{
|
{
|
||||||
return angle;
|
return angle;
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief getFirstPointId return id of first point
|
* @brief GetFirstPointId return id of first point
|
||||||
* @return id
|
* @return id
|
||||||
*/
|
*/
|
||||||
quint32 DialogNormal::getFirstPointId() const
|
quint32 DialogNormal::GetFirstPointId() const
|
||||||
{
|
{
|
||||||
return getCurrentObjectId(ui->comboBoxFirstPoint);
|
return getCurrentObjectId(ui->comboBoxFirstPoint);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief getSecondPointId return id of second point
|
* @brief GetSecondPointId return id of second point
|
||||||
* @return id
|
* @return id
|
||||||
*/
|
*/
|
||||||
quint32 DialogNormal::getSecondPointId() const
|
quint32 DialogNormal::GetSecondPointId() const
|
||||||
{
|
{
|
||||||
return getCurrentObjectId(ui->comboBoxSecondPoint);
|
return getCurrentObjectId(ui->comboBoxSecondPoint);
|
||||||
}
|
}
|
||||||
|
|
|
@ -48,25 +48,25 @@ public:
|
||||||
DialogNormal(const VContainer *data, const quint32 &toolId, QWidget *parent = nullptr);
|
DialogNormal(const VContainer *data, const quint32 &toolId, QWidget *parent = nullptr);
|
||||||
~DialogNormal();
|
~DialogNormal();
|
||||||
|
|
||||||
void setPointName(const QString &value);
|
void SetPointName(const QString &value);
|
||||||
|
|
||||||
QString getTypeLine() const;
|
QString GetTypeLine() const;
|
||||||
void setTypeLine(const QString &value);
|
void SetTypeLine(const QString &value);
|
||||||
|
|
||||||
QString getFormula() const;
|
QString GetFormula() const;
|
||||||
void setFormula(const QString &value);
|
void SetFormula(const QString &value);
|
||||||
|
|
||||||
qreal getAngle() const;
|
qreal GetAngle() const;
|
||||||
void setAngle(const qreal &value);
|
void SetAngle(const qreal &value);
|
||||||
|
|
||||||
quint32 getFirstPointId() const;
|
quint32 GetFirstPointId() const;
|
||||||
void setFirstPointId(const quint32 &value);
|
void SetFirstPointId(const quint32 &value);
|
||||||
|
|
||||||
quint32 getSecondPointId() const;
|
quint32 GetSecondPointId() const;
|
||||||
void setSecondPointId(const quint32 &value);
|
void SetSecondPointId(const quint32 &value);
|
||||||
|
|
||||||
QString getLineColor() const;
|
QString GetLineColor() const;
|
||||||
void setLineColor(const QString &value);
|
void SetLineColor(const QString &value);
|
||||||
public slots:
|
public slots:
|
||||||
virtual void ChosenObject(quint32 id, const SceneObject &type);
|
virtual void ChosenObject(quint32 id, const SceneObject &type);
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -218,8 +218,8 @@ void DialogPointOfContact::SaveData()
|
||||||
radius = ui->plainTextEditFormula->toPlainText();
|
radius = ui->plainTextEditFormula->toPlainText();
|
||||||
radius.replace("\n", " ");
|
radius.replace("\n", " ");
|
||||||
|
|
||||||
line->setPoint1Id(getFirstPoint());
|
line->setPoint1Id(GetFirstPoint());
|
||||||
line->setLineP2Id(getSecondPoint());
|
line->setLineP2Id(GetSecondPoint());
|
||||||
line->setRadiusId(getCenter());
|
line->setRadiusId(getCenter());
|
||||||
line->setRadius(radius);
|
line->setRadius(radius);
|
||||||
line->RefreshGeometry();
|
line->RefreshGeometry();
|
||||||
|
@ -234,10 +234,10 @@ void DialogPointOfContact::closeEvent(QCloseEvent *event)
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief setSecondPoint set id second point
|
* @brief SetSecondPoint set id second point
|
||||||
* @param value id
|
* @param value id
|
||||||
*/
|
*/
|
||||||
void DialogPointOfContact::setSecondPoint(const quint32 &value)
|
void DialogPointOfContact::SetSecondPoint(const quint32 &value)
|
||||||
{
|
{
|
||||||
setCurrentPointId(ui->comboBoxSecondPoint, value);
|
setCurrentPointId(ui->comboBoxSecondPoint, value);
|
||||||
line->setLineP2Id(value);
|
line->setLineP2Id(value);
|
||||||
|
@ -245,10 +245,10 @@ void DialogPointOfContact::setSecondPoint(const quint32 &value)
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief setFirstPoint set id first point
|
* @brief SetFirstPoint set id first point
|
||||||
* @param value id
|
* @param value id
|
||||||
*/
|
*/
|
||||||
void DialogPointOfContact::setFirstPoint(const quint32 &value)
|
void DialogPointOfContact::SetFirstPoint(const quint32 &value)
|
||||||
{
|
{
|
||||||
setCurrentPointId(ui->comboBoxFirstPoint, value);
|
setCurrentPointId(ui->comboBoxFirstPoint, value);
|
||||||
line->setPoint1Id(value);
|
line->setPoint1Id(value);
|
||||||
|
@ -285,10 +285,10 @@ void DialogPointOfContact::setRadius(const QString &value)
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief setPointName set name of point
|
* @brief SetPointName set name of point
|
||||||
* @param value name
|
* @param value name
|
||||||
*/
|
*/
|
||||||
void DialogPointOfContact::setPointName(const QString &value)
|
void DialogPointOfContact::SetPointName(const QString &value)
|
||||||
{
|
{
|
||||||
pointName = value;
|
pointName = value;
|
||||||
ui->lineEditNamePoint->setText(pointName);
|
ui->lineEditNamePoint->setText(pointName);
|
||||||
|
@ -316,20 +316,20 @@ quint32 DialogPointOfContact::getCenter() const
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief getFirstPoint return id first point
|
* @brief GetFirstPoint return id first point
|
||||||
* @return id
|
* @return id
|
||||||
*/
|
*/
|
||||||
quint32 DialogPointOfContact::getFirstPoint() const
|
quint32 DialogPointOfContact::GetFirstPoint() const
|
||||||
{
|
{
|
||||||
return getCurrentObjectId(ui->comboBoxFirstPoint);;
|
return getCurrentObjectId(ui->comboBoxFirstPoint);;
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief getSecondPoint return id second point
|
* @brief GetSecondPoint return id second point
|
||||||
* @return id
|
* @return id
|
||||||
*/
|
*/
|
||||||
quint32 DialogPointOfContact::getSecondPoint() const
|
quint32 DialogPointOfContact::GetSecondPoint() const
|
||||||
{
|
{
|
||||||
return getCurrentObjectId(ui->comboBoxSecondPoint);
|
return getCurrentObjectId(ui->comboBoxSecondPoint);
|
||||||
}
|
}
|
||||||
|
|
|
@ -49,7 +49,7 @@ public:
|
||||||
DialogPointOfContact(const VContainer *data, const quint32 &toolId, QWidget *parent = nullptr);
|
DialogPointOfContact(const VContainer *data, const quint32 &toolId, QWidget *parent = nullptr);
|
||||||
virtual ~DialogPointOfContact();
|
virtual ~DialogPointOfContact();
|
||||||
|
|
||||||
void setPointName(const QString &value);
|
void SetPointName(const QString &value);
|
||||||
|
|
||||||
QString getRadius() const;
|
QString getRadius() const;
|
||||||
void setRadius(const QString &value);
|
void setRadius(const QString &value);
|
||||||
|
@ -57,11 +57,11 @@ public:
|
||||||
quint32 getCenter() const;
|
quint32 getCenter() const;
|
||||||
void setCenter(const quint32 &value);
|
void setCenter(const quint32 &value);
|
||||||
|
|
||||||
quint32 getFirstPoint() const;
|
quint32 GetFirstPoint() const;
|
||||||
void setFirstPoint(const quint32 &value);
|
void SetFirstPoint(const quint32 &value);
|
||||||
|
|
||||||
quint32 getSecondPoint() const;
|
quint32 GetSecondPoint() const;
|
||||||
void setSecondPoint(const quint32 &value);
|
void SetSecondPoint(const quint32 &value);
|
||||||
public slots:
|
public slots:
|
||||||
virtual void ChosenObject(quint32 id, const SceneObject &type);
|
virtual void ChosenObject(quint32 id, const SceneObject &type);
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -76,10 +76,10 @@ DialogPointOfIntersection::~DialogPointOfIntersection()
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief setSecondPointId set id of second point
|
* @brief SetSecondPointId set id of second point
|
||||||
* @param value id
|
* @param value id
|
||||||
*/
|
*/
|
||||||
void DialogPointOfIntersection::setSecondPointId(const quint32 &value)
|
void DialogPointOfIntersection::SetSecondPointId(const quint32 &value)
|
||||||
{
|
{
|
||||||
setCurrentPointId(ui->comboBoxSecondPoint, value);
|
setCurrentPointId(ui->comboBoxSecondPoint, value);
|
||||||
line->setPoint2Id(value);
|
line->setPoint2Id(value);
|
||||||
|
@ -132,8 +132,8 @@ void DialogPointOfIntersection::SaveData()
|
||||||
{
|
{
|
||||||
pointName = ui->lineEditNamePoint->text();
|
pointName = ui->lineEditNamePoint->text();
|
||||||
|
|
||||||
line->setPoint1Id(getFirstPointId());
|
line->setPoint1Id(GetFirstPointId());
|
||||||
line->setPoint2Id(getSecondPointId());
|
line->setPoint2Id(GetSecondPointId());
|
||||||
line->RefreshGeometry();
|
line->RefreshGeometry();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -178,10 +178,10 @@ void DialogPointOfIntersection::ShowVisualization()
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief setFirstPointId set id of first point
|
* @brief SetFirstPointId set id of first point
|
||||||
* @param value id
|
* @param value id
|
||||||
*/
|
*/
|
||||||
void DialogPointOfIntersection::setFirstPointId(const quint32 &value)
|
void DialogPointOfIntersection::SetFirstPointId(const quint32 &value)
|
||||||
{
|
{
|
||||||
setCurrentPointId(ui->comboBoxFirstPoint, value);
|
setCurrentPointId(ui->comboBoxFirstPoint, value);
|
||||||
line->setPoint1Id(value);
|
line->setPoint1Id(value);
|
||||||
|
@ -189,10 +189,10 @@ void DialogPointOfIntersection::setFirstPointId(const quint32 &value)
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief setPointName set name of point
|
* @brief SetPointName set name of point
|
||||||
* @param value name
|
* @param value name
|
||||||
*/
|
*/
|
||||||
void DialogPointOfIntersection::setPointName(const QString &value)
|
void DialogPointOfIntersection::SetPointName(const QString &value)
|
||||||
{
|
{
|
||||||
pointName = value;
|
pointName = value;
|
||||||
ui->lineEditNamePoint->setText(pointName);
|
ui->lineEditNamePoint->setText(pointName);
|
||||||
|
@ -200,20 +200,20 @@ void DialogPointOfIntersection::setPointName(const QString &value)
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief getFirstPointId return id of first point
|
* @brief GetFirstPointId return id of first point
|
||||||
* @return id
|
* @return id
|
||||||
*/
|
*/
|
||||||
quint32 DialogPointOfIntersection::getFirstPointId() const
|
quint32 DialogPointOfIntersection::GetFirstPointId() const
|
||||||
{
|
{
|
||||||
return getCurrentObjectId(ui->comboBoxFirstPoint);
|
return getCurrentObjectId(ui->comboBoxFirstPoint);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief getSecondPointId return id of second point
|
* @brief GetSecondPointId return id of second point
|
||||||
* @return id
|
* @return id
|
||||||
*/
|
*/
|
||||||
quint32 DialogPointOfIntersection::getSecondPointId() const
|
quint32 DialogPointOfIntersection::GetSecondPointId() const
|
||||||
{
|
{
|
||||||
return getCurrentObjectId(ui->comboBoxSecondPoint);
|
return getCurrentObjectId(ui->comboBoxSecondPoint);
|
||||||
}
|
}
|
||||||
|
|
|
@ -48,13 +48,13 @@ public:
|
||||||
DialogPointOfIntersection(const VContainer *data, const quint32 &toolId, QWidget *parent = nullptr);
|
DialogPointOfIntersection(const VContainer *data, const quint32 &toolId, QWidget *parent = nullptr);
|
||||||
~DialogPointOfIntersection();
|
~DialogPointOfIntersection();
|
||||||
|
|
||||||
void setPointName(const QString &value);
|
void SetPointName(const QString &value);
|
||||||
|
|
||||||
quint32 getFirstPointId() const;
|
quint32 GetFirstPointId() const;
|
||||||
void setFirstPointId(const quint32 &value);
|
void SetFirstPointId(const quint32 &value);
|
||||||
|
|
||||||
quint32 getSecondPointId() const;
|
quint32 GetSecondPointId() const;
|
||||||
void setSecondPointId(const quint32 &value);
|
void SetSecondPointId(const quint32 &value);
|
||||||
public slots:
|
public slots:
|
||||||
virtual void ChosenObject(quint32 id, const SceneObject &type);
|
virtual void ChosenObject(quint32 id, const SceneObject &type);
|
||||||
virtual void PointNameChanged();
|
virtual void PointNameChanged();
|
||||||
|
|
|
@ -204,11 +204,11 @@ void DialogShoulderPoint::SaveData()
|
||||||
formula = ui->plainTextEditFormula->toPlainText();
|
formula = ui->plainTextEditFormula->toPlainText();
|
||||||
formula.replace("\n", " ");
|
formula.replace("\n", " ");
|
||||||
|
|
||||||
line->setPoint1Id(getP3());
|
line->setPoint1Id(GetP3());
|
||||||
line->setLineP1Id(getP1Line());
|
line->setLineP1Id(GetP1Line());
|
||||||
line->setLineP2Id(getP2Line());
|
line->setLineP2Id(GetP2Line());
|
||||||
line->setLength(formula);
|
line->setLength(formula);
|
||||||
line->setLineStyle(VAbstractTool::LineStyleToPenStyle(getTypeLine()));
|
line->setLineStyle(VAbstractTool::LineStyleToPenStyle(GetTypeLine()));
|
||||||
line->RefreshGeometry();
|
line->RefreshGeometry();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -224,30 +224,30 @@ void DialogShoulderPoint::closeEvent(QCloseEvent *event)
|
||||||
* @brief setPShoulder set id shoulder point
|
* @brief setPShoulder set id shoulder point
|
||||||
* @param value id
|
* @param value id
|
||||||
*/
|
*/
|
||||||
void DialogShoulderPoint::setP3(const quint32 &value)
|
void DialogShoulderPoint::SetP3(const quint32 &value)
|
||||||
{
|
{
|
||||||
setCurrentPointId(ui->comboBoxP3, value);
|
setCurrentPointId(ui->comboBoxP3, value);
|
||||||
line->setPoint1Id(value);
|
line->setPoint1Id(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
QString DialogShoulderPoint::getLineColor() const
|
QString DialogShoulderPoint::GetLineColor() const
|
||||||
{
|
{
|
||||||
return GetLineColor(ui->comboBoxLineColor);
|
return GetComboBoxCurrentData(ui->comboBoxLineColor);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void DialogShoulderPoint::setLineColor(const QString &value)
|
void DialogShoulderPoint::SetLineColor(const QString &value)
|
||||||
{
|
{
|
||||||
ChangeCurrentData(ui->comboBoxLineColor, value);
|
ChangeCurrentData(ui->comboBoxLineColor, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief setP2Line set id second point of line
|
* @brief SetP2Line set id second point of line
|
||||||
* @param value id
|
* @param value id
|
||||||
*/
|
*/
|
||||||
void DialogShoulderPoint::setP2Line(const quint32 &value)
|
void DialogShoulderPoint::SetP2Line(const quint32 &value)
|
||||||
{
|
{
|
||||||
setCurrentPointId(ui->comboBoxP2Line, value);
|
setCurrentPointId(ui->comboBoxP2Line, value);
|
||||||
line->setLineP2Id(value);
|
line->setLineP2Id(value);
|
||||||
|
@ -255,10 +255,10 @@ void DialogShoulderPoint::setP2Line(const quint32 &value)
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief setP1Line set id first point of line
|
* @brief SetP1Line set id first point of line
|
||||||
* @param value id
|
* @param value id
|
||||||
*/
|
*/
|
||||||
void DialogShoulderPoint::setP1Line(const quint32 &value)
|
void DialogShoulderPoint::SetP1Line(const quint32 &value)
|
||||||
{
|
{
|
||||||
setCurrentPointId(ui->comboBoxP1Line, value);
|
setCurrentPointId(ui->comboBoxP1Line, value);
|
||||||
line->setLineP1Id(value);
|
line->setLineP1Id(value);
|
||||||
|
@ -266,10 +266,10 @@ void DialogShoulderPoint::setP1Line(const quint32 &value)
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief setFormula set string of formula
|
* @brief SetFormula set string of formula
|
||||||
* @param value formula
|
* @param value formula
|
||||||
*/
|
*/
|
||||||
void DialogShoulderPoint::setFormula(const QString &value)
|
void DialogShoulderPoint::SetFormula(const QString &value)
|
||||||
{
|
{
|
||||||
formula = qApp->FormulaToUser(value);
|
formula = qApp->FormulaToUser(value);
|
||||||
// increase height if needed.
|
// increase height if needed.
|
||||||
|
@ -284,10 +284,10 @@ void DialogShoulderPoint::setFormula(const QString &value)
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief setTypeLine set type of line
|
* @brief SetTypeLine set type of line
|
||||||
* @param value type
|
* @param value type
|
||||||
*/
|
*/
|
||||||
void DialogShoulderPoint::setTypeLine(const QString &value)
|
void DialogShoulderPoint::SetTypeLine(const QString &value)
|
||||||
{
|
{
|
||||||
ChangeCurrentData(ui->comboBoxLineType, value);
|
ChangeCurrentData(ui->comboBoxLineType, value);
|
||||||
line->setLineStyle(VAbstractTool::LineStyleToPenStyle(value));
|
line->setLineStyle(VAbstractTool::LineStyleToPenStyle(value));
|
||||||
|
@ -295,10 +295,10 @@ void DialogShoulderPoint::setTypeLine(const QString &value)
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief setPointName set name of point
|
* @brief SetPointName set name of point
|
||||||
* @param value name
|
* @param value name
|
||||||
*/
|
*/
|
||||||
void DialogShoulderPoint::setPointName(const QString &value)
|
void DialogShoulderPoint::SetPointName(const QString &value)
|
||||||
{
|
{
|
||||||
pointName = value;
|
pointName = value;
|
||||||
ui->lineEditNamePoint->setText(pointName);
|
ui->lineEditNamePoint->setText(pointName);
|
||||||
|
@ -306,40 +306,40 @@ void DialogShoulderPoint::setPointName(const QString &value)
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief getTypeLine return type of line
|
* @brief GetTypeLine return type of line
|
||||||
* @return type
|
* @return type
|
||||||
*/
|
*/
|
||||||
QString DialogShoulderPoint::getTypeLine() const
|
QString DialogShoulderPoint::GetTypeLine() const
|
||||||
{
|
{
|
||||||
return GetTypeLine(ui->comboBoxLineType);
|
return GetComboBoxCurrentData(ui->comboBoxLineType);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief getFormula return string of formula
|
* @brief GetFormula return string of formula
|
||||||
* @return formula
|
* @return formula
|
||||||
*/
|
*/
|
||||||
QString DialogShoulderPoint::getFormula() const
|
QString DialogShoulderPoint::GetFormula() const
|
||||||
{
|
{
|
||||||
return qApp->FormulaFromUser(formula);
|
return qApp->FormulaFromUser(formula);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief getP1Line return id first point of line
|
* @brief GetP1Line return id first point of line
|
||||||
* @return id
|
* @return id
|
||||||
*/
|
*/
|
||||||
quint32 DialogShoulderPoint::getP1Line() const
|
quint32 DialogShoulderPoint::GetP1Line() const
|
||||||
{
|
{
|
||||||
return getCurrentObjectId(ui->comboBoxP1Line);
|
return getCurrentObjectId(ui->comboBoxP1Line);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief getP2Line return id second point of line
|
* @brief GetP2Line return id second point of line
|
||||||
* @return id
|
* @return id
|
||||||
*/
|
*/
|
||||||
quint32 DialogShoulderPoint::getP2Line() const
|
quint32 DialogShoulderPoint::GetP2Line() const
|
||||||
{
|
{
|
||||||
return getCurrentObjectId(ui->comboBoxP2Line);
|
return getCurrentObjectId(ui->comboBoxP2Line);
|
||||||
}
|
}
|
||||||
|
@ -349,7 +349,7 @@ quint32 DialogShoulderPoint::getP2Line() const
|
||||||
* @brief getPShoulder return id shoulder point
|
* @brief getPShoulder return id shoulder point
|
||||||
* @return id
|
* @return id
|
||||||
*/
|
*/
|
||||||
quint32 DialogShoulderPoint::getP3() const
|
quint32 DialogShoulderPoint::GetP3() const
|
||||||
{
|
{
|
||||||
return getCurrentObjectId(ui->comboBoxP3);
|
return getCurrentObjectId(ui->comboBoxP3);
|
||||||
}
|
}
|
||||||
|
|
|
@ -48,25 +48,25 @@ public:
|
||||||
DialogShoulderPoint(const VContainer *data, const quint32 &toolId, QWidget *parent = nullptr);
|
DialogShoulderPoint(const VContainer *data, const quint32 &toolId, QWidget *parent = nullptr);
|
||||||
~DialogShoulderPoint();
|
~DialogShoulderPoint();
|
||||||
|
|
||||||
void setPointName(const QString &value);
|
void SetPointName(const QString &value);
|
||||||
|
|
||||||
QString getTypeLine() const;
|
QString GetTypeLine() const;
|
||||||
void setTypeLine(const QString &value);
|
void SetTypeLine(const QString &value);
|
||||||
|
|
||||||
QString getFormula() const;
|
QString GetFormula() const;
|
||||||
void setFormula(const QString &value);
|
void SetFormula(const QString &value);
|
||||||
|
|
||||||
quint32 getP1Line() const;
|
quint32 GetP1Line() const;
|
||||||
void setP1Line(const quint32 &value);
|
void SetP1Line(const quint32 &value);
|
||||||
|
|
||||||
quint32 getP2Line() const;
|
quint32 GetP2Line() const;
|
||||||
void setP2Line(const quint32 &value);
|
void SetP2Line(const quint32 &value);
|
||||||
|
|
||||||
quint32 getP3() const;
|
quint32 GetP3() const;
|
||||||
void setP3(const quint32 &value);
|
void SetP3(const quint32 &value);
|
||||||
|
|
||||||
QString getLineColor() const;
|
QString GetLineColor() const;
|
||||||
void setLineColor(const QString &value);
|
void SetLineColor(const QString &value);
|
||||||
public slots:
|
public slots:
|
||||||
virtual void ChosenObject(quint32 id, const SceneObject &type);
|
virtual void ChosenObject(quint32 id, const SceneObject &type);
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -92,7 +92,7 @@ void DialogSinglePoint::UpdateList()
|
||||||
* @param name name of point
|
* @param name name of point
|
||||||
* @param point data for point
|
* @param point data for point
|
||||||
*/
|
*/
|
||||||
void DialogSinglePoint::setData(const QString &name, const QPointF &point)
|
void DialogSinglePoint::SetData(const QString &name, const QPointF &point)
|
||||||
{
|
{
|
||||||
pointName = name;
|
pointName = name;
|
||||||
this->point = point;
|
this->point = point;
|
||||||
|
@ -113,7 +113,7 @@ DialogSinglePoint::~DialogSinglePoint()
|
||||||
* @brief getPoint return point
|
* @brief getPoint return point
|
||||||
* @return point
|
* @return point
|
||||||
*/
|
*/
|
||||||
QPointF DialogSinglePoint::getPoint() const
|
QPointF DialogSinglePoint::GetPoint() const
|
||||||
{
|
{
|
||||||
return point;
|
return point;
|
||||||
}
|
}
|
||||||
|
|
|
@ -45,8 +45,10 @@ class DialogSinglePoint : public DialogTool
|
||||||
public:
|
public:
|
||||||
DialogSinglePoint(const VContainer *data, const quint32 &toolId, QWidget *parent = nullptr);
|
DialogSinglePoint(const VContainer *data, const quint32 &toolId, QWidget *parent = nullptr);
|
||||||
~DialogSinglePoint();
|
~DialogSinglePoint();
|
||||||
void setData(const QString &name, const QPointF &point);
|
|
||||||
QPointF getPoint()const;
|
void SetData(const QString &name, const QPointF &point);
|
||||||
|
QPointF GetPoint()const;
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void mousePress(const QPointF &scenePos);
|
void mousePress(const QPointF &scenePos);
|
||||||
virtual void UpdateList();
|
virtual void UpdateList();
|
||||||
|
|
|
@ -71,10 +71,10 @@ DialogSpline::~DialogSpline()
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief getP1 return id first point of spline
|
* @brief GetP1 return id first point of spline
|
||||||
* @return id
|
* @return id
|
||||||
*/
|
*/
|
||||||
quint32 DialogSpline::getP1() const
|
quint32 DialogSpline::GetP1() const
|
||||||
{
|
{
|
||||||
return getCurrentObjectId(ui->comboBoxP1);
|
return getCurrentObjectId(ui->comboBoxP1);
|
||||||
}
|
}
|
||||||
|
@ -147,13 +147,13 @@ void DialogSpline::SaveData()
|
||||||
kAsm2 = ui->doubleSpinBoxKasm2->value();
|
kAsm2 = ui->doubleSpinBoxKasm2->value();
|
||||||
kCurve = ui->doubleSpinBoxKcurve->value();
|
kCurve = ui->doubleSpinBoxKcurve->value();
|
||||||
|
|
||||||
path->setPoint1Id(getP1());
|
path->setPoint1Id(GetP1());
|
||||||
path->setPoint4Id(getP4());
|
path->setPoint4Id(GetP4());
|
||||||
path->setAngle1(angle1);
|
path->SetAngle1(angle1);
|
||||||
path->setAngle2(angle2);
|
path->SetAngle2(angle2);
|
||||||
path->setKAsm1(kAsm1);
|
path->SetKAsm1(kAsm1);
|
||||||
path->setKAsm2(kAsm2);
|
path->SetKAsm2(kAsm2);
|
||||||
path->setKCurve(kCurve);
|
path->SetKCurve(kCurve);
|
||||||
path->RefreshGeometry();
|
path->RefreshGeometry();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -203,82 +203,82 @@ void DialogSpline::ShowVisualization()
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief setKCurve set coefficient curve
|
* @brief SetKCurve set coefficient curve
|
||||||
* @param value value. Can be >= 0.
|
* @param value value. Can be >= 0.
|
||||||
*/
|
*/
|
||||||
void DialogSpline::setKCurve(const qreal &value)
|
void DialogSpline::SetKCurve(const qreal &value)
|
||||||
{
|
{
|
||||||
kCurve = value;
|
kCurve = value;
|
||||||
ui->doubleSpinBoxKcurve->setValue(value);
|
ui->doubleSpinBoxKcurve->setValue(value);
|
||||||
path->setKCurve(kCurve);
|
path->SetKCurve(kCurve);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
QString DialogSpline::getColor() const
|
QString DialogSpline::GetColor() const
|
||||||
{
|
{
|
||||||
return GetLineColor(ui->comboBoxColor);
|
return GetComboBoxCurrentData(ui->comboBoxColor);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void DialogSpline::setColor(const QString &value)
|
void DialogSpline::SetColor(const QString &value)
|
||||||
{
|
{
|
||||||
ChangeCurrentData(ui->comboBoxColor, value);
|
ChangeCurrentData(ui->comboBoxColor, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief setKAsm2 set second coefficient asymmetry
|
* @brief SetKAsm2 set second coefficient asymmetry
|
||||||
* @param value value. Can be >= 0.
|
* @param value value. Can be >= 0.
|
||||||
*/
|
*/
|
||||||
void DialogSpline::setKAsm2(const qreal &value)
|
void DialogSpline::SetKAsm2(const qreal &value)
|
||||||
{
|
{
|
||||||
kAsm2 = value;
|
kAsm2 = value;
|
||||||
ui->doubleSpinBoxKasm2->setValue(value);
|
ui->doubleSpinBoxKasm2->setValue(value);
|
||||||
path->setKAsm2(kAsm2);
|
path->SetKAsm2(kAsm2);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief setKAsm1 set first coefficient asymmetry
|
* @brief SetKAsm1 set first coefficient asymmetry
|
||||||
* @param value value. Can be >= 0.
|
* @param value value. Can be >= 0.
|
||||||
*/
|
*/
|
||||||
void DialogSpline::setKAsm1(const qreal &value)
|
void DialogSpline::SetKAsm1(const qreal &value)
|
||||||
{
|
{
|
||||||
kAsm1 = value;
|
kAsm1 = value;
|
||||||
ui->doubleSpinBoxKasm1->setValue(value);
|
ui->doubleSpinBoxKasm1->setValue(value);
|
||||||
path->setKAsm1(kAsm1);
|
path->SetKAsm1(kAsm1);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief setAngle2 set second angle of spline
|
* @brief SetAngle2 set second angle of spline
|
||||||
* @param value angle in degree
|
* @param value angle in degree
|
||||||
*/
|
*/
|
||||||
void DialogSpline::setAngle2(const qreal &value)
|
void DialogSpline::SetAngle2(const qreal &value)
|
||||||
{
|
{
|
||||||
angle2 = value;
|
angle2 = value;
|
||||||
ui->spinBoxAngle2->setValue(static_cast<qint32>(value));
|
ui->spinBoxAngle2->setValue(static_cast<qint32>(value));
|
||||||
path->setAngle2(angle2);
|
path->SetAngle2(angle2);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief setAngle1 set first angle of spline
|
* @brief SetAngle1 set first angle of spline
|
||||||
* @param value angle in degree
|
* @param value angle in degree
|
||||||
*/
|
*/
|
||||||
void DialogSpline::setAngle1(const qreal &value)
|
void DialogSpline::SetAngle1(const qreal &value)
|
||||||
{
|
{
|
||||||
angle1 = value;
|
angle1 = value;
|
||||||
ui->spinBoxAngle1->setValue(static_cast<qint32>(value));
|
ui->spinBoxAngle1->setValue(static_cast<qint32>(value));
|
||||||
path->setAngle1(angle1);
|
path->SetAngle1(angle1);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief setP4 set id fourth point of spline
|
* @brief SetP4 set id fourth point of spline
|
||||||
* @param value id
|
* @param value id
|
||||||
*/
|
*/
|
||||||
void DialogSpline::setP4(const quint32 &value)
|
void DialogSpline::SetP4(const quint32 &value)
|
||||||
{
|
{
|
||||||
setCurrentPointId(ui->comboBoxP4, value);
|
setCurrentPointId(ui->comboBoxP4, value);
|
||||||
path->setPoint4Id(value);
|
path->setPoint4Id(value);
|
||||||
|
@ -286,10 +286,10 @@ void DialogSpline::setP4(const quint32 &value)
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief setP1 set id first point of spline
|
* @brief SetP1 set id first point of spline
|
||||||
* @param value id
|
* @param value id
|
||||||
*/
|
*/
|
||||||
void DialogSpline::setP1(const quint32 &value)
|
void DialogSpline::SetP1(const quint32 &value)
|
||||||
{
|
{
|
||||||
setCurrentPointId(ui->comboBoxP1, value);
|
setCurrentPointId(ui->comboBoxP1, value);
|
||||||
path->setPoint1Id(value);
|
path->setPoint1Id(value);
|
||||||
|
@ -297,60 +297,60 @@ void DialogSpline::setP1(const quint32 &value)
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief getP4 return id fourth point of spline
|
* @brief GetP4 return id fourth point of spline
|
||||||
* @return id
|
* @return id
|
||||||
*/
|
*/
|
||||||
quint32 DialogSpline::getP4() const
|
quint32 DialogSpline::GetP4() const
|
||||||
{
|
{
|
||||||
return getCurrentObjectId(ui->comboBoxP4);
|
return getCurrentObjectId(ui->comboBoxP4);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief getAngle1 return first angle of spline
|
* @brief GetAngle1 return first angle of spline
|
||||||
* @return angle in degree
|
* @return angle in degree
|
||||||
*/
|
*/
|
||||||
qreal DialogSpline::getAngle1() const
|
qreal DialogSpline::GetAngle1() const
|
||||||
{
|
{
|
||||||
return angle1;
|
return angle1;
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief getAngle2 return second angle of spline
|
* @brief GetAngle2 return second angle of spline
|
||||||
* @return angle in degree
|
* @return angle in degree
|
||||||
*/
|
*/
|
||||||
qreal DialogSpline::getAngle2() const
|
qreal DialogSpline::GetAngle2() const
|
||||||
{
|
{
|
||||||
return angle2;
|
return angle2;
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief getKAsm1 return first coefficient asymmetry
|
* @brief GetKAsm1 return first coefficient asymmetry
|
||||||
* @return value. Can be >= 0.
|
* @return value. Can be >= 0.
|
||||||
*/
|
*/
|
||||||
qreal DialogSpline::getKAsm1() const
|
qreal DialogSpline::GetKAsm1() const
|
||||||
{
|
{
|
||||||
return kAsm1;
|
return kAsm1;
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief getKAsm2 return second coefficient asymmetry
|
* @brief GetKAsm2 return second coefficient asymmetry
|
||||||
* @return value. Can be >= 0.
|
* @return value. Can be >= 0.
|
||||||
*/
|
*/
|
||||||
qreal DialogSpline::getKAsm2() const
|
qreal DialogSpline::GetKAsm2() const
|
||||||
{
|
{
|
||||||
return kAsm2;
|
return kAsm2;
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief getKCurve return coefficient curve
|
* @brief GetKCurve return coefficient curve
|
||||||
* @return value. Can be >= 0.
|
* @return value. Can be >= 0.
|
||||||
*/
|
*/
|
||||||
qreal DialogSpline::getKCurve() const
|
qreal DialogSpline::GetKCurve() const
|
||||||
{
|
{
|
||||||
return kCurve;
|
return kCurve;
|
||||||
}
|
}
|
||||||
|
|
|
@ -48,29 +48,29 @@ public:
|
||||||
DialogSpline(const VContainer *data, const quint32 &toolId, QWidget *parent = nullptr);
|
DialogSpline(const VContainer *data, const quint32 &toolId, QWidget *parent = nullptr);
|
||||||
~DialogSpline();
|
~DialogSpline();
|
||||||
|
|
||||||
quint32 getP1() const;
|
quint32 GetP1() const;
|
||||||
void setP1(const quint32 &value);
|
void SetP1(const quint32 &value);
|
||||||
|
|
||||||
quint32 getP4() const;
|
quint32 GetP4() const;
|
||||||
void setP4(const quint32 &value);
|
void SetP4(const quint32 &value);
|
||||||
|
|
||||||
qreal getAngle1() const;
|
qreal GetAngle1() const;
|
||||||
void setAngle1(const qreal &value);
|
void SetAngle1(const qreal &value);
|
||||||
|
|
||||||
qreal getAngle2() const;
|
qreal GetAngle2() const;
|
||||||
void setAngle2(const qreal &value);
|
void SetAngle2(const qreal &value);
|
||||||
|
|
||||||
qreal getKAsm1() const;
|
qreal GetKAsm1() const;
|
||||||
void setKAsm1(const qreal &value);
|
void SetKAsm1(const qreal &value);
|
||||||
|
|
||||||
qreal getKAsm2() const;
|
qreal GetKAsm2() const;
|
||||||
void setKAsm2(const qreal &value);
|
void SetKAsm2(const qreal &value);
|
||||||
|
|
||||||
qreal getKCurve() const;
|
qreal GetKCurve() const;
|
||||||
void setKCurve(const qreal &value);
|
void SetKCurve(const qreal &value);
|
||||||
|
|
||||||
QString getColor() const;
|
QString GetColor() const;
|
||||||
void setColor(const QString &value);
|
void SetColor(const QString &value);
|
||||||
public slots:
|
public slots:
|
||||||
virtual void ChosenObject(quint32 id, const SceneObject &type);
|
virtual void ChosenObject(quint32 id, const SceneObject &type);
|
||||||
virtual void PointNameChanged();
|
virtual void PointNameChanged();
|
||||||
|
|
|
@ -88,20 +88,20 @@ void DialogSplinePath::SetPath(const VSplinePath &value)
|
||||||
NewItem(path.at(i).P().id(), path.at(i).KAsm1(), path.at(i).Angle1(), path.at(i).KAsm2(), path.at(i).Angle2());
|
NewItem(path.at(i).P().id(), path.at(i).KAsm1(), path.at(i).Angle1(), path.at(i).KAsm2(), path.at(i).Angle2());
|
||||||
}
|
}
|
||||||
ui->listWidget->setFocus(Qt::OtherFocusReason);
|
ui->listWidget->setFocus(Qt::OtherFocusReason);
|
||||||
ui->doubleSpinBoxKcurve->setValue(path.getKCurve());
|
ui->doubleSpinBoxKcurve->setValue(path.GetKCurve());
|
||||||
|
|
||||||
visPath->setPath(path);
|
visPath->setPath(path);
|
||||||
ui->listWidget->blockSignals(false);
|
ui->listWidget->blockSignals(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
QString DialogSplinePath::getColor() const
|
QString DialogSplinePath::GetColor() const
|
||||||
{
|
{
|
||||||
return GetLineColor(ui->comboBoxColor);
|
return GetComboBoxCurrentData(ui->comboBoxColor);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void DialogSplinePath::setColor(const QString &value)
|
void DialogSplinePath::SetColor(const QString &value)
|
||||||
{
|
{
|
||||||
ChangeCurrentData(ui->comboBoxColor, value);
|
ChangeCurrentData(ui->comboBoxColor, value);
|
||||||
}
|
}
|
||||||
|
@ -375,5 +375,5 @@ void DialogSplinePath::SavePath()
|
||||||
QListWidgetItem *item = ui->listWidget->item(i);
|
QListWidgetItem *item = ui->listWidget->item(i);
|
||||||
path.append( qvariant_cast<VSplinePoint>(item->data(Qt::UserRole)));
|
path.append( qvariant_cast<VSplinePoint>(item->data(Qt::UserRole)));
|
||||||
}
|
}
|
||||||
path.setKCurve(ui->doubleSpinBoxKcurve->value());
|
path.SetKCurve(ui->doubleSpinBoxKcurve->value());
|
||||||
}
|
}
|
||||||
|
|
|
@ -52,8 +52,8 @@ public:
|
||||||
VSplinePath GetPath() const;
|
VSplinePath GetPath() const;
|
||||||
void SetPath(const VSplinePath &value);
|
void SetPath(const VSplinePath &value);
|
||||||
|
|
||||||
QString getColor() const;
|
QString GetColor() const;
|
||||||
void setColor(const QString &value);
|
void SetColor(const QString &value);
|
||||||
public slots:
|
public slots:
|
||||||
virtual void ChosenObject(quint32 id, const SceneObject &type);
|
virtual void ChosenObject(quint32 id, const SceneObject &type);
|
||||||
void PointChanged(int row);
|
void PointChanged(int row);
|
||||||
|
|
|
@ -346,12 +346,7 @@ void DialogTool::FillComboBoxLineColors(QComboBox *box) const
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
QString DialogTool::GetComboBoxCurrentData(const QComboBox *box) const
|
||||||
* @brief getTypeLine return type of line
|
|
||||||
* @param box combobox
|
|
||||||
* @return type
|
|
||||||
*/
|
|
||||||
QString DialogTool::GetTypeLine(const QComboBox *box) const
|
|
||||||
{
|
{
|
||||||
SCASSERT(box != nullptr)
|
SCASSERT(box != nullptr)
|
||||||
QString value = box->currentData().toString();
|
QString value = box->currentData().toString();
|
||||||
|
@ -362,18 +357,6 @@ QString DialogTool::GetTypeLine(const QComboBox *box) const
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
|
||||||
QString DialogTool::GetLineColor(const QComboBox *box) const
|
|
||||||
{
|
|
||||||
SCASSERT(box != nullptr)
|
|
||||||
QString value = box->currentData().toString();
|
|
||||||
if (value.isEmpty())
|
|
||||||
{
|
|
||||||
value = VAbstractTool::ColorBlack;
|
|
||||||
}
|
|
||||||
return value;
|
|
||||||
}
|
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief ChangeCurrentData select item in combobox by id
|
* @brief ChangeCurrentData select item in combobox by id
|
||||||
|
|
|
@ -225,8 +225,7 @@ protected:
|
||||||
void FillComboBoxLineColors(QComboBox *box)const;
|
void FillComboBoxLineColors(QComboBox *box)const;
|
||||||
|
|
||||||
virtual void CheckState();
|
virtual void CheckState();
|
||||||
QString GetTypeLine(const QComboBox *box)const;
|
QString GetComboBoxCurrentData(const QComboBox *box)const;
|
||||||
QString GetLineColor(const QComboBox *box)const;
|
|
||||||
template <class key, class val>
|
template <class key, class val>
|
||||||
void ShowVariable(const QMap<key, val> var);
|
void ShowVariable(const QMap<key, val> var);
|
||||||
void ChangeCurrentData(QComboBox *box, const QVariant &value) const;
|
void ChangeCurrentData(QComboBox *box, const QVariant &value) const;
|
||||||
|
|
|
@ -161,10 +161,10 @@ void DialogTriangle::SaveData()
|
||||||
{
|
{
|
||||||
pointName = ui->lineEditNamePoint->text();
|
pointName = ui->lineEditNamePoint->text();
|
||||||
|
|
||||||
line->setPoint1Id(getAxisP1Id());
|
line->setPoint1Id(GetAxisP1Id());
|
||||||
line->setPoint2Id(getAxisP2Id());
|
line->setPoint2Id(GetAxisP2Id());
|
||||||
line->setHypotenuseP1Id(getFirstPointId());
|
line->setHypotenuseP1Id(GetFirstPointId());
|
||||||
line->setHypotenuseP2Id(getSecondPointId());
|
line->setHypotenuseP2Id(GetSecondPointId());
|
||||||
line->RefreshGeometry();
|
line->RefreshGeometry();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -218,10 +218,10 @@ void DialogTriangle::ShowVisualization()
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief setPointName set name of point
|
* @brief SetPointName set name of point
|
||||||
* @param value name
|
* @param value name
|
||||||
*/
|
*/
|
||||||
void DialogTriangle::setPointName(const QString &value)
|
void DialogTriangle::SetPointName(const QString &value)
|
||||||
{
|
{
|
||||||
pointName = value;
|
pointName = value;
|
||||||
ui->lineEditNamePoint->setText(pointName);
|
ui->lineEditNamePoint->setText(pointName);
|
||||||
|
@ -229,10 +229,10 @@ void DialogTriangle::setPointName(const QString &value)
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief setSecondPointId set id of second point
|
* @brief SetSecondPointId set id of second point
|
||||||
* @param value id
|
* @param value id
|
||||||
*/
|
*/
|
||||||
void DialogTriangle::setSecondPointId(const quint32 &value)
|
void DialogTriangle::SetSecondPointId(const quint32 &value)
|
||||||
{
|
{
|
||||||
setCurrentPointId(ui->comboBoxSecondPoint, value);
|
setCurrentPointId(ui->comboBoxSecondPoint, value);
|
||||||
line->setHypotenuseP2Id(value);
|
line->setHypotenuseP2Id(value);
|
||||||
|
@ -240,10 +240,10 @@ void DialogTriangle::setSecondPointId(const quint32 &value)
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief setFirstPointId set id of first point
|
* @brief SetFirstPointId set id of first point
|
||||||
* @param value id
|
* @param value id
|
||||||
*/
|
*/
|
||||||
void DialogTriangle::setFirstPointId(const quint32 &value)
|
void DialogTriangle::SetFirstPointId(const quint32 &value)
|
||||||
{
|
{
|
||||||
setCurrentPointId(ui->comboBoxFirstPoint, value);
|
setCurrentPointId(ui->comboBoxFirstPoint, value);
|
||||||
line->setHypotenuseP1Id(value);
|
line->setHypotenuseP1Id(value);
|
||||||
|
@ -251,10 +251,10 @@ void DialogTriangle::setFirstPointId(const quint32 &value)
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief setAxisP2Id set id second point of axis
|
* @brief SetAxisP2Id set id second point of axis
|
||||||
* @param value id
|
* @param value id
|
||||||
*/
|
*/
|
||||||
void DialogTriangle::setAxisP2Id(const quint32 &value)
|
void DialogTriangle::SetAxisP2Id(const quint32 &value)
|
||||||
{
|
{
|
||||||
setCurrentPointId(ui->comboBoxAxisP2, value);
|
setCurrentPointId(ui->comboBoxAxisP2, value);
|
||||||
line->setPoint2Id(value);
|
line->setPoint2Id(value);
|
||||||
|
@ -262,10 +262,10 @@ void DialogTriangle::setAxisP2Id(const quint32 &value)
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief setAxisP1Id set id first point of axis
|
* @brief SetAxisP1Id set id first point of axis
|
||||||
* @param value id
|
* @param value id
|
||||||
*/
|
*/
|
||||||
void DialogTriangle::setAxisP1Id(const quint32 &value)
|
void DialogTriangle::SetAxisP1Id(const quint32 &value)
|
||||||
{
|
{
|
||||||
setCurrentPointId(ui->comboBoxAxisP1, value);
|
setCurrentPointId(ui->comboBoxAxisP1, value);
|
||||||
line->setPoint1Id(value);
|
line->setPoint1Id(value);
|
||||||
|
@ -273,40 +273,40 @@ void DialogTriangle::setAxisP1Id(const quint32 &value)
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief getAxisP1Id return id first point of axis
|
* @brief GetAxisP1Id return id first point of axis
|
||||||
* @return id
|
* @return id
|
||||||
*/
|
*/
|
||||||
quint32 DialogTriangle::getAxisP1Id() const
|
quint32 DialogTriangle::GetAxisP1Id() const
|
||||||
{
|
{
|
||||||
return getCurrentObjectId(ui->comboBoxAxisP1);
|
return getCurrentObjectId(ui->comboBoxAxisP1);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief getAxisP2Id return id second point of axis
|
* @brief GetAxisP2Id return id second point of axis
|
||||||
* @return id
|
* @return id
|
||||||
*/
|
*/
|
||||||
quint32 DialogTriangle::getAxisP2Id() const
|
quint32 DialogTriangle::GetAxisP2Id() const
|
||||||
{
|
{
|
||||||
return getCurrentObjectId(ui->comboBoxAxisP2);
|
return getCurrentObjectId(ui->comboBoxAxisP2);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief getFirstPointId return id of first point
|
* @brief GetFirstPointId return id of first point
|
||||||
* @return id
|
* @return id
|
||||||
*/
|
*/
|
||||||
quint32 DialogTriangle::getFirstPointId() const
|
quint32 DialogTriangle::GetFirstPointId() const
|
||||||
{
|
{
|
||||||
return getCurrentObjectId(ui->comboBoxFirstPoint);
|
return getCurrentObjectId(ui->comboBoxFirstPoint);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief getSecondPointId return id of second point
|
* @brief GetSecondPointId return id of second point
|
||||||
* @return id
|
* @return id
|
||||||
*/
|
*/
|
||||||
quint32 DialogTriangle::getSecondPointId() const
|
quint32 DialogTriangle::GetSecondPointId() const
|
||||||
{
|
{
|
||||||
return getCurrentObjectId(ui->comboBoxSecondPoint);
|
return getCurrentObjectId(ui->comboBoxSecondPoint);
|
||||||
}
|
}
|
||||||
|
|
|
@ -48,19 +48,19 @@ public:
|
||||||
DialogTriangle(const VContainer *data, const quint32 &toolId, QWidget *parent = nullptr);
|
DialogTriangle(const VContainer *data, const quint32 &toolId, QWidget *parent = nullptr);
|
||||||
~DialogTriangle();
|
~DialogTriangle();
|
||||||
|
|
||||||
quint32 getAxisP1Id() const;
|
quint32 GetAxisP1Id() const;
|
||||||
void setAxisP1Id(const quint32 &value);
|
void SetAxisP1Id(const quint32 &value);
|
||||||
|
|
||||||
quint32 getAxisP2Id() const;
|
quint32 GetAxisP2Id() const;
|
||||||
void setAxisP2Id(const quint32 &value);
|
void SetAxisP2Id(const quint32 &value);
|
||||||
|
|
||||||
quint32 getFirstPointId() const;
|
quint32 GetFirstPointId() const;
|
||||||
void setFirstPointId(const quint32 &value);
|
void SetFirstPointId(const quint32 &value);
|
||||||
|
|
||||||
quint32 getSecondPointId() const;
|
quint32 GetSecondPointId() const;
|
||||||
void setSecondPointId(const quint32 &value);
|
void SetSecondPointId(const quint32 &value);
|
||||||
|
|
||||||
void setPointName(const QString &value);
|
void SetPointName(const QString &value);
|
||||||
public slots:
|
public slots:
|
||||||
virtual void ChosenObject(quint32 id, const SceneObject &type);
|
virtual void ChosenObject(quint32 id, const SceneObject &type);
|
||||||
virtual void PointNameChanged();
|
virtual void PointNameChanged();
|
||||||
|
|
|
@ -255,7 +255,7 @@ QString VArc::GetFormulaF1() const
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VArc::SetFormulaF1(const VFormula &value)
|
void VArc::SetFormulaF1(const VFormula &value)
|
||||||
{
|
{
|
||||||
d->formulaF1 = value.getFormula(FormulaType::FromUser);
|
d->formulaF1 = value.GetFormula(FormulaType::FromUser);
|
||||||
d->f1 = value.getDoubleValue();
|
d->f1 = value.getDoubleValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -282,7 +282,7 @@ QString VArc::GetFormulaF2() const
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VArc::SetFormulaF2(const VFormula &value)
|
void VArc::SetFormulaF2(const VFormula &value)
|
||||||
{
|
{
|
||||||
d->formulaF2 = value.getFormula(FormulaType::FromUser);
|
d->formulaF2 = value.GetFormula(FormulaType::FromUser);
|
||||||
d->f2 = value.getDoubleValue();
|
d->f2 = value.getDoubleValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -309,7 +309,7 @@ QString VArc::GetFormulaRadius() const
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VArc::SetFormulaRadius(const VFormula &value)
|
void VArc::SetFormulaRadius(const VFormula &value)
|
||||||
{
|
{
|
||||||
d->formulaRadius = value.getFormula(FormulaType::FromUser);
|
d->formulaRadius = value.GetFormula(FormulaType::FromUser);
|
||||||
d->radius = value.getDoubleValue();
|
d->radius = value.getDoubleValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -255,13 +255,13 @@ void VSplinePath::Clear()
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
qreal VSplinePath::getKCurve() const
|
qreal VSplinePath::GetKCurve() const
|
||||||
{
|
{
|
||||||
return d->kCurve;
|
return d->kCurve;
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VSplinePath::setKCurve(const qreal &value)
|
void VSplinePath::SetKCurve(const qreal &value)
|
||||||
{
|
{
|
||||||
if (value > 0)
|
if (value > 0)
|
||||||
{
|
{
|
||||||
|
|
|
@ -118,15 +118,15 @@ public:
|
||||||
*/
|
*/
|
||||||
void Clear();
|
void Clear();
|
||||||
/**
|
/**
|
||||||
* @brief getKCurve return coefficient of curvature spline path.
|
* @brief GetKCurve return coefficient of curvature spline path.
|
||||||
* @return coefficient of curvature spline.
|
* @return coefficient of curvature spline.
|
||||||
*/
|
*/
|
||||||
qreal getKCurve() const;
|
qreal GetKCurve() const;
|
||||||
/**
|
/**
|
||||||
* @brief setKCurve set coefficient of curvature spline path.
|
* @brief SetKCurve set coefficient of curvature spline path.
|
||||||
* @param value coefficient of curvature spline path.
|
* @param value coefficient of curvature spline path.
|
||||||
*/
|
*/
|
||||||
void setKCurve(const qreal &value);
|
void SetKCurve(const qreal &value);
|
||||||
/**
|
/**
|
||||||
* @brief GetPoint pointer to list spline point.
|
* @brief GetPoint pointer to list spline point.
|
||||||
* @return list.
|
* @return list.
|
||||||
|
@ -160,8 +160,8 @@ public:
|
||||||
*
|
*
|
||||||
* VSplinePoint splP1 = splPath->at(p1);
|
* VSplinePoint splP1 = splPath->at(p1);
|
||||||
* VSplinePoint splP2 = splPath->at(p2);
|
* VSplinePoint splP2 = splPath->at(p2);
|
||||||
* VSpline spl1 = VSpline(splP1.P(), spl1p2, spl1p3, *p, splPath->getKCurve());
|
* VSpline spl1 = VSpline(splP1.P(), spl1p2, spl1p3, *p, splPath->GetKCurve());
|
||||||
* VSpline spl2 = VSpline(*p, spl2p2, spl2p3, splP2.P(), splPath->getKCurve());
|
* VSpline spl2 = VSpline(*p, spl2p2, spl2p3, splP2.P(), splPath->GetKCurve());
|
||||||
* @param length length first spline path.
|
* @param length length first spline path.
|
||||||
* @param p1 index first spline point in list.
|
* @param p1 index first spline point in list.
|
||||||
* @param p2 index second spline point in list.
|
* @param p2 index second spline point in list.
|
||||||
|
|
|
@ -241,10 +241,10 @@ qreal VDrawTool::CheckFormula(const quint32 &toolId, QString &formula, VContaine
|
||||||
{
|
{
|
||||||
DialogEditWrongFormula *dialog = new DialogEditWrongFormula(data, toolId, qApp->getMainWindow());
|
DialogEditWrongFormula *dialog = new DialogEditWrongFormula(data, toolId, qApp->getMainWindow());
|
||||||
dialog->setWindowTitle(tr("Edit wrong formula"));
|
dialog->setWindowTitle(tr("Edit wrong formula"));
|
||||||
dialog->setFormula(formula);
|
dialog->SetFormula(formula);
|
||||||
if (dialog->exec() == QDialog::Accepted)
|
if (dialog->exec() == QDialog::Accepted)
|
||||||
{
|
{
|
||||||
formula = dialog->getFormula();
|
formula = dialog->GetFormula();
|
||||||
/* Need delete dialog here because parser in dialog don't allow use correct separator for parsing
|
/* Need delete dialog here because parser in dialog don't allow use correct separator for parsing
|
||||||
* here. */
|
* here. */
|
||||||
delete dialog;
|
delete dialog;
|
||||||
|
|
|
@ -144,10 +144,10 @@ void VToolAlongLine::SaveDialog(QDomElement &domElement)
|
||||||
DialogAlongLine *dialogTool = qobject_cast<DialogAlongLine*>(dialog);
|
DialogAlongLine *dialogTool = qobject_cast<DialogAlongLine*>(dialog);
|
||||||
SCASSERT(dialogTool != nullptr);
|
SCASSERT(dialogTool != nullptr);
|
||||||
doc->SetAttribute(domElement, AttrName, dialogTool->getPointName());
|
doc->SetAttribute(domElement, AttrName, dialogTool->getPointName());
|
||||||
doc->SetAttribute(domElement, AttrTypeLine, dialogTool->getTypeLine());
|
doc->SetAttribute(domElement, AttrTypeLine, dialogTool->GetTypeLine());
|
||||||
doc->SetAttribute(domElement, AttrLength, dialogTool->getFormula());
|
doc->SetAttribute(domElement, AttrLength, dialogTool->GetFormula());
|
||||||
doc->SetAttribute(domElement, AttrFirstPoint, dialogTool->getFirstPointId());
|
doc->SetAttribute(domElement, AttrFirstPoint, dialogTool->GetFirstPointId());
|
||||||
doc->SetAttribute(domElement, AttrSecondPoint, dialogTool->getSecondPointId());
|
doc->SetAttribute(domElement, AttrSecondPoint, dialogTool->GetSecondPointId());
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
@ -169,13 +169,13 @@ void VToolAlongLine::SaveOptions(QDomElement &tag, QSharedPointer<VGObject> &obj
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
quint32 VToolAlongLine::getSecondPointId() const
|
quint32 VToolAlongLine::GetSecondPointId() const
|
||||||
{
|
{
|
||||||
return secondPointId;
|
return secondPointId;
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VToolAlongLine::setSecondPointId(const quint32 &value)
|
void VToolAlongLine::SetSecondPointId(const quint32 &value)
|
||||||
{
|
{
|
||||||
if (value != NULL_ID)
|
if (value != NULL_ID)
|
||||||
{
|
{
|
||||||
|
@ -231,11 +231,11 @@ void VToolAlongLine::setDialog()
|
||||||
DialogAlongLine *dialogTool = qobject_cast<DialogAlongLine*>(dialog);
|
DialogAlongLine *dialogTool = qobject_cast<DialogAlongLine*>(dialog);
|
||||||
SCASSERT(dialogTool != nullptr);
|
SCASSERT(dialogTool != nullptr);
|
||||||
const QSharedPointer<VPointF> p = VAbstractTool::data.GeometricObject<VPointF>(id);
|
const QSharedPointer<VPointF> p = VAbstractTool::data.GeometricObject<VPointF>(id);
|
||||||
dialogTool->setTypeLine(typeLine);
|
dialogTool->SetTypeLine(typeLine);
|
||||||
dialogTool->setFormula(formulaLength);
|
dialogTool->SetFormula(formulaLength);
|
||||||
dialogTool->setFirstPointId(basePointId);
|
dialogTool->SetFirstPointId(basePointId);
|
||||||
dialogTool->setSecondPointId(secondPointId);
|
dialogTool->SetSecondPointId(secondPointId);
|
||||||
dialogTool->setPointName(p->name());
|
dialogTool->SetPointName(p->name());
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
@ -251,10 +251,10 @@ VToolAlongLine* VToolAlongLine::Create(DialogTool *dialog, VMainGraphicsScene *s
|
||||||
SCASSERT(dialog != nullptr);
|
SCASSERT(dialog != nullptr);
|
||||||
DialogAlongLine *dialogTool = qobject_cast<DialogAlongLine*>(dialog);
|
DialogAlongLine *dialogTool = qobject_cast<DialogAlongLine*>(dialog);
|
||||||
SCASSERT(dialogTool != nullptr);
|
SCASSERT(dialogTool != nullptr);
|
||||||
QString formula = dialogTool->getFormula();
|
QString formula = dialogTool->GetFormula();
|
||||||
const quint32 firstPointId = dialogTool->getFirstPointId();
|
const quint32 firstPointId = dialogTool->GetFirstPointId();
|
||||||
const quint32 secondPointId = dialogTool->getSecondPointId();
|
const quint32 secondPointId = dialogTool->GetSecondPointId();
|
||||||
const QString typeLine = dialogTool->getTypeLine();
|
const QString typeLine = dialogTool->GetTypeLine();
|
||||||
const QString pointName = dialogTool->getPointName();
|
const QString pointName = dialogTool->getPointName();
|
||||||
VToolAlongLine *point=nullptr;
|
VToolAlongLine *point=nullptr;
|
||||||
point = Create(0, pointName, typeLine, formula, firstPointId, secondPointId, 5, 10, scene, doc, data,
|
point = Create(0, pointName, typeLine, formula, firstPointId, secondPointId, 5, 10, scene, doc, data,
|
||||||
|
|
|
@ -52,8 +52,8 @@ public:
|
||||||
virtual int type() const {return Type;}
|
virtual int type() const {return Type;}
|
||||||
enum { Type = UserType + static_cast<int>(Tool::AlongLine)};
|
enum { Type = UserType + static_cast<int>(Tool::AlongLine)};
|
||||||
|
|
||||||
quint32 getSecondPointId() const;
|
quint32 GetSecondPointId() const;
|
||||||
void setSecondPointId(const quint32 &value);
|
void SetSecondPointId(const quint32 &value);
|
||||||
virtual void ShowVisualization(bool show);
|
virtual void ShowVisualization(bool show);
|
||||||
public slots:
|
public slots:
|
||||||
virtual void FullUpdateFromFile();
|
virtual void FullUpdateFromFile();
|
||||||
|
|
|
@ -197,7 +197,7 @@ void VToolArc::setCenter(const quint32 &value)
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
VFormula VToolArc::getFormulaRadius() const
|
VFormula VToolArc::GetFormulaRadius() const
|
||||||
{
|
{
|
||||||
QSharedPointer<VArc> arc = VAbstractTool::data.GeometricObject<VArc>(id);
|
QSharedPointer<VArc> arc = VAbstractTool::data.GeometricObject<VArc>(id);
|
||||||
SCASSERT(arc.isNull() == false);
|
SCASSERT(arc.isNull() == false);
|
||||||
|
@ -210,7 +210,7 @@ VFormula VToolArc::getFormulaRadius() const
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VToolArc::setFormulaRadius(const VFormula &value)
|
void VToolArc::SetFormulaRadius(const VFormula &value)
|
||||||
{
|
{
|
||||||
if (value.error() == false)
|
if (value.error() == false)
|
||||||
{
|
{
|
||||||
|
@ -225,7 +225,7 @@ void VToolArc::setFormulaRadius(const VFormula &value)
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
VFormula VToolArc::getFormulaF1() const
|
VFormula VToolArc::GetFormulaF1() const
|
||||||
{
|
{
|
||||||
QSharedPointer<VArc> arc = VAbstractTool::data.GeometricObject<VArc>(id);
|
QSharedPointer<VArc> arc = VAbstractTool::data.GeometricObject<VArc>(id);
|
||||||
SCASSERT(arc.isNull() == false);
|
SCASSERT(arc.isNull() == false);
|
||||||
|
@ -238,7 +238,7 @@ VFormula VToolArc::getFormulaF1() const
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VToolArc::setFormulaF1(const VFormula &value)
|
void VToolArc::SetFormulaF1(const VFormula &value)
|
||||||
{
|
{
|
||||||
if (value.error() == false)
|
if (value.error() == false)
|
||||||
{
|
{
|
||||||
|
@ -254,7 +254,7 @@ void VToolArc::setFormulaF1(const VFormula &value)
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
VFormula VToolArc::getFormulaF2() const
|
VFormula VToolArc::GetFormulaF2() const
|
||||||
{
|
{
|
||||||
QSharedPointer<VArc> arc = VAbstractTool::data.GeometricObject<VArc>(id);
|
QSharedPointer<VArc> arc = VAbstractTool::data.GeometricObject<VArc>(id);
|
||||||
SCASSERT(arc.isNull() == false);
|
SCASSERT(arc.isNull() == false);
|
||||||
|
@ -267,7 +267,7 @@ VFormula VToolArc::getFormulaF2() const
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VToolArc::setFormulaF2(const VFormula &value)
|
void VToolArc::SetFormulaF2(const VFormula &value)
|
||||||
{
|
{
|
||||||
if (value.error() == false)
|
if (value.error() == false)
|
||||||
{
|
{
|
||||||
|
|
|
@ -55,14 +55,14 @@ public:
|
||||||
quint32 getCenter() const;
|
quint32 getCenter() const;
|
||||||
void setCenter(const quint32 &value);
|
void setCenter(const quint32 &value);
|
||||||
|
|
||||||
VFormula getFormulaRadius() const;
|
VFormula GetFormulaRadius() const;
|
||||||
void setFormulaRadius(const VFormula &value);
|
void SetFormulaRadius(const VFormula &value);
|
||||||
|
|
||||||
VFormula getFormulaF1() const;
|
VFormula GetFormulaF1() const;
|
||||||
void setFormulaF1(const VFormula &value);
|
void SetFormulaF1(const VFormula &value);
|
||||||
|
|
||||||
VFormula getFormulaF2() const;
|
VFormula GetFormulaF2() const;
|
||||||
void setFormulaF2(const VFormula &value);
|
void SetFormulaF2(const VFormula &value);
|
||||||
|
|
||||||
virtual void ShowVisualization(bool show);
|
virtual void ShowVisualization(bool show);
|
||||||
protected:
|
protected:
|
||||||
|
|
|
@ -112,12 +112,12 @@ void VToolBisector::setDialog()
|
||||||
DialogBisector *dialogTool = qobject_cast<DialogBisector*>(dialog);
|
DialogBisector *dialogTool = qobject_cast<DialogBisector*>(dialog);
|
||||||
SCASSERT(dialogTool != nullptr);
|
SCASSERT(dialogTool != nullptr);
|
||||||
const QSharedPointer<VPointF> p = VAbstractTool::data.GeometricObject<VPointF>(id);
|
const QSharedPointer<VPointF> p = VAbstractTool::data.GeometricObject<VPointF>(id);
|
||||||
dialogTool->setTypeLine(typeLine);
|
dialogTool->SetTypeLine(typeLine);
|
||||||
dialogTool->setFormula(formulaLength);
|
dialogTool->SetFormula(formulaLength);
|
||||||
dialogTool->setFirstPointId(firstPointId);
|
dialogTool->SetFirstPointId(firstPointId);
|
||||||
dialogTool->setSecondPointId(basePointId);
|
dialogTool->SetSecondPointId(basePointId);
|
||||||
dialogTool->setThirdPointId(thirdPointId);
|
dialogTool->SetThirdPointId(thirdPointId);
|
||||||
dialogTool->setPointName(p->name());
|
dialogTool->SetPointName(p->name());
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
@ -134,11 +134,11 @@ VToolBisector* VToolBisector::Create(DialogTool *dialog, VMainGraphicsScene *sce
|
||||||
SCASSERT(dialog != nullptr);
|
SCASSERT(dialog != nullptr);
|
||||||
DialogBisector *dialogTool = qobject_cast<DialogBisector*>(dialog);
|
DialogBisector *dialogTool = qobject_cast<DialogBisector*>(dialog);
|
||||||
SCASSERT(dialogTool != nullptr);
|
SCASSERT(dialogTool != nullptr);
|
||||||
QString formula = dialogTool->getFormula();
|
QString formula = dialogTool->GetFormula();
|
||||||
const quint32 firstPointId = dialogTool->getFirstPointId();
|
const quint32 firstPointId = dialogTool->GetFirstPointId();
|
||||||
const quint32 secondPointId = dialogTool->getSecondPointId();
|
const quint32 secondPointId = dialogTool->GetSecondPointId();
|
||||||
const quint32 thirdPointId = dialogTool->getThirdPointId();
|
const quint32 thirdPointId = dialogTool->GetThirdPointId();
|
||||||
const QString typeLine = dialogTool->getTypeLine();
|
const QString typeLine = dialogTool->GetTypeLine();
|
||||||
const QString pointName = dialogTool->getPointName();
|
const QString pointName = dialogTool->getPointName();
|
||||||
VToolBisector *point = nullptr;
|
VToolBisector *point = nullptr;
|
||||||
point=Create(0, formula, firstPointId, secondPointId, thirdPointId, typeLine, pointName, 5, 10, scene, doc, data,
|
point=Create(0, formula, firstPointId, secondPointId, thirdPointId, typeLine, pointName, 5, 10, scene, doc, data,
|
||||||
|
@ -296,11 +296,11 @@ void VToolBisector::SaveDialog(QDomElement &domElement)
|
||||||
DialogBisector *dialogTool = qobject_cast<DialogBisector*>(dialog);
|
DialogBisector *dialogTool = qobject_cast<DialogBisector*>(dialog);
|
||||||
SCASSERT(dialogTool != nullptr);
|
SCASSERT(dialogTool != nullptr);
|
||||||
doc->SetAttribute(domElement, AttrName, dialogTool->getPointName());
|
doc->SetAttribute(domElement, AttrName, dialogTool->getPointName());
|
||||||
doc->SetAttribute(domElement, AttrTypeLine, dialogTool->getTypeLine());
|
doc->SetAttribute(domElement, AttrTypeLine, dialogTool->GetTypeLine());
|
||||||
doc->SetAttribute(domElement, AttrLength, dialogTool->getFormula());
|
doc->SetAttribute(domElement, AttrLength, dialogTool->GetFormula());
|
||||||
doc->SetAttribute(domElement, AttrFirstPoint, QString().setNum(dialogTool->getFirstPointId()));
|
doc->SetAttribute(domElement, AttrFirstPoint, QString().setNum(dialogTool->GetFirstPointId()));
|
||||||
doc->SetAttribute(domElement, AttrSecondPoint, QString().setNum(dialogTool->getSecondPointId()));
|
doc->SetAttribute(domElement, AttrSecondPoint, QString().setNum(dialogTool->GetSecondPointId()));
|
||||||
doc->SetAttribute(domElement, AttrThirdPoint, QString().setNum(dialogTool->getThirdPointId()));
|
doc->SetAttribute(domElement, AttrThirdPoint, QString().setNum(dialogTool->GetThirdPointId()));
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
@ -323,13 +323,13 @@ void VToolBisector::SaveOptions(QDomElement &tag, QSharedPointer<VGObject> &obj)
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
quint32 VToolBisector::getThirdPointId() const
|
quint32 VToolBisector::GetThirdPointId() const
|
||||||
{
|
{
|
||||||
return thirdPointId;
|
return thirdPointId;
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VToolBisector::setThirdPointId(const quint32 &value)
|
void VToolBisector::SetThirdPointId(const quint32 &value)
|
||||||
{
|
{
|
||||||
if (value != NULL_ID)
|
if (value != NULL_ID)
|
||||||
{
|
{
|
||||||
|
@ -377,13 +377,13 @@ void VToolBisector::ShowVisualization(bool show)
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
quint32 VToolBisector::getFirstPointId() const
|
quint32 VToolBisector::GetFirstPointId() const
|
||||||
{
|
{
|
||||||
return firstPointId;
|
return firstPointId;
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VToolBisector::setFirstPointId(const quint32 &value)
|
void VToolBisector::SetFirstPointId(const quint32 &value)
|
||||||
{
|
{
|
||||||
if (value != NULL_ID)
|
if (value != NULL_ID)
|
||||||
{
|
{
|
||||||
|
|
|
@ -56,11 +56,11 @@ public:
|
||||||
virtual int type() const {return Type;}
|
virtual int type() const {return Type;}
|
||||||
enum { Type = UserType + static_cast<int>(Tool::Bisector)};
|
enum { Type = UserType + static_cast<int>(Tool::Bisector)};
|
||||||
|
|
||||||
quint32 getFirstPointId() const;
|
quint32 GetFirstPointId() const;
|
||||||
void setFirstPointId(const quint32 &value);
|
void SetFirstPointId(const quint32 &value);
|
||||||
|
|
||||||
quint32 getThirdPointId() const;
|
quint32 GetThirdPointId() const;
|
||||||
void setThirdPointId(const quint32 &value);
|
void SetThirdPointId(const quint32 &value);
|
||||||
|
|
||||||
virtual void ShowVisualization(bool show);
|
virtual void ShowVisualization(bool show);
|
||||||
public slots:
|
public slots:
|
||||||
|
|
|
@ -66,11 +66,11 @@ void VToolCurveIntersectAxis::setDialog()
|
||||||
DialogCurveIntersectAxis *dialogTool = qobject_cast<DialogCurveIntersectAxis*>(dialog);
|
DialogCurveIntersectAxis *dialogTool = qobject_cast<DialogCurveIntersectAxis*>(dialog);
|
||||||
SCASSERT(dialogTool != nullptr);
|
SCASSERT(dialogTool != nullptr);
|
||||||
const QSharedPointer<VPointF> p = VAbstractTool::data.GeometricObject<VPointF>(id);
|
const QSharedPointer<VPointF> p = VAbstractTool::data.GeometricObject<VPointF>(id);
|
||||||
dialogTool->setTypeLine(typeLine);
|
dialogTool->SetTypeLine(typeLine);
|
||||||
dialogTool->setAngle(formulaAngle);
|
dialogTool->SetAngle(formulaAngle);
|
||||||
dialogTool->setBasePointId(basePointId);
|
dialogTool->SetBasePointId(basePointId);
|
||||||
dialogTool->setCurveId(curveId);
|
dialogTool->setCurveId(curveId);
|
||||||
dialogTool->setPointName(p->name());
|
dialogTool->SetPointName(p->name());
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
@ -81,9 +81,9 @@ VToolCurveIntersectAxis *VToolCurveIntersectAxis::Create(DialogTool *dialog, VMa
|
||||||
DialogCurveIntersectAxis *dialogTool = qobject_cast<DialogCurveIntersectAxis*>(dialog);
|
DialogCurveIntersectAxis *dialogTool = qobject_cast<DialogCurveIntersectAxis*>(dialog);
|
||||||
SCASSERT(dialogTool);
|
SCASSERT(dialogTool);
|
||||||
const QString pointName = dialogTool->getPointName();
|
const QString pointName = dialogTool->getPointName();
|
||||||
const QString typeLine = dialogTool->getTypeLine();
|
const QString typeLine = dialogTool->GetTypeLine();
|
||||||
QString formulaAngle = dialogTool->getAngle();
|
QString formulaAngle = dialogTool->GetAngle();
|
||||||
const quint32 basePointId = dialogTool->getBasePointId();
|
const quint32 basePointId = dialogTool->GetBasePointId();
|
||||||
const quint32 curveId = dialogTool->getCurveId();
|
const quint32 curveId = dialogTool->getCurveId();
|
||||||
|
|
||||||
VToolCurveIntersectAxis *point = nullptr;
|
VToolCurveIntersectAxis *point = nullptr;
|
||||||
|
@ -173,7 +173,7 @@ QPointF VToolCurveIntersectAxis::FindPoint(const QPointF &point, qreal angle,
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
VFormula VToolCurveIntersectAxis::getFormulaAngle() const
|
VFormula VToolCurveIntersectAxis::GetFormulaAngle() const
|
||||||
{
|
{
|
||||||
VFormula fAngle(formulaAngle, getData());
|
VFormula fAngle(formulaAngle, getData());
|
||||||
fAngle.setCheckZero(false);
|
fAngle.setCheckZero(false);
|
||||||
|
@ -183,11 +183,11 @@ VFormula VToolCurveIntersectAxis::getFormulaAngle() const
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VToolCurveIntersectAxis::setFormulaAngle(const VFormula &value)
|
void VToolCurveIntersectAxis::SetFormulaAngle(const VFormula &value)
|
||||||
{
|
{
|
||||||
if (value.error() == false)
|
if (value.error() == false)
|
||||||
{
|
{
|
||||||
formulaAngle = value.getFormula(FormulaType::FromUser);
|
formulaAngle = value.GetFormula(FormulaType::FromUser);
|
||||||
|
|
||||||
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(id);
|
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(id);
|
||||||
SaveOption(obj);
|
SaveOption(obj);
|
||||||
|
@ -226,7 +226,7 @@ void VToolCurveIntersectAxis::ShowVisualization(bool show)
|
||||||
|
|
||||||
visual->setPoint1Id(curveId);
|
visual->setPoint1Id(curveId);
|
||||||
visual->setAxisPointId(basePointId);
|
visual->setAxisPointId(basePointId);
|
||||||
visual->setAngle(qApp->FormulaToUser(formulaAngle));
|
visual->SetAngle(qApp->FormulaToUser(formulaAngle));
|
||||||
visual->setLineStyle(VAbstractTool::LineStyleToPenStyle(typeLine));
|
visual->setLineStyle(VAbstractTool::LineStyleToPenStyle(typeLine));
|
||||||
visual->RefreshGeometry();
|
visual->RefreshGeometry();
|
||||||
vis = visual;
|
vis = visual;
|
||||||
|
@ -265,7 +265,7 @@ void VToolCurveIntersectAxis::FullUpdateFromFile()
|
||||||
VisToolCurveIntersectAxis *visual = qobject_cast<VisToolCurveIntersectAxis *>(vis);
|
VisToolCurveIntersectAxis *visual = qobject_cast<VisToolCurveIntersectAxis *>(vis);
|
||||||
visual->setPoint1Id(curveId);
|
visual->setPoint1Id(curveId);
|
||||||
visual->setAxisPointId(basePointId);
|
visual->setAxisPointId(basePointId);
|
||||||
visual->setAngle(qApp->FormulaToUser(formulaAngle));
|
visual->SetAngle(qApp->FormulaToUser(formulaAngle));
|
||||||
visual->setLineStyle(VAbstractTool::LineStyleToPenStyle(typeLine));
|
visual->setLineStyle(VAbstractTool::LineStyleToPenStyle(typeLine));
|
||||||
visual->RefreshGeometry();
|
visual->RefreshGeometry();
|
||||||
}
|
}
|
||||||
|
@ -290,9 +290,9 @@ void VToolCurveIntersectAxis::SaveDialog(QDomElement &domElement)
|
||||||
DialogCurveIntersectAxis *dialogTool = qobject_cast<DialogCurveIntersectAxis*>(dialog);
|
DialogCurveIntersectAxis *dialogTool = qobject_cast<DialogCurveIntersectAxis*>(dialog);
|
||||||
SCASSERT(dialogTool != nullptr);
|
SCASSERT(dialogTool != nullptr);
|
||||||
doc->SetAttribute(domElement, AttrName, dialogTool->getPointName());
|
doc->SetAttribute(domElement, AttrName, dialogTool->getPointName());
|
||||||
doc->SetAttribute(domElement, AttrTypeLine, dialogTool->getTypeLine());
|
doc->SetAttribute(domElement, AttrTypeLine, dialogTool->GetTypeLine());
|
||||||
doc->SetAttribute(domElement, AttrAngle, dialogTool->getAngle());
|
doc->SetAttribute(domElement, AttrAngle, dialogTool->GetAngle());
|
||||||
doc->SetAttribute(domElement, AttrBasePoint, QString().setNum(dialogTool->getBasePointId()));
|
doc->SetAttribute(domElement, AttrBasePoint, QString().setNum(dialogTool->GetBasePointId()));
|
||||||
doc->SetAttribute(domElement, AttrCurve, QString().setNum(dialogTool->getCurveId()));
|
doc->SetAttribute(domElement, AttrCurve, QString().setNum(dialogTool->getCurveId()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -54,8 +54,8 @@ public:
|
||||||
virtual int type() const {return Type;}
|
virtual int type() const {return Type;}
|
||||||
enum { Type = UserType + static_cast<int>(Tool::CurveIntersectAxis)};
|
enum { Type = UserType + static_cast<int>(Tool::CurveIntersectAxis)};
|
||||||
|
|
||||||
VFormula getFormulaAngle() const;
|
VFormula GetFormulaAngle() const;
|
||||||
void setFormulaAngle(const VFormula &value);
|
void SetFormulaAngle(const VFormula &value);
|
||||||
|
|
||||||
quint32 getCurveId() const;
|
quint32 getCurveId() const;
|
||||||
void setCurveId(const quint32 &value);
|
void setCurveId(const quint32 &value);
|
||||||
|
|
|
@ -94,7 +94,7 @@ void VToolCut::setCurveCutId(const quint32 &value)
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
VFormula VToolCut::getFormula() const
|
VFormula VToolCut::GetFormula() const
|
||||||
{
|
{
|
||||||
VFormula val(formula, getData());
|
VFormula val(formula, getData());
|
||||||
val.setCheckZero(true);
|
val.setCheckZero(true);
|
||||||
|
@ -104,11 +104,11 @@ VFormula VToolCut::getFormula() const
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VToolCut::setFormula(const VFormula &value)
|
void VToolCut::SetFormula(const VFormula &value)
|
||||||
{
|
{
|
||||||
if (value.error() == false)
|
if (value.error() == false)
|
||||||
{
|
{
|
||||||
formula = value.getFormula(FormulaType::FromUser);
|
formula = value.GetFormula(FormulaType::FromUser);
|
||||||
|
|
||||||
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(id);
|
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(id);
|
||||||
SaveOption(obj);
|
SaveOption(obj);
|
||||||
|
|
|
@ -43,8 +43,8 @@ public:
|
||||||
virtual int type() const {return Type;}
|
virtual int type() const {return Type;}
|
||||||
enum { Type = UserType + static_cast<int>(Tool::Cut)};
|
enum { Type = UserType + static_cast<int>(Tool::Cut)};
|
||||||
|
|
||||||
VFormula getFormula() const;
|
VFormula GetFormula() const;
|
||||||
void setFormula(const VFormula &value);
|
void SetFormula(const VFormula &value);
|
||||||
|
|
||||||
quint32 getCurveCutId() const;
|
quint32 getCurveCutId() const;
|
||||||
void setCurveCutId(const quint32 &value);
|
void setCurveCutId(const quint32 &value);
|
||||||
|
|
|
@ -77,9 +77,9 @@ void VToolCutArc::setDialog()
|
||||||
DialogCutArc *dialogTool = qobject_cast<DialogCutArc*>(dialog);
|
DialogCutArc *dialogTool = qobject_cast<DialogCutArc*>(dialog);
|
||||||
SCASSERT(dialogTool != nullptr);
|
SCASSERT(dialogTool != nullptr);
|
||||||
const QSharedPointer<VPointF> point = VAbstractTool::data.GeometricObject<VPointF>(id);
|
const QSharedPointer<VPointF> point = VAbstractTool::data.GeometricObject<VPointF>(id);
|
||||||
dialogTool->setFormula(formula);
|
dialogTool->SetFormula(formula);
|
||||||
dialogTool->setArcId(curveCutId);
|
dialogTool->setArcId(curveCutId);
|
||||||
dialogTool->setPointName(point->name());
|
dialogTool->SetPointName(point->name());
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
@ -96,7 +96,7 @@ VToolCutArc* VToolCutArc::Create(DialogTool *dialog, VMainGraphicsScene *scene,
|
||||||
DialogCutArc *dialogTool = qobject_cast<DialogCutArc*>(dialog);
|
DialogCutArc *dialogTool = qobject_cast<DialogCutArc*>(dialog);
|
||||||
SCASSERT(dialogTool != nullptr);
|
SCASSERT(dialogTool != nullptr);
|
||||||
const QString pointName = dialogTool->getPointName();
|
const QString pointName = dialogTool->getPointName();
|
||||||
QString formula = dialogTool->getFormula();
|
QString formula = dialogTool->GetFormula();
|
||||||
const quint32 arcId = dialogTool->getArcId();
|
const quint32 arcId = dialogTool->getArcId();
|
||||||
VToolCutArc* point = nullptr;
|
VToolCutArc* point = nullptr;
|
||||||
point=Create(0, pointName, formula, arcId, 5, 10, scene, doc, data, Document::FullParse, Source::FromGui);
|
point=Create(0, pointName, formula, arcId, 5, 10, scene, doc, data, Document::FullParse, Source::FromGui);
|
||||||
|
@ -271,7 +271,7 @@ void VToolCutArc::SaveDialog(QDomElement &domElement)
|
||||||
DialogCutArc *dialogTool = qobject_cast<DialogCutArc*>(dialog);
|
DialogCutArc *dialogTool = qobject_cast<DialogCutArc*>(dialog);
|
||||||
SCASSERT(dialogTool != nullptr);
|
SCASSERT(dialogTool != nullptr);
|
||||||
doc->SetAttribute(domElement, AttrName, dialogTool->getPointName());
|
doc->SetAttribute(domElement, AttrName, dialogTool->getPointName());
|
||||||
doc->SetAttribute(domElement, AttrLength, dialogTool->getFormula());
|
doc->SetAttribute(domElement, AttrLength, dialogTool->GetFormula());
|
||||||
doc->SetAttribute(domElement, AttrArc, QString().setNum(dialogTool->getArcId()));
|
doc->SetAttribute(domElement, AttrArc, QString().setNum(dialogTool->getArcId()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -76,9 +76,9 @@ void VToolCutSpline::setDialog()
|
||||||
DialogCutSpline *dialogTool = qobject_cast<DialogCutSpline*>(dialog);
|
DialogCutSpline *dialogTool = qobject_cast<DialogCutSpline*>(dialog);
|
||||||
SCASSERT(dialogTool != nullptr);
|
SCASSERT(dialogTool != nullptr);
|
||||||
const QSharedPointer<VPointF> point = VAbstractTool::data.GeometricObject<VPointF>(id);
|
const QSharedPointer<VPointF> point = VAbstractTool::data.GeometricObject<VPointF>(id);
|
||||||
dialogTool->setFormula(formula);
|
dialogTool->SetFormula(formula);
|
||||||
dialogTool->setSplineId(curveCutId);
|
dialogTool->setSplineId(curveCutId);
|
||||||
dialogTool->setPointName(point->name());
|
dialogTool->SetPointName(point->name());
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
@ -96,7 +96,7 @@ VToolCutSpline* VToolCutSpline::Create(DialogTool *dialog, VMainGraphicsScene *s
|
||||||
DialogCutSpline *dialogTool = qobject_cast<DialogCutSpline*>(dialog);
|
DialogCutSpline *dialogTool = qobject_cast<DialogCutSpline*>(dialog);
|
||||||
SCASSERT(dialogTool != nullptr);
|
SCASSERT(dialogTool != nullptr);
|
||||||
const QString pointName = dialogTool->getPointName();
|
const QString pointName = dialogTool->getPointName();
|
||||||
QString formula = dialogTool->getFormula();
|
QString formula = dialogTool->GetFormula();
|
||||||
const quint32 splineId = dialogTool->getSplineId();
|
const quint32 splineId = dialogTool->getSplineId();
|
||||||
VToolCutSpline* point = nullptr;
|
VToolCutSpline* point = nullptr;
|
||||||
point = Create(0, pointName, formula, splineId, 5, 10, scene, doc, data, Document::FullParse, Source::FromGui);
|
point = Create(0, pointName, formula, splineId, 5, 10, scene, doc, data, Document::FullParse, Source::FromGui);
|
||||||
|
@ -282,7 +282,7 @@ void VToolCutSpline::SaveDialog(QDomElement &domElement)
|
||||||
DialogCutSpline *dialogTool = qobject_cast<DialogCutSpline*>(dialog);
|
DialogCutSpline *dialogTool = qobject_cast<DialogCutSpline*>(dialog);
|
||||||
SCASSERT(dialogTool != nullptr);
|
SCASSERT(dialogTool != nullptr);
|
||||||
doc->SetAttribute(domElement, AttrName, dialogTool->getPointName());
|
doc->SetAttribute(domElement, AttrName, dialogTool->getPointName());
|
||||||
doc->SetAttribute(domElement, AttrLength, dialogTool->getFormula());
|
doc->SetAttribute(domElement, AttrLength, dialogTool->GetFormula());
|
||||||
doc->SetAttribute(domElement, AttrSpline, QString().setNum(dialogTool->getSplineId()));
|
doc->SetAttribute(domElement, AttrSpline, QString().setNum(dialogTool->getSplineId()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -80,9 +80,9 @@ void VToolCutSplinePath::setDialog()
|
||||||
DialogCutSplinePath *dialogTool = qobject_cast<DialogCutSplinePath*>(dialog);
|
DialogCutSplinePath *dialogTool = qobject_cast<DialogCutSplinePath*>(dialog);
|
||||||
SCASSERT(dialogTool != nullptr);
|
SCASSERT(dialogTool != nullptr);
|
||||||
const QSharedPointer<VPointF> point = VAbstractTool::data.GeometricObject<VPointF>(id);
|
const QSharedPointer<VPointF> point = VAbstractTool::data.GeometricObject<VPointF>(id);
|
||||||
dialogTool->setFormula(formula);
|
dialogTool->SetFormula(formula);
|
||||||
dialogTool->setSplinePathId(curveCutId);
|
dialogTool->setSplinePathId(curveCutId);
|
||||||
dialogTool->setPointName(point->name());
|
dialogTool->SetPointName(point->name());
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
@ -100,7 +100,7 @@ VToolCutSplinePath* VToolCutSplinePath::Create(DialogTool *dialog, VMainGraphics
|
||||||
DialogCutSplinePath *dialogTool = qobject_cast<DialogCutSplinePath*>(dialog);
|
DialogCutSplinePath *dialogTool = qobject_cast<DialogCutSplinePath*>(dialog);
|
||||||
SCASSERT(dialogTool != nullptr);
|
SCASSERT(dialogTool != nullptr);
|
||||||
const QString pointName = dialogTool->getPointName();
|
const QString pointName = dialogTool->getPointName();
|
||||||
QString formula = dialogTool->getFormula();
|
QString formula = dialogTool->GetFormula();
|
||||||
const quint32 splinePathId = dialogTool->getSplinePathId();
|
const quint32 splinePathId = dialogTool->getSplinePathId();
|
||||||
VToolCutSplinePath* point = nullptr;
|
VToolCutSplinePath* point = nullptr;
|
||||||
point = Create(0, pointName, formula, splinePathId, 5, 10, scene, doc, data, Document::FullParse, Source::FromGui);
|
point = Create(0, pointName, formula, splinePathId, 5, 10, scene, doc, data, Document::FullParse, Source::FromGui);
|
||||||
|
@ -156,8 +156,8 @@ VToolCutSplinePath* VToolCutSplinePath::Create(const quint32 _id, const QString
|
||||||
|
|
||||||
VSplinePoint splP1 = splPath->at(p1);
|
VSplinePoint splP1 = splPath->at(p1);
|
||||||
VSplinePoint splP2 = splPath->at(p2);
|
VSplinePoint splP2 = splPath->at(p2);
|
||||||
const VSpline spl1 = VSpline(splP1.P(), spl1p2, spl1p3, *p, splPath->getKCurve());
|
const VSpline spl1 = VSpline(splP1.P(), spl1p2, spl1p3, *p, splPath->GetKCurve());
|
||||||
const VSpline spl2 = VSpline(*p, spl2p2, spl2p3, splP2.P(), splPath->getKCurve());
|
const VSpline spl2 = VSpline(*p, spl2p2, spl2p3, splP2.P(), splPath->GetKCurve());
|
||||||
|
|
||||||
VSplinePath *splPath1 = new VSplinePath();
|
VSplinePath *splPath1 = new VSplinePath();
|
||||||
VSplinePath *splPath2 = new VSplinePath();
|
VSplinePath *splPath2 = new VSplinePath();
|
||||||
|
@ -191,8 +191,8 @@ VToolCutSplinePath* VToolCutSplinePath::Create(const quint32 _id, const QString
|
||||||
splPath2->append(splPath->at(i));
|
splPath2->append(splPath->at(i));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
splPath1->setKCurve(splPath->getKCurve());
|
splPath1->SetKCurve(splPath->GetKCurve());
|
||||||
splPath2->setKCurve(splPath->getKCurve());
|
splPath2->SetKCurve(splPath->GetKCurve());
|
||||||
|
|
||||||
splPath1->setMaxCountPoints(splPath->CountPoint());
|
splPath1->setMaxCountPoints(splPath->CountPoint());
|
||||||
splPath2->setMaxCountPoints(splPath->CountPoint());
|
splPath2->setMaxCountPoints(splPath->CountPoint());
|
||||||
|
@ -331,7 +331,7 @@ void VToolCutSplinePath::SaveDialog(QDomElement &domElement)
|
||||||
DialogCutSplinePath *dialogTool = qobject_cast<DialogCutSplinePath*>(dialog);
|
DialogCutSplinePath *dialogTool = qobject_cast<DialogCutSplinePath*>(dialog);
|
||||||
SCASSERT(dialogTool != nullptr);
|
SCASSERT(dialogTool != nullptr);
|
||||||
doc->SetAttribute(domElement, AttrName, dialogTool->getPointName());
|
doc->SetAttribute(domElement, AttrName, dialogTool->getPointName());
|
||||||
doc->SetAttribute(domElement, AttrLength, dialogTool->getFormula());
|
doc->SetAttribute(domElement, AttrLength, dialogTool->GetFormula());
|
||||||
doc->SetAttribute(domElement, AttrSplinePath, QString().setNum(dialogTool->getSplinePathId()));
|
doc->SetAttribute(domElement, AttrSplinePath, QString().setNum(dialogTool->getSplinePathId()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -79,11 +79,11 @@ void VToolEndLine::setDialog()
|
||||||
DialogEndLine *dialogTool = qobject_cast<DialogEndLine*>(dialog);
|
DialogEndLine *dialogTool = qobject_cast<DialogEndLine*>(dialog);
|
||||||
SCASSERT(dialogTool != nullptr);
|
SCASSERT(dialogTool != nullptr);
|
||||||
const QSharedPointer<VPointF> p = VAbstractTool::data.GeometricObject<VPointF>(id);
|
const QSharedPointer<VPointF> p = VAbstractTool::data.GeometricObject<VPointF>(id);
|
||||||
dialogTool->setTypeLine(typeLine);
|
dialogTool->SetTypeLine(typeLine);
|
||||||
dialogTool->setFormula(formulaLength);
|
dialogTool->SetFormula(formulaLength);
|
||||||
dialogTool->setAngle(formulaAngle);
|
dialogTool->SetAngle(formulaAngle);
|
||||||
dialogTool->setBasePointId(basePointId);
|
dialogTool->SetBasePointId(basePointId);
|
||||||
dialogTool->setPointName(p->name());
|
dialogTool->SetPointName(p->name());
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
@ -101,10 +101,10 @@ VToolEndLine* VToolEndLine::Create(DialogTool *dialog, VMainGraphicsScene *scene
|
||||||
DialogEndLine *dialogTool = qobject_cast<DialogEndLine*>(dialog);
|
DialogEndLine *dialogTool = qobject_cast<DialogEndLine*>(dialog);
|
||||||
SCASSERT(dialogTool);
|
SCASSERT(dialogTool);
|
||||||
const QString pointName = dialogTool->getPointName();
|
const QString pointName = dialogTool->getPointName();
|
||||||
const QString typeLine = dialogTool->getTypeLine();
|
const QString typeLine = dialogTool->GetTypeLine();
|
||||||
QString formulaLength = dialogTool->getFormula();
|
QString formulaLength = dialogTool->GetFormula();
|
||||||
QString formulaAngle = dialogTool->getAngle();
|
QString formulaAngle = dialogTool->GetAngle();
|
||||||
const quint32 basePointId = dialogTool->getBasePointId();
|
const quint32 basePointId = dialogTool->GetBasePointId();
|
||||||
|
|
||||||
VToolEndLine *point = nullptr;
|
VToolEndLine *point = nullptr;
|
||||||
point=Create(0, pointName, typeLine, formulaLength, formulaAngle, basePointId, 5, 10, scene, doc, data,
|
point=Create(0, pointName, typeLine, formulaLength, formulaAngle, basePointId, 5, 10, scene, doc, data,
|
||||||
|
@ -196,7 +196,7 @@ void VToolEndLine::FullUpdateFromFile()
|
||||||
VisToolEndLine *visual = qobject_cast<VisToolEndLine *>(vis);
|
VisToolEndLine *visual = qobject_cast<VisToolEndLine *>(vis);
|
||||||
visual->setPoint1Id(basePointId);
|
visual->setPoint1Id(basePointId);
|
||||||
visual->setLength(qApp->FormulaToUser(formulaLength));
|
visual->setLength(qApp->FormulaToUser(formulaLength));
|
||||||
visual->setAngle(qApp->FormulaToUser(formulaAngle));
|
visual->SetAngle(qApp->FormulaToUser(formulaAngle));
|
||||||
visual->setLineStyle(VAbstractTool::LineStyleToPenStyle(typeLine));
|
visual->setLineStyle(VAbstractTool::LineStyleToPenStyle(typeLine));
|
||||||
visual->RefreshGeometry();
|
visual->RefreshGeometry();
|
||||||
}
|
}
|
||||||
|
@ -232,10 +232,10 @@ void VToolEndLine::SaveDialog(QDomElement &domElement)
|
||||||
DialogEndLine *dialogTool = qobject_cast<DialogEndLine*>(dialog);
|
DialogEndLine *dialogTool = qobject_cast<DialogEndLine*>(dialog);
|
||||||
SCASSERT(dialogTool != nullptr);
|
SCASSERT(dialogTool != nullptr);
|
||||||
doc->SetAttribute(domElement, AttrName, dialogTool->getPointName());
|
doc->SetAttribute(domElement, AttrName, dialogTool->getPointName());
|
||||||
doc->SetAttribute(domElement, AttrTypeLine, dialogTool->getTypeLine());
|
doc->SetAttribute(domElement, AttrTypeLine, dialogTool->GetTypeLine());
|
||||||
doc->SetAttribute(domElement, AttrLength, dialogTool->getFormula());
|
doc->SetAttribute(domElement, AttrLength, dialogTool->GetFormula());
|
||||||
doc->SetAttribute(domElement, AttrAngle, dialogTool->getAngle());
|
doc->SetAttribute(domElement, AttrAngle, dialogTool->GetAngle());
|
||||||
doc->SetAttribute(domElement, AttrBasePoint, QString().setNum(dialogTool->getBasePointId()));
|
doc->SetAttribute(domElement, AttrBasePoint, QString().setNum(dialogTool->GetBasePointId()));
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
@ -257,7 +257,7 @@ void VToolEndLine::SaveOptions(QDomElement &tag, QSharedPointer<VGObject> &obj)
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
VFormula VToolEndLine::getFormulaAngle() const
|
VFormula VToolEndLine::GetFormulaAngle() const
|
||||||
{
|
{
|
||||||
VFormula fAngle(formulaAngle, getData());
|
VFormula fAngle(formulaAngle, getData());
|
||||||
fAngle.setCheckZero(false);
|
fAngle.setCheckZero(false);
|
||||||
|
@ -267,11 +267,11 @@ VFormula VToolEndLine::getFormulaAngle() const
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VToolEndLine::setFormulaAngle(const VFormula &value)
|
void VToolEndLine::SetFormulaAngle(const VFormula &value)
|
||||||
{
|
{
|
||||||
if (value.error() == false)
|
if (value.error() == false)
|
||||||
{
|
{
|
||||||
formulaAngle = value.getFormula(FormulaType::FromUser);
|
formulaAngle = value.GetFormula(FormulaType::FromUser);
|
||||||
|
|
||||||
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(id);
|
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(id);
|
||||||
SaveOption(obj);
|
SaveOption(obj);
|
||||||
|
@ -292,7 +292,7 @@ void VToolEndLine::ShowVisualization(bool show)
|
||||||
|
|
||||||
visual->setPoint1Id(basePointId);
|
visual->setPoint1Id(basePointId);
|
||||||
visual->setLength(qApp->FormulaToUser(formulaLength));
|
visual->setLength(qApp->FormulaToUser(formulaLength));
|
||||||
visual->setAngle(qApp->FormulaToUser(formulaAngle));
|
visual->SetAngle(qApp->FormulaToUser(formulaAngle));
|
||||||
visual->setLineStyle(VAbstractTool::LineStyleToPenStyle(typeLine));
|
visual->setLineStyle(VAbstractTool::LineStyleToPenStyle(typeLine));
|
||||||
visual->RefreshGeometry();
|
visual->RefreshGeometry();
|
||||||
vis = visual;
|
vis = visual;
|
||||||
|
|
|
@ -53,8 +53,8 @@ public:
|
||||||
virtual int type() const {return Type;}
|
virtual int type() const {return Type;}
|
||||||
enum { Type = UserType + static_cast<int>(Tool::EndLine)};
|
enum { Type = UserType + static_cast<int>(Tool::EndLine)};
|
||||||
|
|
||||||
VFormula getFormulaAngle() const;
|
VFormula GetFormulaAngle() const;
|
||||||
void setFormulaAngle(const VFormula &value);
|
void SetFormulaAngle(const VFormula &value);
|
||||||
virtual void ShowVisualization(bool show);
|
virtual void ShowVisualization(bool show);
|
||||||
public slots:
|
public slots:
|
||||||
virtual void FullUpdateFromFile();
|
virtual void FullUpdateFromFile();
|
||||||
|
|
|
@ -72,11 +72,11 @@ void VToolHeight::setDialog()
|
||||||
DialogHeight *dialogTool = qobject_cast<DialogHeight*>(dialog);
|
DialogHeight *dialogTool = qobject_cast<DialogHeight*>(dialog);
|
||||||
SCASSERT(dialogTool != nullptr);
|
SCASSERT(dialogTool != nullptr);
|
||||||
const QSharedPointer<VPointF> p = VAbstractTool::data.GeometricObject<VPointF>(id);
|
const QSharedPointer<VPointF> p = VAbstractTool::data.GeometricObject<VPointF>(id);
|
||||||
dialogTool->setTypeLine(typeLine);
|
dialogTool->SetTypeLine(typeLine);
|
||||||
dialogTool->setBasePointId(basePointId);
|
dialogTool->SetBasePointId(basePointId);
|
||||||
dialogTool->setP1LineId(p1LineId);
|
dialogTool->SetP1LineId(p1LineId);
|
||||||
dialogTool->setP2LineId(p2LineId);
|
dialogTool->SetP2LineId(p2LineId);
|
||||||
dialogTool->setPointName(p->name());
|
dialogTool->SetPointName(p->name());
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
@ -95,10 +95,10 @@ VToolHeight* VToolHeight::Create(DialogTool *dialog, VMainGraphicsScene *scene,
|
||||||
SCASSERT(dialogTool != nullptr);
|
SCASSERT(dialogTool != nullptr);
|
||||||
disconnect(doc, &VPattern::FullUpdateFromFile, dialogTool, &DialogHeight::UpdateList);
|
disconnect(doc, &VPattern::FullUpdateFromFile, dialogTool, &DialogHeight::UpdateList);
|
||||||
const QString pointName = dialogTool->getPointName();
|
const QString pointName = dialogTool->getPointName();
|
||||||
const QString typeLine = dialogTool->getTypeLine();
|
const QString typeLine = dialogTool->GetTypeLine();
|
||||||
const quint32 basePointId = dialogTool->getBasePointId();
|
const quint32 basePointId = dialogTool->GetBasePointId();
|
||||||
const quint32 p1LineId = dialogTool->getP1LineId();
|
const quint32 p1LineId = dialogTool->GetP1LineId();
|
||||||
const quint32 p2LineId = dialogTool->getP2LineId();
|
const quint32 p2LineId = dialogTool->GetP2LineId();
|
||||||
|
|
||||||
VToolHeight *point = nullptr;
|
VToolHeight *point = nullptr;
|
||||||
point = Create(0, pointName, typeLine, basePointId, p1LineId, p2LineId, 5, 10, scene, doc, data,
|
point = Create(0, pointName, typeLine, basePointId, p1LineId, p2LineId, 5, 10, scene, doc, data,
|
||||||
|
@ -244,10 +244,10 @@ void VToolHeight::SaveDialog(QDomElement &domElement)
|
||||||
DialogHeight *dialogTool = qobject_cast<DialogHeight*>(dialog);
|
DialogHeight *dialogTool = qobject_cast<DialogHeight*>(dialog);
|
||||||
SCASSERT(dialogTool != nullptr);
|
SCASSERT(dialogTool != nullptr);
|
||||||
doc->SetAttribute(domElement, AttrName, dialogTool->getPointName());
|
doc->SetAttribute(domElement, AttrName, dialogTool->getPointName());
|
||||||
doc->SetAttribute(domElement, AttrTypeLine, dialogTool->getTypeLine());
|
doc->SetAttribute(domElement, AttrTypeLine, dialogTool->GetTypeLine());
|
||||||
doc->SetAttribute(domElement, AttrBasePoint, QString().setNum(dialogTool->getBasePointId()));
|
doc->SetAttribute(domElement, AttrBasePoint, QString().setNum(dialogTool->GetBasePointId()));
|
||||||
doc->SetAttribute(domElement, AttrP1Line, QString().setNum(dialogTool->getP1LineId()));
|
doc->SetAttribute(domElement, AttrP1Line, QString().setNum(dialogTool->GetP1LineId()));
|
||||||
doc->SetAttribute(domElement, AttrP2Line, QString().setNum(dialogTool->getP2LineId()));
|
doc->SetAttribute(domElement, AttrP2Line, QString().setNum(dialogTool->GetP2LineId()));
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
@ -269,13 +269,13 @@ void VToolHeight::SaveOptions(QDomElement &tag, QSharedPointer<VGObject> &obj)
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
quint32 VToolHeight::getP2LineId() const
|
quint32 VToolHeight::GetP2LineId() const
|
||||||
{
|
{
|
||||||
return p2LineId;
|
return p2LineId;
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VToolHeight::setP2LineId(const quint32 &value)
|
void VToolHeight::SetP2LineId(const quint32 &value)
|
||||||
{
|
{
|
||||||
if (value != NULL_ID)
|
if (value != NULL_ID)
|
||||||
{
|
{
|
||||||
|
@ -322,13 +322,13 @@ void VToolHeight::ShowVisualization(bool show)
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
quint32 VToolHeight::getP1LineId() const
|
quint32 VToolHeight::GetP1LineId() const
|
||||||
{
|
{
|
||||||
return p1LineId;
|
return p1LineId;
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VToolHeight::setP1LineId(const quint32 &value)
|
void VToolHeight::SetP1LineId(const quint32 &value)
|
||||||
{
|
{
|
||||||
if (value != NULL_ID)
|
if (value != NULL_ID)
|
||||||
{
|
{
|
||||||
|
|
|
@ -53,11 +53,11 @@ public:
|
||||||
virtual int type() const {return Type;}
|
virtual int type() const {return Type;}
|
||||||
enum { Type = UserType + static_cast<int>(Tool::Height)};
|
enum { Type = UserType + static_cast<int>(Tool::Height)};
|
||||||
|
|
||||||
quint32 getP1LineId() const;
|
quint32 GetP1LineId() const;
|
||||||
void setP1LineId(const quint32 &value);
|
void SetP1LineId(const quint32 &value);
|
||||||
|
|
||||||
quint32 getP2LineId() const;
|
quint32 GetP2LineId() const;
|
||||||
void setP2LineId(const quint32 &value);
|
void SetP2LineId(const quint32 &value);
|
||||||
|
|
||||||
virtual void ShowVisualization(bool show);
|
virtual void ShowVisualization(bool show);
|
||||||
public slots:
|
public slots:
|
||||||
|
|
|
@ -82,9 +82,9 @@ void VToolLine::setDialog()
|
||||||
SCASSERT(dialog != nullptr);
|
SCASSERT(dialog != nullptr);
|
||||||
DialogLine *dialogTool = qobject_cast<DialogLine*>(dialog);
|
DialogLine *dialogTool = qobject_cast<DialogLine*>(dialog);
|
||||||
SCASSERT(dialogTool != nullptr);
|
SCASSERT(dialogTool != nullptr);
|
||||||
dialogTool->setFirstPoint(firstPoint);
|
dialogTool->SetFirstPoint(firstPoint);
|
||||||
dialogTool->setSecondPoint(secondPoint);
|
dialogTool->SetSecondPoint(secondPoint);
|
||||||
dialogTool->setTypeLine(typeLine);
|
dialogTool->SetTypeLine(typeLine);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
@ -100,9 +100,9 @@ VToolLine *VToolLine::Create(DialogTool *dialog, VMainGraphicsScene *scene, VPat
|
||||||
SCASSERT(dialog != nullptr);
|
SCASSERT(dialog != nullptr);
|
||||||
DialogLine *dialogTool = qobject_cast<DialogLine*>(dialog);
|
DialogLine *dialogTool = qobject_cast<DialogLine*>(dialog);
|
||||||
SCASSERT(dialogTool != nullptr);
|
SCASSERT(dialogTool != nullptr);
|
||||||
const quint32 firstPoint = dialogTool->getFirstPoint();
|
const quint32 firstPoint = dialogTool->GetFirstPoint();
|
||||||
const quint32 secondPoint = dialogTool->getSecondPoint();
|
const quint32 secondPoint = dialogTool->GetSecondPoint();
|
||||||
const QString typeLine = dialogTool->getTypeLine();
|
const QString typeLine = dialogTool->GetTypeLine();
|
||||||
|
|
||||||
VToolLine *line = nullptr;
|
VToolLine *line = nullptr;
|
||||||
line = Create(0, firstPoint, secondPoint, typeLine, scene, doc, data, Document::FullParse, Source::FromGui);
|
line = Create(0, firstPoint, secondPoint, typeLine, scene, doc, data, Document::FullParse, Source::FromGui);
|
||||||
|
@ -366,9 +366,9 @@ void VToolLine::SaveDialog(QDomElement &domElement)
|
||||||
SCASSERT(dialog != nullptr);
|
SCASSERT(dialog != nullptr);
|
||||||
DialogLine *dialogTool = qobject_cast<DialogLine*>(dialog);
|
DialogLine *dialogTool = qobject_cast<DialogLine*>(dialog);
|
||||||
SCASSERT(dialogTool != nullptr);
|
SCASSERT(dialogTool != nullptr);
|
||||||
doc->SetAttribute(domElement, AttrFirstPoint, QString().setNum(dialogTool->getFirstPoint()));
|
doc->SetAttribute(domElement, AttrFirstPoint, QString().setNum(dialogTool->GetFirstPoint()));
|
||||||
doc->SetAttribute(domElement, AttrSecondPoint, QString().setNum(dialogTool->getSecondPoint()));
|
doc->SetAttribute(domElement, AttrSecondPoint, QString().setNum(dialogTool->GetSecondPoint()));
|
||||||
doc->SetAttribute(domElement, AttrTypeLine, dialogTool->getTypeLine());
|
doc->SetAttribute(domElement, AttrTypeLine, dialogTool->GetTypeLine());
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
@ -383,13 +383,13 @@ void VToolLine::SaveOptions(QDomElement &tag, QSharedPointer<VGObject> &obj)
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
quint32 VToolLine::getSecondPoint() const
|
quint32 VToolLine::GetSecondPoint() const
|
||||||
{
|
{
|
||||||
return secondPoint;
|
return secondPoint;
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VToolLine::setSecondPoint(const quint32 &value)
|
void VToolLine::SetSecondPoint(const quint32 &value)
|
||||||
{
|
{
|
||||||
if (value != NULL_ID)
|
if (value != NULL_ID)
|
||||||
{
|
{
|
||||||
|
@ -435,7 +435,7 @@ void VToolLine::ShowVisualization(bool show)
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VToolLine::setTypeLine(const QString &value)
|
void VToolLine::SetTypeLine(const QString &value)
|
||||||
{
|
{
|
||||||
typeLine = value;
|
typeLine = value;
|
||||||
|
|
||||||
|
@ -444,13 +444,13 @@ void VToolLine::setTypeLine(const QString &value)
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
quint32 VToolLine::getFirstPoint() const
|
quint32 VToolLine::GetFirstPoint() const
|
||||||
{
|
{
|
||||||
return firstPoint;
|
return firstPoint;
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VToolLine::setFirstPoint(const quint32 &value)
|
void VToolLine::SetFirstPoint(const quint32 &value)
|
||||||
{
|
{
|
||||||
if (value != NULL_ID)
|
if (value != NULL_ID)
|
||||||
{
|
{
|
||||||
|
|
|
@ -51,14 +51,14 @@ public:
|
||||||
virtual int type() const {return Type;}
|
virtual int type() const {return Type;}
|
||||||
enum { Type = UserType + static_cast<int>(Tool::Line)};
|
enum { Type = UserType + static_cast<int>(Tool::Line)};
|
||||||
virtual QString getTagName() const;
|
virtual QString getTagName() const;
|
||||||
quint32 getFirstPoint() const;
|
quint32 GetFirstPoint() const;
|
||||||
void setFirstPoint(const quint32 &value);
|
void SetFirstPoint(const quint32 &value);
|
||||||
|
|
||||||
quint32 getSecondPoint() const;
|
quint32 GetSecondPoint() const;
|
||||||
void setSecondPoint(const quint32 &value);
|
void SetSecondPoint(const quint32 &value);
|
||||||
|
|
||||||
virtual void ShowVisualization(bool show);
|
virtual void ShowVisualization(bool show);
|
||||||
virtual void setTypeLine(const QString &value);
|
virtual void SetTypeLine(const QString &value);
|
||||||
public slots:
|
public slots:
|
||||||
virtual void FullUpdateFromFile();
|
virtual void FullUpdateFromFile();
|
||||||
virtual void ChangedActivDraw(const QString &newName);
|
virtual void ChangedActivDraw(const QString &newName);
|
||||||
|
|
|
@ -74,11 +74,11 @@ void VToolLineIntersect::setDialog()
|
||||||
DialogLineIntersect *dialogTool = qobject_cast<DialogLineIntersect*>(dialog);
|
DialogLineIntersect *dialogTool = qobject_cast<DialogLineIntersect*>(dialog);
|
||||||
SCASSERT(dialogTool != nullptr);
|
SCASSERT(dialogTool != nullptr);
|
||||||
const QSharedPointer<VPointF> p = VAbstractTool::data.GeometricObject<VPointF>(id);
|
const QSharedPointer<VPointF> p = VAbstractTool::data.GeometricObject<VPointF>(id);
|
||||||
dialogTool->setP1Line1(p1Line1);
|
dialogTool->SetP1Line1(p1Line1);
|
||||||
dialogTool->setP2Line1(p2Line1);
|
dialogTool->SetP2Line1(p2Line1);
|
||||||
dialogTool->setP1Line2(p1Line2);
|
dialogTool->SetP1Line2(p1Line2);
|
||||||
dialogTool->setP2Line2(p2Line2);
|
dialogTool->SetP2Line2(p2Line2);
|
||||||
dialogTool->setPointName(p->name());
|
dialogTool->SetPointName(p->name());
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
@ -96,10 +96,10 @@ VToolLineIntersect* VToolLineIntersect::Create(DialogTool *dialog, VMainGraphics
|
||||||
SCASSERT(dialog != nullptr);
|
SCASSERT(dialog != nullptr);
|
||||||
DialogLineIntersect *dialogTool = qobject_cast<DialogLineIntersect*>(dialog);
|
DialogLineIntersect *dialogTool = qobject_cast<DialogLineIntersect*>(dialog);
|
||||||
SCASSERT(dialogTool != nullptr);
|
SCASSERT(dialogTool != nullptr);
|
||||||
const quint32 p1Line1Id = dialogTool->getP1Line1();
|
const quint32 p1Line1Id = dialogTool->GetP1Line1();
|
||||||
const quint32 p2Line1Id = dialogTool->getP2Line1();
|
const quint32 p2Line1Id = dialogTool->GetP2Line1();
|
||||||
const quint32 p1Line2Id = dialogTool->getP1Line2();
|
const quint32 p1Line2Id = dialogTool->GetP1Line2();
|
||||||
const quint32 p2Line2Id = dialogTool->getP2Line2();
|
const quint32 p2Line2Id = dialogTool->GetP2Line2();
|
||||||
const QString pointName = dialogTool->getPointName();
|
const QString pointName = dialogTool->getPointName();
|
||||||
VToolLineIntersect* point = nullptr;
|
VToolLineIntersect* point = nullptr;
|
||||||
point = Create(0, p1Line1Id, p2Line1Id, p1Line2Id, p2Line2Id, pointName, 5, 10, scene, doc, data,
|
point = Create(0, p1Line1Id, p2Line1Id, p1Line2Id, p2Line2Id, pointName, 5, 10, scene, doc, data,
|
||||||
|
@ -267,10 +267,10 @@ void VToolLineIntersect::SaveDialog(QDomElement &domElement)
|
||||||
DialogLineIntersect *dialogTool = qobject_cast<DialogLineIntersect*>(dialog);
|
DialogLineIntersect *dialogTool = qobject_cast<DialogLineIntersect*>(dialog);
|
||||||
SCASSERT(dialogTool != nullptr);
|
SCASSERT(dialogTool != nullptr);
|
||||||
doc->SetAttribute(domElement, AttrName, dialogTool->getPointName());
|
doc->SetAttribute(domElement, AttrName, dialogTool->getPointName());
|
||||||
doc->SetAttribute(domElement, AttrP1Line1, QString().setNum(dialogTool->getP1Line1()));
|
doc->SetAttribute(domElement, AttrP1Line1, QString().setNum(dialogTool->GetP1Line1()));
|
||||||
doc->SetAttribute(domElement, AttrP2Line1, QString().setNum(dialogTool->getP2Line1()));
|
doc->SetAttribute(domElement, AttrP2Line1, QString().setNum(dialogTool->GetP2Line1()));
|
||||||
doc->SetAttribute(domElement, AttrP1Line2, QString().setNum(dialogTool->getP1Line2()));
|
doc->SetAttribute(domElement, AttrP1Line2, QString().setNum(dialogTool->GetP1Line2()));
|
||||||
doc->SetAttribute(domElement, AttrP2Line2, QString().setNum(dialogTool->getP2Line2()));
|
doc->SetAttribute(domElement, AttrP2Line2, QString().setNum(dialogTool->GetP2Line2()));
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
@ -292,13 +292,13 @@ void VToolLineIntersect::SaveOptions(QDomElement &tag, QSharedPointer<VGObject>
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
quint32 VToolLineIntersect::getP2Line2() const
|
quint32 VToolLineIntersect::GetP2Line2() const
|
||||||
{
|
{
|
||||||
return p2Line2;
|
return p2Line2;
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VToolLineIntersect::setP2Line2(const quint32 &value)
|
void VToolLineIntersect::SetP2Line2(const quint32 &value)
|
||||||
{
|
{
|
||||||
if (value != NULL_ID)
|
if (value != NULL_ID)
|
||||||
{
|
{
|
||||||
|
@ -345,13 +345,13 @@ void VToolLineIntersect::ShowVisualization(bool show)
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
quint32 VToolLineIntersect::getP1Line2() const
|
quint32 VToolLineIntersect::GetP1Line2() const
|
||||||
{
|
{
|
||||||
return p1Line2;
|
return p1Line2;
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VToolLineIntersect::setP1Line2(const quint32 &value)
|
void VToolLineIntersect::SetP1Line2(const quint32 &value)
|
||||||
{
|
{
|
||||||
if (value != NULL_ID)
|
if (value != NULL_ID)
|
||||||
{
|
{
|
||||||
|
@ -363,13 +363,13 @@ void VToolLineIntersect::setP1Line2(const quint32 &value)
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
quint32 VToolLineIntersect::getP2Line1() const
|
quint32 VToolLineIntersect::GetP2Line1() const
|
||||||
{
|
{
|
||||||
return p2Line1;
|
return p2Line1;
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VToolLineIntersect::setP2Line1(const quint32 &value)
|
void VToolLineIntersect::SetP2Line1(const quint32 &value)
|
||||||
{
|
{
|
||||||
if (value != NULL_ID)
|
if (value != NULL_ID)
|
||||||
{
|
{
|
||||||
|
@ -381,13 +381,13 @@ void VToolLineIntersect::setP2Line1(const quint32 &value)
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
quint32 VToolLineIntersect::getP1Line1() const
|
quint32 VToolLineIntersect::GetP1Line1() const
|
||||||
{
|
{
|
||||||
return p1Line1;
|
return p1Line1;
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VToolLineIntersect::setP1Line1(const quint32 &value)
|
void VToolLineIntersect::SetP1Line1(const quint32 &value)
|
||||||
{
|
{
|
||||||
if (value != NULL_ID)
|
if (value != NULL_ID)
|
||||||
{
|
{
|
||||||
|
|
|
@ -51,17 +51,17 @@ public:
|
||||||
virtual int type() const {return Type;}
|
virtual int type() const {return Type;}
|
||||||
enum { Type = UserType + static_cast<int>(Tool::LineIntersect)};
|
enum { Type = UserType + static_cast<int>(Tool::LineIntersect)};
|
||||||
|
|
||||||
quint32 getP1Line1() const;
|
quint32 GetP1Line1() const;
|
||||||
void setP1Line1(const quint32 &value);
|
void SetP1Line1(const quint32 &value);
|
||||||
|
|
||||||
quint32 getP2Line1() const;
|
quint32 GetP2Line1() const;
|
||||||
void setP2Line1(const quint32 &value);
|
void SetP2Line1(const quint32 &value);
|
||||||
|
|
||||||
quint32 getP1Line2() const;
|
quint32 GetP1Line2() const;
|
||||||
void setP1Line2(const quint32 &value);
|
void SetP1Line2(const quint32 &value);
|
||||||
|
|
||||||
quint32 getP2Line2() const;
|
quint32 GetP2Line2() const;
|
||||||
void setP2Line2(const quint32 &value);
|
void SetP2Line2(const quint32 &value);
|
||||||
|
|
||||||
virtual void ShowVisualization(bool show);
|
virtual void ShowVisualization(bool show);
|
||||||
public slots:
|
public slots:
|
||||||
|
|
|
@ -67,12 +67,12 @@ void VToolLineIntersectAxis::setDialog()
|
||||||
DialogLineIntersectAxis *dialogTool = qobject_cast<DialogLineIntersectAxis*>(dialog);
|
DialogLineIntersectAxis *dialogTool = qobject_cast<DialogLineIntersectAxis*>(dialog);
|
||||||
SCASSERT(dialogTool != nullptr);
|
SCASSERT(dialogTool != nullptr);
|
||||||
const QSharedPointer<VPointF> p = VAbstractTool::data.GeometricObject<VPointF>(id);
|
const QSharedPointer<VPointF> p = VAbstractTool::data.GeometricObject<VPointF>(id);
|
||||||
dialogTool->setTypeLine(typeLine);
|
dialogTool->SetTypeLine(typeLine);
|
||||||
dialogTool->setAngle(formulaAngle);
|
dialogTool->SetAngle(formulaAngle);
|
||||||
dialogTool->setBasePointId(basePointId);
|
dialogTool->SetBasePointId(basePointId);
|
||||||
dialogTool->setFirstPointId(firstPointId);
|
dialogTool->SetFirstPointId(firstPointId);
|
||||||
dialogTool->setSecondPointId(secondPointId);
|
dialogTool->SetSecondPointId(secondPointId);
|
||||||
dialogTool->setPointName(p->name());
|
dialogTool->SetPointName(p->name());
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
@ -83,11 +83,11 @@ VToolLineIntersectAxis *VToolLineIntersectAxis::Create(DialogTool *dialog, VMain
|
||||||
DialogLineIntersectAxis *dialogTool = qobject_cast<DialogLineIntersectAxis*>(dialog);
|
DialogLineIntersectAxis *dialogTool = qobject_cast<DialogLineIntersectAxis*>(dialog);
|
||||||
SCASSERT(dialogTool);
|
SCASSERT(dialogTool);
|
||||||
const QString pointName = dialogTool->getPointName();
|
const QString pointName = dialogTool->getPointName();
|
||||||
const QString typeLine = dialogTool->getTypeLine();
|
const QString typeLine = dialogTool->GetTypeLine();
|
||||||
QString formulaAngle = dialogTool->getAngle();
|
QString formulaAngle = dialogTool->GetAngle();
|
||||||
const quint32 basePointId = dialogTool->getBasePointId();
|
const quint32 basePointId = dialogTool->GetBasePointId();
|
||||||
const quint32 firstPointId = dialogTool->getFirstPointId();
|
const quint32 firstPointId = dialogTool->GetFirstPointId();
|
||||||
const quint32 secondPointId = dialogTool->getSecondPointId();
|
const quint32 secondPointId = dialogTool->GetSecondPointId();
|
||||||
|
|
||||||
VToolLineIntersectAxis *point = nullptr;
|
VToolLineIntersectAxis *point = nullptr;
|
||||||
point=Create(0, pointName, typeLine, formulaAngle, basePointId, firstPointId, secondPointId, 5, 10, scene, doc,
|
point=Create(0, pointName, typeLine, formulaAngle, basePointId, firstPointId, secondPointId, 5, 10, scene, doc,
|
||||||
|
@ -170,7 +170,7 @@ QPointF VToolLineIntersectAxis::FindPoint(const QLineF &axis, const QLineF &line
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
VFormula VToolLineIntersectAxis::getFormulaAngle() const
|
VFormula VToolLineIntersectAxis::GetFormulaAngle() const
|
||||||
{
|
{
|
||||||
VFormula fAngle(formulaAngle, getData());
|
VFormula fAngle(formulaAngle, getData());
|
||||||
fAngle.setCheckZero(false);
|
fAngle.setCheckZero(false);
|
||||||
|
@ -180,11 +180,11 @@ VFormula VToolLineIntersectAxis::getFormulaAngle() const
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VToolLineIntersectAxis::setFormulaAngle(const VFormula &value)
|
void VToolLineIntersectAxis::SetFormulaAngle(const VFormula &value)
|
||||||
{
|
{
|
||||||
if (value.error() == false)
|
if (value.error() == false)
|
||||||
{
|
{
|
||||||
formulaAngle = value.getFormula(FormulaType::FromUser);
|
formulaAngle = value.GetFormula(FormulaType::FromUser);
|
||||||
|
|
||||||
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(id);
|
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(id);
|
||||||
SaveOption(obj);
|
SaveOption(obj);
|
||||||
|
@ -192,13 +192,13 @@ void VToolLineIntersectAxis::setFormulaAngle(const VFormula &value)
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
quint32 VToolLineIntersectAxis::getFirstPointId() const
|
quint32 VToolLineIntersectAxis::GetFirstPointId() const
|
||||||
{
|
{
|
||||||
return firstPointId;
|
return firstPointId;
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VToolLineIntersectAxis::setFirstPointId(const quint32 &value)
|
void VToolLineIntersectAxis::SetFirstPointId(const quint32 &value)
|
||||||
{
|
{
|
||||||
if (value != NULL_ID)
|
if (value != NULL_ID)
|
||||||
{
|
{
|
||||||
|
@ -210,13 +210,13 @@ void VToolLineIntersectAxis::setFirstPointId(const quint32 &value)
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
quint32 VToolLineIntersectAxis::getSecondPointId() const
|
quint32 VToolLineIntersectAxis::GetSecondPointId() const
|
||||||
{
|
{
|
||||||
return secondPointId;
|
return secondPointId;
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VToolLineIntersectAxis::setSecondPointId(const quint32 &value)
|
void VToolLineIntersectAxis::SetSecondPointId(const quint32 &value)
|
||||||
{
|
{
|
||||||
if (value != NULL_ID)
|
if (value != NULL_ID)
|
||||||
{
|
{
|
||||||
|
@ -242,7 +242,7 @@ void VToolLineIntersectAxis::ShowVisualization(bool show)
|
||||||
visual->setPoint1Id(firstPointId);
|
visual->setPoint1Id(firstPointId);
|
||||||
visual->setPoint2Id(secondPointId);
|
visual->setPoint2Id(secondPointId);
|
||||||
visual->setAxisPointId(basePointId);
|
visual->setAxisPointId(basePointId);
|
||||||
visual->setAngle(qApp->FormulaToUser(formulaAngle));
|
visual->SetAngle(qApp->FormulaToUser(formulaAngle));
|
||||||
visual->setLineStyle(VAbstractTool::LineStyleToPenStyle(typeLine));
|
visual->setLineStyle(VAbstractTool::LineStyleToPenStyle(typeLine));
|
||||||
visual->RefreshGeometry();
|
visual->RefreshGeometry();
|
||||||
vis = visual;
|
vis = visual;
|
||||||
|
@ -283,7 +283,7 @@ void VToolLineIntersectAxis::FullUpdateFromFile()
|
||||||
visual->setPoint1Id(firstPointId);
|
visual->setPoint1Id(firstPointId);
|
||||||
visual->setPoint2Id(secondPointId);
|
visual->setPoint2Id(secondPointId);
|
||||||
visual->setAxisPointId(basePointId);
|
visual->setAxisPointId(basePointId);
|
||||||
visual->setAngle(qApp->FormulaToUser(formulaAngle));
|
visual->SetAngle(qApp->FormulaToUser(formulaAngle));
|
||||||
visual->setLineStyle(VAbstractTool::LineStyleToPenStyle(typeLine));
|
visual->setLineStyle(VAbstractTool::LineStyleToPenStyle(typeLine));
|
||||||
visual->RefreshGeometry();
|
visual->RefreshGeometry();
|
||||||
}
|
}
|
||||||
|
@ -308,11 +308,11 @@ void VToolLineIntersectAxis::SaveDialog(QDomElement &domElement)
|
||||||
DialogLineIntersectAxis *dialogTool = qobject_cast<DialogLineIntersectAxis*>(dialog);
|
DialogLineIntersectAxis *dialogTool = qobject_cast<DialogLineIntersectAxis*>(dialog);
|
||||||
SCASSERT(dialogTool != nullptr);
|
SCASSERT(dialogTool != nullptr);
|
||||||
doc->SetAttribute(domElement, AttrName, dialogTool->getPointName());
|
doc->SetAttribute(domElement, AttrName, dialogTool->getPointName());
|
||||||
doc->SetAttribute(domElement, AttrTypeLine, dialogTool->getTypeLine());
|
doc->SetAttribute(domElement, AttrTypeLine, dialogTool->GetTypeLine());
|
||||||
doc->SetAttribute(domElement, AttrAngle, dialogTool->getAngle());
|
doc->SetAttribute(domElement, AttrAngle, dialogTool->GetAngle());
|
||||||
doc->SetAttribute(domElement, AttrBasePoint, QString().setNum(dialogTool->getBasePointId()));
|
doc->SetAttribute(domElement, AttrBasePoint, QString().setNum(dialogTool->GetBasePointId()));
|
||||||
doc->SetAttribute(domElement, AttrP1Line, QString().setNum(dialogTool->getFirstPointId()));
|
doc->SetAttribute(domElement, AttrP1Line, QString().setNum(dialogTool->GetFirstPointId()));
|
||||||
doc->SetAttribute(domElement, AttrP2Line, QString().setNum(dialogTool->getSecondPointId()));
|
doc->SetAttribute(domElement, AttrP2Line, QString().setNum(dialogTool->GetSecondPointId()));
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
|
@ -55,14 +55,14 @@ public:
|
||||||
virtual int type() const {return Type;}
|
virtual int type() const {return Type;}
|
||||||
enum { Type = UserType + static_cast<int>(Tool::LineIntersectAxis)};
|
enum { Type = UserType + static_cast<int>(Tool::LineIntersectAxis)};
|
||||||
|
|
||||||
VFormula getFormulaAngle() const;
|
VFormula GetFormulaAngle() const;
|
||||||
void setFormulaAngle(const VFormula &value);
|
void SetFormulaAngle(const VFormula &value);
|
||||||
|
|
||||||
quint32 getFirstPointId() const;
|
quint32 GetFirstPointId() const;
|
||||||
void setFirstPointId(const quint32 &value);
|
void SetFirstPointId(const quint32 &value);
|
||||||
|
|
||||||
quint32 getSecondPointId() const;
|
quint32 GetSecondPointId() const;
|
||||||
void setSecondPointId(const quint32 &value);
|
void SetSecondPointId(const quint32 &value);
|
||||||
|
|
||||||
virtual void ShowVisualization(bool show);
|
virtual void ShowVisualization(bool show);
|
||||||
public slots:
|
public slots:
|
||||||
|
|
|
@ -108,13 +108,13 @@ void VToolLinePoint::SetFactor(qreal factor)
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
qreal VToolLinePoint::getAngle() const
|
qreal VToolLinePoint::GetAngle() const
|
||||||
{
|
{
|
||||||
return angle;
|
return angle;
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VToolLinePoint::setAngle(const qreal &value)
|
void VToolLinePoint::SetAngle(const qreal &value)
|
||||||
{
|
{
|
||||||
angle = value;
|
angle = value;
|
||||||
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(id);
|
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(id);
|
||||||
|
@ -122,13 +122,13 @@ void VToolLinePoint::setAngle(const qreal &value)
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
quint32 VToolLinePoint::getBasePointId() const
|
quint32 VToolLinePoint::GetBasePointId() const
|
||||||
{
|
{
|
||||||
return basePointId;
|
return basePointId;
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VToolLinePoint::setBasePointId(const quint32 &value)
|
void VToolLinePoint::SetBasePointId(const quint32 &value)
|
||||||
{
|
{
|
||||||
if (value != NULL_ID)
|
if (value != NULL_ID)
|
||||||
{
|
{
|
||||||
|
@ -140,7 +140,7 @@ void VToolLinePoint::setBasePointId(const quint32 &value)
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
VFormula VToolLinePoint::getFormulaLength() const
|
VFormula VToolLinePoint::GetFormulaLength() const
|
||||||
{
|
{
|
||||||
VFormula fLength(formulaLength, this->getData());
|
VFormula fLength(formulaLength, this->getData());
|
||||||
fLength.setCheckZero(true);
|
fLength.setCheckZero(true);
|
||||||
|
@ -151,11 +151,11 @@ VFormula VToolLinePoint::getFormulaLength() const
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VToolLinePoint::setFormulaLength(const VFormula &value)
|
void VToolLinePoint::SetFormulaLength(const VFormula &value)
|
||||||
{
|
{
|
||||||
if (value.error() == false)
|
if (value.error() == false)
|
||||||
{
|
{
|
||||||
formulaLength = value.getFormula(FormulaType::FromUser);
|
formulaLength = value.GetFormula(FormulaType::FromUser);
|
||||||
|
|
||||||
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(id);
|
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(id);
|
||||||
SaveOption(obj);
|
SaveOption(obj);
|
||||||
|
|
|
@ -44,14 +44,14 @@ public:
|
||||||
virtual ~VToolLinePoint();
|
virtual ~VToolLinePoint();
|
||||||
virtual int type() const {return Type;}
|
virtual int type() const {return Type;}
|
||||||
enum { Type = UserType + static_cast<int>(Tool::LinePoint)};
|
enum { Type = UserType + static_cast<int>(Tool::LinePoint)};
|
||||||
VFormula getFormulaLength() const;
|
VFormula GetFormulaLength() const;
|
||||||
void setFormulaLength(const VFormula &value);
|
void SetFormulaLength(const VFormula &value);
|
||||||
|
|
||||||
quint32 getBasePointId() const;
|
quint32 GetBasePointId() const;
|
||||||
void setBasePointId(const quint32 &value);
|
void SetBasePointId(const quint32 &value);
|
||||||
|
|
||||||
qreal getAngle() const;
|
qreal GetAngle() const;
|
||||||
void setAngle(const qreal &value);
|
void SetAngle(const qreal &value);
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
virtual void ChangedActivDraw(const QString &newName);
|
virtual void ChangedActivDraw(const QString &newName);
|
||||||
|
|
|
@ -75,12 +75,12 @@ void VToolNormal::setDialog()
|
||||||
DialogNormal *dialogTool = qobject_cast<DialogNormal*>(dialog);
|
DialogNormal *dialogTool = qobject_cast<DialogNormal*>(dialog);
|
||||||
SCASSERT(dialogTool != nullptr);
|
SCASSERT(dialogTool != nullptr);
|
||||||
const QSharedPointer<VPointF> p = VAbstractTool::data.GeometricObject<VPointF>(id);
|
const QSharedPointer<VPointF> p = VAbstractTool::data.GeometricObject<VPointF>(id);
|
||||||
dialogTool->setTypeLine(typeLine);
|
dialogTool->SetTypeLine(typeLine);
|
||||||
dialogTool->setFormula(formulaLength);
|
dialogTool->SetFormula(formulaLength);
|
||||||
dialogTool->setAngle(angle);
|
dialogTool->SetAngle(angle);
|
||||||
dialogTool->setFirstPointId(basePointId);
|
dialogTool->SetFirstPointId(basePointId);
|
||||||
dialogTool->setSecondPointId(secondPointId);
|
dialogTool->SetSecondPointId(secondPointId);
|
||||||
dialogTool->setPointName(p->name());
|
dialogTool->SetPointName(p->name());
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
@ -96,12 +96,12 @@ VToolNormal* VToolNormal::Create(DialogTool *dialog, VMainGraphicsScene *scene,
|
||||||
SCASSERT(dialog != nullptr);
|
SCASSERT(dialog != nullptr);
|
||||||
DialogNormal *dialogTool = qobject_cast<DialogNormal*>(dialog);
|
DialogNormal *dialogTool = qobject_cast<DialogNormal*>(dialog);
|
||||||
SCASSERT(dialogTool != nullptr);
|
SCASSERT(dialogTool != nullptr);
|
||||||
QString formula = dialogTool->getFormula();
|
QString formula = dialogTool->GetFormula();
|
||||||
const quint32 firstPointId = dialogTool->getFirstPointId();
|
const quint32 firstPointId = dialogTool->GetFirstPointId();
|
||||||
const quint32 secondPointId = dialogTool->getSecondPointId();
|
const quint32 secondPointId = dialogTool->GetSecondPointId();
|
||||||
const QString typeLine = dialogTool->getTypeLine();
|
const QString typeLine = dialogTool->GetTypeLine();
|
||||||
const QString pointName = dialogTool->getPointName();
|
const QString pointName = dialogTool->getPointName();
|
||||||
const qreal angle = dialogTool->getAngle();
|
const qreal angle = dialogTool->GetAngle();
|
||||||
VToolNormal *point = nullptr;
|
VToolNormal *point = nullptr;
|
||||||
point=Create(0, formula, firstPointId, secondPointId, typeLine, pointName, angle, 5, 10, scene, doc, data,
|
point=Create(0, formula, firstPointId, secondPointId, typeLine, pointName, angle, 5, 10, scene, doc, data,
|
||||||
Document::FullParse, Source::FromGui);
|
Document::FullParse, Source::FromGui);
|
||||||
|
@ -217,7 +217,7 @@ void VToolNormal::FullUpdateFromFile()
|
||||||
visual->setPoint1Id(basePointId);
|
visual->setPoint1Id(basePointId);
|
||||||
visual->setPoint2Id(secondPointId);
|
visual->setPoint2Id(secondPointId);
|
||||||
visual->setLength(qApp->FormulaToUser(formulaLength));
|
visual->setLength(qApp->FormulaToUser(formulaLength));
|
||||||
visual->setAngle(angle);
|
visual->SetAngle(angle);
|
||||||
visual->setLineStyle(VAbstractTool::LineStyleToPenStyle(typeLine));
|
visual->setLineStyle(VAbstractTool::LineStyleToPenStyle(typeLine));
|
||||||
visual->RefreshGeometry();
|
visual->RefreshGeometry();
|
||||||
}
|
}
|
||||||
|
@ -274,11 +274,11 @@ void VToolNormal::SaveDialog(QDomElement &domElement)
|
||||||
DialogNormal *dialogTool = qobject_cast<DialogNormal*>(dialog);
|
DialogNormal *dialogTool = qobject_cast<DialogNormal*>(dialog);
|
||||||
SCASSERT(dialogTool != nullptr);
|
SCASSERT(dialogTool != nullptr);
|
||||||
doc->SetAttribute(domElement, AttrName, dialogTool->getPointName());
|
doc->SetAttribute(domElement, AttrName, dialogTool->getPointName());
|
||||||
doc->SetAttribute(domElement, AttrTypeLine, dialogTool->getTypeLine());
|
doc->SetAttribute(domElement, AttrTypeLine, dialogTool->GetTypeLine());
|
||||||
doc->SetAttribute(domElement, AttrLength, dialogTool->getFormula());
|
doc->SetAttribute(domElement, AttrLength, dialogTool->GetFormula());
|
||||||
doc->SetAttribute(domElement, AttrAngle, QString().setNum(dialogTool->getAngle()));
|
doc->SetAttribute(domElement, AttrAngle, QString().setNum(dialogTool->GetAngle()));
|
||||||
doc->SetAttribute(domElement, AttrFirstPoint, QString().setNum(dialogTool->getFirstPointId()));
|
doc->SetAttribute(domElement, AttrFirstPoint, QString().setNum(dialogTool->GetFirstPointId()));
|
||||||
doc->SetAttribute(domElement, AttrSecondPoint, QString().setNum(dialogTool->getSecondPointId()));
|
doc->SetAttribute(domElement, AttrSecondPoint, QString().setNum(dialogTool->GetSecondPointId()));
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
@ -301,13 +301,13 @@ void VToolNormal::SaveOptions(QDomElement &tag, QSharedPointer<VGObject> &obj)
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
quint32 VToolNormal::getSecondPointId() const
|
quint32 VToolNormal::GetSecondPointId() const
|
||||||
{
|
{
|
||||||
return secondPointId;
|
return secondPointId;
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VToolNormal::setSecondPointId(const quint32 &value)
|
void VToolNormal::SetSecondPointId(const quint32 &value)
|
||||||
{
|
{
|
||||||
if (value != NULL_ID)
|
if (value != NULL_ID)
|
||||||
{
|
{
|
||||||
|
@ -333,7 +333,7 @@ void VToolNormal::ShowVisualization(bool show)
|
||||||
visual->setPoint1Id(basePointId);
|
visual->setPoint1Id(basePointId);
|
||||||
visual->setPoint2Id(secondPointId);
|
visual->setPoint2Id(secondPointId);
|
||||||
visual->setLength(qApp->FormulaToUser(formulaLength));
|
visual->setLength(qApp->FormulaToUser(formulaLength));
|
||||||
visual->setAngle(angle);
|
visual->SetAngle(angle);
|
||||||
visual->setLineStyle(VAbstractTool::LineStyleToPenStyle(typeLine));
|
visual->setLineStyle(VAbstractTool::LineStyleToPenStyle(typeLine));
|
||||||
visual->RefreshGeometry();
|
visual->RefreshGeometry();
|
||||||
vis = visual;
|
vis = visual;
|
||||||
|
|
|
@ -53,8 +53,8 @@ public:
|
||||||
virtual int type() const {return Type;}
|
virtual int type() const {return Type;}
|
||||||
enum { Type = UserType + static_cast<int>(Tool::Normal)};
|
enum { Type = UserType + static_cast<int>(Tool::Normal)};
|
||||||
|
|
||||||
quint32 getSecondPointId() const;
|
quint32 GetSecondPointId() const;
|
||||||
void setSecondPointId(const quint32 &value);
|
void SetSecondPointId(const quint32 &value);
|
||||||
|
|
||||||
virtual void ShowVisualization(bool show);
|
virtual void ShowVisualization(bool show);
|
||||||
public slots:
|
public slots:
|
||||||
|
|
|
@ -78,9 +78,9 @@ void VToolPointOfContact::setDialog()
|
||||||
const QSharedPointer<VPointF> p = VAbstractTool::data.GeometricObject<VPointF>(id);
|
const QSharedPointer<VPointF> p = VAbstractTool::data.GeometricObject<VPointF>(id);
|
||||||
dialogTool->setRadius(arcRadius);
|
dialogTool->setRadius(arcRadius);
|
||||||
dialogTool->setCenter(center);
|
dialogTool->setCenter(center);
|
||||||
dialogTool->setFirstPoint(firstPointId);
|
dialogTool->SetFirstPoint(firstPointId);
|
||||||
dialogTool->setSecondPoint(secondPointId);
|
dialogTool->SetSecondPoint(secondPointId);
|
||||||
dialogTool->setPointName(p->name());
|
dialogTool->SetPointName(p->name());
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
@ -138,8 +138,8 @@ VToolPointOfContact* VToolPointOfContact::Create(DialogTool *dialog, VMainGraphi
|
||||||
SCASSERT(dialogTool != nullptr);
|
SCASSERT(dialogTool != nullptr);
|
||||||
QString radius = dialogTool->getRadius();
|
QString radius = dialogTool->getRadius();
|
||||||
const quint32 center = dialogTool->getCenter();
|
const quint32 center = dialogTool->getCenter();
|
||||||
const quint32 firstPointId = dialogTool->getFirstPoint();
|
const quint32 firstPointId = dialogTool->GetFirstPoint();
|
||||||
const quint32 secondPointId = dialogTool->getSecondPoint();
|
const quint32 secondPointId = dialogTool->GetSecondPoint();
|
||||||
const QString pointName = dialogTool->getPointName();
|
const QString pointName = dialogTool->getPointName();
|
||||||
VToolPointOfContact *point = nullptr;
|
VToolPointOfContact *point = nullptr;
|
||||||
point=Create(0, radius, center, firstPointId, secondPointId, pointName, 5, 10, scene, doc, data,
|
point=Create(0, radius, center, firstPointId, secondPointId, pointName, 5, 10, scene, doc, data,
|
||||||
|
@ -300,8 +300,8 @@ void VToolPointOfContact::SaveDialog(QDomElement &domElement)
|
||||||
doc->SetAttribute(domElement, AttrName, dialogTool->getPointName());
|
doc->SetAttribute(domElement, AttrName, dialogTool->getPointName());
|
||||||
doc->SetAttribute(domElement, AttrRadius, dialogTool->getRadius());
|
doc->SetAttribute(domElement, AttrRadius, dialogTool->getRadius());
|
||||||
doc->SetAttribute(domElement, AttrCenter, QString().setNum(dialogTool->getCenter()));
|
doc->SetAttribute(domElement, AttrCenter, QString().setNum(dialogTool->getCenter()));
|
||||||
doc->SetAttribute(domElement, AttrFirstPoint, QString().setNum(dialogTool->getFirstPoint()));
|
doc->SetAttribute(domElement, AttrFirstPoint, QString().setNum(dialogTool->GetFirstPoint()));
|
||||||
doc->SetAttribute(domElement, AttrSecondPoint, QString().setNum(dialogTool->getSecondPoint()));
|
doc->SetAttribute(domElement, AttrSecondPoint, QString().setNum(dialogTool->GetSecondPoint()));
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
@ -323,13 +323,13 @@ void VToolPointOfContact::SaveOptions(QDomElement &tag, QSharedPointer<VGObject>
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
quint32 VToolPointOfContact::getSecondPointId() const
|
quint32 VToolPointOfContact::GetSecondPointId() const
|
||||||
{
|
{
|
||||||
return secondPointId;
|
return secondPointId;
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VToolPointOfContact::setSecondPointId(const quint32 &value)
|
void VToolPointOfContact::SetSecondPointId(const quint32 &value)
|
||||||
{
|
{
|
||||||
secondPointId = value;
|
secondPointId = value;
|
||||||
}
|
}
|
||||||
|
@ -370,13 +370,13 @@ void VToolPointOfContact::ShowVisualization(bool show)
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
quint32 VToolPointOfContact::getFirstPointId() const
|
quint32 VToolPointOfContact::GetFirstPointId() const
|
||||||
{
|
{
|
||||||
return firstPointId;
|
return firstPointId;
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VToolPointOfContact::setFirstPointId(const quint32 &value)
|
void VToolPointOfContact::SetFirstPointId(const quint32 &value)
|
||||||
{
|
{
|
||||||
firstPointId = value;
|
firstPointId = value;
|
||||||
}
|
}
|
||||||
|
@ -415,7 +415,7 @@ void VToolPointOfContact::setArcRadius(const VFormula &value)
|
||||||
{
|
{
|
||||||
if (value.error() == false)
|
if (value.error() == false)
|
||||||
{
|
{
|
||||||
arcRadius = value.getFormula(FormulaType::FromUser);
|
arcRadius = value.GetFormula(FormulaType::FromUser);
|
||||||
|
|
||||||
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(id);
|
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(id);
|
||||||
SaveOption(obj);
|
SaveOption(obj);
|
||||||
|
|
|
@ -62,11 +62,11 @@ public:
|
||||||
quint32 getCenter() const;
|
quint32 getCenter() const;
|
||||||
void setCenter(const quint32 &value);
|
void setCenter(const quint32 &value);
|
||||||
|
|
||||||
quint32 getFirstPointId() const;
|
quint32 GetFirstPointId() const;
|
||||||
void setFirstPointId(const quint32 &value);
|
void SetFirstPointId(const quint32 &value);
|
||||||
|
|
||||||
quint32 getSecondPointId() const;
|
quint32 GetSecondPointId() const;
|
||||||
void setSecondPointId(const quint32 &value);
|
void SetSecondPointId(const quint32 &value);
|
||||||
|
|
||||||
virtual void ShowVisualization(bool show);
|
virtual void ShowVisualization(bool show);
|
||||||
public slots:
|
public slots:
|
||||||
|
|
|
@ -70,9 +70,9 @@ void VToolPointOfIntersection::setDialog()
|
||||||
DialogPointOfIntersection *dialogTool = qobject_cast<DialogPointOfIntersection*>(dialog);
|
DialogPointOfIntersection *dialogTool = qobject_cast<DialogPointOfIntersection*>(dialog);
|
||||||
SCASSERT(dialogTool != nullptr);
|
SCASSERT(dialogTool != nullptr);
|
||||||
const QSharedPointer<VPointF> p = VAbstractTool::data.GeometricObject<VPointF>(id);
|
const QSharedPointer<VPointF> p = VAbstractTool::data.GeometricObject<VPointF>(id);
|
||||||
dialogTool->setFirstPointId(firstPointId);
|
dialogTool->SetFirstPointId(firstPointId);
|
||||||
dialogTool->setSecondPointId(secondPointId);
|
dialogTool->SetSecondPointId(secondPointId);
|
||||||
dialogTool->setPointName(p->name());
|
dialogTool->SetPointName(p->name());
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
@ -90,8 +90,8 @@ VToolPointOfIntersection *VToolPointOfIntersection::Create(DialogTool *dialog, V
|
||||||
SCASSERT(dialog != nullptr);
|
SCASSERT(dialog != nullptr);
|
||||||
DialogPointOfIntersection *dialogTool = qobject_cast<DialogPointOfIntersection*>(dialog);
|
DialogPointOfIntersection *dialogTool = qobject_cast<DialogPointOfIntersection*>(dialog);
|
||||||
SCASSERT(dialogTool != nullptr);
|
SCASSERT(dialogTool != nullptr);
|
||||||
const quint32 firstPointId = dialogTool->getFirstPointId();
|
const quint32 firstPointId = dialogTool->GetFirstPointId();
|
||||||
const quint32 secondPointId = dialogTool->getSecondPointId();
|
const quint32 secondPointId = dialogTool->GetSecondPointId();
|
||||||
const QString pointName = dialogTool->getPointName();
|
const QString pointName = dialogTool->getPointName();
|
||||||
VToolPointOfIntersection *point = nullptr;
|
VToolPointOfIntersection *point = nullptr;
|
||||||
point = Create(0, pointName, firstPointId, secondPointId, 5, 10, scene, doc, data, Document::FullParse,
|
point = Create(0, pointName, firstPointId, secondPointId, 5, 10, scene, doc, data, Document::FullParse,
|
||||||
|
@ -222,8 +222,8 @@ void VToolPointOfIntersection::SaveDialog(QDomElement &domElement)
|
||||||
DialogPointOfIntersection *dialogTool = qobject_cast<DialogPointOfIntersection*>(dialog);
|
DialogPointOfIntersection *dialogTool = qobject_cast<DialogPointOfIntersection*>(dialog);
|
||||||
SCASSERT(dialogTool != nullptr);
|
SCASSERT(dialogTool != nullptr);
|
||||||
doc->SetAttribute(domElement, AttrName, dialogTool->getPointName());
|
doc->SetAttribute(domElement, AttrName, dialogTool->getPointName());
|
||||||
doc->SetAttribute(domElement, AttrFirstPoint, QString().setNum(dialogTool->getFirstPointId()));
|
doc->SetAttribute(domElement, AttrFirstPoint, QString().setNum(dialogTool->GetFirstPointId()));
|
||||||
doc->SetAttribute(domElement, AttrSecondPoint, QString().setNum(dialogTool->getSecondPointId()));
|
doc->SetAttribute(domElement, AttrSecondPoint, QString().setNum(dialogTool->GetSecondPointId()));
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
@ -243,13 +243,13 @@ void VToolPointOfIntersection::SaveOptions(QDomElement &tag, QSharedPointer<VGOb
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
quint32 VToolPointOfIntersection::getSecondPointId() const
|
quint32 VToolPointOfIntersection::GetSecondPointId() const
|
||||||
{
|
{
|
||||||
return secondPointId;
|
return secondPointId;
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VToolPointOfIntersection::setSecondPointId(const quint32 &value)
|
void VToolPointOfIntersection::SetSecondPointId(const quint32 &value)
|
||||||
{
|
{
|
||||||
if (value != NULL_ID)
|
if (value != NULL_ID)
|
||||||
{
|
{
|
||||||
|
@ -294,13 +294,13 @@ void VToolPointOfIntersection::ShowVisualization(bool show)
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
quint32 VToolPointOfIntersection::getFirstPointId() const
|
quint32 VToolPointOfIntersection::GetFirstPointId() const
|
||||||
{
|
{
|
||||||
return firstPointId;
|
return firstPointId;
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VToolPointOfIntersection::setFirstPointId(const quint32 &value)
|
void VToolPointOfIntersection::SetFirstPointId(const quint32 &value)
|
||||||
{
|
{
|
||||||
if (value != NULL_ID)
|
if (value != NULL_ID)
|
||||||
{
|
{
|
||||||
|
|
|
@ -52,11 +52,11 @@ public:
|
||||||
virtual int type() const {return Type;}
|
virtual int type() const {return Type;}
|
||||||
enum { Type = UserType + static_cast<int>(Tool::PointOfIntersection) };
|
enum { Type = UserType + static_cast<int>(Tool::PointOfIntersection) };
|
||||||
|
|
||||||
quint32 getFirstPointId() const;
|
quint32 GetFirstPointId() const;
|
||||||
void setFirstPointId(const quint32 &value);
|
void SetFirstPointId(const quint32 &value);
|
||||||
|
|
||||||
quint32 getSecondPointId() const;
|
quint32 GetSecondPointId() const;
|
||||||
void setSecondPointId(const quint32 &value);
|
void SetSecondPointId(const quint32 &value);
|
||||||
|
|
||||||
virtual void ShowVisualization(bool show);
|
virtual void ShowVisualization(bool show);
|
||||||
public slots:
|
public slots:
|
||||||
|
|
|
@ -74,12 +74,12 @@ void VToolShoulderPoint::setDialog()
|
||||||
DialogShoulderPoint *dialogTool = qobject_cast<DialogShoulderPoint*>(dialog);
|
DialogShoulderPoint *dialogTool = qobject_cast<DialogShoulderPoint*>(dialog);
|
||||||
SCASSERT(dialogTool != nullptr);
|
SCASSERT(dialogTool != nullptr);
|
||||||
const QSharedPointer<VPointF> p = VAbstractTool::data.GeometricObject<VPointF>(id);
|
const QSharedPointer<VPointF> p = VAbstractTool::data.GeometricObject<VPointF>(id);
|
||||||
dialogTool->setTypeLine(typeLine);
|
dialogTool->SetTypeLine(typeLine);
|
||||||
dialogTool->setFormula(formulaLength);
|
dialogTool->SetFormula(formulaLength);
|
||||||
dialogTool->setP1Line(basePointId);
|
dialogTool->SetP1Line(basePointId);
|
||||||
dialogTool->setP2Line(p2Line);
|
dialogTool->SetP2Line(p2Line);
|
||||||
dialogTool->setP3(pShoulder);
|
dialogTool->SetP3(pShoulder);
|
||||||
dialogTool->setPointName(p->name());
|
dialogTool->SetPointName(p->name());
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
@ -134,11 +134,11 @@ VToolShoulderPoint* VToolShoulderPoint::Create(DialogTool *dialog, VMainGraphics
|
||||||
SCASSERT(dialog != nullptr);
|
SCASSERT(dialog != nullptr);
|
||||||
DialogShoulderPoint *dialogTool = qobject_cast<DialogShoulderPoint*>(dialog);
|
DialogShoulderPoint *dialogTool = qobject_cast<DialogShoulderPoint*>(dialog);
|
||||||
SCASSERT(dialogTool);
|
SCASSERT(dialogTool);
|
||||||
QString formula = dialogTool->getFormula();
|
QString formula = dialogTool->GetFormula();
|
||||||
const quint32 p1Line = dialogTool->getP1Line();
|
const quint32 p1Line = dialogTool->GetP1Line();
|
||||||
const quint32 p2Line = dialogTool->getP2Line();
|
const quint32 p2Line = dialogTool->GetP2Line();
|
||||||
const quint32 pShoulder = dialogTool->getP3();
|
const quint32 pShoulder = dialogTool->GetP3();
|
||||||
const QString typeLine = dialogTool->getTypeLine();
|
const QString typeLine = dialogTool->GetTypeLine();
|
||||||
const QString pointName = dialogTool->getPointName();
|
const QString pointName = dialogTool->getPointName();
|
||||||
VToolShoulderPoint * point = nullptr;
|
VToolShoulderPoint * point = nullptr;
|
||||||
point=Create(0, formula, p1Line, p2Line, pShoulder, typeLine, pointName, 5, 10, scene, doc, data,
|
point=Create(0, formula, p1Line, p2Line, pShoulder, typeLine, pointName, 5, 10, scene, doc, data,
|
||||||
|
@ -300,11 +300,11 @@ void VToolShoulderPoint::SaveDialog(QDomElement &domElement)
|
||||||
DialogShoulderPoint *dialogTool = qobject_cast<DialogShoulderPoint*>(dialog);
|
DialogShoulderPoint *dialogTool = qobject_cast<DialogShoulderPoint*>(dialog);
|
||||||
SCASSERT(dialogTool != nullptr);
|
SCASSERT(dialogTool != nullptr);
|
||||||
doc->SetAttribute(domElement, AttrName, dialogTool->getPointName());
|
doc->SetAttribute(domElement, AttrName, dialogTool->getPointName());
|
||||||
doc->SetAttribute(domElement, AttrTypeLine, dialogTool->getTypeLine());
|
doc->SetAttribute(domElement, AttrTypeLine, dialogTool->GetTypeLine());
|
||||||
doc->SetAttribute(domElement, AttrLength, dialogTool->getFormula());
|
doc->SetAttribute(domElement, AttrLength, dialogTool->GetFormula());
|
||||||
doc->SetAttribute(domElement, AttrP1Line, QString().setNum(dialogTool->getP1Line()));
|
doc->SetAttribute(domElement, AttrP1Line, QString().setNum(dialogTool->GetP1Line()));
|
||||||
doc->SetAttribute(domElement, AttrP2Line, QString().setNum(dialogTool->getP2Line()));
|
doc->SetAttribute(domElement, AttrP2Line, QString().setNum(dialogTool->GetP2Line()));
|
||||||
doc->SetAttribute(domElement, AttrPShoulder, QString().setNum(dialogTool->getP3()));
|
doc->SetAttribute(domElement, AttrPShoulder, QString().setNum(dialogTool->GetP3()));
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
@ -381,13 +381,13 @@ void VToolShoulderPoint::ShowVisualization(bool show)
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
quint32 VToolShoulderPoint::getP2Line() const
|
quint32 VToolShoulderPoint::GetP2Line() const
|
||||||
{
|
{
|
||||||
return p2Line;
|
return p2Line;
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VToolShoulderPoint::setP2Line(const quint32 &value)
|
void VToolShoulderPoint::SetP2Line(const quint32 &value)
|
||||||
{
|
{
|
||||||
if (value != NULL_ID)
|
if (value != NULL_ID)
|
||||||
{
|
{
|
||||||
|
|
|
@ -54,8 +54,8 @@ public:
|
||||||
virtual int type() const {return Type;}
|
virtual int type() const {return Type;}
|
||||||
enum { Type = UserType + static_cast<int>(Tool::ShoulderPoint) };
|
enum { Type = UserType + static_cast<int>(Tool::ShoulderPoint) };
|
||||||
|
|
||||||
quint32 getP2Line() const;
|
quint32 GetP2Line() const;
|
||||||
void setP2Line(const quint32 &value);
|
void SetP2Line(const quint32 &value);
|
||||||
|
|
||||||
quint32 getPShoulder() const;
|
quint32 getPShoulder() const;
|
||||||
void setPShoulder(const quint32 &value);
|
void setPShoulder(const quint32 &value);
|
||||||
|
|
|
@ -58,7 +58,7 @@ VToolSinglePoint::VToolSinglePoint (VPattern *doc, VContainer *data, quint32 id,
|
||||||
this->setFlag(QGraphicsItem::ItemIsMovable, true);
|
this->setFlag(QGraphicsItem::ItemIsMovable, true);
|
||||||
this->setFlag(QGraphicsItem::ItemSendsGeometryChanges, true);
|
this->setFlag(QGraphicsItem::ItemSendsGeometryChanges, true);
|
||||||
this->setFlag(QGraphicsItem::ItemIsFocusable, false);
|
this->setFlag(QGraphicsItem::ItemIsFocusable, false);
|
||||||
setColorLabel(Qt::black);
|
SetColorLabel(Qt::black);
|
||||||
if (typeCreation == Source::FromGui)
|
if (typeCreation == Source::FromGui)
|
||||||
{
|
{
|
||||||
AddToFile();
|
AddToFile();
|
||||||
|
@ -79,7 +79,7 @@ void VToolSinglePoint::setDialog()
|
||||||
DialogSinglePoint *dialogTool = qobject_cast<DialogSinglePoint*>(dialog);
|
DialogSinglePoint *dialogTool = qobject_cast<DialogSinglePoint*>(dialog);
|
||||||
SCASSERT(dialogTool != nullptr);
|
SCASSERT(dialogTool != nullptr);
|
||||||
const QSharedPointer<VPointF> p = VAbstractTool::data.GeometricObject<VPointF>(id);
|
const QSharedPointer<VPointF> p = VAbstractTool::data.GeometricObject<VPointF>(id);
|
||||||
dialogTool->setData(p->name(), p->toQPointF());
|
dialogTool->SetData(p->name(), p->toQPointF());
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
@ -194,7 +194,7 @@ void VToolSinglePoint::SaveDialog(QDomElement &domElement)
|
||||||
SCASSERT(dialog != nullptr);
|
SCASSERT(dialog != nullptr);
|
||||||
DialogSinglePoint *dialogTool = qobject_cast<DialogSinglePoint*>(dialog);
|
DialogSinglePoint *dialogTool = qobject_cast<DialogSinglePoint*>(dialog);
|
||||||
SCASSERT(dialogTool != nullptr);
|
SCASSERT(dialogTool != nullptr);
|
||||||
QPointF p = dialogTool->getPoint();
|
QPointF p = dialogTool->GetPoint();
|
||||||
QString name = dialogTool->getPointName();
|
QString name = dialogTool->getPointName();
|
||||||
doc->SetAttribute(domElement, AttrName, name);
|
doc->SetAttribute(domElement, AttrName, name);
|
||||||
doc->SetAttribute(domElement, AttrX, QString().setNum(qApp->fromPixel(p.x())));
|
doc->SetAttribute(domElement, AttrX, QString().setNum(qApp->fromPixel(p.x())));
|
||||||
|
@ -241,10 +241,10 @@ void VToolSinglePoint::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief setColorLabel change color for label and label line.
|
* @brief SetColorLabel change color for label and label line.
|
||||||
* @param color new color.
|
* @param color new color.
|
||||||
*/
|
*/
|
||||||
void VToolSinglePoint::setColorLabel(const Qt::GlobalColor &color)
|
void VToolSinglePoint::SetColorLabel(const Qt::GlobalColor &color)
|
||||||
{
|
{
|
||||||
namePoint->setBrush(color);
|
namePoint->setBrush(color);
|
||||||
lineName->setPen(QPen(color, qApp->toPixel(qApp->widthHairLine())/factor));
|
lineName->setPen(QPen(color, qApp->toPixel(qApp->widthHairLine())/factor));
|
||||||
|
@ -310,12 +310,12 @@ void VToolSinglePoint::ChangedActivDraw(const QString &newName)
|
||||||
if (nameActivDraw == newName)
|
if (nameActivDraw == newName)
|
||||||
{
|
{
|
||||||
this->setEnabled(true);
|
this->setEnabled(true);
|
||||||
setColorLabel(Qt::black);
|
SetColorLabel(Qt::black);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
this->setEnabled(false);
|
this->setEnabled(false);
|
||||||
setColorLabel(Qt::gray);
|
SetColorLabel(Qt::gray);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -71,7 +71,7 @@ protected:
|
||||||
private:
|
private:
|
||||||
QString namePP;
|
QString namePP;
|
||||||
QString mPath;
|
QString mPath;
|
||||||
void setColorLabel(const Qt::GlobalColor & color);
|
void SetColorLabel(const Qt::GlobalColor & color);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -98,13 +98,13 @@ void VToolSpline::setDialog()
|
||||||
DialogSpline *dialogTool = qobject_cast<DialogSpline*>(dialog);
|
DialogSpline *dialogTool = qobject_cast<DialogSpline*>(dialog);
|
||||||
SCASSERT(dialogTool != nullptr);
|
SCASSERT(dialogTool != nullptr);
|
||||||
const QSharedPointer<VSpline> spl = VAbstractTool::data.GeometricObject<VSpline>(id);
|
const QSharedPointer<VSpline> spl = VAbstractTool::data.GeometricObject<VSpline>(id);
|
||||||
dialogTool->setP1(spl->GetP1().id());
|
dialogTool->SetP1(spl->GetP1().id());
|
||||||
dialogTool->setP4(spl->GetP4().id());
|
dialogTool->SetP4(spl->GetP4().id());
|
||||||
dialogTool->setAngle1(spl->GetAngle1());
|
dialogTool->SetAngle1(spl->GetAngle1());
|
||||||
dialogTool->setAngle2(spl->GetAngle2());
|
dialogTool->SetAngle2(spl->GetAngle2());
|
||||||
dialogTool->setKAsm1(spl->GetKasm1());
|
dialogTool->SetKAsm1(spl->GetKasm1());
|
||||||
dialogTool->setKAsm2(spl->GetKasm2());
|
dialogTool->SetKAsm2(spl->GetKasm2());
|
||||||
dialogTool->setKCurve(spl->GetKcurve());
|
dialogTool->SetKCurve(spl->GetKcurve());
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
@ -121,13 +121,13 @@ VToolSpline* VToolSpline::Create(DialogTool *dialog, VMainGraphicsScene *scene,
|
||||||
SCASSERT(dialog != nullptr);
|
SCASSERT(dialog != nullptr);
|
||||||
DialogSpline *dialogTool = qobject_cast<DialogSpline*>(dialog);
|
DialogSpline *dialogTool = qobject_cast<DialogSpline*>(dialog);
|
||||||
SCASSERT(dialogTool != nullptr);
|
SCASSERT(dialogTool != nullptr);
|
||||||
const quint32 p1 = dialogTool->getP1();
|
const quint32 p1 = dialogTool->GetP1();
|
||||||
const quint32 p4 = dialogTool->getP4();
|
const quint32 p4 = dialogTool->GetP4();
|
||||||
const qreal kAsm1 = dialogTool->getKAsm1();
|
const qreal kAsm1 = dialogTool->GetKAsm1();
|
||||||
const qreal kAsm2 = dialogTool->getKAsm2();
|
const qreal kAsm2 = dialogTool->GetKAsm2();
|
||||||
const qreal angle1 = dialogTool->getAngle1();
|
const qreal angle1 = dialogTool->GetAngle1();
|
||||||
const qreal angle2 = dialogTool->getAngle2();
|
const qreal angle2 = dialogTool->GetAngle2();
|
||||||
const qreal kCurve = dialogTool->getKCurve();
|
const qreal kCurve = dialogTool->GetKCurve();
|
||||||
VToolSpline *spl = nullptr;
|
VToolSpline *spl = nullptr;
|
||||||
spl = Create(0, p1, p4, kAsm1, kAsm2, angle1, angle2, kCurve, scene, doc, data, Document::FullParse,
|
spl = Create(0, p1, p4, kAsm1, kAsm2, angle1, angle2, kCurve, scene, doc, data, Document::FullParse,
|
||||||
Source::FromGui);
|
Source::FromGui);
|
||||||
|
@ -225,11 +225,11 @@ void VToolSpline::ShowVisualization(bool show)
|
||||||
const QSharedPointer<VSpline> spl = VAbstractTool::data.GeometricObject<VSpline>(id);
|
const QSharedPointer<VSpline> spl = VAbstractTool::data.GeometricObject<VSpline>(id);
|
||||||
visual->setPoint1Id(spl->GetP1().id());
|
visual->setPoint1Id(spl->GetP1().id());
|
||||||
visual->setPoint4Id(spl->GetP4().id());
|
visual->setPoint4Id(spl->GetP4().id());
|
||||||
visual->setAngle1(spl->GetAngle1());
|
visual->SetAngle1(spl->GetAngle1());
|
||||||
visual->setAngle2(spl->GetAngle2());
|
visual->SetAngle2(spl->GetAngle2());
|
||||||
visual->setKAsm1(spl->GetKasm1());
|
visual->SetKAsm1(spl->GetKasm1());
|
||||||
visual->setKAsm2(spl->GetKasm2());
|
visual->SetKAsm2(spl->GetKasm2());
|
||||||
visual->setKCurve(spl->GetKcurve());
|
visual->SetKCurve(spl->GetKcurve());
|
||||||
visual->RefreshGeometry();
|
visual->RefreshGeometry();
|
||||||
vis = visual;
|
vis = visual;
|
||||||
}
|
}
|
||||||
|
@ -308,10 +308,10 @@ void VToolSpline::SaveDialog(QDomElement &domElement)
|
||||||
DialogSpline *dialogTool = qobject_cast<DialogSpline*>(dialog);
|
DialogSpline *dialogTool = qobject_cast<DialogSpline*>(dialog);
|
||||||
SCASSERT(dialogTool != nullptr);
|
SCASSERT(dialogTool != nullptr);
|
||||||
|
|
||||||
VPointF point1 = *VAbstractTool::data.GeometricObject<VPointF>(dialogTool->getP1());
|
VPointF point1 = *VAbstractTool::data.GeometricObject<VPointF>(dialogTool->GetP1());
|
||||||
VPointF point4 = *VAbstractTool::data.GeometricObject<VPointF>(dialogTool->getP4());
|
VPointF point4 = *VAbstractTool::data.GeometricObject<VPointF>(dialogTool->GetP4());
|
||||||
VSpline spl = VSpline (point1, point4, dialogTool->getAngle1(), dialogTool->getAngle2(),
|
VSpline spl = VSpline (point1, point4, dialogTool->GetAngle1(), dialogTool->GetAngle2(),
|
||||||
dialogTool->getKAsm1(), dialogTool->getKAsm2(), dialogTool->getKCurve());
|
dialogTool->GetKAsm1(), dialogTool->GetKAsm2(), dialogTool->GetKCurve());
|
||||||
|
|
||||||
controlPoints[0]->blockSignals(true);
|
controlPoints[0]->blockSignals(true);
|
||||||
controlPoints[1]->blockSignals(true);
|
controlPoints[1]->blockSignals(true);
|
||||||
|
@ -322,7 +322,7 @@ void VToolSpline::SaveDialog(QDomElement &domElement)
|
||||||
controlPoints[0]->blockSignals(false);
|
controlPoints[0]->blockSignals(false);
|
||||||
controlPoints[1]->blockSignals(false);
|
controlPoints[1]->blockSignals(false);
|
||||||
|
|
||||||
spl = VSpline (point1, controlPoints[0]->pos(), controlPoints[1]->pos(), point4, dialogTool->getKCurve());
|
spl = VSpline (point1, controlPoints[0]->pos(), controlPoints[1]->pos(), point4, dialogTool->GetKCurve());
|
||||||
|
|
||||||
doc->SetAttribute(domElement, AttrPoint1, spl.GetP1().id());
|
doc->SetAttribute(domElement, AttrPoint1, spl.GetP1().id());
|
||||||
doc->SetAttribute(domElement, AttrPoint4, spl.GetP4().id());
|
doc->SetAttribute(domElement, AttrPoint4, spl.GetP4().id());
|
||||||
|
@ -388,11 +388,11 @@ void VToolSpline::RefreshGeometry()
|
||||||
VisToolSpline *visual = qobject_cast<VisToolSpline *>(vis);
|
VisToolSpline *visual = qobject_cast<VisToolSpline *>(vis);
|
||||||
visual->setPoint1Id(spl->GetP1().id());
|
visual->setPoint1Id(spl->GetP1().id());
|
||||||
visual->setPoint4Id(spl->GetP4().id());
|
visual->setPoint4Id(spl->GetP4().id());
|
||||||
visual->setAngle1(spl->GetAngle1());
|
visual->SetAngle1(spl->GetAngle1());
|
||||||
visual->setAngle2(spl->GetAngle2());
|
visual->SetAngle2(spl->GetAngle2());
|
||||||
visual->setKAsm1(spl->GetKasm1());
|
visual->SetKAsm1(spl->GetKasm1());
|
||||||
visual->setKAsm2(spl->GetKasm2());
|
visual->SetKAsm2(spl->GetKasm2());
|
||||||
visual->setKCurve(spl->GetKcurve());
|
visual->SetKCurve(spl->GetKcurve());
|
||||||
visual->RefreshGeometry();
|
visual->RefreshGeometry();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -237,7 +237,7 @@ void VToolSplinePath::RefreshSplinePath(VSplinePath &splPath)
|
||||||
controlPoints[j-1]->blockSignals(false);
|
controlPoints[j-1]->blockSignals(false);
|
||||||
|
|
||||||
spl = VSpline (spl.GetP1(), controlPoints[j-2]->pos(), controlPoints[j-1]->pos(), spl.GetP4(),
|
spl = VSpline (spl.GetP1(), controlPoints[j-2]->pos(), controlPoints[j-1]->pos(), spl.GetP4(),
|
||||||
splPath.getKCurve());
|
splPath.GetKCurve());
|
||||||
UpdateControlPoints(spl, splPath, i);
|
UpdateControlPoints(spl, splPath, i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -340,7 +340,7 @@ void VToolSplinePath::RefreshDataInFile()
|
||||||
}
|
}
|
||||||
VSplinePath splPath = *VAbstractTool::data.GeometricObject<VSplinePath>(id);
|
VSplinePath splPath = *VAbstractTool::data.GeometricObject<VSplinePath>(id);
|
||||||
RefreshSplinePath(splPath);
|
RefreshSplinePath(splPath);
|
||||||
doc->SetAttribute(domElement, AttrKCurve, QString().setNum(splPath.getKCurve()));
|
doc->SetAttribute(domElement, AttrKCurve, QString().setNum(splPath.GetKCurve()));
|
||||||
UpdatePathPoint(doc, domElement, splPath);
|
UpdatePathPoint(doc, domElement, splPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -388,7 +388,7 @@ void VToolSplinePath::SaveDialog(QDomElement &domElement)
|
||||||
|
|
||||||
VSplinePath splPath = dialogTool->GetPath();
|
VSplinePath splPath = dialogTool->GetPath();
|
||||||
RefreshSplinePath(splPath);
|
RefreshSplinePath(splPath);
|
||||||
doc->SetAttribute(domElement, AttrKCurve, QString().setNum(splPath.getKCurve()));
|
doc->SetAttribute(domElement, AttrKCurve, QString().setNum(splPath.GetKCurve()));
|
||||||
UpdatePathPoint(doc, domElement, splPath);
|
UpdatePathPoint(doc, domElement, splPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -400,7 +400,7 @@ void VToolSplinePath::SaveOptions(QDomElement &tag, QSharedPointer<VGObject> &ob
|
||||||
|
|
||||||
doc->SetAttribute(tag, VDomDocument::AttrId, id);
|
doc->SetAttribute(tag, VDomDocument::AttrId, id);
|
||||||
doc->SetAttribute(tag, AttrType, ToolType);
|
doc->SetAttribute(tag, AttrType, ToolType);
|
||||||
doc->SetAttribute(tag, AttrKCurve, splPath->getKCurve());
|
doc->SetAttribute(tag, AttrKCurve, splPath->GetKCurve());
|
||||||
|
|
||||||
doc->RemoveAllChild(tag);
|
doc->RemoveAllChild(tag);
|
||||||
for (qint32 i = 0; i < splPath->CountPoint(); ++i)
|
for (qint32 i = 0; i < splPath->CountPoint(); ++i)
|
||||||
|
|
|
@ -74,11 +74,11 @@ void VToolTriangle::setDialog()
|
||||||
DialogTriangle *dialogTool = qobject_cast<DialogTriangle*>(dialog);
|
DialogTriangle *dialogTool = qobject_cast<DialogTriangle*>(dialog);
|
||||||
SCASSERT(dialogTool != nullptr);
|
SCASSERT(dialogTool != nullptr);
|
||||||
const QSharedPointer<VPointF> p = VAbstractTool::data.GeometricObject<VPointF>(id);
|
const QSharedPointer<VPointF> p = VAbstractTool::data.GeometricObject<VPointF>(id);
|
||||||
dialogTool->setAxisP1Id(axisP1Id);
|
dialogTool->SetAxisP1Id(axisP1Id);
|
||||||
dialogTool->setAxisP2Id(axisP2Id);
|
dialogTool->SetAxisP2Id(axisP2Id);
|
||||||
dialogTool->setFirstPointId(firstPointId);
|
dialogTool->SetFirstPointId(firstPointId);
|
||||||
dialogTool->setSecondPointId(secondPointId);
|
dialogTool->SetSecondPointId(secondPointId);
|
||||||
dialogTool->setPointName(p->name());
|
dialogTool->SetPointName(p->name());
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
@ -95,10 +95,10 @@ VToolTriangle* VToolTriangle::Create(DialogTool *dialog, VMainGraphicsScene *sce
|
||||||
SCASSERT(dialog != nullptr);
|
SCASSERT(dialog != nullptr);
|
||||||
DialogTriangle *dialogTool = qobject_cast<DialogTriangle*>(dialog);
|
DialogTriangle *dialogTool = qobject_cast<DialogTriangle*>(dialog);
|
||||||
SCASSERT(dialogTool != nullptr);
|
SCASSERT(dialogTool != nullptr);
|
||||||
const quint32 axisP1Id = dialogTool->getAxisP1Id();
|
const quint32 axisP1Id = dialogTool->GetAxisP1Id();
|
||||||
const quint32 axisP2Id = dialogTool->getAxisP2Id();
|
const quint32 axisP2Id = dialogTool->GetAxisP2Id();
|
||||||
const quint32 firstPointId = dialogTool->getFirstPointId();
|
const quint32 firstPointId = dialogTool->GetFirstPointId();
|
||||||
const quint32 secondPointId = dialogTool->getSecondPointId();
|
const quint32 secondPointId = dialogTool->GetSecondPointId();
|
||||||
const QString pointName = dialogTool->getPointName();
|
const QString pointName = dialogTool->getPointName();
|
||||||
VToolTriangle* point = nullptr;
|
VToolTriangle* point = nullptr;
|
||||||
point = Create(0, pointName, axisP1Id, axisP2Id, firstPointId, secondPointId, 5, 10, scene, doc, data,
|
point = Create(0, pointName, axisP1Id, axisP2Id, firstPointId, secondPointId, 5, 10, scene, doc, data,
|
||||||
|
@ -283,10 +283,10 @@ void VToolTriangle::SaveDialog(QDomElement &domElement)
|
||||||
DialogTriangle *dialogTool = qobject_cast<DialogTriangle*>(dialog);
|
DialogTriangle *dialogTool = qobject_cast<DialogTriangle*>(dialog);
|
||||||
SCASSERT(dialogTool != nullptr);
|
SCASSERT(dialogTool != nullptr);
|
||||||
doc->SetAttribute(domElement, AttrName, dialogTool->getPointName());
|
doc->SetAttribute(domElement, AttrName, dialogTool->getPointName());
|
||||||
doc->SetAttribute(domElement, AttrAxisP1, QString().setNum(dialogTool->getAxisP1Id()));
|
doc->SetAttribute(domElement, AttrAxisP1, QString().setNum(dialogTool->GetAxisP1Id()));
|
||||||
doc->SetAttribute(domElement, AttrAxisP2, QString().setNum(dialogTool->getAxisP2Id()));
|
doc->SetAttribute(domElement, AttrAxisP2, QString().setNum(dialogTool->GetAxisP2Id()));
|
||||||
doc->SetAttribute(domElement, AttrFirstPoint, QString().setNum(dialogTool->getFirstPointId()));
|
doc->SetAttribute(domElement, AttrFirstPoint, QString().setNum(dialogTool->GetFirstPointId()));
|
||||||
doc->SetAttribute(domElement, AttrSecondPoint, QString().setNum(dialogTool->getSecondPointId()));
|
doc->SetAttribute(domElement, AttrSecondPoint, QString().setNum(dialogTool->GetSecondPointId()));
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
@ -308,13 +308,13 @@ void VToolTriangle::SaveOptions(QDomElement &tag, QSharedPointer<VGObject> &obj)
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
quint32 VToolTriangle::getSecondPointId() const
|
quint32 VToolTriangle::GetSecondPointId() const
|
||||||
{
|
{
|
||||||
return secondPointId;
|
return secondPointId;
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VToolTriangle::setSecondPointId(const quint32 &value)
|
void VToolTriangle::SetSecondPointId(const quint32 &value)
|
||||||
{
|
{
|
||||||
if (value != NULL_ID)
|
if (value != NULL_ID)
|
||||||
{
|
{
|
||||||
|
@ -361,13 +361,13 @@ void VToolTriangle::ShowVisualization(bool show)
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
quint32 VToolTriangle::getFirstPointId() const
|
quint32 VToolTriangle::GetFirstPointId() const
|
||||||
{
|
{
|
||||||
return firstPointId;
|
return firstPointId;
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VToolTriangle::setFirstPointId(const quint32 &value)
|
void VToolTriangle::SetFirstPointId(const quint32 &value)
|
||||||
{
|
{
|
||||||
if (value != NULL_ID)
|
if (value != NULL_ID)
|
||||||
{
|
{
|
||||||
|
@ -379,13 +379,13 @@ void VToolTriangle::setFirstPointId(const quint32 &value)
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
quint32 VToolTriangle::getAxisP2Id() const
|
quint32 VToolTriangle::GetAxisP2Id() const
|
||||||
{
|
{
|
||||||
return axisP2Id;
|
return axisP2Id;
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VToolTriangle::setAxisP2Id(const quint32 &value)
|
void VToolTriangle::SetAxisP2Id(const quint32 &value)
|
||||||
{
|
{
|
||||||
if (value != NULL_ID)
|
if (value != NULL_ID)
|
||||||
{
|
{
|
||||||
|
@ -397,13 +397,13 @@ void VToolTriangle::setAxisP2Id(const quint32 &value)
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
quint32 VToolTriangle::getAxisP1Id() const
|
quint32 VToolTriangle::GetAxisP1Id() const
|
||||||
{
|
{
|
||||||
return axisP1Id;
|
return axisP1Id;
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VToolTriangle::setAxisP1Id(const quint32 &value)
|
void VToolTriangle::SetAxisP1Id(const quint32 &value)
|
||||||
{
|
{
|
||||||
if (value != NULL_ID)
|
if (value != NULL_ID)
|
||||||
{
|
{
|
||||||
|
|
|
@ -54,17 +54,17 @@ public:
|
||||||
virtual int type() const {return Type;}
|
virtual int type() const {return Type;}
|
||||||
enum { Type = UserType + static_cast<int>(Tool::Triangle)};
|
enum { Type = UserType + static_cast<int>(Tool::Triangle)};
|
||||||
|
|
||||||
quint32 getAxisP1Id() const;
|
quint32 GetAxisP1Id() const;
|
||||||
void setAxisP1Id(const quint32 &value);
|
void SetAxisP1Id(const quint32 &value);
|
||||||
|
|
||||||
quint32 getAxisP2Id() const;
|
quint32 GetAxisP2Id() const;
|
||||||
void setAxisP2Id(const quint32 &value);
|
void SetAxisP2Id(const quint32 &value);
|
||||||
|
|
||||||
quint32 getFirstPointId() const;
|
quint32 GetFirstPointId() const;
|
||||||
void setFirstPointId(const quint32 &value);
|
void SetFirstPointId(const quint32 &value);
|
||||||
|
|
||||||
quint32 getSecondPointId() const;
|
quint32 GetSecondPointId() const;
|
||||||
void setSecondPointId(const quint32 &value);
|
void SetSecondPointId(const quint32 &value);
|
||||||
|
|
||||||
virtual void ShowVisualization(bool show);
|
virtual void ShowVisualization(bool show);
|
||||||
public slots:
|
public slots:
|
||||||
|
|
|
@ -239,7 +239,7 @@ QString VAbstractTool::getLineType() const
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VAbstractTool::setTypeLine(const QString &value)
|
void VAbstractTool::SetTypeLine(const QString &value)
|
||||||
{
|
{
|
||||||
typeLine = value;
|
typeLine = value;
|
||||||
|
|
||||||
|
|
|
@ -115,7 +115,7 @@ public:
|
||||||
const VContainer *getData() const;
|
const VContainer *getData() const;
|
||||||
|
|
||||||
QString getLineType() const;
|
QString getLineType() const;
|
||||||
virtual void setTypeLine(const QString &value);
|
virtual void SetTypeLine(const QString &value);
|
||||||
QMap<QString, quint32> PointsList() const;
|
QMap<QString, quint32> PointsList() const;
|
||||||
virtual QString getTagName() const =0;
|
virtual QString getTagName() const =0;
|
||||||
virtual void ShowVisualization(bool show) =0;
|
virtual void ShowVisualization(bool show) =0;
|
||||||
|
|
|
@ -206,7 +206,7 @@ void VToolUnionDetails::AddToNewDetail(QObject *tool, VPattern *doc, VContainer
|
||||||
{
|
{
|
||||||
VSpline spline(splinePath->at(i-1).P(), splinePath->at(i).P(),
|
VSpline spline(splinePath->at(i-1).P(), splinePath->at(i).P(),
|
||||||
splinePath->at(i-1).Angle2(), splinePath->at(i).Angle1(), splinePath->at(i-1).KAsm2(),
|
splinePath->at(i-1).Angle2(), splinePath->at(i).Angle1(), splinePath->at(i-1).KAsm2(),
|
||||||
splinePath->at(i).KAsm1(), splinePath->getKCurve());
|
splinePath->at(i).KAsm1(), splinePath->GetKCurve());
|
||||||
|
|
||||||
VPointF *p1 = new VPointF(spline.GetP1());
|
VPointF *p1 = new VPointF(spline.GetP1());
|
||||||
BiasRotatePoint(p1, dx, dy, data->GeometricObject<VPointF>(pRotate)->toQPointF(),
|
BiasRotatePoint(p1, dx, dy, data->GeometricObject<VPointF>(pRotate)->toQPointF(),
|
||||||
|
@ -366,7 +366,7 @@ void VToolUnionDetails::UpdatePoints(const quint32 &idDetail, VContainer *data,
|
||||||
{
|
{
|
||||||
VSpline spline(splinePath->at(i-1).P(), splinePath->at(i).P(),
|
VSpline spline(splinePath->at(i-1).P(), splinePath->at(i).P(),
|
||||||
splinePath->at(i-1).Angle2(), splinePath->at(i).Angle1(), splinePath->at(i-1).KAsm2(),
|
splinePath->at(i-1).Angle2(), splinePath->at(i).Angle1(), splinePath->at(i-1).KAsm2(),
|
||||||
splinePath->at(i).KAsm1(), splinePath->getKCurve());
|
splinePath->at(i).KAsm1(), splinePath->GetKCurve());
|
||||||
|
|
||||||
VPointF *p1 = new VPointF(spline.GetP1());
|
VPointF *p1 = new VPointF(spline.GetP1());
|
||||||
BiasRotatePoint(p1, dx, dy, data->GeometricObject<VPointF>(pRotate)->toQPointF(),
|
BiasRotatePoint(p1, dx, dy, data->GeometricObject<VPointF>(pRotate)->toQPointF(),
|
||||||
|
|
|
@ -89,7 +89,7 @@ void MoveSplinePath::Do(const VSplinePath &splPath)
|
||||||
QDomElement domElement = doc->elementById(QString().setNum(nodeId));
|
QDomElement domElement = doc->elementById(QString().setNum(nodeId));
|
||||||
if (domElement.isElement())
|
if (domElement.isElement())
|
||||||
{
|
{
|
||||||
doc->SetAttribute(domElement, VToolSplinePath::AttrKCurve, QString().setNum(splPath.getKCurve()));
|
doc->SetAttribute(domElement, VToolSplinePath::AttrKCurve, QString().setNum(splPath.GetKCurve()));
|
||||||
VToolSplinePath::UpdatePathPoint(doc, domElement, splPath);
|
VToolSplinePath::UpdatePathPoint(doc, domElement, splPath);
|
||||||
|
|
||||||
emit NeedLiteParsing(Document::LiteParse);
|
emit NeedLiteParsing(Document::LiteParse);
|
||||||
|
|
|
@ -92,7 +92,7 @@ QString VisToolCurveIntersectAxis::Angle() const
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VisToolCurveIntersectAxis::setAngle(const QString &expression)
|
void VisToolCurveIntersectAxis::SetAngle(const QString &expression)
|
||||||
{
|
{
|
||||||
angle = FindVal(expression);
|
angle = FindVal(expression);
|
||||||
}
|
}
|
||||||
|
|
|
@ -43,7 +43,7 @@ public:
|
||||||
virtual void RefreshGeometry();
|
virtual void RefreshGeometry();
|
||||||
|
|
||||||
QString Angle() const;
|
QString Angle() const;
|
||||||
void setAngle(const QString &expression);
|
void SetAngle(const QString &expression);
|
||||||
void setAxisPointId(const quint32 &value);
|
void setAxisPointId(const quint32 &value);
|
||||||
|
|
||||||
virtual int type() const {return Type;}
|
virtual int type() const {return Type;}
|
||||||
|
|
|
@ -67,8 +67,8 @@ void VisToolCutSplinePath::RefreshGeometry()
|
||||||
|
|
||||||
VSplinePoint splP1 = splPath->at(p1);
|
VSplinePoint splP1 = splPath->at(p1);
|
||||||
VSplinePoint splP2 = splPath->at(p2);
|
VSplinePoint splP2 = splPath->at(p2);
|
||||||
const VSpline spl1 = VSpline(splP1.P(), spl1p2, spl1p3, p, splPath->getKCurve());
|
const VSpline spl1 = VSpline(splP1.P(), spl1p2, spl1p3, p, splPath->GetKCurve());
|
||||||
const VSpline spl2 = VSpline(p, spl2p2, spl2p3, splP2.P(), splPath->getKCurve());
|
const VSpline spl2 = VSpline(p, spl2p2, spl2p3, splP2.P(), splPath->GetKCurve());
|
||||||
|
|
||||||
VSplinePath spPath1 = VSplinePath();
|
VSplinePath spPath1 = VSplinePath();
|
||||||
VSplinePath spPath2 = VSplinePath();
|
VSplinePath spPath2 = VSplinePath();
|
||||||
|
@ -104,8 +104,8 @@ void VisToolCutSplinePath::RefreshGeometry()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
spPath1.setKCurve(splPath->getKCurve());
|
spPath1.SetKCurve(splPath->GetKCurve());
|
||||||
spPath2.setKCurve(splPath->getKCurve());
|
spPath2.SetKCurve(splPath->GetKCurve());
|
||||||
|
|
||||||
DrawPoint(point, cutPoint, mainColor);
|
DrawPoint(point, cutPoint, mainColor);
|
||||||
|
|
||||||
|
|
|
@ -72,7 +72,7 @@ QString VisToolEndLine::Angle() const
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VisToolEndLine::setAngle(const QString &expression)
|
void VisToolEndLine::SetAngle(const QString &expression)
|
||||||
{
|
{
|
||||||
angle = FindVal(expression);
|
angle = FindVal(expression);
|
||||||
}
|
}
|
||||||
|
|
|
@ -42,7 +42,7 @@ public:
|
||||||
|
|
||||||
virtual void RefreshGeometry();
|
virtual void RefreshGeometry();
|
||||||
QString Angle() const;
|
QString Angle() const;
|
||||||
void setAngle(const QString &expression);
|
void SetAngle(const QString &expression);
|
||||||
void setLength(const QString &expression);
|
void setLength(const QString &expression);
|
||||||
virtual int type() const {return Type;}
|
virtual int type() const {return Type;}
|
||||||
enum { Type = UserType + static_cast<int>(Vis::ToolEndLine)};
|
enum { Type = UserType + static_cast<int>(Vis::ToolEndLine)};
|
||||||
|
|
|
@ -108,7 +108,7 @@ QString VisToolLineIntersectAxis::Angle() const
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VisToolLineIntersectAxis::setAngle(const QString &expression)
|
void VisToolLineIntersectAxis::SetAngle(const QString &expression)
|
||||||
{
|
{
|
||||||
angle = FindVal(expression);
|
angle = FindVal(expression);
|
||||||
}
|
}
|
||||||
|
|
|
@ -43,7 +43,7 @@ public:
|
||||||
virtual void RefreshGeometry();
|
virtual void RefreshGeometry();
|
||||||
|
|
||||||
QString Angle() const;
|
QString Angle() const;
|
||||||
void setAngle(const QString &expression);
|
void SetAngle(const QString &expression);
|
||||||
void setPoint2Id(const quint32 &value);
|
void setPoint2Id(const quint32 &value);
|
||||||
void setAxisPointId(const quint32 &value);
|
void setAxisPointId(const quint32 &value);
|
||||||
|
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user