Merged develop into feature
--HG-- branch : feature
This commit is contained in:
commit
10f2d83edd
|
@ -54,6 +54,8 @@
|
||||||
- [#526] Dialog Detail is not on top after selection second object on Mac.
|
- [#526] Dialog Detail is not on top after selection second object on Mac.
|
||||||
- [#532] Unexpected error occurs when zoom out image.
|
- [#532] Unexpected error occurs when zoom out image.
|
||||||
- [#537] Valentina crashes when use undo command.
|
- [#537] Valentina crashes when use undo command.
|
||||||
|
- [#544] Error: Color Lines are black until touched.
|
||||||
|
- [#543] Detail loses details.
|
||||||
|
|
||||||
# Version 0.4.4 April 12, 2016
|
# Version 0.4.4 April 12, 2016
|
||||||
- Updated measurement templates with all measurements. Added new template Aldrich/Women measurements.
|
- Updated measurement templates with all measurements. Added new template Aldrich/Women measurements.
|
||||||
|
|
|
@ -121,7 +121,7 @@ init:
|
||||||
# Path before
|
# Path before
|
||||||
- path
|
- path
|
||||||
- set QTDIR=C:\%QT5%
|
- set QTDIR=C:\%QT5%
|
||||||
- set PATH=%QTDIR%\bin;C:\Tools\PsTools;C:\Windows\system32;C:\Windows;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Mercurial\
|
- set PATH=%QTDIR%\bin;%QTDIR%\include;C:\Tools\PsTools;C:\Windows\system32;C:\Windows;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Mercurial\
|
||||||
# Installing various utilities
|
# Installing various utilities
|
||||||
#- if "%QMAKE_GENERATOR%" == "MinGW Makefiles" choco install -y InnoSetup
|
#- if "%QMAKE_GENERATOR%" == "MinGW Makefiles" choco install -y InnoSetup
|
||||||
#- if "%QMAKE_GENERATOR%" == "MinGW Makefiles" if "%PLATFORM%" == "x86" set PATH="C:\Program Files\Inno Setup 5";%PATH%
|
#- if "%QMAKE_GENERATOR%" == "MinGW Makefiles" if "%PLATFORM%" == "x86" set PATH="C:\Program Files\Inno Setup 5";%PATH%
|
||||||
|
@ -181,4 +181,6 @@ notifications:
|
||||||
- dismine@gmail.com
|
- dismine@gmail.com
|
||||||
- susan.spencer@gmail.com
|
- susan.spencer@gmail.com
|
||||||
- zhuravska19@gmail.com
|
- zhuravska19@gmail.com
|
||||||
|
on_build_success: false
|
||||||
|
on_build_failure: true
|
||||||
on_build_status_changed: true
|
on_build_status_changed: true
|
||||||
|
|
25
scripts/cppcheck.sh
Executable file
25
scripts/cppcheck.sh
Executable file
|
@ -0,0 +1,25 @@
|
||||||
|
#!/bin/sh
|
||||||
|
# This script helps run cppcheck with the same keys we have on codeship.com (except for key --platform=unix32).
|
||||||
|
# Please, run this script from folder <root_folder>/scripts.
|
||||||
|
|
||||||
|
# Because we use the last available cppcheck version usually we build it manually.
|
||||||
|
CPPCHECK="../../../../cppcheck/cppcheck"
|
||||||
|
$CPPCHECK \
|
||||||
|
-j4 -f -q \
|
||||||
|
-U__INTEL_COMPILER_UPDATE \
|
||||||
|
-UqApp \
|
||||||
|
--template '{file}:{line}:{message}:{id}' \
|
||||||
|
--inline-suppr \
|
||||||
|
--platform=unix32 \
|
||||||
|
--std=c++11 \
|
||||||
|
--std=posix \
|
||||||
|
--enable=all \
|
||||||
|
--library=qt.cfg \
|
||||||
|
--library=std.cfg \
|
||||||
|
--library=posix.cfg \
|
||||||
|
--inconclusive \
|
||||||
|
--suppress=leakReturnValNotUsed:../src/app/valentina/core/vapplication.cpp \
|
||||||
|
--suppress=unmatchedSuppression:../src/libs/ifc/xml/vdomdocument.cpp \
|
||||||
|
--suppress=redundantCondition:../src/libs/vtools/tools/drawTools/toolcurve/vtoolsplinepath.cpp \
|
||||||
|
--suppress=unmatchedSuppression:../src/libs/vtools/tools/drawTools/toolcurve/vtoolsplinepath.cpp \
|
||||||
|
../src
|
|
@ -35,15 +35,15 @@
|
||||||
#include "../vwidgets/vmaingraphicsview.h"
|
#include "../vwidgets/vmaingraphicsview.h"
|
||||||
#include "../version.h"
|
#include "../version.h"
|
||||||
#include "../vmisc/logging.h"
|
#include "../vmisc/logging.h"
|
||||||
|
#include "../vmisc/vmath.h"
|
||||||
#include "../qmuparser/qmuparsererror.h"
|
#include "../qmuparser/qmuparsererror.h"
|
||||||
#include "../mainwindow.h"
|
#include "../mainwindow.h"
|
||||||
|
|
||||||
#include <QDebug>
|
#include <QtDebug>
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
#include <QProcess>
|
#include <QProcess>
|
||||||
#include <QTemporaryFile>
|
#include <QTemporaryFile>
|
||||||
#include <QUndoStack>
|
#include <QUndoStack>
|
||||||
#include <QtCore/qmath.h>
|
|
||||||
#include <QTemporaryFile>
|
#include <QTemporaryFile>
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
#include <QStandardPaths>
|
#include <QStandardPaths>
|
||||||
|
|
|
@ -31,12 +31,7 @@
|
||||||
#include "../core/vapplication.h"
|
#include "../core/vapplication.h"
|
||||||
#include "../ifc/xml/vdomdocument.h"
|
#include "../ifc/xml/vdomdocument.h"
|
||||||
#include "../vmisc/vsettings.h"
|
#include "../vmisc/vsettings.h"
|
||||||
|
|
||||||
#if QT_VERSION < QT_VERSION_CHECK(5, 1, 0)
|
|
||||||
#include "../vmisc/vmath.h"
|
#include "../vmisc/vmath.h"
|
||||||
#else
|
|
||||||
# include <QtMath>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
#include <QPushButton>
|
#include <QPushButton>
|
||||||
|
|
|
@ -37,7 +37,7 @@
|
||||||
#include <QFileDialog>
|
#include <QFileDialog>
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
#include <QProcess>
|
#include <QProcess>
|
||||||
#include <QDebug>
|
#include <QtDebug>
|
||||||
|
|
||||||
const QString baseFilenameRegExp = QStringLiteral("^[\\w\\-. ]+$");
|
const QString baseFilenameRegExp = QStringLiteral("^[\\w\\-. ]+$");
|
||||||
|
|
||||||
|
|
|
@ -59,7 +59,7 @@
|
||||||
#include "dialogs/vwidgetdetails.h"
|
#include "dialogs/vwidgetdetails.h"
|
||||||
|
|
||||||
#include <QInputDialog>
|
#include <QInputDialog>
|
||||||
#include <QDebug>
|
#include <QtDebug>
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
#include <QShowEvent>
|
#include <QShowEvent>
|
||||||
#include <QScrollBar>
|
#include <QScrollBar>
|
||||||
|
|
|
@ -41,6 +41,7 @@
|
||||||
#include "../ifc/xml/vpatternconverter.h"
|
#include "../ifc/xml/vpatternconverter.h"
|
||||||
#include "../vmisc/undoevent.h"
|
#include "../vmisc/undoevent.h"
|
||||||
#include "../vmisc/vsettings.h"
|
#include "../vmisc/vsettings.h"
|
||||||
|
#include "../vmisc/vmath.h"
|
||||||
#include "../qmuparser/qmuparsererror.h"
|
#include "../qmuparser/qmuparsererror.h"
|
||||||
#include "../vgeometry/varc.h"
|
#include "../vgeometry/varc.h"
|
||||||
#include "../vgeometry/vsplinepath.h"
|
#include "../vgeometry/vsplinepath.h"
|
||||||
|
@ -53,7 +54,6 @@
|
||||||
|
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
#include <QUndoStack>
|
#include <QUndoStack>
|
||||||
#include <QtCore/qmath.h>
|
|
||||||
#include <QtNumeric>
|
#include <QtNumeric>
|
||||||
|
|
||||||
const QString VPattern::AttrReadOnly = QStringLiteral("readOnly");
|
const QString VPattern::AttrReadOnly = QStringLiteral("readOnly");
|
||||||
|
|
|
@ -26,7 +26,6 @@
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
#include <QByteArray>
|
#include <QByteArray>
|
||||||
#include <QDate>
|
#include <QDate>
|
||||||
#include <QDebug>
|
|
||||||
#include <QDesktopServices>
|
#include <QDesktopServices>
|
||||||
#include <QLatin1String>
|
#include <QLatin1String>
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
|
|
|
@ -28,7 +28,6 @@
|
||||||
|
|
||||||
#include "vabstractpattern.h"
|
#include "vabstractpattern.h"
|
||||||
|
|
||||||
#include <QDebug>
|
|
||||||
#include <QDomNode>
|
#include <QDomNode>
|
||||||
#include <QDomNodeList>
|
#include <QDomNodeList>
|
||||||
#include <QLatin1String>
|
#include <QLatin1String>
|
||||||
|
|
|
@ -47,7 +47,6 @@
|
||||||
|
|
||||||
#include <QAbstractMessageHandler>
|
#include <QAbstractMessageHandler>
|
||||||
#include <QByteArray>
|
#include <QByteArray>
|
||||||
#include <QDebug>
|
|
||||||
#include <QDomNodeList>
|
#include <QDomNodeList>
|
||||||
#include <QDomText>
|
#include <QDomText>
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
|
|
|
@ -30,7 +30,6 @@
|
||||||
#define VDOMDOCUMENT_H
|
#define VDOMDOCUMENT_H
|
||||||
|
|
||||||
#include <QCoreApplication>
|
#include <QCoreApplication>
|
||||||
#include <QDebug>
|
|
||||||
#include <QDomDocument>
|
#include <QDomDocument>
|
||||||
#include <QDomElement>
|
#include <QDomElement>
|
||||||
#include <QDomNode>
|
#include <QDomNode>
|
||||||
|
|
|
@ -21,8 +21,6 @@
|
||||||
|
|
||||||
#include "qmuparser.h"
|
#include "qmuparser.h"
|
||||||
|
|
||||||
#include <QtCore/qmath.h>
|
|
||||||
#include <math.h>
|
|
||||||
#include <QCoreApplication>
|
#include <QCoreApplication>
|
||||||
#include <QStaticStringData>
|
#include <QStaticStringData>
|
||||||
#include <QStringData>
|
#include <QStringData>
|
||||||
|
@ -33,6 +31,7 @@
|
||||||
|
|
||||||
#include "qmuparserdef.h"
|
#include "qmuparserdef.h"
|
||||||
#include "qmuparsererror.h"
|
#include "qmuparsererror.h"
|
||||||
|
#include "../vmisc/vmath.h"
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
|
|
|
@ -21,7 +21,6 @@
|
||||||
|
|
||||||
#include "qmuparserbase.h"
|
#include "qmuparserbase.h"
|
||||||
|
|
||||||
#include <QDebug>
|
|
||||||
#include <QList>
|
#include <QList>
|
||||||
#include <QMessageLogger>
|
#include <QMessageLogger>
|
||||||
#include <QStack>
|
#include <QStack>
|
||||||
|
@ -29,14 +28,14 @@
|
||||||
#include <QTextStream>
|
#include <QTextStream>
|
||||||
#include <QtDebug>
|
#include <QtDebug>
|
||||||
#include <map>
|
#include <map>
|
||||||
|
|
||||||
#include "qmudef.h"
|
|
||||||
#ifdef QMUP_USE_OPENMP
|
#ifdef QMUP_USE_OPENMP
|
||||||
#include <omp.h>
|
#include <omp.h>
|
||||||
#endif
|
#endif
|
||||||
#include <QtCore/qmath.h>
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
|
||||||
|
#include "qmudef.h"
|
||||||
|
#include "../vmisc/vmath.h"
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -21,9 +21,7 @@
|
||||||
|
|
||||||
#include "qmuparserbytecode.h"
|
#include "qmuparserbytecode.h"
|
||||||
|
|
||||||
#include <QtCore/qmath.h>
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <QDebug>
|
|
||||||
#include <QMessageLogger>
|
#include <QMessageLogger>
|
||||||
#include <QStack>
|
#include <QStack>
|
||||||
#include <QString>
|
#include <QString>
|
||||||
|
@ -31,6 +29,7 @@
|
||||||
|
|
||||||
#include "qmudef.h"
|
#include "qmudef.h"
|
||||||
#include "qmuparsererror.h"
|
#include "qmuparsererror.h"
|
||||||
|
#include "../vmisc/vmath.h"
|
||||||
|
|
||||||
namespace qmu
|
namespace qmu
|
||||||
{
|
{
|
||||||
|
|
|
@ -21,11 +21,9 @@
|
||||||
|
|
||||||
#include "qmuparsertest.h"
|
#include "qmuparsertest.h"
|
||||||
|
|
||||||
#include <math.h>
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <QChar>
|
#include <QChar>
|
||||||
#include <QCoreApplication>
|
#include <QCoreApplication>
|
||||||
#include <QDebug>
|
|
||||||
#include <QMessageLogger>
|
#include <QMessageLogger>
|
||||||
#include <QString>
|
#include <QString>
|
||||||
#include <QtDebug>
|
#include <QtDebug>
|
||||||
|
@ -41,6 +39,7 @@
|
||||||
#include "qmudef.h"
|
#include "qmudef.h"
|
||||||
#include "qmuparser.h"
|
#include "qmuparser.h"
|
||||||
#include "qmuparsererror.h"
|
#include "qmuparsererror.h"
|
||||||
|
#include "../vmisc/vmath.h"
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
|
|
|
@ -23,7 +23,6 @@
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <QCharRef>
|
#include <QCharRef>
|
||||||
#include <QDebug>
|
|
||||||
#include <QList>
|
#include <QList>
|
||||||
#include <QMessageLogger>
|
#include <QMessageLogger>
|
||||||
#include <QStringList>
|
#include <QStringList>
|
||||||
|
|
|
@ -27,8 +27,7 @@
|
||||||
|
|
||||||
#include "dl_global.h"
|
#include "dl_global.h"
|
||||||
|
|
||||||
#include <math.h>
|
#include "../vmisc/vmath.h"
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Storing and passing around attributes. Attributes
|
* Storing and passing around attributes. Attributes
|
||||||
|
|
|
@ -28,11 +28,9 @@
|
||||||
|
|
||||||
#include "vdxfengine.h"
|
#include "vdxfengine.h"
|
||||||
|
|
||||||
#include <math.h>
|
|
||||||
#include <QByteArray>
|
#include <QByteArray>
|
||||||
#include <QColor>
|
#include <QColor>
|
||||||
#include <QDateTime>
|
#include <QDateTime>
|
||||||
#include <QDebug>
|
|
||||||
#include <QFlag>
|
#include <QFlag>
|
||||||
#include <QFlags>
|
#include <QFlags>
|
||||||
#include <QFont>
|
#include <QFont>
|
||||||
|
@ -49,6 +47,7 @@
|
||||||
|
|
||||||
#include "../vmisc/def.h"
|
#include "../vmisc/def.h"
|
||||||
#include "../vmisc/diagnostic.h"
|
#include "../vmisc/diagnostic.h"
|
||||||
|
#include "../vmisc/vmath.h"
|
||||||
#include "dxflib/dl_attributes.h"
|
#include "dxflib/dl_attributes.h"
|
||||||
#include "dxflib/dl_codes.h"
|
#include "dxflib/dl_codes.h"
|
||||||
#include "dxflib/dl_dxf.h"
|
#include "dxflib/dl_dxf.h"
|
||||||
|
@ -65,11 +64,6 @@ class QPolygonF;
|
||||||
class QRect;
|
class QRect;
|
||||||
class QRectF;
|
class QRectF;
|
||||||
|
|
||||||
#if QT_VERSION < QT_VERSION_CHECK(5, 1, 0)
|
|
||||||
# include "../vmisc/vmath.h"
|
|
||||||
#else
|
|
||||||
#endif
|
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
static inline QPaintEngine::PaintEngineFeatures svgEngineFeatures()
|
static inline QPaintEngine::PaintEngineFeatures svgEngineFeatures()
|
||||||
{
|
{
|
||||||
|
|
|
@ -30,7 +30,6 @@
|
||||||
|
|
||||||
#include <qnumeric.h>
|
#include <qnumeric.h>
|
||||||
#include <QDate>
|
#include <QDate>
|
||||||
#include <QDebug>
|
|
||||||
#include <QDomNode>
|
#include <QDomNode>
|
||||||
#include <QDomNodeList>
|
#include <QDomNodeList>
|
||||||
#include <QDomText>
|
#include <QDomText>
|
||||||
|
|
|
@ -28,14 +28,13 @@
|
||||||
|
|
||||||
#include "vabstractcubicbezier.h"
|
#include "vabstractcubicbezier.h"
|
||||||
|
|
||||||
#include <math.h>
|
|
||||||
#include <QDebug>
|
|
||||||
#include <QLineF>
|
#include <QLineF>
|
||||||
#include <QMessageLogger>
|
#include <QMessageLogger>
|
||||||
#include <QPoint>
|
#include <QPoint>
|
||||||
#include <QtDebug>
|
#include <QtDebug>
|
||||||
|
|
||||||
#include "../vmisc/def.h"
|
#include "../vmisc/def.h"
|
||||||
|
#include "../vmisc/vmath.h"
|
||||||
#include "../vgeometry/vpointf.h"
|
#include "../vgeometry/vpointf.h"
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
|
@ -28,7 +28,6 @@
|
||||||
|
|
||||||
#include "vabstractcurve.h"
|
#include "vabstractcurve.h"
|
||||||
|
|
||||||
#include <QDebug>
|
|
||||||
#include <QLine>
|
#include <QLine>
|
||||||
#include <QLineF>
|
#include <QLineF>
|
||||||
#include <QMessageLogger>
|
#include <QMessageLogger>
|
||||||
|
|
|
@ -28,11 +28,11 @@
|
||||||
|
|
||||||
#include "varc.h"
|
#include "varc.h"
|
||||||
|
|
||||||
#include <QtCore/qmath.h>
|
|
||||||
#include <QLineF>
|
#include <QLineF>
|
||||||
#include <QPointF>
|
#include <QPointF>
|
||||||
|
|
||||||
#include "../vmisc/def.h"
|
#include "../vmisc/def.h"
|
||||||
|
#include "../vmisc/vmath.h"
|
||||||
#include "../ifc/ifcdef.h"
|
#include "../ifc/ifcdef.h"
|
||||||
#include "vabstractcurve.h"
|
#include "vabstractcurve.h"
|
||||||
#include "varc_p.h"
|
#include "varc_p.h"
|
||||||
|
|
|
@ -31,11 +31,11 @@
|
||||||
|
|
||||||
#include <QSharedData>
|
#include <QSharedData>
|
||||||
#include <QLineF>
|
#include <QLineF>
|
||||||
#include <QtCore/qmath.h>
|
|
||||||
|
|
||||||
#include "vpointf.h"
|
#include "vpointf.h"
|
||||||
#include "../vmisc/vabstractapplication.h"
|
#include "../vmisc/vabstractapplication.h"
|
||||||
#include "../vmisc/diagnostic.h"
|
#include "../vmisc/diagnostic.h"
|
||||||
|
#include "../vmisc/vmath.h"
|
||||||
|
|
||||||
QT_WARNING_PUSH
|
QT_WARNING_PUSH
|
||||||
QT_WARNING_DISABLE_GCC("-Weffc++")
|
QT_WARNING_DISABLE_GCC("-Weffc++")
|
||||||
|
|
|
@ -28,21 +28,16 @@
|
||||||
|
|
||||||
#include "vcubicbezierpath.h"
|
#include "vcubicbezierpath.h"
|
||||||
|
|
||||||
#include <qmath.h>
|
|
||||||
#include <QLineF>
|
#include <QLineF>
|
||||||
#include <QPoint>
|
#include <QPoint>
|
||||||
|
|
||||||
#include "../ifc/exception/vexception.h"
|
#include "../ifc/exception/vexception.h"
|
||||||
|
#include "../vmisc/vmath.h"
|
||||||
#include "vabstractcurve.h"
|
#include "vabstractcurve.h"
|
||||||
#include "vcubicbezierpath_p.h"
|
#include "vcubicbezierpath_p.h"
|
||||||
#include "vspline.h"
|
#include "vspline.h"
|
||||||
#include "vsplinepoint.h"
|
#include "vsplinepoint.h"
|
||||||
|
|
||||||
#if QT_VERSION < QT_VERSION_CHECK(5, 1, 0)
|
|
||||||
# include "../vmisc/vmath.h"
|
|
||||||
#else
|
|
||||||
#endif
|
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
VCubicBezierPath::VCubicBezierPath(quint32 idObject, Draw mode)
|
VCubicBezierPath::VCubicBezierPath(quint32 idObject, Draw mode)
|
||||||
: VAbstractCubicBezierPath(GOType::CubicBezierPath, idObject, mode),
|
: VAbstractCubicBezierPath(GOType::CubicBezierPath, idObject, mode),
|
||||||
|
|
|
@ -28,12 +28,11 @@
|
||||||
|
|
||||||
#include "vellipticalarc.h"
|
#include "vellipticalarc.h"
|
||||||
|
|
||||||
#include <QtCore/qmath.h>
|
|
||||||
#include <math.h>
|
|
||||||
#include <QLineF>
|
#include <QLineF>
|
||||||
#include <QPoint>
|
#include <QPoint>
|
||||||
|
|
||||||
#include "../vmisc/def.h"
|
#include "../vmisc/def.h"
|
||||||
|
#include "../vmisc/vmath.h"
|
||||||
#include "../ifc/ifcdef.h"
|
#include "../ifc/ifcdef.h"
|
||||||
#include "../vmisc/vabstractapplication.h"
|
#include "../vmisc/vabstractapplication.h"
|
||||||
#include "vabstractcurve.h"
|
#include "vabstractcurve.h"
|
||||||
|
|
|
@ -28,8 +28,6 @@
|
||||||
|
|
||||||
#include "vgobject.h"
|
#include "vgobject.h"
|
||||||
|
|
||||||
#include <QtCore/qmath.h>
|
|
||||||
#include <math.h>
|
|
||||||
#include <QLine>
|
#include <QLine>
|
||||||
#include <QLineF>
|
#include <QLineF>
|
||||||
#include <QPoint>
|
#include <QPoint>
|
||||||
|
@ -37,9 +35,12 @@
|
||||||
#include <QRectF>
|
#include <QRectF>
|
||||||
|
|
||||||
#include "../vmisc/def.h"
|
#include "../vmisc/def.h"
|
||||||
|
#include "../vmisc/vmath.h"
|
||||||
#include "../ifc/ifcdef.h"
|
#include "../ifc/ifcdef.h"
|
||||||
#include "vgobject_p.h"
|
#include "vgobject_p.h"
|
||||||
|
|
||||||
|
double VGObject::accuracyPointOnLine = (0.5/*mm*/ / 25.4) * PrintDPI;
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief VGObject default constructor.
|
* @brief VGObject default constructor.
|
||||||
|
@ -505,14 +506,16 @@ double VGObject::PerpDotProduct(const QPointF &p1, const QPointF &p2, const QPoi
|
||||||
* There is the floating-point accuraccy problem, so instead of checking against zero, some epsilon value has to be
|
* There is the floating-point accuraccy problem, so instead of checking against zero, some epsilon value has to be
|
||||||
* used. Because the size of the pdp value depends on the length of the vectors, no static value can be used. One
|
* used. Because the size of the pdp value depends on the length of the vectors, no static value can be used. One
|
||||||
* approach is to compare the pdp/area value to the fraction of another area which also depends on the length of the
|
* approach is to compare the pdp/area value to the fraction of another area which also depends on the length of the
|
||||||
* line e1=(p1, p2), e.g. the area of the square with side e1 which is computed below
|
* line e1=(p1, p2), e.g. the minimal area calucalted with PerpDotProduc() if point still not on the line. This distance
|
||||||
|
* is controled by variable accuracyPointOnLine
|
||||||
*/
|
*/
|
||||||
double VGObject::GetEpsilon(const QPointF &p1, const QPointF &p2)
|
double VGObject::GetEpsilon(const QPointF &p1, const QPointF &p2)
|
||||||
{
|
{
|
||||||
const double dx1 = p2.x() - p1.x();
|
QLineF line(p1, p2);
|
||||||
const double dy1 = p2.y() - p1.y();
|
line.setAngle(line.angle() + 90);
|
||||||
const double epsilon = 0.06 * (dx1 * dx1 + dy1 * dy1); //-V636
|
line.setLength(accuracyPointOnLine); // less than accuracy means the same point
|
||||||
return epsilon;
|
|
||||||
|
return qAbs(PerpDotProduct(p1, p2, line.p2()));
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
|
@ -91,6 +91,8 @@ public:
|
||||||
|
|
||||||
static QVector<QPointF> GetReversePoints(const QVector<QPointF> &points);
|
static QVector<QPointF> GetReversePoints(const QVector<QPointF> &points);
|
||||||
static int GetLengthContour(const QVector<QPointF> &contour, const QVector<QPointF> &newPoints);
|
static int GetLengthContour(const QVector<QPointF> &contour, const QVector<QPointF> &newPoints);
|
||||||
|
|
||||||
|
static double accuracyPointOnLine;
|
||||||
private:
|
private:
|
||||||
QSharedDataPointer<VGObjectData> d;
|
QSharedDataPointer<VGObjectData> d;
|
||||||
|
|
||||||
|
|
|
@ -28,11 +28,11 @@
|
||||||
|
|
||||||
#include "vspline.h"
|
#include "vspline.h"
|
||||||
|
|
||||||
#include <math.h>
|
|
||||||
#include <QLineF>
|
#include <QLineF>
|
||||||
|
|
||||||
#include "vabstractcurve.h"
|
#include "vabstractcurve.h"
|
||||||
#include "vspline_p.h"
|
#include "vspline_p.h"
|
||||||
|
#include "../vmisc/vmath.h"
|
||||||
|
|
||||||
class QPointF;
|
class QPointF;
|
||||||
|
|
||||||
|
|
|
@ -31,10 +31,10 @@
|
||||||
|
|
||||||
#include <QSharedData>
|
#include <QSharedData>
|
||||||
#include <QLineF>
|
#include <QLineF>
|
||||||
#include <QtCore/qmath.h>
|
|
||||||
|
|
||||||
#include "vpointf.h"
|
#include "vpointf.h"
|
||||||
#include "../vmisc/vabstractapplication.h"
|
#include "../vmisc/vabstractapplication.h"
|
||||||
|
#include "../vmisc/vmath.h"
|
||||||
|
|
||||||
QT_WARNING_PUSH
|
QT_WARNING_PUSH
|
||||||
QT_WARNING_DISABLE_GCC("-Weffc++")
|
QT_WARNING_DISABLE_GCC("-Weffc++")
|
||||||
|
|
|
@ -31,14 +31,10 @@
|
||||||
#include <QPoint>
|
#include <QPoint>
|
||||||
|
|
||||||
#include "../ifc/exception/vexception.h"
|
#include "../ifc/exception/vexception.h"
|
||||||
|
#include "../vmisc/vmath.h"
|
||||||
#include "vabstractcurve.h"
|
#include "vabstractcurve.h"
|
||||||
#include "vsplinepath_p.h"
|
#include "vsplinepath_p.h"
|
||||||
|
|
||||||
#if QT_VERSION < QT_VERSION_CHECK(5, 1, 0)
|
|
||||||
# include "../vmisc/vmath.h"
|
|
||||||
#else
|
|
||||||
#endif
|
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief VSplinePath constructor.
|
* @brief VSplinePath constructor.
|
||||||
|
|
|
@ -30,7 +30,7 @@
|
||||||
#define VSPLINEPOINT_P_H
|
#define VSPLINEPOINT_P_H
|
||||||
|
|
||||||
#include <QSharedData>
|
#include <QSharedData>
|
||||||
#include <QDebug>
|
#include <QtDebug>
|
||||||
|
|
||||||
#include "vpointf.h"
|
#include "vpointf.h"
|
||||||
#include "../vmisc/def.h"
|
#include "../vmisc/def.h"
|
||||||
|
|
|
@ -28,7 +28,6 @@
|
||||||
|
|
||||||
#include "vabstractdetail.h"
|
#include "vabstractdetail.h"
|
||||||
|
|
||||||
#include <QDebug>
|
|
||||||
#include <QLine>
|
#include <QLine>
|
||||||
#include <QLineF>
|
#include <QLineF>
|
||||||
#include <QMessageLogger>
|
#include <QMessageLogger>
|
||||||
|
|
|
@ -28,7 +28,6 @@
|
||||||
|
|
||||||
#include "vcontour.h"
|
#include "vcontour.h"
|
||||||
|
|
||||||
#include <qmath.h>
|
|
||||||
#include <QLineF>
|
#include <QLineF>
|
||||||
#include <QPainterPath>
|
#include <QPainterPath>
|
||||||
#include <QPoint>
|
#include <QPoint>
|
||||||
|
@ -39,11 +38,7 @@
|
||||||
|
|
||||||
#include "vcontour_p.h"
|
#include "vcontour_p.h"
|
||||||
#include "vlayoutdetail.h"
|
#include "vlayoutdetail.h"
|
||||||
|
|
||||||
#if QT_VERSION < QT_VERSION_CHECK(5, 1, 0)
|
|
||||||
#include "../vmisc/vmath.h"
|
#include "../vmisc/vmath.h"
|
||||||
#else
|
|
||||||
#endif
|
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
VContour::VContour()
|
VContour::VContour()
|
||||||
|
|
|
@ -28,8 +28,6 @@
|
||||||
|
|
||||||
#include "vlayoutdetail.h"
|
#include "vlayoutdetail.h"
|
||||||
|
|
||||||
#include <math.h>
|
|
||||||
#include <qmath.h>
|
|
||||||
#include <QBrush>
|
#include <QBrush>
|
||||||
#include <QFlags>
|
#include <QFlags>
|
||||||
#include <QFont>
|
#include <QFont>
|
||||||
|
@ -47,6 +45,7 @@
|
||||||
|
|
||||||
#include "../vpatterndb/vpatterninfogeometry.h"
|
#include "../vpatterndb/vpatterninfogeometry.h"
|
||||||
#include "../vpatterndb/vpatternpiecedata.h"
|
#include "../vpatterndb/vpatternpiecedata.h"
|
||||||
|
#include "../vmisc/vmath.h"
|
||||||
#include "vlayoutdef.h"
|
#include "vlayoutdef.h"
|
||||||
#include "vlayoutdetail_p.h"
|
#include "vlayoutdetail_p.h"
|
||||||
#include "vtextmanager.h"
|
#include "vtextmanager.h"
|
||||||
|
@ -55,13 +54,6 @@ class QGraphicsPathItem;
|
||||||
class QLineF;
|
class QLineF;
|
||||||
class VAbstractPattern;
|
class VAbstractPattern;
|
||||||
|
|
||||||
#if QT_VERSION < QT_VERSION_CHECK(5, 1, 0)
|
|
||||||
# include "../vmisc/vmath.h"
|
|
||||||
#else
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <QDebug>
|
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
VLayoutDetail::VLayoutDetail()
|
VLayoutDetail::VLayoutDetail()
|
||||||
:VAbstractDetail(), d(new VLayoutDetailData)
|
:VAbstractDetail(), d(new VLayoutDetailData)
|
||||||
|
|
|
@ -28,12 +28,12 @@
|
||||||
|
|
||||||
#include "vlayoutgenerator.h"
|
#include "vlayoutgenerator.h"
|
||||||
|
|
||||||
#include <QtCore/qmath.h>
|
|
||||||
#include <QGraphicsRectItem>
|
#include <QGraphicsRectItem>
|
||||||
#include <QRectF>
|
#include <QRectF>
|
||||||
#include <QThreadPool>
|
#include <QThreadPool>
|
||||||
|
|
||||||
#include "../vmisc/def.h"
|
#include "../vmisc/def.h"
|
||||||
|
#include "../vmisc/vmath.h"
|
||||||
#include "vlayoutdetail.h"
|
#include "vlayoutdetail.h"
|
||||||
#include "vlayoutpaper.h"
|
#include "vlayoutpaper.h"
|
||||||
|
|
||||||
|
|
|
@ -28,7 +28,6 @@
|
||||||
|
|
||||||
#include "vposition.h"
|
#include "vposition.h"
|
||||||
|
|
||||||
#include <qmath.h>
|
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
#include <QImage>
|
#include <QImage>
|
||||||
#include <QLineF>
|
#include <QLineF>
|
||||||
|
@ -48,11 +47,7 @@
|
||||||
#include <Qt>
|
#include <Qt>
|
||||||
|
|
||||||
#include "../vmisc/def.h"
|
#include "../vmisc/def.h"
|
||||||
|
|
||||||
#if QT_VERSION < QT_VERSION_CHECK(5, 1, 0)
|
|
||||||
#include "../vmisc/vmath.h"
|
#include "../vmisc/vmath.h"
|
||||||
#else
|
|
||||||
#endif
|
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
VPosition::VPosition(const VContour &gContour, int j, const VLayoutDetail &detail, int i, volatile bool *stop,
|
VPosition::VPosition(const VContour &gContour, int j, const VLayoutDetail &detail, int i, volatile bool *stop,
|
||||||
|
|
|
@ -28,7 +28,6 @@
|
||||||
|
|
||||||
#include "vposter.h"
|
#include "vposter.h"
|
||||||
|
|
||||||
#include <qmath.h>
|
|
||||||
#include <QGraphicsLineItem>
|
#include <QGraphicsLineItem>
|
||||||
#include <QGraphicsPixmapItem>
|
#include <QGraphicsPixmapItem>
|
||||||
#include <QGraphicsTextItem>
|
#include <QGraphicsTextItem>
|
||||||
|
@ -40,11 +39,7 @@
|
||||||
#include <QVector>
|
#include <QVector>
|
||||||
#include <Qt>
|
#include <Qt>
|
||||||
|
|
||||||
#if QT_VERSION < QT_VERSION_CHECK(5, 1, 0)
|
|
||||||
#include "../vmisc/vmath.h"
|
#include "../vmisc/vmath.h"
|
||||||
#else
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "../vmisc/def.h"
|
#include "../vmisc/def.h"
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
|
@ -36,7 +36,7 @@
|
||||||
#include <QDebugStateSaver>
|
#include <QDebugStateSaver>
|
||||||
#if QT_VERSION < QT_VERSION_CHECK(5, 3, 0)
|
#if QT_VERSION < QT_VERSION_CHECK(5, 3, 0)
|
||||||
#include <QDataStream>
|
#include <QDataStream>
|
||||||
#include <QDebug>
|
#include <QtDebug>
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\class QMarginsF
|
\class QMarginsF
|
||||||
|
|
|
@ -33,7 +33,6 @@
|
||||||
#include <QColor>
|
#include <QColor>
|
||||||
#include <QComboBox>
|
#include <QComboBox>
|
||||||
#include <QCursor>
|
#include <QCursor>
|
||||||
#include <QDebug>
|
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
#include <QFileInfo>
|
#include <QFileInfo>
|
||||||
#include <QGuiApplication>
|
#include <QGuiApplication>
|
||||||
|
|
|
@ -28,7 +28,6 @@
|
||||||
|
|
||||||
#include "vabstractapplication.h"
|
#include "vabstractapplication.h"
|
||||||
|
|
||||||
#include <QDebug>
|
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
#include <QLibraryInfo>
|
#include <QLibraryInfo>
|
||||||
#include <QLoggingCategory>
|
#include <QLoggingCategory>
|
||||||
|
|
|
@ -30,7 +30,6 @@
|
||||||
|
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
#include <QDate>
|
#include <QDate>
|
||||||
#include <QDebug>
|
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
#include <QLocale>
|
#include <QLocale>
|
||||||
#include <QMessageLogger>
|
#include <QMessageLogger>
|
||||||
|
@ -41,14 +40,10 @@
|
||||||
#include <QtDebug>
|
#include <QtDebug>
|
||||||
|
|
||||||
#include "../vmisc/def.h"
|
#include "../vmisc/def.h"
|
||||||
|
#include "../vmisc/vmath.h"
|
||||||
|
|
||||||
class QDate;
|
class QDate;
|
||||||
|
|
||||||
#if QT_VERSION < QT_VERSION_CHECK(5, 1, 0)
|
|
||||||
# include "../vmisc/vmath.h"
|
|
||||||
#else
|
|
||||||
#endif
|
|
||||||
|
|
||||||
const QString VCommonSettings::SettingPathsIndividualMeasurements = QStringLiteral("paths/individual_measurements");
|
const QString VCommonSettings::SettingPathsIndividualMeasurements = QStringLiteral("paths/individual_measurements");
|
||||||
const QString VCommonSettings::SettingPathsStandardMeasurements = QStringLiteral("paths/standard_measurements");
|
const QString VCommonSettings::SettingPathsStandardMeasurements = QStringLiteral("paths/standard_measurements");
|
||||||
const QString VCommonSettings::SettingPathsTemplates = QStringLiteral("paths/templates");
|
const QString VCommonSettings::SettingPathsTemplates = QStringLiteral("paths/templates");
|
||||||
|
|
|
@ -18,10 +18,12 @@
|
||||||
**
|
**
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#ifndef QMATH_H
|
#ifndef VMATH_H
|
||||||
#define QMATH_H
|
#define VMATH_H
|
||||||
|
|
||||||
#if QT_VERSION < QT_VERSION_CHECK(5, 1, 0)
|
#if QT_VERSION >= QT_VERSION_CHECK(5, 1, 0)
|
||||||
|
#include <QtMath>
|
||||||
|
#else
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
#pragma qt_class(QtMath)
|
#pragma qt_class(QtMath)
|
||||||
|
|
|
@ -39,14 +39,10 @@
|
||||||
#include <QVariant>
|
#include <QVariant>
|
||||||
|
|
||||||
#include "../vmisc/def.h"
|
#include "../vmisc/def.h"
|
||||||
|
#include "../vmisc/vmath.h"
|
||||||
|
|
||||||
class QMarginsF;
|
class QMarginsF;
|
||||||
|
|
||||||
#if QT_VERSION < QT_VERSION_CHECK(5, 1, 0)
|
|
||||||
# include "../vmisc/vmath.h"
|
|
||||||
#else
|
|
||||||
#endif
|
|
||||||
|
|
||||||
Q_DECLARE_METATYPE(QMarginsF)
|
Q_DECLARE_METATYPE(QMarginsF)
|
||||||
|
|
||||||
const QString VSettings::SettingConfigurationLabelLanguage = QStringLiteral("configuration/label_language");
|
const QString VSettings::SettingConfigurationLabelLanguage = QStringLiteral("configuration/label_language");
|
||||||
|
|
|
@ -28,9 +28,7 @@
|
||||||
|
|
||||||
#include "vobjengine.h"
|
#include "vobjengine.h"
|
||||||
|
|
||||||
#include <qmath.h>
|
|
||||||
#include <QByteArray>
|
#include <QByteArray>
|
||||||
#include <QDebug>
|
|
||||||
#include <QFlag>
|
#include <QFlag>
|
||||||
#include <QFlags>
|
#include <QFlags>
|
||||||
#include <QIODevice>
|
#include <QIODevice>
|
||||||
|
@ -45,6 +43,7 @@
|
||||||
#include <QtDebug>
|
#include <QtDebug>
|
||||||
|
|
||||||
#include "../vmisc/diagnostic.h"
|
#include "../vmisc/diagnostic.h"
|
||||||
|
#include "../vmisc/vmath.h"
|
||||||
|
|
||||||
class QPaintDevice;
|
class QPaintDevice;
|
||||||
class QPixmap;
|
class QPixmap;
|
||||||
|
@ -53,11 +52,6 @@ class QPointF;
|
||||||
class QPolygonF;
|
class QPolygonF;
|
||||||
class QRectF;
|
class QRectF;
|
||||||
|
|
||||||
#if QT_VERSION < QT_VERSION_CHECK(5, 1, 0)
|
|
||||||
# include "../vmisc/vmath.h"
|
|
||||||
#else
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef Q_CC_MSVC
|
#ifdef Q_CC_MSVC
|
||||||
#include <ciso646>
|
#include <ciso646>
|
||||||
#endif /* Q_CC_MSVC */
|
#endif /* Q_CC_MSVC */
|
||||||
|
|
|
@ -28,23 +28,18 @@
|
||||||
|
|
||||||
#include "vlineangle.h"
|
#include "vlineangle.h"
|
||||||
|
|
||||||
#include <qmath.h>
|
|
||||||
#include <QLineF>
|
#include <QLineF>
|
||||||
#include <QMessageLogger>
|
#include <QMessageLogger>
|
||||||
#include <QPointF>
|
#include <QPointF>
|
||||||
#include <QString>
|
#include <QString>
|
||||||
|
|
||||||
#include "../vmisc/def.h"
|
#include "../vmisc/def.h"
|
||||||
|
#include "../vmisc/vmath.h"
|
||||||
#include "../ifc/ifcdef.h"
|
#include "../ifc/ifcdef.h"
|
||||||
#include "../vgeometry/vpointf.h"
|
#include "../vgeometry/vpointf.h"
|
||||||
#include "vinternalvariable.h"
|
#include "vinternalvariable.h"
|
||||||
#include "vlineangle_p.h"
|
#include "vlineangle_p.h"
|
||||||
|
|
||||||
#if QT_VERSION < QT_VERSION_CHECK(5, 1, 0)
|
|
||||||
# include "../vmisc/vmath.h"
|
|
||||||
#else
|
|
||||||
#endif
|
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
VLineAngle::VLineAngle()
|
VLineAngle::VLineAngle()
|
||||||
:VInternalVariable(), d(new VLineAngleData)
|
:VInternalVariable(), d(new VLineAngleData)
|
||||||
|
|
|
@ -28,7 +28,6 @@
|
||||||
|
|
||||||
#include "vmeasurement.h"
|
#include "vmeasurement.h"
|
||||||
|
|
||||||
#include <QDebug>
|
|
||||||
#include <QMap>
|
#include <QMap>
|
||||||
#include <QMessageLogger>
|
#include <QMessageLogger>
|
||||||
#include <QtDebug>
|
#include <QtDebug>
|
||||||
|
|
|
@ -29,7 +29,6 @@
|
||||||
#include "vcontainer.h"
|
#include "vcontainer.h"
|
||||||
|
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
#include <QDebug>
|
|
||||||
#include <QLoggingCategory>
|
#include <QLoggingCategory>
|
||||||
#include <QVector>
|
#include <QVector>
|
||||||
#include <QtDebug>
|
#include <QtDebug>
|
||||||
|
|
|
@ -28,7 +28,6 @@
|
||||||
|
|
||||||
#include "vdetail.h"
|
#include "vdetail.h"
|
||||||
|
|
||||||
#include <QDebug>
|
|
||||||
#include <QList>
|
#include <QList>
|
||||||
#include <QMessageLogger>
|
#include <QMessageLogger>
|
||||||
#include <QPainterPath>
|
#include <QPainterPath>
|
||||||
|
|
|
@ -29,7 +29,6 @@
|
||||||
#include "vformula.h"
|
#include "vformula.h"
|
||||||
|
|
||||||
#include <qnumeric.h>
|
#include <qnumeric.h>
|
||||||
#include <QDebug>
|
|
||||||
#include <QMessageLogger>
|
#include <QMessageLogger>
|
||||||
#include <QScopedPointer>
|
#include <QScopedPointer>
|
||||||
#include <QtDebug>
|
#include <QtDebug>
|
||||||
|
|
|
@ -28,7 +28,6 @@
|
||||||
|
|
||||||
#include "vtranslatevars.h"
|
#include "vtranslatevars.h"
|
||||||
|
|
||||||
#include <QDebug>
|
|
||||||
#include <QList>
|
#include <QList>
|
||||||
#include <QLocale>
|
#include <QLocale>
|
||||||
#include <QMap>
|
#include <QMap>
|
||||||
|
|
|
@ -48,6 +48,7 @@
|
||||||
#include "../../visualization/visualization.h"
|
#include "../../visualization/visualization.h"
|
||||||
#include "../ifc/ifcdef.h"
|
#include "../ifc/ifcdef.h"
|
||||||
#include "../vmisc/vabstractapplication.h"
|
#include "../vmisc/vabstractapplication.h"
|
||||||
|
#include "../vmisc/vmath.h"
|
||||||
#include "../vpatterndb/vcontainer.h"
|
#include "../vpatterndb/vcontainer.h"
|
||||||
#include "../vwidgets/vabstractmainwindow.h"
|
#include "../vwidgets/vabstractmainwindow.h"
|
||||||
#include "dialogtool.h"
|
#include "dialogtool.h"
|
||||||
|
@ -55,11 +56,6 @@
|
||||||
|
|
||||||
class QWidget;
|
class QWidget;
|
||||||
|
|
||||||
#if QT_VERSION < QT_VERSION_CHECK(5, 1, 0)
|
|
||||||
# include "../vmisc/vmath.h"
|
|
||||||
#else
|
|
||||||
#endif
|
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
DialogCubicBezierPath::DialogCubicBezierPath(const VContainer *data, const quint32 &toolId, QWidget *parent)
|
DialogCubicBezierPath::DialogCubicBezierPath(const VContainer *data, const quint32 &toolId, QWidget *parent)
|
||||||
: DialogTool(data, toolId, parent),
|
: DialogTool(data, toolId, parent),
|
||||||
|
|
|
@ -32,7 +32,6 @@
|
||||||
#include <QByteArray>
|
#include <QByteArray>
|
||||||
#include <QCheckBox>
|
#include <QCheckBox>
|
||||||
#include <QComboBox>
|
#include <QComboBox>
|
||||||
#include <QDebug>
|
|
||||||
#include <QDialogButtonBox>
|
#include <QDialogButtonBox>
|
||||||
#include <QDoubleSpinBox>
|
#include <QDoubleSpinBox>
|
||||||
#include <QFlags>
|
#include <QFlags>
|
||||||
|
|
|
@ -33,7 +33,6 @@
|
||||||
#include <qnumeric.h>
|
#include <qnumeric.h>
|
||||||
#include <QCloseEvent>
|
#include <QCloseEvent>
|
||||||
#include <QComboBox>
|
#include <QComboBox>
|
||||||
#include <QDebug>
|
|
||||||
#include <QDoubleSpinBox>
|
#include <QDoubleSpinBox>
|
||||||
#include <QEvent>
|
#include <QEvent>
|
||||||
#include <QHash>
|
#include <QHash>
|
||||||
|
|
|
@ -28,8 +28,6 @@
|
||||||
|
|
||||||
#include "vtoolspline.h"
|
#include "vtoolspline.h"
|
||||||
|
|
||||||
#include <math.h>
|
|
||||||
#include <qmath.h>
|
|
||||||
#include <QDomElement>
|
#include <QDomElement>
|
||||||
#include <QEvent>
|
#include <QEvent>
|
||||||
#include <QFlags>
|
#include <QFlags>
|
||||||
|
@ -63,6 +61,7 @@
|
||||||
#include "../vgeometry/vpointf.h"
|
#include "../vgeometry/vpointf.h"
|
||||||
#include "../vgeometry/vspline.h"
|
#include "../vgeometry/vspline.h"
|
||||||
#include "../vmisc/vabstractapplication.h"
|
#include "../vmisc/vabstractapplication.h"
|
||||||
|
#include "../vmisc/vmath.h"
|
||||||
#include "../vpatterndb/vcontainer.h"
|
#include "../vpatterndb/vcontainer.h"
|
||||||
#include "../vwidgets/vcontrolpointspline.h"
|
#include "../vwidgets/vcontrolpointspline.h"
|
||||||
#include "../vwidgets/vmaingraphicsscene.h"
|
#include "../vwidgets/vmaingraphicsscene.h"
|
||||||
|
@ -75,11 +74,6 @@ class QGraphicsSceneContextMenuEvent;
|
||||||
class QGraphicsSceneHoverEvent;
|
class QGraphicsSceneHoverEvent;
|
||||||
class QGraphicsSceneMouseEvent;
|
class QGraphicsSceneMouseEvent;
|
||||||
|
|
||||||
#if QT_VERSION < QT_VERSION_CHECK(5, 1, 0)
|
|
||||||
# include "../vmisc/vmath.h"
|
|
||||||
#else
|
|
||||||
#endif
|
|
||||||
|
|
||||||
const QString VToolSpline::ToolType = QStringLiteral("simpleInteractive");
|
const QString VToolSpline::ToolType = QStringLiteral("simpleInteractive");
|
||||||
const QString VToolSpline::OldToolType = QStringLiteral("simple");
|
const QString VToolSpline::OldToolType = QStringLiteral("simple");
|
||||||
|
|
||||||
|
|
|
@ -28,8 +28,6 @@
|
||||||
|
|
||||||
#include "vtoolsplinepath.h"
|
#include "vtoolsplinepath.h"
|
||||||
|
|
||||||
#include <math.h>
|
|
||||||
#include <qmath.h>
|
|
||||||
#include <QDomElement>
|
#include <QDomElement>
|
||||||
#include <QEvent>
|
#include <QEvent>
|
||||||
#include <QFlags>
|
#include <QFlags>
|
||||||
|
@ -67,6 +65,7 @@
|
||||||
#include "../vgeometry/vspline.h"
|
#include "../vgeometry/vspline.h"
|
||||||
#include "../vgeometry/vsplinepoint.h"
|
#include "../vgeometry/vsplinepoint.h"
|
||||||
#include "../vmisc/vabstractapplication.h"
|
#include "../vmisc/vabstractapplication.h"
|
||||||
|
#include "../vmisc/vmath.h"
|
||||||
#include "../vpatterndb/vcontainer.h"
|
#include "../vpatterndb/vcontainer.h"
|
||||||
#include "../vwidgets/../vgeometry/vsplinepath.h"
|
#include "../vwidgets/../vgeometry/vsplinepath.h"
|
||||||
#include "../vwidgets/vcontrolpointspline.h"
|
#include "../vwidgets/vcontrolpointspline.h"
|
||||||
|
@ -80,11 +79,6 @@ class QGraphicsSceneContextMenuEvent;
|
||||||
class QGraphicsSceneHoverEvent;
|
class QGraphicsSceneHoverEvent;
|
||||||
class QGraphicsSceneMouseEvent;
|
class QGraphicsSceneMouseEvent;
|
||||||
|
|
||||||
#if QT_VERSION < QT_VERSION_CHECK(5, 1, 0)
|
|
||||||
# include "../vmisc/vmath.h"
|
|
||||||
#else
|
|
||||||
#endif
|
|
||||||
|
|
||||||
const QString VToolSplinePath::ToolType = QStringLiteral("pathInteractive");
|
const QString VToolSplinePath::ToolType = QStringLiteral("pathInteractive");
|
||||||
const QString VToolSplinePath::OldToolType = QStringLiteral("path");
|
const QString VToolSplinePath::OldToolType = QStringLiteral("path");
|
||||||
|
|
||||||
|
|
|
@ -76,7 +76,8 @@ VToolLinePoint::VToolLinePoint(VAbstractPattern *doc, VContainer *data, const qu
|
||||||
QPointF point1 = *data->GeometricObject<VPointF>(basePointId);
|
QPointF point1 = *data->GeometricObject<VPointF>(basePointId);
|
||||||
QPointF point2 = *data->GeometricObject<VPointF>(id);
|
QPointF point2 = *data->GeometricObject<VPointF>(id);
|
||||||
mainLine = new QGraphicsLineItem(QLineF(point1 - point2, QPointF()), this);
|
mainLine = new QGraphicsLineItem(QLineF(point1 - point2, QPointF()), this);
|
||||||
mainLine->setPen(QPen(Qt::black, qApp->toPixel(WidthHairLine(*VAbstractTool::data.GetPatternUnit()))/factor,
|
mainLine->setPen(QPen(CorrectColor(lineColor),
|
||||||
|
qApp->toPixel(WidthHairLine(*VAbstractTool::data.GetPatternUnit()))/factor,
|
||||||
LineStyleToPenStyle(typeLine)));
|
LineStyleToPenStyle(typeLine)));
|
||||||
mainLine->setFlag(QGraphicsItem::ItemStacksBehindParent, true);
|
mainLine->setFlag(QGraphicsItem::ItemStacksBehindParent, true);
|
||||||
}
|
}
|
||||||
|
@ -93,7 +94,7 @@ VToolLinePoint::~VToolLinePoint()
|
||||||
*/
|
*/
|
||||||
void VToolLinePoint::RefreshGeometry()
|
void VToolLinePoint::RefreshGeometry()
|
||||||
{
|
{
|
||||||
mainLine->setPen(QPen(CorrectColor(QColor(lineColor)),
|
mainLine->setPen(QPen(CorrectColor(lineColor),
|
||||||
qApp->toPixel(WidthHairLine(*VAbstractTool::data.GetPatternUnit()))/factor,
|
qApp->toPixel(WidthHairLine(*VAbstractTool::data.GetPatternUnit()))/factor,
|
||||||
LineStyleToPenStyle(typeLine)));
|
LineStyleToPenStyle(typeLine)));
|
||||||
VToolSinglePoint::RefreshPointGeometry(*VDrawTool::data.GeometricObject<VPointF>(id));
|
VToolSinglePoint::RefreshPointGeometry(*VDrawTool::data.GeometricObject<VPointF>(id));
|
||||||
|
|
|
@ -28,7 +28,6 @@
|
||||||
|
|
||||||
#include "vtoolshoulderpoint.h"
|
#include "vtoolshoulderpoint.h"
|
||||||
|
|
||||||
#include <QDebug>
|
|
||||||
#include <QLineF>
|
#include <QLineF>
|
||||||
#include <QMessageLogger>
|
#include <QMessageLogger>
|
||||||
#include <QSharedPointer>
|
#include <QSharedPointer>
|
||||||
|
|
|
@ -28,7 +28,6 @@
|
||||||
|
|
||||||
#include "vtoolpointofcontact.h"
|
#include "vtoolpointofcontact.h"
|
||||||
|
|
||||||
#include <QDebug>
|
|
||||||
#include <QLineF>
|
#include <QLineF>
|
||||||
#include <QMessageLogger>
|
#include <QMessageLogger>
|
||||||
#include <QSharedPointer>
|
#include <QSharedPointer>
|
||||||
|
|
|
@ -28,7 +28,6 @@
|
||||||
|
|
||||||
#include "vtooltriangle.h"
|
#include "vtooltriangle.h"
|
||||||
|
|
||||||
#include <QtCore/qmath.h>
|
|
||||||
#include <QLine>
|
#include <QLine>
|
||||||
#include <QLineF>
|
#include <QLineF>
|
||||||
#include <QSharedPointer>
|
#include <QSharedPointer>
|
||||||
|
@ -50,6 +49,7 @@
|
||||||
#include "../../../vabstracttool.h"
|
#include "../../../vabstracttool.h"
|
||||||
#include "../../vdrawtool.h"
|
#include "../../vdrawtool.h"
|
||||||
#include "vtoolsinglepoint.h"
|
#include "vtoolsinglepoint.h"
|
||||||
|
#include "../vmisc/vmath.h"
|
||||||
|
|
||||||
class QDomElement;
|
class QDomElement;
|
||||||
class QGraphicsSceneContextMenuEvent;
|
class QGraphicsSceneContextMenuEvent;
|
||||||
|
|
|
@ -29,7 +29,6 @@
|
||||||
#include "vdrawtool.h"
|
#include "vdrawtool.h"
|
||||||
|
|
||||||
#include <qnumeric.h>
|
#include <qnumeric.h>
|
||||||
#include <QDebug>
|
|
||||||
#include <QDialog>
|
#include <QDialog>
|
||||||
#include <QDomNode>
|
#include <QDomNode>
|
||||||
#include <QMessageLogger>
|
#include <QMessageLogger>
|
||||||
|
|
|
@ -28,7 +28,6 @@
|
||||||
|
|
||||||
#include "vtoolline.h"
|
#include "vtoolline.h"
|
||||||
|
|
||||||
#include <QDebug>
|
|
||||||
#include <QKeyEvent>
|
#include <QKeyEvent>
|
||||||
#include <QLineF>
|
#include <QLineF>
|
||||||
#include <QMessageLogger>
|
#include <QMessageLogger>
|
||||||
|
@ -85,7 +84,8 @@ VToolLine::VToolLine(VAbstractPattern *doc, VContainer *data, quint32 id, quint3
|
||||||
this->setFlag(QGraphicsItem::ItemStacksBehindParent, true);
|
this->setFlag(QGraphicsItem::ItemStacksBehindParent, true);
|
||||||
this->setFlag(QGraphicsItem::ItemIsFocusable, true);// For keyboard input focus
|
this->setFlag(QGraphicsItem::ItemIsFocusable, true);// For keyboard input focus
|
||||||
this->setAcceptHoverEvents(true);
|
this->setAcceptHoverEvents(true);
|
||||||
this->setPen(QPen(Qt::black, qApp->toPixel(WidthHairLine(*VAbstractTool::data.GetPatternUnit()))/factor,
|
this->setPen(QPen(CorrectColor(lineColor),
|
||||||
|
qApp->toPixel(WidthHairLine(*VAbstractTool::data.GetPatternUnit()))/factor,
|
||||||
LineStyleToPenStyle(typeLine)));
|
LineStyleToPenStyle(typeLine)));
|
||||||
|
|
||||||
ToolCreation(typeCreation);
|
ToolCreation(typeCreation);
|
||||||
|
@ -233,7 +233,7 @@ void VToolLine::Disable(bool disable, const QString &namePP)
|
||||||
{
|
{
|
||||||
enabled = !CorrectDisable(disable, namePP);
|
enabled = !CorrectDisable(disable, namePP);
|
||||||
this->setEnabled(enabled);
|
this->setEnabled(enabled);
|
||||||
this->setPen(QPen(CorrectColor(baseColor),
|
this->setPen(QPen(CorrectColor(lineColor),
|
||||||
qApp->toPixel(WidthHairLine(*VAbstractTool::data.GetPatternUnit()))/factor,
|
qApp->toPixel(WidthHairLine(*VAbstractTool::data.GetPatternUnit()))/factor,
|
||||||
LineStyleToPenStyle(typeLine)));
|
LineStyleToPenStyle(typeLine)));
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,8 +26,6 @@
|
||||||
**
|
**
|
||||||
*************************************************************************/
|
*************************************************************************/
|
||||||
|
|
||||||
#include <math.h>
|
|
||||||
#include <qmath.h>
|
|
||||||
#include <QColor>
|
#include <QColor>
|
||||||
#include <QFlags>
|
#include <QFlags>
|
||||||
#include <QFont>
|
#include <QFont>
|
||||||
|
@ -41,6 +39,7 @@
|
||||||
#include <Qt>
|
#include <Qt>
|
||||||
|
|
||||||
#include "../vmisc/def.h"
|
#include "../vmisc/def.h"
|
||||||
|
#include "../vmisc/vmath.h"
|
||||||
#include "vtextgraphicsitem.h"
|
#include "vtextgraphicsitem.h"
|
||||||
|
|
||||||
class QGraphicsSceneHoverEvent;
|
class QGraphicsSceneHoverEvent;
|
||||||
|
|
|
@ -30,7 +30,6 @@
|
||||||
|
|
||||||
#include <QAction>
|
#include <QAction>
|
||||||
#include <QBrush>
|
#include <QBrush>
|
||||||
#include <QDebug>
|
|
||||||
#include <QDialog>
|
#include <QDialog>
|
||||||
#include <QDomElement>
|
#include <QDomElement>
|
||||||
#include <QEvent>
|
#include <QEvent>
|
||||||
|
|
|
@ -29,7 +29,6 @@
|
||||||
#include "vtooluniondetails.h"
|
#include "vtooluniondetails.h"
|
||||||
|
|
||||||
#include <QByteArray>
|
#include <QByteArray>
|
||||||
#include <QDebug>
|
|
||||||
#include <QDomNodeList>
|
#include <QDomNodeList>
|
||||||
#include <QHash>
|
#include <QHash>
|
||||||
#include <QLineF>
|
#include <QLineF>
|
||||||
|
|
|
@ -28,7 +28,6 @@
|
||||||
|
|
||||||
#include "visline.h"
|
#include "visline.h"
|
||||||
|
|
||||||
#include <QtCore/qmath.h>
|
|
||||||
#include <QGraphicsScene>
|
#include <QGraphicsScene>
|
||||||
#include <QGuiApplication>
|
#include <QGuiApplication>
|
||||||
#include <QPen>
|
#include <QPen>
|
||||||
|
@ -37,6 +36,7 @@
|
||||||
#include "../ifc/ifcdef.h"
|
#include "../ifc/ifcdef.h"
|
||||||
#include "../vgeometry/vgobject.h"
|
#include "../vgeometry/vgobject.h"
|
||||||
#include "../vmisc/vabstractapplication.h"
|
#include "../vmisc/vabstractapplication.h"
|
||||||
|
#include "../vmisc/vmath.h"
|
||||||
#include "../vpatterndb/vcontainer.h"
|
#include "../vpatterndb/vcontainer.h"
|
||||||
|
|
||||||
class QPointF;
|
class QPointF;
|
||||||
|
|
|
@ -28,7 +28,6 @@
|
||||||
|
|
||||||
#include "vistooltriangle.h"
|
#include "vistooltriangle.h"
|
||||||
|
|
||||||
#include <QtCore/qmath.h>
|
|
||||||
#include <QGraphicsLineItem>
|
#include <QGraphicsLineItem>
|
||||||
#include <QGraphicsPathItem>
|
#include <QGraphicsPathItem>
|
||||||
#include <QPainterPath>
|
#include <QPainterPath>
|
||||||
|
@ -41,6 +40,7 @@
|
||||||
#include "../ifc/ifcdef.h"
|
#include "../ifc/ifcdef.h"
|
||||||
#include "../vgeometry/vpointf.h"
|
#include "../vgeometry/vpointf.h"
|
||||||
#include "../vmisc/vabstractapplication.h"
|
#include "../vmisc/vabstractapplication.h"
|
||||||
|
#include "../vmisc/vmath.h"
|
||||||
#include "../vpatterndb/vcontainer.h"
|
#include "../vpatterndb/vcontainer.h"
|
||||||
#include "../visualization.h"
|
#include "../visualization.h"
|
||||||
#include "visline.h"
|
#include "visline.h"
|
||||||
|
|
|
@ -31,7 +31,6 @@
|
||||||
#include <qnumeric.h>
|
#include <qnumeric.h>
|
||||||
#include <QBrush>
|
#include <QBrush>
|
||||||
#include <QColor>
|
#include <QColor>
|
||||||
#include <QDebug>
|
|
||||||
#include <QGraphicsEllipseItem>
|
#include <QGraphicsEllipseItem>
|
||||||
#include <QGraphicsItem>
|
#include <QGraphicsItem>
|
||||||
#include <QGraphicsLineItem>
|
#include <QGraphicsLineItem>
|
||||||
|
|
|
@ -28,7 +28,6 @@
|
||||||
|
|
||||||
#include "vmaingraphicsview.h"
|
#include "vmaingraphicsview.h"
|
||||||
|
|
||||||
#include <qmath.h>
|
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
#include <QCursor>
|
#include <QCursor>
|
||||||
#include <QEvent>
|
#include <QEvent>
|
||||||
|
@ -48,6 +47,7 @@
|
||||||
#include <QWidget>
|
#include <QWidget>
|
||||||
|
|
||||||
#include "../vmisc/def.h"
|
#include "../vmisc/def.h"
|
||||||
|
#include "../vmisc/vmath.h"
|
||||||
#include "vmaingraphicsscene.h"
|
#include "vmaingraphicsscene.h"
|
||||||
#include "vsimplecurve.h"
|
#include "vsimplecurve.h"
|
||||||
|
|
||||||
|
|
|
@ -29,7 +29,6 @@
|
||||||
#include "vsimplecurve.h"
|
#include "vsimplecurve.h"
|
||||||
|
|
||||||
#include <QBrush>
|
#include <QBrush>
|
||||||
#include <QDebug>
|
|
||||||
#include <QFlags>
|
#include <QFlags>
|
||||||
#include <QGraphicsScene>
|
#include <QGraphicsScene>
|
||||||
#include <QGraphicsSceneMouseEvent>
|
#include <QGraphicsSceneMouseEvent>
|
||||||
|
|
|
@ -27,7 +27,6 @@
|
||||||
*************************************************************************/
|
*************************************************************************/
|
||||||
|
|
||||||
#include <QCoreApplication>
|
#include <QCoreApplication>
|
||||||
#include <QDebug>
|
|
||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
#include <QtGlobal>
|
#include <QtGlobal>
|
||||||
#include "../qmuparser/qmuparsertest.h"
|
#include "../qmuparser/qmuparsertest.h"
|
||||||
|
|
|
@ -50,7 +50,8 @@ SOURCES += \
|
||||||
tst_vabstractcurve.cpp \
|
tst_vabstractcurve.cpp \
|
||||||
tst_findpoint.cpp \
|
tst_findpoint.cpp \
|
||||||
tst_vellipticalarc.cpp \
|
tst_vellipticalarc.cpp \
|
||||||
tst_vcubicbezierpath.cpp
|
tst_vcubicbezierpath.cpp \
|
||||||
|
tst_vgobject.cpp
|
||||||
|
|
||||||
win32-msvc*:SOURCES += stable.cpp
|
win32-msvc*:SOURCES += stable.cpp
|
||||||
|
|
||||||
|
@ -71,7 +72,8 @@ HEADERS += \
|
||||||
tst_vabstractcurve.h \
|
tst_vabstractcurve.h \
|
||||||
tst_findpoint.h \
|
tst_findpoint.h \
|
||||||
tst_vellipticalarc.h \
|
tst_vellipticalarc.h \
|
||||||
tst_vcubicbezierpath.h
|
tst_vcubicbezierpath.h \
|
||||||
|
tst_vgobject.h
|
||||||
|
|
||||||
# Set using ccache. Function enable_ccache() defined in common.pri.
|
# Set using ccache. Function enable_ccache() defined in common.pri.
|
||||||
$$enable_ccache()
|
$$enable_ccache()
|
||||||
|
|
|
@ -44,6 +44,7 @@
|
||||||
#include "tst_findpoint.h"
|
#include "tst_findpoint.h"
|
||||||
#include "tst_vabstractcurve.h"
|
#include "tst_vabstractcurve.h"
|
||||||
#include "tst_vcubicbezierpath.h"
|
#include "tst_vcubicbezierpath.h"
|
||||||
|
#include "tst_vgobject.h"
|
||||||
|
|
||||||
#include "../vmisc/def.h"
|
#include "../vmisc/def.h"
|
||||||
|
|
||||||
|
@ -76,6 +77,7 @@ int main(int argc, char** argv)
|
||||||
ASSERT_TEST(new TST_VCommandLine());
|
ASSERT_TEST(new TST_VCommandLine());
|
||||||
ASSERT_TEST(new TST_VAbstractCurve());
|
ASSERT_TEST(new TST_VAbstractCurve());
|
||||||
ASSERT_TEST(new TST_VCubicBezierPath());
|
ASSERT_TEST(new TST_VCubicBezierPath());
|
||||||
|
ASSERT_TEST(new TST_VGObject());
|
||||||
|
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
138
src/test/ValentinaTest/tst_vgobject.cpp
Normal file
138
src/test/ValentinaTest/tst_vgobject.cpp
Normal file
|
@ -0,0 +1,138 @@
|
||||||
|
/************************************************************************
|
||||||
|
**
|
||||||
|
** @file
|
||||||
|
** @author Roman Telezhynskyi <dismine(at)gmail.com>
|
||||||
|
** @date 16 8, 2016
|
||||||
|
**
|
||||||
|
** @brief
|
||||||
|
** @copyright
|
||||||
|
** This source code is part of the Valentine project, a pattern making
|
||||||
|
** program, whose allow create and modeling patterns of clothing.
|
||||||
|
** Copyright (C) 2016 Valentina project
|
||||||
|
** <https://bitbucket.org/dismine/valentina> All Rights Reserved.
|
||||||
|
**
|
||||||
|
** Valentina is free software: you can redistribute it and/or modify
|
||||||
|
** it under the terms of the GNU General Public License as published by
|
||||||
|
** the Free Software Foundation, either version 3 of the License, or
|
||||||
|
** (at your option) any later version.
|
||||||
|
**
|
||||||
|
** Valentina is distributed in the hope that it will be useful,
|
||||||
|
** but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
** GNU General Public License for more details.
|
||||||
|
**
|
||||||
|
** You should have received a copy of the GNU General Public License
|
||||||
|
** along with Valentina. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
**
|
||||||
|
*************************************************************************/
|
||||||
|
|
||||||
|
#include "tst_vgobject.h"
|
||||||
|
|
||||||
|
#include <QtTest>
|
||||||
|
|
||||||
|
#include "../vgeometry/vgobject.h"
|
||||||
|
#include "../vmisc/def.h"
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
TST_VGObject::TST_VGObject(QObject *parent)
|
||||||
|
:QObject(parent)
|
||||||
|
{}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
void TST_VGObject::TestIsPointOnLineviaPDP_data()
|
||||||
|
{
|
||||||
|
QTest::addColumn<QPointF>("p1");
|
||||||
|
QTest::addColumn<QPointF>("p2");
|
||||||
|
QTest::addColumn<QPointF>("t");
|
||||||
|
QTest::addColumn<bool>("excpect");
|
||||||
|
|
||||||
|
{
|
||||||
|
const QPointF p1(483.54330708661416, 3819.527433070866);
|
||||||
|
const QPointF p2(483.54330708661416, 1929.763653543307);
|
||||||
|
const QPointF t(483.54330708661416, 1920.763653543307);
|
||||||
|
QTest::newRow("Point is on line, but not on segment.") << p1 << p2 << t << true;
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
const QPointF p1(483.54330708661416, 3819.527433070866);
|
||||||
|
const QPointF p2(483.54330708661416, 1929.763653543307);
|
||||||
|
const QPointF t(483.54330708661416, 2874.763653543307);
|
||||||
|
QTest::newRow("Point is on segment. On middle.") << p1 << p2 << t << true;
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
const QPointF p1(483.54330708661416, 3819.527433070866);
|
||||||
|
const QPointF p2(483.54330708661416, 1929.763653543307);
|
||||||
|
const QPointF t(483.54330708661416, 1929.763653543307);
|
||||||
|
QTest::newRow("Point is on segment. The end of segment.") << p1 << p2 << t << true;
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
const QPointF p1(483.54330708661416, 3819.527433070866);
|
||||||
|
const QPointF p2(483.54330708661416, 1929.763653543307);
|
||||||
|
const QPointF t(483.54330708661416 + VGObject::accuracyPointOnLine, 2874.763653543307);
|
||||||
|
QTest::newRow("Min accuracy gap. On middle.") << p1 << p2 << t << false;
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
const QPointF p1(483.54330708661416, 3819.527433070866);
|
||||||
|
const QPointF p2(483.54330708661416, 1929.763653543307);
|
||||||
|
const QPointF t(483.54330708661416 + VGObject::accuracyPointOnLine, 1929.763653543307);
|
||||||
|
QTest::newRow("Min accuracy gap.") << p1 << p2 << t << false;
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
const QPointF p1(483.54330708661416, 3819.527433070866);
|
||||||
|
const QPointF p2(483.54330708661416, 1929.763653543307);
|
||||||
|
const QPointF t(483.54330708661416 + VGObject::accuracyPointOnLine/2., 2874.763653543307);
|
||||||
|
QTest::newRow("Less than min accuracy gap. On middle.") << p1 << p2 << t << true;
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
const QPointF p1(483.54330708661416, 3819.527433070866);
|
||||||
|
const QPointF p2(483.54330708661416, 1929.763653543307);
|
||||||
|
const QPointF t(483.54330708661416 + VGObject::accuracyPointOnLine/2., 1929.763653543307);
|
||||||
|
QTest::newRow("Less than min accuracy gap.") << p1 << p2 << t << true;
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
const QPointF p1(483.54330708661416, 3819.527433070866);
|
||||||
|
const QPointF p2(483.54330708661416, 1929.763653543307);
|
||||||
|
const QPointF t(370.1574803149606, 2874.763653543307);
|
||||||
|
QTest::newRow("Issue 534 - 3 cm gap. On middle.") << p1 << p2 << t << false;
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
const QPointF p1(483.54330708661416, 3819.527433070866);
|
||||||
|
const QPointF p2(483.54330708661416, 1929.763653543307);
|
||||||
|
const QPointF t(370.1574803149606, 1929.763653543307);
|
||||||
|
QTest::newRow("Issue 534 - 3 cm gap.") << p1 << p2 << t << false;
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
const QPointF p1(483.54330708661416, 3819.527433070866);
|
||||||
|
const QPointF p2(483.54330708661416, 1929.763653543307);
|
||||||
|
const QPointF t(407.9527559055118, 2874.763653543307);
|
||||||
|
QTest::newRow("Issue 534 - 2 cm gap. On middle.") << p1 << p2 << t << false;
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
const QPointF p1(483.54330708661416, 3819.527433070866);
|
||||||
|
const QPointF p2(483.54330708661416, 1929.763653543307);
|
||||||
|
const QPointF t(407.9527559055118, 1929.763653543307);
|
||||||
|
QTest::newRow("Issue 534 - 2 cm gap.") << p1 << p2 << t << false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
void TST_VGObject::TestIsPointOnLineviaPDP() const
|
||||||
|
{
|
||||||
|
QFETCH(QPointF, p1);
|
||||||
|
QFETCH(QPointF, p2);
|
||||||
|
QFETCH(QPointF, t);
|
||||||
|
QFETCH(bool, excpect);
|
||||||
|
|
||||||
|
const bool res = VGObject::IsPointOnLineviaPDP(t, p1, p2);
|
||||||
|
QCOMPARE(res, excpect);
|
||||||
|
}
|
||||||
|
|
45
src/test/ValentinaTest/tst_vgobject.h
Normal file
45
src/test/ValentinaTest/tst_vgobject.h
Normal file
|
@ -0,0 +1,45 @@
|
||||||
|
/************************************************************************
|
||||||
|
**
|
||||||
|
** @file
|
||||||
|
** @author Roman Telezhynskyi <dismine(at)gmail.com>
|
||||||
|
** @date 16 8, 2016
|
||||||
|
**
|
||||||
|
** @brief
|
||||||
|
** @copyright
|
||||||
|
** This source code is part of the Valentine project, a pattern making
|
||||||
|
** program, whose allow create and modeling patterns of clothing.
|
||||||
|
** Copyright (C) 2016 Valentina project
|
||||||
|
** <https://bitbucket.org/dismine/valentina> All Rights Reserved.
|
||||||
|
**
|
||||||
|
** Valentina is free software: you can redistribute it and/or modify
|
||||||
|
** it under the terms of the GNU General Public License as published by
|
||||||
|
** the Free Software Foundation, either version 3 of the License, or
|
||||||
|
** (at your option) any later version.
|
||||||
|
**
|
||||||
|
** Valentina is distributed in the hope that it will be useful,
|
||||||
|
** but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
** GNU General Public License for more details.
|
||||||
|
**
|
||||||
|
** You should have received a copy of the GNU General Public License
|
||||||
|
** along with Valentina. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
**
|
||||||
|
*************************************************************************/
|
||||||
|
|
||||||
|
#ifndef TST_VGOBJECT_H
|
||||||
|
#define TST_VGOBJECT_H
|
||||||
|
|
||||||
|
#include <QObject>
|
||||||
|
|
||||||
|
class TST_VGObject : public QObject
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
public:
|
||||||
|
explicit TST_VGObject(QObject *parent = nullptr);
|
||||||
|
|
||||||
|
private slots:
|
||||||
|
void TestIsPointOnLineviaPDP_data();
|
||||||
|
void TestIsPointOnLineviaPDP() const;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // TST_VGOBJECT_H
|
Loading…
Reference in New Issue
Block a user