Seamly2D
Code documentation
vbestsquare.h
Go to the documentation of this file.
1
/***************************************************************************
2
* *
3
* Copyright (C) 2017 Seamly, LLC *
4
* *
5
* https://github.com/fashionfreedom/seamly2d *
6
* *
7
***************************************************************************
8
**
9
** Seamly2D is free software: you can redistribute it and/or modify
10
** it under the terms of the GNU General Public License as published by
11
** the Free Software Foundation, either version 3 of the License, or
12
** (at your option) any later version.
13
**
14
** Seamly2D is distributed in the hope that it will be useful,
15
** but WITHOUT ANY WARRANTY; without even the implied warranty of
16
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
** GNU General Public License for more details.
18
**
19
** You should have received a copy of the GNU General Public License
20
** along with Seamly2D. If not, see <http://www.gnu.org/licenses/>.
21
**
22
**************************************************************************
23
24
************************************************************************
25
**
26
** @file vbestsquare.h
27
** @author Roman Telezhynskyi <dismine(at)gmail.com>
28
** @date 21 1, 2015
29
**
30
** @brief
31
** @copyright
32
** This source code is part of the Valentine project, a pattern making
33
** program, whose allow create and modeling patterns of clothing.
34
** Copyright (C) 2013-2015 Seamly2D project
35
** <https://github.com/fashionfreedom/seamly2d> All Rights Reserved.
36
**
37
** Seamly2D is free software: you can redistribute it and/or modify
38
** it under the terms of the GNU General Public License as published by
39
** the Free Software Foundation, either version 3 of the License, or
40
** (at your option) any later version.
41
**
42
** Seamly2D is distributed in the hope that it will be useful,
43
** but WITHOUT ANY WARRANTY; without even the implied warranty of
44
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
45
** GNU General Public License for more details.
46
**
47
** You should have received a copy of the GNU General Public License
48
** along with Seamly2D. If not, see <http://www.gnu.org/licenses/>.
49
**
50
*************************************************************************/
51
52
#ifndef VBESTSQUARE_H
53
#define VBESTSQUARE_H
54
55
#include <QSizeF>
56
#include <QTransform>
57
#include <QtGlobal>
58
59
#include "
vlayoutdef.h
"
60
61
class
VBestSquare
62
{
63
public
:
64
VBestSquare
(
const
QSizeF &sheetSize,
bool
saveLength
);
65
66
void
NewResult
(
const
QSizeF &candidate,
int
i,
int
j,
const
QTransform &transform,
bool
mirror,
BestFrom
type
);
67
void
NewResult
(
const
VBestSquare
&best);
68
69
QSizeF
BestSize
()
const
;
70
int
GContourEdge
()
const
;
71
int
pieceEdge
()
const
;
72
QTransform
Transform
()
const
;
73
bool
ValidResult
()
const
;
74
bool
isMirror
()
const
;
75
BestFrom
Type
()
const
;
76
77
bool
IsSaveLength
()
const
;
78
79
private
:
80
// All nedded information about best result
81
int
resI
;
// Edge of global contour
82
int
resJ
;
// Edge of detail
83
QTransform
resTransform
;
// Transform for rotation and translation detail
84
QSizeF
bestSize
;
85
qreal
sheetWidth
;
86
bool
valideResult
;
87
bool
resMirror
;
88
BestFrom
type
;
89
bool
saveLength
;
90
91
static
qint64
Square
(
const
QSizeF &size);
92
};
93
94
#endif
// VBESTSQUARE_H
VBestSquare
Definition:
vbestsquare.h:62
VBestSquare::ValidResult
bool ValidResult() const
Definition:
vbestsquare.cpp:137
VBestSquare::BestSize
QSizeF BestSize() const
Definition:
vbestsquare.cpp:113
VBestSquare::GContourEdge
int GContourEdge() const
Definition:
vbestsquare.cpp:119
VBestSquare::Transform
QTransform Transform() const
Definition:
vbestsquare.cpp:131
VBestSquare::saveLength
bool saveLength
Definition:
vbestsquare.h:89
VBestSquare::resMirror
bool resMirror
Definition:
vbestsquare.h:87
VBestSquare::isMirror
bool isMirror() const
Definition:
vbestsquare.cpp:143
VBestSquare::Type
BestFrom Type() const
Definition:
vbestsquare.cpp:149
VBestSquare::bestSize
QSizeF bestSize
Definition:
vbestsquare.h:84
VBestSquare::pieceEdge
int pieceEdge() const
Definition:
vbestsquare.cpp:125
VBestSquare::NewResult
void NewResult(const QSizeF &candidate, int i, int j, const QTransform &transform, bool mirror, BestFrom type)
Definition:
vbestsquare.cpp:69
VBestSquare::Square
static qint64 Square(const QSizeF &size)
Definition:
vbestsquare.cpp:161
VBestSquare::sheetWidth
qreal sheetWidth
Definition:
vbestsquare.h:85
VBestSquare::IsSaveLength
bool IsSaveLength() const
Definition:
vbestsquare.cpp:155
VBestSquare::resJ
int resJ
Definition:
vbestsquare.h:82
VBestSquare::VBestSquare
VBestSquare(const QSizeF &sheetSize, bool saveLength)
Definition:
vbestsquare.cpp:57
VBestSquare::resTransform
QTransform resTransform
Definition:
vbestsquare.h:83
VBestSquare::resI
int resI
Definition:
vbestsquare.h:81
VBestSquare::type
BestFrom type
Definition:
vbestsquare.h:88
VBestSquare::valideResult
bool valideResult
Definition:
vbestsquare.h:86
vlayoutdef.h
BestFrom
BestFrom
Definition:
vlayoutdef.h:68
src
libs
vlayout
vbestsquare.h
Generated by
1.9.1