Seamly2D
Code documentation
VPosition Class Reference

#include <vposition.h>

Inheritance diagram for VPosition:
Collaboration diagram for VPosition:

Public Member Functions

 VPosition (const VContour &gContour, int j, const VLayoutPiece &piece, int i, std::atomic_bool *stop, bool rotate, int rotationIncrease, bool saveLength)
 
virtual ~VPosition () Q_DECL_OVERRIDE
 
quint32 getPaperIndex () const
 
void setPaperIndex (const quint32 &value)
 
quint32 getFrame () const
 
void setFrame (const quint32 &value)
 
quint32 getPieceCount () const
 
void setPieceCount (const quint32 &value)
 
void setPieces (const QVector< VLayoutPiece > &pieces)
 
VBestSquare getBestResult () const
 

Static Public Member Functions

static void DrawDebug (const VContour &contour, const VLayoutPiece &piece, int frame, quint32 paperIndex, int piecesCount, const QVector< VLayoutPiece > &pieces=QVector< VLayoutPiece >())
 
static int Bias (int length, int maxLength)
 

Private Types

enum class  CrossingType : char { NoIntersection = 0 , Intersection = 1 , EdgeError = 2 }
 
enum class  InsideType : char { Outside = 0 , Inside = 1 , EdgeError = 2 }
 

Private Member Functions

virtual void run () Q_DECL_OVERRIDE
 
void SaveCandidate (VBestSquare &bestResult, const VLayoutPiece &piece, int globalI, int detJ, BestFrom type)
 
bool CheckCombineEdges (VLayoutPiece &piece, int j, int &dEdge)
 
bool CheckRotationEdges (VLayoutPiece &piece, int j, int dEdge, int angle) const
 
CrossingType Crossing (const VLayoutPiece &piece) const
 
bool SheetContains (const QRectF &rect) const
 
void CombineEdges (VLayoutPiece &piece, const QLineF &globalEdge, const int &dEdge)
 
void RotateEdges (VLayoutPiece &piece, const QLineF &globalEdge, int dEdge, int angle) const
 
void Rotate (int increase)
 

Static Private Member Functions

static QPainterPath ShowDirection (const QLineF &edge)
 
static QPainterPath DrawContour (const QVector< QPointF > &points)
 
static QPainterPath drawPieces (const QVector< VLayoutPiece > &pieces)
 

Private Attributes

VBestSquare bestResult
 
const VContour gContour
 
const VLayoutPiece piece
 
int i
 
int j
 
quint32 paperIndex
 
quint32 frame
 
quint32 piecesCount
 
QVector< VLayoutPiecepieces
 
std::atomic_bool * stop
 
bool rotate
 
int rotationIncrease
 
qreal angle_between
 angle_between keep angle between global edge and piece edge. Need for optimization rotation. More...
 

Detailed Description

Definition at line 67 of file vposition.h.

Member Enumeration Documentation

◆ CrossingType

enum VPosition::CrossingType : char
strongprivate
Enumerator
NoIntersection 
Intersection 
EdgeError 

Definition at line 111 of file vposition.h.

◆ InsideType

enum VPosition::InsideType : char
strongprivate
Enumerator
Outside 
Inside 
EdgeError 

Definition at line 118 of file vposition.h.

Constructor & Destructor Documentation

◆ VPosition()

VPosition::VPosition ( const VContour gContour,
int  j,
const VLayoutPiece piece,
int  i,
std::atomic_bool *  stop,
bool  rotate,
int  rotationIncrease,
bool  saveLength 
)

Definition at line 77 of file vposition.cpp.

References rotationIncrease.

◆ ~VPosition()

virtual VPosition::~VPosition ( )
inlinevirtual

Definition at line 72 of file vposition.h.

Member Function Documentation

◆ Bias()

int VPosition::Bias ( int  length,
int  maxLength 
)
static

Definition at line 267 of file vposition.cpp.

Referenced by DrawDebug().

◆ CheckCombineEdges()

◆ CheckRotationEdges()

bool VPosition::CheckRotationEdges ( VLayoutPiece piece,
int  j,
int  dEdge,
int  angle 
) const
private

◆ CombineEdges()

void VPosition::CombineEdges ( VLayoutPiece piece,
const QLineF &  globalEdge,
const int &  dEdge 
)
private

◆ Crossing()

◆ DrawContour()

QPainterPath VPosition::DrawContour ( const QVector< QPointF > &  points)
staticprivate

Definition at line 556 of file vposition.cpp.

References i, and ShowDirection().

