Prepated detail dialog for formula editing in case of grainline length and rotation
--HG-- branch : feature
This commit is contained in:
parent
385eae034a
commit
2dc19732a0
|
@ -724,17 +724,10 @@ void VPattern::ParseDetailElement(const QDomElement &domElement, const Document
|
||||||
ptPos.setX(GetParametrDouble(element, AttrMx, "0"));
|
ptPos.setX(GetParametrDouble(element, AttrMx, "0"));
|
||||||
ptPos.setY(GetParametrDouble(element, AttrMy, "0"));
|
ptPos.setY(GetParametrDouble(element, AttrMy, "0"));
|
||||||
detail.GetGrainlineGeometry().SetPos(ptPos);
|
detail.GetGrainlineGeometry().SetPos(ptPos);
|
||||||
qreal dLength = GetParametrDouble(element, AttrLength, "0");
|
QString qsLength = GetParametrString(element, AttrLength, "0");
|
||||||
detail.GetGrainlineGeometry().SetLength(dLength);
|
detail.GetGrainlineGeometry().SetLength(qsLength);
|
||||||
if (detail.GetGrainlineGeometry().IsVisible() == true)
|
QString qsRot = GetParametrString(element, VToolDetail::AttrRotation, "0");
|
||||||
{
|
detail.GetGrainlineGeometry().SetRotation(qsRot);
|
||||||
qreal dRot = GetParametrDouble(element, VToolDetail::AttrRotation, "0");
|
|
||||||
detail.GetGrainlineGeometry().SetRotation(dRot);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
detail.GetGrainlineGeometry().SetRotation(0);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -378,8 +378,8 @@
|
||||||
<xs:attribute name="visible" type="xs:boolean"></xs:attribute>
|
<xs:attribute name="visible" type="xs:boolean"></xs:attribute>
|
||||||
<xs:attribute name="mx" type="xs:double"></xs:attribute>
|
<xs:attribute name="mx" type="xs:double"></xs:attribute>
|
||||||
<xs:attribute name="my" type="xs:double"></xs:attribute>
|
<xs:attribute name="my" type="xs:double"></xs:attribute>
|
||||||
<xs:attribute name="length" type="xs:double"></xs:attribute>
|
<xs:attribute name="length" type="xs:string"></xs:attribute>
|
||||||
<xs:attribute name="rotation" type="xs:double"></xs:attribute>
|
<xs:attribute name="rotation" type="xs:string"></xs:attribute>
|
||||||
</xs:complexType>
|
</xs:complexType>
|
||||||
</xs:element>
|
</xs:element>
|
||||||
<xs:element name="node" maxOccurs="unbounded">
|
<xs:element name="node" maxOccurs="unbounded">
|
||||||
|
|
|
@ -33,7 +33,7 @@
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
VGrainlineGeometry::VGrainlineGeometry()
|
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
|
@ -30,6 +30,7 @@
|
||||||
#define VGRAINLINEGEOMETRY_H
|
#define VGRAINLINEGEOMETRY_H
|
||||||
|
|
||||||
#include <QtGlobal>
|
#include <QtGlobal>
|
||||||
|
#include <QString>
|
||||||
|
|
||||||
class QPointF;
|
class QPointF;
|
||||||
|
|
||||||
|
@ -46,10 +47,10 @@ public:
|
||||||
// methods, which set and return values of different parameters
|
// methods, which set and return values of different parameters
|
||||||
QPointF GetPos() const;
|
QPointF GetPos() const;
|
||||||
void SetPos(const QPointF& ptPos);
|
void SetPos(const QPointF& ptPos);
|
||||||
qreal GetLength() const;
|
QString GetLength() const;
|
||||||
void SetLength(qreal dLen);
|
void SetLength(QString qsLen);
|
||||||
qreal GetRotation() const;
|
QString GetRotation() const;
|
||||||
void SetRotation(qreal dRot);
|
void SetRotation(QString qsRot);
|
||||||
bool IsVisible() const;
|
bool IsVisible() const;
|
||||||
void SetVisible(bool bVisible);
|
void SetVisible(bool bVisible);
|
||||||
|
|
||||||
|
@ -59,13 +60,13 @@ private:
|
||||||
*/
|
*/
|
||||||
QPointF m_ptPos;
|
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
|
* @brief m_bVisible visibility flag
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -469,7 +469,8 @@ VDetail DialogDetail::CreateDetail() const
|
||||||
detail.GetGrainlineGeometry().SetVisible(ui.checkBoxGrainline->isChecked());
|
detail.GetGrainlineGeometry().SetVisible(ui.checkBoxGrainline->isChecked());
|
||||||
if (ui.checkBoxGrainline->isChecked() == true)
|
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;
|
return detail;
|
||||||
}
|
}
|
||||||
|
@ -542,7 +543,8 @@ void DialogDetail::setDetail(const VDetail &value)
|
||||||
UpdateList();
|
UpdateList();
|
||||||
|
|
||||||
ui.checkBoxGrainline->setChecked(detail.GetGrainlineGeometry().IsVisible());
|
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_oldData = detail.GetPatternPieceData();
|
||||||
m_oldGeom = detail.GetPatternInfo();
|
m_oldGeom = detail.GetPatternInfo();
|
||||||
|
@ -865,5 +867,10 @@ void DialogDetail::SetEditMode()
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void DialogDetail::EnableGrainlineRotation()
|
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());
|
||||||
}
|
}
|
||||||
|
|
|
@ -540,28 +540,11 @@
|
||||||
<rect>
|
<rect>
|
||||||
<x>10</x>
|
<x>10</x>
|
||||||
<y>10</y>
|
<y>10</y>
|
||||||
<width>291</width>
|
<width>361</width>
|
||||||
<height>62</height>
|
<height>201</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QFormLayout" name="formLayout_2">
|
<layout class="QGridLayout" name="gridLayout" columnstretch="0,1,0" columnminimumwidth="0,0,30">
|
||||||
<item row="1" column="0">
|
|
||||||
<widget class="QLabel" name="label_6">
|
|
||||||
<property name="text">
|
|
||||||
<string>Rotation:</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="1">
|
|
||||||
<widget class="QSpinBox" name="spinBoxGrainlineRotation">
|
|
||||||
<property name="suffix">
|
|
||||||
<string>°</string>
|
|
||||||
</property>
|
|
||||||
<property name="maximum">
|
|
||||||
<number>359</number>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="0" colspan="2">
|
<item row="0" column="0" colspan="2">
|
||||||
<widget class="QCheckBox" name="checkBoxGrainline">
|
<widget class="QCheckBox" name="checkBoxGrainline">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
|
@ -569,6 +552,132 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="4" column="0">
|
||||||
|
<widget class="QLabel" name="label_12">
|
||||||
|
<property name="font">
|
||||||
|
<font>
|
||||||
|
<family>Liberation Sans</family>
|
||||||
|
<pointsize>10</pointsize>
|
||||||
|
<weight>75</weight>
|
||||||
|
<bold>true</bold>
|
||||||
|
</font>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Length</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="4" column="1">
|
||||||
|
<widget class="QLabel" name="labelLen">
|
||||||
|
<property name="text">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="5" column="0">
|
||||||
|
<widget class="QLabel" name="label_15">
|
||||||
|
<property name="text">
|
||||||
|
<string>Value</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="0">
|
||||||
|
<widget class="QLabel" name="label_11">
|
||||||
|
<property name="text">
|
||||||
|
<string>Value</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="0">
|
||||||
|
<widget class="QLabel" name="label_6">
|
||||||
|
<property name="font">
|
||||||
|
<font>
|
||||||
|
<family>Liberation Sans</family>
|
||||||
|
<pointsize>10</pointsize>
|
||||||
|
<weight>75</weight>
|
||||||
|
<bold>true</bold>
|
||||||
|
</font>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Rotation</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="3" column="0">
|
||||||
|
<widget class="QLabel" name="label_13">
|
||||||
|
<property name="text">
|
||||||
|
<string>Formula</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="1">
|
||||||
|
<widget class="QLabel" name="labelRot">
|
||||||
|
<property name="text">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="6" column="0">
|
||||||
|
<widget class="QLabel" name="label_16">
|
||||||
|
<property name="text">
|
||||||
|
<string>Formula</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="2">
|
||||||
|
<widget class="QPushButton" name="pushButtonRot">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Ignored" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>f(x)</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="4" column="2">
|
||||||
|
<widget class="QPushButton" name="pushButtonLen">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Ignored" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>f(x)</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="1">
|
||||||
|
<widget class="QLineEdit" name="lineEditRotValue">
|
||||||
|
<property name="readOnly">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="3" column="1">
|
||||||
|
<widget class="QLineEdit" name="lineEditRotFormula">
|
||||||
|
<property name="clearButtonEnabled">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="5" column="1">
|
||||||
|
<widget class="QLineEdit" name="lineEditLenValue">
|
||||||
|
<property name="readOnly">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="6" column="1">
|
||||||
|
<widget class="QLineEdit" name="lineEditLenFormula">
|
||||||
|
<property name="clearButtonEnabled">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
|
@ -604,13 +713,11 @@
|
||||||
<tabstop>checkBoxSeams</tabstop>
|
<tabstop>checkBoxSeams</tabstop>
|
||||||
<tabstop>doubleSpinBoxSeams</tabstop>
|
<tabstop>doubleSpinBoxSeams</tabstop>
|
||||||
<tabstop>toolButtonDown</tabstop>
|
<tabstop>toolButtonDown</tabstop>
|
||||||
<tabstop>tabWidget</tabstop>
|
|
||||||
<tabstop>checkBoxForbidFlipping</tabstop>
|
<tabstop>checkBoxForbidFlipping</tabstop>
|
||||||
<tabstop>checkBoxDetail</tabstop>
|
<tabstop>checkBoxDetail</tabstop>
|
||||||
<tabstop>checkBoxPattern</tabstop>
|
<tabstop>checkBoxPattern</tabstop>
|
||||||
<tabstop>lineEditLetter</tabstop>
|
<tabstop>lineEditLetter</tabstop>
|
||||||
<tabstop>checkBoxGrainline</tabstop>
|
<tabstop>checkBoxGrainline</tabstop>
|
||||||
<tabstop>spinBoxGrainlineRotation</tabstop>
|
|
||||||
</tabstops>
|
</tabstops>
|
||||||
<resources>
|
<resources>
|
||||||
<include location="../../../vmisc/share/resources/icon.qrc"/>
|
<include location="../../../vmisc/share/resources/icon.qrc"/>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user