Seamly2D
Code documentation
VLayoutGenerator Class Reference

#include <vlayoutgenerator.h>

Inheritance diagram for VLayoutGenerator:
Collaboration diagram for VLayoutGenerator:

Public Slots

void Abort ()
 

Signals

void Start ()
 
void Arranged (int count)
 
void Error (const LayoutErrors &state)
 
void Finished ()
 

Public Member Functions

 VLayoutGenerator (QObject *parent=nullptr)
 
virtual ~VLayoutGenerator () Q_DECL_OVERRIDE
 
void setPieces (const QVector< VLayoutPiece > &details)
 
void SetLayoutWidth (qreal width)
 
void SetCaseType (Cases caseType)
 
int PieceCount ()
 
qreal GetPaperHeight () const
 
void SetPaperHeight (qreal value)
 
qreal GetPaperWidth () const
 
void SetPaperWidth (qreal value)
 
bool IsUsePrinterFields () const
 
QMarginsF GetPrinterFields () const
 
void SetPrinterFields (bool usePrinterFields, const QMarginsF &value)
 
quint32 GetShift () const
 
void SetShift (quint32 shift)
 
void Generate ()
 
LayoutErrors State () const
 
Q_REQUIRED_RESULT QList< QGraphicsItem * > GetPapersItems () const
 
Q_REQUIRED_RESULT QList< QList< QGraphicsItem * > > getAllPieceItems () const
 
QVector< QVector< VLayoutPiece > > getAllPieces () const
 
bool GetRotate () const
 
void SetRotate (bool value)
 
int GetRotationIncrease () const
 
void SetRotationIncrease (int value)
 
bool GetAutoCrop () const
 
void SetAutoCrop (bool value)
 
bool IsSaveLength () const
 
void SetSaveLength (bool value)
 
bool IsUnitePages () const
 
void SetUnitePages (bool value)
 
quint8 GetMultiplier () const
 
void SetMultiplier (const quint8 &value)
 
bool IsStripOptimization () const
 
void SetStripOptimization (bool value)
 
bool IsTestAsPaths () const
 
void SetTestAsPaths (bool value)
 

Private Member Functions

int PageHeight () const
 
int PageWidth () const
 
void GatherPages ()
 
void UnitePages ()
 
void unitePieces (int j, QList< QList< VLayoutPiece > > &pieces, qreal length, int i)
 
void UnitePapers (int j, QList< qreal > &papersLength, qreal length)
 
QList< VLayoutPiecemovePieces (qreal length, const QVector< VLayoutPiece > &pieces)
 

Private Attributes

QVector< VLayoutPaperpapers
 
VBankbank
 
qreal paperHeight
 
qreal paperWidth
 
QMarginsF margins
 
bool usePrinterFields
 
std::atomic_bool stopGeneration
 
LayoutErrors state
 
quint32 shift
 
bool rotate
 
int rotationIncrease
 
bool autoCrop
 
bool saveLength
 
bool unitePages
 
bool stripOptimizationEnabled
 
quint8 multiplier
 
bool stripOptimization
 
bool textAsPaths
 

Detailed Description

Definition at line 74 of file vlayoutgenerator.h.

Constructor & Destructor Documentation

◆ VLayoutGenerator()

VLayoutGenerator::VLayoutGenerator ( QObject *  parent = nullptr)
explicit

Definition at line 64 of file vlayoutgenerator.cpp.

◆ ~VLayoutGenerator()

VLayoutGenerator::~VLayoutGenerator ( )
virtual

Definition at line 92 of file vlayoutgenerator.cpp.

References bank.

Member Function Documentation

◆ Abort

void VLayoutGenerator::Abort ( )
slot

Definition at line 264 of file vlayoutgenerator.cpp.

References ProcessStoped, state, and stopGeneration.

Referenced by MainWindowsNoGUI::LayoutSettings().

◆ Arranged

void VLayoutGenerator::Arranged ( int  count)
signal

◆ Error

void VLayoutGenerator::Error ( const LayoutErrors state)
signal

◆ Finished

void VLayoutGenerator::Finished ( )
signal

◆ GatherPages()

◆ Generate()

◆ getAllPieceItems()

