2015-01-02 14:53:36 +01:00
|
|
|
/************************************************************************
|
|
|
|
**
|
|
|
|
** @file vlayoutgenerator.cpp
|
|
|
|
** @author Roman Telezhynskyi <dismine(at)gmail.com>
|
|
|
|
** @date 2 1, 2015
|
|
|
|
**
|
|
|
|
** @brief
|
|
|
|
** @copyright
|
|
|
|
** This source code is part of the Valentine project, a pattern making
|
|
|
|
** program, whose allow create and modeling patterns of clothing.
|
2015-02-27 11:27:48 +01:00
|
|
|
** Copyright (C) 2013-2015 Valentina project
|
2015-01-02 14:53:36 +01:00
|
|
|
** <https://bitbucket.org/dismine/valentina> All Rights Reserved.
|
|
|
|
**
|
|
|
|
** Valentina is free software: you can redistribute it and/or modify
|
|
|
|
** it under the terms of the GNU General Public License as published by
|
|
|
|
** the Free Software Foundation, either version 3 of the License, or
|
|
|
|
** (at your option) any later version.
|
|
|
|
**
|
|
|
|
** Valentina is distributed in the hope that it will be useful,
|
|
|
|
** but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
** GNU General Public License for more details.
|
|
|
|
**
|
|
|
|
** You should have received a copy of the GNU General Public License
|
|
|
|
** along with Valentina. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
**
|
|
|
|
*************************************************************************/
|
|
|
|
|
|
|
|
#include "vlayoutgenerator.h"
|
2015-01-12 13:12:15 +01:00
|
|
|
#include "vlayoutpaper.h"
|
|
|
|
#include "vlayoutdetail.h"
|
2016-02-23 13:13:10 +01:00
|
|
|
#include "../vmisc/def.h"
|
2015-01-02 14:53:36 +01:00
|
|
|
|
2015-01-12 13:12:15 +01:00
|
|
|
#include <QRectF>
|
2015-01-12 21:35:32 +01:00
|
|
|
#include <QImage>
|
|
|
|
#include <QDir>
|
2015-01-13 11:38:51 +01:00
|
|
|
#include <QGraphicsItem>
|
2015-05-02 19:18:31 +02:00
|
|
|
#include <QThreadPool>
|
2016-02-23 13:13:10 +01:00
|
|
|
#include <QtCore/qmath.h>
|
2015-01-02 14:53:36 +01:00
|
|
|
|
2015-01-12 13:12:15 +01:00
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
VLayoutGenerator::VLayoutGenerator(QObject *parent)
|
2015-11-09 12:33:36 +01:00
|
|
|
:QObject(parent), papers(QVector<VLayoutPaper>()), bank(new VBank()), paperHeight(0), paperWidth(0), margins(),
|
2015-05-02 18:21:47 +02:00
|
|
|
stopGeneration(false), state(LayoutErrors::NoError), shift(0), rotate(true), rotationIncrease(180),
|
2016-02-23 13:13:10 +01:00
|
|
|
autoCrop(false), saveLength(false), unitePages(false), stripOptimizationEnabled(false), multiplier(1),
|
|
|
|
stripOptimization(false)
|
2015-01-12 13:12:15 +01:00
|
|
|
{}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
VLayoutGenerator::~VLayoutGenerator()
|
|
|
|
{
|
|
|
|
delete bank;
|
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
void VLayoutGenerator::SetDetails(const QVector<VLayoutDetail> &details)
|
2015-01-02 14:53:36 +01:00
|
|
|
{
|
2015-01-12 13:12:15 +01:00
|
|
|
bank->SetDetails(details);
|
2015-01-02 14:53:36 +01:00
|
|
|
}
|
2015-01-12 13:12:15 +01:00
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
void VLayoutGenerator::SetLayoutWidth(qreal width)
|
|
|
|
{
|
|
|
|
bank->SetLayoutWidth(width);
|
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
void VLayoutGenerator::SetCaseType(Cases caseType)
|
|
|
|
{
|
|
|
|
bank->SetCaseType(caseType);
|
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2015-04-15 14:44:57 +02:00
|
|
|
// cppcheck-suppress unusedFunction
|
2015-01-12 13:12:15 +01:00
|
|
|
int VLayoutGenerator::DetailsCount()
|
|
|
|
{
|
|
|
|
return bank->AllDetailsCount();
|
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
void VLayoutGenerator::Generate()
|
|
|
|
{
|
|
|
|
stopGeneration = false;
|
|
|
|
papers.clear();
|
|
|
|
state = LayoutErrors::NoError;
|
2015-01-12 21:35:32 +01:00
|
|
|
|
|
|
|
#ifdef LAYOUT_DEBUG
|
|
|
|
const QString path = QDir::homePath()+QStringLiteral("/LayoutDebug");
|
|
|
|
QDir debugDir(path);
|
|
|
|
debugDir.removeRecursively();
|
|
|
|
debugDir.mkpath(path);
|
|
|
|
#endif
|
|
|
|
|
2015-01-12 13:12:15 +01:00
|
|
|
emit Start();
|
|
|
|
|
|
|
|
if (bank->Prepare())
|
|
|
|
{
|
2016-02-23 13:13:10 +01:00
|
|
|
const int width = PageWidth();
|
|
|
|
int height = PageHeight();
|
|
|
|
|
|
|
|
if (stripOptimization)
|
|
|
|
{
|
|
|
|
const qreal b = bank->GetBiggestDiagonal() * multiplier + bank->GetLayoutWidth();
|
|
|
|
|
|
|
|
if (height >= b*2)
|
|
|
|
{
|
|
|
|
stripOptimizationEnabled = true;
|
|
|
|
height = qFloor(height / qFloor(height/b));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-01-16 20:34:37 +01:00
|
|
|
while (bank->AllDetailsCount() > 0)
|
2015-01-12 13:12:15 +01:00
|
|
|
{
|
|
|
|
if (stopGeneration)
|
|
|
|
{
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2016-02-23 13:13:10 +01:00
|
|
|
VLayoutPaper paper(height, width);
|
2015-01-12 16:23:25 +01:00
|
|
|
paper.SetShift(shift);
|
2015-01-17 15:00:46 +01:00
|
|
|
paper.SetLayoutWidth(bank->GetLayoutWidth());
|
2015-03-16 13:23:02 +01:00
|
|
|
paper.SetPaperIndex(static_cast<quint32>(papers.count()));
|
2015-01-22 15:11:50 +01:00
|
|
|
paper.SetRotate(rotate);
|
|
|
|
paper.SetRotationIncrease(rotationIncrease);
|
2015-05-08 12:10:56 +02:00
|
|
|
paper.SetSaveLength(saveLength);
|
2015-01-16 20:34:37 +01:00
|
|
|
do
|
2015-01-12 13:12:15 +01:00
|
|
|
{
|
|
|
|
const int index = bank->GetTiket();
|
2015-01-16 15:45:56 +01:00
|
|
|
if (paper.ArrangeDetail(bank->GetDetail(index), stopGeneration))
|
2015-01-12 13:12:15 +01:00
|
|
|
{
|
|
|
|
bank->Arranged(index);
|
2015-01-16 13:53:14 +01:00
|
|
|
emit Arranged(bank->ArrangedCount());
|
2015-01-12 13:12:15 +01:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
bank->NotArranged(index);
|
|
|
|
}
|
2015-01-16 15:45:56 +01:00
|
|
|
|
|
|
|
if (stopGeneration)
|
|
|
|
{
|
|
|
|
break;
|
|
|
|
}
|
2015-01-16 20:34:37 +01:00
|
|
|
} while(bank->LeftArrange() > 0);
|
|
|
|
|
2015-01-17 14:14:28 +01:00
|
|
|
if (stopGeneration)
|
|
|
|
{
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2015-01-16 20:34:37 +01:00
|
|
|
if (paper.Count() > 0)
|
|
|
|
{
|
|
|
|
papers.append(paper);
|
2015-01-12 13:12:15 +01:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2015-01-16 20:34:37 +01:00
|
|
|
state = LayoutErrors::EmptyPaperError;
|
|
|
|
emit Error(state);
|
|
|
|
return;
|
2015-01-12 13:12:15 +01:00
|
|
|
}
|
2015-01-16 20:34:37 +01:00
|
|
|
}
|
2015-01-12 13:12:15 +01:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
state = LayoutErrors::PrepareLayoutError;
|
|
|
|
emit Error(state);
|
|
|
|
return;
|
|
|
|
}
|
2016-02-23 13:13:10 +01:00
|
|
|
|
|
|
|
if (stripOptimizationEnabled)
|
|
|
|
{
|
|
|
|
GatherPages();
|
|
|
|
}
|
|
|
|
|
|
|
|
if (IsUnitePages())
|
|
|
|
{
|
|
|
|
UnitePages();
|
|
|
|
}
|
|
|
|
|
2015-01-15 14:10:05 +01:00
|
|
|
emit Finished();
|
2015-01-12 13:12:15 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
LayoutErrors VLayoutGenerator::State() const
|
|
|
|
{
|
|
|
|
return state;
|
|
|
|
}
|
|
|
|
|
2015-01-13 11:38:51 +01:00
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2015-01-23 11:07:58 +01:00
|
|
|
QList<QGraphicsItem *> VLayoutGenerator::GetPapersItems() const
|
2015-01-13 11:38:51 +01:00
|
|
|
{
|
|
|
|
QList<QGraphicsItem *> list;
|
|
|
|
for (int i=0; i < papers.count(); ++i)
|
|
|
|
{
|
2015-05-02 18:21:47 +02:00
|
|
|
list.append(papers.at(i).GetPaperItem(autoCrop));
|
2015-01-23 11:07:58 +01:00
|
|
|
}
|
|
|
|
return list;
|
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
QList<QList<QGraphicsItem *> > VLayoutGenerator::GetAllDetails() const
|
|
|
|
{
|
|
|
|
QList<QList<QGraphicsItem *> > list;
|
|
|
|
for (int i=0; i < papers.count(); ++i)
|
|
|
|
{
|
2016-02-23 13:13:10 +01:00
|
|
|
list.append(papers.at(i).GetItemDetails());
|
2015-01-13 11:38:51 +01:00
|
|
|
}
|
|
|
|
return list;
|
|
|
|
}
|
|
|
|
|
2015-01-12 13:12:15 +01:00
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
void VLayoutGenerator::Abort()
|
|
|
|
{
|
|
|
|
stopGeneration = true;
|
2015-01-16 15:45:56 +01:00
|
|
|
state = LayoutErrors::ProcessStoped;
|
2015-05-02 19:18:31 +02:00
|
|
|
#if QT_VERSION >= QT_VERSION_CHECK(5, 2, 0)
|
|
|
|
QThreadPool::globalInstance()->clear();
|
|
|
|
#endif
|
2015-01-12 13:12:15 +01:00
|
|
|
}
|
|
|
|
|
2016-02-23 13:13:10 +01:00
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
bool VLayoutGenerator::IsStripOptimization() const
|
|
|
|
{
|
|
|
|
return stripOptimization;
|
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
void VLayoutGenerator::SetStripOptimization(bool value)
|
|
|
|
{
|
|
|
|
stripOptimization = value;
|
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
quint8 VLayoutGenerator::GetMultiplier() const
|
|
|
|
{
|
|
|
|
return multiplier;
|
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
void VLayoutGenerator::SetMultiplier(const quint8 &value)
|
|
|
|
{
|
|
|
|
if (value > 10)
|
|
|
|
{
|
|
|
|
multiplier = 10;
|
|
|
|
}
|
|
|
|
else if (value == 0)
|
|
|
|
{
|
|
|
|
multiplier = 1;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
multiplier = value;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-11-09 12:33:36 +01:00
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
int VLayoutGenerator::PageHeight() const
|
|
|
|
{
|
2015-11-09 12:58:45 +01:00
|
|
|
return static_cast<int>(paperHeight - (margins.top() + margins.bottom()));
|
2015-11-09 12:33:36 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
int VLayoutGenerator::PageWidth() const
|
|
|
|
{
|
2015-11-09 12:58:45 +01:00
|
|
|
return static_cast<int>(paperWidth - (margins.left() + margins.right()));
|
2015-11-09 12:33:36 +01:00
|
|
|
}
|
|
|
|
|
2016-02-23 13:13:10 +01:00
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
void VLayoutGenerator::GatherPages()
|
|
|
|
{
|
|
|
|
if (papers.size() < 2)
|
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
QList<QList<VLayoutDetail>> nDetails;
|
|
|
|
qreal length = 0;
|
|
|
|
int j = 0; // papers count
|
|
|
|
|
|
|
|
for (int i = 0; i < papers.size(); ++i)
|
|
|
|
{
|
|
|
|
const int paperHeight = qRound(papers.at(i).BoundingRect().height());
|
|
|
|
if (length + paperHeight <= PageHeight())
|
|
|
|
{
|
|
|
|
UniteDetails(j, nDetails, length, i);
|
|
|
|
length += paperHeight;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
length = 0; // Start new paper
|
|
|
|
++j;// New paper
|
|
|
|
UniteDetails(j, nDetails, length, i);
|
|
|
|
length += paperHeight;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
QVector<VLayoutPaper> nPapers;
|
|
|
|
for (int i = 0; i < nDetails.size(); ++i)
|
|
|
|
{
|
|
|
|
VLayoutPaper paper(PageHeight(), PageWidth());
|
|
|
|
paper.SetShift(shift);
|
|
|
|
paper.SetLayoutWidth(bank->GetLayoutWidth());
|
2016-05-03 18:50:37 +02:00
|
|
|
paper.SetPaperIndex(static_cast<quint32>(i));
|
2016-02-23 13:13:10 +01:00
|
|
|
paper.SetRotate(rotate);
|
|
|
|
paper.SetRotationIncrease(rotationIncrease);
|
|
|
|
paper.SetSaveLength(saveLength);
|
|
|
|
paper.SetDetails(nDetails.at(i));
|
|
|
|
|
|
|
|
nPapers.append(paper);
|
|
|
|
}
|
|
|
|
|
|
|
|
papers.clear();
|
|
|
|
papers = nPapers;
|
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
void VLayoutGenerator::UnitePages()
|
|
|
|
{
|
|
|
|
if (papers.size() < 2)
|
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
QList<qreal> papersLength;
|
|
|
|
QList<QList<VLayoutDetail> > nDetails;
|
|
|
|
qreal length = 0;
|
|
|
|
int j = 0; // papers count
|
|
|
|
|
|
|
|
for (int i = 0; i < papers.size(); ++i)
|
|
|
|
{
|
|
|
|
int paperHeight = 0;
|
|
|
|
if (autoCrop)
|
|
|
|
{
|
|
|
|
paperHeight = qRound(papers.at(i).BoundingRect().height());
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
paperHeight = papers.at(i).GetHeight();
|
|
|
|
}
|
|
|
|
|
|
|
|
paperHeight = qRound(paperHeight + bank->GetLayoutWidth());
|
|
|
|
|
|
|
|
if (length + paperHeight <= QIMAGE_MAX)
|
|
|
|
{
|
|
|
|
UniteDetails(j, nDetails, length, i);
|
|
|
|
length += paperHeight;
|
|
|
|
UnitePapers(j, papersLength, length);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
length = 0; // Start new paper
|
|
|
|
++j;// New paper
|
|
|
|
UniteDetails(j, nDetails, length, i);
|
|
|
|
length += paperHeight;
|
|
|
|
UnitePapers(j, papersLength, length);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
QVector<VLayoutPaper> nPapers;
|
|
|
|
for (int i = 0; i < nDetails.size(); ++i)
|
|
|
|
{
|
|
|
|
VLayoutPaper paper(qFloor(papersLength.at(i)), PageWidth());
|
|
|
|
paper.SetShift(shift);
|
|
|
|
paper.SetLayoutWidth(bank->GetLayoutWidth());
|
2016-05-03 18:50:37 +02:00
|
|
|
paper.SetPaperIndex(static_cast<quint32>(i));
|
2016-02-23 13:13:10 +01:00
|
|
|
paper.SetRotate(rotate);
|
|
|
|
paper.SetRotationIncrease(rotationIncrease);
|
|
|
|
paper.SetSaveLength(saveLength);
|
|
|
|
paper.SetDetails(nDetails.at(i));
|
|
|
|
|
|
|
|
nPapers.append(paper);
|
|
|
|
}
|
|
|
|
|
|
|
|
papers.clear();
|
|
|
|
papers = nPapers;
|
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
void VLayoutGenerator::UniteDetails(int j, QList<QList<VLayoutDetail> > &nDetails, qreal length, int i)
|
|
|
|
{
|
|
|
|
if ((j == 0 && nDetails.isEmpty()) || j >= nDetails.size())
|
|
|
|
{//First or new details in paper
|
|
|
|
nDetails.insert(j, MoveDetails(length, papers.at(i).GetDetails()));
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
nDetails[j].append(MoveDetails(length, papers.at(i).GetDetails()));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
void VLayoutGenerator::UnitePapers(int j, QList<qreal> &papersLength, qreal length)
|
|
|
|
{
|
|
|
|
if ((j == 0 && papersLength.isEmpty()) || j >= papersLength.size())
|
|
|
|
{
|
|
|
|
papersLength.insert(j, length);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
papersLength[j] = length;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
QList<VLayoutDetail> VLayoutGenerator::MoveDetails(qreal length, const QVector<VLayoutDetail> &details)
|
|
|
|
{
|
|
|
|
if (qFuzzyIsNull(length))
|
|
|
|
{
|
|
|
|
return details.toList();
|
|
|
|
}
|
|
|
|
|
|
|
|
QList<VLayoutDetail> newDetails;
|
|
|
|
for (int i = 0; i < details.size(); ++i)
|
|
|
|
{
|
|
|
|
VLayoutDetail d = details.at(i);
|
|
|
|
d.Translate(0, length);
|
|
|
|
newDetails.append(d);
|
|
|
|
}
|
|
|
|
|
|
|
|
return newDetails;
|
|
|
|
}
|
|
|
|
|
2015-05-18 13:26:37 +02:00
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
bool VLayoutGenerator::IsUnitePages() const
|
|
|
|
{
|
|
|
|
return unitePages;
|
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
void VLayoutGenerator::SetUnitePages(bool value)
|
|
|
|
{
|
|
|
|
unitePages = value;
|
|
|
|
}
|
|
|
|
|
2015-05-08 12:10:56 +02:00
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
bool VLayoutGenerator::IsSaveLength() const
|
|
|
|
{
|
|
|
|
return saveLength;
|
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
void VLayoutGenerator::SetSaveLength(bool value)
|
|
|
|
{
|
|
|
|
saveLength = value;
|
|
|
|
}
|
|
|
|
|
2015-05-02 18:21:47 +02:00
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
bool VLayoutGenerator::GetAutoCrop() const
|
|
|
|
{
|
|
|
|
return autoCrop;
|
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
void VLayoutGenerator::SetAutoCrop(bool value)
|
|
|
|
{
|
|
|
|
autoCrop = value;
|
|
|
|
}
|
|
|
|
|
2015-01-22 15:11:50 +01:00
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2015-04-15 14:44:57 +02:00
|
|
|
// cppcheck-suppress unusedFunction
|
2015-01-22 15:11:50 +01:00
|
|
|
int VLayoutGenerator::GetRotationIncrease() const
|
|
|
|
{
|
|
|
|
return rotationIncrease;
|
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
void VLayoutGenerator::SetRotationIncrease(int value)
|
|
|
|
{
|
|
|
|
rotationIncrease = value;
|
|
|
|
|
|
|
|
if ((rotationIncrease >= 1 && rotationIncrease <= 180 && 360 % rotationIncrease == 0) == false)
|
|
|
|
{
|
|
|
|
rotationIncrease = 180;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
bool VLayoutGenerator::GetRotate() const
|
|
|
|
{
|
|
|
|
return rotate;
|
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
void VLayoutGenerator::SetRotate(bool value)
|
|
|
|
{
|
|
|
|
rotate = value;
|
|
|
|
}
|
|
|
|
|
2015-01-12 13:12:15 +01:00
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2015-11-09 12:58:45 +01:00
|
|
|
qreal VLayoutGenerator::GetPaperWidth() const
|
2015-01-12 13:12:15 +01:00
|
|
|
{
|
|
|
|
return paperWidth;
|
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2015-11-09 12:58:45 +01:00
|
|
|
void VLayoutGenerator::SetPaperWidth(qreal value)
|
2015-01-12 13:12:15 +01:00
|
|
|
{
|
|
|
|
paperWidth = value;
|
|
|
|
}
|
|
|
|
|
2015-11-09 12:33:36 +01:00
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
QMarginsF VLayoutGenerator::GetFields() const
|
|
|
|
{
|
|
|
|
return margins;
|
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
void VLayoutGenerator::SetFields(const QMarginsF &value)
|
|
|
|
{
|
|
|
|
margins = value;
|
|
|
|
}
|
|
|
|
|
2015-01-12 16:23:25 +01:00
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2015-10-26 09:36:07 +01:00
|
|
|
quint32 VLayoutGenerator::GetShift() const
|
2015-01-12 16:23:25 +01:00
|
|
|
{
|
|
|
|
return shift;
|
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2015-10-26 09:36:07 +01:00
|
|
|
void VLayoutGenerator::SetShift(quint32 shift)
|
2015-01-12 16:23:25 +01:00
|
|
|
{
|
|
|
|
this->shift = shift;
|
|
|
|
}
|
|
|
|
|
2015-01-12 13:12:15 +01:00
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2015-11-09 12:58:45 +01:00
|
|
|
qreal VLayoutGenerator::GetPaperHeight() const
|
2015-01-12 13:12:15 +01:00
|
|
|
{
|
|
|
|
return paperHeight;
|
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2015-11-09 12:58:45 +01:00
|
|
|
void VLayoutGenerator::SetPaperHeight(qreal value)
|
2015-01-12 13:12:15 +01:00
|
|
|
{
|
|
|
|
paperHeight = value;
|
|
|
|
}
|