Refactoring. Rename class VPatternInfoGeometry to VPatternLabelData.

--HG--
branch : feature
This commit is contained in:
Roman Telezhynskyi 2017-02-23 11:26:25 +02:00
parent 37efefe1ec
commit 4e3ee3eefd
14 changed files with 47 additions and 47 deletions

View File

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

View File

@ -52,7 +52,7 @@
#include "../vpatterndb/vpiecenode.h" #include "../vpatterndb/vpiecenode.h"
#include "../vpatterndb/calculator.h" #include "../vpatterndb/calculator.h"
#include "../vpatterndb/vpiecelabeldata.h" #include "../vpatterndb/vpiecelabeldata.h"
#include "../vpatterndb/vpatterninfogeometry.h" #include "../vpatterndb/vpatternlabeldata.h"
#include "../vpatterndb/vgrainlinegeometry.h" #include "../vpatterndb/vgrainlinegeometry.h"
#include "../vpatterndb/vpiecepath.h" #include "../vpatterndb/vpiecepath.h"
#include "../vpatterndb/vnodedetail.h" #include "../vpatterndb/vnodedetail.h"

View File

@ -43,7 +43,7 @@
#include <Qt> #include <Qt>
#include <QtDebug> #include <QtDebug>
#include "../vpatterndb/vpatterninfogeometry.h" #include "../vpatterndb/vpatternlabeldata.h"
#include "../vpatterndb/vpiecelabeldata.h" #include "../vpatterndb/vpiecelabeldata.h"
#include "../vmisc/vmath.h" #include "../vmisc/vmath.h"
#include "../vmisc/vabstractapplication.h" #include "../vmisc/vabstractapplication.h"
@ -111,7 +111,7 @@ VLayoutPiece VLayoutPiece::Create(const VPiece &piece, const VContainer *pattern
{ {
det.SetDetail(piece.GetName(), data, qApp->font()); det.SetDetail(piece.GetName(), data, qApp->font());
} }
const VPatternInfoGeometry& geom = piece.GetPatternInfo(); const VPatternLabelData& geom = piece.GetPatternInfo();
if (geom.IsVisible() == true) if (geom.IsVisible() == true)
{ {
VAbstractPattern* pDoc = qApp->getCurrentDocument(); VAbstractPattern* pDoc = qApp->getCurrentDocument();
@ -201,7 +201,7 @@ void VLayoutPiece::SetDetail(const QString& qsName, const VPieceLabelData& data,
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void VLayoutPiece::SetPatternInfo(const VAbstractPattern* pDoc, const VPatternInfoGeometry& geom, const QFont &font, void VLayoutPiece::SetPatternInfo(const VAbstractPattern* pDoc, const VPatternLabelData& geom, const QFont &font,
qreal dSize, qreal dHeight) qreal dSize, qreal dHeight)
{ {
d->patternGeom = geom; d->patternGeom = geom;

View File

@ -42,7 +42,7 @@
#include <QtGlobal> #include <QtGlobal>
#include "../ifc/xml/vabstractpattern.h" #include "../ifc/xml/vabstractpattern.h"
#include "../vpatterndb/vpatterninfogeometry.h" #include "../vpatterndb/vpatternlabeldata.h"
#include "../vpatterndb/vpiecelabeldata.h" #include "../vpatterndb/vpiecelabeldata.h"
#include "../vpatterndb/vcontainer.h" #include "../vpatterndb/vcontainer.h"
#include "vabstractpiece.h" #include "vabstractpiece.h"
@ -75,7 +75,7 @@ public:
void SetDetail(const QString &qsName, const VPieceLabelData& 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, 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 VGrainlineGeometry& geom, const VContainer& rPattern);

View File

@ -35,7 +35,7 @@
#include <QTransform> #include <QTransform>
#include "../vpatterndb/vpiecelabeldata.h" #include "../vpatterndb/vpiecelabeldata.h"
#include "../vpatterndb/vpatterninfogeometry.h" #include "../vpatterndb/vpatternlabeldata.h"
#include "../vpatterndb/vgrainlinegeometry.h" #include "../vpatterndb/vgrainlinegeometry.h"
#include "../vmisc/diagnostic.h" #include "../vmisc/diagnostic.h"
#include "vlayoutpiecepath.h" #include "vlayoutpiecepath.h"
@ -118,7 +118,7 @@ public:
/** @brief detailData detail data */ /** @brief detailData detail data */
VPieceLabelData detailData; VPieceLabelData detailData;
/** @brief patternGeom pattern geometry */ /** @brief patternGeom pattern geometry */
VPatternInfoGeometry patternGeom; VPatternLabelData patternGeom;
/** @brief grainlineGeom grainline geometry */ /** @brief grainlineGeom grainline geometry */
VGrainlineGeometry grainlineGeom; VGrainlineGeometry grainlineGeom;
/** @brief m_tmDetail text manager for laying out detail info */ /** @brief m_tmDetail text manager for laying out detail info */

View File

@ -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/vpatterninfogeometry.cpp \
$$PWD/vgrainlinegeometry.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
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/vpatterninfogeometry.h \
$$PWD/vgrainlinegeometry.h \ $$PWD/vgrainlinegeometry.h \
$$PWD/variables/vcurveclength.h \ $$PWD/variables/vcurveclength.h \
$$PWD/variables/vellipticalarcradius.h \ $$PWD/variables/vellipticalarcradius.h \
@ -65,4 +64,5 @@ HEADERS += \
$$PWD/vpiecenode_p.h \ $$PWD/vpiecenode_p.h \
$$PWD/vpiecepath.h \ $$PWD/vpiecepath.h \
$$PWD/vpiecepath_p.h \ $$PWD/vpiecepath_p.h \
$$PWD/vpiecelabeldata.h $$PWD/vpiecelabeldata.h \
$$PWD/vpatternlabeldata.h

View File

@ -1,6 +1,6 @@
/************************************************************************ /************************************************************************
** **
** @file vpatterninfogeometry.cpp ** @file vpatternlabeldata.cpp
** @author Bojan Kverh ** @author Bojan Kverh
** @date June 16, 2016 ** @date June 16, 2016
** **
@ -26,82 +26,82 @@
** **
*************************************************************************/ *************************************************************************/
#include "vpatterninfogeometry.h" #include "vpatternlabeldata.h"
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
VPatternInfoGeometry::VPatternInfoGeometry() VPatternLabelData::VPatternLabelData()
:m_ptPos(0, 0), m_dLabelWidth(0), m_dLabelHeight(0), m_iFontSize(0), :m_ptPos(0, 0), m_dLabelWidth(0), m_dLabelHeight(0), m_iFontSize(0),
m_dRotation(0), m_bVisible(true) m_dRotation(0), m_bVisible(true)
{} {}
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
QPointF VPatternInfoGeometry::GetPos() const QPointF VPatternLabelData::GetPos() const
{ {
return m_ptPos; return m_ptPos;
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void VPatternInfoGeometry::SetPos(const QPointF& ptPos) void VPatternLabelData::SetPos(const QPointF& ptPos)
{ {
m_ptPos = ptPos; m_ptPos = ptPos;
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
qreal VPatternInfoGeometry::GetLabelWidth() const qreal VPatternLabelData::GetLabelWidth() const
{ {
return m_dLabelWidth; return m_dLabelWidth;
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void VPatternInfoGeometry::SetLabelWidth(qreal dLabelW) void VPatternLabelData::SetLabelWidth(qreal dLabelW)
{ {
m_dLabelWidth = dLabelW; m_dLabelWidth = dLabelW;
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
qreal VPatternInfoGeometry::GetLabelHeight() const qreal VPatternLabelData::GetLabelHeight() const
{ {
return m_dLabelHeight; return m_dLabelHeight;
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void VPatternInfoGeometry::SetLabelHeight(qreal dLabelH) void VPatternLabelData::SetLabelHeight(qreal dLabelH)
{ {
m_dLabelHeight = dLabelH; m_dLabelHeight = dLabelH;
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
int VPatternInfoGeometry::GetFontSize() const int VPatternLabelData::GetFontSize() const
{ {
return m_iFontSize; return m_iFontSize;
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void VPatternInfoGeometry::SetFontSize(int iSize) void VPatternLabelData::SetFontSize(int iSize)
{ {
m_iFontSize = iSize; m_iFontSize = iSize;
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
qreal VPatternInfoGeometry::GetRotation() const qreal VPatternLabelData::GetRotation() const
{ {
return m_dRotation; return m_dRotation;
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void VPatternInfoGeometry::SetRotation(qreal dRot) void VPatternLabelData::SetRotation(qreal dRot)
{ {
m_dRotation = dRot; m_dRotation = dRot;
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
bool VPatternInfoGeometry::IsVisible() const bool VPatternLabelData::IsVisible() const
{ {
return m_bVisible; return m_bVisible;
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void VPatternInfoGeometry::SetVisible(bool bVal) void VPatternLabelData::SetVisible(bool bVal)
{ {
m_bVisible = bVal; m_bVisible = bVal;
} }

View File

@ -1,6 +1,6 @@
/************************************************************************ /************************************************************************
** **
** @file vpatterninfogeometry.h ** @file vpatternlabeldata.h
** @author Bojan Kverh ** @author Bojan Kverh
** @date June 16, 2016 ** @date June 16, 2016
** **
@ -33,12 +33,12 @@
#include <QtGlobal> #include <QtGlobal>
/** /**
* @brief The VPatternInfoGeometry class holds the information about pattern info label geometry * @brief The VPatternLabelData class holds the information about pattern info label geometry
*/ */
class VPatternInfoGeometry class VPatternLabelData
{ {
public: public:
VPatternInfoGeometry(); VPatternLabelData();
// methods, which set up label parameters // methods, which set up label parameters
QPointF GetPos() const; QPointF GetPos() const;

View File

@ -439,7 +439,7 @@ const VPieceLabelData &VPiece::GetPatternPieceData() const
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void VPiece::SetPatternInfo(const VPatternInfoGeometry &info) void VPiece::SetPatternInfo(const VPatternLabelData &info)
{ {
d->m_piPatternInfo = info; d->m_piPatternInfo = info;
} }
@ -449,7 +449,7 @@ void VPiece::SetPatternInfo(const VPatternInfoGeometry &info)
* @brief Returns full access to the pattern info geometry object * @brief Returns full access to the pattern info geometry object
* @return pattern info geometry object * @return pattern info geometry object
*/ */
VPatternInfoGeometry &VPiece::GetPatternInfo() VPatternLabelData &VPiece::GetPatternInfo()
{ {
return d->m_piPatternInfo; return d->m_piPatternInfo;
} }
@ -459,7 +459,7 @@ VPatternInfoGeometry &VPiece::GetPatternInfo()
* @brief Returns the read only reference to the pattern info geometry object * @brief Returns the read only reference to the pattern info geometry object
* @return pattern info geometry object * @return pattern info geometry object
*/ */
const VPatternInfoGeometry &VPiece::GetPatternInfo() const const VPatternLabelData &VPiece::GetPatternInfo() const
{ {
return d->m_piPatternInfo; return d->m_piPatternInfo;
} }

View File

@ -39,7 +39,7 @@ class VPieceNode;
template <class T> class QVector; template <class T> class QVector;
template <class T>class QSharedPointer; template <class T>class QSharedPointer;
class VPiecePath; class VPiecePath;
class VPatternInfoGeometry; class VPatternLabelData;
class VPieceLabelData; class VPieceLabelData;
class VGrainlineGeometry; class VGrainlineGeometry;
class VContainer; class VContainer;
@ -101,9 +101,9 @@ public:
VPieceLabelData& GetPatternPieceData(); VPieceLabelData& GetPatternPieceData();
const VPieceLabelData& GetPatternPieceData() const; const VPieceLabelData& GetPatternPieceData() const;
void SetPatternInfo(const VPatternInfoGeometry &info); void SetPatternInfo(const VPatternLabelData &info);
VPatternInfoGeometry& GetPatternInfo(); VPatternLabelData& GetPatternInfo();
const VPatternInfoGeometry& GetPatternInfo() const; const VPatternLabelData& GetPatternInfo() const;
VGrainlineGeometry& GetGrainlineGeometry(); VGrainlineGeometry& GetGrainlineGeometry();
const VGrainlineGeometry& GetGrainlineGeometry() const; const VGrainlineGeometry& GetGrainlineGeometry() const;

View File

@ -37,7 +37,7 @@
#include "vpiecenode.h" #include "vpiecenode.h"
#include "vpiecepath.h" #include "vpiecepath.h"
#include "vpiecelabeldata.h" #include "vpiecelabeldata.h"
#include "vpatterninfogeometry.h" #include "vpatternlabeldata.h"
#include "vgrainlinegeometry.h" #include "vgrainlinegeometry.h"
QT_WARNING_PUSH QT_WARNING_PUSH
@ -96,7 +96,7 @@ public:
VPieceLabelData m_ppData; VPieceLabelData m_ppData;
/** @brief Pattern info coordinates */ /** @brief Pattern info coordinates */
VPatternInfoGeometry m_piPatternInfo; VPatternLabelData m_piPatternInfo;
/** @brief m_glGrainline grainline geometry object*/ /** @brief m_glGrainline grainline geometry object*/
VGrainlineGeometry m_glGrainline; VGrainlineGeometry m_glGrainline;

View File

@ -31,7 +31,7 @@
#include "dialogtool.h" #include "dialogtool.h"
#include "../vpatterndb/vpiece.h" #include "../vpatterndb/vpiece.h"
#include "../vpatterndb/vpatterninfogeometry.h" #include "../vpatterndb/vpatternlabeldata.h"
#include "../vpatterndb/vpiecelabeldata.h" #include "../vpatterndb/vpiecelabeldata.h"
#include "../vpatterndb/vgrainlinegeometry.h" #include "../vpatterndb/vgrainlinegeometry.h"
@ -137,7 +137,7 @@ private:
MCPContainer m_conMCP; MCPContainer m_conMCP;
VPieceLabelData m_oldData; VPieceLabelData m_oldData;
VPatternInfoGeometry m_oldGeom; VPatternLabelData m_oldGeom;
VGrainlineGeometry m_oldGrainline; VGrainlineGeometry m_oldGrainline;
int m_iRotBaseHeight; int m_iRotBaseHeight;
int m_iLenBaseHeight; int m_iLenBaseHeight;

View File

@ -31,7 +31,7 @@
#include "../vpatterndb/vpiecenode.h" #include "../vpatterndb/vpiecenode.h"
#include "../vpatterndb/vpiecepath.h" #include "../vpatterndb/vpiecepath.h"
#include "../vpatterndb/calculator.h" #include "../vpatterndb/calculator.h"
#include "../vpatterndb/vpatterninfogeometry.h" #include "../vpatterndb/vpatternlabeldata.h"
#include "../vpatterndb/vpiecelabeldata.h" #include "../vpatterndb/vpiecelabeldata.h"
#include "nodeDetails/vnodearc.h" #include "nodeDetails/vnodearc.h"
#include "nodeDetails/vnodeellipticalarc.h" #include "nodeDetails/vnodeellipticalarc.h"
@ -272,7 +272,7 @@ void VToolSeamAllowance::AddPatternPieceData(VAbstractPattern *doc, QDomElement
void VToolSeamAllowance::AddPatternInfo(VAbstractPattern *doc, QDomElement &domElement, const VPiece &piece) void VToolSeamAllowance::AddPatternInfo(VAbstractPattern *doc, QDomElement &domElement, const VPiece &piece)
{ {
QDomElement domData = doc->createElement(VAbstractPattern::TagPatternInfo); QDomElement domData = doc->createElement(VAbstractPattern::TagPatternInfo);
const VPatternInfoGeometry& geom = piece.GetPatternInfo(); const VPatternLabelData& geom = piece.GetPatternInfo();
doc->SetAttribute(domData, VAbstractPattern::AttrVisible, geom.IsVisible() == true ? trueStr : falseStr); doc->SetAttribute(domData, VAbstractPattern::AttrVisible, geom.IsVisible() == true ? trueStr : falseStr);
doc->SetAttribute(domData, AttrMx, geom.GetPos().x()); doc->SetAttribute(domData, AttrMx, geom.GetPos().x());
doc->SetAttribute(domData, AttrMy, geom.GetPos().y()); doc->SetAttribute(domData, AttrMy, geom.GetPos().y());
@ -460,7 +460,7 @@ void VToolSeamAllowance::UpdateLabel()
void VToolSeamAllowance::UpdatePatternInfo() void VToolSeamAllowance::UpdatePatternInfo()
{ {
const VPiece detail = VAbstractTool::data.GetPiece(id); const VPiece detail = VAbstractTool::data.GetPiece(id);
const VPatternInfoGeometry& geom = detail.GetPatternInfo(); const VPatternLabelData& geom = detail.GetPatternInfo();
if (geom.IsVisible() == true) if (geom.IsVisible() == true)
{ {

View File

@ -38,7 +38,7 @@
#include "../vmisc/logging.h" #include "../vmisc/logging.h"
#include "../vmisc/def.h" #include "../vmisc/def.h"
#include "../vpatterndb/vpiecenode.h" #include "../vpatterndb/vpiecenode.h"
#include "../vpatterndb/vpatterninfogeometry.h" #include "../vpatterndb/vpatternlabeldata.h"
#include "../vpatterndb/vpiecelabeldata.h" #include "../vpatterndb/vpiecelabeldata.h"
#include "../vpatterndb/vgrainlinegeometry.h" #include "../vpatterndb/vgrainlinegeometry.h"
#include "../tools/vtoolseamallowance.h" #include "../tools/vtoolseamallowance.h"