QList< QList< QGraphicsItem * > > VLayoutGenerator::getAllPieceItems ( ) const

Definition at line 242 of file vlayoutgenerator.cpp.

References IsTestAsPaths(), and papers.

Referenced by MainWindowsNoGUI::LayoutSettings().

◆ getAllPieces()

QVector< QVector< VLayoutPiece > > VLayoutGenerator::getAllPieces ( ) const

Definition at line 253 of file vlayoutgenerator.cpp.

References papers.

Referenced by MainWindowsNoGUI::LayoutSettings().

◆ GetAutoCrop()

bool VLayoutGenerator::GetAutoCrop ( ) const

Definition at line 519 of file vlayoutgenerator.cpp.

References autoCrop.

Referenced by MainWindowsNoGUI::LayoutSettings().

◆ GetMultiplier()

quint8 VLayoutGenerator::GetMultiplier ( ) const

Definition at line 296 of file vlayoutgenerator.cpp.

References multiplier.

◆ GetPaperHeight()

qreal VLayoutGenerator::GetPaperHeight ( ) const

Definition at line 604 of file vlayoutgenerator.cpp.

References paperHeight.

Referenced by MainWindowsNoGUI::LayoutSettings().

◆ GetPapersItems()

QList< QGraphicsItem * > VLayoutGenerator::GetPapersItems ( ) const

Definition at line 231 of file vlayoutgenerator.cpp.

References autoCrop, IsTestAsPaths(), and papers.

Referenced by MainWindowsNoGUI::LayoutSettings().

◆ GetPaperWidth()

qreal VLayoutGenerator::GetPaperWidth ( ) const

Definition at line 561 of file vlayoutgenerator.cpp.

References paperWidth.

Referenced by MainWindowsNoGUI::LayoutSettings().

◆ GetPrinterFields()

QMarginsF VLayoutGenerator::GetPrinterFields ( ) const

Definition at line 579 of file vlayoutgenerator.cpp.

References margins.

Referenced by MainWindowsNoGUI::LayoutSettings().

◆ GetRotate()

bool VLayoutGenerator::GetRotate ( ) const

Definition at line 549 of file vlayoutgenerator.cpp.

References rotate.

◆ GetRotationIncrease()

int VLayoutGenerator::GetRotationIncrease ( ) const

Definition at line 532 of file vlayoutgenerator.cpp.

References rotationIncrease.

◆ GetShift()

quint32 VLayoutGenerator::GetShift ( ) const

Definition at line 592 of file vlayoutgenerator.cpp.

References shift.

◆ IsSaveLength()

bool VLayoutGenerator::IsSaveLength ( ) const

Definition at line 507 of file vlayoutgenerator.cpp.

References saveLength.

◆ IsStripOptimization()

bool VLayoutGenerator::IsStripOptimization ( ) const

Definition at line 272 of file vlayoutgenerator.cpp.

References stripOptimization.

◆ IsTestAsPaths()

bool VLayoutGenerator::IsTestAsPaths ( ) const

Definition at line 284 of file vlayoutgenerator.cpp.

References textAsPaths.

Referenced by getAllPieceItems(), and GetPapersItems().

◆ IsUnitePages()

bool VLayoutGenerator::IsUnitePages ( ) const

Definition at line 495 of file vlayoutgenerator.cpp.

References unitePages.

Referenced by Generate(), and MainWindowsNoGUI::LayoutSettings().

◆ IsUsePrinterFields()

bool VLayoutGenerator::IsUsePrinterFields ( ) const

Definition at line 573 of file vlayoutgenerator.cpp.

References usePrinterFields.

Referenced by MainWindowsNoGUI::LayoutSettings().

◆ movePieces()

QList< VLayoutPiece > VLayoutGenerator::movePieces ( qreal  length,
const QVector< VLayoutPiece > &  pieces 
)
private

Definition at line 476 of file vlayoutgenerator.cpp.

References VLayoutPiece::Translate().

Referenced by unitePieces().

◆ PageHeight()

int VLayoutGenerator::PageHeight ( ) const
private

Definition at line 319 of file vlayoutgenerator.cpp.

References margins, and paperHeight.

Referenced by GatherPages(), and Generate().

◆ PageWidth()

