#include <vposition.h>
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< VLayoutPiece > | pieces |
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... | |
Definition at line 67 of file vposition.h.
|
strongprivate |
Enumerator | |
---|---|
NoIntersection | |
Intersection | |
EdgeError |
Definition at line 111 of file vposition.h.
|
strongprivate |
Enumerator | |
---|---|
Outside | |
Inside | |
EdgeError |
Definition at line 118 of file vposition.h.
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.
|
inlinevirtual |
Definition at line 72 of file vposition.h.
|
static |
Definition at line 267 of file vposition.cpp.
Referenced by DrawDebug().
|
private |
Definition at line 290 of file vposition.cpp.
References CombineEdges(), Crossing(), DrawDebug(), EdgeError, frame, gContour, VContour::GetContour(), VContour::GlobalEdge(), Intersection, VAbstractPiece::IsForbidFlipping(), j, VLayoutPiece::LayoutEdgeByPoint(), VLayoutPiece::Mirror(), NoIntersection, paperIndex, piece, VLayoutPiece::pieceBoundingRect(), VLayoutPiece::pieceEdgeByPoint(), pieces, piecesCount, and SheetContains().
Referenced by run().
|
private |
Definition at line 378 of file vposition.cpp.
References Crossing(), DrawDebug(), EdgeError, frame, gContour, VContour::GlobalEdge(), Intersection, j, NoIntersection, paperIndex, piece, VLayoutPiece::pieceBoundingRect(), pieces, piecesCount, RotateEdges(), and SheetContains().
Referenced by Rotate().
|
private |
Definition at line 442 of file vposition.cpp.
References angle_between, gContour, VContour::GetContour(), VLayoutPiece::LayoutEdge(), piece, VLayoutPiece::pieceEdge(), VLayoutPiece::Rotate(), and VLayoutPiece::Translate().
Referenced by CheckCombineEdges().
|
private |
Definition at line 414 of file vposition.cpp.
References VContour::BoundingRect(), VContour::ContourPath(), VLayoutPiece::createMainPath(), gContour, Intersection, VLayoutPiece::LayoutAllowancePath(), VLayoutPiece::LayoutBoundingRect(), NoIntersection, piece, and VLayoutPiece::pieceBoundingRect().
Referenced by CheckCombineEdges(), and CheckRotationEdges().
|
staticprivate |
Definition at line 556 of file vposition.cpp.
References i, and ShowDirection().
Referenced by DrawDebug().
|
static |
Definition at line 189 of file vposition.cpp.
References Bias(), VContour::CutEmptySheetEdge(), DrawContour(), drawPieces(), frame, VContour::GetContour(), VContour::GetHeight(), VLayoutPiece::getLayoutAllowancePoints(), VContour::GetWidth(), paperIndex, piece, pieces, piecesCount, and QIMAGE_MAX.
Referenced by CheckCombineEdges(), CheckRotationEdges(), Rotate(), run(), and VLayoutPaper::SaveResult().
|
staticprivate |
VBestSquare VPosition::getBestResult | ( | ) | const |
Definition at line 183 of file vposition.cpp.
References bestResult.
quint32 VPosition::getFrame | ( | ) | const |
Definition at line 152 of file vposition.cpp.
References frame.
quint32 VPosition::getPaperIndex | ( | ) | const |
Definition at line 139 of file vposition.cpp.
References paperIndex.
quint32 VPosition::getPieceCount | ( | ) | const |
Definition at line 165 of file vposition.cpp.
References piecesCount.
|
private |
Definition at line 495 of file vposition.cpp.
References angle_between, bestResult, CheckRotationEdges(), DrawDebug(), frame, gContour, i, j, paperIndex, piece, pieces, piecesCount, Rotation, SaveCandidate(), stop, and VFuzzyComparePossibleNulls().
Referenced by run().
|
private |
Definition at line 471 of file vposition.cpp.
References gContour, VContour::GetContour(), VLayoutPiece::LayoutEdge(), piece, VLayoutPiece::pieceEdge(), VLayoutPiece::Rotate(), and VLayoutPiece::Translate().
Referenced by CheckRotationEdges().
|
privatevirtual |
Definition at line 101 of file vposition.cpp.
References bestResult, CheckCombineEdges(), Combine, DrawDebug(), frame, gContour, VContour::GetContour(), i, j, paperIndex, piece, pieces, piecesCount, rotate, Rotate(), rotationIncrease, SaveCandidate(), and stop.
|
private |
Definition at line 280 of file vposition.cpp.
References bestResult, gContour, VLayoutPiece::getTransform(), VLayoutPiece::isMirror(), VBestSquare::NewResult(), piece, and VContour::UniteWithContour().
void VPosition::setFrame | ( | const quint32 & | value | ) |
Definition at line 158 of file vposition.cpp.
References frame.
Referenced by VLayoutPaper::AddToSheet().
void VPosition::setPaperIndex | ( | const quint32 & | value | ) |
Definition at line 145 of file vposition.cpp.
References paperIndex.
Referenced by VLayoutPaper::AddToSheet().
void VPosition::setPieceCount | ( | const quint32 & | value | ) |
Definition at line 171 of file vposition.cpp.
References piecesCount.
Referenced by VLayoutPaper::AddToSheet().
void VPosition::setPieces | ( | const QVector< VLayoutPiece > & | pieces | ) |
Definition at line 177 of file vposition.cpp.
References pieces.
Referenced by VLayoutPaper::AddToSheet().
|
private |
Definition at line 435 of file vposition.cpp.
References gContour, VContour::GetHeight(), and VContour::GetWidth().
Referenced by CheckCombineEdges(), and CheckRotationEdges().
|
staticprivate |
Definition at line 528 of file vposition.cpp.
Referenced by DrawContour().
|
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().
|
private |
Definition at line 94 of file vposition.h.
Referenced by getBestResult(), Rotate(), run(), and SaveCandidate().
|
private |
Definition at line 100 of file vposition.h.
Referenced by CheckCombineEdges(), CheckRotationEdges(), DrawDebug(), getFrame(), Rotate(), run(), and setFrame().
|
private |
Definition at line 95 of file vposition.h.
Referenced by CheckCombineEdges(), CheckRotationEdges(), CombineEdges(), Crossing(), Rotate(), RotateEdges(), run(), SaveCandidate(), and SheetContains().
|
private |
Definition at line 97 of file vposition.h.
Referenced by DrawContour(), drawPieces(), Rotate(), and run().
|
private |
Definition at line 98 of file vposition.h.
Referenced by CheckCombineEdges(), CheckRotationEdges(), Rotate(), and run().
|
private |
Definition at line 99 of file vposition.h.
Referenced by CheckCombineEdges(), CheckRotationEdges(), DrawDebug(), getPaperIndex(), Rotate(), run(), and setPaperIndex().
|
private |
Definition at line 96 of file vposition.h.
Referenced by CheckCombineEdges(), CheckRotationEdges(), CombineEdges(), Crossing(), DrawDebug(), Rotate(), RotateEdges(), run(), and SaveCandidate().
|
private |
Definition at line 102 of file vposition.h.
Referenced by CheckCombineEdges(), CheckRotationEdges(), DrawDebug(), drawPieces(), Rotate(), run(), and setPieces().
|
private |
Definition at line 101 of file vposition.h.
Referenced by CheckCombineEdges(), CheckRotationEdges(), DrawDebug(), getPieceCount(), Rotate(), run(), and setPieceCount().
|
private |
Definition at line 104 of file vposition.h.
Referenced by run().
|
private |
Definition at line 105 of file vposition.h.
Referenced by run(), and VPosition().
|
private |
Definition at line 103 of file vposition.h.