diff --git a/src/app/valentina/xml/vpattern.cpp b/src/app/valentina/xml/vpattern.cpp
index 7a3d84f3f..0899e0748 100644
--- a/src/app/valentina/xml/vpattern.cpp
+++ b/src/app/valentina/xml/vpattern.cpp
@@ -724,17 +724,10 @@ void VPattern::ParseDetailElement(const QDomElement &domElement, const Document
ptPos.setX(GetParametrDouble(element, AttrMx, "0"));
ptPos.setY(GetParametrDouble(element, AttrMy, "0"));
detail.GetGrainlineGeometry().SetPos(ptPos);
- qreal dLength = GetParametrDouble(element, AttrLength, "0");
- detail.GetGrainlineGeometry().SetLength(dLength);
- if (detail.GetGrainlineGeometry().IsVisible() == true)
- {
- qreal dRot = GetParametrDouble(element, VToolDetail::AttrRotation, "0");
- detail.GetGrainlineGeometry().SetRotation(dRot);
- }
- else
- {
- detail.GetGrainlineGeometry().SetRotation(0);
- }
+ QString qsLength = GetParametrString(element, AttrLength, "0");
+ detail.GetGrainlineGeometry().SetLength(qsLength);
+ QString qsRot = GetParametrString(element, VToolDetail::AttrRotation, "0");
+ detail.GetGrainlineGeometry().SetRotation(qsRot);
}
}
}
diff --git a/src/libs/ifc/schema/pattern/v0.3.5.xsd b/src/libs/ifc/schema/pattern/v0.3.5.xsd
index db1b7232f..d872d7977 100644
--- a/src/libs/ifc/schema/pattern/v0.3.5.xsd
+++ b/src/libs/ifc/schema/pattern/v0.3.5.xsd
@@ -378,8 +378,8 @@
-
-
+
+
diff --git a/src/libs/vpatterndb/vgrainlinegeometry.cpp b/src/libs/vpatterndb/vgrainlinegeometry.cpp
index 4f64d6158..fb519bf84 100644
--- a/src/libs/vpatterndb/vgrainlinegeometry.cpp
+++ b/src/libs/vpatterndb/vgrainlinegeometry.cpp
@@ -33,7 +33,7 @@
//---------------------------------------------------------------------------------------------------------------------
VGrainlineGeometry::VGrainlineGeometry()
- :m_ptPos(0, 0), m_dLength(0), m_dRotation(0), m_bVisible(true)
+ :m_ptPos(0, 0), m_qsLength(), m_qsRotation(), m_bVisible(true)
{}
//---------------------------------------------------------------------------------------------------------------------
@@ -57,30 +57,30 @@ void VGrainlineGeometry::SetPos(const QPointF &ptPos)
//---------------------------------------------------------------------------------------------------------------------
-qreal VGrainlineGeometry::GetLength() const
+QString VGrainlineGeometry::GetLength() const
{
- return m_dLength;
+ return m_qsLength;
}
//---------------------------------------------------------------------------------------------------------------------
-void VGrainlineGeometry::SetLength(qreal dLen)
+void VGrainlineGeometry::SetLength(QString qsLen)
{
- m_dLength = dLen;
+ m_qsLength = qsLen;
}
//---------------------------------------------------------------------------------------------------------------------
-qreal VGrainlineGeometry::GetRotation() const
+QString VGrainlineGeometry::GetRotation() const
{
- return m_dRotation;
+ return m_qsRotation;
}
//---------------------------------------------------------------------------------------------------------------------
-void VGrainlineGeometry::SetRotation(qreal dRot)
+void VGrainlineGeometry::SetRotation(QString qsRot)
{
- m_dRotation = dRot;
+ m_qsRotation = qsRot;
}
//---------------------------------------------------------------------------------------------------------------------
diff --git a/src/libs/vpatterndb/vgrainlinegeometry.h b/src/libs/vpatterndb/vgrainlinegeometry.h
index ae7fad4b6..d4a2f8fff 100644
--- a/src/libs/vpatterndb/vgrainlinegeometry.h
+++ b/src/libs/vpatterndb/vgrainlinegeometry.h
@@ -30,6 +30,7 @@
#define VGRAINLINEGEOMETRY_H
#include
+#include
class QPointF;
@@ -46,10 +47,10 @@ public:
// methods, which set and return values of different parameters
QPointF GetPos() const;
void SetPos(const QPointF& ptPos);
- qreal GetLength() const;
- void SetLength(qreal dLen);
- qreal GetRotation() const;
- void SetRotation(qreal dRot);
+ QString GetLength() const;
+ void SetLength(QString qsLen);
+ QString GetRotation() const;
+ void SetRotation(QString qsRot);
bool IsVisible() const;
void SetVisible(bool bVisible);
@@ -59,13 +60,13 @@ private:
*/
QPointF m_ptPos;
/**
- * @brief m_dLength total length of grainline
+ * @brief m_dLength formula to calculate the length of grainline
*/
- qreal m_dLength;
+ QString m_qsLength;
/**
- * @brief m_dRotation rotation of grainline in [degrees]
+ * @brief m_dRotation formula to calculate the rotation of grainline in [degrees]
*/
- qreal m_dRotation;
+ QString m_qsRotation;
/**
* @brief m_bVisible visibility flag
*/
diff --git a/src/libs/vtools/dialogs/tools/dialogdetail.cpp b/src/libs/vtools/dialogs/tools/dialogdetail.cpp
index 8334eae68..f61898ee3 100644
--- a/src/libs/vtools/dialogs/tools/dialogdetail.cpp
+++ b/src/libs/vtools/dialogs/tools/dialogdetail.cpp
@@ -469,7 +469,8 @@ VDetail DialogDetail::CreateDetail() const
detail.GetGrainlineGeometry().SetVisible(ui.checkBoxGrainline->isChecked());
if (ui.checkBoxGrainline->isChecked() == true)
{
- detail.GetGrainlineGeometry().SetRotation(ui.spinBoxGrainlineRotation->value());
+ detail.GetGrainlineGeometry().SetRotation(ui.lineEditRotFormula->text());
+ detail.GetGrainlineGeometry().SetLength(ui.lineEditLenFormula->text());
}
return detail;
}
@@ -542,7 +543,8 @@ void DialogDetail::setDetail(const VDetail &value)
UpdateList();
ui.checkBoxGrainline->setChecked(detail.GetGrainlineGeometry().IsVisible());
- ui.spinBoxGrainlineRotation->setValue(detail.GetGrainlineGeometry().GetRotation());
+ ui.lineEditRotFormula->setText(detail.GetGrainlineGeometry().GetRotation());
+ ui.lineEditLenFormula->setText(detail.GetGrainlineGeometry().GetLength());
m_oldData = detail.GetPatternPieceData();
m_oldGeom = detail.GetPatternInfo();
@@ -865,5 +867,10 @@ void DialogDetail::SetEditMode()
//---------------------------------------------------------------------------------------------------------------------
void DialogDetail::EnableGrainlineRotation()
{
- ui.spinBoxGrainlineRotation->setEnabled(ui.checkBoxGrainline->isChecked());
+ ui.lineEditRotValue->setEnabled(ui.checkBoxGrainline->isChecked());
+ ui.lineEditRotFormula->setEnabled(ui.checkBoxGrainline->isChecked());
+ ui.lineEditLenValue->setEnabled(ui.checkBoxGrainline->isChecked());
+ ui.lineEditLenFormula->setEnabled(ui.checkBoxGrainline->isChecked());
+ ui.pushButtonRot->setEnabled(ui.checkBoxGrainline->isChecked());
+ ui.pushButtonLen->setEnabled(ui.checkBoxGrainline->isChecked());
}
diff --git a/src/libs/vtools/dialogs/tools/dialogdetail.ui b/src/libs/vtools/dialogs/tools/dialogdetail.ui
index ef40167f3..6a5125508 100644
--- a/src/libs/vtools/dialogs/tools/dialogdetail.ui
+++ b/src/libs/vtools/dialogs/tools/dialogdetail.ui
@@ -540,28 +540,11 @@
10
10
- 291
- 62
+ 361
+ 201
-
- -
-
-
- Rotation:
-
-
-
- -
-
-
- °
-
-
- 359
-
-
-
+
-
@@ -569,6 +552,132 @@
+ -
+
+
+
+ Liberation Sans
+ 10
+ 75
+ true
+
+
+
+ Length
+
+
+
+ -
+
+
+
+
+
+
+ -
+
+
+ Value
+
+
+
+ -
+
+
+ Value
+
+
+
+ -
+
+
+
+ Liberation Sans
+ 10
+ 75
+ true
+
+
+
+ Rotation
+
+
+
+ -
+
+
+ Formula
+
+
+
+ -
+
+
+
+
+
+
+ -
+
+
+ Formula
+
+
+
+ -
+
+
+
+ 0
+ 0
+
+
+
+ f(x)
+
+
+
+ -
+
+
+
+ 0
+ 0
+
+
+
+ f(x)
+
+
+
+ -
+
+
+ true
+
+
+
+ -
+
+
+ true
+
+
+
+ -
+
+
+ true
+
+
+
+ -
+
+
+ true
+
+
+
@@ -604,13 +713,11 @@
checkBoxSeams
doubleSpinBoxSeams
toolButtonDown
- tabWidget
checkBoxForbidFlipping
checkBoxDetail
checkBoxPattern
lineEditLetter
checkBoxGrainline
- spinBoxGrainlineRotation