Elliptic arc bring new formulas that we should also cover.

--HG--
branch : feature
This commit is contained in:
Roman Telezhynskyi 2016-12-19 14:56:39 +02:00
parent b729f4dacb
commit 24970440b7
2 changed files with 74 additions and 4 deletions

View File

@ -1409,8 +1409,10 @@ QStringList VAbstractPattern::ListExpressions() const
{ {
QStringList list; QStringList list;
// If new tool bring absolutely new type and has formula(s) create new method to cover it.
list << ListPointExpressions(); list << ListPointExpressions();
list << ListArcExpressions(); list << ListArcExpressions();
list << ListElArcExpressions();
list << ListSplineExpressions(); list << ListSplineExpressions();
list << ListIncrementExpressions(); list << ListIncrementExpressions();
list << ListOperationExpressions(); list << ListOperationExpressions();
@ -1422,7 +1424,8 @@ QStringList VAbstractPattern::ListExpressions() const
QStringList VAbstractPattern::ListPointExpressions() const QStringList VAbstractPattern::ListPointExpressions() const
{ {
// Check if new tool doesn't bring new attribute with a formula. // Check if new tool doesn't bring new attribute with a formula.
// If no just increment number // If no just increment a number.
// If new tool bring absolutely new type and has formula(s) create new method to cover it.
Q_STATIC_ASSERT(static_cast<int>(Tool::LAST_ONE_DO_NOT_USE) == 49); Q_STATIC_ASSERT(static_cast<int>(Tool::LAST_ONE_DO_NOT_USE) == 49);
QStringList expressions; QStringList expressions;
@ -1493,7 +1496,8 @@ QStringList VAbstractPattern::ListPointExpressions() const
QStringList VAbstractPattern::ListArcExpressions() const QStringList VAbstractPattern::ListArcExpressions() const
{ {
// Check if new tool doesn't bring new attribute with a formula. // Check if new tool doesn't bring new attribute with a formula.
// If no just increment number // If no just increment number.
// If new tool bring absolutely new type and has formula(s) create new method to cover it.
Q_STATIC_ASSERT(static_cast<int>(Tool::LAST_ONE_DO_NOT_USE) == 49); Q_STATIC_ASSERT(static_cast<int>(Tool::LAST_ONE_DO_NOT_USE) == 49);
QStringList expressions; QStringList expressions;
@ -1542,6 +1546,69 @@ QStringList VAbstractPattern::ListArcExpressions() const
return expressions; return expressions;
} }
//---------------------------------------------------------------------------------------------------------------------
QStringList VAbstractPattern::ListElArcExpressions() const
{
// Check if new tool doesn't bring new attribute with a formula.
// If no just increment number.
// If new tool bring absolutely new type and has formula(s) create new method to cover it.
Q_STATIC_ASSERT(static_cast<int>(Tool::LAST_ONE_DO_NOT_USE) == 49);
QStringList expressions;
const QDomNodeList list = elementsByTagName(TagElArc);
for (int i=0; i < list.size(); ++i)
{
const QDomElement dom = list.at(i).toElement();
try
{
expressions.append(GetParametrString(dom, AttrRadius1));
}
catch (VExceptionEmptyParameter &e)
{
Q_UNUSED(e)
}
try
{
expressions.append(GetParametrString(dom, AttrRadius2));
}
catch (VExceptionEmptyParameter &e)
{
Q_UNUSED(e)
}
try
{
expressions.append(GetParametrString(dom, AttrAngle1));
}
catch (VExceptionEmptyParameter &e)
{
Q_UNUSED(e)
}
try
{
expressions.append(GetParametrString(dom, AttrAngle2));
}
catch (VExceptionEmptyParameter &e)
{
Q_UNUSED(e)
}
try
{
expressions.append(GetParametrString(dom, AttrRotationAngle));
}
catch (VExceptionEmptyParameter &e)
{
Q_UNUSED(e)
}
}
return expressions;
}
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
QStringList VAbstractPattern::ListSplineExpressions() const QStringList VAbstractPattern::ListSplineExpressions() const
{ {
@ -1554,7 +1621,8 @@ QStringList VAbstractPattern::ListSplineExpressions() const
QStringList VAbstractPattern::ListPathPointExpressions() const QStringList VAbstractPattern::ListPathPointExpressions() const
{ {
// Check if new tool doesn't bring new attribute with a formula. // Check if new tool doesn't bring new attribute with a formula.
// If no just increment number // If no just increment number.
// If new tool bring absolutely new type and has formula(s) create new method to cover it.
Q_STATIC_ASSERT(static_cast<int>(Tool::LAST_ONE_DO_NOT_USE) == 49); Q_STATIC_ASSERT(static_cast<int>(Tool::LAST_ONE_DO_NOT_USE) == 49);
QStringList expressions; QStringList expressions;
@ -1620,7 +1688,8 @@ QStringList VAbstractPattern::ListIncrementExpressions() const
QStringList VAbstractPattern::ListOperationExpressions() const QStringList VAbstractPattern::ListOperationExpressions() const
{ {
// Check if new tool doesn't bring new attribute with a formula. // Check if new tool doesn't bring new attribute with a formula.
// If no just increment number // If no just increment number.
// If new tool bring absolutely new type and has formula(s) create new method to cover it.
Q_STATIC_ASSERT(static_cast<int>(Tool::LAST_ONE_DO_NOT_USE) == 49); Q_STATIC_ASSERT(static_cast<int>(Tool::LAST_ONE_DO_NOT_USE) == 49);
QStringList expressions; QStringList expressions;

View File

@ -351,6 +351,7 @@ private:
QStringList ListExpressions() const; QStringList ListExpressions() const;
QStringList ListPointExpressions() const; QStringList ListPointExpressions() const;
QStringList ListArcExpressions() const; QStringList ListArcExpressions() const;
QStringList ListElArcExpressions() const;
QStringList ListSplineExpressions() const; QStringList ListSplineExpressions() const;
QStringList ListPathPointExpressions() const; QStringList ListPathPointExpressions() const;
QStringList ListIncrementExpressions() const; QStringList ListIncrementExpressions() const;