Refactoring. Rename class VGrainlineGeometry to VGrainlineData.
--HG-- branch : feature
This commit is contained in:
parent
4e3ee3eefd
commit
a287913500
|
@ -39,7 +39,7 @@
|
||||||
#include "../vlayout/vposter.h"
|
#include "../vlayout/vposter.h"
|
||||||
#include "../vpatterndb/vpiecelabeldata.h"
|
#include "../vpatterndb/vpiecelabeldata.h"
|
||||||
#include "../vpatterndb/vpatternlabeldata.h"
|
#include "../vpatterndb/vpatternlabeldata.h"
|
||||||
#include "../vpatterndb/vgrainlinegeometry.h"
|
#include "../vpatterndb/vgrainlinedata.h"
|
||||||
#include "../vtools/tools/vabstracttool.h"
|
#include "../vtools/tools/vabstracttool.h"
|
||||||
|
|
||||||
#include <QFileDialog>
|
#include <QFileDialog>
|
||||||
|
|
|
@ -53,7 +53,7 @@
|
||||||
#include "../vpatterndb/calculator.h"
|
#include "../vpatterndb/calculator.h"
|
||||||
#include "../vpatterndb/vpiecelabeldata.h"
|
#include "../vpatterndb/vpiecelabeldata.h"
|
||||||
#include "../vpatterndb/vpatternlabeldata.h"
|
#include "../vpatterndb/vpatternlabeldata.h"
|
||||||
#include "../vpatterndb/vgrainlinegeometry.h"
|
#include "../vpatterndb/vgrainlinedata.h"
|
||||||
#include "../vpatterndb/vpiecepath.h"
|
#include "../vpatterndb/vpiecepath.h"
|
||||||
#include "../vpatterndb/vnodedetail.h"
|
#include "../vpatterndb/vnodedetail.h"
|
||||||
|
|
||||||
|
@ -874,8 +874,8 @@ void VPattern::ParsePieceGrainline(const QDomElement &domElement, VPiece &detail
|
||||||
detail.GetGrainlineGeometry().SetLength(qsLength);
|
detail.GetGrainlineGeometry().SetLength(qsLength);
|
||||||
QString qsRot = GetParametrString(domElement, AttrRotation, "90");
|
QString qsRot = GetParametrString(domElement, AttrRotation, "90");
|
||||||
detail.GetGrainlineGeometry().SetRotation(qsRot);
|
detail.GetGrainlineGeometry().SetRotation(qsRot);
|
||||||
VGrainlineGeometry::ArrowType eAT =
|
VGrainlineData::ArrowType eAT =
|
||||||
VGrainlineGeometry::ArrowType(GetParametrUInt(domElement, AttrArrows, "0"));
|
VGrainlineData::ArrowType(GetParametrUInt(domElement, AttrArrows, "0"));
|
||||||
detail.GetGrainlineGeometry().SetArrowType(eAT);
|
detail.GetGrainlineGeometry().SetArrowType(eAT);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -117,7 +117,7 @@ VLayoutPiece VLayoutPiece::Create(const VPiece &piece, const VContainer *pattern
|
||||||
VAbstractPattern* pDoc = qApp->getCurrentDocument();
|
VAbstractPattern* pDoc = qApp->getCurrentDocument();
|
||||||
det.SetPatternInfo(pDoc, geom, qApp->font(), pattern->size(), pattern->height());
|
det.SetPatternInfo(pDoc, geom, qApp->font(), pattern->size(), pattern->height());
|
||||||
}
|
}
|
||||||
const VGrainlineGeometry& grainlineGeom = piece.GetGrainlineGeometry();
|
const VGrainlineData& grainlineGeom = piece.GetGrainlineGeometry();
|
||||||
if (grainlineGeom.IsVisible() == true)
|
if (grainlineGeom.IsVisible() == true)
|
||||||
{
|
{
|
||||||
det.SetGrainline(grainlineGeom, *pattern);
|
det.SetGrainline(grainlineGeom, *pattern);
|
||||||
|
@ -230,7 +230,7 @@ void VLayoutPiece::SetPatternInfo(const VAbstractPattern* pDoc, const VPatternLa
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VLayoutPiece::SetGrainline(const VGrainlineGeometry& geom, const VContainer& rPattern)
|
void VLayoutPiece::SetGrainline(const VGrainlineData& geom, const VContainer& rPattern)
|
||||||
{
|
{
|
||||||
d->grainlineGeom = geom;
|
d->grainlineGeom = geom;
|
||||||
qreal dAng;
|
qreal dAng;
|
||||||
|
@ -267,7 +267,7 @@ void VLayoutPiece::SetGrainline(const VGrainlineGeometry& geom, const VContainer
|
||||||
|
|
||||||
v << pt1;
|
v << pt1;
|
||||||
|
|
||||||
if (geom.GetArrowType() != VGrainlineGeometry::atRear) {
|
if (geom.GetArrowType() != VGrainlineData::atRear) {
|
||||||
pt.setX(pt1.x() + dArrowLen * qCos(dAng + dArrowAng));
|
pt.setX(pt1.x() + dArrowLen * qCos(dAng + dArrowAng));
|
||||||
pt.setY(pt1.y() - dArrowLen * qSin(dAng + dArrowAng));
|
pt.setY(pt1.y() - dArrowLen * qSin(dAng + dArrowAng));
|
||||||
v << pt;
|
v << pt;
|
||||||
|
@ -280,7 +280,7 @@ void VLayoutPiece::SetGrainline(const VGrainlineGeometry& geom, const VContainer
|
||||||
|
|
||||||
v << pt2;
|
v << pt2;
|
||||||
|
|
||||||
if (geom.GetArrowType() != VGrainlineGeometry::atFront)
|
if (geom.GetArrowType() != VGrainlineData::atFront)
|
||||||
{
|
{
|
||||||
dAng += M_PI;
|
dAng += M_PI;
|
||||||
|
|
||||||
|
|
|
@ -78,7 +78,7 @@ public:
|
||||||
void SetPatternInfo(const VAbstractPattern* pDoc, const VPatternLabelData& geom, const QFont& font,
|
void SetPatternInfo(const VAbstractPattern* pDoc, const VPatternLabelData& geom, const QFont& font,
|
||||||
qreal dSize, qreal dHeight);
|
qreal dSize, qreal dHeight);
|
||||||
|
|
||||||
void SetGrainline(const VGrainlineGeometry& geom, const VContainer& rPattern);
|
void SetGrainline(const VGrainlineData& geom, const VContainer& rPattern);
|
||||||
|
|
||||||
QTransform GetMatrix() const;
|
QTransform GetMatrix() const;
|
||||||
void SetMatrix(const QTransform &matrix);
|
void SetMatrix(const QTransform &matrix);
|
||||||
|
|
|
@ -36,7 +36,7 @@
|
||||||
|
|
||||||
#include "../vpatterndb/vpiecelabeldata.h"
|
#include "../vpatterndb/vpiecelabeldata.h"
|
||||||
#include "../vpatterndb/vpatternlabeldata.h"
|
#include "../vpatterndb/vpatternlabeldata.h"
|
||||||
#include "../vpatterndb/vgrainlinegeometry.h"
|
#include "../vpatterndb/vgrainlinedata.h"
|
||||||
#include "../vmisc/diagnostic.h"
|
#include "../vmisc/diagnostic.h"
|
||||||
#include "vlayoutpiecepath.h"
|
#include "vlayoutpiecepath.h"
|
||||||
|
|
||||||
|
@ -120,7 +120,7 @@ public:
|
||||||
/** @brief patternGeom pattern geometry */
|
/** @brief patternGeom pattern geometry */
|
||||||
VPatternLabelData patternGeom;
|
VPatternLabelData patternGeom;
|
||||||
/** @brief grainlineGeom grainline geometry */
|
/** @brief grainlineGeom grainline geometry */
|
||||||
VGrainlineGeometry grainlineGeom;
|
VGrainlineData grainlineGeom;
|
||||||
/** @brief m_tmDetail text manager for laying out detail info */
|
/** @brief m_tmDetail text manager for laying out detail info */
|
||||||
VTextManager m_tmDetail;
|
VTextManager m_tmDetail;
|
||||||
/** @brief m_tmPattern text manager for laying out pattern info */
|
/** @brief m_tmPattern text manager for laying out pattern info */
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
**
|
**
|
||||||
** @file vgrainlinegeometry.cpp
|
** @file vgrainlinedata.cpp
|
||||||
** @author Bojan Kverh
|
** @author Bojan Kverh
|
||||||
** @date September 06, 2016
|
** @date September 06, 2016
|
||||||
**
|
**
|
||||||
|
@ -28,80 +28,80 @@
|
||||||
|
|
||||||
#include <QPointF>
|
#include <QPointF>
|
||||||
|
|
||||||
#include "vgrainlinegeometry.h"
|
#include "vgrainlinedata.h"
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
VGrainlineGeometry::VGrainlineGeometry()
|
VGrainlineData::VGrainlineData()
|
||||||
:m_ptPos(0, 0), m_qsLength(), m_qsRotation(), m_bVisible(false), m_eArrowType(atBoth)
|
:m_ptPos(0, 0), m_qsLength(), m_qsRotation(), m_bVisible(false), m_eArrowType(atBoth)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
QPointF VGrainlineGeometry::GetPos() const
|
QPointF VGrainlineData::GetPos() const
|
||||||
{
|
{
|
||||||
return m_ptPos;
|
return m_ptPos;
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
void VGrainlineGeometry::SetPos(const QPointF &ptPos)
|
void VGrainlineData::SetPos(const QPointF &ptPos)
|
||||||
{
|
{
|
||||||
m_ptPos = ptPos;
|
m_ptPos = ptPos;
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
QString VGrainlineGeometry::GetLength() const
|
QString VGrainlineData::GetLength() const
|
||||||
{
|
{
|
||||||
return m_qsLength;
|
return m_qsLength;
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
void VGrainlineGeometry::SetLength(const QString& qsLen)
|
void VGrainlineData::SetLength(const QString& qsLen)
|
||||||
{
|
{
|
||||||
m_qsLength = qsLen;
|
m_qsLength = qsLen;
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
QString VGrainlineGeometry::GetRotation() const
|
QString VGrainlineData::GetRotation() const
|
||||||
{
|
{
|
||||||
return m_qsRotation;
|
return m_qsRotation;
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
void VGrainlineGeometry::SetRotation(const QString& qsRot)
|
void VGrainlineData::SetRotation(const QString& qsRot)
|
||||||
{
|
{
|
||||||
m_qsRotation = qsRot;
|
m_qsRotation = qsRot;
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
bool VGrainlineGeometry::IsVisible() const
|
bool VGrainlineData::IsVisible() const
|
||||||
{
|
{
|
||||||
return m_bVisible;
|
return m_bVisible;
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
void VGrainlineGeometry::SetVisible(bool bVisible)
|
void VGrainlineData::SetVisible(bool bVisible)
|
||||||
{
|
{
|
||||||
m_bVisible = bVisible;
|
m_bVisible = bVisible;
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
VGrainlineGeometry::ArrowType VGrainlineGeometry::GetArrowType() const
|
VGrainlineData::ArrowType VGrainlineData::GetArrowType() const
|
||||||
{
|
{
|
||||||
return m_eArrowType;
|
return m_eArrowType;
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
void VGrainlineGeometry::SetArrowType(ArrowType eAT)
|
void VGrainlineData::SetArrowType(ArrowType eAT)
|
||||||
{
|
{
|
||||||
m_eArrowType = eAT;
|
m_eArrowType = eAT;
|
||||||
}
|
}
|
|
@ -1,6 +1,6 @@
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
**
|
**
|
||||||
** @file vgrainlinegeometry.h
|
** @file vgrainlinedata.h
|
||||||
** @author Bojan Kverh
|
** @author Bojan Kverh
|
||||||
** @date September 06, 2016
|
** @date September 06, 2016
|
||||||
**
|
**
|
||||||
|
@ -31,12 +31,13 @@
|
||||||
|
|
||||||
#include <QtGlobal>
|
#include <QtGlobal>
|
||||||
#include <QString>
|
#include <QString>
|
||||||
|
#include <QPointF>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief The VGrainlineGeometry class holds information about a grainline like
|
* @brief The VGrainlineData class holds information about a grainline like
|
||||||
* position, size, rotation and visibility
|
* position, size, rotation and visibility
|
||||||
*/
|
*/
|
||||||
class VGrainlineGeometry
|
class VGrainlineData
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
// denotes the type of arrow for the grainline
|
// denotes the type of arrow for the grainline
|
||||||
|
@ -47,7 +48,7 @@ public:
|
||||||
atRear
|
atRear
|
||||||
};
|
};
|
||||||
|
|
||||||
VGrainlineGeometry();
|
VGrainlineData();
|
||||||
|
|
||||||
// methods, which set and return values of different parameters
|
// methods, which set and return values of different parameters
|
||||||
QPointF GetPos() const;
|
QPointF GetPos() const;
|
|
@ -17,14 +17,14 @@ SOURCES += \
|
||||||
$$PWD/variables/vmeasurement.cpp \
|
$$PWD/variables/vmeasurement.cpp \
|
||||||
$$PWD/variables/vvariable.cpp \
|
$$PWD/variables/vvariable.cpp \
|
||||||
$$PWD/vformula.cpp \
|
$$PWD/vformula.cpp \
|
||||||
$$PWD/vgrainlinegeometry.cpp \
|
|
||||||
$$PWD/variables/vcurveclength.cpp \
|
$$PWD/variables/vcurveclength.cpp \
|
||||||
$$PWD/variables/vellipticalarcradius.cpp \
|
$$PWD/variables/vellipticalarcradius.cpp \
|
||||||
$$PWD/vpiece.cpp \
|
$$PWD/vpiece.cpp \
|
||||||
$$PWD/vpiecenode.cpp \
|
$$PWD/vpiecenode.cpp \
|
||||||
$$PWD/vpiecepath.cpp \
|
$$PWD/vpiecepath.cpp \
|
||||||
$$PWD/vpiecelabeldata.cpp \
|
$$PWD/vpiecelabeldata.cpp \
|
||||||
$$PWD/vpatternlabeldata.cpp
|
$$PWD/vpatternlabeldata.cpp \
|
||||||
|
$$PWD/vgrainlinedata.cpp
|
||||||
|
|
||||||
win32-msvc*:SOURCES += $$PWD/stable.cpp
|
win32-msvc*:SOURCES += $$PWD/stable.cpp
|
||||||
|
|
||||||
|
@ -55,7 +55,6 @@ HEADERS += \
|
||||||
$$PWD/variables/vvariable.h \
|
$$PWD/variables/vvariable.h \
|
||||||
$$PWD/variables/vvariable_p.h \
|
$$PWD/variables/vvariable_p.h \
|
||||||
$$PWD/vformula.h \
|
$$PWD/vformula.h \
|
||||||
$$PWD/vgrainlinegeometry.h \
|
|
||||||
$$PWD/variables/vcurveclength.h \
|
$$PWD/variables/vcurveclength.h \
|
||||||
$$PWD/variables/vellipticalarcradius.h \
|
$$PWD/variables/vellipticalarcradius.h \
|
||||||
$$PWD/vpiece.h \
|
$$PWD/vpiece.h \
|
||||||
|
@ -65,4 +64,5 @@ HEADERS += \
|
||||||
$$PWD/vpiecepath.h \
|
$$PWD/vpiecepath.h \
|
||||||
$$PWD/vpiecepath_p.h \
|
$$PWD/vpiecepath_p.h \
|
||||||
$$PWD/vpiecelabeldata.h \
|
$$PWD/vpiecelabeldata.h \
|
||||||
$$PWD/vpatternlabeldata.h
|
$$PWD/vpatternlabeldata.h \
|
||||||
|
$$PWD/vgrainlinedata.h
|
||||||
|
|
|
@ -469,7 +469,7 @@ const VPatternLabelData &VPiece::GetPatternInfo() const
|
||||||
* @brief VDetail::GetGrainlineGeometry full access to the grainline geometry object
|
* @brief VDetail::GetGrainlineGeometry full access to the grainline geometry object
|
||||||
* @return reference to grainline geometry object
|
* @return reference to grainline geometry object
|
||||||
*/
|
*/
|
||||||
VGrainlineGeometry &VPiece::GetGrainlineGeometry()
|
VGrainlineData &VPiece::GetGrainlineGeometry()
|
||||||
{
|
{
|
||||||
return d->m_glGrainline;
|
return d->m_glGrainline;
|
||||||
}
|
}
|
||||||
|
@ -479,7 +479,7 @@ VGrainlineGeometry &VPiece::GetGrainlineGeometry()
|
||||||
* @brief VDetail::GetGrainlineGeometry returns the read-only reference to the grainline geometry object
|
* @brief VDetail::GetGrainlineGeometry returns the read-only reference to the grainline geometry object
|
||||||
* @return reference to grainline geometry object
|
* @return reference to grainline geometry object
|
||||||
*/
|
*/
|
||||||
const VGrainlineGeometry &VPiece::GetGrainlineGeometry() const
|
const VGrainlineData &VPiece::GetGrainlineGeometry() const
|
||||||
{
|
{
|
||||||
return d->m_glGrainline;
|
return d->m_glGrainline;
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,7 +41,7 @@ template <class T>class QSharedPointer;
|
||||||
class VPiecePath;
|
class VPiecePath;
|
||||||
class VPatternLabelData;
|
class VPatternLabelData;
|
||||||
class VPieceLabelData;
|
class VPieceLabelData;
|
||||||
class VGrainlineGeometry;
|
class VGrainlineData;
|
||||||
class VContainer;
|
class VContainer;
|
||||||
class QPainterPath;
|
class QPainterPath;
|
||||||
class VPointF;
|
class VPointF;
|
||||||
|
@ -105,8 +105,8 @@ public:
|
||||||
VPatternLabelData& GetPatternInfo();
|
VPatternLabelData& GetPatternInfo();
|
||||||
const VPatternLabelData& GetPatternInfo() const;
|
const VPatternLabelData& GetPatternInfo() const;
|
||||||
|
|
||||||
VGrainlineGeometry& GetGrainlineGeometry();
|
VGrainlineData& GetGrainlineGeometry();
|
||||||
const VGrainlineGeometry& GetGrainlineGeometry() const;
|
const VGrainlineData& GetGrainlineGeometry() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QSharedDataPointer<VPieceData> d;
|
QSharedDataPointer<VPieceData> d;
|
||||||
|
|
|
@ -38,7 +38,7 @@
|
||||||
#include "vpiecepath.h"
|
#include "vpiecepath.h"
|
||||||
#include "vpiecelabeldata.h"
|
#include "vpiecelabeldata.h"
|
||||||
#include "vpatternlabeldata.h"
|
#include "vpatternlabeldata.h"
|
||||||
#include "vgrainlinegeometry.h"
|
#include "vgrainlinedata.h"
|
||||||
|
|
||||||
QT_WARNING_PUSH
|
QT_WARNING_PUSH
|
||||||
QT_WARNING_DISABLE_GCC("-Weffc++")
|
QT_WARNING_DISABLE_GCC("-Weffc++")
|
||||||
|
@ -99,7 +99,7 @@ public:
|
||||||
VPatternLabelData m_piPatternInfo;
|
VPatternLabelData m_piPatternInfo;
|
||||||
|
|
||||||
/** @brief m_glGrainline grainline geometry object*/
|
/** @brief m_glGrainline grainline geometry object*/
|
||||||
VGrainlineGeometry m_glGrainline;
|
VGrainlineData m_glGrainline;
|
||||||
|
|
||||||
QString m_formulaWidth;
|
QString m_formulaWidth;
|
||||||
|
|
||||||
|
|
|
@ -1307,7 +1307,7 @@ VPiece DialogSeamAllowance::CreatePiece() const
|
||||||
piece.GetGrainlineGeometry().SetVisible(ui->checkBoxGrainline->isChecked());
|
piece.GetGrainlineGeometry().SetVisible(ui->checkBoxGrainline->isChecked());
|
||||||
piece.GetGrainlineGeometry().SetRotation(GetFormulaFromUser(ui->lineEditRotFormula));
|
piece.GetGrainlineGeometry().SetRotation(GetFormulaFromUser(ui->lineEditRotFormula));
|
||||||
piece.GetGrainlineGeometry().SetLength(GetFormulaFromUser(ui->lineEditLenFormula));
|
piece.GetGrainlineGeometry().SetLength(GetFormulaFromUser(ui->lineEditLenFormula));
|
||||||
piece.GetGrainlineGeometry().SetArrowType(VGrainlineGeometry::ArrowType(ui->comboBoxArrow->currentIndex()));
|
piece.GetGrainlineGeometry().SetArrowType(VGrainlineData::ArrowType(ui->comboBoxArrow->currentIndex()));
|
||||||
|
|
||||||
return piece;
|
return piece;
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,7 +33,7 @@
|
||||||
#include "../vpatterndb/vpiece.h"
|
#include "../vpatterndb/vpiece.h"
|
||||||
#include "../vpatterndb/vpatternlabeldata.h"
|
#include "../vpatterndb/vpatternlabeldata.h"
|
||||||
#include "../vpatterndb/vpiecelabeldata.h"
|
#include "../vpatterndb/vpiecelabeldata.h"
|
||||||
#include "../vpatterndb/vgrainlinegeometry.h"
|
#include "../vpatterndb/vgrainlinedata.h"
|
||||||
|
|
||||||
namespace Ui
|
namespace Ui
|
||||||
{
|
{
|
||||||
|
@ -138,7 +138,7 @@ private:
|
||||||
|
|
||||||
VPieceLabelData m_oldData;
|
VPieceLabelData m_oldData;
|
||||||
VPatternLabelData m_oldGeom;
|
VPatternLabelData m_oldGeom;
|
||||||
VGrainlineGeometry m_oldGrainline;
|
VGrainlineData m_oldGrainline;
|
||||||
int m_iRotBaseHeight;
|
int m_iRotBaseHeight;
|
||||||
int m_iLenBaseHeight;
|
int m_iLenBaseHeight;
|
||||||
int m_formulaBaseWidth;
|
int m_formulaBaseWidth;
|
||||||
|
|
|
@ -288,7 +288,7 @@ void VToolSeamAllowance::AddGrainline(VAbstractPattern *doc, QDomElement &domEle
|
||||||
{
|
{
|
||||||
// grainline
|
// grainline
|
||||||
QDomElement domData = doc->createElement(VAbstractPattern::TagGrainline);
|
QDomElement domData = doc->createElement(VAbstractPattern::TagGrainline);
|
||||||
const VGrainlineGeometry& glGeom = piece.GetGrainlineGeometry();
|
const VGrainlineData& glGeom = piece.GetGrainlineGeometry();
|
||||||
doc->SetAttribute(domData, VAbstractPattern::AttrVisible, glGeom.IsVisible() == true ? trueStr : falseStr);
|
doc->SetAttribute(domData, VAbstractPattern::AttrVisible, glGeom.IsVisible() == true ? trueStr : falseStr);
|
||||||
doc->SetAttribute(domData, AttrMx, glGeom.GetPos().x());
|
doc->SetAttribute(domData, AttrMx, glGeom.GetPos().x());
|
||||||
doc->SetAttribute(domData, AttrMy, glGeom.GetPos().y());
|
doc->SetAttribute(domData, AttrMy, glGeom.GetPos().y());
|
||||||
|
@ -506,7 +506,7 @@ void VToolSeamAllowance::UpdatePatternInfo()
|
||||||
void VToolSeamAllowance::UpdateGrainline()
|
void VToolSeamAllowance::UpdateGrainline()
|
||||||
{
|
{
|
||||||
const VPiece detail = VAbstractTool::data.GetPiece(id);
|
const VPiece detail = VAbstractTool::data.GetPiece(id);
|
||||||
const VGrainlineGeometry& geom = detail.GetGrainlineGeometry();
|
const VGrainlineData& geom = detail.GetGrainlineGeometry();
|
||||||
|
|
||||||
if (geom.IsVisible() == true)
|
if (geom.IsVisible() == true)
|
||||||
{
|
{
|
||||||
|
|
|
@ -40,7 +40,7 @@
|
||||||
#include "../vpatterndb/vpiecenode.h"
|
#include "../vpatterndb/vpiecenode.h"
|
||||||
#include "../vpatterndb/vpatternlabeldata.h"
|
#include "../vpatterndb/vpatternlabeldata.h"
|
||||||
#include "../vpatterndb/vpiecelabeldata.h"
|
#include "../vpatterndb/vpiecelabeldata.h"
|
||||||
#include "../vpatterndb/vgrainlinegeometry.h"
|
#include "../vpatterndb/vgrainlinedata.h"
|
||||||
#include "../tools/vtoolseamallowance.h"
|
#include "../tools/vtoolseamallowance.h"
|
||||||
#include "vundocommand.h"
|
#include "vundocommand.h"
|
||||||
|
|
||||||
|
|
|
@ -65,7 +65,7 @@ VGrainlineItem::VGrainlineItem(QGraphicsItem* pParent)
|
||||||
m_ptFinish(),
|
m_ptFinish(),
|
||||||
m_ptCenter(),
|
m_ptCenter(),
|
||||||
m_dAngle(0),
|
m_dAngle(0),
|
||||||
m_eArrowType(VGrainlineGeometry::atBoth)
|
m_eArrowType(VGrainlineData::atBoth)
|
||||||
{
|
{
|
||||||
m_inactiveZ = 5;
|
m_inactiveZ = 5;
|
||||||
Reset();
|
Reset();
|
||||||
|
@ -107,7 +107,7 @@ void VGrainlineItem::paint(QPainter* pP, const QStyleOptionGraphicsItem* pOption
|
||||||
QPolygonF poly;
|
QPolygonF poly;
|
||||||
QPointF ptA;
|
QPointF ptA;
|
||||||
qreal dArrLen = ARROW_LENGTH*m_dScale;
|
qreal dArrLen = ARROW_LENGTH*m_dScale;
|
||||||
if (m_eArrowType != VGrainlineGeometry::atRear)
|
if (m_eArrowType != VGrainlineData::atRear)
|
||||||
{
|
{
|
||||||
// first arrow
|
// first arrow
|
||||||
poly << pt1;
|
poly << pt1;
|
||||||
|
@ -119,7 +119,7 @@ void VGrainlineItem::paint(QPainter* pP, const QStyleOptionGraphicsItem* pOption
|
||||||
poly << ptA;
|
poly << ptA;
|
||||||
pP->drawPolygon(poly);
|
pP->drawPolygon(poly);
|
||||||
}
|
}
|
||||||
if (m_eArrowType != VGrainlineGeometry::atFront)
|
if (m_eArrowType != VGrainlineData::atFront)
|
||||||
{
|
{
|
||||||
// second arrow
|
// second arrow
|
||||||
poly.clear();
|
poly.clear();
|
||||||
|
@ -188,7 +188,7 @@ void VGrainlineItem::paint(QPainter* pP, const QStyleOptionGraphicsItem* pOption
|
||||||
* @param dLength length of the grainline in user's units
|
* @param dLength length of the grainline in user's units
|
||||||
*/
|
*/
|
||||||
void VGrainlineItem::UpdateGeometry(const QPointF& ptPos, qreal dRotation, qreal dLength,
|
void VGrainlineItem::UpdateGeometry(const QPointF& ptPos, qreal dRotation, qreal dLength,
|
||||||
VGrainlineGeometry::ArrowType eAT)
|
VGrainlineData::ArrowType eAT)
|
||||||
{
|
{
|
||||||
m_dRotation = qDegreesToRadians(dRotation);
|
m_dRotation = qDegreesToRadians(dRotation);
|
||||||
m_dLength = dLength;
|
m_dLength = dLength;
|
||||||
|
|
|
@ -30,7 +30,7 @@
|
||||||
#define VGRAINLINEITEM_H
|
#define VGRAINLINEITEM_H
|
||||||
|
|
||||||
#include "vpieceitem.h"
|
#include "vpieceitem.h"
|
||||||
#include "../vpatterndb/vgrainlinegeometry.h"
|
#include "../vpatterndb/vgrainlinedata.h"
|
||||||
|
|
||||||
class VGrainlineItem : public VPieceItem
|
class VGrainlineItem : public VPieceItem
|
||||||
{
|
{
|
||||||
|
@ -41,7 +41,7 @@ public:
|
||||||
|
|
||||||
virtual void paint(QPainter* pP, const QStyleOptionGraphicsItem* pOption, QWidget* pWidget) Q_DECL_OVERRIDE;
|
virtual void paint(QPainter* pP, const QStyleOptionGraphicsItem* pOption, QWidget* pWidget) Q_DECL_OVERRIDE;
|
||||||
void UpdateGeometry(const QPointF& ptPos, qreal dRotation, qreal dLength,
|
void UpdateGeometry(const QPointF& ptPos, qreal dRotation, qreal dLength,
|
||||||
VGrainlineGeometry::ArrowType eAT);
|
VGrainlineData::ArrowType eAT);
|
||||||
|
|
||||||
bool IsContained(const QPointF &pt, qreal dRot, qreal &dX, qreal &dY) const;
|
bool IsContained(const QPointF &pt, qreal dRot, qreal &dX, qreal &dY) const;
|
||||||
void SetScale(qreal dScale);
|
void SetScale(qreal dScale);
|
||||||
|
@ -75,7 +75,7 @@ private:
|
||||||
QPointF m_ptFinish;
|
QPointF m_ptFinish;
|
||||||
QPointF m_ptCenter;
|
QPointF m_ptCenter;
|
||||||
qreal m_dAngle;
|
qreal m_dAngle;
|
||||||
VGrainlineGeometry::ArrowType m_eArrowType;
|
VGrainlineData::ArrowType m_eArrowType;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // VGRAINLINEITEM_H
|
#endif // VGRAINLINEITEM_H
|
||||||
|
|
Loading…
Reference in New Issue
Block a user