Fixed gcc warning in code.

This commit is contained in:
dismine 2013-08-20 13:26:02 +03:00
parent ece5024156
commit 8f186148ba
87 changed files with 563 additions and 245 deletions

View File

@ -130,9 +130,11 @@ RESOURCES += \
CONFIG(debug, debug|release){ CONFIG(debug, debug|release){
# Debug # Debug
QMAKE_CXXFLAGS += -O0 -isystem "/usr/include/qt5" -Wall -Wextra -pedantic -Weffc++ -Woverloaded-virtual \ QMAKE_CXXFLAGS += -isystem "/usr/include/qt5" -isystem "/usr/include/qt5/QtWidgets" \
-Wctor-dtor-privacy -Wnon-virtual-dtor -Wold-style-cast -Wconversion -Wsign-conversion \ -isystem "/usr/include/qt5/QtXml" -isystem "/usr/include/qt5/QtGui" \
-Winit-self -Wunreachable-code -std=c++0x -isystem "/usr/include/qt5/QtCore" -O0 -Wall -Wextra -pedantic -Weffc++ \
-Woverloaded-virtual -Wctor-dtor-privacy -Wnon-virtual-dtor -Wold-style-cast \
-Wconversion -Wsign-conversion -Winit-self -Wunreachable-code -std=c++0x
}else{ }else{
# Release # Release
QMAKE_CXXFLAGS += -O1 -std=c++0x QMAKE_CXXFLAGS += -O1 -std=c++0x

View File

@ -1,7 +1,12 @@
#include "calculator.h" #include "calculator.h"
#include <cmath> #include <cmath>
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Weffc++"
#pragma GCC diagnostic ignored "-Wconversion"
#pragma GCC diagnostic ignored "-Wsign-conversion"
#pragma GCC diagnostic ignored "-Wctor-dtor-privacy"
#include <QDebug> #include <QDebug>
#pragma GCC diagnostic pop
#define DELIMITER 1 #define DELIMITER 1
#define VARIABLE 2 #define VARIABLE 2
@ -12,10 +17,8 @@
#define FINISHED 10 #define FINISHED 10
#define EOL 9 #define EOL 9
Calculator::Calculator(const VContainer *data){ Calculator::Calculator(const VContainer *data):errorMsg(0), token(QString()), tok(0), token_type(0),
index = 0; prog(QString()), index(0), data(data), debugFormula(QString()){
this->data = data;
} }
qreal Calculator::eval(QString prog, QString *errorMsg){ qreal Calculator::eval(QString prog, QString *errorMsg){

View File

@ -3,6 +3,7 @@
#pragma GCC diagnostic push #pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Weffc++" #pragma GCC diagnostic ignored "-Weffc++"
#pragma GCC diagnostic ignored "-Wconversion"
#pragma GCC diagnostic ignored "-Wsign-conversion" #pragma GCC diagnostic ignored "-Wsign-conversion"
#pragma GCC diagnostic ignored "-Wctor-dtor-privacy" #pragma GCC diagnostic ignored "-Wctor-dtor-privacy"
#include <QtGlobal> #include <QtGlobal>
@ -32,6 +33,8 @@ public:
*/ */
qreal eval(QString prog, QString *errorMsg); qreal eval(QString prog, QString *errorMsg);
private: private:
Calculator(const Calculator &calc);
const Calculator &operator=(const Calculator &calc);
QString *errorMsg; QString *errorMsg;
/** /**
* @brief token теперішня лексема. * @brief token теперішня лексема.

View File

@ -1,11 +1,20 @@
#include "vcontainer.h" #include "vcontainer.h"
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Weffc++"
#pragma GCC diagnostic ignored "-Wconversion"
#pragma GCC diagnostic ignored "-Wsign-conversion"
#pragma GCC diagnostic ignored "-Wctor-dtor-privacy"
#include <QDebug> #include <QDebug>
#pragma GCC diagnostic pop
#include "../options.h" #include "../options.h"
qint64 VContainer::_id = 0; qint64 VContainer::_id = 0;
VContainer::VContainer(){ VContainer::VContainer():base(QMap<QString, qint32>()), points(QMap<qint64, VPointF>()),
standartTable(QMap<QString, VStandartTableCell>()), incrementTable(QMap<QString, VIncrementTableRow>()),
lengthLines(QMap<QString, qreal>()), lineArcs(QMap<QString, qreal>()), splines(QMap<qint64, VSpline>()),
lengthSplines(QMap<QString, qreal>()), arcs(QMap<qint64, VArc>()), lengthArcs(QMap<QString, qreal>()),
splinePaths(QMap<qint64, VSplinePath>()){
SetSize(500); SetSize(500);
SetGrowth(1760); SetGrowth(1760);
CreateManTableIGroup (); CreateManTableIGroup ();
@ -60,7 +69,7 @@ qreal VContainer::GetLine(const QString &name) const{
return GetObject(lengthLines, name); return GetObject(lengthLines, name);
} }
qint32 VContainer::GetLineArc(const QString &name) const{ qreal VContainer::GetLineArc(const QString &name) const{
Q_ASSERT(!name.isEmpty()); Q_ASSERT(!name.isEmpty());
return GetObject(lineArcs, name); return GetObject(lineArcs, name);
} }
@ -155,16 +164,16 @@ void VContainer::AddLineArc(const QString &name, const qint32 &value){
qreal VContainer::GetValueStandartTableCell(const QString& name) const{ qreal VContainer::GetValueStandartTableCell(const QString& name) const{
VStandartTableCell cell = GetStandartTableCell(name); VStandartTableCell cell = GetStandartTableCell(name);
qreal k_size = ( ( qreal ) (size()/10) - 50.0 ) / 2; qreal k_size = ( static_cast<qreal> (size()/10.0) - 50.0 ) / 2.0;
qreal k_growth = ( ( qreal ) (growth()/10) - 176.0 ) / 6; qreal k_growth = ( static_cast<qreal> (growth()/10.0) - 176.0 ) / 6.0;
qreal value = cell.GetBase() + k_size*cell.GetKsize() + k_growth*cell.GetKgrowth(); qreal value = cell.GetBase() + k_size*cell.GetKsize() + k_growth*cell.GetKgrowth();
return value; return value;
} }
qreal VContainer::GetValueIncrementTableRow(const QString& name) const{ qreal VContainer::GetValueIncrementTableRow(const QString& name) const{
VIncrementTableRow cell = GetIncrementTableRow(name); VIncrementTableRow cell = GetIncrementTableRow(name);
qreal k_size = ( ( qreal ) (size()/10) - 50.0 ) / 2; qreal k_size = ( static_cast<qreal> (size()/10.0) - 50.0 ) / 2.0;
qreal k_growth = ( ( qreal ) (growth()/10) - 176.0 ) / 6; qreal k_growth = ( static_cast<qreal> (growth()/10.0) - 176.0 ) / 6.0;
qreal value = cell.getBase() + k_size*cell.getKsize() + k_growth*cell.getKgrowth(); qreal value = cell.getBase() + k_size*cell.getKsize() + k_growth*cell.getKgrowth();
return value; return value;
} }
@ -365,7 +374,7 @@ QString VContainer::GetNameSplinePath(const VSplinePath &path) const{
QString VContainer::GetNameArc(const qint64 &center, const qint64 &id) const{ QString VContainer::GetNameArc(const qint64 &center, const qint64 &id) const{
VPointF centerPoint = GetPoint(center); VPointF centerPoint = GetPoint(center);
return QString ("Arc(%1)%2").arg(centerPoint.name(), id); return QString ("Arc(%1)%2").arg(centerPoint.name()).arg(id);
} }
void VContainer::AddLengthLine(const QString &name, const qreal &value){ void VContainer::AddLengthLine(const QString &name, const qreal &value){

View File

@ -3,6 +3,7 @@
#pragma GCC diagnostic push #pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Weffc++" #pragma GCC diagnostic ignored "-Weffc++"
#pragma GCC diagnostic ignored "-Wconversion"
#pragma GCC diagnostic ignored "-Wsign-conversion" #pragma GCC diagnostic ignored "-Wsign-conversion"
#pragma GCC diagnostic ignored "-Wctor-dtor-privacy" #pragma GCC diagnostic ignored "-Wctor-dtor-privacy"
#include <QMap> #include <QMap>
@ -36,7 +37,7 @@ public:
VStandartTableCell GetStandartTableCell(const QString& name) const; VStandartTableCell GetStandartTableCell(const QString& name) const;
VIncrementTableRow GetIncrementTableRow(const QString& name) const; VIncrementTableRow GetIncrementTableRow(const QString& name) const;
qreal GetLine(const QString &name) const; qreal GetLine(const QString &name) const;
qint32 GetLineArc(const QString &name) const; qreal GetLineArc(const QString &name) const;
VSpline GetSpline(qint64 id) const; VSpline GetSpline(qint64 id) const;
VArc GetArc(qint64 id) const; VArc GetArc(qint64 id) const;
VSplinePath GetSplinePath(qint64 id) const; VSplinePath GetSplinePath(qint64 id) const;

View File

@ -1,20 +1,11 @@
#include "vincrementtablerow.h" #include "vincrementtablerow.h"
VIncrementTableRow::VIncrementTableRow(){ VIncrementTableRow::VIncrementTableRow():id(0), base(0), ksize(0), kgrowth(0), description(QString()){
this->id = 0;
this->base = 0;
this->ksize = 0;
this->kgrowth = 0;
this->description = QString();
} }
VIncrementTableRow::VIncrementTableRow(qint64 id, qreal base, qreal ksize, qreal kgrowth, VIncrementTableRow::VIncrementTableRow(qint64 id, qreal base, qreal ksize, qreal kgrowth,
QString description){ QString description):id(id), base(base), ksize(ksize),
this->id = id; kgrowth(kgrowth), description(description){
this->base = base;
this->ksize = ksize;
this->kgrowth = kgrowth;
this->description = description;
} }
QString VIncrementTableRow::getDescription() const{ QString VIncrementTableRow::getDescription() const{

View File

@ -1,7 +1,10 @@
#ifndef VINCREMENTTABLEROW_H #ifndef VINCREMENTTABLEROW_H
#define VINCREMENTTABLEROW_H #define VINCREMENTTABLEROW_H
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Weffc++"
#include <QString> #include <QString>
#pragma GCC diagnostic pop
class VIncrementTableRow class VIncrementTableRow
{ {

View File

@ -1,17 +1,10 @@
#include "vstandarttablecell.h" #include "vstandarttablecell.h"
VStandartTableCell::VStandartTableCell(){ VStandartTableCell::VStandartTableCell():base(0), ksize(0), kgrowth(0), description(QString()){
base = 0;
ksize = 0;
kgrowth = 0;
description = QString();
} }
VStandartTableCell::VStandartTableCell(qint32 base, qreal ksize, qreal kgrowth, QString description){ VStandartTableCell::VStandartTableCell(qint32 base, qreal ksize, qreal kgrowth, QString description):base(base),
this->base = base; ksize(ksize), kgrowth(kgrowth), description(description){
this->ksize = ksize;
this->kgrowth = kgrowth;
this->description = description;
} }
qint32 VStandartTableCell::GetBase() const{ qint32 VStandartTableCell::GetBase() const{

View File

@ -1,7 +1,13 @@
#ifndef VSTANDARTTABLECELL_H #ifndef VSTANDARTTABLECELL_H
#define VSTANDARTTABLECELL_H #define VSTANDARTTABLECELL_H
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Weffc++"
#pragma GCC diagnostic ignored "-Wconversion"
#pragma GCC diagnostic ignored "-Wsign-conversion"
#pragma GCC diagnostic ignored "-Wctor-dtor-privacy"
#include <QString> #include <QString>
#pragma GCC diagnostic pop
class VStandartTableCell class VStandartTableCell
{ {

View File

@ -1,11 +1,13 @@
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Weffc++"
#include "dialogalongline.h" #include "dialogalongline.h"
#include "ui_dialogalongline.h" #include "ui_dialogalongline.h"
#pragma GCC diagnostic pop
DialogAlongLine::DialogAlongLine(const VContainer *data, QWidget *parent) : DialogAlongLine::DialogAlongLine(const VContainer *data, QWidget *parent) :
DialogTool(data, parent), ui(new Ui::DialogAlongLine) DialogTool(data, parent), ui(new Ui::DialogAlongLine), number(0), pointName(QString()),
{ typeLine(QString()), formula(QString()), firstPointId(0), secondPointId(0){
ui->setupUi(this); ui->setupUi(this);
number = 0;
listWidget = ui->listWidget; listWidget = ui->listWidget;
labelResultCalculation = ui->labelResultCalculation; labelResultCalculation = ui->labelResultCalculation;
labelDescription = ui->labelDescription; labelDescription = ui->labelDescription;

View File

@ -1,7 +1,10 @@
#ifndef DIALOGALONGLINE_H #ifndef DIALOGALONGLINE_H
#define DIALOGALONGLINE_H #define DIALOGALONGLINE_H
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Weffc++"
#include "dialogtool.h" #include "dialogtool.h"
#pragma GCC diagnostic pop
#include "../options.h" #include "../options.h"
#include "../container/vcontainer.h" #include "../container/vcontainer.h"
#include "../container/calculator.h" #include "../container/calculator.h"
@ -37,6 +40,8 @@ private:
QString formula; QString formula;
qint64 firstPointId; qint64 firstPointId;
qint64 secondPointId; qint64 secondPointId;
DialogAlongLine(const DialogAlongLine &dialog);
const DialogAlongLine &operator=(const DialogAlongLine& dialog);
}; };
#endif // DIALOGALONGLINE_H #endif // DIALOGALONGLINE_H

View File

@ -3,12 +3,9 @@
#include "../container/calculator.h" #include "../container/calculator.h"
DialogArc::DialogArc(const VContainer *data, QWidget *parent) : DialogArc::DialogArc(const VContainer *data, QWidget *parent) :
DialogTool(data, parent), ui(new Ui::DialogArc) DialogTool(data, parent), ui(new Ui::DialogArc), flagRadius(false), flagF1(false), flagF2(false),
{ timerRadius(0), timerF1(0), timerF2(0), center(0), radius(QString()), f1(QString()), f2(QString()){
ui->setupUi(this); ui->setupUi(this);
flagRadius = false;
flagF1 = false;
flagF2 = false;
timerRadius = new QTimer(this); timerRadius = new QTimer(this);
connect(timerRadius, &QTimer::timeout, this, &DialogArc::EvalRadius); connect(timerRadius, &QTimer::timeout, this, &DialogArc::EvalRadius);

View File

@ -55,6 +55,8 @@ private:
void EvalF1(); void EvalF1();
void EvalF2(); void EvalF2();
void ShowLineArcs(); void ShowLineArcs();
DialogArc(const DialogArc &dialog);
const DialogArc &operator=(const DialogArc& dialog);
}; };
#endif // DIALOGARC_H #endif // DIALOGARC_H

View File

@ -2,10 +2,9 @@
#include "ui_dialogbisector.h" #include "ui_dialogbisector.h"
DialogBisector::DialogBisector(const VContainer *data, QWidget *parent) : DialogBisector::DialogBisector(const VContainer *data, QWidget *parent) :
DialogTool(data, parent), ui(new Ui::DialogBisector) DialogTool(data, parent), ui(new Ui::DialogBisector), number(0), pointName(QString()),
{ typeLine(QString()), formula(QString()), firstPointId(0), secondPointId(0), thirdPointId(0){
ui->setupUi(this); ui->setupUi(this);
number = 0;
listWidget = ui->listWidget; listWidget = ui->listWidget;
labelResultCalculation = ui->labelResultCalculation; labelResultCalculation = ui->labelResultCalculation;
labelDescription = ui->labelDescription; labelDescription = ui->labelDescription;

View File

@ -45,6 +45,8 @@ private:
qint64 firstPointId; qint64 firstPointId;
qint64 secondPointId; qint64 secondPointId;
qint64 thirdPointId; qint64 thirdPointId;
DialogBisector(const DialogBisector &dialog);
const DialogBisector &operator=(const DialogBisector& dialog);
}; };
#endif // DIALOGBISECTOR_H #endif // DIALOGBISECTOR_H

View File

@ -1,14 +1,17 @@
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Weffc++"
#pragma GCC diagnostic ignored "-Wconversion"
#include "dialogendline.h" #include "dialogendline.h"
#include "ui_dialogendline.h" #include "ui_dialogendline.h"
#include <QCloseEvent> #include <QCloseEvent>
#include <QString> #include <QString>
#pragma GCC diagnostic pop
#include "../container/vpointf.h" #include "../container/vpointf.h"
#include "../container/calculator.h" #include "../container/calculator.h"
DialogEndLine::DialogEndLine(const VContainer *data, QWidget *parent) : DialogEndLine::DialogEndLine(const VContainer *data, QWidget *parent) :
DialogTool(data, parent), ui(new Ui::DialogEndLine) DialogTool(data, parent), ui(new Ui::DialogEndLine), pointName(QString()), typeLine(QString()),
{ formula(QString()), angle(0), basePointId(0){
ui->setupUi(this); ui->setupUi(this);
spinBoxAngle = ui->spinBoxAngle; spinBoxAngle = ui->spinBoxAngle;
listWidget = ui->listWidget; listWidget = ui->listWidget;

View File

@ -1,10 +1,13 @@
#ifndef DIALOGENDLINE_H #ifndef DIALOGENDLINE_H
#define DIALOGENDLINE_H #define DIALOGENDLINE_H
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Weffc++"
#include "dialogtool.h" #include "dialogtool.h"
#include <QPushButton> #include <QPushButton>
#include <QListWidgetItem> #include <QListWidgetItem>
#include <QTimer> #include <QTimer>
#pragma GCC diagnostic pop
#include "../options.h" #include "../options.h"
#include "../container/vcontainer.h" #include "../container/vcontainer.h"
@ -40,6 +43,8 @@ private:
QString formula; QString formula;
qint32 angle; qint32 angle;
qint64 basePointId; qint64 basePointId;
DialogEndLine(const DialogEndLine &dialog);
const DialogEndLine &operator=(const DialogEndLine& dialog);
}; };
#endif // DIALOGENDLINE_H #endif // DIALOGENDLINE_H

View File

@ -36,6 +36,8 @@ private:
QString Record(const VToolRecord &tool); QString Record(const VToolRecord &tool);
void InitialTable(); void InitialTable();
void ShowPoint(); void ShowPoint();
DialogHistory(const DialogHistory &dialog);
const DialogHistory &operator=(const DialogHistory& dialog);
}; };
#endif // DIALOGHISTORY_H #endif // DIALOGHISTORY_H

View File

@ -1,17 +1,17 @@
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Weffc++"
#include "dialogincrements.h" #include "dialogincrements.h"
#include "ui_dialogincrements.h" #include "ui_dialogincrements.h"
#include <QHeaderView> #include <QHeaderView>
#include <QCloseEvent> #include <QCloseEvent>
#include "../container/vincrementtablerow.h"
#include "../widgets/delegate.h" #include "../widgets/delegate.h"
#include "../widgets/doubledelegate.h" #include "../widgets/doubledelegate.h"
#pragma GCC diagnostic pop
#include "../container/vincrementtablerow.h"
DialogIncrements::DialogIncrements(VContainer *data, VDomDocument *doc, QWidget *parent) : DialogIncrements::DialogIncrements(VContainer *data, VDomDocument *doc, QWidget *parent) :
DialogTool(data, parent), ui(new Ui::DialogIncrements){ DialogTool(data, parent), ui(new Ui::DialogIncrements), data(data), doc(doc){
ui->setupUi(this); ui->setupUi(this);
this->doc = doc;
this->data = data;
InitialStandartTable(); InitialStandartTable();
InitialIncrementTable(); InitialIncrementTable();
InitialLinesTable(); InitialLinesTable();
@ -305,7 +305,7 @@ void DialogIncrements::clickedToolButtonRemove(){
&DialogIncrements::cellChanged); &DialogIncrements::cellChanged);
} }
void DialogIncrements::AddIncrementToFile(quint64 id, QString name, qint32 base, qreal ksize, void DialogIncrements::AddIncrementToFile(qint64 id, QString name, qint32 base, qreal ksize,
qreal kgrowth, QString description){ qreal kgrowth, QString description){
QDomNodeList list = doc->elementsByTagName("increments"); QDomNodeList list = doc->elementsByTagName("increments");
QDomElement element = doc->createElement("increment"); QDomElement element = doc->createElement("increment");

View File

@ -1,11 +1,14 @@
#ifndef DIALOGINCREMENTS_H #ifndef DIALOGINCREMENTS_H
#define DIALOGINCREMENTS_H #define DIALOGINCREMENTS_H
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Weffc++"
#include "dialogtool.h" #include "dialogtool.h"
#include <QPushButton> #include <QPushButton>
#include "../container/vcontainer.h"
#include "../xml/vdomdocument.h" #include "../xml/vdomdocument.h"
#pragma GCC diagnostic pop
#include "../container/vcontainer.h"
namespace Ui { namespace Ui {
class DialogIncrements; class DialogIncrements;
@ -40,8 +43,10 @@ private:
void FillLengthLines(); void FillLengthLines();
void FillLengthSplines(); void FillLengthSplines();
void FillLengthArcs(); void FillLengthArcs();
void AddIncrementToFile(quint64 id, QString name, qint32 base, qreal ksize, qreal kgrowth, void AddIncrementToFile(qint64 id, QString name, qint32 base, qreal ksize, qreal kgrowth,
QString description); QString description);
DialogIncrements(const DialogIncrements &dialog);
const DialogIncrements &operator=(const DialogIncrements& dialog);
}; };
#endif // DIALOGINCREMENTS_H #endif // DIALOGINCREMENTS_H

View File

@ -1,11 +1,16 @@
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Weffc++"
#pragma GCC diagnostic ignored "-Wconversion"
#pragma GCC diagnostic ignored "-Wsign-conversion"
#pragma GCC diagnostic ignored "-Wctor-dtor-privacy"
#include "dialogline.h" #include "dialogline.h"
#include "ui_dialogline.h" #include "ui_dialogline.h"
#include <QPushButton> #include <QPushButton>
#include <QCloseEvent> #include <QCloseEvent>
#pragma GCC diagnostic pop
DialogLine::DialogLine(const VContainer *data, QWidget *parent) : DialogLine::DialogLine(const VContainer *data, QWidget *parent) :
DialogTool(data, parent), ui(new Ui::DialogLine) DialogTool(data, parent), ui(new Ui::DialogLine), number(0), firstPoint(0), secondPoint(0){
{
ui->setupUi(this); ui->setupUi(this);
bOk = ui->buttonBox->button(QDialogButtonBox::Ok); bOk = ui->buttonBox->button(QDialogButtonBox::Ok);
connect(bOk, &QPushButton::clicked, this, &DialogLine::DialogAccepted); connect(bOk, &QPushButton::clicked, this, &DialogLine::DialogAccepted);

View File

@ -1,10 +1,17 @@
#ifndef DIALOGLINE_H #ifndef DIALOGLINE_H
#define DIALOGLINE_H #define DIALOGLINE_H
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Weffc++"
#pragma GCC diagnostic ignored "-Wconversion"
#pragma GCC diagnostic ignored "-Wsign-conversion"
#pragma GCC diagnostic ignored "-Wctor-dtor-privacy"
#include "dialogtool.h" #include "dialogtool.h"
#include <QComboBox>
#pragma GCC diagnostic pop
#include "../container/vcontainer.h" #include "../container/vcontainer.h"
#include "../options.h" #include "../options.h"
#include <QComboBox>
namespace Ui { namespace Ui {
class DialogLine; class DialogLine;
@ -28,6 +35,8 @@ private:
qint32 number; qint32 number;
qint64 firstPoint; qint64 firstPoint;
qint64 secondPoint; qint64 secondPoint;
DialogLine(const DialogLine &dialog);
const DialogLine &operator=(const DialogLine& dialog);
}; };
#endif // DIALOGLINE_H #endif // DIALOGLINE_H

View File

@ -2,14 +2,13 @@
#include "ui_dialoglineintersect.h" #include "ui_dialoglineintersect.h"
DialogLineIntersect::DialogLineIntersect(const VContainer *data, QWidget *parent) : DialogLineIntersect::DialogLineIntersect(const VContainer *data, QWidget *parent) :
DialogTool(data, parent), ui(new Ui::DialogLineIntersect) DialogTool(data, parent), ui(new Ui::DialogLineIntersect), number(0), pointName(QString()), p1Line1(0),
{ p2Line1(0), p1Line2(0), p2Line2(0), flagPoint(true){
ui->setupUi(this); ui->setupUi(this);
number = 0; number = 0;
bOk = ui->buttonBox->button(QDialogButtonBox::Ok); bOk = ui->buttonBox->button(QDialogButtonBox::Ok);
connect(bOk, &QPushButton::clicked, this, &DialogLineIntersect::DialogAccepted); connect(bOk, &QPushButton::clicked, this, &DialogLineIntersect::DialogAccepted);
flagName = false; flagName = false;
flagPoint = true;
QPushButton *bCansel = ui->buttonBox->button(QDialogButtonBox::Cancel); QPushButton *bCansel = ui->buttonBox->button(QDialogButtonBox::Cancel);
connect(bCansel, &QPushButton::clicked, this, &DialogLineIntersect::DialogRejected); connect(bCansel, &QPushButton::clicked, this, &DialogLineIntersect::DialogRejected);
FillComboBoxPoints(ui->comboBoxP1Line1); FillComboBoxPoints(ui->comboBoxP1Line1);

View File

@ -41,6 +41,8 @@ private:
bool flagPoint; bool flagPoint;
virtual void CheckState(); virtual void CheckState();
bool CheckIntersecion(); bool CheckIntersecion();
DialogLineIntersect(const DialogLineIntersect &dialog);
const DialogLineIntersect &operator=(const DialogLineIntersect& dialog);
}; };
#endif // DIALOGLINEINTERSECT_H #endif // DIALOGLINEINTERSECT_H

View File

@ -3,10 +3,9 @@
#include <QMenu> #include <QMenu>
DialogNormal::DialogNormal(const VContainer *data, QWidget *parent) : DialogNormal::DialogNormal(const VContainer *data, QWidget *parent) :
DialogTool(data, parent), ui(new Ui::DialogNormal) DialogTool(data, parent), ui(new Ui::DialogNormal), number(0), pointName(QString()), typeLine(QString()),
{ formula(QString()), angle(0), firstPointId(0), secondPointId(0){
ui->setupUi(this); ui->setupUi(this);
number = 0;
spinBoxAngle = ui->spinBoxAngle; spinBoxAngle = ui->spinBoxAngle;
listWidget = ui->listWidget; listWidget = ui->listWidget;
labelResultCalculation = ui->labelResultCalculation; labelResultCalculation = ui->labelResultCalculation;

View File

@ -44,6 +44,8 @@ private:
qint32 angle; qint32 angle;
qint64 firstPointId; qint64 firstPointId;
qint64 secondPointId; qint64 secondPointId;
DialogNormal(const DialogNormal &dialog);
const DialogNormal &operator=(const DialogNormal& dialog);
}; };
#endif // DIALOGNORMAL_H #endif // DIALOGNORMAL_H

View File

@ -2,8 +2,8 @@
#include "ui_dialogshoulderpoint.h" #include "ui_dialogshoulderpoint.h"
DialogShoulderPoint::DialogShoulderPoint(const VContainer *data, QWidget *parent) : DialogShoulderPoint::DialogShoulderPoint(const VContainer *data, QWidget *parent) :
DialogTool(data, parent), ui(new Ui::DialogShoulderPoint) DialogTool(data, parent), ui(new Ui::DialogShoulderPoint), number(0), pointName(QString()),
{ typeLine(QString()), formula(QString()), p1Line(0), p2Line(0), pShoulder(0){
ui->setupUi(this); ui->setupUi(this);
number = 0; number = 0;
listWidget = ui->listWidget; listWidget = ui->listWidget;

View File

@ -40,6 +40,8 @@ private:
qint64 p1Line; qint64 p1Line;
qint64 p2Line; qint64 p2Line;
qint64 pShoulder; qint64 pShoulder;
DialogShoulderPoint(const DialogShoulderPoint &dialog);
const DialogShoulderPoint &operator=(const DialogShoulderPoint& dialog);
}; };
#endif // DIALOGSHOULDERPOINT_H #endif // DIALOGSHOULDERPOINT_H

View File

@ -1,15 +1,18 @@
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Weffc++" #pragma GCC diagnostic ignored "-Weffc++"
#pragma GCC diagnostic ignored "-Wconversion"
#pragma GCC diagnostic ignored "-Wsign-conversion"
#pragma GCC diagnostic ignored "-Wctor-dtor-privacy"
#include "dialogsinglepoint.h" #include "dialogsinglepoint.h"
#include "ui_dialogsinglepoint.h" #include "ui_dialogsinglepoint.h"
#include <QShowEvent> #include <QShowEvent>
#include <QPushButton> #include <QPushButton>
#include <QDebug> #include <QDebug>
#pragma GCC diagnostic warning "-Weffc++" #pragma GCC diagnostic pop
#include "../options.h" #include "../options.h"
DialogSinglePoint::DialogSinglePoint(const VContainer *data, QWidget *parent) : DialogSinglePoint::DialogSinglePoint(const VContainer *data, QWidget *parent) :
DialogTool(data, parent), ui(new Ui::DialogSinglePoint) DialogTool(data, parent), ui(new Ui::DialogSinglePoint), name(QString()), point(QPointF()){
{
ui->setupUi(this); ui->setupUi(this);
ui->doubleSpinBoxX->setRange(0,PaperSize/PrintDPI*25.4); ui->doubleSpinBoxX->setRange(0,PaperSize/PrintDPI*25.4);
ui->doubleSpinBoxY->setRange(0,PaperSize/PrintDPI*25.4); ui->doubleSpinBoxY->setRange(0,PaperSize/PrintDPI*25.4);

View File

@ -26,6 +26,8 @@ private:
Ui::DialogSinglePoint *ui; Ui::DialogSinglePoint *ui;
QString name; QString name;
QPointF point; QPointF point;
DialogSinglePoint(const DialogSinglePoint &dialog);
const DialogSinglePoint &operator=(const DialogSinglePoint& dialog);
}; };
#endif // DIALOGSINGLEPOINT_H #endif // DIALOGSINGLEPOINT_H

View File

@ -2,10 +2,9 @@
#include "ui_dialogspline.h" #include "ui_dialogspline.h"
DialogSpline::DialogSpline(const VContainer *data, QWidget *parent) : DialogSpline::DialogSpline(const VContainer *data, QWidget *parent) :
DialogTool(data, parent), ui(new Ui::DialogSpline) DialogTool(data, parent), ui(new Ui::DialogSpline), number(0), p1(0), p4(0), angle1(0), angle2(0),
{ kAsm1(1), kAsm2(1), kCurve(1){
ui->setupUi(this); ui->setupUi(this);
number = 0;
bOk = ui->buttonBox->button(QDialogButtonBox::Ok); bOk = ui->buttonBox->button(QDialogButtonBox::Ok);
connect(bOk, &QPushButton::clicked, this, &DialogSpline::DialogAccepted); connect(bOk, &QPushButton::clicked, this, &DialogSpline::DialogAccepted);
@ -40,8 +39,8 @@ void DialogSpline::ChoosedObject(qint64 id, Scene::Type type){
qint64 p1Id = qvariant_cast<qint64>(ui->comboBoxP1->itemData(index)); qint64 p1Id = qvariant_cast<qint64>(ui->comboBoxP1->itemData(index));
QPointF p1 = data->GetPoint(p1Id).toQPointF(); QPointF p1 = data->GetPoint(p1Id).toQPointF();
QPointF p4 = data->GetPoint(id).toQPointF(); QPointF p4 = data->GetPoint(id).toQPointF();
ui->spinBoxAngle1->setValue(QLineF(p1, p4).angle()); ui->spinBoxAngle1->setValue(static_cast<qint32>(QLineF(p1, p4).angle()));
ui->spinBoxAngle2->setValue(QLineF(p4, p1).angle()); ui->spinBoxAngle2->setValue(static_cast<qint32>(QLineF(p4, p1).angle()));
} }
if(!isInitialized){ if(!isInitialized){
this->show(); this->show();
@ -94,7 +93,7 @@ qreal DialogSpline::getAngle2() const{
void DialogSpline::setAngle2(const qreal &value){ void DialogSpline::setAngle2(const qreal &value){
angle2 = value; angle2 = value;
ui->spinBoxAngle2->setValue(value); ui->spinBoxAngle2->setValue(static_cast<qint32>(value));
} }
qreal DialogSpline::getAngle1() const{ qreal DialogSpline::getAngle1() const{
@ -103,7 +102,7 @@ qreal DialogSpline::getAngle1() const{
void DialogSpline::setAngle1(const qreal &value){ void DialogSpline::setAngle1(const qreal &value){
angle1 = value; angle1 = value;
ui->spinBoxAngle1->setValue(value); ui->spinBoxAngle1->setValue(static_cast<qint32>(value));
} }
qint64 DialogSpline::getP4() const{ qint64 DialogSpline::getP4() const{

View File

@ -41,6 +41,8 @@ private:
qreal kAsm1; qreal kAsm1;
qreal kAsm2; qreal kAsm2;
qreal kCurve; qreal kCurve;
DialogSpline(const DialogSpline &dialog);
const DialogSpline &operator=(const DialogSpline& dialog);
}; };
#endif // DIALOGSPLINE_H #endif // DIALOGSPLINE_H

View File

@ -1,10 +1,15 @@
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Weffc++"
#pragma GCC diagnostic ignored "-Wconversion"
#pragma GCC diagnostic ignored "-Wsign-conversion"
#pragma GCC diagnostic ignored "-Wctor-dtor-privacy"
#include "dialogsplinepath.h" #include "dialogsplinepath.h"
#include "ui_dialogsplinepath.h" #include "ui_dialogsplinepath.h"
#pragma GCC diagnostic pop
#include "../geometry/vsplinepoint.h" #include "../geometry/vsplinepoint.h"
DialogSplinePath::DialogSplinePath(const VContainer *data, QWidget *parent) : DialogSplinePath::DialogSplinePath(const VContainer *data, QWidget *parent) :
DialogTool(data, parent), ui(new Ui::DialogSplinePath) DialogTool(data, parent), ui(new Ui::DialogSplinePath), path(VSplinePath()){
{
ui->setupUi(this); ui->setupUi(this);
bOk = ui->buttonBox->button(QDialogButtonBox::Ok); bOk = ui->buttonBox->button(QDialogButtonBox::Ok);
connect(bOk, &QPushButton::clicked, this, &DialogSplinePath::DialogAccepted); connect(bOk, &QPushButton::clicked, this, &DialogSplinePath::DialogAccepted);
@ -136,8 +141,8 @@ void DialogSplinePath::DataPoint(qint64 id, qreal kAsm1, qreal angle1, qreal kAs
ChangeCurrentData(ui->comboBoxPoint, id); ChangeCurrentData(ui->comboBoxPoint, id);
ui->doubleSpinBoxKasm1->setValue(kAsm1); ui->doubleSpinBoxKasm1->setValue(kAsm1);
ui->doubleSpinBoxKasm2->setValue(kAsm2); ui->doubleSpinBoxKasm2->setValue(kAsm2);
ui->spinBoxAngle2->setValue(angle2); ui->spinBoxAngle2->setValue(static_cast<qint32>(angle2));
ui->spinBoxAngle1->setValue(angle1); ui->spinBoxAngle1->setValue(static_cast<qint32>(angle1));
connect(ui->comboBoxPoint, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), connect(ui->comboBoxPoint, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged),
this, &DialogSplinePath::currentPointChanged); this, &DialogSplinePath::currentPointChanged);

View File

@ -1,7 +1,13 @@
#ifndef DIALOGSPLINEPATH_H #ifndef DIALOGSPLINEPATH_H
#define DIALOGSPLINEPATH_H #define DIALOGSPLINEPATH_H
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Weffc++"
#pragma GCC diagnostic ignored "-Wconversion"
#pragma GCC diagnostic ignored "-Wsign-conversion"
#pragma GCC diagnostic ignored "-Wctor-dtor-privacy"
#include "dialogtool.h" #include "dialogtool.h"
#pragma GCC diagnostic pop
#include "../container/vcontainer.h" #include "../container/vcontainer.h"
#include "../geometry/vsplinepath.h" #include "../geometry/vsplinepath.h"
@ -33,6 +39,8 @@ private:
void DataPoint(qint64 id, qreal kAsm1, qreal angle1, qreal kAsm2, qreal angle2); void DataPoint(qint64 id, qreal kAsm1, qreal angle1, qreal kAsm2, qreal angle2);
void EnableFields(); void EnableFields();
void SetAngle(qint32 angle); void SetAngle(qint32 angle);
DialogSplinePath(const DialogSplinePath &dialog);
const DialogSplinePath &operator=(const DialogSplinePath& dialog);
}; };
#endif // DIALOGSPLINEPATH_H #endif // DIALOGSPLINEPATH_H

View File

@ -1,27 +1,21 @@
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Weffc++"
#pragma GCC diagnostic ignored "-Wconversion"
#pragma GCC diagnostic ignored "-Wsign-conversion"
#pragma GCC diagnostic ignored "-Wctor-dtor-privacy"
#include "dialogtool.h" #include "dialogtool.h"
#include <QListWidgetItem> #include <QListWidgetItem>
#include <QCloseEvent> #include <QCloseEvent>
#pragma GCC diagnostic pop
#include "../container/calculator.h" #include "../container/calculator.h"
DialogTool::DialogTool(const VContainer *data, QWidget *parent):QDialog(parent){ DialogTool::DialogTool(const VContainer *data, QWidget *parent):QDialog(parent), data(data),
isInitialized(false), flagName(true), flagFormula(true), timerFormula(0), bOk(0), spinBoxAngle(0),
lineEditFormula(0), listWidget(0), labelResultCalculation(0), labelDescription(0), radioButtonSizeGrowth(0),
radioButtonStandartTable(0), radioButtonIncrements(0), radioButtonLengthLine(0){
Q_CHECK_PTR(data); Q_CHECK_PTR(data);
this->data = data;
flagName = true;
flagFormula = true;
timerFormula = new QTimer(this); timerFormula = new QTimer(this);
connect(timerFormula, &QTimer::timeout, this, &DialogTool::EvalFormula); connect(timerFormula, &QTimer::timeout, this, &DialogTool::EvalFormula);
isInitialized = false;
bOk = 0;
spinBoxAngle = 0;
lineEditFormula = 0;
listWidget = 0;
labelResultCalculation = 0;
labelDescription = 0;
radioButtonSizeGrowth = 0;
radioButtonStandartTable = 0;
radioButtonIncrements = 0;
radioButtonLengthLine = 0;
} }
DialogTool::~DialogTool(){ DialogTool::~DialogTool(){
@ -329,7 +323,7 @@ void DialogTool::UpdateList(){
} }
} }
export template <class key, class val> template <class key, class val>
void DialogTool::ShowVariable(const QMap<key, val> *var){ void DialogTool::ShowVariable(const QMap<key, val> *var){
Q_CHECK_PTR(listWidget); Q_CHECK_PTR(listWidget);
disconnect(listWidget, &QListWidget::currentRowChanged, this, &DialogTool::ValChenged); disconnect(listWidget, &QListWidget::currentRowChanged, this, &DialogTool::ValChenged);

View File

@ -1,7 +1,11 @@
#ifndef DIALOGTOOL_H #ifndef DIALOGTOOL_H
#define DIALOGTOOL_H #define DIALOGTOOL_H
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Weffc++" #pragma GCC diagnostic ignored "-Weffc++"
#pragma GCC diagnostic ignored "-Wconversion"
#pragma GCC diagnostic ignored "-Wsign-conversion"
#pragma GCC diagnostic ignored "-Wctor-dtor-privacy"
#include <QDialog> #include <QDialog>
#include <QComboBox> #include <QComboBox>
#include <QSpinBox> #include <QSpinBox>
@ -11,7 +15,7 @@
#include <QLabel> #include <QLabel>
#include <QRadioButton> #include <QRadioButton>
#include <QTimer> #include <QTimer>
#pragma GCC diagnostic warning "-Weffc++" #pragma GCC diagnostic pop
#include "../container/vcontainer.h" #include "../container/vcontainer.h"
#include "../options.h" #include "../options.h"
@ -77,6 +81,8 @@ protected:
void Eval(QLineEdit *edit, bool &flag, QTimer *timer, QLabel *label); void Eval(QLineEdit *edit, bool &flag, QTimer *timer, QLabel *label);
void setCurrentPointId(QComboBox *box, qint64 &pointId, const qint64 &value, const qint64 &id) const; void setCurrentPointId(QComboBox *box, qint64 &pointId, const qint64 &value, const qint64 &id) const;
qint64 getCurrentPointId(QComboBox *box) const; qint64 getCurrentPointId(QComboBox *box) const;
DialogTool(const DialogTool &dialog);
const DialogTool &operator=(const DialogTool &dialog);
}; };
#endif // DIALOGTOOL_H #endif // DIALOGTOOL_H

View File

@ -3,41 +3,24 @@
#include "vspline.h" #include "vspline.h"
#include <QDebug> #include <QDebug>
VSpline::VSpline(){ VSpline::VSpline():p1(0), p2(QPointF()), p3(QPointF()), p4(0), angle1(0), angle2(0), kAsm1(1), kAsm2(1),
p1 = 0; kCurve(1), points(0){
p2 = QPointF();
p3 = QPointF();
p4 = 0;
angle1 = 0;
angle2 = 0;
points = 0;
kAsm1 = 1;
kAsm2 = 1;
kCurve = 1;
} }
VSpline::VSpline ( const VSpline & spline ){ VSpline::VSpline ( const VSpline & spline ):p1(spline.GetP1 ()), p2(spline.GetP2 ()), p3(spline.GetP3 ()),
p1 = spline.GetP1 (); p4(spline.GetP4 ()), angle1(spline.GetAngle1 ()), angle2(spline.GetAngle2 ()), kAsm1(spline.GetKasm1()),
p2 = spline.GetP2 (); kAsm2(spline.GetKasm2()), kCurve(spline.GetKcurve()), points(spline.GetDataPoints()){
p3 = spline.GetP3 ();
p4 = spline.GetP4 ();
angle1 = spline.GetAngle1 ();
angle2 = spline.GetAngle2 ();
points = spline.GetDataPoints();
kAsm1 = spline.GetKasm1();
kAsm2 = spline.GetKasm2();
kCurve = spline.GetKcurve();
} }
VSpline::VSpline (const QMap<qint64, VPointF> *points, qint64 p1, qint64 p4, qreal angle1, qreal angle2, VSpline::VSpline (const QMap<qint64, VPointF> *points, qint64 p1, qint64 p4, qreal angle1, qreal angle2,
qreal kAsm1, qreal kAsm2 , qreal kCurve){ qreal kAsm1, qreal kAsm2 , qreal kCurve):p1(p1), p2(QPointF()), p3(QPointF()),
this->points = points; p4(p4), angle1(angle1), angle2(angle2), kAsm1(kAsm1), kAsm2(kAsm2), kCurve(kCurve), points(points){
ModifiSpl ( p1, p4, angle1, angle2, kAsm1, kAsm2, kCurve ); ModifiSpl ( p1, p4, angle1, angle2, kAsm1, kAsm2, kCurve );
} }
VSpline::VSpline (const QMap<qint64, VPointF> *points, qint64 p1, QPointF p2, QPointF p3, qint64 p4, VSpline::VSpline (const QMap<qint64, VPointF> *points, qint64 p1, QPointF p2, QPointF p3, qint64 p4,
qreal kCurve){ qreal kCurve):p1(p1), p2(p2), p3(p3), p4(p4), angle1(0), angle2(0), kAsm1(1), kAsm2(1),
this->points = points; kCurve(1), points(points){
ModifiSpl ( p1, p2, p3, p4, kCurve); ModifiSpl ( p1, p2, p3, p4, kCurve);
} }
@ -308,7 +291,7 @@ qreal VSpline::LengthBezier ( QPointF p1, QPointF p2, QPointF p3, QPointF p4 ) c
py.append ( p4.y () ); py.append ( p4.y () );
qint32 i = 0; qint32 i = 0;
qreal length = 0.0; qreal length = 0.0;
/* *
* Наприклад маємо 10 точок. Від 0 до 9 і останню точку не опрацьовуємо. * Наприклад маємо 10 точок. Від 0 до 9 і останню точку не опрацьовуємо.
* Тому від 0 до 8(<10-1). * Тому від 0 до 8(<10-1).
* *
@ -368,8 +351,8 @@ void VSpline::PointBezier_r ( qreal x1, qreal y1, qreal x2, qreal y2,
double d3 = fabs(((x3 - x4) * dy - (y3 - y4) * dx)); double d3 = fabs(((x3 - x4) * dy - (y3 - y4) * dx));
double da1, da2, k; double da1, da2, k;
switch(((int)(d2 > curve_collinearity_epsilon) << 1) + switch((static_cast<int>(d2 > curve_collinearity_epsilon) << 1) +
(int)(d3 > curve_collinearity_epsilon)) static_cast<int>(d3 > curve_collinearity_epsilon))
{ {
case 0: case 0:
// All collinear OR p1==p4 // All collinear OR p1==p4
@ -583,8 +566,8 @@ void VSpline::PointBezier_r ( qreal x1, qreal y1, qreal x2, qreal y2,
// Continue subdivision // Continue subdivision
//---------------------- //----------------------
PointBezier_r(x1, y1, x12, y12, x123, y123, x1234, y1234, level + 1, px, py); PointBezier_r(x1, y1, x12, y12, x123, y123, x1234, y1234, static_cast<qint16>(level + 1), px, py);
PointBezier_r(x1234, y1234, x234, y234, x34, y34, x4, y4, level + 1, px, py); PointBezier_r(x1234, y1234, x234, y234, x34, y34, x4, y4, static_cast<qint16>(level + 1), px, py);
} }
qreal VSpline::CalcSqDistance (qreal x1, qreal y1, qreal x2, qreal y2) const{ qreal VSpline::CalcSqDistance (qreal x1, qreal y1, qreal x2, qreal y2) const{
@ -662,7 +645,7 @@ qreal VSpline::calc_t (qreal curve_coord1, qreal curve_coord2, qreal curve_coord
qreal P1, P2, P3, P4, Bt; qreal P1, P2, P3, P4, Bt;
qreal a, b, c, d, ret_t; qreal a, b, c, d, ret_t;
qreal *t = (qreal *)malloc(3*sizeof(qreal)); qreal *t = static_cast<qreal *>(malloc(3*sizeof(qreal)));
P1 = curve_coord1; P1 = curve_coord1;
P2 = curve_coord2; P2 = curve_coord2;
P3 = curve_coord3; P3 = curve_coord3;

View File

@ -1,13 +1,14 @@
#include "vsplinepath.h" #include "vsplinepath.h"
VSplinePath::VSplinePath(){ VSplinePath::VSplinePath(): path(QVector<VSplinePoint>()), kCurve(1), points(0){
points = 0;
kCurve = 1;
} }
VSplinePath::VSplinePath(const QMap<qint64, VPointF> *points, qreal kCurve){ VSplinePath::VSplinePath(const QMap<qint64, VPointF> *points, qreal kCurve): path(QVector<VSplinePoint>()),
this->points = points; kCurve(kCurve), points(points){
this->kCurve = kCurve; }
VSplinePath::VSplinePath(const VSplinePath &splPath): path(*splPath.GetPoint()),
kCurve(splPath.getKCurve()), points( splPath.GetDataPoints()){
} }
void VSplinePath::append(VSplinePoint point){ void VSplinePath::append(VSplinePoint point){

View File

@ -28,6 +28,7 @@ public:
* @brief VSplinePath конструктор по замовчуванню. * @brief VSplinePath конструктор по замовчуванню.
*/ */
VSplinePath(const QMap<qint64, VPointF> *points, qreal kCurve = 1); VSplinePath(const QMap<qint64, VPointF> *points, qreal kCurve = 1);
VSplinePath(const VSplinePath& splPath);
/** /**
* @brief append додає точку сплайну до шляху. * @brief append додає точку сплайну до шляху.
* @param point точка. * @param point точка.

View File

@ -1,24 +1,14 @@
#include "vsplinepoint.h" #include "vsplinepoint.h"
VSplinePoint::VSplinePoint(){ VSplinePoint::VSplinePoint():pSpline(0), angle(0), kAsm1(1), kAsm2(1){
this->pSpline = 0;
this->angle = 0;
this->kAsm1 = 1;
this->kAsm2 = 1;
} }
VSplinePoint::VSplinePoint(qint64 pSpline, qreal kAsm1, qreal angle , qreal kAsm2){ VSplinePoint::VSplinePoint(qint64 pSpline, qreal kAsm1, qreal angle , qreal kAsm2):pSpline(pSpline),
this->pSpline = pSpline; angle(angle), kAsm1(kAsm1), kAsm2(kAsm2){
this->angle = angle;
this->kAsm1 = kAsm1;
this->kAsm2 = kAsm2;
} }
VSplinePoint::VSplinePoint(const VSplinePoint &point){ VSplinePoint::VSplinePoint(const VSplinePoint &point):pSpline(point.P()), angle(point.Angle2()),
this->pSpline = point.P(); kAsm1(point.KAsm1()), kAsm2(point.KAsm2()){
this->angle = point.Angle2();
this->kAsm1 = point.KAsm1();
this->kAsm2 = point.KAsm2();
} }
VSplinePoint::~VSplinePoint(){ VSplinePoint::~VSplinePoint(){

View File

@ -1,8 +1,9 @@
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Weffc++" #pragma GCC diagnostic ignored "-Weffc++"
#include "mainwindow.h" #include "mainwindow.h"
#include <QApplication> #include <QApplication>
#include <QTextCodec> #include <QTextCodec>
#pragma GCC diagnostic warning "-Weffc++" #pragma GCC diagnostic pop
void myMessageOutput(QtMsgType type, const QMessageLogContext &context, const QString &msg){ void myMessageOutput(QtMsgType type, const QMessageLogContext &context, const QString &msg){
QByteArray localMsg = msg.toLocal8Bit(); QByteArray localMsg = msg.toLocal8Bit();

View File

@ -1,4 +1,8 @@
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Weffc++" #pragma GCC diagnostic ignored "-Weffc++"
#pragma GCC diagnostic ignored "-Wconversion"
#pragma GCC diagnostic ignored "-Wsign-conversion"
#pragma GCC diagnostic ignored "-Wctor-dtor-privacy"
#include "mainwindow.h" #include "mainwindow.h"
#include "ui_mainwindow.h" #include "ui_mainwindow.h"
#include <QLabel> #include <QLabel>
@ -9,7 +13,6 @@
#include <QInputDialog> #include <QInputDialog>
#include <QFileDialog> #include <QFileDialog>
#include <QDebug> #include <QDebug>
#include "tools/vtoolendline.h" #include "tools/vtoolendline.h"
#include "tools/vtoolline.h" #include "tools/vtoolline.h"
#include "tools/vtoolalongline.h" #include "tools/vtoolalongline.h"
@ -20,15 +23,21 @@
#include "tools/vtoolspline.h" #include "tools/vtoolspline.h"
#include "tools/vtoolarc.h" #include "tools/vtoolarc.h"
#include "tools/vtoolsplinepath.h" #include "tools/vtoolsplinepath.h"
#pragma GCC diagnostic warning "-Weffc++" #pragma GCC diagnostic pop
#include "geometry/vspline.h" #include "geometry/vspline.h"
MainWindow::MainWindow(QWidget *parent) : MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent), ui(new Ui::MainWindow) QMainWindow(parent), ui(new Ui::MainWindow), tool(Tools::ArrowTool), scene(0), mouseCoordinate(0),
{ helpLabel(0), view(0), isInitialized(false), dialogTable(0),
dialogEndLine(QSharedPointer<DialogEndLine>()), dialogLine(QSharedPointer<DialogLine>()),
dialogAlongLine(QSharedPointer<DialogAlongLine>()),
dialogShoulderPoint(QSharedPointer<DialogShoulderPoint>()), dialogNormal(QSharedPointer<DialogNormal>()),
dialogBisector(QSharedPointer<DialogBisector>()),
dialogLineIntersect(QSharedPointer<DialogLineIntersect>()),
dialogSpline(QSharedPointer<DialogSpline>()),
dialogArc(QSharedPointer<DialogArc>()), dialogSplinePath(QSharedPointer<DialogSplinePath>()),
dialogHistory(0), doc(0), data(0), comboBoxDraws(0), fileName(QString()), changeInFile(false){
ui->setupUi(this); ui->setupUi(this);
tool = Tools::ArrowTool;
isInitialized = false;
ToolBarOption(); ToolBarOption();
ToolBarDraws(); ToolBarDraws();
QRectF sceneRect = QRectF(0, 0, PaperSize, PaperSize); QRectF sceneRect = QRectF(0, 0, PaperSize, PaperSize);

View File

@ -1,7 +1,12 @@
#ifndef MAINWINDOW_H #ifndef MAINWINDOW_H
#define MAINWINDOW_H #define MAINWINDOW_H
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Weffc++" #pragma GCC diagnostic ignored "-Weffc++"
#pragma GCC diagnostic ignored "-Wold-style-cast"
#pragma GCC diagnostic ignored "-Wconversion"
#pragma GCC diagnostic ignored "-Wsign-conversion"
#pragma GCC diagnostic ignored "-Wctor-dtor-privacy"
#include <QMainWindow> #include <QMainWindow>
#include <QLabel> #include <QLabel>
#include <QtXml> #include <QtXml>
@ -9,7 +14,6 @@
#include <QSharedPointer> #include <QSharedPointer>
#include <QToolButton> #include <QToolButton>
#include <QSharedPointer> #include <QSharedPointer>
#include "widgets/vmaingraphicsscene.h" #include "widgets/vmaingraphicsscene.h"
#include "widgets/vmaingraphicsview.h" #include "widgets/vmaingraphicsview.h"
#include "dialogs/dialogincrements.h" #include "dialogs/dialogincrements.h"
@ -26,7 +30,7 @@
#include "dialogs/dialoghistory.h" #include "dialogs/dialoghistory.h"
#include "tools/vtoolsinglepoint.h" #include "tools/vtoolsinglepoint.h"
#include "xml/vdomdocument.h" #include "xml/vdomdocument.h"
#pragma GCC diagnostic warning "-Weffc++" #pragma GCC diagnostic pop
#include "container/vcontainer.h" #include "container/vcontainer.h"
#include "options.h" #include "options.h"
@ -107,6 +111,8 @@ private:
QComboBox *comboBoxDraws; QComboBox *comboBoxDraws;
QString fileName; QString fileName;
bool changeInFile; bool changeInFile;
MainWindow(const MainWindow &window);
const MainWindow &operator=(const MainWindow &window);
void ToolBarOption(); void ToolBarOption();
void ToolBarDraws(); void ToolBarDraws();
void CanselTool(); void CanselTool();

View File

@ -1,10 +1,15 @@
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Weffc++" #pragma GCC diagnostic ignored "-Weffc++"
#pragma GCC diagnostic ignored "-Wconversion"
#pragma GCC diagnostic ignored "-Wsign-conversion"
#pragma GCC diagnostic ignored "-Wctor-dtor-privacy"
#include "vabstracttool.h" #include "vabstracttool.h"
#include <QDebug> #include <QDebug>
#pragma GCC diagnostic pop #pragma GCC diagnostic pop
VAbstractTool::VAbstractTool(VDomDocument *doc, VContainer *data, qint64 id, QObject *parent): VAbstractTool::VAbstractTool(VDomDocument *doc, VContainer *data, qint64 id, QObject *parent):
VDataTool(data, parent), baseColor(Qt::black), currentColor(Qt::black){ VDataTool(data, parent), doc(doc), id(id), ignoreContextMenuEvent(false), nameActivDraw(QString()),
baseColor(Qt::black), currentColor(Qt::black){
this->doc = doc; this->doc = doc;
this->id = id; this->id = id;
nameActivDraw = doc->GetNameActivDraw(); nameActivDraw = doc->GetNameActivDraw();
@ -95,6 +100,9 @@ void VAbstractTool::setData(const VContainer &value){
data = value; data = value;
} }
void VAbstractTool::RemoveDataTool(){
}
void VAbstractTool::setDialog(){ void VAbstractTool::setDialog(){
} }

View File

@ -1,11 +1,15 @@
#ifndef VABSTRACTTOOL_H #ifndef VABSTRACTTOOL_H
#define VABSTRACTTOOL_H #define VABSTRACTTOOL_H
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Weffc++" #pragma GCC diagnostic ignored "-Weffc++"
#pragma GCC diagnostic ignored "-Wconversion"
#pragma GCC diagnostic ignored "-Wsign-conversion"
#pragma GCC diagnostic ignored "-Wctor-dtor-privacy"
#include <QMenu> #include <QMenu>
#include "../xml/vdomdocument.h" #include "../xml/vdomdocument.h"
#include "vdatatool.h" #include "vdatatool.h"
#pragma GCC diagnostic warning "-Weffc++" #pragma GCC diagnostic pop
#include "../container/vcontainer.h" #include "../container/vcontainer.h"
namespace Tool{ namespace Tool{
@ -34,6 +38,7 @@ signals:
void toolhaveChange(); void toolhaveChange();
void ChoosedTool(qint64 id, Scene::Type type); void ChoosedTool(qint64 id, Scene::Type type);
void FullUpdateTree(); void FullUpdateTree();
void RemoveTool(QGraphicsItem *tool);
protected: protected:
VDomDocument *doc; VDomDocument *doc;
qint64 id; qint64 id;
@ -49,11 +54,17 @@ protected:
void AddToCalculation(const QDomElement &domElement); void AddToCalculation(const QDomElement &domElement);
const VContainer *getData() const; const VContainer *getData() const;
void setData(const VContainer &value); void setData(const VContainer &value);
virtual void RemoveDataTool();
template <typename Dialog, typename Tool> template <typename Dialog, typename Tool>
void ContextMenu(QSharedPointer<Dialog> &dialog, Tool *tool, QGraphicsSceneContextMenuEvent *event){ void ContextMenu(QSharedPointer<Dialog> &dialog, Tool *tool, QGraphicsSceneContextMenuEvent *event,
bool showRemove = true){
if(!ignoreContextMenuEvent){ if(!ignoreContextMenuEvent){
QMenu menu; QMenu menu;
QAction *actionOption = menu.addAction("Властивості"); QAction *actionOption = menu.addAction("Властивості");
QAction *actionRemove;
if(showRemove){
actionRemove = menu.addAction("Видалити");
}
QAction *selectedAction = menu.exec(event->screenPos()); QAction *selectedAction = menu.exec(event->screenPos());
if(selectedAction == actionOption){ if(selectedAction == actionOption){
dialog = QSharedPointer<Dialog>(new Dialog(getData())); dialog = QSharedPointer<Dialog>(new Dialog(getData()));
@ -68,7 +79,26 @@ protected:
dialog->show(); dialog->show();
} }
if(selectedAction == actionRemove){
RemoveDataTool();//remove form data
//remove form xml file
QDomElement domElement = doc->elementById(QString().setNum(id));
if(domElement.isElement()){
QDomElement calcElement;
bool ok = doc->GetActivCalculationElement(calcElement);
if(ok){
calcElement.removeChild(domElement);
//update xml file
emit FullUpdateTree();
//remove form scene
emit RemoveTool(tool);
} }
} }
}
}
}
private:
VAbstractTool(const VAbstractTool &tool);
const VAbstractTool &operator=(const VAbstractTool &tool);
}; };
#endif // VABSTRACTTOOL_H #endif // VABSTRACTTOOL_H

View File

@ -1,10 +1,10 @@
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Weffc++" #pragma GCC diagnostic ignored "-Weffc++"
#include "vdatatool.h" #include "vdatatool.h"
#pragma GCC diagnostic warning "-Weffc++" #pragma GCC diagnostic pop
VDataTool::VDataTool(VContainer *data, QObject *parent) : VDataTool::VDataTool(VContainer *data, QObject *parent) :
QObject(parent){ QObject(parent), data(*data){
this->data = *data;
} }
VDataTool::~VDataTool(){ VDataTool::~VDataTool(){
@ -12,6 +12,7 @@ VDataTool::~VDataTool(){
const VDataTool &VDataTool::operator =(const VDataTool &tool){ const VDataTool &VDataTool::operator =(const VDataTool &tool){
data = tool.getData(); data = tool.getData();
return *this;
} }
VContainer VDataTool::getData() const{ VContainer VDataTool::getData() const{

View File

@ -1,9 +1,10 @@
#ifndef VDATATOOL_H #ifndef VDATATOOL_H
#define VDATATOOL_H #define VDATATOOL_H
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Weffc++" #pragma GCC diagnostic ignored "-Weffc++"
#include <QObject> #include <QObject>
#pragma GCC diagnostic warning "-Weffc++" #pragma GCC diagnostic pop
#include "../container/vcontainer.h" #include "../container/vcontainer.h"
class VDataTool : public QObject class VDataTool : public QObject

View File

@ -1,15 +1,18 @@
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Weffc++"
#include "vtoolalongline.h" #include "vtoolalongline.h"
#include "../container/calculator.h"
#include <QDialog> #include <QDialog>
#include <QMenu> #include <QMenu>
#include <QDebug> #include <QDebug>
#pragma GCC diagnostic pop
#include "../container/calculator.h"
VToolAlongLine::VToolAlongLine(VDomDocument *doc, VContainer *data, qint64 id, const QString &formula, VToolAlongLine::VToolAlongLine(VDomDocument *doc, VContainer *data, qint64 id, const QString &formula,
const qint64 &firstPointId, const qint64 &secondPointId, const qint64 &firstPointId, const qint64 &secondPointId,
const QString &typeLine, Tool::Enum typeCreation, const QString &typeLine, Tool::Enum typeCreation,
QGraphicsItem *parent): QGraphicsItem *parent):
VToolLinePoint(doc, data, id, typeLine, formula, firstPointId, 0, parent){ VToolLinePoint(doc, data, id, typeLine, formula, firstPointId, 0, parent), secondPointId(secondPointId),
this->secondPointId = secondPointId; dialogAlongLine(QSharedPointer<DialogAlongLine>()){
if(typeCreation == Tool::FromGui){ if(typeCreation == Tool::FromGui){
AddToFile(); AddToFile();
@ -120,6 +123,7 @@ void VToolAlongLine::Create(const qint64 _id, const QString &pointName, const QS
secondPointId, typeLine, typeCreation); secondPointId, typeLine, typeCreation);
scene->addItem(point); scene->addItem(point);
connect(point, &VToolAlongLine::ChoosedTool, scene, &VMainGraphicsScene::ChoosedItem); connect(point, &VToolAlongLine::ChoosedTool, scene, &VMainGraphicsScene::ChoosedItem);
connect(point, &VToolAlongLine::RemoveTool, scene, &VMainGraphicsScene::RemoveTool);
QMap<qint64, VDataTool*>* tools = doc->getTools(); QMap<qint64, VDataTool*>* tools = doc->getTools();
tools->insert(id,point); tools->insert(id,point);

View File

@ -1,8 +1,11 @@
#ifndef VTOOLALONGLINE_H #ifndef VTOOLALONGLINE_H
#define VTOOLALONGLINE_H #define VTOOLALONGLINE_H
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Weffc++"
#include "vtoollinepoint.h" #include "vtoollinepoint.h"
#include "../dialogs/dialogalongline.h" #include "../dialogs/dialogalongline.h"
#pragma GCC diagnostic pop
class VToolAlongLine : public VToolLinePoint class VToolAlongLine : public VToolLinePoint
{ {

View File

@ -1,9 +1,16 @@
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Weffc++"
#pragma GCC diagnostic ignored "-Wconversion"
#pragma GCC diagnostic ignored "-Wsign-conversion"
#pragma GCC diagnostic ignored "-Wctor-dtor-privacy"
#include "vtoolarc.h" #include "vtoolarc.h"
#include <QMenu> #include <QMenu>
#pragma GCC diagnostic pop
#include "../container/calculator.h" #include "../container/calculator.h"
VToolArc::VToolArc(VDomDocument *doc, VContainer *data, qint64 id, Tool::Enum typeCreation, VToolArc::VToolArc(VDomDocument *doc, VContainer *data, qint64 id, Tool::Enum typeCreation,
QGraphicsItem *parent):VAbstractTool(doc, data, id), QGraphicsPathItem(parent){ QGraphicsItem *parent):VAbstractTool(doc, data, id), QGraphicsPathItem(parent),
dialogArc(QSharedPointer<DialogArc>()){
VArc arc = data->GetArc(id); VArc arc = data->GetArc(id);
QPainterPath path; QPainterPath path;
path.addPath(arc.GetPath()); path.addPath(arc.GetPath());
@ -81,6 +88,7 @@ void VToolArc::Create(const qint64 _id, const qint64 &center, const QString &rad
VToolArc *toolArc = new VToolArc(doc, data, id, typeCreation); VToolArc *toolArc = new VToolArc(doc, data, id, typeCreation);
scene->addItem(toolArc); scene->addItem(toolArc);
connect(toolArc, &VToolArc::ChoosedTool, scene, &VMainGraphicsScene::ChoosedItem); connect(toolArc, &VToolArc::ChoosedTool, scene, &VMainGraphicsScene::ChoosedItem);
connect(toolArc, &VToolArc::RemoveTool, scene, &VMainGraphicsScene::RemoveTool);
QMap<qint64, VDataTool*>* tools = doc->getTools(); QMap<qint64, VDataTool*>* tools = doc->getTools();
tools->insert(id,toolArc); tools->insert(id,toolArc);
} }

View File

@ -1,12 +1,18 @@
#ifndef VTOOLARC_H #ifndef VTOOLARC_H
#define VTOOLARC_H #define VTOOLARC_H
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Weffc++"
#pragma GCC diagnostic ignored "-Wconversion"
#pragma GCC diagnostic ignored "-Wsign-conversion"
#pragma GCC diagnostic ignored "-Wctor-dtor-privacy"
#include "vabstracttool.h" #include "vabstracttool.h"
#include "../container/vcontainer.h"
#include "../xml/vdomdocument.h" #include "../xml/vdomdocument.h"
#include <QGraphicsPathItem> #include <QGraphicsPathItem>
#include "../dialogs/dialogarc.h" #include "../dialogs/dialogarc.h"
#include "../widgets/vcontrolpointspline.h" #include "../widgets/vcontrolpointspline.h"
#pragma GCC diagnostic pop
#include "../container/vcontainer.h"
class VToolArc :public VAbstractTool, public QGraphicsPathItem class VToolArc :public VAbstractTool, public QGraphicsPathItem
{ {

View File

@ -6,7 +6,8 @@
VToolBisector::VToolBisector(VDomDocument *doc, VContainer *data, const qint64 &id, const QString &typeLine, VToolBisector::VToolBisector(VDomDocument *doc, VContainer *data, const qint64 &id, const QString &typeLine,
const QString &formula, const qint64 &firstPointId, const qint64 &secondPointId, const QString &formula, const qint64 &firstPointId, const qint64 &secondPointId,
const qint64 &thirdPointId, Tool::Enum typeCreation, QGraphicsItem *parent): const qint64 &thirdPointId, Tool::Enum typeCreation, QGraphicsItem *parent):
VToolLinePoint(doc, data, id, typeLine, formula, secondPointId, 0, parent){ VToolLinePoint(doc, data, id, typeLine, formula, secondPointId, 0, parent), firstPointId(0),
thirdPointId(0), dialogBisector(QSharedPointer<DialogBisector>()){
this->firstPointId = firstPointId; this->firstPointId = firstPointId;
this->thirdPointId = thirdPointId; this->thirdPointId = thirdPointId;
@ -88,6 +89,7 @@ void VToolBisector::Create(const qint64 _id, const QString &formula, const qint6
typeCreation); typeCreation);
scene->addItem(point); scene->addItem(point);
connect(point, &VToolBisector::ChoosedTool, scene, &VMainGraphicsScene::ChoosedItem); connect(point, &VToolBisector::ChoosedTool, scene, &VMainGraphicsScene::ChoosedItem);
connect(point, &VToolBisector::RemoveTool, scene, &VMainGraphicsScene::RemoveTool);
QMap<qint64, VDataTool*>* tools = doc->getTools(); QMap<qint64, VDataTool*>* tools = doc->getTools();
tools->insert(id,point); tools->insert(id,point);
} }

View File

@ -1,13 +1,16 @@
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Weffc++"
#include "vtoolendline.h" #include "vtoolendline.h"
#include <QDebug> #include <QDebug>
#include <QMenu> #include <QMenu>
#include "../widgets/vmaingraphicsscene.h" #include "../widgets/vmaingraphicsscene.h"
#pragma GCC diagnostic pop
VToolEndLine::VToolEndLine(VDomDocument *doc, VContainer *data, const qint64 &id, const QString &typeLine, VToolEndLine::VToolEndLine(VDomDocument *doc, VContainer *data, const qint64 &id, const QString &typeLine,
const QString &formula, const qint32 &angle, const qint64 &basePointId, const QString &formula, const qint32 &angle, const qint64 &basePointId,
Tool::Enum typeCreation, QGraphicsItem *parent): Tool::Enum typeCreation, QGraphicsItem *parent):
VToolLinePoint(doc, data, id, typeLine, formula, basePointId, angle, parent){ VToolLinePoint(doc, data, id, typeLine, formula, basePointId, angle, parent),
dialogEndLine(QSharedPointer<DialogEndLine>()){
if(typeCreation == Tool::FromGui){ if(typeCreation == Tool::FromGui){
AddToFile(); AddToFile();
@ -69,6 +72,7 @@ void VToolEndLine::Create(const qint64 _id, const QString &pointName, const QStr
basePointId, typeCreation); basePointId, typeCreation);
scene->addItem(point); scene->addItem(point);
connect(point, &VToolPoint::ChoosedTool, scene, &VMainGraphicsScene::ChoosedItem); connect(point, &VToolPoint::ChoosedTool, scene, &VMainGraphicsScene::ChoosedItem);
connect(point, &VToolPoint::RemoveTool, scene, &VMainGraphicsScene::RemoveTool);
QMap<qint64, VDataTool*>* tools = doc->getTools(); QMap<qint64, VDataTool*>* tools = doc->getTools();
tools->insert(id,point); tools->insert(id,point);
} }

View File

@ -1,10 +1,12 @@
#ifndef VTOOLENDLINE_H #ifndef VTOOLENDLINE_H
#define VTOOLENDLINE_H #define VTOOLENDLINE_H
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Weffc++"
#include <QSharedPointer> #include <QSharedPointer>
#include "vtoollinepoint.h" #include "vtoollinepoint.h"
#include "../dialogs/dialogendline.h" #include "../dialogs/dialogendline.h"
#pragma GCC diagnostic pop
class VToolEndLine : public VToolLinePoint class VToolEndLine : public VToolLinePoint
{ {

View File

@ -1,13 +1,17 @@
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Weffc++"
#pragma GCC diagnostic ignored "-Wconversion"
#pragma GCC diagnostic ignored "-Wsign-conversion"
#pragma GCC diagnostic ignored "-Wctor-dtor-privacy"
#include "vtoolline.h" #include "vtoolline.h"
#include <QMenu> #include <QMenu>
#include <QDebug> #include <QDebug>
#pragma GCC diagnostic pop
VToolLine::VToolLine(VDomDocument *doc, VContainer *data, qint64 id, qint64 firstPoint, qint64 secondPoint, VToolLine::VToolLine(VDomDocument *doc, VContainer *data, qint64 id, qint64 firstPoint, qint64 secondPoint,
Tool::Enum typeCreation, QGraphicsItem *parent):VAbstractTool(doc, data, id), Tool::Enum typeCreation, QGraphicsItem *parent):VAbstractTool(doc, data, id),
QGraphicsLineItem(parent){ QGraphicsLineItem(parent), firstPoint(firstPoint), secondPoint(secondPoint),
this->firstPoint = firstPoint; dialogLine(QSharedPointer<DialogLine>()){
this->secondPoint = secondPoint;
//Лінія //Лінія
VPointF first = data->GetPoint(firstPoint); VPointF first = data->GetPoint(firstPoint);
VPointF second = data->GetPoint(secondPoint); VPointF second = data->GetPoint(secondPoint);
@ -49,6 +53,7 @@ void VToolLine::Create(const qint64 &id, const qint64 &firstPoint, const qint64
VToolLine *line = new VToolLine(doc, data, id, firstPoint, secondPoint, typeCreation); VToolLine *line = new VToolLine(doc, data, id, firstPoint, secondPoint, typeCreation);
scene->addItem(line); scene->addItem(line);
connect(line, &VToolLine::ChoosedTool, scene, &VMainGraphicsScene::ChoosedItem); connect(line, &VToolLine::ChoosedTool, scene, &VMainGraphicsScene::ChoosedItem);
connect(line, &VToolLine::RemoveTool, scene, &VMainGraphicsScene::RemoveTool);
QMap<qint64, VDataTool*>* tools = doc->getTools(); QMap<qint64, VDataTool*>* tools = doc->getTools();
tools->insert(id,line); tools->insert(id,line);
} }

View File

@ -1,9 +1,15 @@
#ifndef VTOOLLINE_H #ifndef VTOOLLINE_H
#define VTOOLLINE_H #define VTOOLLINE_H
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Weffc++"
#pragma GCC diagnostic ignored "-Wconversion"
#pragma GCC diagnostic ignored "-Wsign-conversion"
#pragma GCC diagnostic ignored "-Wctor-dtor-privacy"
#include "vabstracttool.h" #include "vabstracttool.h"
#include "QGraphicsLineItem" #include "QGraphicsLineItem"
#include "../dialogs/dialogline.h" #include "../dialogs/dialogline.h"
#pragma GCC diagnostic pop
class VToolLine: public VAbstractTool, public QGraphicsLineItem class VToolLine: public VAbstractTool, public QGraphicsLineItem
{ {

View File

@ -1,14 +1,17 @@
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Weffc++"
#pragma GCC diagnostic ignored "-Wconversion"
#pragma GCC diagnostic ignored "-Wsign-conversion"
#pragma GCC diagnostic ignored "-Wctor-dtor-privacy"
#include "vtoollineintersect.h" #include "vtoollineintersect.h"
#include <QMenu> #include <QMenu>
#pragma GCC diagnostic pop
VToolLineIntersect::VToolLineIntersect(VDomDocument *doc, VContainer *data, const qint64 &id, VToolLineIntersect::VToolLineIntersect(VDomDocument *doc, VContainer *data, const qint64 &id,
const qint64 &p1Line1, const qint64 &p2Line1, const qint64 &p1Line2, const qint64 &p1Line1, const qint64 &p2Line1, const qint64 &p1Line2,
const qint64 &p2Line2, Tool::Enum typeCreation, QGraphicsItem *parent): const qint64 &p2Line2, Tool::Enum typeCreation, QGraphicsItem *parent):
VToolPoint(doc, data, id, parent){ VToolPoint(doc, data, id, parent), p1Line1(p1Line1), p2Line1(p2Line1), p1Line2(p1Line2), p2Line2(p2Line2),
this->p1Line1 = p1Line1; dialogLineIntersect(QSharedPointer<DialogLineIntersect>()){
this->p2Line1 = p2Line1;
this->p1Line2 = p1Line2;
this->p2Line2 = p2Line2;
if(typeCreation == Tool::FromGui){ if(typeCreation == Tool::FromGui){
AddToFile(); AddToFile();
} }
@ -73,8 +76,8 @@ void VToolLineIntersect::Create(const qint64 _id, const qint64 &p1Line1Id, const
p2Line1Id, p1Line2Id, p2Line1Id, p1Line2Id,
p2Line2Id, typeCreation); p2Line2Id, typeCreation);
scene->addItem(point); scene->addItem(point);
connect(point, &VToolLineIntersect::ChoosedTool, scene, connect(point, &VToolLineIntersect::ChoosedTool, scene, &VMainGraphicsScene::ChoosedItem);
&VMainGraphicsScene::ChoosedItem); connect(point, &VToolLineIntersect::RemoveTool, scene, &VMainGraphicsScene::RemoveTool);
QMap<qint64, VDataTool*>* tools = doc->getTools(); QMap<qint64, VDataTool*>* tools = doc->getTools();
tools->insert(id,point); tools->insert(id,point);
} }

View File

@ -1,8 +1,14 @@
#ifndef VTOOLLINEINTERSECT_H #ifndef VTOOLLINEINTERSECT_H
#define VTOOLLINEINTERSECT_H #define VTOOLLINEINTERSECT_H
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Weffc++"
#pragma GCC diagnostic ignored "-Wconversion"
#pragma GCC diagnostic ignored "-Wsign-conversion"
#pragma GCC diagnostic ignored "-Wctor-dtor-privacy"
#include "vtoolpoint.h" #include "vtoolpoint.h"
#include "../dialogs/dialoglineintersect.h" #include "../dialogs/dialoglineintersect.h"
#pragma GCC diagnostic pop
class VToolLineIntersect:public VToolPoint class VToolLineIntersect:public VToolPoint
{ {

View File

@ -1,4 +1,10 @@
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Weffc++"
#pragma GCC diagnostic ignored "-Wconversion"
#pragma GCC diagnostic ignored "-Wsign-conversion"
#pragma GCC diagnostic ignored "-Wctor-dtor-privacy"
#include "vtoollinepoint.h" #include "vtoollinepoint.h"
#pragma GCC diagnostic pop
VToolLinePoint::VToolLinePoint(VDomDocument *doc, VContainer *data, const qint64 &id, const QString &typeLine, VToolLinePoint::VToolLinePoint(VDomDocument *doc, VContainer *data, const qint64 &id, const QString &typeLine,
const QString &formula, const qint64 &basePointId, const qint32 &angle, const QString &formula, const qint64 &basePointId, const qint32 &angle,

View File

@ -1,9 +1,10 @@
#ifndef VTOOLLINEPOINT_H #ifndef VTOOLLINEPOINT_H
#define VTOOLLINEPOINT_H #define VTOOLLINEPOINT_H
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Weffc++" #pragma GCC diagnostic ignored "-Weffc++"
#include "vtoolpoint.h" #include "vtoolpoint.h"
#pragma GCC diagnostic warning "-Weffc++" #pragma GCC diagnostic pop
class VToolLinePoint : public VToolPoint class VToolLinePoint : public VToolPoint
{ {
@ -20,6 +21,9 @@ protected:
qint32 angle; qint32 angle;
qint64 basePointId; qint64 basePointId;
QGraphicsLineItem *mainLine; QGraphicsLineItem *mainLine;
private:
VToolLinePoint(const VToolLinePoint &tool);
const VToolLinePoint &operator=(const VToolLinePoint &tool);
}; };
#endif // VTOOLLINEPOINT_H #endif // VTOOLLINEPOINT_H

View File

@ -1,11 +1,17 @@
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Weffc++"
#pragma GCC diagnostic ignored "-Wconversion"
#pragma GCC diagnostic ignored "-Wsign-conversion"
#pragma GCC diagnostic ignored "-Wctor-dtor-privacy"
#include "vtoolnormal.h" #include "vtoolnormal.h"
#include <QMenu> #include <QMenu>
#pragma GCC diagnostic pop
VToolNormal::VToolNormal(VDomDocument *doc, VContainer *data, const qint64 &id, const QString &typeLine, VToolNormal::VToolNormal(VDomDocument *doc, VContainer *data, const qint64 &id, const QString &typeLine,
const QString &formula, const qint32 &angle, const qint64 &firstPointId, const QString &formula, const qreal &angle, const qint64 &firstPointId,
const qint64 &secondPointId, Tool::Enum typeCreation, QGraphicsItem *parent): const qint64 &secondPointId, Tool::Enum typeCreation, QGraphicsItem *parent):
VToolLinePoint(doc, data, id, typeLine, formula, firstPointId, angle, parent){ VToolLinePoint(doc, data, id, typeLine, formula, firstPointId, angle, parent),
this->secondPointId = secondPointId; secondPointId(secondPointId), dialogNormal(QSharedPointer<DialogNormal>()){
if(typeCreation == Tool::FromGui){ if(typeCreation == Tool::FromGui){
AddToFile(); AddToFile();
@ -40,7 +46,7 @@ void VToolNormal::Create(QSharedPointer<DialogNormal> &dialog, VMainGraphicsScen
void VToolNormal::Create(const qint64 _id, const QString &formula, const qint64 &firstPointId, void VToolNormal::Create(const qint64 _id, const QString &formula, const qint64 &firstPointId,
const qint64 &secondPointId, const QString typeLine, const QString pointName, const qint64 &secondPointId, const QString typeLine, const QString pointName,
const qint32 angle, const qreal &mx, const qreal &my, VMainGraphicsScene *scene, const qreal angle, const qreal &mx, const qreal &my, VMainGraphicsScene *scene,
VDomDocument *doc, VContainer *data, Document::Enum parse, Tool::Enum typeCreation){ VDomDocument *doc, VContainer *data, Document::Enum parse, Tool::Enum typeCreation){
VPointF firstPoint = data->GetPoint(firstPointId); VPointF firstPoint = data->GetPoint(firstPointId);
VPointF secondPoint = data->GetPoint(secondPointId); VPointF secondPoint = data->GetPoint(secondPointId);
@ -69,6 +75,7 @@ void VToolNormal::Create(const qint64 _id, const QString &formula, const qint64
firstPointId, secondPointId, typeCreation); firstPointId, secondPointId, typeCreation);
scene->addItem(point); scene->addItem(point);
connect(point, &VToolNormal::ChoosedTool, scene, &VMainGraphicsScene::ChoosedItem); connect(point, &VToolNormal::ChoosedTool, scene, &VMainGraphicsScene::ChoosedItem);
connect(point, &VToolNormal::RemoveTool, scene, &VMainGraphicsScene::RemoveTool);
QMap<qint64, VDataTool*>* tools = doc->getTools(); QMap<qint64, VDataTool*>* tools = doc->getTools();
tools->insert(id,point); tools->insert(id,point);
} }
@ -76,7 +83,7 @@ void VToolNormal::Create(const qint64 _id, const QString &formula, const qint64
} }
QPointF VToolNormal::FindPoint(const QPointF &firstPoint, const QPointF &secondPoint, const qreal &length, QPointF VToolNormal::FindPoint(const QPointF &firstPoint, const QPointF &secondPoint, const qreal &length,
const qint32 &angle){ const qreal &angle){
QLineF line(firstPoint, secondPoint); QLineF line(firstPoint, secondPoint);
QLineF normal = line.normalVector(); QLineF normal = line.normalVector();
normal.setAngle(normal.angle()+angle); normal.setAngle(normal.angle()+angle);

View File

@ -1,17 +1,22 @@
#ifndef VTOOLNORMAL_H #ifndef VTOOLNORMAL_H
#define VTOOLNORMAL_H #define VTOOLNORMAL_H
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Weffc++"
#pragma GCC diagnostic ignored "-Wconversion"
#pragma GCC diagnostic ignored "-Wsign-conversion"
#pragma GCC diagnostic ignored "-Wctor-dtor-privacy"
#include <QSharedPointer> #include <QSharedPointer>
#include "vtoollinepoint.h" #include "vtoollinepoint.h"
#include "../dialogs/dialognormal.h" #include "../dialogs/dialognormal.h"
#pragma GCC diagnostic pop
class VToolNormal : public VToolLinePoint class VToolNormal : public VToolLinePoint
{ {
public: public:
VToolNormal(VDomDocument *doc, VContainer *data, const qint64 &id, VToolNormal(VDomDocument *doc, VContainer *data, const qint64 &id,
const QString &typeLine, const QString &formula, const QString &typeLine, const QString &formula,
const qint32 &angle, const qint64 &firstPointId, const qreal &angle, const qint64 &firstPointId,
const qint64 &secondPointId, Tool::Enum typeCreation, const qint64 &secondPointId, Tool::Enum typeCreation,
QGraphicsItem * parent = 0); QGraphicsItem * parent = 0);
virtual void setDialog(); virtual void setDialog();
@ -19,10 +24,10 @@ public:
VContainer *data); VContainer *data);
static void Create(const qint64 _id, const QString &formula, const qint64 &firstPointId, static void Create(const qint64 _id, const QString &formula, const qint64 &firstPointId,
const qint64 &secondPointId, const QString typeLine, const QString pointName, const qint64 &secondPointId, const QString typeLine, const QString pointName,
const qint32 angle, const qreal &mx, const qreal &my, VMainGraphicsScene *scene, const qreal angle, const qreal &mx, const qreal &my, VMainGraphicsScene *scene,
VDomDocument *doc, VContainer *data, Document::Enum parse, Tool::Enum typeCreation); VDomDocument *doc, VContainer *data, Document::Enum parse, Tool::Enum typeCreation);
static QPointF FindPoint(const QPointF &firstPoint, const QPointF &secondPoint, static QPointF FindPoint(const QPointF &firstPoint, const QPointF &secondPoint,
const qreal &length, const qint32 &angle = 0); const qreal &length, const qreal &angle = 0);
public slots: public slots:
virtual void FullUpdateFromFile(); virtual void FullUpdateFromFile();
virtual void FullUpdateFromGui(int result); virtual void FullUpdateFromGui(int result);

View File

@ -1,16 +1,22 @@
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Weffc++"
#pragma GCC diagnostic ignored "-Wconversion"
#pragma GCC diagnostic ignored "-Wsign-conversion"
#pragma GCC diagnostic ignored "-Wctor-dtor-privacy"
#include "vtoolpoint.h" #include "vtoolpoint.h"
#include <QPen> #include <QPen>
#include <QBrush> #include <QBrush>
#include <QDebug> #include <QDebug>
#include <QGraphicsItem> #include <QGraphicsItem>
#include <cmath>
#include "../container/vpointf.h"
#include "../widgets/vmaingraphicsscene.h" #include "../widgets/vmaingraphicsscene.h"
#pragma GCC diagnostic pop
#include <cmath>
#include "../container/vpointf.h"
VToolPoint::VToolPoint(VDomDocument *doc, VContainer *data, qint64 id, VToolPoint::VToolPoint(VDomDocument *doc, VContainer *data, qint64 id,
QGraphicsItem *parent):VAbstractTool(doc, data, id), QGraphicsEllipseItem(parent){ QGraphicsItem *parent):VAbstractTool(doc, data, id), QGraphicsEllipseItem(parent),
radius = 1.5*PrintDPI/25.4; radius(1.5*PrintDPI/25.4), namePoint(0), lineName(0){
//create circle //create circle
VPointF point = data->GetPoint(id); VPointF point = data->GetPoint(id);
QRectF rec = QRectF(0, 0, radius*2, radius*2); QRectF rec = QRectF(0, 0, radius*2, radius*2);

View File

@ -1,12 +1,16 @@
#ifndef VTOOLPOINT_H #ifndef VTOOLPOINT_H
#define VTOOLPOINT_H #define VTOOLPOINT_H
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Weffc++" #pragma GCC diagnostic ignored "-Weffc++"
#pragma GCC diagnostic ignored "-Wconversion"
#pragma GCC diagnostic ignored "-Wsign-conversion"
#pragma GCC diagnostic ignored "-Wctor-dtor-privacy"
#include <QGraphicsLineItem> #include <QGraphicsLineItem>
#include <QGraphicsEllipseItem> #include <QGraphicsEllipseItem>
#include "../widgets/vgraphicssimpletextitem.h" #include "../widgets/vgraphicssimpletextitem.h"
#include "vabstracttool.h" #include "vabstracttool.h"
#pragma GCC diagnostic warning "-Weffc++" #pragma GCC diagnostic pop
#include "../options.h" #include "../options.h"
class VToolPoint: public VAbstractTool, public QGraphicsEllipseItem class VToolPoint: public VAbstractTool, public QGraphicsEllipseItem
@ -29,6 +33,8 @@ protected:
virtual void hoverMoveEvent ( QGraphicsSceneHoverEvent * event ); virtual void hoverMoveEvent ( QGraphicsSceneHoverEvent * event );
virtual void hoverLeaveEvent ( QGraphicsSceneHoverEvent * event ); virtual void hoverLeaveEvent ( QGraphicsSceneHoverEvent * event );
private: private:
VToolPoint(const VToolPoint &tool);
const VToolPoint &operator=(const VToolPoint &tool);
QPointF LineIntersectRect(QRectF rec, QLineF line) const; QPointF LineIntersectRect(QRectF rec, QLineF line) const;
void LiteUpdateFromGui(qreal mx, qreal my); void LiteUpdateFromGui(qreal mx, qreal my);
void RefreshLine(); void RefreshLine();
@ -36,6 +42,7 @@ private:
QPointF &p2) const; QPointF &p2) const;
QPointF ClosestPoint(QLineF line, QPointF p) const; QPointF ClosestPoint(QLineF line, QPointF p) const;
QPointF addVector (QPointF p, QPointF p1, QPointF p2, qreal k) const; QPointF addVector (QPointF p, QPointF p1, QPointF p2, qreal k) const;
}; };
#endif // VTOOLPOINT_H #endif // VTOOLPOINT_H

View File

@ -1,14 +1,19 @@
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Weffc++"
#pragma GCC diagnostic ignored "-Wconversion"
#pragma GCC diagnostic ignored "-Wsign-conversion"
#pragma GCC diagnostic ignored "-Wctor-dtor-privacy"
#include "vtoolshoulderpoint.h" #include "vtoolshoulderpoint.h"
#include <QDebug> #include <QDebug>
#include <QMenu> #include <QMenu>
#pragma GCC diagnostic pop
VToolShoulderPoint::VToolShoulderPoint(VDomDocument *doc, VContainer *data, const qint64 &id, VToolShoulderPoint::VToolShoulderPoint(VDomDocument *doc, VContainer *data, const qint64 &id,
const QString &typeLine, const QString &formula, const qint64 &p1Line, const QString &typeLine, const QString &formula, const qint64 &p1Line,
const qint64 &p2Line, const qint64 &pShoulder, Tool::Enum typeCreation, const qint64 &p2Line, const qint64 &pShoulder, Tool::Enum typeCreation,
QGraphicsItem * parent): QGraphicsItem * parent):
VToolLinePoint(doc, data, id, typeLine, formula, p1Line, 0, parent){ VToolLinePoint(doc, data, id, typeLine, formula, p1Line, 0, parent), p2Line(p2Line), pShoulder(pShoulder),
this->p2Line = p2Line; dialogShoulderPoint(QSharedPointer<DialogShoulderPoint>()){
this->pShoulder = pShoulder;
if(typeCreation == Tool::FromGui){ if(typeCreation == Tool::FromGui){
AddToFile(); AddToFile();
@ -97,8 +102,8 @@ void VToolShoulderPoint::Create(const qint64 _id, const QString &formula, const
p1Line, p2Line, pShoulder, p1Line, p2Line, pShoulder,
typeCreation); typeCreation);
scene->addItem(point); scene->addItem(point);
connect(point, &VToolShoulderPoint::ChoosedTool, scene, connect(point, &VToolShoulderPoint::ChoosedTool, scene, &VMainGraphicsScene::ChoosedItem);
&VMainGraphicsScene::ChoosedItem); connect(point, &VToolShoulderPoint::RemoveTool, scene, &VMainGraphicsScene::RemoveTool);
QMap<qint64, VDataTool*>* tools = doc->getTools(); QMap<qint64, VDataTool*>* tools = doc->getTools();
tools->insert(id,point); tools->insert(id,point);
} }

View File

@ -1,8 +1,14 @@
#ifndef VTOOLSHOULDERPOINT_H #ifndef VTOOLSHOULDERPOINT_H
#define VTOOLSHOULDERPOINT_H #define VTOOLSHOULDERPOINT_H
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Weffc++"
#pragma GCC diagnostic ignored "-Wconversion"
#pragma GCC diagnostic ignored "-Wsign-conversion"
#pragma GCC diagnostic ignored "-Wctor-dtor-privacy"
#include "vtoollinepoint.h" #include "vtoollinepoint.h"
#include "../dialogs/dialogshoulderpoint.h" #include "../dialogs/dialogshoulderpoint.h"
#pragma GCC diagnostic pop
class VToolShoulderPoint : public VToolLinePoint class VToolShoulderPoint : public VToolLinePoint
{ {

View File

@ -1,17 +1,23 @@
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Weffc++"
#pragma GCC diagnostic ignored "-Wconversion"
#pragma GCC diagnostic ignored "-Wsign-conversion"
#pragma GCC diagnostic ignored "-Wctor-dtor-privacy"
#include "vtoolsinglepoint.h" #include "vtoolsinglepoint.h"
#include <QPen> #include <QPen>
#include <QBrush> #include <QBrush>
#include <QDebug> #include <QDebug>
#include <QGraphicsItem> #include <QGraphicsItem>
#include <cmath>
#include <QMenu> #include <QMenu>
#include <QGraphicsSceneContextMenuEvent> #include <QGraphicsSceneContextMenuEvent>
#pragma GCC diagnostic pop
#include <cmath>
#include "../options.h" #include "../options.h"
#include "../container/vpointf.h" #include "../container/vpointf.h"
VToolSinglePoint::VToolSinglePoint (VDomDocument *doc, VContainer *data, qint64 id, Tool::Enum typeCreation, VToolSinglePoint::VToolSinglePoint (VDomDocument *doc, VContainer *data, qint64 id, Tool::Enum typeCreation,
QGraphicsItem * parent ):VToolPoint(doc, data, id, parent){ QGraphicsItem * parent ):VToolPoint(doc, data, id, parent),
dialogSinglePoint(QSharedPointer<DialogSinglePoint>()){
this->setFlag(QGraphicsItem::ItemIsMovable, true); this->setFlag(QGraphicsItem::ItemIsMovable, true);
this->setFlag(QGraphicsItem::ItemSendsGeometryChanges, true); this->setFlag(QGraphicsItem::ItemSendsGeometryChanges, true);
if(typeCreation == Tool::FromGui){ if(typeCreation == Tool::FromGui){
@ -69,7 +75,7 @@ QVariant VToolSinglePoint::itemChange(QGraphicsItem::GraphicsItemChange change,
} }
void VToolSinglePoint::contextMenuEvent ( QGraphicsSceneContextMenuEvent * event ){ void VToolSinglePoint::contextMenuEvent ( QGraphicsSceneContextMenuEvent * event ){
ContextMenu(dialogSinglePoint, this, event); ContextMenu(dialogSinglePoint, this, event, false);
} }
void VToolSinglePoint::FullUpdateFromFile(){ void VToolSinglePoint::FullUpdateFromFile(){

View File

@ -1,10 +1,16 @@
#ifndef VTOOLSINGLEPOINT_H #ifndef VTOOLSINGLEPOINT_H
#define VTOOLSINGLEPOINT_H #define VTOOLSINGLEPOINT_H
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Weffc++"
#pragma GCC diagnostic ignored "-Wconversion"
#pragma GCC diagnostic ignored "-Wsign-conversion"
#pragma GCC diagnostic ignored "-Wctor-dtor-privacy"
#include "../container/vcontainer.h" #include "../container/vcontainer.h"
#include "../xml/vdomdocument.h" #include "../xml/vdomdocument.h"
#include "vtoolpoint.h"
#include "../dialogs/dialogsinglepoint.h" #include "../dialogs/dialogsinglepoint.h"
#include "vtoolpoint.h"
#pragma GCC diagnostic pop
class VToolSinglePoint : public VToolPoint class VToolSinglePoint : public VToolPoint
{ {

View File

@ -1,10 +1,18 @@
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Weffc++"
#pragma GCC diagnostic ignored "-Wconversion"
#pragma GCC diagnostic ignored "-Wsign-conversion"
#pragma GCC diagnostic ignored "-Wctor-dtor-privacy"
#include "vtoolspline.h" #include "vtoolspline.h"
#include "../geometry/vspline.h"
#include <QMenu> #include <QMenu>
#include <QDebug> #include <QDebug>
#pragma GCC diagnostic pop
#include "../geometry/vspline.h"
VToolSpline::VToolSpline(VDomDocument *doc, VContainer *data, qint64 id, Tool::Enum typeCreation, VToolSpline::VToolSpline(VDomDocument *doc, VContainer *data, qint64 id, Tool::Enum typeCreation,
QGraphicsItem *parent):VAbstractTool(doc, data, id), QGraphicsPathItem(parent){ QGraphicsItem *parent):VAbstractTool(doc, data, id), QGraphicsPathItem(parent),
dialogSpline(QSharedPointer<DialogSpline>()), controlPoints(QVector<VControlPointSpline *>()){
VSpline spl = data->GetSpline(id); VSpline spl = data->GetSpline(id);
QPainterPath path; QPainterPath path;
@ -86,6 +94,7 @@ void VToolSpline::Create(const qint64 _id, const qint64 &p1, const qint64 &p4, c
VToolSpline *spl = new VToolSpline(doc, data, id, typeCreation); VToolSpline *spl = new VToolSpline(doc, data, id, typeCreation);
scene->addItem(spl); scene->addItem(spl);
connect(spl, &VToolSpline::ChoosedTool, scene, &VMainGraphicsScene::ChoosedItem); connect(spl, &VToolSpline::ChoosedTool, scene, &VMainGraphicsScene::ChoosedItem);
connect(spl, &VToolSpline::RemoveTool, scene, &VMainGraphicsScene::RemoveTool);
QMap<qint64, VDataTool*>* tools = doc->getTools(); QMap<qint64, VDataTool*>* tools = doc->getTools();
tools->insert(id,spl); tools->insert(id,spl);
} }

View File

@ -1,12 +1,18 @@
#ifndef VTOOLSPLINE_H #ifndef VTOOLSPLINE_H
#define VTOOLSPLINE_H #define VTOOLSPLINE_H
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Weffc++"
#pragma GCC diagnostic ignored "-Wconversion"
#pragma GCC diagnostic ignored "-Wsign-conversion"
#pragma GCC diagnostic ignored "-Wctor-dtor-privacy"
#include "vabstracttool.h" #include "vabstracttool.h"
#include "../container/vcontainer.h"
#include "../xml/vdomdocument.h" #include "../xml/vdomdocument.h"
#include <QGraphicsPathItem> #include <QGraphicsPathItem>
#include "../dialogs/dialogspline.h" #include "../dialogs/dialogspline.h"
#include "../widgets/vcontrolpointspline.h" #include "../widgets/vcontrolpointspline.h"
#include "../container/vcontainer.h"
#pragma GCC diagnostic pop
#include "../geometry/vsplinepath.h" #include "../geometry/vsplinepath.h"
class VToolSpline:public VAbstractTool, public QGraphicsPathItem class VToolSpline:public VAbstractTool, public QGraphicsPathItem

View File

@ -3,7 +3,8 @@
VToolSplinePath::VToolSplinePath(VDomDocument *doc, VContainer *data, qint64 id, Tool::Enum typeCreation, VToolSplinePath::VToolSplinePath(VDomDocument *doc, VContainer *data, qint64 id, Tool::Enum typeCreation,
QGraphicsItem *parent):VAbstractTool(doc, data, id), QGraphicsItem *parent):VAbstractTool(doc, data, id),
QGraphicsPathItem(parent){ QGraphicsPathItem(parent), dialogSplinePath(QSharedPointer<DialogSplinePath>()),
controlPoints(QVector<VControlPointSpline *>()){
VSplinePath splPath = data->GetSplinePath(id); VSplinePath splPath = data->GetSplinePath(id);
QPainterPath path; QPainterPath path;
path.addPath(splPath.GetPath()); path.addPath(splPath.GetPath());
@ -72,6 +73,7 @@ void VToolSplinePath::Create(const qint64 _id, const VSplinePath &path, VMainGra
VToolSplinePath *spl = new VToolSplinePath(doc, data, id, typeCreation); VToolSplinePath *spl = new VToolSplinePath(doc, data, id, typeCreation);
scene->addItem(spl); scene->addItem(spl);
connect(spl, &VToolSplinePath::ChoosedTool, scene, &VMainGraphicsScene::ChoosedItem); connect(spl, &VToolSplinePath::ChoosedTool, scene, &VMainGraphicsScene::ChoosedItem);
connect(spl, &VToolSplinePath::RemoveTool, scene, &VMainGraphicsScene::RemoveTool);
QMap<qint64, VDataTool*>* tools = doc->getTools(); QMap<qint64, VDataTool*>* tools = doc->getTools();
tools->insert(id,spl); tools->insert(id,spl);
} }

View File

@ -1,12 +1,18 @@
#ifndef VTOOLSPLINEPATH_H #ifndef VTOOLSPLINEPATH_H
#define VTOOLSPLINEPATH_H #define VTOOLSPLINEPATH_H
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Weffc++"
#pragma GCC diagnostic ignored "-Wconversion"
#pragma GCC diagnostic ignored "-Wsign-conversion"
#pragma GCC diagnostic ignored "-Wctor-dtor-privacy"
#include "vabstracttool.h" #include "vabstracttool.h"
#include "../container/vcontainer.h"
#include "../xml/vdomdocument.h" #include "../xml/vdomdocument.h"
#include <QGraphicsPathItem> #include <QGraphicsPathItem>
#include "../dialogs/dialogsplinepath.h" #include "../dialogs/dialogsplinepath.h"
#include "../widgets/vcontrolpointspline.h" #include "../widgets/vcontrolpointspline.h"
#pragma GCC diagnostic pop
#include "../container/vcontainer.h"
class VToolSplinePath:public VAbstractTool, public QGraphicsPathItem class VToolSplinePath:public VAbstractTool, public QGraphicsPathItem
{ {

View File

@ -45,8 +45,14 @@
using a spin box widget. using a spin box widget.
*/ */
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Weffc++"
#pragma GCC diagnostic ignored "-Wconversion"
#pragma GCC diagnostic ignored "-Wsign-conversion"
#pragma GCC diagnostic ignored "-Wctor-dtor-privacy"
#include <QtGui> #include <QtGui>
#include "delegate.h" #include "delegate.h"
#pragma GCC diagnostic pop
SpinBoxDelegate::SpinBoxDelegate(QObject *parent) SpinBoxDelegate::SpinBoxDelegate(QObject *parent)
: QItemDelegate(parent) : QItemDelegate(parent)

View File

@ -41,11 +41,17 @@
#ifndef DELEGATE_H #ifndef DELEGATE_H
#define DELEGATE_H #define DELEGATE_H
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Weffc++"
#pragma GCC diagnostic ignored "-Wconversion"
#pragma GCC diagnostic ignored "-Wsign-conversion"
#pragma GCC diagnostic ignored "-Wctor-dtor-privacy"
#include <QItemDelegate> #include <QItemDelegate>
#include <QModelIndex> #include <QModelIndex>
#include <QObject> #include <QObject>
#include <QSize> #include <QSize>
#include <QSpinBox> #include <QSpinBox>
#pragma GCC diagnostic pop
class SpinBoxDelegate : public QItemDelegate class SpinBoxDelegate : public QItemDelegate
{ {

View File

@ -45,9 +45,14 @@
using a spin box widget. using a spin box widget.
*/ */
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Weffc++"
#pragma GCC diagnostic ignored "-Wconversion"
#pragma GCC diagnostic ignored "-Wsign-conversion"
#pragma GCC diagnostic ignored "-Wctor-dtor-privacy"
#include <QtGui> #include <QtGui>
#include "doubledelegate.h" #include "doubledelegate.h"
#pragma GCC diagnostic pop
DoubleSpinBoxDelegate::DoubleSpinBoxDelegate(QObject *parent) DoubleSpinBoxDelegate::DoubleSpinBoxDelegate(QObject *parent)
: QItemDelegate(parent) : QItemDelegate(parent)

View File

@ -41,11 +41,17 @@
#ifndef DOUBLEDELEGATE_H #ifndef DOUBLEDELEGATE_H
#define DOUBLEDELEGATE_H #define DOUBLEDELEGATE_H
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Weffc++"
#pragma GCC diagnostic ignored "-Wconversion"
#pragma GCC diagnostic ignored "-Wsign-conversion"
#pragma GCC diagnostic ignored "-Wctor-dtor-privacy"
#include <QItemDelegate> #include <QItemDelegate>
#include <QModelIndex> #include <QModelIndex>
#include <QObject> #include <QObject>
#include <QSize> #include <QSize>
#include <QSpinBox> #include <QSpinBox>
#pragma GCC diagnostic pop
class DoubleSpinBoxDelegate : public QItemDelegate class DoubleSpinBoxDelegate : public QItemDelegate
{ {

View File

@ -1,15 +1,19 @@
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Weffc++"
#pragma GCC diagnostic ignored "-Wconversion"
#pragma GCC diagnostic ignored "-Wsign-conversion"
#pragma GCC diagnostic ignored "-Wctor-dtor-privacy"
#include "vcontrolpointspline.h" #include "vcontrolpointspline.h"
#include <QPen> #include <QPen>
#include <QBrush> #include <QBrush>
#include <QGraphicsScene> #include <QGraphicsScene>
#include <QDebug> #include <QDebug>
#pragma GCC diagnostic pop
VControlPointSpline::VControlPointSpline(const qint32 &indexSpline, SplinePoint::Position position, VControlPointSpline::VControlPointSpline(const qint32 &indexSpline, SplinePoint::Position position,
const QPointF &controlPoint, const QPointF &splinePoint, const QPointF &controlPoint, const QPointF &splinePoint,
QGraphicsItem *parent):QGraphicsEllipseItem(parent){ QGraphicsItem *parent):QGraphicsEllipseItem(parent),
radius = 1.5*PrintDPI/25.4; radius(1.5*PrintDPI/25.4), controlLine(0), indexSpline(indexSpline), position(position){
this->indexSpline = indexSpline;
this->position = position;
//create circle //create circle
QRectF rec = QRectF(0, 0, radius*2, radius*2); QRectF rec = QRectF(0, 0, radius*2, radius*2);
rec.translate(-rec.center().x(), -rec.center().y()); rec.translate(-rec.center().x(), -rec.center().y());

View File

@ -1,9 +1,15 @@
#ifndef VCONTROLPOINTSPLINE_H #ifndef VCONTROLPOINTSPLINE_H
#define VCONTROLPOINTSPLINE_H #define VCONTROLPOINTSPLINE_H
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Weffc++"
#pragma GCC diagnostic ignored "-Wconversion"
#pragma GCC diagnostic ignored "-Wsign-conversion"
#pragma GCC diagnostic ignored "-Wctor-dtor-privacy"
#include <QGraphicsEllipseItem> #include <QGraphicsEllipseItem>
#include <QGraphicsLineItem> #include <QGraphicsLineItem>
#include <QObject> #include <QObject>
#pragma GCC diagnostic pop
#include "../options.h" #include "../options.h"
#include "../geometry/vsplinepath.h" #include "../geometry/vsplinepath.h"
@ -28,6 +34,8 @@ protected:
virtual void hoverLeaveEvent ( QGraphicsSceneHoverEvent * event ); virtual void hoverLeaveEvent ( QGraphicsSceneHoverEvent * event );
QVariant itemChange ( GraphicsItemChange change, const QVariant &value ); QVariant itemChange ( GraphicsItemChange change, const QVariant &value );
private: private:
VControlPointSpline(const VControlPointSpline &pSpl);
const VControlPointSpline &operator=(const VControlPointSpline &pSpl);
qint32 indexSpline; qint32 indexSpline;
SplinePoint::Position position; SplinePoint::Position position;
qint32 LineIntersectCircle(QPointF center, qreal radius, QLineF line, QPointF &p1, qint32 LineIntersectCircle(QPointF center, qreal radius, QLineF line, QPointF &p1,

View File

@ -1,5 +1,11 @@
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Weffc++"
#pragma GCC diagnostic ignored "-Wconversion"
#pragma GCC diagnostic ignored "-Wsign-conversion"
#pragma GCC diagnostic ignored "-Wctor-dtor-privacy"
#include "vgraphicssimpletextitem.h" #include "vgraphicssimpletextitem.h"
#include <QGraphicsScene> #include <QGraphicsScene>
#pragma GCC diagnostic pop
VGraphicsSimpleTextItem::VGraphicsSimpleTextItem(QGraphicsItem * parent):QGraphicsSimpleTextItem(parent){ VGraphicsSimpleTextItem::VGraphicsSimpleTextItem(QGraphicsItem * parent):QGraphicsSimpleTextItem(parent){
} }

View File

@ -1,7 +1,13 @@
#ifndef VGRAPHICSSIMPLETEXTITEM_H #ifndef VGRAPHICSSIMPLETEXTITEM_H
#define VGRAPHICSSIMPLETEXTITEM_H #define VGRAPHICSSIMPLETEXTITEM_H
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Weffc++"
#pragma GCC diagnostic ignored "-Wconversion"
#pragma GCC diagnostic ignored "-Wsign-conversion"
#pragma GCC diagnostic ignored "-Wctor-dtor-privacy"
#include <QGraphicsSimpleTextItem> #include <QGraphicsSimpleTextItem>
#pragma GCC diagnostic pop
class VGraphicsSimpleTextItem : public QObject, public QGraphicsSimpleTextItem class VGraphicsSimpleTextItem : public QObject, public QGraphicsSimpleTextItem
{ {

View File

@ -1,7 +1,11 @@
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Weffc++"
#include "vmaingraphicsscene.h" #include "vmaingraphicsscene.h"
#include <QDebug> #include <QDebug>
#include <QApplication> #include <QApplication>
#include <QScrollBar> #include <QScrollBar>
#include <QGraphicsItem>
#pragma GCC diagnostic pop
VMainGraphicsScene::VMainGraphicsScene():QGraphicsScene(){ VMainGraphicsScene::VMainGraphicsScene():QGraphicsScene(){
} }
@ -23,3 +27,7 @@ void VMainGraphicsScene::mousePressEvent(QGraphicsSceneMouseEvent *event){
void VMainGraphicsScene::ChoosedItem(qint64 id, Scene::Type type){ void VMainGraphicsScene::ChoosedItem(qint64 id, Scene::Type type){
emit ChoosedObject(id, type); emit ChoosedObject(id, type);
} }
void VMainGraphicsScene::RemoveTool(QGraphicsItem *tool){
this->removeItem(tool);
}

View File

@ -1,9 +1,12 @@
#ifndef VMAINGRAPHICSSCENE_H #ifndef VMAINGRAPHICSSCENE_H
#define VMAINGRAPHICSSCENE_H #define VMAINGRAPHICSSCENE_H
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Weffc++"
#include <QGraphicsScene> #include <QGraphicsScene>
#include <QGraphicsView> #include <QGraphicsView>
#include <QGraphicsSceneMouseEvent> #include <QGraphicsSceneMouseEvent>
#pragma GCC diagnostic pop
#include "../options.h" #include "../options.h"
@ -15,6 +18,7 @@ public:
VMainGraphicsScene(const QRectF & sceneRect, QObject * parent = 0); VMainGraphicsScene(const QRectF & sceneRect, QObject * parent = 0);
public slots: public slots:
void ChoosedItem(qint64 id, Scene::Type type); void ChoosedItem(qint64 id, Scene::Type type);
void RemoveTool(QGraphicsItem *tool);
protected: protected:
void mouseMoveEvent(QGraphicsSceneMouseEvent* event); void mouseMoveEvent(QGraphicsSceneMouseEvent* event);
void mousePressEvent(QGraphicsSceneMouseEvent *event); void mousePressEvent(QGraphicsSceneMouseEvent *event);

View File

@ -1,7 +1,13 @@
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Weffc++"
#pragma GCC diagnostic ignored "-Wconversion"
#pragma GCC diagnostic ignored "-Wsign-conversion"
#pragma GCC diagnostic ignored "-Wctor-dtor-privacy"
#include "vmaingraphicsview.h" #include "vmaingraphicsview.h"
#include <QApplication> #include <QApplication>
#include <QWheelEvent> #include <QWheelEvent>
#include <QScrollBar> #include <QScrollBar>
#pragma GCC diagnostic pop
VMainGraphicsView::VMainGraphicsView(QWidget *parent) : VMainGraphicsView::VMainGraphicsView(QWidget *parent) :
QGraphicsView(parent){ QGraphicsView(parent){

View File

@ -1,7 +1,13 @@
#ifndef VMAINGRAPHICSVIEW_H #ifndef VMAINGRAPHICSVIEW_H
#define VMAINGRAPHICSVIEW_H #define VMAINGRAPHICSVIEW_H
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Weffc++"
#pragma GCC diagnostic ignored "-Wconversion"
#pragma GCC diagnostic ignored "-Wsign-conversion"
#pragma GCC diagnostic ignored "-Wctor-dtor-privacy"
#include <QGraphicsView> #include <QGraphicsView>
#pragma GCC diagnostic pop
class VMainGraphicsView : public QGraphicsView class VMainGraphicsView : public QGraphicsView
{ {

View File

@ -1,4 +1,8 @@
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Weffc++" #pragma GCC diagnostic ignored "-Weffc++"
#pragma GCC diagnostic ignored "-Wconversion"
#pragma GCC diagnostic ignored "-Wsign-conversion"
#pragma GCC diagnostic ignored "-Wctor-dtor-privacy"
#include "vdomdocument.h" #include "vdomdocument.h"
#include <QDebug> #include <QDebug>
#include "../tools/vtoolsinglepoint.h" #include "../tools/vtoolsinglepoint.h"
@ -12,27 +16,29 @@
#include "../tools/vtoolspline.h" #include "../tools/vtoolspline.h"
#include "../tools/vtoolarc.h" #include "../tools/vtoolarc.h"
#include "../tools/vtoolsplinepath.h" #include "../tools/vtoolsplinepath.h"
#pragma GCC diagnostic warning "-Weffc++" #pragma GCC diagnostic pop
#include "../options.h" #include "../options.h"
#include "../container/calculator.h" #include "../container/calculator.h"
#include "../geometry/vsplinepoint.h" #include "../geometry/vsplinepoint.h"
VDomDocument::VDomDocument(VContainer *data, QComboBox *comboBoxDraws) : QDomDocument(), cursor(0){ VDomDocument::VDomDocument(VContainer *data, QComboBox *comboBoxDraws) : QDomDocument(),
this->data = data; map(QMap<QString, QDomElement>()), nameActivDraw(QString()), data(data),
this->comboBoxDraws = comboBoxDraws; tools(QMap<qint64, VDataTool*>()), history(QVector<VToolRecord>()), cursor(0),
comboBoxDraws(comboBoxDraws){
} }
VDomDocument::VDomDocument(const QString& name, VContainer *data, QComboBox *comboBoxDraws) : QDomDocument(name), cursor(0) { VDomDocument::VDomDocument(const QString& name, VContainer *data, QComboBox *comboBoxDraws) :
this->data = data; QDomDocument(name), map(QMap<QString, QDomElement>()), nameActivDraw(QString()), data(data),
this->comboBoxDraws = comboBoxDraws; tools(QMap<qint64, VDataTool*>()), history(QVector<VToolRecord>()), cursor(0),
comboBoxDraws(comboBoxDraws){
} }
VDomDocument::VDomDocument(const QDomDocumentType& doctype, VContainer *data, QComboBox *comboBoxDraws) : QDomDocument(doctype), VDomDocument::VDomDocument(const QDomDocumentType& doctype, VContainer *data, QComboBox *comboBoxDraws) :
cursor(0){ QDomDocument(doctype), map(QMap<QString, QDomElement>()), nameActivDraw(QString()), data(data),
this->data = data; tools(QMap<qint64, VDataTool*>()), history(QVector<VToolRecord>()), cursor(0),
this->comboBoxDraws = comboBoxDraws; comboBoxDraws(comboBoxDraws){
} }
VDomDocument::~VDomDocument(){ VDomDocument::~VDomDocument(){
@ -434,7 +440,7 @@ void VDomDocument::ParsePointElement(VMainGraphicsScene *scene, const QDomElemen
QString formula = domElement.attribute("length", ""); QString formula = domElement.attribute("length", "");
qint64 firstPointId = domElement.attribute("firstPoint", "").toLongLong(); qint64 firstPointId = domElement.attribute("firstPoint", "").toLongLong();
qint64 secondPointId = domElement.attribute("secondPoint", "").toLongLong(); qint64 secondPointId = domElement.attribute("secondPoint", "").toLongLong();
qreal angle = domElement.attribute("angle", "").toInt(); qreal angle = domElement.attribute("angle", "").toDouble();
VToolNormal::Create(id, formula, firstPointId, secondPointId, typeLine, name, angle, VToolNormal::Create(id, formula, firstPointId, secondPointId, typeLine, name, angle,
mx, my, scene, this, data, parse, Tool::FromFile); mx, my, scene, this, data, parse, Tool::FromFile);
} }

View File

@ -1,7 +1,11 @@
#ifndef VDOMDOCUMENT_H #ifndef VDOMDOCUMENT_H
#define VDOMDOCUMENT_H #define VDOMDOCUMENT_H
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Weffc++" #pragma GCC diagnostic ignored "-Weffc++"
#pragma GCC diagnostic ignored "-Wconversion"
#pragma GCC diagnostic ignored "-Wsign-conversion"
#pragma GCC diagnostic ignored "-Wctor-dtor-privacy"
#include <QDomDocument> #include <QDomDocument>
#include <QMap> #include <QMap>
#include <QObject> #include <QObject>
@ -9,7 +13,7 @@
#include "../container/vcontainer.h" #include "../container/vcontainer.h"
#include "../widgets/vmaingraphicsscene.h" #include "../widgets/vmaingraphicsscene.h"
#include "../tools/vdatatool.h" #include "../tools/vdatatool.h"
#pragma GCC diagnostic warning "-Weffc++" #pragma GCC diagnostic pop
#include "vtoolrecord.h" #include "vtoolrecord.h"
namespace Document{ namespace Document{
@ -20,6 +24,8 @@ namespace Document{
}; };
} }
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Weffc++"
class VDomDocument : public QObject, public QDomDocument class VDomDocument : public QObject, public QDomDocument
{ {
Q_OBJECT Q_OBJECT
@ -63,6 +69,8 @@ private:
QVector<VToolRecord> history; QVector<VToolRecord> history;
qint64 cursor; qint64 cursor;
QComboBox *comboBoxDraws; QComboBox *comboBoxDraws;
VDomDocument(const VDomDocument & doc);
const VDomDocument &operator=(const VDomDocument& doc);
bool find(QDomElement node, const QString& id); bool find(QDomElement node, const QString& id);
bool CheckNameDraw(const QString& name) const; bool CheckNameDraw(const QString& name) const;
void SetActivDraw(const QString& name); void SetActivDraw(const QString& name);
@ -82,4 +90,6 @@ private:
void ParseIncrementsElement(const QDomNode& node); void ParseIncrementsElement(const QDomNode& node);
}; };
#pragma GCC diagnostic pop
#endif // VDOMDOCUMENT_H #endif // VDOMDOCUMENT_H

View File

@ -1,12 +1,12 @@
#ifndef VTOOLRECORD_H #ifndef VTOOLRECORD_H
#define VTOOLRECORD_H #define VTOOLRECORD_H
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Weffc++" #pragma GCC diagnostic ignored "-Weffc++"
#pragma GCC diagnostic ignored "-Wsign-conversion" #pragma GCC diagnostic ignored "-Wsign-conversion"
#include <QtGlobal> #include <QtGlobal>
#include <QString> #include <QString>
#pragma GCC diagnostic warning "-Wsign-conversion" #pragma GCC diagnostic pop
#pragma GCC diagnostic warning "-Weffc++"
#include "../options.h" #include "../options.h"
class VToolRecord class VToolRecord