Allow an arc to have the same start and end angles.

In such a case full circle will be drawn.

--HG--
branch : develop
This commit is contained in:
Roman Telezhynskyi 2017-11-15 13:22:16 +02:00
parent 12761dcfa6
commit 016883110f
5 changed files with 4 additions and 64 deletions

View File

@ -423,32 +423,6 @@ void DialogArc::EvalF()
labelEditFormula = ui->labelEditF2;
angleF2 = Eval(ui->plainTextEditF2->toPlainText(), flagF2, ui->labelResultF2, degreeSymbol, false);
CheckAngles();
}
//---------------------------------------------------------------------------------------------------------------------
void DialogArc::CheckAngles()
{
if (static_cast<int>(angleF1) == INT_MIN || static_cast<int>(angleF2) == INT_MIN)
{
return;
}
if (VFuzzyComparePossibleNulls(angleF1, angleF2))
{
flagF1 = false;
ChangeColor(ui->labelEditF1, Qt::red);
ui->labelResultF1->setText(tr("Error"));
ui->labelResultF1->setToolTip(tr("Angles equal"));
flagF2 = false;
ChangeColor(ui->labelEditF2, Qt::red);
ui->labelResultF2->setText(tr("Error"));
ui->labelResultF2->setToolTip(tr("Angles equal"));
}
DialogArc::CheckState();
}
//---------------------------------------------------------------------------------------------------------------------

View File

@ -139,7 +139,6 @@ private:
void EvalRadius();
void EvalF();
void CheckAngles();
};
#endif // DIALOGARC_H

View File

@ -408,32 +408,6 @@ void DialogEllipticalArc::EvalAngles()
labelEditFormula = ui->labelEditRotationAngle;
angleRotation = Eval(ui->plainTextEditRotationAngle->toPlainText(), flagRotationAngle,
ui->labelResultRotationAngle, degreeSymbol, false);
CheckAngles();
}
//---------------------------------------------------------------------------------------------------------------------
void DialogEllipticalArc::CheckAngles()
{
if (static_cast<int>(angleF1) == INT_MIN || static_cast<int>(angleF2) == INT_MIN)
{
return;
}
if (VFuzzyComparePossibleNulls(angleF1, angleF2))
{
flagF1 = false;
ChangeColor(ui->labelEditF1, Qt::red);
ui->labelResultF1->setText(tr("Error"));
ui->labelResultF1->setToolTip(tr("Angles equal"));
flagF2 = false;
ChangeColor(ui->labelEditF2, Qt::red);
ui->labelResultF2->setText(tr("Error"));
ui->labelResultF2->setToolTip(tr("Angles equal"));
}
DialogEllipticalArc::CheckState();
}
//---------------------------------------------------------------------------------------------------------------------

View File

@ -170,7 +170,6 @@ private:
void EvalRadiuses();
void EvalAngles();
void CheckAngles();
};
#endif // DIALOGELLIPTICALARC_H

View File

@ -232,13 +232,10 @@ void VToolArc::SetFormulaF1(const VFormula &value)
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(m_id);
QSharedPointer<VArc> arc = qSharedPointerDynamicCast<VArc>(obj);
if (not VFuzzyComparePossibleNulls(value.getDoubleValue(), arc->GetEndAngle()))// Angles can't be equal
{
arc->SetFormulaF1(value.GetFormula(FormulaType::FromUser), value.getDoubleValue());
SaveOption(obj);
}
}
}
//---------------------------------------------------------------------------------------------------------------------
VFormula VToolArc::GetFormulaF2() const
@ -260,13 +257,10 @@ void VToolArc::SetFormulaF2(const VFormula &value)
{
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(m_id);
QSharedPointer<VArc> arc = qSharedPointerDynamicCast<VArc>(obj);
if (not VFuzzyComparePossibleNulls(value.getDoubleValue(), arc->GetStartAngle()))// Angles can't be equal
{
arc->SetFormulaF2(value.GetFormula(FormulaType::FromUser), value.getDoubleValue());
SaveOption(obj);
}
}
}
//---------------------------------------------------------------------------------------------------------------------
qreal VToolArc::GetApproximationScale() const