int VLayoutGenerator::PageWidth ( ) const
private

Definition at line 325 of file vlayoutgenerator.cpp.

References margins, and paperWidth.

Referenced by GatherPages(), Generate(), and UnitePages().

◆ PieceCount()

int VLayoutGenerator::PieceCount ( )

Definition at line 117 of file vlayoutgenerator.cpp.

References VBank::allPieceCount(), and bank.

◆ SetAutoCrop()

void VLayoutGenerator::SetAutoCrop ( bool  value)

Definition at line 525 of file vlayoutgenerator.cpp.

References autoCrop.

Referenced by DialogLayoutSettings::DialogAccepted().

◆ SetCaseType()

void VLayoutGenerator::SetCaseType ( Cases  caseType)

Definition at line 110 of file vlayoutgenerator.cpp.

References bank, and VBank::SetCaseType().

Referenced by DialogLayoutSettings::DialogAccepted().

◆ SetLayoutWidth()

void VLayoutGenerator::SetLayoutWidth ( qreal  width)

Definition at line 104 of file vlayoutgenerator.cpp.

References bank, and VBank::SetLayoutWidth().

Referenced by DialogLayoutSettings::DialogAccepted().

◆ SetMultiplier()

void VLayoutGenerator::SetMultiplier ( const quint8 &  value)

Definition at line 302 of file vlayoutgenerator.cpp.

References multiplier.

Referenced by DialogLayoutSettings::DialogAccepted().

◆ SetPaperHeight()

void VLayoutGenerator::SetPaperHeight ( qreal  value)

Definition at line 610 of file vlayoutgenerator.cpp.

References paperHeight.

Referenced by DialogLayoutSettings::DialogAccepted().

◆ SetPaperWidth()

void VLayoutGenerator::SetPaperWidth ( qreal  value)

Definition at line 567 of file vlayoutgenerator.cpp.

References paperWidth.

Referenced by DialogLayoutSettings::DialogAccepted().

◆ setPieces()

void VLayoutGenerator::setPieces ( const QVector< VLayoutPiece > &  details)

Definition at line 98 of file vlayoutgenerator.cpp.

References bank, and VBank::setPieces().

Referenced by MainWindowsNoGUI::LayoutSettings().

◆ SetPrinterFields()

void VLayoutGenerator::SetPrinterFields ( bool  usePrinterFields,
const QMarginsF &  value 
)

Definition at line 585 of file vlayoutgenerator.cpp.

References margins, and usePrinterFields.

Referenced by DialogLayoutSettings::DialogAccepted().

◆ SetRotate()

void VLayoutGenerator::SetRotate ( bool  value)

Definition at line 555 of file vlayoutgenerator.cpp.

References rotate.

Referenced by DialogLayoutSettings::DialogAccepted().

◆ SetRotationIncrease()

void VLayoutGenerator::SetRotationIncrease ( int  value)

Definition at line 538 of file vlayoutgenerator.cpp.

References rotationIncrease.

Referenced by DialogLayoutSettings::DialogAccepted().

◆ SetSaveLength()

void VLayoutGenerator::SetSaveLength ( bool  value)

Definition at line 513 of file vlayoutgenerator.cpp.

References saveLength.

Referenced by DialogLayoutSettings::DialogAccepted().

◆ SetShift()

void VLayoutGenerator::SetShift ( quint32  shift)

Definition at line 598 of file vlayoutgenerator.cpp.

References shift.

Referenced by DialogLayoutSettings::DialogAccepted().

◆ SetStripOptimization()

void VLayoutGenerator::SetStripOptimization ( bool  value)

Definition at line 278 of file vlayoutgenerator.cpp.

References stripOptimization.

Referenced by DialogLayoutSettings::DialogAccepted().

◆ SetTestAsPaths()

void VLayoutGenerator::SetTestAsPaths ( bool  value)

Definition at line 290 of file vlayoutgenerator.cpp.

References textAsPaths.

Referenced by DialogLayoutSettings::DialogAccepted().

◆ SetUnitePages()

void VLayoutGenerator::SetUnitePages ( bool  value)

Definition at line 501 of file vlayoutgenerator.cpp.

References unitePages.

Referenced by DialogLayoutSettings::DialogAccepted().

