Refactoring. Rename class VPatternPieceData to VPieceLabelData.

--HG--
branch : feature
This commit is contained in:
Roman Telezhynskyi 2017-02-23 11:19:27 +02:00
parent e7651c7194
commit 37efefe1ec
18 changed files with 62 additions and 62 deletions

View File

@ -37,7 +37,7 @@
#include "dialogs/dialoglayoutprogress.h"
#include "dialogs/dialogsavelayout.h"
#include "../vlayout/vposter.h"
#include "../vpatterndb/vpatternpiecedata.h"
#include "../vpatterndb/vpiecelabeldata.h"
#include "../vpatterndb/vpatterninfogeometry.h"
#include "../vpatterndb/vgrainlinegeometry.h"
#include "../vtools/tools/vabstracttool.h"

View File

@ -51,7 +51,7 @@
#include "../core/vapplication.h"
#include "../vpatterndb/vpiecenode.h"
#include "../vpatterndb/calculator.h"
#include "../vpatterndb/vpatternpiecedata.h"
#include "../vpatterndb/vpiecelabeldata.h"
#include "../vpatterndb/vpatterninfogeometry.h"
#include "../vpatterndb/vgrainlinegeometry.h"
#include "../vpatterndb/vpiecepath.h"

View File

@ -44,7 +44,7 @@
#include <QtDebug>
#include "../vpatterndb/vpatterninfogeometry.h"
#include "../vpatterndb/vpatternpiecedata.h"
#include "../vpatterndb/vpiecelabeldata.h"
#include "../vmisc/vmath.h"
#include "../vmisc/vabstractapplication.h"
#include "../vpatterndb/calculator.h"
@ -106,7 +106,7 @@ VLayoutPiece VLayoutPiece::Create(const VPiece &piece, const VContainer *pattern
det.SetInternalPaths(ConvertInternalPaths(piece, pattern));
det.SetName(piece.GetName());
const VPatternPieceData& data = piece.GetPatternPieceData();
const VPieceLabelData& data = piece.GetPatternPieceData();
if (data.IsVisible() == true)
{
det.SetDetail(piece.GetName(), data, qApp->font());
@ -175,7 +175,7 @@ QVector<QPointF> VLayoutPiece::GetLayoutAllowancePoints() const
}
//---------------------------------------------------------------------------------------------------------------------
void VLayoutPiece::SetDetail(const QString& qsName, const VPatternPieceData& data, const QFont &font)
void VLayoutPiece::SetDetail(const QString& qsName, const VPieceLabelData& data, const QFont &font)
{
d->detailData = data;
qreal dAng = qDegreesToRadians(data.GetRotation());

View File

@ -43,7 +43,7 @@
#include "../ifc/xml/vabstractpattern.h"
#include "../vpatterndb/vpatterninfogeometry.h"
#include "../vpatterndb/vpatternpiecedata.h"
#include "../vpatterndb/vpiecelabeldata.h"
#include "../vpatterndb/vcontainer.h"
#include "vabstractpiece.h"
@ -73,7 +73,7 @@ public:
QVector<VLayoutPiecePath> GetInternalPaths() const;
void SetInternalPaths(const QVector<VLayoutPiecePath> &internalPaths);
void SetDetail(const QString &qsName, const VPatternPieceData& data, const QFont& font);
void SetDetail(const QString &qsName, const VPieceLabelData& data, const QFont& font);
void SetPatternInfo(const VAbstractPattern* pDoc, const VPatternInfoGeometry& geom, const QFont& font,
qreal dSize, qreal dHeight);

View File

@ -34,7 +34,7 @@
#include <QVector>
#include <QTransform>
#include "../vpatterndb/vpatternpiecedata.h"
#include "../vpatterndb/vpiecelabeldata.h"
#include "../vpatterndb/vpatterninfogeometry.h"
#include "../vpatterndb/vgrainlinegeometry.h"
#include "../vmisc/diagnostic.h"
@ -116,7 +116,7 @@ public:
/** @brief grainlineInfo line */
QVector<QPointF> grainlinePoints;
/** @brief detailData detail data */
VPatternPieceData detailData;
VPieceLabelData detailData;
/** @brief patternGeom pattern geometry */
VPatternInfoGeometry patternGeom;
/** @brief grainlineGeom grainline geometry */

View File

@ -35,7 +35,7 @@
#include <QDebug>
#include "../ifc/xml/vabstractpattern.h"
#include "../vpatterndb/vpatternpiecedata.h"
#include "../vpatterndb/vpiecelabeldata.h"
#include "../vmisc/vabstractapplication.h"
#include "../vmisc/vmath.h"
#include "vtextmanager.h"
@ -238,7 +238,7 @@ void VTextManager::FitFontSize(qreal fW, qreal fH)
* @param qsName detail name
* @param data reference to the detail data
*/
void VTextManager::Update(const QString& qsName, const VPatternPieceData& data)
void VTextManager::Update(const QString& qsName, const VPieceLabelData& data)
{
ClearSourceLines();
TextLine tl;

View File

@ -38,7 +38,7 @@
#include <QtGlobal>
#include <QCoreApplication>
class VPatternPieceData;
class VPieceLabelData;
class VAbstractPattern;
#define MIN_FONT_SIZE 5
@ -85,7 +85,7 @@ public:
int GetSourceLinesCount() const;
const TextLine& GetSourceLine(int i) const;
void Update(const QString& qsName, const VPatternPieceData& data);
void Update(const QString& qsName, const VPieceLabelData& data);
void Update(const VAbstractPattern* pDoc, qreal dSize, qreal dHeight);
private:

View File

@ -17,14 +17,14 @@ SOURCES += \
$$PWD/variables/vmeasurement.cpp \
$$PWD/variables/vvariable.cpp \
$$PWD/vformula.cpp \
$$PWD/vpatternpiecedata.cpp \
$$PWD/vpatterninfogeometry.cpp \
$$PWD/vgrainlinegeometry.cpp \
$$PWD/variables/vcurveclength.cpp \
$$PWD/variables/vellipticalarcradius.cpp \
$$PWD/vpiece.cpp \
$$PWD/vpiecenode.cpp \
$$PWD/vpiecepath.cpp
$$PWD/vpiecepath.cpp \
$$PWD/vpiecelabeldata.cpp
win32-msvc*:SOURCES += $$PWD/stable.cpp
@ -55,7 +55,6 @@ HEADERS += \
$$PWD/variables/vvariable.h \
$$PWD/variables/vvariable_p.h \
$$PWD/vformula.h \
$$PWD/vpatternpiecedata.h \
$$PWD/vpatterninfogeometry.h \
$$PWD/vgrainlinegeometry.h \
$$PWD/variables/vcurveclength.h \
@ -65,4 +64,5 @@ HEADERS += \
$$PWD/vpiecenode.h \
$$PWD/vpiecenode_p.h \
$$PWD/vpiecepath.h \
$$PWD/vpiecepath_p.h
$$PWD/vpiecepath_p.h \
$$PWD/vpiecelabeldata.h

View File

@ -413,7 +413,7 @@ QVector<quint32> VPiece::MissingPins(const VPiece &det) const
}
//---------------------------------------------------------------------------------------------------------------------
void VPiece::SetPatternPieceData(const VPatternPieceData &data)
void VPiece::SetPatternPieceData(const VPieceLabelData &data)
{
d->m_ppData = data;
}
@ -423,7 +423,7 @@ void VPiece::SetPatternPieceData(const VPatternPieceData &data)
* @brief Returns full access to the pattern piece data object
* @return pattern piece data object
*/
VPatternPieceData &VPiece::GetPatternPieceData()
VPieceLabelData &VPiece::GetPatternPieceData()
{
return d->m_ppData;
}
@ -433,7 +433,7 @@ VPatternPieceData &VPiece::GetPatternPieceData()
* @brief Returns the read only reference to the pattern piece data object
* @return pattern piece data object
*/
const VPatternPieceData &VPiece::GetPatternPieceData() const
const VPieceLabelData &VPiece::GetPatternPieceData() const
{
return d->m_ppData;
}

View File

@ -40,7 +40,7 @@ template <class T> class QVector;
template <class T>class QSharedPointer;
class VPiecePath;
class VPatternInfoGeometry;
class VPatternPieceData;
class VPieceLabelData;
class VGrainlineGeometry;
class VContainer;
class QPainterPath;
@ -97,9 +97,9 @@ public:
QVector<quint32> MissingInternalPaths(const VPiece &det) const;
QVector<quint32> MissingPins(const VPiece &det) const;
void SetPatternPieceData(const VPatternPieceData &data);
VPatternPieceData& GetPatternPieceData();
const VPatternPieceData& GetPatternPieceData() const;
void SetPatternPieceData(const VPieceLabelData &data);
VPieceLabelData& GetPatternPieceData();
const VPieceLabelData& GetPatternPieceData() const;
void SetPatternInfo(const VPatternInfoGeometry &info);
VPatternInfoGeometry& GetPatternInfo();

View File

@ -36,7 +36,7 @@
#include "../vmisc/def.h"
#include "vpiecenode.h"
#include "vpiecepath.h"
#include "vpatternpiecedata.h"
#include "vpiecelabeldata.h"
#include "vpatterninfogeometry.h"
#include "vgrainlinegeometry.h"
@ -93,7 +93,7 @@ public:
QVector<quint32> m_pins;
/** @brief Pattern piece data */
VPatternPieceData m_ppData;
VPieceLabelData m_ppData;
/** @brief Pattern info coordinates */
VPatternInfoGeometry m_piPatternInfo;

View File

@ -1,6 +1,6 @@
/************************************************************************
**
** @file vpatternpiecedata.cpp
** @file vpiecelabeldata.cpp
** @author Bojan Kverh
** @date June 16, 2016
**
@ -26,7 +26,7 @@
**
*************************************************************************/
#include "vpatternpiecedata.h"
#include "vpiecelabeldata.h"
//---------------------------------------------------------------------------------------------------------------------
MaterialCutPlacement::MaterialCutPlacement()
@ -34,19 +34,19 @@ MaterialCutPlacement::MaterialCutPlacement()
{}
//---------------------------------------------------------------------------------------------------------------------
VPatternPieceData::VPatternPieceData()
VPieceLabelData::VPieceLabelData()
:m_qsLetter(), m_conMCP(), m_ptPos(0, 0), m_dLabelWidth(0), m_dLabelHeight(0),
m_iFontSize(0), m_dRotation(0), m_bVisible(true)
{}
//---------------------------------------------------------------------------------------------------------------------
void VPatternPieceData::Append(const MaterialCutPlacement& rMCP)
void VPieceLabelData::Append(const MaterialCutPlacement& rMCP)
{
m_conMCP.append(rMCP);
}
//---------------------------------------------------------------------------------------------------------------------
void VPatternPieceData::Insert(int i, const MaterialCutPlacement& rMCP)
void VPieceLabelData::Insert(int i, const MaterialCutPlacement& rMCP)
{
Q_ASSERT(i >= 0);
Q_ASSERT(i <= GetMCPCount());
@ -54,7 +54,7 @@ void VPatternPieceData::Insert(int i, const MaterialCutPlacement& rMCP)
}
//---------------------------------------------------------------------------------------------------------------------
void VPatternPieceData::Set(int i, const MaterialCutPlacement& rMCP)
void VPieceLabelData::Set(int i, const MaterialCutPlacement& rMCP)
{
Q_ASSERT(i >= 0);
Q_ASSERT(i < GetMCPCount());
@ -62,13 +62,13 @@ void VPatternPieceData::Set(int i, const MaterialCutPlacement& rMCP)
}
//---------------------------------------------------------------------------------------------------------------------
int VPatternPieceData::GetMCPCount() const
int VPieceLabelData::GetMCPCount() const
{
return m_conMCP.count();
}
//---------------------------------------------------------------------------------------------------------------------
const MaterialCutPlacement& VPatternPieceData::GetMCP(int i) const
const MaterialCutPlacement& VPieceLabelData::GetMCP(int i) const
{
Q_ASSERT(i >= 0);
Q_ASSERT(i < GetMCPCount());
@ -76,7 +76,7 @@ const MaterialCutPlacement& VPatternPieceData::GetMCP(int i) const
}
//---------------------------------------------------------------------------------------------------------------------
void VPatternPieceData::RemoveMCP(int i)
void VPieceLabelData::RemoveMCP(int i)
{
Q_ASSERT(i >= 0);
Q_ASSERT(i < GetMCPCount());
@ -84,92 +84,92 @@ void VPatternPieceData::RemoveMCP(int i)
}
//---------------------------------------------------------------------------------------------------------------------
void VPatternPieceData::Clear()
void VPieceLabelData::Clear()
{
m_qsLetter.clear();
m_conMCP.clear();
}
//---------------------------------------------------------------------------------------------------------------------
const QString& VPatternPieceData::GetLetter() const
const QString& VPieceLabelData::GetLetter() const
{
return m_qsLetter;
}
//---------------------------------------------------------------------------------------------------------------------
void VPatternPieceData::SetLetter(QString qsLetter)
void VPieceLabelData::SetLetter(QString qsLetter)
{
m_qsLetter = qsLetter.left(3);
}
//---------------------------------------------------------------------------------------------------------------------
QPointF VPatternPieceData::GetPos() const
QPointF VPieceLabelData::GetPos() const
{
return m_ptPos;
}
//---------------------------------------------------------------------------------------------------------------------
void VPatternPieceData::SetPos(const QPointF& ptPos)
void VPieceLabelData::SetPos(const QPointF& ptPos)
{
m_ptPos = ptPos;
}
//---------------------------------------------------------------------------------------------------------------------
qreal VPatternPieceData::GetLabelWidth() const
qreal VPieceLabelData::GetLabelWidth() const
{
return m_dLabelWidth;
}
//---------------------------------------------------------------------------------------------------------------------
void VPatternPieceData::SetLabelWidth(qreal dLabelW)
void VPieceLabelData::SetLabelWidth(qreal dLabelW)
{
m_dLabelWidth = dLabelW;
}
//---------------------------------------------------------------------------------------------------------------------
qreal VPatternPieceData::GetLabelHeight() const
qreal VPieceLabelData::GetLabelHeight() const
{
return m_dLabelHeight;
}
//---------------------------------------------------------------------------------------------------------------------
void VPatternPieceData::SetLabelHeight(qreal dLabelH)
void VPieceLabelData::SetLabelHeight(qreal dLabelH)
{
m_dLabelHeight = dLabelH;
}
//---------------------------------------------------------------------------------------------------------------------
int VPatternPieceData::GetFontSize() const
int VPieceLabelData::GetFontSize() const
{
return m_iFontSize;
}
//---------------------------------------------------------------------------------------------------------------------
void VPatternPieceData::SetFontSize(int iSize)
void VPieceLabelData::SetFontSize(int iSize)
{
m_iFontSize = iSize;
}
//---------------------------------------------------------------------------------------------------------------------
qreal VPatternPieceData::GetRotation() const
qreal VPieceLabelData::GetRotation() const
{
return m_dRotation;
}
//---------------------------------------------------------------------------------------------------------------------
void VPatternPieceData::SetRotation(qreal dRot)
void VPieceLabelData::SetRotation(qreal dRot)
{
m_dRotation = dRot;
}
//---------------------------------------------------------------------------------------------------------------------
bool VPatternPieceData::IsVisible() const
bool VPieceLabelData::IsVisible() const
{
return m_bVisible;
}
//---------------------------------------------------------------------------------------------------------------------
void VPatternPieceData::SetVisible(bool bVal)
void VPieceLabelData::SetVisible(bool bVal)
{
m_bVisible = bVal;
}

View File

@ -1,6 +1,6 @@
/************************************************************************
**
** @file vpatternpiecedata.h
** @file vpiecelabeldata.h
** @author Bojan Kverh
** @date June 16, 2016
**
@ -67,13 +67,13 @@ struct MaterialCutPlacement
typedef QList<MaterialCutPlacement> MCPContainer;
/**
* @brief The VPatternPieceData class holds some information about a single
* @brief The VPieceLabelData class holds some information about a single
* piece like letter, name, material type, cut number and placement.
*/
class VPatternPieceData
class VPieceLabelData
{
public:
VPatternPieceData();
VPieceLabelData();
// methods, which operate on MaterialCutPlacement container
void Append(const MaterialCutPlacement& rMCP);

View File

@ -32,7 +32,7 @@
#include "dialogtool.h"
#include "../vpatterndb/vpiece.h"
#include "../vpatterndb/vpatterninfogeometry.h"
#include "../vpatterndb/vpatternpiecedata.h"
#include "../vpatterndb/vpiecelabeldata.h"
#include "../vpatterndb/vgrainlinegeometry.h"
namespace Ui
@ -136,7 +136,7 @@ private:
// temporary container for Material/Cut/Placement 3-tuples
MCPContainer m_conMCP;
VPatternPieceData m_oldData;
VPieceLabelData m_oldData;
VPatternInfoGeometry m_oldGeom;
VGrainlineGeometry m_oldGrainline;
int m_iRotBaseHeight;

View File

@ -32,7 +32,7 @@
#include "../vpatterndb/vpiecepath.h"
#include "../vpatterndb/calculator.h"
#include "../vpatterndb/vpatterninfogeometry.h"
#include "../vpatterndb/vpatternpiecedata.h"
#include "../vpatterndb/vpiecelabeldata.h"
#include "nodeDetails/vnodearc.h"
#include "nodeDetails/vnodeellipticalarc.h"
#include "nodeDetails/vnodepoint.h"
@ -242,7 +242,7 @@ void VToolSeamAllowance::AddPins(VAbstractPattern *doc, QDomElement &domElement,
void VToolSeamAllowance::AddPatternPieceData(VAbstractPattern *doc, QDomElement &domElement, const VPiece &piece)
{
QDomElement domData = doc->createElement(VAbstractPattern::TagData);
const VPatternPieceData& data = piece.GetPatternPieceData();
const VPieceLabelData& data = piece.GetPatternPieceData();
doc->SetAttribute(domData, VAbstractPattern::AttrLetter, data.GetLetter());
doc->SetAttribute(domData, VAbstractPattern::AttrVisible, data.IsVisible() == true? trueStr : falseStr);
doc->SetAttribute(domData, AttrMx, data.GetPos().x());
@ -417,7 +417,7 @@ void VToolSeamAllowance::Highlight(quint32 id)
void VToolSeamAllowance::UpdateLabel()
{
const VPiece detail = VAbstractTool::data.GetPiece(id);
const VPatternPieceData& data = detail.GetPatternPieceData();
const VPieceLabelData& data = detail.GetPatternPieceData();
if (data.IsVisible() == true)
{

View File

@ -39,7 +39,7 @@
#include "../vmisc/def.h"
#include "../vpatterndb/vpiecenode.h"
#include "../vpatterndb/vpatterninfogeometry.h"
#include "../vpatterndb/vpatternpiecedata.h"
#include "../vpatterndb/vpiecelabeldata.h"
#include "../vpatterndb/vgrainlinegeometry.h"
#include "../tools/vtoolseamallowance.h"
#include "vundocommand.h"

View File

@ -359,7 +359,7 @@ bool VTextGraphicsItem::IsContained(QRectF rectBB, qreal dRot, qreal &dX, qreal
* @param qsName name of detail
* @param data reference to VPatternPieceData
*/
void VTextGraphicsItem::UpdateData(const QString &qsName, const VPatternPieceData &data)
void VTextGraphicsItem::UpdateData(const QString &qsName, const VPieceLabelData &data)
{
m_tm.Update(qsName, data);
}

View File

@ -64,7 +64,7 @@ public:
void Clear();
void SetSize(qreal fW, qreal fH);
bool IsContained(QRectF rectBB, qreal dRot, qreal& dX, qreal& dY) const;
void UpdateData(const QString& qsName, const VPatternPieceData& data);
void UpdateData(const QString& qsName, const VPieceLabelData& data);
void UpdateData(const VAbstractPattern* pDoc, qreal dSize, qreal dHeight);
int GetTextLines() const;