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:
parent
12761dcfa6
commit
016883110f
|
@ -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();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
|
|
|
@ -139,7 +139,6 @@ private:
|
|||
|
||||
void EvalRadius();
|
||||
void EvalF();
|
||||
void CheckAngles();
|
||||
};
|
||||
|
||||
#endif // DIALOGARC_H
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
|
|
|
@ -170,7 +170,6 @@ private:
|
|||
|
||||
void EvalRadiuses();
|
||||
void EvalAngles();
|
||||
void CheckAngles();
|
||||
};
|
||||
|
||||
#endif // DIALOGELLIPTICALARC_H
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue
Block a user