◆ Start

void VLayoutGenerator::Start ( )
signal

◆ State()

LayoutErrors VLayoutGenerator::State ( ) const

Definition at line 225 of file vlayoutgenerator.cpp.

References state.

Referenced by MainWindowsNoGUI::LayoutSettings().

◆ UnitePages()

◆ UnitePapers()

void VLayoutGenerator::UnitePapers ( int  j,
QList< qreal > &  papersLength,
qreal  length 
)
private

Definition at line 463 of file vlayoutgenerator.cpp.

Referenced by UnitePages().

◆ unitePieces()

void VLayoutGenerator::unitePieces ( int  j,
QList< QList< VLayoutPiece > > &  pieces,
qreal  length,
int  i 
)
private

Definition at line 450 of file vlayoutgenerator.cpp.

References movePieces(), and papers.

Referenced by GatherPages(), and UnitePages().

Member Data Documentation

◆ autoCrop

bool VLayoutGenerator::autoCrop
private

Definition at line 154 of file vlayoutgenerator.h.

Referenced by GetAutoCrop(), GetPapersItems(), SetAutoCrop(), and UnitePages().

◆ bank

VBank* VLayoutGenerator::bank
private

◆ margins

QMarginsF VLayoutGenerator::margins
private

Definition at line 147 of file vlayoutgenerator.h.

Referenced by GetPrinterFields(), PageHeight(), PageWidth(), and SetPrinterFields().

◆ multiplier

quint8 VLayoutGenerator::multiplier
private

Definition at line 158 of file vlayoutgenerator.h.

Referenced by Generate(), GetMultiplier(), and SetMultiplier().

◆ paperHeight

qreal VLayoutGenerator::paperHeight
private

◆ papers

QVector<VLayoutPaper> VLayoutGenerator::papers
private

◆ paperWidth

qreal VLayoutGenerator::paperWidth
private

Definition at line 146 of file vlayoutgenerator.h.

Referenced by GetPaperWidth(), PageWidth(), and SetPaperWidth().

◆ rotate

bool VLayoutGenerator::rotate
private

Definition at line 152 of file vlayoutgenerator.h.

Referenced by GatherPages(), Generate(), GetRotate(), SetRotate(), and UnitePages().

◆ rotationIncrease

int VLayoutGenerator::rotationIncrease
private

◆ saveLength

bool VLayoutGenerator::saveLength
private

Definition at line 155 of file vlayoutgenerator.h.

Referenced by GatherPages(), Generate(), IsSaveLength(), SetSaveLength(), and UnitePages().

◆ shift

quint32 VLayoutGenerator::shift
private

Definition at line 151 of file vlayoutgenerator.h.

Referenced by GatherPages(), Generate(), GetShift(), SetShift(), and UnitePages().

◆ state

LayoutErrors VLayoutGenerator::state
private

Definition at line 150 of file vlayoutgenerator.h.

Referenced by Abort(), Generate(), and State().

◆ stopGeneration

std::atomic_bool VLayoutGenerator::stopGeneration
private

Definition at line 149 of file vlayoutgenerator.h.

Referenced by Abort(), and Generate().

◆ stripOptimization

bool VLayoutGenerator::stripOptimization
private

Definition at line 159 of file vlayoutgenerator.h.

Referenced by Generate(), IsStripOptimization(), and SetStripOptimization().

◆ stripOptimizationEnabled

bool VLayoutGenerator::stripOptimizationEnabled
private

Definition at line 157 of file vlayoutgenerator.h.

Referenced by Generate().

◆ textAsPaths

bool VLayoutGenerator::textAsPaths
private

Definition at line 160 of file vlayoutgenerator.h.

Referenced by IsTestAsPaths(), and SetTestAsPaths().

◆ unitePages

bool VLayoutGenerator::unitePages
private

Definition at line 156 of file vlayoutgenerator.h.

Referenced by IsUnitePages(), and SetUnitePages().

◆ usePrinterFields

bool VLayoutGenerator::usePrinterFields
private

Definition at line 148 of file vlayoutgenerator.h.

Referenced by IsUsePrinterFields(), and SetPrinterFields().


The documentation for this class was generated from the following files: