54 #include <QGraphicsRectItem>
56 #include <QThreadPool>
58 #include "../vmisc/def.h"
59 #include "../vmisc/vmath.h"
71 usePrinterFields(true),
74 stopGeneration(ATOMIC_VAR_INIT(false)),
76 stopGeneration(false),
81 rotationIncrease(180),
85 stripOptimizationEnabled(false),
87 stripOptimization(false),
130 const QString path = QDir::homePath()+QStringLiteral(
"/LayoutDebug");
132 debugDir.removeRecursively();
133 debugDir.mkpath(path);
150 height = qFloor(height / qFloor(height/b));
192 if (paper.
Count() > 0)
234 for (
int i=0; i <
papers.count(); ++i)
245 for (
int i=0; i <
papers.count(); ++i)
256 for (
int i=0; i <
papers.count(); ++i)
258 list.append(
papers.at(i).getPieces());
268 QThreadPool::globalInstance()->clear();
342 for (
int i = 0; i <
papers.size(); ++i)
366 for (
int i = 0; i < pieces.size(); ++i)
377 nPapers.append(paper);
397 for (
int i = 0; i <
papers.size(); ++i)
431 for (
int i = 0; i < pieces.size(); ++i)
442 nPapers.append(paper);
452 if ((j == 0 && pieces.isEmpty()) || j >= pieces.size())
465 if ((j == 0 && papersLength.isEmpty()) || j >= papersLength.size())
467 papersLength.insert(j, length);
471 papersLength[j] = length;
478 if (qFuzzyIsNull(length))
480 return pieces.toList();
484 for (
int i = 0; i < pieces.size(); ++i)
void SetCaseType(Cases caseType)
void SetLayoutWidth(const qreal &value)
int ArrangedCount() const
int allPieceCount() const
VLayoutPiece getPiece(int i) const
void setPieces(const QVector< VLayoutPiece > &pieces)
qreal GetLayoutWidth() const
qreal GetBiggestDiagonal() const
qreal GetPaperHeight() const
void SetPaperHeight(qreal value)
void SetLayoutWidth(qreal width)
void SetPaperWidth(qreal value)
Q_REQUIRED_RESULT QList< QGraphicsItem * > GetPapersItems() const
void SetAutoCrop(bool value)
void setPieces(const QVector< VLayoutPiece > &details)
bool stripOptimizationEnabled
int GetRotationIncrease() const
void SetUnitePages(bool value)
quint8 GetMultiplier() const
void UnitePapers(int j, QList< qreal > &papersLength, qreal length)
void SetRotationIncrease(int value)
QList< VLayoutPiece > movePieces(qreal length, const QVector< VLayoutPiece > &pieces)
Q_REQUIRED_RESULT QList< QList< QGraphicsItem * > > getAllPieceItems() const
bool IsUnitePages() const
void SetRotate(bool value)
void SetTestAsPaths(bool value)
virtual ~VLayoutGenerator() Q_DECL_OVERRIDE
void SetPrinterFields(bool usePrinterFields, const QMarginsF &value)
bool IsSaveLength() const
void SetCaseType(Cases caseType)
qreal GetPaperWidth() const
void unitePieces(int j, QList< QList< VLayoutPiece > > &pieces, qreal length, int i)
QMarginsF GetPrinterFields() const
void SetMultiplier(const quint8 &value)
std::atomic_bool stopGeneration
void SetStripOptimization(bool value)
void SetShift(quint32 shift)
LayoutErrors State() const
void Error(const LayoutErrors &state)
bool IsTestAsPaths() const
QVector< VLayoutPaper > papers
bool IsStripOptimization() const
VLayoutGenerator(QObject *parent=nullptr)
QVector< QVector< VLayoutPiece > > getAllPieces() const
void SetSaveLength(bool value)
bool IsUsePrinterFields() const
bool arrangePiece(const VLayoutPiece &piece, std::atomic_bool &stop)
void setPieces(const QList< VLayoutPiece > &pieces)
void SetRotationIncrease(int value)
void SetShift(quint32 shift)
void SetSaveLength(bool value)
void SetRotate(bool value)
void SetPaperIndex(quint32 index)
void SetLayoutWidth(qreal width)
void Translate(qreal dx, qreal dy)