1 /************************************************************************ 2 ** 3 ** @file vbestsquare.h 4 ** @author Roman Telezhynskyi <dismine(at)gmail.com> 5 ** @date 21 1, 2015 6 ** 7 ** @brief 8 ** @copyright 9 ** This source code is part of the Valentina project, a pattern making 10 ** program, whose allow create and modeling patterns of clothing. 11 ** Copyright (C) 2013-2015 Valentina project 12 ** <https://gitlab.com/smart-pattern/valentina> All Rights Reserved. 13 ** 14 ** Valentina is free software: you can redistribute it and/or modify 15 ** it under the terms of the GNU General Public License as published by 16 ** the Free Software Foundation, either version 3 of the License, or 17 ** (at your option) any later version. 18 ** 19 ** Valentina is distributed in the hope that it will be useful, 20 ** but WITHOUT ANY WARRANTY; without even the implied warranty of 21 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 22 ** GNU General Public License for more details. 23 ** 24 ** You should have received a copy of the GNU General Public License 25 ** along with Valentina. If not, see <http://www.gnu.org/licenses/>. 26 ** 27 *************************************************************************/ 28 29 #ifndef VBESTSQUARE_H 30 #define VBESTSQUARE_H 31 32 #include <QSizeF> 33 #include <QTransform> 34 #include <QtGlobal> 35 #include <QSharedDataPointer> 36 #include <QTypeInfo> 37 38 #include "vlayoutdef.h" 39 40 class VBestSquareData; 41 42 class VBestSquare 43 { 44 public: 45 VBestSquare(); 46 VBestSquare(QSizeF sheetSize, bool saveLength, bool isPortrait); 47 VBestSquare(const VBestSquare &res); 48 virtual ~VBestSquare(); 49 50 VBestSquare &operator=(const VBestSquare &res); 51 #ifdef Q_COMPILER_RVALUE_REFS 52 VBestSquare(const VBestSquare &&res) Q_DECL_NOTHROW; 53 VBestSquare &operator=(VBestSquare &&res) Q_DECL_NOTHROW; 54 #endif 55 56 void NewResult(const VBestSquareResData &data); 57 void NewResult(const VBestSquare &best); 58 59 QSizeF BestSize() const; 60 int GContourEdge() const; 61 int DetailEdge() const; 62 QTransform Matrix() const; 63 bool HasValidResult() const; 64 bool Mirror() const; 65 BestFrom Type() const; 66 bool IsTerminatedByException() const; 67 QString ReasonTerminatedByException() const; 68 void TerminatedByException(const QString &reason); 69 70 VBestSquareResData BestResultData() const; 71 72 bool IsSaveLength() const; 73 bool IsImprovedSidePosition(qreal sidePosition) const; 74 bool IsPortrait() const; 75 76 private: 77 QSharedDataPointer<VBestSquareData> d; 78 79 }; 80 81 Q_DECLARE_TYPEINFO(VBestSquare, Q_MOVABLE_TYPE); 82 83 #endif // VBESTSQUARE_H 84