Referenced by DrawDebug().

◆ DrawDebug()

void VPosition::DrawDebug ( const VContour contour,
const VLayoutPiece piece,
int  frame,
quint32  paperIndex,
int  piecesCount,
const QVector< VLayoutPiece > &  pieces = QVector<VLayoutPiece>() 
)
static

◆ drawPieces()

QPainterPath VPosition::drawPieces ( const QVector< VLayoutPiece > &  pieces)
staticprivate

Definition at line 587 of file vposition.cpp.

References i, and pieces.

Referenced by DrawDebug().

◆ getBestResult()

VBestSquare VPosition::getBestResult ( ) const

Definition at line 183 of file vposition.cpp.

References bestResult.

◆ getFrame()

quint32 VPosition::getFrame ( ) const

Definition at line 152 of file vposition.cpp.

References frame.

◆ getPaperIndex()

quint32 VPosition::getPaperIndex ( ) const

Definition at line 139 of file vposition.cpp.

References paperIndex.

◆ getPieceCount()

quint32 VPosition::getPieceCount ( ) const

Definition at line 165 of file vposition.cpp.

References piecesCount.

◆ Rotate()

void VPosition::Rotate ( int  increase)
private

◆ RotateEdges()

void VPosition::RotateEdges ( VLayoutPiece piece,
const QLineF &  globalEdge,
int  dEdge,
int  angle 
) const
private

◆ run()

void VPosition::run ( )
privatevirtual

◆ SaveCandidate()

void VPosition::SaveCandidate ( VBestSquare bestResult,
const VLayoutPiece piece,
int  globalI,
int  detJ,
BestFrom  type 
)
private

◆ setFrame()

void VPosition::setFrame ( const quint32 &  value)

Definition at line 158 of file vposition.cpp.

References frame.

Referenced by VLayoutPaper::AddToSheet().

◆ setPaperIndex()

void VPosition::setPaperIndex ( const quint32 &  value)

Definition at line 145 of file vposition.cpp.

References paperIndex.

Referenced by VLayoutPaper::AddToSheet().

◆ setPieceCount()

void VPosition::setPieceCount ( const quint32 &  value)

Definition at line 171 of file vposition.cpp.

References piecesCount.

Referenced by VLayoutPaper::AddToSheet().

◆ setPieces()

void VPosition::setPieces ( const QVector< VLayoutPiece > &  pieces)

Definition at line 177 of file vposition.cpp.

References pieces.

Referenced by VLayoutPaper::AddToSheet().

◆ SheetContains()

bool VPosition::SheetContains ( const QRectF &  rect) const
private

Definition at line 435 of file vposition.cpp.

References gContour, VContour::GetHeight(), and VContour::GetWidth().

Referenced by CheckCombineEdges(), and CheckRotationEdges().

◆ ShowDirection()

QPainterPath VPosition::ShowDirection ( const QLineF &  edge)
staticprivate

Definition at line 528 of file vposition.cpp.

Referenced by DrawContour().

Member Data Documentation

◆ angle_between

qreal VPosition::angle_between
private

angle_between keep angle between global edge and piece edge. Need for optimization rotation.

Definition at line 109 of file vposition.h.

Referenced by CombineEdges(), and Rotate().

◆ bestResult

VBestSquare VPosition::bestResult
private

Definition at line 94 of file vposition.h.

Referenced by getBestResult(), Rotate(), run(), and SaveCandidate().

◆ frame

quint32 VPosition::frame
private

◆ gContour

const VContour VPosition::gContour
private

◆ i

int VPosition::i
private

Definition at line 97 of file vposition.h.

Referenced by DrawContour(), drawPieces(), Rotate(), and run().

◆ j

int VPosition::j
private

Definition at line 98 of file vposition.h.

Referenced by CheckCombineEdges(), CheckRotationEdges(), Rotate(), and run().

◆ paperIndex

quint32 VPosition::paperIndex
private

◆ piece

const VLayoutPiece VPosition::piece
private

◆ pieces

QVector<VLayoutPiece> VPosition::pieces
private

◆ piecesCount

quint32 VPosition::piecesCount
private

◆ rotate

bool VPosition::rotate
private

Definition at line 104 of file vposition.h.

Referenced by run().

◆ rotationIncrease

int VPosition::rotationIncrease
private

Definition at line 105 of file vposition.h.

Referenced by run(), and VPosition().

◆ stop

std::atomic_bool* VPosition::stop
private

Definition at line 103 of file vposition.h.

Referenced by Rotate(), and run().


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