diff --git a/src/app/valentina/mainwindowsnogui.cpp b/src/app/valentina/mainwindowsnogui.cpp index a17821cbf..ed2928768 100644 --- a/src/app/valentina/mainwindowsnogui.cpp +++ b/src/app/valentina/mainwindowsnogui.cpp @@ -37,9 +37,9 @@ #include "dialogs/dialoglayoutprogress.h" #include "dialogs/dialogsavelayout.h" #include "../vlayout/vposter.h" -#include "../vpatterndb/vpiecelabeldata.h" -#include "../vpatterndb/vpatternlabeldata.h" -#include "../vpatterndb/vgrainlinedata.h" +#include "../vpatterndb/floatItemData/vpiecelabeldata.h" +#include "../vpatterndb/floatItemData/vpatternlabeldata.h" +#include "../vpatterndb/floatItemData/vgrainlinedata.h" #include "../vtools/tools/vabstracttool.h" #include diff --git a/src/app/valentina/xml/vpattern.cpp b/src/app/valentina/xml/vpattern.cpp index 4d75d8627..deb68b924 100644 --- a/src/app/valentina/xml/vpattern.cpp +++ b/src/app/valentina/xml/vpattern.cpp @@ -51,9 +51,9 @@ #include "../core/vapplication.h" #include "../vpatterndb/vpiecenode.h" #include "../vpatterndb/calculator.h" -#include "../vpatterndb/vpiecelabeldata.h" -#include "../vpatterndb/vpatternlabeldata.h" -#include "../vpatterndb/vgrainlinedata.h" +#include "../vpatterndb/floatItemData/vpiecelabeldata.h" +#include "../vpatterndb/floatItemData/vpatternlabeldata.h" +#include "../vpatterndb/floatItemData/vgrainlinedata.h" #include "../vpatterndb/vpiecepath.h" #include "../vpatterndb/vnodedetail.h" diff --git a/src/libs/vlayout/vlayoutpiece.cpp b/src/libs/vlayout/vlayoutpiece.cpp index 8728d049f..30a4063a1 100644 --- a/src/libs/vlayout/vlayoutpiece.cpp +++ b/src/libs/vlayout/vlayoutpiece.cpp @@ -43,8 +43,8 @@ #include #include -#include "../vpatterndb/vpatternlabeldata.h" -#include "../vpatterndb/vpiecelabeldata.h" +#include "../vpatterndb/floatItemData/vpatternlabeldata.h" +#include "../vpatterndb/floatItemData/vpiecelabeldata.h" #include "../vmisc/vmath.h" #include "../vmisc/vabstractapplication.h" #include "../vpatterndb/calculator.h" diff --git a/src/libs/vlayout/vlayoutpiece.h b/src/libs/vlayout/vlayoutpiece.h index dcb9eb9ee..33299d450 100644 --- a/src/libs/vlayout/vlayoutpiece.h +++ b/src/libs/vlayout/vlayoutpiece.h @@ -42,8 +42,8 @@ #include #include "../ifc/xml/vabstractpattern.h" -#include "../vpatterndb/vpatternlabeldata.h" -#include "../vpatterndb/vpiecelabeldata.h" +#include "../vpatterndb/floatItemData/vpatternlabeldata.h" +#include "../vpatterndb/floatItemData/vpiecelabeldata.h" #include "../vpatterndb/vcontainer.h" #include "vabstractpiece.h" diff --git a/src/libs/vlayout/vlayoutpiece_p.h b/src/libs/vlayout/vlayoutpiece_p.h index d35e744f0..4e42fb3b2 100644 --- a/src/libs/vlayout/vlayoutpiece_p.h +++ b/src/libs/vlayout/vlayoutpiece_p.h @@ -34,9 +34,9 @@ #include #include -#include "../vpatterndb/vpiecelabeldata.h" -#include "../vpatterndb/vpatternlabeldata.h" -#include "../vpatterndb/vgrainlinedata.h" +#include "../vpatterndb/floatItemData/vpiecelabeldata.h" +#include "../vpatterndb/floatItemData/vpatternlabeldata.h" +#include "../vpatterndb/floatItemData/vgrainlinedata.h" #include "../vmisc/diagnostic.h" #include "vlayoutpiecepath.h" diff --git a/src/libs/vlayout/vtextmanager.cpp b/src/libs/vlayout/vtextmanager.cpp index e245a331d..41d043e7b 100644 --- a/src/libs/vlayout/vtextmanager.cpp +++ b/src/libs/vlayout/vtextmanager.cpp @@ -35,7 +35,7 @@ #include #include "../ifc/xml/vabstractpattern.h" -#include "../vpatterndb/vpiecelabeldata.h" +#include "../vpatterndb/floatItemData/vpiecelabeldata.h" #include "../vmisc/vabstractapplication.h" #include "../vmisc/vmath.h" #include "vtextmanager.h" diff --git a/src/libs/vpatterndb/vgrainlinedata.cpp b/src/libs/vpatterndb/floatItemData/vgrainlinedata.cpp similarity index 100% rename from src/libs/vpatterndb/vgrainlinedata.cpp rename to src/libs/vpatterndb/floatItemData/vgrainlinedata.cpp diff --git a/src/libs/vpatterndb/vgrainlinedata.h b/src/libs/vpatterndb/floatItemData/vgrainlinedata.h similarity index 100% rename from src/libs/vpatterndb/vgrainlinedata.h rename to src/libs/vpatterndb/floatItemData/vgrainlinedata.h diff --git a/src/libs/vpatterndb/vpatternlabeldata.cpp b/src/libs/vpatterndb/floatItemData/vpatternlabeldata.cpp similarity index 95% rename from src/libs/vpatterndb/vpatternlabeldata.cpp rename to src/libs/vpatterndb/floatItemData/vpatternlabeldata.cpp index 1f3852763..d813cf0c5 100644 --- a/src/libs/vpatterndb/vpatternlabeldata.cpp +++ b/src/libs/vpatterndb/floatItemData/vpatternlabeldata.cpp @@ -30,8 +30,16 @@ //--------------------------------------------------------------------------------------------------------------------- VPatternLabelData::VPatternLabelData() - :m_ptPos(0, 0), m_dLabelWidth(0), m_dLabelHeight(0), m_iFontSize(0), - m_dRotation(0), m_bVisible(true) + : m_ptPos(), + m_dLabelWidth(0), + m_dLabelHeight(0), + m_iFontSize(0), + m_dRotation(0), + m_bVisible(true) +{} + +//--------------------------------------------------------------------------------------------------------------------- +VPatternLabelData::~VPatternLabelData() {} //--------------------------------------------------------------------------------------------------------------------- @@ -105,5 +113,3 @@ void VPatternLabelData::SetVisible(bool bVal) { m_bVisible = bVal; } - -//--------------------------------------------------------------------------------------------------------------------- diff --git a/src/libs/vpatterndb/vpatternlabeldata.h b/src/libs/vpatterndb/floatItemData/vpatternlabeldata.h similarity index 74% rename from src/libs/vpatterndb/vpatternlabeldata.h rename to src/libs/vpatterndb/floatItemData/vpatternlabeldata.h index b3d818a0c..1279f2283 100644 --- a/src/libs/vpatterndb/vpatternlabeldata.h +++ b/src/libs/vpatterndb/floatItemData/vpatternlabeldata.h @@ -39,22 +39,28 @@ class VPatternLabelData { public: VPatternLabelData(); + virtual ~VPatternLabelData(); // methods, which set up label parameters - QPointF GetPos() const; - void SetPos(const QPointF& ptPos); - qreal GetLabelWidth() const; - void SetLabelWidth(qreal dLabelW); - qreal GetLabelHeight() const; - void SetLabelHeight(qreal dLabelH); - int GetFontSize() const; - void SetFontSize(int iSize); - qreal GetRotation() const; - void SetRotation(qreal dRot); - bool IsVisible() const; - void SetVisible(bool bVal); + QPointF GetPos() const; + void SetPos(const QPointF& ptPos); -private: + qreal GetLabelWidth() const; + void SetLabelWidth(qreal dLabelW); + + qreal GetLabelHeight() const; + void SetLabelHeight(qreal dLabelH); + + int GetFontSize() const; + void SetFontSize(int iSize); + + qreal GetRotation() const; + void SetRotation(qreal dRot); + + bool IsVisible() const; + void SetVisible(bool bVal); + +protected: /** * @brief m_ptPos position of label's top left corner */ @@ -72,7 +78,7 @@ private: */ int m_iFontSize; /** - * @brief m_dRotation Label rotation + * @brief m_dRotation label rotation */ qreal m_dRotation; /** diff --git a/src/libs/vpatterndb/vpiecelabeldata.cpp b/src/libs/vpatterndb/floatItemData/vpiecelabeldata.cpp similarity index 59% rename from src/libs/vpatterndb/vpiecelabeldata.cpp rename to src/libs/vpatterndb/floatItemData/vpiecelabeldata.cpp index 4adf35eb0..ecfafc6c0 100644 --- a/src/libs/vpatterndb/vpiecelabeldata.cpp +++ b/src/libs/vpatterndb/floatItemData/vpiecelabeldata.cpp @@ -28,15 +28,25 @@ #include "vpiecelabeldata.h" +#include + //--------------------------------------------------------------------------------------------------------------------- MaterialCutPlacement::MaterialCutPlacement() - :m_eMaterial(MaterialType::mtFabric), m_qsMaterialUserDef(), m_iCutNumber(0), m_ePlacement(PlacementType::ptNone) + : m_eMaterial(MaterialType::mtFabric), + m_qsMaterialUserDef(), + m_iCutNumber(0), + m_ePlacement(PlacementType::ptNone) {} //--------------------------------------------------------------------------------------------------------------------- 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) + : VPatternLabelData(), + m_qsLetter(), + m_conMCP() +{} + +//--------------------------------------------------------------------------------------------------------------------- +VPieceLabelData::~VPieceLabelData() {} //--------------------------------------------------------------------------------------------------------------------- @@ -101,78 +111,3 @@ void VPieceLabelData::SetLetter(QString qsLetter) { m_qsLetter = qsLetter.left(3); } - -//--------------------------------------------------------------------------------------------------------------------- -QPointF VPieceLabelData::GetPos() const -{ - return m_ptPos; -} - -//--------------------------------------------------------------------------------------------------------------------- -void VPieceLabelData::SetPos(const QPointF& ptPos) -{ - m_ptPos = ptPos; -} - -//--------------------------------------------------------------------------------------------------------------------- -qreal VPieceLabelData::GetLabelWidth() const -{ - return m_dLabelWidth; -} - -//--------------------------------------------------------------------------------------------------------------------- -void VPieceLabelData::SetLabelWidth(qreal dLabelW) -{ - m_dLabelWidth = dLabelW; -} - -//--------------------------------------------------------------------------------------------------------------------- -qreal VPieceLabelData::GetLabelHeight() const -{ - return m_dLabelHeight; -} - -//--------------------------------------------------------------------------------------------------------------------- -void VPieceLabelData::SetLabelHeight(qreal dLabelH) -{ - m_dLabelHeight = dLabelH; -} - -//--------------------------------------------------------------------------------------------------------------------- -int VPieceLabelData::GetFontSize() const -{ - return m_iFontSize; -} - -//--------------------------------------------------------------------------------------------------------------------- -void VPieceLabelData::SetFontSize(int iSize) -{ - m_iFontSize = iSize; -} - -//--------------------------------------------------------------------------------------------------------------------- -qreal VPieceLabelData::GetRotation() const -{ - return m_dRotation; -} - -//--------------------------------------------------------------------------------------------------------------------- -void VPieceLabelData::SetRotation(qreal dRot) -{ - m_dRotation = dRot; -} - -//--------------------------------------------------------------------------------------------------------------------- -bool VPieceLabelData::IsVisible() const -{ - return m_bVisible; -} - -//--------------------------------------------------------------------------------------------------------------------- -void VPieceLabelData::SetVisible(bool bVal) -{ - m_bVisible = bVal; -} - -//--------------------------------------------------------------------------------------------------------------------- - diff --git a/src/libs/vpatterndb/vpiecelabeldata.h b/src/libs/vpatterndb/floatItemData/vpiecelabeldata.h similarity index 58% rename from src/libs/vpatterndb/vpiecelabeldata.h rename to src/libs/vpatterndb/floatItemData/vpiecelabeldata.h index 52103e3d6..273df823c 100644 --- a/src/libs/vpatterndb/vpiecelabeldata.h +++ b/src/libs/vpatterndb/floatItemData/vpiecelabeldata.h @@ -30,11 +30,9 @@ #define VPATTERNPIECEDATA_H #include -#include -#include #include -#include -#include + +#include "vpatternlabeldata.h" enum class MaterialType : char { @@ -56,10 +54,10 @@ enum class PlacementType : char */ struct MaterialCutPlacement { - MaterialType m_eMaterial; - QString m_qsMaterialUserDef; - int m_iCutNumber; - PlacementType m_ePlacement; + MaterialType m_eMaterial; + QString m_qsMaterialUserDef; + int m_iCutNumber; + PlacementType m_ePlacement; MaterialCutPlacement(); }; @@ -70,10 +68,11 @@ typedef QList MCPContainer; * @brief The VPieceLabelData class holds some information about a single * piece like letter, name, material type, cut number and placement. */ -class VPieceLabelData +class VPieceLabelData : public VPatternLabelData { public: VPieceLabelData(); + virtual ~VPieceLabelData(); // methods, which operate on MaterialCutPlacement container void Append(const MaterialCutPlacement& rMCP); @@ -88,54 +87,11 @@ public: const QString& GetLetter() const; void SetLetter(QString qsLetter); - // methods, which set up label parameters - QPointF GetPos() const; - void SetPos(const QPointF& ptPos); - qreal GetLabelWidth() const; - void SetLabelWidth(qreal dLabelW); - qreal GetLabelHeight() const; - void SetLabelHeight(qreal dLabelH); - int GetFontSize() const; - void SetFontSize(int iSize); - qreal GetRotation() const; - void SetRotation(qreal dRot); - bool IsVisible() const; - void SetVisible(bool bVal); - private: - /** - * @brief m_qsLetter Detail letter (should be no more than 3 characters) - */ - QString m_qsLetter; - /** - * @brief m_conMCP List of material, cut, placement tuples - */ - MCPContainer m_conMCP; - /** - * @brief m_ptPos position of label's top left corner - */ - QPointF m_ptPos; - /** - * @brief m_dLabelWidth label width - */ - qreal m_dLabelWidth; - /** - * @brief m_dLabelHeight label height - */ - qreal m_dLabelHeight; - /** - * @brief m_iFontSize label font size - */ - int m_iFontSize; - /** - * @brief m_dRotation label rotation - */ - qreal m_dRotation; - /** - * @brief m_bVisible visibility flag - */ - bool m_bVisible; - + /** @brief m_qsLetter Detail letter (should be no more than 3 characters) */ + QString m_qsLetter; + /** @brief m_conMCP List of material, cut, placement tuples */ + MCPContainer m_conMCP; }; #endif // VPATTERNPIECEDATA_H diff --git a/src/libs/vpatterndb/vpatterndb.pri b/src/libs/vpatterndb/vpatterndb.pri index d3bf388cb..7ce9e3735 100644 --- a/src/libs/vpatterndb/vpatterndb.pri +++ b/src/libs/vpatterndb/vpatterndb.pri @@ -22,9 +22,9 @@ SOURCES += \ $$PWD/vpiece.cpp \ $$PWD/vpiecenode.cpp \ $$PWD/vpiecepath.cpp \ - $$PWD/vpiecelabeldata.cpp \ - $$PWD/vpatternlabeldata.cpp \ - $$PWD/vgrainlinedata.cpp + $$PWD/floatItemData/vpiecelabeldata.cpp \ + $$PWD/floatItemData/vpatternlabeldata.cpp \ + $$PWD/floatItemData/vgrainlinedata.cpp win32-msvc*:SOURCES += $$PWD/stable.cpp @@ -63,6 +63,6 @@ HEADERS += \ $$PWD/vpiecenode_p.h \ $$PWD/vpiecepath.h \ $$PWD/vpiecepath_p.h \ - $$PWD/vpiecelabeldata.h \ - $$PWD/vpatternlabeldata.h \ - $$PWD/vgrainlinedata.h + $$PWD/floatItemData/vpiecelabeldata.h \ + $$PWD/floatItemData/vpatternlabeldata.h \ + $$PWD/floatItemData/vgrainlinedata.h diff --git a/src/libs/vpatterndb/vpiece_p.h b/src/libs/vpatterndb/vpiece_p.h index 229e3174b..be91f663f 100644 --- a/src/libs/vpatterndb/vpiece_p.h +++ b/src/libs/vpatterndb/vpiece_p.h @@ -36,9 +36,9 @@ #include "../vmisc/def.h" #include "vpiecenode.h" #include "vpiecepath.h" -#include "vpiecelabeldata.h" -#include "vpatternlabeldata.h" -#include "vgrainlinedata.h" +#include "floatItemData/vpiecelabeldata.h" +#include "floatItemData/vpatternlabeldata.h" +#include "floatItemData/vgrainlinedata.h" QT_WARNING_PUSH QT_WARNING_DISABLE_GCC("-Weffc++") diff --git a/src/libs/vtools/dialogs/tools/dialogseamallowance.h b/src/libs/vtools/dialogs/tools/dialogseamallowance.h index 58d5f55b9..3205a366a 100644 --- a/src/libs/vtools/dialogs/tools/dialogseamallowance.h +++ b/src/libs/vtools/dialogs/tools/dialogseamallowance.h @@ -31,9 +31,9 @@ #include "dialogtool.h" #include "../vpatterndb/vpiece.h" -#include "../vpatterndb/vpatternlabeldata.h" -#include "../vpatterndb/vpiecelabeldata.h" -#include "../vpatterndb/vgrainlinedata.h" +#include "../vpatterndb/floatItemData/vpatternlabeldata.h" +#include "../vpatterndb/floatItemData/vpiecelabeldata.h" +#include "../vpatterndb/floatItemData/vgrainlinedata.h" namespace Ui { diff --git a/src/libs/vtools/tools/vtoolseamallowance.cpp b/src/libs/vtools/tools/vtoolseamallowance.cpp index 85a40b491..710329d51 100644 --- a/src/libs/vtools/tools/vtoolseamallowance.cpp +++ b/src/libs/vtools/tools/vtoolseamallowance.cpp @@ -31,8 +31,8 @@ #include "../vpatterndb/vpiecenode.h" #include "../vpatterndb/vpiecepath.h" #include "../vpatterndb/calculator.h" -#include "../vpatterndb/vpatternlabeldata.h" -#include "../vpatterndb/vpiecelabeldata.h" +#include "../vpatterndb/floatItemData/vpatternlabeldata.h" +#include "../vpatterndb/floatItemData/vpiecelabeldata.h" #include "nodeDetails/vnodearc.h" #include "nodeDetails/vnodeellipticalarc.h" #include "nodeDetails/vnodepoint.h" diff --git a/src/libs/vtools/undocommands/savepieceoptions.cpp b/src/libs/vtools/undocommands/savepieceoptions.cpp index 9ac8a28f2..91b587586 100644 --- a/src/libs/vtools/undocommands/savepieceoptions.cpp +++ b/src/libs/vtools/undocommands/savepieceoptions.cpp @@ -38,9 +38,9 @@ #include "../vmisc/logging.h" #include "../vmisc/def.h" #include "../vpatterndb/vpiecenode.h" -#include "../vpatterndb/vpatternlabeldata.h" -#include "../vpatterndb/vpiecelabeldata.h" -#include "../vpatterndb/vgrainlinedata.h" +#include "../vpatterndb/floatItemData/vpatternlabeldata.h" +#include "../vpatterndb/floatItemData/vpiecelabeldata.h" +#include "../vpatterndb/floatItemData/vgrainlinedata.h" #include "../tools/vtoolseamallowance.h" #include "vundocommand.h" diff --git a/src/libs/vwidgets/vgrainlineitem.h b/src/libs/vwidgets/vgrainlineitem.h index 8a0180fc6..a7b9ea89e 100644 --- a/src/libs/vwidgets/vgrainlineitem.h +++ b/src/libs/vwidgets/vgrainlineitem.h @@ -30,7 +30,7 @@ #define VGRAINLINEITEM_H #include "vpieceitem.h" -#include "../vpatterndb/vgrainlinedata.h" +#include "../vpatterndb/floatItemData/vgrainlinedata.h" class VGrainlineItem : public VPieceItem {