Move documantation to cpp file.
--HG-- branch : develop
This commit is contained in:
parent
58a5c85615
commit
543758a80c
|
@ -29,7 +29,10 @@
|
||||||
#include "dialogaboutapp.h"
|
#include "dialogaboutapp.h"
|
||||||
#include "ui_dialogaboutapp.h"
|
#include "ui_dialogaboutapp.h"
|
||||||
#include "../../version.h"
|
#include "../../version.h"
|
||||||
|
#include <QDesktopServices>
|
||||||
|
#include <QMessageBox>
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
DialogAboutApp::DialogAboutApp(QWidget *parent) :
|
DialogAboutApp::DialogAboutApp(QWidget *parent) :
|
||||||
QDialog(parent),
|
QDialog(parent),
|
||||||
ui(new Ui::DialogAboutApp)
|
ui(new Ui::DialogAboutApp)
|
||||||
|
@ -45,21 +48,25 @@ DialogAboutApp::DialogAboutApp(QWidget *parent) :
|
||||||
ui->label_Legal_Stuff->setText(WARRANTY);
|
ui->label_Legal_Stuff->setText(WARRANTY);
|
||||||
|
|
||||||
ui->pushButton_Web_Site->setText(tr("Web site : %1").arg(VER_COMPANYDOMAIN_STR));
|
ui->pushButton_Web_Site->setText(tr("Web site : %1").arg(VER_COMPANYDOMAIN_STR));
|
||||||
connect(ui->pushButton_Web_Site, &QPushButton::clicked,
|
connect(ui->pushButton_Web_Site, &QPushButton::clicked, this, &DialogAboutApp::webButtonClicked );
|
||||||
this, &DialogAboutApp::webButtonClicked );
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
DialogAboutApp::~DialogAboutApp()
|
DialogAboutApp::~DialogAboutApp()
|
||||||
{
|
{
|
||||||
delete ui;
|
delete ui;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DialogAboutApp::webButtonClicked() {
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
if ( ! QDesktopServices::openUrl(QUrl(VER_COMPANYDOMAIN_STR))) {
|
/**
|
||||||
QMessageBox::warning(this,
|
* @brief Fake button clicked
|
||||||
tr("Warning"),
|
*/
|
||||||
tr("Cannot open your default browser"));
|
void DialogAboutApp::webButtonClicked()
|
||||||
|
{
|
||||||
|
if ( ! QDesktopServices::openUrl(QUrl(VER_COMPANYDOMAIN_STR)))
|
||||||
|
{
|
||||||
|
QMessageBox::warning(this, tr("Warning"), tr("Cannot open your default browser"));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -48,9 +48,6 @@ private:
|
||||||
Q_DISABLE_COPY(DialogAboutApp)
|
Q_DISABLE_COPY(DialogAboutApp)
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
/**
|
|
||||||
* @brief Fake button clicked
|
|
||||||
*/
|
|
||||||
void webButtonClicked();
|
void webButtonClicked();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -39,6 +39,12 @@
|
||||||
#include <QPushButton>
|
#include <QPushButton>
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief DialogHistory create dialog
|
||||||
|
* @param data container with data
|
||||||
|
* @param doc dom document container
|
||||||
|
* @param parent parent widget
|
||||||
|
*/
|
||||||
DialogHistory::DialogHistory(VContainer *data, VPattern *doc, QWidget *parent)
|
DialogHistory::DialogHistory(VContainer *data, VPattern *doc, QWidget *parent)
|
||||||
:DialogTool(data, parent), ui(new Ui::DialogHistory), doc(doc), cursorRow(0),
|
:DialogTool(data, parent), ui(new Ui::DialogHistory), doc(doc), cursorRow(0),
|
||||||
cursorToolRecordRow(0)
|
cursorToolRecordRow(0)
|
||||||
|
@ -63,6 +69,9 @@ DialogHistory::~DialogHistory()
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief DialogAccepted save data and emit signal about closed dialog.
|
||||||
|
*/
|
||||||
void DialogHistory::DialogAccepted()
|
void DialogHistory::DialogAccepted()
|
||||||
{
|
{
|
||||||
QTableWidgetItem *item = ui->tableWidget->item(cursorToolRecordRow, 0);
|
QTableWidgetItem *item = ui->tableWidget->item(cursorToolRecordRow, 0);
|
||||||
|
@ -72,6 +81,11 @@ void DialogHistory::DialogAccepted()
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief cellClicked changed history record
|
||||||
|
* @param row number row in table
|
||||||
|
* @param column number column in table
|
||||||
|
*/
|
||||||
void DialogHistory::cellClicked(int row, int column)
|
void DialogHistory::cellClicked(int row, int column)
|
||||||
{
|
{
|
||||||
if (column == 0)
|
if (column == 0)
|
||||||
|
@ -101,6 +115,10 @@ void DialogHistory::cellClicked(int row, int column)
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief ChangedCursor changed cursor of input. Cursor show after what record we will insert new object
|
||||||
|
* @param id id of object
|
||||||
|
*/
|
||||||
void DialogHistory::ChangedCursor(quint32 id)
|
void DialogHistory::ChangedCursor(quint32 id)
|
||||||
{
|
{
|
||||||
for (qint32 i = 0; i< ui->tableWidget->rowCount(); ++i)
|
for (qint32 i = 0; i< ui->tableWidget->rowCount(); ++i)
|
||||||
|
@ -118,6 +136,9 @@ void DialogHistory::ChangedCursor(quint32 id)
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief UpdateHistory update history table
|
||||||
|
*/
|
||||||
void DialogHistory::UpdateHistory()
|
void DialogHistory::UpdateHistory()
|
||||||
{
|
{
|
||||||
FillTable();
|
FillTable();
|
||||||
|
@ -125,6 +146,9 @@ void DialogHistory::UpdateHistory()
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief FillTable fill table
|
||||||
|
*/
|
||||||
void DialogHistory::FillTable()
|
void DialogHistory::FillTable()
|
||||||
{
|
{
|
||||||
ui->tableWidget->clear();
|
ui->tableWidget->clear();
|
||||||
|
@ -173,6 +197,11 @@ void DialogHistory::FillTable()
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief Record return description for record
|
||||||
|
* @param tool record data
|
||||||
|
* @return description
|
||||||
|
*/
|
||||||
QString DialogHistory::Record(const VToolRecord &tool)
|
QString DialogHistory::Record(const VToolRecord &tool)
|
||||||
{
|
{
|
||||||
const QDomElement domElement = doc->elementById(QString().setNum(tool.getId()));
|
const QDomElement domElement = doc->elementById(QString().setNum(tool.getId()));
|
||||||
|
@ -416,6 +445,9 @@ QString DialogHistory::Record(const VToolRecord &tool)
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief InitialTable set initial option of table
|
||||||
|
*/
|
||||||
void DialogHistory::InitialTable()
|
void DialogHistory::InitialTable()
|
||||||
{
|
{
|
||||||
ui->tableWidget->setSortingEnabled(false);
|
ui->tableWidget->setSortingEnabled(false);
|
||||||
|
@ -424,6 +456,9 @@ void DialogHistory::InitialTable()
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief ShowPoint show selected point
|
||||||
|
*/
|
||||||
void DialogHistory::ShowPoint()
|
void DialogHistory::ShowPoint()
|
||||||
{
|
{
|
||||||
QVector<VToolRecord> *history = doc->getHistory();
|
QVector<VToolRecord> *history = doc->getHistory();
|
||||||
|
@ -439,6 +474,10 @@ void DialogHistory::ShowPoint()
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief closeEvent handle when windows is closing
|
||||||
|
* @param event event
|
||||||
|
*/
|
||||||
void DialogHistory::closeEvent(QCloseEvent *event)
|
void DialogHistory::closeEvent(QCloseEvent *event)
|
||||||
{
|
{
|
||||||
QTableWidgetItem *item = ui->tableWidget->item(cursorToolRecordRow, 0);
|
QTableWidgetItem *item = ui->tableWidget->item(cursorToolRecordRow, 0);
|
||||||
|
|
|
@ -44,33 +44,12 @@ class DialogHistory : public DialogTool
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
/**
|
DialogHistory(VContainer *data, VPattern *doc, QWidget *parent = nullptr);
|
||||||
* @brief DialogHistory create dialog
|
virtual ~DialogHistory();
|
||||||
* @param data container with data
|
|
||||||
* @param doc dom document container
|
|
||||||
* @param parent parent widget
|
|
||||||
*/
|
|
||||||
DialogHistory(VContainer *data, VPattern *doc, QWidget *parent = nullptr);
|
|
||||||
virtual ~DialogHistory();
|
|
||||||
public slots:
|
public slots:
|
||||||
/**
|
|
||||||
* @brief DialogAccepted save data and emit signal about closed dialog.
|
|
||||||
*/
|
|
||||||
virtual void DialogAccepted();
|
virtual void DialogAccepted();
|
||||||
/**
|
|
||||||
* @brief cellClicked changed history record
|
|
||||||
* @param row number row in table
|
|
||||||
* @param column number column in table
|
|
||||||
*/
|
|
||||||
void cellClicked(int row, int column);
|
void cellClicked(int row, int column);
|
||||||
/**
|
|
||||||
* @brief ChangedCursor changed cursor of input. Cursor show after what record we will insert new object
|
|
||||||
* @param id id of object
|
|
||||||
*/
|
|
||||||
void ChangedCursor(quint32 id);
|
void ChangedCursor(quint32 id);
|
||||||
/**
|
|
||||||
* @brief UpdateHistory update history table
|
|
||||||
*/
|
|
||||||
void UpdateHistory();
|
void UpdateHistory();
|
||||||
signals:
|
signals:
|
||||||
/**
|
/**
|
||||||
|
@ -81,46 +60,25 @@ signals:
|
||||||
*/
|
*/
|
||||||
void ShowHistoryTool(quint32 id, Qt::GlobalColor color, bool enable);
|
void ShowHistoryTool(quint32 id, Qt::GlobalColor color, bool enable);
|
||||||
protected:
|
protected:
|
||||||
/**
|
|
||||||
* @brief closeEvent handle when windows is closing
|
|
||||||
* @param event event
|
|
||||||
*/
|
|
||||||
virtual void closeEvent ( QCloseEvent * event );
|
virtual void closeEvent ( QCloseEvent * event );
|
||||||
private:
|
private:
|
||||||
Q_DISABLE_COPY(DialogHistory)
|
Q_DISABLE_COPY(DialogHistory)
|
||||||
/**
|
|
||||||
* @brief ui keeps information about user interface
|
/** @brief ui keeps information about user interface */
|
||||||
*/
|
|
||||||
Ui::DialogHistory *ui;
|
Ui::DialogHistory *ui;
|
||||||
/**
|
|
||||||
* @brief doc dom document container
|
/** @brief doc dom document container */
|
||||||
*/
|
|
||||||
VPattern *doc;
|
VPattern *doc;
|
||||||
/**
|
|
||||||
* @brief cursorRow save number of row where is cursor
|
/** @brief cursorRow save number of row where is cursor */
|
||||||
*/
|
|
||||||
qint32 cursorRow;
|
qint32 cursorRow;
|
||||||
/**
|
|
||||||
* @brief cursorToolRecordRow save number of row selected record
|
/** @brief cursorToolRecordRow save number of row selected record */
|
||||||
*/
|
|
||||||
qint32 cursorToolRecordRow;
|
qint32 cursorToolRecordRow;
|
||||||
/**
|
|
||||||
* @brief FillTable fill table
|
|
||||||
*/
|
|
||||||
void FillTable();
|
void FillTable();
|
||||||
/**
|
|
||||||
* @brief Record return description for record
|
|
||||||
* @param tool record data
|
|
||||||
* @return description
|
|
||||||
*/
|
|
||||||
QString Record(const VToolRecord &tool);
|
QString Record(const VToolRecord &tool);
|
||||||
/**
|
|
||||||
* @brief InitialTable set initial option of table
|
|
||||||
*/
|
|
||||||
void InitialTable();
|
void InitialTable();
|
||||||
/**
|
|
||||||
* @brief ShowPoint show selected point
|
|
||||||
*/
|
|
||||||
void ShowPoint();
|
void ShowPoint();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -41,6 +41,12 @@
|
||||||
#include <QCloseEvent>
|
#include <QCloseEvent>
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief DialogIncrements create dialog
|
||||||
|
* @param data container with data
|
||||||
|
* @param doc dom document container
|
||||||
|
* @param parent parent widget
|
||||||
|
*/
|
||||||
DialogIncrements::DialogIncrements(VContainer *data, VPattern *doc, QWidget *parent)
|
DialogIncrements::DialogIncrements(VContainer *data, VPattern *doc, QWidget *parent)
|
||||||
:DialogTool(data, parent), ui(new Ui::DialogIncrements), data(data), doc(doc), row(0), column(0), m(nullptr)
|
:DialogTool(data, parent), ui(new Ui::DialogIncrements), data(data), doc(doc), row(0), column(0), m(nullptr)
|
||||||
{
|
{
|
||||||
|
@ -137,6 +143,9 @@ DialogIncrements::DialogIncrements(VContainer *data, VPattern *doc, QWidget *par
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief FillMeasurements load measurements data
|
||||||
|
*/
|
||||||
void DialogIncrements::FillMeasurements()
|
void DialogIncrements::FillMeasurements()
|
||||||
{
|
{
|
||||||
const QHash<QString, VMeasurement> *table = data->DataMeasurements();
|
const QHash<QString, VMeasurement> *table = data->DataMeasurements();
|
||||||
|
@ -217,6 +226,9 @@ void DialogIncrements::FillMeasurements()
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief FillIncrementTable fill data for increment table
|
||||||
|
*/
|
||||||
void DialogIncrements::FillIncrements()
|
void DialogIncrements::FillIncrements()
|
||||||
{
|
{
|
||||||
const QHash<QString, VIncrement> *increments = data->DataIncrements();
|
const QHash<QString, VIncrement> *increments = data->DataIncrements();
|
||||||
|
@ -285,6 +297,9 @@ void DialogIncrements::FillIncrements()
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief FillLengthLines fill data for table of lines lengths
|
||||||
|
*/
|
||||||
void DialogIncrements::FillLengthLines()
|
void DialogIncrements::FillLengthLines()
|
||||||
{
|
{
|
||||||
const QHash<QString, qreal> *linesTable = data->DataLengthLines();
|
const QHash<QString, qreal> *linesTable = data->DataLengthLines();
|
||||||
|
@ -321,6 +336,9 @@ void DialogIncrements::FillLengthLines()
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief FillLengthSplines fill data for table of splines lengths
|
||||||
|
*/
|
||||||
void DialogIncrements::FillLengthSplines()
|
void DialogIncrements::FillLengthSplines()
|
||||||
{
|
{
|
||||||
const QHash<QString, qreal> *splinesTable = data->DataLengthSplines();
|
const QHash<QString, qreal> *splinesTable = data->DataLengthSplines();
|
||||||
|
@ -357,6 +375,9 @@ void DialogIncrements::FillLengthSplines()
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief FillLengthArcs fill data for table of arcs lengths
|
||||||
|
*/
|
||||||
void DialogIncrements::FillLengthArcs()
|
void DialogIncrements::FillLengthArcs()
|
||||||
{
|
{
|
||||||
const QHash<QString, qreal> *arcsTable = data->DataLengthArcs();
|
const QHash<QString, qreal> *arcsTable = data->DataLengthArcs();
|
||||||
|
@ -393,6 +414,9 @@ void DialogIncrements::FillLengthArcs()
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief FullUpdateFromFile update information in tables form file
|
||||||
|
*/
|
||||||
void DialogIncrements::FullUpdateFromFile()
|
void DialogIncrements::FullUpdateFromFile()
|
||||||
{
|
{
|
||||||
disconnect(ui->tableWidgetMeasurements, &QTableWidget::cellChanged, this, &DialogIncrements::MeasurementChanged);
|
disconnect(ui->tableWidgetMeasurements, &QTableWidget::cellChanged, this, &DialogIncrements::MeasurementChanged);
|
||||||
|
@ -555,6 +579,9 @@ void DialogIncrements::OpenTable()
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief clickedToolButtonAdd create new row in table
|
||||||
|
*/
|
||||||
void DialogIncrements::clickedToolButtonAdd()
|
void DialogIncrements::clickedToolButtonAdd()
|
||||||
{
|
{
|
||||||
ui->tableWidgetIncrement->setFocus(Qt::OtherFocusReason);
|
ui->tableWidgetIncrement->setFocus(Qt::OtherFocusReason);
|
||||||
|
@ -616,6 +643,9 @@ void DialogIncrements::clickedToolButtonAdd()
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief clickedToolButtonRemove remove one row from table
|
||||||
|
*/
|
||||||
void DialogIncrements::clickedToolButtonRemove()
|
void DialogIncrements::clickedToolButtonRemove()
|
||||||
{
|
{
|
||||||
disconnect(ui->tableWidgetIncrement, &QTableWidget::cellChanged, this,
|
disconnect(ui->tableWidgetIncrement, &QTableWidget::cellChanged, this,
|
||||||
|
@ -642,6 +672,15 @@ void DialogIncrements::clickedToolButtonRemove()
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief AddIncrementToFile save created increment to file
|
||||||
|
* @param id id of increment
|
||||||
|
* @param name name
|
||||||
|
* @param base base value
|
||||||
|
* @param ksize increment in sizes
|
||||||
|
* @param kheight increment in heights
|
||||||
|
* @param description description of increment
|
||||||
|
*/
|
||||||
void DialogIncrements::AddIncrementToFile(const quint32 &id, const QString &name, const qreal &base, const qreal &ksize,
|
void DialogIncrements::AddIncrementToFile(const quint32 &id, const QString &name, const qreal &base, const qreal &ksize,
|
||||||
const qreal &kheight, const QString &description)
|
const qreal &kheight, const QString &description)
|
||||||
{
|
{
|
||||||
|
@ -659,6 +698,11 @@ void DialogIncrements::AddIncrementToFile(const quint32 &id, const QString &name
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief cellChanged cell in table was changed
|
||||||
|
* @param row number of row
|
||||||
|
* @param column number of column
|
||||||
|
*/
|
||||||
void DialogIncrements::IncrementChanged ( qint32 row, qint32 column )
|
void DialogIncrements::IncrementChanged ( qint32 row, qint32 column )
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
|
@ -45,33 +45,13 @@ class DialogIncrements : public DialogTool
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
/**
|
DialogIncrements(VContainer *data, VPattern *doc, QWidget *parent = nullptr);
|
||||||
* @brief DialogIncrements create dialog
|
~DialogIncrements();
|
||||||
* @param data container with data
|
|
||||||
* @param doc dom document container
|
|
||||||
* @param parent parent widget
|
|
||||||
*/
|
|
||||||
DialogIncrements(VContainer *data, VPattern *doc, QWidget *parent = nullptr);
|
|
||||||
~DialogIncrements();
|
|
||||||
public slots:
|
public slots:
|
||||||
/**
|
|
||||||
* @brief clickedToolButtonAdd create new row in table
|
|
||||||
*/
|
|
||||||
void clickedToolButtonAdd();
|
void clickedToolButtonAdd();
|
||||||
/**
|
|
||||||
* @brief clickedToolButtonRemove remove one row from table
|
|
||||||
*/
|
|
||||||
void clickedToolButtonRemove();
|
void clickedToolButtonRemove();
|
||||||
/**
|
|
||||||
* @brief cellChanged cell in table was changed
|
|
||||||
* @param row number of row
|
|
||||||
* @param column number of column
|
|
||||||
*/
|
|
||||||
void IncrementChanged ( qint32 row, qint32 column );
|
void IncrementChanged ( qint32 row, qint32 column );
|
||||||
void MeasurementChanged ( qint32 row, qint32 column );
|
void MeasurementChanged ( qint32 row, qint32 column );
|
||||||
/**
|
|
||||||
* @brief FullUpdateFromFile update information in tables form file
|
|
||||||
*/
|
|
||||||
void FullUpdateFromFile();
|
void FullUpdateFromFile();
|
||||||
void SaveGivenName();
|
void SaveGivenName();
|
||||||
void SaveFamilyName();
|
void SaveFamilyName();
|
||||||
|
@ -92,56 +72,29 @@ protected:
|
||||||
virtual void closeEvent ( QCloseEvent * event );
|
virtual void closeEvent ( QCloseEvent * event );
|
||||||
private:
|
private:
|
||||||
Q_DISABLE_COPY(DialogIncrements)
|
Q_DISABLE_COPY(DialogIncrements)
|
||||||
/**
|
|
||||||
* @brief ui keeps information about user interface
|
/** @brief ui keeps information about user interface */
|
||||||
*/
|
|
||||||
Ui::DialogIncrements *ui;
|
Ui::DialogIncrements *ui;
|
||||||
/**
|
|
||||||
* @brief data container with data
|
/** @brief data container with data */
|
||||||
*/
|
|
||||||
VContainer *data; // need because we must change data
|
VContainer *data; // need because we must change data
|
||||||
/**
|
|
||||||
* @brief doc dom document container
|
/** @brief doc dom document container */
|
||||||
*/
|
|
||||||
VPattern *doc;
|
VPattern *doc;
|
||||||
/**
|
|
||||||
* @brief row save number of row current selected cell
|
/** @brief row save number of row current selected cell */
|
||||||
*/
|
|
||||||
qint32 row;
|
qint32 row;
|
||||||
/**
|
|
||||||
* @brief column save number of column current selected cell
|
/** @brief column save number of column current selected cell */
|
||||||
*/
|
|
||||||
qint32 column;
|
qint32 column;
|
||||||
|
|
||||||
VIndividualMeasurements *m;
|
VIndividualMeasurements *m;
|
||||||
/**
|
|
||||||
* @brief FillMeasurements load measurements data
|
|
||||||
*/
|
|
||||||
void FillMeasurements();
|
void FillMeasurements();
|
||||||
/**
|
|
||||||
* @brief FillIncrementTable fill data for increment table
|
|
||||||
*/
|
|
||||||
void FillIncrements();
|
void FillIncrements();
|
||||||
/**
|
|
||||||
* @brief FillLengthLines fill data for table of lines lengths
|
|
||||||
*/
|
|
||||||
void FillLengthLines();
|
void FillLengthLines();
|
||||||
/**
|
|
||||||
* @brief FillLengthSplines fill data for table of splines lengths
|
|
||||||
*/
|
|
||||||
void FillLengthSplines();
|
void FillLengthSplines();
|
||||||
/**
|
|
||||||
* @brief FillLengthArcs fill data for table of arcs lengths
|
|
||||||
*/
|
|
||||||
void FillLengthArcs();
|
void FillLengthArcs();
|
||||||
/**
|
|
||||||
* @brief AddIncrementToFile save created increment to file
|
|
||||||
* @param id id of increment
|
|
||||||
* @param name name
|
|
||||||
* @param base base value
|
|
||||||
* @param ksize increment in sizes
|
|
||||||
* @param kheight increment in heights
|
|
||||||
* @param description description of increment
|
|
||||||
*/
|
|
||||||
void AddIncrementToFile(const quint32 &id, const QString &name, const qreal &base,
|
void AddIncrementToFile(const quint32 &id, const QString &name, const qreal &base,
|
||||||
const qreal &ksize, const qreal &kheight, const QString &description);
|
const qreal &ksize, const qreal &kheight, const QString &description);
|
||||||
};
|
};
|
||||||
|
|
|
@ -32,6 +32,11 @@
|
||||||
#include <QPushButton>
|
#include <QPushButton>
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief DialogAlongLine create dialog
|
||||||
|
* @param data container with data
|
||||||
|
* @param parent parent widget
|
||||||
|
*/
|
||||||
DialogAlongLine::DialogAlongLine(const VContainer *data, QWidget *parent)
|
DialogAlongLine::DialogAlongLine(const VContainer *data, QWidget *parent)
|
||||||
:DialogTool(data, parent), ui(new Ui::DialogAlongLine), number(0), pointName(QString()),
|
:DialogTool(data, parent), ui(new Ui::DialogAlongLine), number(0), pointName(QString()),
|
||||||
typeLine(QString()), formula(QString()), firstPointId(0), secondPointId(0)
|
typeLine(QString()), formula(QString()), firstPointId(0), secondPointId(0)
|
||||||
|
@ -67,6 +72,11 @@ DialogAlongLine::~DialogAlongLine()
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief ChoosedObject gets id and type of selected object. Save right data and ignore wrong.
|
||||||
|
* @param id id of point or detail
|
||||||
|
* @param type type of object
|
||||||
|
*/
|
||||||
void DialogAlongLine::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
void DialogAlongLine::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
||||||
{
|
{
|
||||||
if (type == Valentina::Point)
|
if (type == Valentina::Point)
|
||||||
|
@ -94,6 +104,9 @@ void DialogAlongLine::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief DialogAccepted save data and emit signal about closed dialog.
|
||||||
|
*/
|
||||||
void DialogAlongLine::DialogAccepted()
|
void DialogAlongLine::DialogAccepted()
|
||||||
{
|
{
|
||||||
pointName = ui->lineEditNamePoint->text();
|
pointName = ui->lineEditNamePoint->text();
|
||||||
|
@ -105,18 +118,32 @@ void DialogAlongLine::DialogAccepted()
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief setSecondPointId set id second point of line
|
||||||
|
* @param value id
|
||||||
|
* @param id id of current point
|
||||||
|
*/
|
||||||
void DialogAlongLine::setSecondPointId(const quint32 &value, const quint32 &id)
|
void DialogAlongLine::setSecondPointId(const quint32 &value, const quint32 &id)
|
||||||
{
|
{
|
||||||
setCurrentPointId(ui->comboBoxSecondPoint, secondPointId, value, id);
|
setCurrentPointId(ui->comboBoxSecondPoint, secondPointId, value, id);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief setFirstPointId set id first point of line
|
||||||
|
* @param value id
|
||||||
|
* @param id id of current point
|
||||||
|
*/
|
||||||
void DialogAlongLine::setFirstPointId(const quint32 &value, const quint32 &id)
|
void DialogAlongLine::setFirstPointId(const quint32 &value, const quint32 &id)
|
||||||
{
|
{
|
||||||
setCurrentPointId(ui->comboBoxFirstPoint, firstPointId, value, id);
|
setCurrentPointId(ui->comboBoxFirstPoint, firstPointId, value, id);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief setFormula set string of formula
|
||||||
|
* @param value formula
|
||||||
|
*/
|
||||||
void DialogAlongLine::setFormula(const QString &value)
|
void DialogAlongLine::setFormula(const QString &value)
|
||||||
{
|
{
|
||||||
formula = qApp->FormulaToUser(value);
|
formula = qApp->FormulaToUser(value);
|
||||||
|
@ -124,6 +151,10 @@ void DialogAlongLine::setFormula(const QString &value)
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief setTypeLine set type of line
|
||||||
|
* @param value type
|
||||||
|
*/
|
||||||
void DialogAlongLine::setTypeLine(const QString &value)
|
void DialogAlongLine::setTypeLine(const QString &value)
|
||||||
{
|
{
|
||||||
typeLine = value;
|
typeLine = value;
|
||||||
|
@ -131,6 +162,10 @@ void DialogAlongLine::setTypeLine(const QString &value)
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief setPointName set name of point
|
||||||
|
* @param value name
|
||||||
|
*/
|
||||||
void DialogAlongLine::setPointName(const QString &value)
|
void DialogAlongLine::setPointName(const QString &value)
|
||||||
{
|
{
|
||||||
pointName = value;
|
pointName = value;
|
||||||
|
|
|
@ -43,128 +43,95 @@ class DialogAlongLine : public DialogTool
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
/**
|
|
||||||
* @brief DialogAlongLine create dialog
|
|
||||||
* @param data container with data
|
|
||||||
* @param parent parent widget
|
|
||||||
*/
|
|
||||||
DialogAlongLine(const VContainer *data, QWidget *parent = nullptr);
|
DialogAlongLine(const VContainer *data, QWidget *parent = nullptr);
|
||||||
~DialogAlongLine();
|
~DialogAlongLine();
|
||||||
/**
|
|
||||||
* @brief getPointName return name of point
|
|
||||||
* @return name
|
|
||||||
*/
|
|
||||||
QString getPointName() const;
|
QString getPointName() const;
|
||||||
/**
|
|
||||||
* @brief setPointName set name of point
|
|
||||||
* @param value name
|
|
||||||
*/
|
|
||||||
void setPointName(const QString &value);
|
void setPointName(const QString &value);
|
||||||
/**
|
|
||||||
* @brief getTypeLine return type of line
|
|
||||||
* @return type
|
|
||||||
*/
|
|
||||||
QString getTypeLine() const;
|
QString getTypeLine() const;
|
||||||
/**
|
|
||||||
* @brief setTypeLine set type of line
|
|
||||||
* @param value type
|
|
||||||
*/
|
|
||||||
void setTypeLine(const QString &value);
|
void setTypeLine(const QString &value);
|
||||||
/**
|
|
||||||
* @brief getFormula return string of formula
|
|
||||||
* @return formula
|
|
||||||
*/
|
|
||||||
QString getFormula() const;
|
QString getFormula() const;
|
||||||
/**
|
|
||||||
* @brief setFormula set string of formula
|
|
||||||
* @param value formula
|
|
||||||
*/
|
|
||||||
void setFormula(const QString &value);
|
void setFormula(const QString &value);
|
||||||
/**
|
|
||||||
* @brief getFirstPointId return id first point of line
|
|
||||||
* @return id
|
|
||||||
*/
|
|
||||||
quint32 getFirstPointId() const;
|
quint32 getFirstPointId() const;
|
||||||
/**
|
|
||||||
* @brief setFirstPointId set id first point of line
|
|
||||||
* @param value id
|
|
||||||
* @param id id of current point
|
|
||||||
*/
|
|
||||||
void setFirstPointId(const quint32 &value, const quint32 &id);
|
void setFirstPointId(const quint32 &value, const quint32 &id);
|
||||||
/**
|
|
||||||
* @brief getSecondPointId return id second point of line
|
|
||||||
* @return id
|
|
||||||
*/
|
|
||||||
quint32 getSecondPointId() const;
|
quint32 getSecondPointId() const;
|
||||||
/**
|
|
||||||
* @brief setSecondPointId set id second point of line
|
|
||||||
* @param value id
|
|
||||||
* @param id id of current point
|
|
||||||
*/
|
|
||||||
void setSecondPointId(const quint32 &value, const quint32 &id);
|
void setSecondPointId(const quint32 &value, const quint32 &id);
|
||||||
public slots:
|
public slots:
|
||||||
/**
|
|
||||||
* @brief ChoosedObject gets id and type of selected object. Save right data and ignore wrong.
|
|
||||||
* @param id id of point or detail
|
|
||||||
* @param type type of object
|
|
||||||
*/
|
|
||||||
virtual void ChoosedObject(quint32 id, const Valentina::Scenes &type);
|
virtual void ChoosedObject(quint32 id, const Valentina::Scenes &type);
|
||||||
/**
|
|
||||||
* @brief DialogAccepted save data and emit signal about closed dialog.
|
|
||||||
*/
|
|
||||||
virtual void DialogAccepted();
|
virtual void DialogAccepted();
|
||||||
private:
|
private:
|
||||||
Q_DISABLE_COPY(DialogAlongLine)
|
Q_DISABLE_COPY(DialogAlongLine)
|
||||||
/**
|
|
||||||
* @brief ui keeps information about user interface
|
/** @brief ui keeps information about user interface */
|
||||||
*/
|
|
||||||
Ui::DialogAlongLine *ui;
|
Ui::DialogAlongLine *ui;
|
||||||
/**
|
|
||||||
* @brief number number of handled objects
|
/** @brief number number of handled objects */
|
||||||
*/
|
|
||||||
qint32 number;
|
qint32 number;
|
||||||
/**
|
|
||||||
* @brief pointName name of point
|
/** @brief pointName name of point */
|
||||||
*/
|
|
||||||
QString pointName;
|
QString pointName;
|
||||||
/**
|
|
||||||
* @brief typeLine type of line
|
/** @brief typeLine type of line */
|
||||||
*/
|
|
||||||
QString typeLine;
|
QString typeLine;
|
||||||
/**
|
|
||||||
* @brief formula formula
|
/** @brief formula formula */
|
||||||
*/
|
|
||||||
QString formula;
|
QString formula;
|
||||||
/**
|
|
||||||
* @brief firstPointId id first point of line
|
/** @brief firstPointId id first point of line */
|
||||||
*/
|
|
||||||
quint32 firstPointId;
|
quint32 firstPointId;
|
||||||
/**
|
|
||||||
* @brief secondPointId id second point of line
|
/** @brief secondPointId id second point of line */
|
||||||
*/
|
|
||||||
quint32 secondPointId;
|
quint32 secondPointId;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief getPointName return name of point
|
||||||
|
* @return name
|
||||||
|
*/
|
||||||
inline QString DialogAlongLine::getPointName() const
|
inline QString DialogAlongLine::getPointName() const
|
||||||
{
|
{
|
||||||
return pointName;
|
return pointName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief getTypeLine return type of line
|
||||||
|
* @return type
|
||||||
|
*/
|
||||||
inline QString DialogAlongLine::getTypeLine() const
|
inline QString DialogAlongLine::getTypeLine() const
|
||||||
{
|
{
|
||||||
return typeLine;
|
return typeLine;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief getFormula return string of formula
|
||||||
|
* @return formula
|
||||||
|
*/
|
||||||
inline QString DialogAlongLine::getFormula() const
|
inline QString DialogAlongLine::getFormula() const
|
||||||
{
|
{
|
||||||
return qApp->FormulaFromUser(formula);
|
return qApp->FormulaFromUser(formula);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief getFirstPointId return id first point of line
|
||||||
|
* @return id
|
||||||
|
*/
|
||||||
inline quint32 DialogAlongLine::getFirstPointId() const
|
inline quint32 DialogAlongLine::getFirstPointId() const
|
||||||
{
|
{
|
||||||
return firstPointId;
|
return firstPointId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief getSecondPointId return id second point of line
|
||||||
|
* @return id
|
||||||
|
*/
|
||||||
inline quint32 DialogAlongLine::getSecondPointId() const
|
inline quint32 DialogAlongLine::getSecondPointId() const
|
||||||
{
|
{
|
||||||
return secondPointId;
|
return secondPointId;
|
||||||
|
|
|
@ -33,6 +33,11 @@
|
||||||
#include <QtWidgets>
|
#include <QtWidgets>
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief DialogArc create dialog
|
||||||
|
* @param data container with data
|
||||||
|
* @param parent parent widget
|
||||||
|
*/
|
||||||
DialogArc::DialogArc(const VContainer *data, QWidget *parent)
|
DialogArc::DialogArc(const VContainer *data, QWidget *parent)
|
||||||
:DialogTool(data, parent), ui(new Ui::DialogArc), flagRadius(false), flagF1(false), flagF2(false),
|
:DialogTool(data, parent), ui(new Ui::DialogArc), flagRadius(false), flagF1(false), flagF2(false),
|
||||||
timerRadius(nullptr), timerF1(nullptr), timerF2(nullptr), center(0), radius(QString()), f1(QString()), f2(QString())
|
timerRadius(nullptr), timerF1(nullptr), timerF2(nullptr), center(0), radius(QString()), f1(QString()), f2(QString())
|
||||||
|
@ -76,6 +81,10 @@ DialogArc::~DialogArc()
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief SetCenter set id of center point
|
||||||
|
* @param value id
|
||||||
|
*/
|
||||||
void DialogArc::SetCenter(const quint32 &value)
|
void DialogArc::SetCenter(const quint32 &value)
|
||||||
{
|
{
|
||||||
center = value;
|
center = value;
|
||||||
|
@ -83,6 +92,10 @@ void DialogArc::SetCenter(const quint32 &value)
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief SetF2 set formula second angle of arc
|
||||||
|
* @param value formula
|
||||||
|
*/
|
||||||
void DialogArc::SetF2(const QString &value)
|
void DialogArc::SetF2(const QString &value)
|
||||||
{
|
{
|
||||||
f2 = value;
|
f2 = value;
|
||||||
|
@ -90,6 +103,10 @@ void DialogArc::SetF2(const QString &value)
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief SetF1 set formula first angle of arc
|
||||||
|
* @param value formula
|
||||||
|
*/
|
||||||
void DialogArc::SetF1(const QString &value)
|
void DialogArc::SetF1(const QString &value)
|
||||||
{
|
{
|
||||||
f1 = value;
|
f1 = value;
|
||||||
|
@ -97,6 +114,10 @@ void DialogArc::SetF1(const QString &value)
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief SetRadius set formula of radius
|
||||||
|
* @param value formula
|
||||||
|
*/
|
||||||
void DialogArc::SetRadius(const QString &value)
|
void DialogArc::SetRadius(const QString &value)
|
||||||
{
|
{
|
||||||
radius = value;
|
radius = value;
|
||||||
|
@ -104,6 +125,11 @@ void DialogArc::SetRadius(const QString &value)
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief ChoosedObject gets id and type of selected object. Save right data and ignore wrong.
|
||||||
|
* @param id id of point or detail
|
||||||
|
* @param type type of object
|
||||||
|
*/
|
||||||
void DialogArc::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
void DialogArc::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
||||||
{
|
{
|
||||||
if (type == Valentina::Point)
|
if (type == Valentina::Point)
|
||||||
|
@ -117,6 +143,9 @@ void DialogArc::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief DialogAccepted save data and emit signal about closed dialog.
|
||||||
|
*/
|
||||||
void DialogArc::DialogAccepted()
|
void DialogArc::DialogAccepted()
|
||||||
{
|
{
|
||||||
radius = ui->lineEditRadius->text();
|
radius = ui->lineEditRadius->text();
|
||||||
|
@ -127,6 +156,10 @@ void DialogArc::DialogAccepted()
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief ValChenged show description angles of lines
|
||||||
|
* @param row number of row
|
||||||
|
*/
|
||||||
void DialogArc::ValChenged(int row)
|
void DialogArc::ValChenged(int row)
|
||||||
{
|
{
|
||||||
if (ui->listWidget->count() == 0)
|
if (ui->listWidget->count() == 0)
|
||||||
|
@ -145,24 +178,36 @@ void DialogArc::ValChenged(int row)
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief PutRadius put variable into formula of radius
|
||||||
|
*/
|
||||||
void DialogArc::PutRadius()
|
void DialogArc::PutRadius()
|
||||||
{
|
{
|
||||||
PutValHere(ui->lineEditRadius, ui->listWidget);
|
PutValHere(ui->lineEditRadius, ui->listWidget);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief PutF1 put variable into formula of first angle
|
||||||
|
*/
|
||||||
void DialogArc::PutF1()
|
void DialogArc::PutF1()
|
||||||
{
|
{
|
||||||
PutValHere(ui->lineEditF1, ui->listWidget);
|
PutValHere(ui->lineEditF1, ui->listWidget);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief PutF2 put variable into formula of second angle
|
||||||
|
*/
|
||||||
void DialogArc::PutF2()
|
void DialogArc::PutF2()
|
||||||
{
|
{
|
||||||
PutValHere(ui->lineEditF2, ui->listWidget);
|
PutValHere(ui->lineEditF2, ui->listWidget);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief LineAngles show variable angles of lines
|
||||||
|
*/
|
||||||
// cppcheck-suppress unusedFunction
|
// cppcheck-suppress unusedFunction
|
||||||
void DialogArc::LineAngles()
|
void DialogArc::LineAngles()
|
||||||
{
|
{
|
||||||
|
@ -170,6 +215,9 @@ void DialogArc::LineAngles()
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief RadiusChanged after change formula of radius calculate value and show result
|
||||||
|
*/
|
||||||
void DialogArc::RadiusChanged()
|
void DialogArc::RadiusChanged()
|
||||||
{
|
{
|
||||||
labelEditFormula = ui->labelEditRadius;
|
labelEditFormula = ui->labelEditRadius;
|
||||||
|
@ -177,6 +225,9 @@ void DialogArc::RadiusChanged()
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief F1Changed after change formula of first angle calculate value and show result
|
||||||
|
*/
|
||||||
void DialogArc::F1Changed()
|
void DialogArc::F1Changed()
|
||||||
{
|
{
|
||||||
labelEditFormula = ui->labelEditF1;
|
labelEditFormula = ui->labelEditF1;
|
||||||
|
@ -184,6 +235,9 @@ void DialogArc::F1Changed()
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief F2Changed after change formula of second angle calculate value and show result
|
||||||
|
*/
|
||||||
void DialogArc::F2Changed()
|
void DialogArc::F2Changed()
|
||||||
{
|
{
|
||||||
labelEditFormula = ui->labelEditF2;
|
labelEditFormula = ui->labelEditF2;
|
||||||
|
@ -191,6 +245,9 @@ void DialogArc::F2Changed()
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief CheckState if all is right enable button ok
|
||||||
|
*/
|
||||||
void DialogArc::CheckState()
|
void DialogArc::CheckState()
|
||||||
{
|
{
|
||||||
Q_CHECK_PTR(bOk);
|
Q_CHECK_PTR(bOk);
|
||||||
|
@ -198,6 +255,9 @@ void DialogArc::CheckState()
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief EvalRadius calculate value of radius
|
||||||
|
*/
|
||||||
void DialogArc::EvalRadius()
|
void DialogArc::EvalRadius()
|
||||||
{
|
{
|
||||||
labelEditFormula = ui->labelEditRadius;
|
labelEditFormula = ui->labelEditRadius;
|
||||||
|
@ -205,6 +265,9 @@ void DialogArc::EvalRadius()
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief EvalF1 calculate value of first angle
|
||||||
|
*/
|
||||||
void DialogArc::EvalF1()
|
void DialogArc::EvalF1()
|
||||||
{
|
{
|
||||||
labelEditFormula = ui->labelEditF1;
|
labelEditFormula = ui->labelEditF1;
|
||||||
|
@ -212,6 +275,9 @@ void DialogArc::EvalF1()
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief EvalF2 calculate value of second angle
|
||||||
|
*/
|
||||||
void DialogArc::EvalF2()
|
void DialogArc::EvalF2()
|
||||||
{
|
{
|
||||||
labelEditFormula = ui->labelEditF2;
|
labelEditFormula = ui->labelEditF2;
|
||||||
|
@ -219,6 +285,9 @@ void DialogArc::EvalF2()
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief ShowLineAngles show varibles angles of lines
|
||||||
|
*/
|
||||||
void DialogArc::ShowLineAngles()
|
void DialogArc::ShowLineAngles()
|
||||||
{
|
{
|
||||||
disconnect(ui->listWidget, &QListWidget::currentRowChanged, this, &DialogArc::ValChenged);
|
disconnect(ui->listWidget, &QListWidget::currentRowChanged, this, &DialogArc::ValChenged);
|
||||||
|
|
|
@ -43,182 +43,111 @@ class DialogArc : public DialogTool
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
/**
|
|
||||||
* @brief DialogArc create dialog
|
|
||||||
* @param data container with data
|
|
||||||
* @param parent parent widget
|
|
||||||
*/
|
|
||||||
DialogArc(const VContainer *data, QWidget *parent = nullptr);
|
DialogArc(const VContainer *data, QWidget *parent = nullptr);
|
||||||
~DialogArc();
|
~DialogArc();
|
||||||
/**
|
|
||||||
* @brief GetCenter return id of center point
|
|
||||||
* @return id id
|
|
||||||
*/
|
|
||||||
quint32 GetCenter() const;
|
quint32 GetCenter() const;
|
||||||
/**
|
|
||||||
* @brief SetCenter set id of center point
|
|
||||||
* @param value id
|
|
||||||
*/
|
|
||||||
void SetCenter(const quint32 &value);
|
void SetCenter(const quint32 &value);
|
||||||
/**
|
|
||||||
* @brief GetRadius return formula of radius
|
|
||||||
* @return formula
|
|
||||||
*/
|
|
||||||
QString GetRadius() const;
|
QString GetRadius() const;
|
||||||
/**
|
|
||||||
* @brief SetRadius set formula of radius
|
|
||||||
* @param value formula
|
|
||||||
*/
|
|
||||||
void SetRadius(const QString &value);
|
void SetRadius(const QString &value);
|
||||||
/**
|
|
||||||
* @brief GetF1 return formula first angle of arc
|
|
||||||
* @return formula
|
|
||||||
*/
|
|
||||||
QString GetF1() const;
|
QString GetF1() const;
|
||||||
/**
|
|
||||||
* @brief SetF1 set formula first angle of arc
|
|
||||||
* @param value formula
|
|
||||||
*/
|
|
||||||
void SetF1(const QString &value);
|
void SetF1(const QString &value);
|
||||||
/**
|
|
||||||
* @brief GetF2 return formula second angle of arc
|
|
||||||
* @return formula
|
|
||||||
*/
|
|
||||||
QString GetF2() const;
|
QString GetF2() const;
|
||||||
/**
|
|
||||||
* @brief SetF2 set formula second angle of arc
|
|
||||||
* @param value formula
|
|
||||||
*/
|
|
||||||
void SetF2(const QString &value);
|
void SetF2(const QString &value);
|
||||||
public slots:
|
public slots:
|
||||||
/**
|
|
||||||
* @brief ChoosedObject gets id and type of selected object. Save right data and ignore wrong.
|
|
||||||
* @param id id of point or detail
|
|
||||||
* @param type type of object
|
|
||||||
*/
|
|
||||||
virtual void ChoosedObject(quint32 id, const Valentina::Scenes &type);
|
virtual void ChoosedObject(quint32 id, const Valentina::Scenes &type);
|
||||||
/**
|
|
||||||
* @brief DialogAccepted save data and emit signal about closed dialog.
|
|
||||||
*/
|
|
||||||
virtual void DialogAccepted();
|
virtual void DialogAccepted();
|
||||||
/**
|
|
||||||
* @brief ValChenged show description angles of lines
|
|
||||||
* @param row number of row
|
|
||||||
*/
|
|
||||||
virtual void ValChenged(int row);
|
virtual void ValChenged(int row);
|
||||||
/**
|
|
||||||
* @brief PutRadius put variable into formula of radius
|
|
||||||
*/
|
|
||||||
void PutRadius();
|
void PutRadius();
|
||||||
/**
|
|
||||||
* @brief PutF1 put variable into formula of first angle
|
|
||||||
*/
|
|
||||||
void PutF1();
|
void PutF1();
|
||||||
/**
|
|
||||||
* @brief PutF2 put variable into formula of second angle
|
|
||||||
*/
|
|
||||||
void PutF2();
|
void PutF2();
|
||||||
/**
|
|
||||||
* @brief LineAngles show variable angles of lines
|
|
||||||
*/
|
|
||||||
// cppcheck-suppress unusedFunction
|
// cppcheck-suppress unusedFunction
|
||||||
void LineAngles();
|
void LineAngles();
|
||||||
/**
|
|
||||||
* @brief RadiusChanged after change formula of radius calculate value and show result
|
|
||||||
*/
|
|
||||||
void RadiusChanged();
|
void RadiusChanged();
|
||||||
/**
|
|
||||||
* @brief F1Changed after change formula of first angle calculate value and show result
|
|
||||||
*/
|
|
||||||
void F1Changed();
|
void F1Changed();
|
||||||
/**
|
|
||||||
* @brief F2Changed after change formula of second angle calculate value and show result
|
|
||||||
*/
|
|
||||||
void F2Changed();
|
void F2Changed();
|
||||||
protected:
|
protected:
|
||||||
/**
|
|
||||||
* @brief CheckState if all is right enable button ok
|
|
||||||
*/
|
|
||||||
virtual void CheckState();
|
virtual void CheckState();
|
||||||
private:
|
private:
|
||||||
Q_DISABLE_COPY(DialogArc)
|
Q_DISABLE_COPY(DialogArc)
|
||||||
/**
|
|
||||||
* @brief ui keeps information about user interface
|
/** @brief ui keeps information about user interface */
|
||||||
*/
|
|
||||||
Ui::DialogArc *ui;
|
Ui::DialogArc *ui;
|
||||||
/**
|
|
||||||
* @brief flagRadius true if value of radius is correct
|
/** @brief flagRadius true if value of radius is correct */
|
||||||
*/
|
|
||||||
bool flagRadius;
|
bool flagRadius;
|
||||||
/**
|
|
||||||
* @brief flagF1 true if value of first angle is correct
|
/** @brief flagF1 true if value of first angle is correct */
|
||||||
*/
|
|
||||||
bool flagF1;
|
bool flagF1;
|
||||||
/**
|
|
||||||
* @brief flagF2 true if value of second angle is correct
|
/** @brief flagF2 true if value of second angle is correct */
|
||||||
*/
|
|
||||||
bool flagF2;
|
bool flagF2;
|
||||||
/**
|
|
||||||
* @brief timerRadius timer of check formula of radius
|
/** @brief timerRadius timer of check formula of radius */
|
||||||
*/
|
|
||||||
QTimer *timerRadius;
|
QTimer *timerRadius;
|
||||||
/**
|
|
||||||
* @brief timerF1 timer of check formula of first angle
|
/** @brief timerF1 timer of check formula of first angle */
|
||||||
*/
|
|
||||||
QTimer *timerF1;
|
QTimer *timerF1;
|
||||||
/**
|
|
||||||
* @brief timerF2 timer of check formula of second angle
|
/** @brief timerF2 timer of check formula of second angle */
|
||||||
*/
|
|
||||||
QTimer *timerF2;
|
QTimer *timerF2;
|
||||||
/**
|
|
||||||
* @brief center id of center point
|
/** @brief center id of center point */
|
||||||
*/
|
|
||||||
quint32 center;
|
quint32 center;
|
||||||
/**
|
|
||||||
* @brief radius formula of radius
|
/** @brief radius formula of radius */
|
||||||
*/
|
|
||||||
QString radius;
|
QString radius;
|
||||||
/**
|
|
||||||
* @brief f1 formula of first angle
|
/** @brief f1 formula of first angle */
|
||||||
*/
|
|
||||||
QString f1;
|
QString f1;
|
||||||
/**
|
|
||||||
* @brief f2 formula of second angle
|
/** @brief f2 formula of second angle */
|
||||||
*/
|
|
||||||
QString f2;
|
QString f2;
|
||||||
/**
|
|
||||||
* @brief EvalRadius calculate value of radius
|
|
||||||
*/
|
|
||||||
void EvalRadius();
|
void EvalRadius();
|
||||||
/**
|
|
||||||
* @brief EvalF1 calculate value of first angle
|
|
||||||
*/
|
|
||||||
void EvalF1();
|
void EvalF1();
|
||||||
/**
|
|
||||||
* @brief EvalF2 calculate value of second angle
|
|
||||||
*/
|
|
||||||
void EvalF2();
|
void EvalF2();
|
||||||
/**
|
|
||||||
* @brief ShowLineAngles show varibles angles of lines
|
|
||||||
*/
|
|
||||||
void ShowLineAngles();
|
void ShowLineAngles();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief GetCenter return id of center point
|
||||||
|
* @return id id
|
||||||
|
*/
|
||||||
inline quint32 DialogArc::GetCenter() const
|
inline quint32 DialogArc::GetCenter() const
|
||||||
{
|
{
|
||||||
return center;
|
return center;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief GetRadius return formula of radius
|
||||||
|
* @return formula
|
||||||
|
*/
|
||||||
inline QString DialogArc::GetRadius() const
|
inline QString DialogArc::GetRadius() const
|
||||||
{
|
{
|
||||||
return radius;
|
return radius;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief GetF1 return formula first angle of arc
|
||||||
|
* @return formula
|
||||||
|
*/
|
||||||
inline QString DialogArc::GetF1() const
|
inline QString DialogArc::GetF1() const
|
||||||
{
|
{
|
||||||
return f1;
|
return f1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief GetF2 return formula second angle of arc
|
||||||
|
* @return formula
|
||||||
|
*/
|
||||||
inline QString DialogArc::GetF2() const
|
inline QString DialogArc::GetF2() const
|
||||||
{
|
{
|
||||||
return f2;
|
return f2;
|
||||||
|
|
|
@ -32,6 +32,11 @@
|
||||||
#include <QPushButton>
|
#include <QPushButton>
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief DialogBisector create dialog
|
||||||
|
* @param data container with data
|
||||||
|
* @param parent parent widget
|
||||||
|
*/
|
||||||
DialogBisector::DialogBisector(const VContainer *data, QWidget *parent)
|
DialogBisector::DialogBisector(const VContainer *data, QWidget *parent)
|
||||||
:DialogTool(data, parent), ui(new Ui::DialogBisector), number(0), pointName(QString()),
|
:DialogTool(data, parent), ui(new Ui::DialogBisector), number(0), pointName(QString()),
|
||||||
typeLine(QString()), formula(QString()), firstPointId(0), secondPointId(0), thirdPointId(0)
|
typeLine(QString()), formula(QString()), firstPointId(0), secondPointId(0), thirdPointId(0)
|
||||||
|
@ -67,6 +72,11 @@ DialogBisector::~DialogBisector()
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief ChoosedObject gets id and type of selected object. Save right data and ignore wrong.
|
||||||
|
* @param id id of point or detail
|
||||||
|
* @param type type of object
|
||||||
|
*/
|
||||||
void DialogBisector::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
void DialogBisector::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
||||||
{
|
{
|
||||||
if (type == Valentina::Point)
|
if (type == Valentina::Point)
|
||||||
|
@ -112,6 +122,10 @@ void DialogBisector::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief setPointName set name of point
|
||||||
|
* @param value name
|
||||||
|
*/
|
||||||
void DialogBisector::setPointName(const QString &value)
|
void DialogBisector::setPointName(const QString &value)
|
||||||
{
|
{
|
||||||
pointName = value;
|
pointName = value;
|
||||||
|
@ -119,6 +133,10 @@ void DialogBisector::setPointName(const QString &value)
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief setTypeLine set type of line
|
||||||
|
* @param value type
|
||||||
|
*/
|
||||||
void DialogBisector::setTypeLine(const QString &value)
|
void DialogBisector::setTypeLine(const QString &value)
|
||||||
{
|
{
|
||||||
typeLine = value;
|
typeLine = value;
|
||||||
|
@ -126,6 +144,10 @@ void DialogBisector::setTypeLine(const QString &value)
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief setFormula set string of formula
|
||||||
|
* @param value formula
|
||||||
|
*/
|
||||||
void DialogBisector::setFormula(const QString &value)
|
void DialogBisector::setFormula(const QString &value)
|
||||||
{
|
{
|
||||||
formula = qApp->FormulaToUser(value);
|
formula = qApp->FormulaToUser(value);
|
||||||
|
@ -133,24 +155,42 @@ void DialogBisector::setFormula(const QString &value)
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief setFirstPointId set id of first point
|
||||||
|
* @param value id
|
||||||
|
* @param id don't show this id in list
|
||||||
|
*/
|
||||||
void DialogBisector::setFirstPointId(const quint32 &value, const quint32 &id)
|
void DialogBisector::setFirstPointId(const quint32 &value, const quint32 &id)
|
||||||
{
|
{
|
||||||
setCurrentPointId(ui->comboBoxFirstPoint, firstPointId, value, id);
|
setCurrentPointId(ui->comboBoxFirstPoint, firstPointId, value, id);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief setSecondPointId set id of second point
|
||||||
|
* @param value id
|
||||||
|
* @param id don't show this id in list
|
||||||
|
*/
|
||||||
void DialogBisector::setSecondPointId(const quint32 &value, const quint32 &id)
|
void DialogBisector::setSecondPointId(const quint32 &value, const quint32 &id)
|
||||||
{
|
{
|
||||||
setCurrentPointId(ui->comboBoxSecondPoint, secondPointId, value, id);
|
setCurrentPointId(ui->comboBoxSecondPoint, secondPointId, value, id);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief setThirdPointId set id of third point
|
||||||
|
* @param value id
|
||||||
|
* @param id don't show this id in list
|
||||||
|
*/
|
||||||
void DialogBisector::setThirdPointId(const quint32 &value, const quint32 &id)
|
void DialogBisector::setThirdPointId(const quint32 &value, const quint32 &id)
|
||||||
{
|
{
|
||||||
setCurrentPointId(ui->comboBoxThirdPoint, thirdPointId, value, id);
|
setCurrentPointId(ui->comboBoxThirdPoint, thirdPointId, value, id);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief DialogAccepted save data and emit signal about closed dialog.
|
||||||
|
*/
|
||||||
void DialogBisector::DialogAccepted()
|
void DialogBisector::DialogAccepted()
|
||||||
{
|
{
|
||||||
pointName = ui->lineEditNamePoint->text();
|
pointName = ui->lineEditNamePoint->text();
|
||||||
|
|
|
@ -43,143 +43,113 @@ class DialogBisector : public DialogTool
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
/**
|
|
||||||
* @brief DialogBisector create dialog
|
|
||||||
* @param data container with data
|
|
||||||
* @param parent parent widget
|
|
||||||
*/
|
|
||||||
DialogBisector(const VContainer *data, QWidget *parent = nullptr);
|
DialogBisector(const VContainer *data, QWidget *parent = nullptr);
|
||||||
~DialogBisector();
|
~DialogBisector();
|
||||||
/**
|
|
||||||
* @brief getPointName return name of point
|
QString getPointName() const;
|
||||||
* @return name
|
|
||||||
*/
|
|
||||||
QString getPointName() const {return pointName;}
|
|
||||||
/**
|
|
||||||
* @brief setPointName set name of point
|
|
||||||
* @param value name
|
|
||||||
*/
|
|
||||||
void setPointName(const QString &value);
|
void setPointName(const QString &value);
|
||||||
/**
|
|
||||||
* @brief getTypeLine return type of line
|
|
||||||
* @return type
|
|
||||||
*/
|
|
||||||
QString getTypeLine() const;
|
QString getTypeLine() const;
|
||||||
/**
|
|
||||||
* @brief setTypeLine set type of line
|
|
||||||
* @param value type
|
|
||||||
*/
|
|
||||||
void setTypeLine(const QString &value);
|
void setTypeLine(const QString &value);
|
||||||
/**
|
|
||||||
* @brief getFormula return string of formula
|
|
||||||
* @return formula
|
|
||||||
*/
|
|
||||||
QString getFormula() const;
|
QString getFormula() const;
|
||||||
/**
|
|
||||||
* @brief setFormula set string of formula
|
|
||||||
* @param value formula
|
|
||||||
*/
|
|
||||||
void setFormula(const QString &value);
|
void setFormula(const QString &value);
|
||||||
/**
|
|
||||||
* @brief getFirstPointId return id of first point
|
|
||||||
* @return id
|
|
||||||
*/
|
|
||||||
quint32 getFirstPointId() const;
|
quint32 getFirstPointId() const;
|
||||||
/**
|
|
||||||
* @brief setFirstPointId set id of first point
|
|
||||||
* @param value id
|
|
||||||
* @param id don't show this id in list
|
|
||||||
*/
|
|
||||||
void setFirstPointId(const quint32 &value, const quint32 &id);
|
void setFirstPointId(const quint32 &value, const quint32 &id);
|
||||||
/**
|
|
||||||
* @brief getSecondPointId return id of second point
|
|
||||||
* @return id
|
|
||||||
*/
|
|
||||||
quint32 getSecondPointId() const;
|
quint32 getSecondPointId() const;
|
||||||
/**
|
|
||||||
* @brief setSecondPointId set id of second point
|
|
||||||
* @param value id
|
|
||||||
* @param id don't show this id in list
|
|
||||||
*/
|
|
||||||
void setSecondPointId(const quint32 &value, const quint32 &id);
|
void setSecondPointId(const quint32 &value, const quint32 &id);
|
||||||
/**
|
|
||||||
* @brief getThirdPointId return id of third point
|
|
||||||
* @return id
|
|
||||||
*/
|
|
||||||
quint32 getThirdPointId() const;
|
quint32 getThirdPointId() const;
|
||||||
/**
|
|
||||||
* @brief setThirdPointId set id of third point
|
|
||||||
* @param value id
|
|
||||||
* @param id don't show this id in list
|
|
||||||
*/
|
|
||||||
void setThirdPointId(const quint32 &value, const quint32 &id);
|
void setThirdPointId(const quint32 &value, const quint32 &id);
|
||||||
public slots:
|
public slots:
|
||||||
/**
|
|
||||||
* @brief ChoosedObject gets id and type of selected object. Save right data and ignore wrong.
|
|
||||||
* @param id id of point or detail
|
|
||||||
* @param type type of object
|
|
||||||
*/
|
|
||||||
virtual void ChoosedObject(quint32 id, const Valentina::Scenes &type);
|
virtual void ChoosedObject(quint32 id, const Valentina::Scenes &type);
|
||||||
/**
|
|
||||||
* @brief DialogAccepted save data and emit signal about closed dialog.
|
|
||||||
*/
|
|
||||||
virtual void DialogAccepted();
|
virtual void DialogAccepted();
|
||||||
private:
|
private:
|
||||||
Q_DISABLE_COPY(DialogBisector)
|
Q_DISABLE_COPY(DialogBisector)
|
||||||
/**
|
|
||||||
* @brief ui keeps information about user interface
|
/** @brief ui keeps information about user interface */
|
||||||
*/
|
|
||||||
Ui::DialogBisector *ui;
|
Ui::DialogBisector *ui;
|
||||||
/**
|
|
||||||
* @brief number number of handled objects
|
/** @brief number number of handled objects */
|
||||||
*/
|
|
||||||
qint32 number;
|
qint32 number;
|
||||||
/**
|
|
||||||
* @brief pointName name of point
|
/** @brief pointName name of point */
|
||||||
*/
|
|
||||||
QString pointName;
|
QString pointName;
|
||||||
/**
|
|
||||||
* @brief typeLine type of line
|
/** @brief typeLine type of line */
|
||||||
*/
|
|
||||||
QString typeLine;
|
QString typeLine;
|
||||||
/**
|
|
||||||
* @brief formula formula
|
/** @brief formula formula */
|
||||||
*/
|
|
||||||
QString formula;
|
QString formula;
|
||||||
/**
|
|
||||||
* @brief firstPointId id of first point
|
/** @brief firstPointId id of first point */
|
||||||
*/
|
|
||||||
quint32 firstPointId;
|
quint32 firstPointId;
|
||||||
/**
|
|
||||||
* @brief secondPointId id of second point
|
/** @brief secondPointId id of second point */
|
||||||
*/
|
|
||||||
quint32 secondPointId;
|
quint32 secondPointId;
|
||||||
/**
|
|
||||||
* @brief thirdPointId id of third point
|
/** @brief thirdPointId id of third point */
|
||||||
*/
|
|
||||||
quint32 thirdPointId;
|
quint32 thirdPointId;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief getPointName return name of point
|
||||||
|
* @return name
|
||||||
|
*/
|
||||||
|
inline QString DialogBisector::getPointName() const
|
||||||
|
{
|
||||||
|
return pointName;
|
||||||
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief getTypeLine return type of line
|
||||||
|
* @return type
|
||||||
|
*/
|
||||||
inline QString DialogBisector::getTypeLine() const
|
inline QString DialogBisector::getTypeLine() const
|
||||||
{
|
{
|
||||||
return typeLine;
|
return typeLine;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief getFormula return string of formula
|
||||||
|
* @return formula
|
||||||
|
*/
|
||||||
inline QString DialogBisector::getFormula() const
|
inline QString DialogBisector::getFormula() const
|
||||||
{
|
{
|
||||||
return qApp->FormulaFromUser(formula);
|
return qApp->FormulaFromUser(formula);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief getFirstPointId return id of first point
|
||||||
|
* @return id
|
||||||
|
*/
|
||||||
inline quint32 DialogBisector::getFirstPointId() const
|
inline quint32 DialogBisector::getFirstPointId() const
|
||||||
{
|
{
|
||||||
return firstPointId;
|
return firstPointId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief getSecondPointId return id of second point
|
||||||
|
* @return id
|
||||||
|
*/
|
||||||
inline quint32 DialogBisector::getSecondPointId() const
|
inline quint32 DialogBisector::getSecondPointId() const
|
||||||
{
|
{
|
||||||
return secondPointId;
|
return secondPointId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief getThirdPointId return id of third point
|
||||||
|
* @return id
|
||||||
|
*/
|
||||||
inline quint32 DialogBisector::getThirdPointId() const
|
inline quint32 DialogBisector::getThirdPointId() const
|
||||||
{
|
{
|
||||||
return thirdPointId;
|
return thirdPointId;
|
||||||
|
|
|
@ -43,13 +43,15 @@ class DialogCutArc : public DialogTool
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
|
|
||||||
DialogCutArc(const VContainer *data, QWidget *parent = nullptr);
|
DialogCutArc(const VContainer *data, QWidget *parent = nullptr);
|
||||||
~DialogCutArc();
|
~DialogCutArc();
|
||||||
|
|
||||||
QString getPointName() const;
|
QString getPointName() const;
|
||||||
void setPointName(const QString &value);
|
void setPointName(const QString &value);
|
||||||
|
|
||||||
QString getFormula() const;
|
QString getFormula() const;
|
||||||
void setFormula(const QString &value);
|
void setFormula(const QString &value);
|
||||||
|
|
||||||
quint32 getArcId() const;
|
quint32 getArcId() const;
|
||||||
void setArcId(const quint32 &value, const quint32 &id);
|
void setArcId(const quint32 &value, const quint32 &id);
|
||||||
public slots:
|
public slots:
|
||||||
|
@ -57,21 +59,16 @@ public slots:
|
||||||
virtual void DialogAccepted();
|
virtual void DialogAccepted();
|
||||||
private:
|
private:
|
||||||
Q_DISABLE_COPY(DialogCutArc)
|
Q_DISABLE_COPY(DialogCutArc)
|
||||||
/**
|
/** @brief ui keeps information about user interface */
|
||||||
* @brief ui keeps information about user interface
|
|
||||||
*/
|
|
||||||
Ui::DialogCutArc *ui;
|
Ui::DialogCutArc *ui;
|
||||||
/**
|
|
||||||
* @brief pointName name of created point
|
/** @brief pointName name of created point */
|
||||||
*/
|
|
||||||
QString pointName;
|
QString pointName;
|
||||||
/**
|
|
||||||
* @brief formula string with formula
|
/** @brief formula string with formula */
|
||||||
*/
|
|
||||||
QString formula;
|
QString formula;
|
||||||
/**
|
|
||||||
* @brief arcId keep id of arc
|
/** @brief arcId keep id of arc */
|
||||||
*/
|
|
||||||
quint32 arcId;
|
quint32 arcId;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -30,6 +30,11 @@
|
||||||
#include "ui_dialogcutspline.h"
|
#include "ui_dialogcutspline.h"
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief DialogCutSpline create dialog.
|
||||||
|
* @param data container with data
|
||||||
|
* @param parent parent widget
|
||||||
|
*/
|
||||||
DialogCutSpline::DialogCutSpline(const VContainer *data, QWidget *parent)
|
DialogCutSpline::DialogCutSpline(const VContainer *data, QWidget *parent)
|
||||||
:DialogTool(data, parent), ui(new Ui::DialogCutSpline), pointName(QString()), formula(QString()), splineId(0)
|
:DialogTool(data, parent), ui(new Ui::DialogCutSpline), pointName(QString()), formula(QString()), splineId(0)
|
||||||
{
|
{
|
||||||
|
@ -61,6 +66,10 @@ DialogCutSpline::~DialogCutSpline()
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief setPointName set name of point
|
||||||
|
* @param value name
|
||||||
|
*/
|
||||||
void DialogCutSpline::setPointName(const QString &value)
|
void DialogCutSpline::setPointName(const QString &value)
|
||||||
{
|
{
|
||||||
pointName = value;
|
pointName = value;
|
||||||
|
@ -68,6 +77,10 @@ void DialogCutSpline::setPointName(const QString &value)
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief setFormula set string of formula
|
||||||
|
* @param value formula
|
||||||
|
*/
|
||||||
void DialogCutSpline::setFormula(const QString &value)
|
void DialogCutSpline::setFormula(const QString &value)
|
||||||
{
|
{
|
||||||
formula = qApp->FormulaToUser(value);
|
formula = qApp->FormulaToUser(value);
|
||||||
|
@ -75,12 +88,22 @@ void DialogCutSpline::setFormula(const QString &value)
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief setSplineId set id spline
|
||||||
|
* @param value id
|
||||||
|
* @param id don't show this id in list
|
||||||
|
*/
|
||||||
void DialogCutSpline::setSplineId(const quint32 &value, const quint32 &id)
|
void DialogCutSpline::setSplineId(const quint32 &value, const quint32 &id)
|
||||||
{
|
{
|
||||||
setCurrentSplineId(ui->comboBoxSpline, splineId, value, id, ComboMode::CutSpline);
|
setCurrentSplineId(ui->comboBoxSpline, splineId, value, id, ComboMode::CutSpline);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief ChoosedObject gets id and type of selected object. Save right data and ignore wrong.
|
||||||
|
* @param id id of point or detail
|
||||||
|
* @param type type of object
|
||||||
|
*/
|
||||||
void DialogCutSpline::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
void DialogCutSpline::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
||||||
{
|
{
|
||||||
if (type == Valentina::Spline)
|
if (type == Valentina::Spline)
|
||||||
|
@ -93,6 +116,9 @@ void DialogCutSpline::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief DialogAccepted save data and emit signal about closed dialog.
|
||||||
|
*/
|
||||||
void DialogCutSpline::DialogAccepted()
|
void DialogCutSpline::DialogAccepted()
|
||||||
{
|
{
|
||||||
pointName = ui->lineEditNamePoint->text();
|
pointName = ui->lineEditNamePoint->text();
|
||||||
|
|
|
@ -43,85 +43,61 @@ class DialogCutSpline : public DialogTool
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
/**
|
|
||||||
* @brief DialogCutSpline create dialog.
|
|
||||||
* @param data container with data
|
|
||||||
* @param parent parent widget
|
|
||||||
*/
|
|
||||||
DialogCutSpline(const VContainer *data, QWidget *parent = nullptr);
|
DialogCutSpline(const VContainer *data, QWidget *parent = nullptr);
|
||||||
~DialogCutSpline();
|
~DialogCutSpline();
|
||||||
/**
|
|
||||||
* @brief getPointName return name of point
|
|
||||||
* @return name
|
|
||||||
*/
|
|
||||||
QString getPointName() const;
|
QString getPointName() const;
|
||||||
/**
|
|
||||||
* @brief setPointName set name of point
|
|
||||||
* @param value name
|
|
||||||
*/
|
|
||||||
void setPointName(const QString &value);
|
void setPointName(const QString &value);
|
||||||
/**
|
|
||||||
* @brief getFormula return string of formula
|
|
||||||
* @return formula
|
|
||||||
*/
|
|
||||||
QString getFormula() const;
|
QString getFormula() const;
|
||||||
/**
|
|
||||||
* @brief setFormula set string of formula
|
|
||||||
* @param value formula
|
|
||||||
*/
|
|
||||||
void setFormula(const QString &value);
|
void setFormula(const QString &value);
|
||||||
/**
|
|
||||||
* @brief getSplineId return id base point of line
|
|
||||||
* @return id
|
|
||||||
*/
|
|
||||||
quint32 getSplineId() const;
|
quint32 getSplineId() const;
|
||||||
/**
|
|
||||||
* @brief setSplineId set id spline
|
|
||||||
* @param value id
|
|
||||||
* @param id don't show this id in list
|
|
||||||
*/
|
|
||||||
void setSplineId(const quint32 &value, const quint32 &id);
|
void setSplineId(const quint32 &value, const quint32 &id);
|
||||||
public slots:
|
public slots:
|
||||||
/**
|
|
||||||
* @brief ChoosedObject gets id and type of selected object. Save right data and ignore wrong.
|
|
||||||
* @param id id of point or detail
|
|
||||||
* @param type type of object
|
|
||||||
*/
|
|
||||||
virtual void ChoosedObject(quint32 id, const Valentina::Scenes &type);
|
virtual void ChoosedObject(quint32 id, const Valentina::Scenes &type);
|
||||||
/**
|
|
||||||
* @brief DialogAccepted save data and emit signal about closed dialog.
|
|
||||||
*/
|
|
||||||
virtual void DialogAccepted();
|
virtual void DialogAccepted();
|
||||||
private:
|
private:
|
||||||
Q_DISABLE_COPY(DialogCutSpline)
|
Q_DISABLE_COPY(DialogCutSpline)
|
||||||
/**
|
|
||||||
* @brief ui keeps information about user interface
|
/** @brief ui keeps information about user interface */
|
||||||
*/
|
|
||||||
Ui::DialogCutSpline *ui;
|
Ui::DialogCutSpline *ui;
|
||||||
/**
|
|
||||||
* @brief pointName name of created point
|
/** @brief pointName name of created point */
|
||||||
*/
|
|
||||||
QString pointName;
|
QString pointName;
|
||||||
/**
|
|
||||||
* @brief formula string with formula
|
/** @brief formula string with formula */
|
||||||
*/
|
|
||||||
QString formula;
|
QString formula;
|
||||||
/**
|
|
||||||
* @brief splineId keep id of spline
|
/** @brief splineId keep id of spline */
|
||||||
*/
|
|
||||||
quint32 splineId;
|
quint32 splineId;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief getPointName return name of point
|
||||||
|
* @return name
|
||||||
|
*/
|
||||||
inline QString DialogCutSpline::getPointName() const
|
inline QString DialogCutSpline::getPointName() const
|
||||||
{
|
{
|
||||||
return pointName;
|
return pointName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief getFormula return string of formula
|
||||||
|
* @return formula
|
||||||
|
*/
|
||||||
inline QString DialogCutSpline::getFormula() const
|
inline QString DialogCutSpline::getFormula() const
|
||||||
{
|
{
|
||||||
return qApp->FormulaFromUser(formula);
|
return qApp->FormulaFromUser(formula);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief getSplineId return id base point of line
|
||||||
|
* @return id
|
||||||
|
*/
|
||||||
inline quint32 DialogCutSpline::getSplineId() const
|
inline quint32 DialogCutSpline::getSplineId() const
|
||||||
{
|
{
|
||||||
return splineId;
|
return splineId;
|
||||||
|
|
|
@ -30,6 +30,11 @@
|
||||||
#include "ui_dialogcutsplinepath.h"
|
#include "ui_dialogcutsplinepath.h"
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief DialogCutSplinePath create dialog.
|
||||||
|
* @param data container with data
|
||||||
|
* @param parent parent widget
|
||||||
|
*/
|
||||||
DialogCutSplinePath::DialogCutSplinePath(const VContainer *data, QWidget *parent)
|
DialogCutSplinePath::DialogCutSplinePath(const VContainer *data, QWidget *parent)
|
||||||
:DialogTool(data, parent), ui(new Ui::DialogCutSplinePath), pointName(QString()), formula(QString()),
|
:DialogTool(data, parent), ui(new Ui::DialogCutSplinePath), pointName(QString()), formula(QString()),
|
||||||
splinePathId(0)
|
splinePathId(0)
|
||||||
|
@ -62,6 +67,10 @@ DialogCutSplinePath::~DialogCutSplinePath()
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief setPointName set name of point
|
||||||
|
* @param value name
|
||||||
|
*/
|
||||||
void DialogCutSplinePath::setPointName(const QString &value)
|
void DialogCutSplinePath::setPointName(const QString &value)
|
||||||
{
|
{
|
||||||
pointName = value;
|
pointName = value;
|
||||||
|
@ -69,6 +78,10 @@ void DialogCutSplinePath::setPointName(const QString &value)
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief setFormula set string of formula
|
||||||
|
* @param value formula
|
||||||
|
*/
|
||||||
void DialogCutSplinePath::setFormula(const QString &value)
|
void DialogCutSplinePath::setFormula(const QString &value)
|
||||||
{
|
{
|
||||||
formula = qApp->FormulaToUser(value);
|
formula = qApp->FormulaToUser(value);
|
||||||
|
@ -76,12 +89,22 @@ void DialogCutSplinePath::setFormula(const QString &value)
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief setSplineId set id spline
|
||||||
|
* @param value id
|
||||||
|
* @param id don't show this id in list
|
||||||
|
*/
|
||||||
void DialogCutSplinePath::setSplinePathId(const quint32 &value, const quint32 &id)
|
void DialogCutSplinePath::setSplinePathId(const quint32 &value, const quint32 &id)
|
||||||
{
|
{
|
||||||
setCurrentSplinePathId(ui->comboBoxSplinePath, splinePathId, value, id, ComboMode::CutSpline);
|
setCurrentSplinePathId(ui->comboBoxSplinePath, splinePathId, value, id, ComboMode::CutSpline);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief ChoosedObject gets id and type of selected object. Save right data and ignore wrong.
|
||||||
|
* @param id id of point or detail
|
||||||
|
* @param type type of object
|
||||||
|
*/
|
||||||
void DialogCutSplinePath::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
void DialogCutSplinePath::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
||||||
{
|
{
|
||||||
if (type == Valentina::SplinePath)
|
if (type == Valentina::SplinePath)
|
||||||
|
@ -94,6 +117,9 @@ void DialogCutSplinePath::ChoosedObject(quint32 id, const Valentina::Scenes &typ
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief DialogAccepted save data and emit signal about closed dialog.
|
||||||
|
*/
|
||||||
void DialogCutSplinePath::DialogAccepted()
|
void DialogCutSplinePath::DialogAccepted()
|
||||||
{
|
{
|
||||||
pointName = ui->lineEditNamePoint->text();
|
pointName = ui->lineEditNamePoint->text();
|
||||||
|
|
|
@ -43,85 +43,61 @@ class DialogCutSplinePath : public DialogTool
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
/**
|
|
||||||
* @brief DialogCutSplinePath create dialog.
|
|
||||||
* @param data container with data
|
|
||||||
* @param parent parent widget
|
|
||||||
*/
|
|
||||||
DialogCutSplinePath(const VContainer *data, QWidget *parent = nullptr);
|
DialogCutSplinePath(const VContainer *data, QWidget *parent = nullptr);
|
||||||
~DialogCutSplinePath();
|
~DialogCutSplinePath();
|
||||||
/**
|
|
||||||
* @brief getPointName return name of point
|
|
||||||
* @return name
|
|
||||||
*/
|
|
||||||
QString getPointName() const;
|
QString getPointName() const;
|
||||||
/**
|
|
||||||
* @brief setPointName set name of point
|
|
||||||
* @param value name
|
|
||||||
*/
|
|
||||||
void setPointName(const QString &value);
|
void setPointName(const QString &value);
|
||||||
/**
|
|
||||||
* @brief getFormula return string of formula
|
|
||||||
* @return formula
|
|
||||||
*/
|
|
||||||
QString getFormula() const;
|
QString getFormula() const;
|
||||||
/**
|
|
||||||
* @brief setFormula set string of formula
|
|
||||||
* @param value formula
|
|
||||||
*/
|
|
||||||
void setFormula(const QString &value);
|
void setFormula(const QString &value);
|
||||||
/**
|
|
||||||
* @brief getSplineId return id base point of line
|
|
||||||
* @return id
|
|
||||||
*/
|
|
||||||
quint32 getSplinePathId() const;
|
quint32 getSplinePathId() const;
|
||||||
/**
|
|
||||||
* @brief setSplineId set id spline
|
|
||||||
* @param value id
|
|
||||||
* @param id don't show this id in list
|
|
||||||
*/
|
|
||||||
void setSplinePathId(const quint32 &value, const quint32 &id);
|
void setSplinePathId(const quint32 &value, const quint32 &id);
|
||||||
public slots:
|
public slots:
|
||||||
/**
|
|
||||||
* @brief ChoosedObject gets id and type of selected object. Save right data and ignore wrong.
|
|
||||||
* @param id id of point or detail
|
|
||||||
* @param type type of object
|
|
||||||
*/
|
|
||||||
virtual void ChoosedObject(quint32 id, const Valentina::Scenes &type);
|
virtual void ChoosedObject(quint32 id, const Valentina::Scenes &type);
|
||||||
/**
|
|
||||||
* @brief DialogAccepted save data and emit signal about closed dialog.
|
|
||||||
*/
|
|
||||||
virtual void DialogAccepted();
|
virtual void DialogAccepted();
|
||||||
private:
|
private:
|
||||||
Q_DISABLE_COPY(DialogCutSplinePath)
|
Q_DISABLE_COPY(DialogCutSplinePath)
|
||||||
/**
|
|
||||||
* @brief ui keeps information about user interface
|
/** @brief ui keeps information about user interface */
|
||||||
*/
|
|
||||||
Ui::DialogCutSplinePath *ui;
|
Ui::DialogCutSplinePath *ui;
|
||||||
/**
|
|
||||||
* @brief pointName name of created point
|
/** @brief pointName name of created point */
|
||||||
*/
|
|
||||||
QString pointName;
|
QString pointName;
|
||||||
/**
|
|
||||||
* @brief formula string with formula
|
/** @brief formula string with formula */
|
||||||
*/
|
|
||||||
QString formula;
|
QString formula;
|
||||||
/**
|
|
||||||
* @brief splinePathId keep id of splinePath
|
/** @brief splinePathId keep id of splinePath */
|
||||||
*/
|
|
||||||
quint32 splinePathId;
|
quint32 splinePathId;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief getPointName return name of point
|
||||||
|
* @return name
|
||||||
|
*/
|
||||||
inline QString DialogCutSplinePath::getPointName() const
|
inline QString DialogCutSplinePath::getPointName() const
|
||||||
{
|
{
|
||||||
return pointName;
|
return pointName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief getFormula return string of formula
|
||||||
|
* @return formula
|
||||||
|
*/
|
||||||
inline QString DialogCutSplinePath::getFormula() const
|
inline QString DialogCutSplinePath::getFormula() const
|
||||||
{
|
{
|
||||||
return qApp->FormulaFromUser(formula);
|
return qApp->FormulaFromUser(formula);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief getSplineId return id base point of line
|
||||||
|
* @return id
|
||||||
|
*/
|
||||||
inline quint32 DialogCutSplinePath::getSplinePathId() const
|
inline quint32 DialogCutSplinePath::getSplinePathId() const
|
||||||
{
|
{
|
||||||
return splinePathId;
|
return splinePathId;
|
||||||
|
|
|
@ -32,6 +32,11 @@
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief DialogDetail create dialog
|
||||||
|
* @param data container with data
|
||||||
|
* @param parent parent widget
|
||||||
|
*/
|
||||||
DialogDetail::DialogDetail(const VContainer *data, QWidget *parent)
|
DialogDetail::DialogDetail(const VContainer *data, QWidget *parent)
|
||||||
:DialogTool(data, parent), ui(), details(VDetail()), supplement(true), closed(true)
|
:DialogTool(data, parent), ui(), details(VDetail()), supplement(true), closed(true)
|
||||||
{
|
{
|
||||||
|
@ -64,6 +69,11 @@ DialogDetail::DialogDetail(const VContainer *data, QWidget *parent)
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief ChoosedObject gets id and type of selected object. Save right data and ignore wrong.
|
||||||
|
* @param id id of objects (points, arcs, splines, spline paths)
|
||||||
|
* @param type type of object
|
||||||
|
*/
|
||||||
void DialogDetail::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
void DialogDetail::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
||||||
{
|
{
|
||||||
if (type != Valentina::Line && type != Valentina::Detail)
|
if (type != Valentina::Line && type != Valentina::Detail)
|
||||||
|
@ -92,6 +102,9 @@ void DialogDetail::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief DialogAccepted save data and emit signal about closed dialog.
|
||||||
|
*/
|
||||||
void DialogDetail::DialogAccepted()
|
void DialogDetail::DialogAccepted()
|
||||||
{
|
{
|
||||||
details.Clear();
|
details.Clear();
|
||||||
|
@ -109,6 +122,14 @@ void DialogDetail::DialogAccepted()
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief NewItem add new object (point, arc, spline or spline path) to list
|
||||||
|
* @param id id of object
|
||||||
|
* @param typeTool type of tool
|
||||||
|
* @param typeNode type of node in detail
|
||||||
|
* @param mx offset respect to x
|
||||||
|
* @param my offset respect to y
|
||||||
|
*/
|
||||||
void DialogDetail::NewItem(quint32 id, const Valentina::Tools &typeTool, const NodeDetail::NodeDetails &typeNode,
|
void DialogDetail::NewItem(quint32 id, const Valentina::Tools &typeTool, const NodeDetail::NodeDetails &typeNode,
|
||||||
qreal mx, qreal my)
|
qreal mx, qreal my)
|
||||||
{
|
{
|
||||||
|
@ -163,6 +184,10 @@ void DialogDetail::NewItem(quint32 id, const Valentina::Tools &typeTool, const N
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief setDetails set detail
|
||||||
|
* @param value detail
|
||||||
|
*/
|
||||||
void DialogDetail::setDetails(const VDetail &value)
|
void DialogDetail::setDetails(const VDetail &value)
|
||||||
{
|
{
|
||||||
details = value;
|
details = value;
|
||||||
|
@ -184,6 +209,10 @@ void DialogDetail::setDetails(const VDetail &value)
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief BiasXChanged changed value of offset for object respect to x
|
||||||
|
* @param d value in mm
|
||||||
|
*/
|
||||||
void DialogDetail::BiasXChanged(qreal d)
|
void DialogDetail::BiasXChanged(qreal d)
|
||||||
{
|
{
|
||||||
qint32 row = ui.listWidget->currentRow();
|
qint32 row = ui.listWidget->currentRow();
|
||||||
|
@ -195,6 +224,10 @@ void DialogDetail::BiasXChanged(qreal d)
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief BiasYChanged changed value of offset for object respect to y
|
||||||
|
* @param d value in mm
|
||||||
|
*/
|
||||||
void DialogDetail::BiasYChanged(qreal d)
|
void DialogDetail::BiasYChanged(qreal d)
|
||||||
{
|
{
|
||||||
qint32 row = ui.listWidget->currentRow();
|
qint32 row = ui.listWidget->currentRow();
|
||||||
|
@ -206,6 +239,10 @@ void DialogDetail::BiasYChanged(qreal d)
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief ClickedSeams save supplement of seams for detail
|
||||||
|
* @param checked 1 - need supplement, 0 - don't need supplement
|
||||||
|
*/
|
||||||
void DialogDetail::ClickedSeams(bool checked)
|
void DialogDetail::ClickedSeams(bool checked)
|
||||||
{
|
{
|
||||||
supplement = checked;
|
supplement = checked;
|
||||||
|
@ -214,12 +251,20 @@ void DialogDetail::ClickedSeams(bool checked)
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief ClickedClosed save closed equdistant or not
|
||||||
|
* @param checked 1 - closed, 0 - don't closed
|
||||||
|
*/
|
||||||
void DialogDetail::ClickedClosed(bool checked)
|
void DialogDetail::ClickedClosed(bool checked)
|
||||||
{
|
{
|
||||||
closed = checked;
|
closed = checked;
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief ObjectChanged changed new object (point, arc, spline or spline path) form list
|
||||||
|
* @param row number of row
|
||||||
|
*/
|
||||||
void DialogDetail::ObjectChanged(int row)
|
void DialogDetail::ObjectChanged(int row)
|
||||||
{
|
{
|
||||||
if (ui.listWidget->count() == 0)
|
if (ui.listWidget->count() == 0)
|
||||||
|
@ -233,6 +278,9 @@ void DialogDetail::ObjectChanged(int row)
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief DeleteItem delete item from list
|
||||||
|
*/
|
||||||
void DialogDetail::DeleteItem()
|
void DialogDetail::DeleteItem()
|
||||||
{
|
{
|
||||||
qint32 row = ui.listWidget->currentRow();
|
qint32 row = ui.listWidget->currentRow();
|
||||||
|
|
|
@ -39,91 +39,42 @@ class DialogDetail : public DialogTool
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
/**
|
DialogDetail(const VContainer *data, QWidget *parent = nullptr);
|
||||||
* @brief DialogDetail create dialog
|
|
||||||
* @param data container with data
|
|
||||||
* @param parent parent widget
|
|
||||||
*/
|
|
||||||
DialogDetail(const VContainer *data, QWidget *parent = nullptr);
|
|
||||||
/**
|
|
||||||
* @brief getDetails return detail
|
|
||||||
* @return detail
|
|
||||||
*/
|
|
||||||
VDetail getDetails() const;
|
VDetail getDetails() const;
|
||||||
/**
|
|
||||||
* @brief setDetails set detail
|
|
||||||
* @param value detail
|
|
||||||
*/
|
|
||||||
void setDetails(const VDetail &value);
|
void setDetails(const VDetail &value);
|
||||||
public slots:
|
public slots:
|
||||||
/**
|
|
||||||
* @brief ChoosedObject gets id and type of selected object. Save right data and ignore wrong.
|
|
||||||
* @param id id of objects (points, arcs, splines, spline paths)
|
|
||||||
* @param type type of object
|
|
||||||
*/
|
|
||||||
virtual void ChoosedObject(quint32 id, const Valentina::Scenes &type);
|
virtual void ChoosedObject(quint32 id, const Valentina::Scenes &type);
|
||||||
/**
|
|
||||||
* @brief DialogAccepted save data and emit signal about closed dialog.
|
|
||||||
*/
|
|
||||||
virtual void DialogAccepted();
|
virtual void DialogAccepted();
|
||||||
/**
|
|
||||||
* @brief BiasXChanged changed value of offset for object respect to x
|
|
||||||
* @param d value in mm
|
|
||||||
*/
|
|
||||||
void BiasXChanged(qreal d);
|
void BiasXChanged(qreal d);
|
||||||
/**
|
|
||||||
* @brief BiasYChanged changed value of offset for object respect to y
|
|
||||||
* @param d value in mm
|
|
||||||
*/
|
|
||||||
void BiasYChanged(qreal d);
|
void BiasYChanged(qreal d);
|
||||||
/**
|
|
||||||
* @brief ClickedSeams save supplement of seams for detail
|
|
||||||
* @param checked 1 - need supplement, 0 - don't need supplement
|
|
||||||
*/
|
|
||||||
void ClickedSeams(bool checked);
|
void ClickedSeams(bool checked);
|
||||||
/**
|
|
||||||
* @brief ClickedClosed save closed equdistant or not
|
|
||||||
* @param checked 1 - closed, 0 - don't closed
|
|
||||||
*/
|
|
||||||
void ClickedClosed(bool checked);
|
void ClickedClosed(bool checked);
|
||||||
/**
|
|
||||||
* @brief ObjectChanged changed new object (point, arc, spline or spline path) form list
|
|
||||||
* @param row number of row
|
|
||||||
*/
|
|
||||||
void ObjectChanged(int row);
|
void ObjectChanged(int row);
|
||||||
/**
|
|
||||||
* @brief DeleteItem delete item from list
|
|
||||||
*/
|
|
||||||
void DeleteItem();
|
void DeleteItem();
|
||||||
private:
|
private:
|
||||||
/**
|
|
||||||
* @brief ui keeps information about user interface
|
/** @brief ui keeps information about user interface */
|
||||||
*/
|
|
||||||
Ui::DialogDetail ui;
|
Ui::DialogDetail ui;
|
||||||
/**
|
|
||||||
* @brief details detail
|
/** @brief details detail */
|
||||||
*/
|
|
||||||
VDetail details;
|
VDetail details;
|
||||||
/**
|
|
||||||
* @brief supplement keep option supplement of seams
|
/** @brief supplement keep option supplement of seams */
|
||||||
*/
|
|
||||||
bool supplement;
|
bool supplement;
|
||||||
/**
|
|
||||||
* @brief closed keep option about equdistant (closed or not)
|
/** @brief closed keep option about equdistant (closed or not) */
|
||||||
*/
|
|
||||||
bool closed;
|
bool closed;
|
||||||
/**
|
|
||||||
* @brief NewItem add new object (point, arc, spline or spline path) to list
|
|
||||||
* @param id id of object
|
|
||||||
* @param typeTool type of tool
|
|
||||||
* @param typeNode type of node in detail
|
|
||||||
* @param mx offset respect to x
|
|
||||||
* @param my offset respect to y
|
|
||||||
*/
|
|
||||||
void NewItem(quint32 id, const Valentina::Tools &typeTool, const NodeDetail::NodeDetails &typeNode,
|
void NewItem(quint32 id, const Valentina::Tools &typeTool, const NodeDetail::NodeDetails &typeNode,
|
||||||
qreal mx = 0, qreal my = 0);
|
qreal mx = 0, qreal my = 0);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief getDetails return detail
|
||||||
|
* @return detail
|
||||||
|
*/
|
||||||
inline VDetail DialogDetail::getDetails() const
|
inline VDetail DialogDetail::getDetails() const
|
||||||
{
|
{
|
||||||
return details;
|
return details;
|
||||||
|
|
|
@ -49,6 +49,7 @@ class DialogEditWrongFormula : public DialogTool
|
||||||
public:
|
public:
|
||||||
explicit DialogEditWrongFormula(const VContainer *data, QWidget *parent = nullptr);
|
explicit DialogEditWrongFormula(const VContainer *data, QWidget *parent = nullptr);
|
||||||
~DialogEditWrongFormula();
|
~DialogEditWrongFormula();
|
||||||
|
|
||||||
QString getFormula() const;
|
QString getFormula() const;
|
||||||
void setFormula(const QString &value);
|
void setFormula(const QString &value);
|
||||||
public slots:
|
public slots:
|
||||||
|
@ -59,9 +60,8 @@ protected:
|
||||||
private:
|
private:
|
||||||
Q_DISABLE_COPY(DialogEditWrongFormula)
|
Q_DISABLE_COPY(DialogEditWrongFormula)
|
||||||
Ui::DialogEditWrongFormula *ui;
|
Ui::DialogEditWrongFormula *ui;
|
||||||
/**
|
|
||||||
* @brief formula string with formula
|
/** @brief formula string with formula */
|
||||||
*/
|
|
||||||
QString formula;
|
QString formula;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -32,6 +32,11 @@
|
||||||
#include <QPushButton>
|
#include <QPushButton>
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief DialogEndLine create dialog
|
||||||
|
* @param data container with data
|
||||||
|
* @param parent parent widget
|
||||||
|
*/
|
||||||
DialogEndLine::DialogEndLine(const VContainer *data, QWidget *parent)
|
DialogEndLine::DialogEndLine(const VContainer *data, QWidget *parent)
|
||||||
:DialogTool(data, parent), ui(new Ui::DialogEndLine), pointName(QString()), typeLine(QString()),
|
:DialogTool(data, parent), ui(new Ui::DialogEndLine), pointName(QString()), typeLine(QString()),
|
||||||
formula(QString()), angle(0), basePointId(0)
|
formula(QString()), angle(0), basePointId(0)
|
||||||
|
@ -61,6 +66,11 @@ DialogEndLine::DialogEndLine(const VContainer *data, QWidget *parent)
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief ChoosedObject gets id and type of selected object. Save right data and ignore wrong.
|
||||||
|
* @param id id of point or detail
|
||||||
|
* @param type type of object
|
||||||
|
*/
|
||||||
void DialogEndLine::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
void DialogEndLine::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
||||||
{
|
{
|
||||||
if (type == Valentina::Point)
|
if (type == Valentina::Point)
|
||||||
|
@ -73,6 +83,10 @@ void DialogEndLine::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief setPointName set name of point
|
||||||
|
* @param value name
|
||||||
|
*/
|
||||||
void DialogEndLine::setPointName(const QString &value)
|
void DialogEndLine::setPointName(const QString &value)
|
||||||
{
|
{
|
||||||
pointName = value;
|
pointName = value;
|
||||||
|
@ -80,6 +94,10 @@ void DialogEndLine::setPointName(const QString &value)
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief setTypeLine set type of line
|
||||||
|
* @param value type
|
||||||
|
*/
|
||||||
void DialogEndLine::setTypeLine(const QString &value)
|
void DialogEndLine::setTypeLine(const QString &value)
|
||||||
{
|
{
|
||||||
typeLine = value;
|
typeLine = value;
|
||||||
|
@ -87,6 +105,10 @@ void DialogEndLine::setTypeLine(const QString &value)
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief setFormula set string of formula
|
||||||
|
* @param value formula
|
||||||
|
*/
|
||||||
void DialogEndLine::setFormula(const QString &value)
|
void DialogEndLine::setFormula(const QString &value)
|
||||||
{
|
{
|
||||||
formula = qApp->FormulaToUser(value);
|
formula = qApp->FormulaToUser(value);
|
||||||
|
@ -94,6 +116,10 @@ void DialogEndLine::setFormula(const QString &value)
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief setAngle set angle of line
|
||||||
|
* @param value angle in degree
|
||||||
|
*/
|
||||||
void DialogEndLine::setAngle(const qreal &value)
|
void DialogEndLine::setAngle(const qreal &value)
|
||||||
{
|
{
|
||||||
angle = value;
|
angle = value;
|
||||||
|
@ -101,12 +127,20 @@ void DialogEndLine::setAngle(const qreal &value)
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief setBasePointId set id base point of line
|
||||||
|
* @param value id
|
||||||
|
* @param id don't show this id in list
|
||||||
|
*/
|
||||||
void DialogEndLine::setBasePointId(const quint32 &value, const quint32 &id)
|
void DialogEndLine::setBasePointId(const quint32 &value, const quint32 &id)
|
||||||
{
|
{
|
||||||
setCurrentPointId(ui->comboBoxBasePoint, basePointId, value, id);
|
setCurrentPointId(ui->comboBoxBasePoint, basePointId, value, id);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief DialogAccepted save data and emit signal about closed dialog.
|
||||||
|
*/
|
||||||
void DialogEndLine::DialogAccepted()
|
void DialogEndLine::DialogAccepted()
|
||||||
{
|
{
|
||||||
pointName = ui->lineEditNamePoint->text();
|
pointName = ui->lineEditNamePoint->text();
|
||||||
|
|
|
@ -43,123 +43,93 @@ class DialogEndLine : public DialogTool
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
/**
|
|
||||||
* @brief DialogEndLine create dialog
|
|
||||||
* @param data container with data
|
|
||||||
* @param parent parent widget
|
|
||||||
*/
|
|
||||||
DialogEndLine(const VContainer *data, QWidget *parent = nullptr);
|
DialogEndLine(const VContainer *data, QWidget *parent = nullptr);
|
||||||
~DialogEndLine();
|
~DialogEndLine();
|
||||||
/**
|
|
||||||
* @brief getPointName return name of point
|
|
||||||
* @return name
|
|
||||||
*/
|
|
||||||
QString getPointName() const;
|
QString getPointName() const;
|
||||||
/**
|
|
||||||
* @brief setPointName set name of point
|
|
||||||
* @param value name
|
|
||||||
*/
|
|
||||||
void setPointName(const QString &value);
|
void setPointName(const QString &value);
|
||||||
/**
|
|
||||||
* @brief getTypeLine return type of line
|
|
||||||
* @return type
|
|
||||||
*/
|
|
||||||
QString getTypeLine() const;
|
QString getTypeLine() const;
|
||||||
/**
|
|
||||||
* @brief setTypeLine set type of line
|
|
||||||
* @param value type
|
|
||||||
*/
|
|
||||||
void setTypeLine(const QString &value);
|
void setTypeLine(const QString &value);
|
||||||
/**
|
|
||||||
* @brief getFormula return string of formula
|
|
||||||
* @return formula
|
|
||||||
*/
|
|
||||||
QString getFormula() const;
|
QString getFormula() const;
|
||||||
/**
|
|
||||||
* @brief setFormula set string of formula
|
|
||||||
* @param value formula
|
|
||||||
*/
|
|
||||||
void setFormula(const QString &value);
|
void setFormula(const QString &value);
|
||||||
/**
|
|
||||||
* @brief getAngle return angle of line
|
|
||||||
* @return angle in degree
|
|
||||||
*/
|
|
||||||
qreal getAngle() const;
|
qreal getAngle() const;
|
||||||
/**
|
|
||||||
* @brief setAngle set angle of line
|
|
||||||
* @param value angle in degree
|
|
||||||
*/
|
|
||||||
void setAngle(const qreal &value);
|
void setAngle(const qreal &value);
|
||||||
/**
|
|
||||||
* @brief getBasePointId return id base point of line
|
|
||||||
* @return id
|
|
||||||
*/
|
|
||||||
quint32 getBasePointId() const;
|
quint32 getBasePointId() const;
|
||||||
/**
|
|
||||||
* @brief setBasePointId set id base point of line
|
|
||||||
* @param value id
|
|
||||||
* @param id don't show this id in list
|
|
||||||
*/
|
|
||||||
void setBasePointId(const quint32 &value, const quint32 &id);
|
void setBasePointId(const quint32 &value, const quint32 &id);
|
||||||
public slots:
|
public slots:
|
||||||
/**
|
|
||||||
* @brief ChoosedObject gets id and type of selected object. Save right data and ignore wrong.
|
|
||||||
* @param id id of point or detail
|
|
||||||
* @param type type of object
|
|
||||||
*/
|
|
||||||
virtual void ChoosedObject(quint32 id, const Valentina::Scenes &type);
|
virtual void ChoosedObject(quint32 id, const Valentina::Scenes &type);
|
||||||
/**
|
|
||||||
* @brief DialogAccepted save data and emit signal about closed dialog.
|
|
||||||
*/
|
|
||||||
virtual void DialogAccepted();
|
virtual void DialogAccepted();
|
||||||
private:
|
private:
|
||||||
Q_DISABLE_COPY(DialogEndLine)
|
Q_DISABLE_COPY(DialogEndLine)
|
||||||
/**
|
|
||||||
* @brief ui keeps information about user interface
|
/** @brief ui keeps information about user interface */
|
||||||
*/
|
|
||||||
Ui::DialogEndLine *ui;
|
Ui::DialogEndLine *ui;
|
||||||
/**
|
|
||||||
* @brief pointName name of point
|
/** @brief pointName name of point */
|
||||||
*/
|
|
||||||
QString pointName;
|
QString pointName;
|
||||||
/**
|
|
||||||
* @brief typeLine type of line
|
/** @brief typeLine type of line */
|
||||||
*/
|
|
||||||
QString typeLine;
|
QString typeLine;
|
||||||
/**
|
|
||||||
* @brief formula formula
|
/** @brief formula formula */
|
||||||
*/
|
|
||||||
QString formula;
|
QString formula;
|
||||||
/**
|
|
||||||
* @brief angle angle of line
|
/** @brief angle angle of line */
|
||||||
*/
|
|
||||||
qreal angle;
|
qreal angle;
|
||||||
/**
|
|
||||||
* @brief basePointId id base point of line
|
/** @brief basePointId id base point of line */
|
||||||
*/
|
|
||||||
quint32 basePointId;
|
quint32 basePointId;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief getPointName return name of point
|
||||||
|
* @return name
|
||||||
|
*/
|
||||||
inline QString DialogEndLine::getPointName() const
|
inline QString DialogEndLine::getPointName() const
|
||||||
{
|
{
|
||||||
return pointName;
|
return pointName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief getTypeLine return type of line
|
||||||
|
* @return type
|
||||||
|
*/
|
||||||
inline QString DialogEndLine::getTypeLine() const
|
inline QString DialogEndLine::getTypeLine() const
|
||||||
{
|
{
|
||||||
return typeLine;
|
return typeLine;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief getFormula return string of formula
|
||||||
|
* @return formula
|
||||||
|
*/
|
||||||
inline QString DialogEndLine::getFormula() const
|
inline QString DialogEndLine::getFormula() const
|
||||||
{
|
{
|
||||||
return qApp->FormulaFromUser(formula);
|
return qApp->FormulaFromUser(formula);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief getAngle return angle of line
|
||||||
|
* @return angle in degree
|
||||||
|
*/
|
||||||
inline qreal DialogEndLine::getAngle() const
|
inline qreal DialogEndLine::getAngle() const
|
||||||
{
|
{
|
||||||
return angle;
|
return angle;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief getBasePointId return id base point of line
|
||||||
|
* @return id
|
||||||
|
*/
|
||||||
inline quint32 DialogEndLine::getBasePointId() const
|
inline quint32 DialogEndLine::getBasePointId() const
|
||||||
{
|
{
|
||||||
return basePointId;
|
return basePointId;
|
||||||
|
|
|
@ -32,6 +32,11 @@
|
||||||
#include <QPushButton>
|
#include <QPushButton>
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief DialogHeight create dialog
|
||||||
|
* @param data container with data
|
||||||
|
* @param parent parent widget
|
||||||
|
*/
|
||||||
DialogHeight::DialogHeight(const VContainer *data, QWidget *parent)
|
DialogHeight::DialogHeight(const VContainer *data, QWidget *parent)
|
||||||
:DialogTool(data, parent), ui(new Ui::DialogHeight), number(0), pointName(QString()),
|
:DialogTool(data, parent), ui(new Ui::DialogHeight), number(0), pointName(QString()),
|
||||||
typeLine(QString()), basePointId(0), p1LineId(0), p2LineId(0)
|
typeLine(QString()), basePointId(0), p1LineId(0), p2LineId(0)
|
||||||
|
@ -56,6 +61,10 @@ DialogHeight::~DialogHeight()
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief setPointName set name of point
|
||||||
|
* @param value name
|
||||||
|
*/
|
||||||
void DialogHeight::setPointName(const QString &value)
|
void DialogHeight::setPointName(const QString &value)
|
||||||
{
|
{
|
||||||
pointName = value;
|
pointName = value;
|
||||||
|
@ -63,6 +72,10 @@ void DialogHeight::setPointName(const QString &value)
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief setTypeLine set type of line
|
||||||
|
* @param value type
|
||||||
|
*/
|
||||||
void DialogHeight::setTypeLine(const QString &value)
|
void DialogHeight::setTypeLine(const QString &value)
|
||||||
{
|
{
|
||||||
typeLine = value;
|
typeLine = value;
|
||||||
|
@ -70,6 +83,11 @@ void DialogHeight::setTypeLine(const QString &value)
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief setBasePointId set id base point of height
|
||||||
|
* @param value id
|
||||||
|
* @param id don't show this id in list
|
||||||
|
*/
|
||||||
void DialogHeight::setBasePointId(const quint32 &value, const quint32 &id)
|
void DialogHeight::setBasePointId(const quint32 &value, const quint32 &id)
|
||||||
{
|
{
|
||||||
basePointId = value;
|
basePointId = value;
|
||||||
|
@ -77,6 +95,11 @@ void DialogHeight::setBasePointId(const quint32 &value, const quint32 &id)
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief setP1LineId set id first point of line
|
||||||
|
* @param value id
|
||||||
|
* @param id don't show this id in list
|
||||||
|
*/
|
||||||
void DialogHeight::setP1LineId(const quint32 &value, const quint32 &id)
|
void DialogHeight::setP1LineId(const quint32 &value, const quint32 &id)
|
||||||
{
|
{
|
||||||
p1LineId = value;
|
p1LineId = value;
|
||||||
|
@ -84,6 +107,11 @@ void DialogHeight::setP1LineId(const quint32 &value, const quint32 &id)
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief setP2LineId set id second point of line
|
||||||
|
* @param value id
|
||||||
|
* @param id don't show this id in list
|
||||||
|
*/
|
||||||
void DialogHeight::setP2LineId(const quint32 &value, const quint32 &id)
|
void DialogHeight::setP2LineId(const quint32 &value, const quint32 &id)
|
||||||
{
|
{
|
||||||
p2LineId = value;
|
p2LineId = value;
|
||||||
|
@ -91,6 +119,11 @@ void DialogHeight::setP2LineId(const quint32 &value, const quint32 &id)
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief ChoosedObject gets id and type of selected object. Save right data and ignore wrong.
|
||||||
|
* @param id id of point or detail
|
||||||
|
* @param type type of object
|
||||||
|
*/
|
||||||
void DialogHeight::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
void DialogHeight::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
||||||
{
|
{
|
||||||
if (type == Valentina::Point)
|
if (type == Valentina::Point)
|
||||||
|
@ -124,6 +157,9 @@ void DialogHeight::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief DialogAccepted save data and emit signal about closed dialog.
|
||||||
|
*/
|
||||||
void DialogHeight::DialogAccepted()
|
void DialogHeight::DialogAccepted()
|
||||||
{
|
{
|
||||||
pointName = ui->lineEditNamePoint->text();
|
pointName = ui->lineEditNamePoint->text();
|
||||||
|
|
|
@ -43,129 +43,96 @@ class DialogHeight : public DialogTool
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
/**
|
|
||||||
* @brief DialogHeight create dialog
|
|
||||||
* @param data container with data
|
|
||||||
* @param parent parent widget
|
|
||||||
*/
|
|
||||||
DialogHeight(const VContainer *data, QWidget *parent = nullptr);
|
DialogHeight(const VContainer *data, QWidget *parent = nullptr);
|
||||||
~DialogHeight();
|
~DialogHeight();
|
||||||
/**
|
|
||||||
* @brief getPointName return name of point
|
|
||||||
* @return name
|
|
||||||
*/
|
|
||||||
QString getPointName() const;
|
QString getPointName() const;
|
||||||
/**
|
|
||||||
* @brief setPointName set name of point
|
|
||||||
* @param value name
|
|
||||||
*/
|
|
||||||
void setPointName(const QString &value);
|
void setPointName(const QString &value);
|
||||||
/**
|
|
||||||
* @brief getTypeLine return type of line
|
|
||||||
* @return type
|
|
||||||
*/
|
|
||||||
QString getTypeLine() const;
|
QString getTypeLine() const;
|
||||||
/**
|
|
||||||
* @brief setTypeLine set type of line
|
|
||||||
* @param value type
|
|
||||||
*/
|
|
||||||
void setTypeLine(const QString &value);
|
void setTypeLine(const QString &value);
|
||||||
/**
|
|
||||||
* @brief getBasePointId return id base point of height
|
|
||||||
* @return id
|
|
||||||
*/
|
|
||||||
quint32 getBasePointId() const;
|
quint32 getBasePointId() const;
|
||||||
/**
|
|
||||||
* @brief setBasePointId set id base point of height
|
|
||||||
* @param value id
|
|
||||||
* @param id don't show this id in list
|
|
||||||
*/
|
|
||||||
void setBasePointId(const quint32 &value, const quint32 &id);
|
void setBasePointId(const quint32 &value, const quint32 &id);
|
||||||
/**
|
|
||||||
* @brief getP1LineId return id first point of line
|
|
||||||
* @return id id
|
|
||||||
*/
|
|
||||||
quint32 getP1LineId() const;
|
quint32 getP1LineId() const;
|
||||||
/**
|
|
||||||
* @brief setP1LineId set id first point of line
|
|
||||||
* @param value id
|
|
||||||
* @param id don't show this id in list
|
|
||||||
*/
|
|
||||||
void setP1LineId(const quint32 &value, const quint32 &id);
|
void setP1LineId(const quint32 &value, const quint32 &id);
|
||||||
/**
|
|
||||||
* @brief getP2LineId return id second point of line
|
|
||||||
* @return id
|
|
||||||
*/
|
|
||||||
quint32 getP2LineId() const;
|
quint32 getP2LineId() const;
|
||||||
/**
|
|
||||||
* @brief setP2LineId set id second point of line
|
|
||||||
* @param value id
|
|
||||||
* @param id don't show this id in list
|
|
||||||
*/
|
|
||||||
void setP2LineId(const quint32 &value, const quint32 &id);
|
void setP2LineId(const quint32 &value, const quint32 &id);
|
||||||
public slots:
|
public slots:
|
||||||
/**
|
|
||||||
* @brief ChoosedObject gets id and type of selected object. Save right data and ignore wrong.
|
|
||||||
* @param id id of point or detail
|
|
||||||
* @param type type of object
|
|
||||||
*/
|
|
||||||
virtual void ChoosedObject(quint32 id, const Valentina::Scenes &type);
|
virtual void ChoosedObject(quint32 id, const Valentina::Scenes &type);
|
||||||
/**
|
|
||||||
* @brief DialogAccepted save data and emit signal about closed dialog.
|
|
||||||
*/
|
|
||||||
virtual void DialogAccepted();
|
virtual void DialogAccepted();
|
||||||
private:
|
private:
|
||||||
Q_DISABLE_COPY(DialogHeight)
|
Q_DISABLE_COPY(DialogHeight)
|
||||||
/**
|
|
||||||
* @brief ui keeps information about user interface
|
/** @brief ui keeps information about user interface */
|
||||||
*/
|
|
||||||
Ui::DialogHeight *ui;
|
Ui::DialogHeight *ui;
|
||||||
/**
|
|
||||||
* @brief number number of handled objects
|
/** @brief number number of handled objects */
|
||||||
*/
|
|
||||||
qint32 number;
|
qint32 number;
|
||||||
/**
|
|
||||||
* @brief pointName name of point
|
/** @brief pointName name of point */
|
||||||
*/
|
|
||||||
QString pointName;
|
QString pointName;
|
||||||
/**
|
|
||||||
* @brief typeLine type of line
|
/** @brief typeLine type of line */
|
||||||
*/
|
|
||||||
QString typeLine;
|
QString typeLine;
|
||||||
/**
|
|
||||||
* @brief basePointId id base point of height
|
/** @brief basePointId id base point of height */
|
||||||
*/
|
|
||||||
quint32 basePointId;
|
quint32 basePointId;
|
||||||
/**
|
|
||||||
* @brief p1LineId id first point of line
|
/** @brief p1LineId id first point of line */
|
||||||
*/
|
|
||||||
quint32 p1LineId;
|
quint32 p1LineId;
|
||||||
/**
|
|
||||||
* @brief p2LineId id second point of line
|
/** @brief p2LineId id second point of line */
|
||||||
*/
|
|
||||||
quint32 p2LineId;
|
quint32 p2LineId;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief getPointName return name of point
|
||||||
|
* @return name
|
||||||
|
*/
|
||||||
inline QString DialogHeight::getPointName() const
|
inline QString DialogHeight::getPointName() const
|
||||||
{
|
{
|
||||||
return pointName;
|
return pointName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief getTypeLine return type of line
|
||||||
|
* @return type
|
||||||
|
*/
|
||||||
inline QString DialogHeight::getTypeLine() const
|
inline QString DialogHeight::getTypeLine() const
|
||||||
{
|
{
|
||||||
return typeLine;
|
return typeLine;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief getBasePointId return id base point of height
|
||||||
|
* @return id
|
||||||
|
*/
|
||||||
inline quint32 DialogHeight::getBasePointId() const
|
inline quint32 DialogHeight::getBasePointId() const
|
||||||
{
|
{
|
||||||
return basePointId;
|
return basePointId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief getP1LineId return id first point of line
|
||||||
|
* @return id id
|
||||||
|
*/
|
||||||
inline quint32 DialogHeight::getP1LineId() const
|
inline quint32 DialogHeight::getP1LineId() const
|
||||||
{
|
{
|
||||||
return p1LineId;
|
return p1LineId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief getP2LineId return id second point of line
|
||||||
|
* @return id
|
||||||
|
*/
|
||||||
inline quint32 DialogHeight::getP2LineId() const
|
inline quint32 DialogHeight::getP2LineId() const
|
||||||
{
|
{
|
||||||
return p2LineId;
|
return p2LineId;
|
||||||
|
|
|
@ -32,6 +32,11 @@
|
||||||
#include <QPushButton>
|
#include <QPushButton>
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief DialogLine create dialog
|
||||||
|
* @param data container with data
|
||||||
|
* @param parent parent widget
|
||||||
|
*/
|
||||||
DialogLine::DialogLine(const VContainer *data, QWidget *parent)
|
DialogLine::DialogLine(const VContainer *data, QWidget *parent)
|
||||||
:DialogTool(data, parent), ui(new Ui::DialogLine), number(0), firstPoint(0), secondPoint(0), typeLine(QString())
|
:DialogTool(data, parent), ui(new Ui::DialogLine), number(0), firstPoint(0), secondPoint(0), typeLine(QString())
|
||||||
{
|
{
|
||||||
|
@ -52,6 +57,10 @@ DialogLine::~DialogLine()
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief setSecondPoint set id second point
|
||||||
|
* @param value id
|
||||||
|
*/
|
||||||
void DialogLine::setSecondPoint(const quint32 &value)
|
void DialogLine::setSecondPoint(const quint32 &value)
|
||||||
{
|
{
|
||||||
secondPoint = value;
|
secondPoint = value;
|
||||||
|
@ -64,6 +73,10 @@ void DialogLine::setSecondPoint(const quint32 &value)
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief setTypeLine set type of line
|
||||||
|
* @param value type
|
||||||
|
*/
|
||||||
void DialogLine::setTypeLine(const QString &value)
|
void DialogLine::setTypeLine(const QString &value)
|
||||||
{
|
{
|
||||||
typeLine = value;
|
typeLine = value;
|
||||||
|
@ -71,6 +84,10 @@ void DialogLine::setTypeLine(const QString &value)
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief setFirstPoint set id first point
|
||||||
|
* @param value id
|
||||||
|
*/
|
||||||
void DialogLine::setFirstPoint(const quint32 &value)
|
void DialogLine::setFirstPoint(const quint32 &value)
|
||||||
{
|
{
|
||||||
firstPoint = value;
|
firstPoint = value;
|
||||||
|
@ -83,6 +100,9 @@ void DialogLine::setFirstPoint(const quint32 &value)
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief DialogAccepted save data and emit signal about closed dialog.
|
||||||
|
*/
|
||||||
void DialogLine::DialogAccepted()
|
void DialogLine::DialogAccepted()
|
||||||
{
|
{
|
||||||
qint32 index = ui->comboBoxFirstPoint->currentIndex();
|
qint32 index = ui->comboBoxFirstPoint->currentIndex();
|
||||||
|
@ -94,6 +114,11 @@ void DialogLine::DialogAccepted()
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief ChoosedObject gets id and type of selected object. Save right data and ignore wrong.
|
||||||
|
* @param id id of point or detail
|
||||||
|
* @param type type of object
|
||||||
|
*/
|
||||||
void DialogLine::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
void DialogLine::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
||||||
{
|
{
|
||||||
if (type == Valentina::Point)
|
if (type == Valentina::Point)
|
||||||
|
|
|
@ -43,88 +43,64 @@ class DialogLine : public DialogTool
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
/**
|
|
||||||
* @brief DialogLine create dialog
|
|
||||||
* @param data container with data
|
|
||||||
* @param parent parent widget
|
|
||||||
*/
|
|
||||||
DialogLine(const VContainer *data, QWidget *parent = nullptr);
|
DialogLine(const VContainer *data, QWidget *parent = nullptr);
|
||||||
~DialogLine();
|
~DialogLine();
|
||||||
/**
|
|
||||||
* @brief getFirstPoint return id first point
|
|
||||||
* @return id
|
|
||||||
*/
|
|
||||||
quint32 getFirstPoint() const;
|
quint32 getFirstPoint() const;
|
||||||
/**
|
|
||||||
* @brief setFirstPoint set id first point
|
|
||||||
* @param value id
|
|
||||||
*/
|
|
||||||
void setFirstPoint(const quint32 &value);
|
void setFirstPoint(const quint32 &value);
|
||||||
/**
|
|
||||||
* @brief getSecondPoint return id second point
|
|
||||||
* @return id
|
|
||||||
*/
|
|
||||||
quint32 getSecondPoint() const;
|
quint32 getSecondPoint() const;
|
||||||
/**
|
|
||||||
* @brief setSecondPoint set id second point
|
|
||||||
* @param value id
|
|
||||||
*/
|
|
||||||
void setSecondPoint(const quint32 &value);
|
void setSecondPoint(const quint32 &value);
|
||||||
/**
|
|
||||||
* @brief getTypeLine return type of line
|
|
||||||
* @return type
|
|
||||||
*/
|
|
||||||
QString getTypeLine() const;
|
QString getTypeLine() const;
|
||||||
/**
|
|
||||||
* @brief setTypeLine set type of line
|
|
||||||
* @param value type
|
|
||||||
*/
|
|
||||||
void setTypeLine(const QString &value);
|
void setTypeLine(const QString &value);
|
||||||
public slots:
|
public slots:
|
||||||
/**
|
|
||||||
* @brief ChoosedObject gets id and type of selected object. Save right data and ignore wrong.
|
|
||||||
* @param id id of point or detail
|
|
||||||
* @param type type of object
|
|
||||||
*/
|
|
||||||
virtual void ChoosedObject(quint32 id, const Valentina::Scenes &type);
|
virtual void ChoosedObject(quint32 id, const Valentina::Scenes &type);
|
||||||
/**
|
|
||||||
* @brief DialogAccepted save data and emit signal about closed dialog.
|
|
||||||
*/
|
|
||||||
virtual void DialogAccepted();
|
virtual void DialogAccepted();
|
||||||
private:
|
private:
|
||||||
Q_DISABLE_COPY(DialogLine)
|
Q_DISABLE_COPY(DialogLine)
|
||||||
/**
|
|
||||||
* @brief ui keeps information about user interface
|
/** @brief ui keeps information about user interface */
|
||||||
*/
|
|
||||||
Ui::DialogLine *ui;
|
Ui::DialogLine *ui;
|
||||||
/**
|
|
||||||
* @brief number number of handled objects
|
/** @brief number number of handled objects */
|
||||||
*/
|
|
||||||
qint32 number;
|
qint32 number;
|
||||||
/**
|
|
||||||
* @brief firstPoint id first point
|
/** @brief firstPoint id first point */
|
||||||
*/
|
|
||||||
quint32 firstPoint;
|
quint32 firstPoint;
|
||||||
/**
|
|
||||||
* @brief secondPoint id second point
|
/** @brief secondPoint id second point */
|
||||||
*/
|
|
||||||
quint32 secondPoint;
|
quint32 secondPoint;
|
||||||
/**
|
|
||||||
* @brief typeLine type of line
|
/** @brief typeLine type of line */
|
||||||
*/
|
|
||||||
QString typeLine;
|
QString typeLine;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief getFirstPoint return id first point
|
||||||
|
* @return id
|
||||||
|
*/
|
||||||
inline quint32 DialogLine::getFirstPoint() const
|
inline quint32 DialogLine::getFirstPoint() const
|
||||||
{
|
{
|
||||||
return firstPoint;
|
return firstPoint;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief getSecondPoint return id second point
|
||||||
|
* @return id
|
||||||
|
*/
|
||||||
inline quint32 DialogLine::getSecondPoint() const
|
inline quint32 DialogLine::getSecondPoint() const
|
||||||
{
|
{
|
||||||
return secondPoint;
|
return secondPoint;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief getTypeLine return type of line
|
||||||
|
* @return type
|
||||||
|
*/
|
||||||
inline QString DialogLine::getTypeLine() const
|
inline QString DialogLine::getTypeLine() const
|
||||||
{
|
{
|
||||||
return typeLine;
|
return typeLine;
|
||||||
|
|
|
@ -32,6 +32,11 @@
|
||||||
#include <QPushButton>
|
#include <QPushButton>
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief DialogLineIntersect create dialog
|
||||||
|
* @param data container with data
|
||||||
|
* @param parent parent widget
|
||||||
|
*/
|
||||||
DialogLineIntersect::DialogLineIntersect(const VContainer *data, QWidget *parent)
|
DialogLineIntersect::DialogLineIntersect(const VContainer *data, QWidget *parent)
|
||||||
:DialogTool(data, parent), ui(new Ui::DialogLineIntersect), number(0), pointName(QString()),
|
:DialogTool(data, parent), ui(new Ui::DialogLineIntersect), number(0), pointName(QString()),
|
||||||
p1Line1(0), p2Line1(0), p1Line2(0), p2Line2(0), flagPoint(true)
|
p1Line1(0), p2Line1(0), p1Line2(0), p2Line2(0), flagPoint(true)
|
||||||
|
@ -57,6 +62,11 @@ DialogLineIntersect::~DialogLineIntersect()
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief ChoosedObject gets id and type of selected object. Save right data and ignore wrong.
|
||||||
|
* @param id id of point or detail
|
||||||
|
* @param type type of object
|
||||||
|
*/
|
||||||
void DialogLineIntersect::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
void DialogLineIntersect::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
||||||
{
|
{
|
||||||
if (type == Valentina::Point)
|
if (type == Valentina::Point)
|
||||||
|
@ -131,6 +141,9 @@ void DialogLineIntersect::ChoosedObject(quint32 id, const Valentina::Scenes &typ
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief DialogAccepted save data and emit signal about closed dialog.
|
||||||
|
*/
|
||||||
void DialogLineIntersect::DialogAccepted()
|
void DialogLineIntersect::DialogAccepted()
|
||||||
{
|
{
|
||||||
pointName = ui->lineEditNamePoint->text();
|
pointName = ui->lineEditNamePoint->text();
|
||||||
|
@ -142,6 +155,10 @@ void DialogLineIntersect::DialogAccepted()
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief P1Line1Changed changed first point of first line
|
||||||
|
* @param index index in list
|
||||||
|
*/
|
||||||
void DialogLineIntersect::P1Line1Changed( int index)
|
void DialogLineIntersect::P1Line1Changed( int index)
|
||||||
{
|
{
|
||||||
p1Line1 = qvariant_cast<quint32>(ui->comboBoxP1Line1->itemData(index));
|
p1Line1 = qvariant_cast<quint32>(ui->comboBoxP1Line1->itemData(index));
|
||||||
|
@ -150,6 +167,10 @@ void DialogLineIntersect::P1Line1Changed( int index)
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief P2Line1Changed changed second point of first line
|
||||||
|
* @param index index in list
|
||||||
|
*/
|
||||||
void DialogLineIntersect::P2Line1Changed(int index)
|
void DialogLineIntersect::P2Line1Changed(int index)
|
||||||
{
|
{
|
||||||
p2Line1 = qvariant_cast<quint32>(ui->comboBoxP2Line1->itemData(index));
|
p2Line1 = qvariant_cast<quint32>(ui->comboBoxP2Line1->itemData(index));
|
||||||
|
@ -158,6 +179,10 @@ void DialogLineIntersect::P2Line1Changed(int index)
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief P1Line2Changed changed first point of second line
|
||||||
|
* @param index index in list
|
||||||
|
*/
|
||||||
void DialogLineIntersect::P1Line2Changed(int index)
|
void DialogLineIntersect::P1Line2Changed(int index)
|
||||||
{
|
{
|
||||||
p1Line2 = qvariant_cast<quint32>(ui->comboBoxP1Line2->itemData(index));
|
p1Line2 = qvariant_cast<quint32>(ui->comboBoxP1Line2->itemData(index));
|
||||||
|
@ -166,6 +191,10 @@ void DialogLineIntersect::P1Line2Changed(int index)
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief P2Line2Changed changed second point of second line
|
||||||
|
* @param index index in list
|
||||||
|
*/
|
||||||
void DialogLineIntersect::P2Line2Changed(int index)
|
void DialogLineIntersect::P2Line2Changed(int index)
|
||||||
{
|
{
|
||||||
p2Line2 = qvariant_cast<quint32>(ui->comboBoxP2Line2->itemData(index));
|
p2Line2 = qvariant_cast<quint32>(ui->comboBoxP2Line2->itemData(index));
|
||||||
|
@ -174,6 +203,9 @@ void DialogLineIntersect::P2Line2Changed(int index)
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief CheckState check state of dialog. Enable or disable button ok.
|
||||||
|
*/
|
||||||
void DialogLineIntersect::CheckState()
|
void DialogLineIntersect::CheckState()
|
||||||
{
|
{
|
||||||
Q_CHECK_PTR(bOk);
|
Q_CHECK_PTR(bOk);
|
||||||
|
@ -181,6 +213,10 @@ void DialogLineIntersect::CheckState()
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief CheckIntersecion check intersection of points
|
||||||
|
* @return true - line have intersection, false = don't have
|
||||||
|
*/
|
||||||
bool DialogLineIntersect::CheckIntersecion()
|
bool DialogLineIntersect::CheckIntersecion()
|
||||||
{
|
{
|
||||||
const VPointF *p1L1 = data->GeometricObject<const VPointF *>(p1Line1);
|
const VPointF *p1L1 = data->GeometricObject<const VPointF *>(p1Line1);
|
||||||
|
@ -203,6 +239,10 @@ bool DialogLineIntersect::CheckIntersecion()
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief setP2Line2 set id second point of second line
|
||||||
|
* @param value id
|
||||||
|
*/
|
||||||
void DialogLineIntersect::setP2Line2(const quint32 &value)
|
void DialogLineIntersect::setP2Line2(const quint32 &value)
|
||||||
{
|
{
|
||||||
p2Line2 = value;
|
p2Line2 = value;
|
||||||
|
@ -210,6 +250,10 @@ void DialogLineIntersect::setP2Line2(const quint32 &value)
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief setP1Line2 set id first point of second line
|
||||||
|
* @param value id
|
||||||
|
*/
|
||||||
void DialogLineIntersect::setP1Line2(const quint32 &value)
|
void DialogLineIntersect::setP1Line2(const quint32 &value)
|
||||||
{
|
{
|
||||||
p1Line2 = value;
|
p1Line2 = value;
|
||||||
|
@ -217,6 +261,10 @@ void DialogLineIntersect::setP1Line2(const quint32 &value)
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief setP2Line1 set id second point of first line
|
||||||
|
* @param value id
|
||||||
|
*/
|
||||||
void DialogLineIntersect::setP2Line1(const quint32 &value)
|
void DialogLineIntersect::setP2Line1(const quint32 &value)
|
||||||
{
|
{
|
||||||
p2Line1 = value;
|
p2Line1 = value;
|
||||||
|
@ -224,6 +272,10 @@ void DialogLineIntersect::setP2Line1(const quint32 &value)
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief setP1Line1 set id first point of first line
|
||||||
|
* @param value id
|
||||||
|
*/
|
||||||
void DialogLineIntersect::setP1Line1(const quint32 &value)
|
void DialogLineIntersect::setP1Line1(const quint32 &value)
|
||||||
{
|
{
|
||||||
p1Line1 = value;
|
p1Line1 = value;
|
||||||
|
@ -231,6 +283,10 @@ void DialogLineIntersect::setP1Line1(const quint32 &value)
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief setPointName set name of point
|
||||||
|
* @param value name of point
|
||||||
|
*/
|
||||||
void DialogLineIntersect::setPointName(const QString &value)
|
void DialogLineIntersect::setPointName(const QString &value)
|
||||||
{
|
{
|
||||||
pointName = value;
|
pointName = value;
|
||||||
|
|
|
@ -43,159 +43,106 @@ class DialogLineIntersect : public DialogTool
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
/**
|
|
||||||
* @brief DialogLineIntersect create dialog
|
|
||||||
* @param data container with data
|
|
||||||
* @param parent parent widget
|
|
||||||
*/
|
|
||||||
DialogLineIntersect(const VContainer *data, QWidget *parent = nullptr);
|
DialogLineIntersect(const VContainer *data, QWidget *parent = nullptr);
|
||||||
~DialogLineIntersect();
|
~DialogLineIntersect();
|
||||||
/**
|
|
||||||
* @brief getP1Line1 return id first point of first line
|
|
||||||
* @return id
|
|
||||||
*/
|
|
||||||
quint32 getP1Line1() const;
|
quint32 getP1Line1() const;
|
||||||
/**
|
|
||||||
* @brief setP1Line1 set id first point of first line
|
|
||||||
* @param value id
|
|
||||||
*/
|
|
||||||
void setP1Line1(const quint32 &value);
|
void setP1Line1(const quint32 &value);
|
||||||
/**
|
|
||||||
* @brief getP2Line1 return id second point of first line
|
|
||||||
* @return id
|
|
||||||
*/
|
|
||||||
quint32 getP2Line1() const;
|
quint32 getP2Line1() const;
|
||||||
/**
|
|
||||||
* @brief setP2Line1 set id second point of first line
|
|
||||||
* @param value id
|
|
||||||
*/
|
|
||||||
void setP2Line1(const quint32 &value);
|
void setP2Line1(const quint32 &value);
|
||||||
/**
|
|
||||||
* @brief getP1Line2 return id first point of second line
|
|
||||||
* @return id
|
|
||||||
*/
|
|
||||||
quint32 getP1Line2() const;
|
quint32 getP1Line2() const;
|
||||||
/**
|
|
||||||
* @brief setP1Line2 set id first point of second line
|
|
||||||
* @param value id
|
|
||||||
*/
|
|
||||||
void setP1Line2(const quint32 &value);
|
void setP1Line2(const quint32 &value);
|
||||||
/**
|
|
||||||
* @brief getP2Line2 return id second point of second line
|
|
||||||
* @return id
|
|
||||||
*/
|
|
||||||
quint32 getP2Line2() const;
|
quint32 getP2Line2() const;
|
||||||
/**
|
|
||||||
* @brief setP2Line2 set id second point of second line
|
|
||||||
* @param value id
|
|
||||||
*/
|
|
||||||
void setP2Line2(const quint32 &value);
|
void setP2Line2(const quint32 &value);
|
||||||
/**
|
|
||||||
* @brief getPointName return name of point
|
|
||||||
* @return name of point
|
|
||||||
*/
|
|
||||||
QString getPointName() const;
|
QString getPointName() const;
|
||||||
/**
|
|
||||||
* @brief setPointName set name of point
|
|
||||||
* @param value name of point
|
|
||||||
*/
|
|
||||||
void setPointName(const QString &value);
|
void setPointName(const QString &value);
|
||||||
public slots:
|
public slots:
|
||||||
/**
|
|
||||||
* @brief ChoosedObject gets id and type of selected object. Save right data and ignore wrong.
|
|
||||||
* @param id id of point or detail
|
|
||||||
* @param type type of object
|
|
||||||
*/
|
|
||||||
virtual void ChoosedObject(quint32 id, const Valentina::Scenes &type);
|
virtual void ChoosedObject(quint32 id, const Valentina::Scenes &type);
|
||||||
/**
|
|
||||||
* @brief DialogAccepted save data and emit signal about closed dialog.
|
|
||||||
*/
|
|
||||||
virtual void DialogAccepted();
|
virtual void DialogAccepted();
|
||||||
/**
|
|
||||||
* @brief P1Line1Changed changed first point of first line
|
|
||||||
* @param index index in list
|
|
||||||
*/
|
|
||||||
void P1Line1Changed( int index);
|
void P1Line1Changed( int index);
|
||||||
/**
|
|
||||||
* @brief P2Line1Changed changed second point of first line
|
|
||||||
* @param index index in list
|
|
||||||
*/
|
|
||||||
void P2Line1Changed( int index);
|
void P2Line1Changed( int index);
|
||||||
/**
|
|
||||||
* @brief P1Line2Changed changed first point of second line
|
|
||||||
* @param index index in list
|
|
||||||
*/
|
|
||||||
void P1Line2Changed( int index);
|
void P1Line2Changed( int index);
|
||||||
/**
|
|
||||||
* @brief P2Line2Changed changed second point of second line
|
|
||||||
* @param index index in list
|
|
||||||
*/
|
|
||||||
void P2Line2Changed( int index);
|
void P2Line2Changed( int index);
|
||||||
private:
|
private:
|
||||||
Q_DISABLE_COPY(DialogLineIntersect)
|
Q_DISABLE_COPY(DialogLineIntersect)
|
||||||
/**
|
|
||||||
* @brief ui keeps information about user interface
|
/** @brief ui keeps information about user interface */
|
||||||
*/
|
|
||||||
Ui::DialogLineIntersect *ui;
|
Ui::DialogLineIntersect *ui;
|
||||||
/**
|
|
||||||
* @brief number number of handled objects
|
/** @brief number number of handled objects */
|
||||||
*/
|
|
||||||
qint32 number;
|
qint32 number;
|
||||||
/**
|
|
||||||
* @brief pointName name of point
|
/** @brief pointName name of point */
|
||||||
*/
|
|
||||||
QString pointName;
|
QString pointName;
|
||||||
/**
|
|
||||||
* @brief p1Line1 id first point of first line
|
/** @brief p1Line1 id first point of first line */
|
||||||
*/
|
|
||||||
quint32 p1Line1;
|
quint32 p1Line1;
|
||||||
/**
|
|
||||||
* @brief p2Line1 id second point of first line
|
/** @brief p2Line1 id second point of first line */
|
||||||
*/
|
|
||||||
quint32 p2Line1;
|
quint32 p2Line1;
|
||||||
/**
|
|
||||||
* @brief p1Line2 id first point of second line
|
/** @brief p1Line2 id first point of second line */
|
||||||
*/
|
|
||||||
quint32 p1Line2;
|
quint32 p1Line2;
|
||||||
/**
|
|
||||||
* @brief p2Line2 id second point of second line
|
/** @brief p2Line2 id second point of second line */
|
||||||
*/
|
|
||||||
quint32 p2Line2;
|
quint32 p2Line2;
|
||||||
/**
|
|
||||||
* @brief flagPoint keep state of point
|
/** @brief flagPoint keep state of point */
|
||||||
*/
|
|
||||||
bool flagPoint;
|
bool flagPoint;
|
||||||
/**
|
|
||||||
* @brief CheckState check state of dialog. Enable or disable button ok.
|
|
||||||
*/
|
|
||||||
virtual void CheckState();
|
virtual void CheckState();
|
||||||
/**
|
|
||||||
* @brief CheckIntersecion check intersection of points
|
|
||||||
* @return true - line have intersection, false = don't have
|
|
||||||
*/
|
|
||||||
bool CheckIntersecion();
|
bool CheckIntersecion();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief getP1Line1 return id first point of first line
|
||||||
|
* @return id
|
||||||
|
*/
|
||||||
inline quint32 DialogLineIntersect::getP1Line1() const
|
inline quint32 DialogLineIntersect::getP1Line1() const
|
||||||
{
|
{
|
||||||
return p1Line1;
|
return p1Line1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief getP2Line1 return id second point of first line
|
||||||
|
* @return id
|
||||||
|
*/
|
||||||
inline quint32 DialogLineIntersect::getP2Line1() const
|
inline quint32 DialogLineIntersect::getP2Line1() const
|
||||||
{
|
{
|
||||||
return p2Line1;
|
return p2Line1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief getP1Line2 return id first point of second line
|
||||||
|
* @return id
|
||||||
|
*/
|
||||||
inline quint32 DialogLineIntersect::getP1Line2() const
|
inline quint32 DialogLineIntersect::getP1Line2() const
|
||||||
{
|
{
|
||||||
return p1Line2;
|
return p1Line2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief getP2Line2 return id second point of second line
|
||||||
|
* @return id
|
||||||
|
*/
|
||||||
inline quint32 DialogLineIntersect::getP2Line2() const
|
inline quint32 DialogLineIntersect::getP2Line2() const
|
||||||
{
|
{
|
||||||
return p2Line2;
|
return p2Line2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief getPointName return name of point
|
||||||
|
* @return name of point
|
||||||
|
*/
|
||||||
inline QString DialogLineIntersect::getPointName() const
|
inline QString DialogLineIntersect::getPointName() const
|
||||||
{
|
{
|
||||||
return pointName;
|
return pointName;
|
||||||
|
|
|
@ -32,6 +32,11 @@
|
||||||
#include <QPushButton>
|
#include <QPushButton>
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief DialogNormal create dialog
|
||||||
|
* @param data container with data
|
||||||
|
* @param parent parent widget
|
||||||
|
*/
|
||||||
DialogNormal::DialogNormal(const VContainer *data, QWidget *parent)
|
DialogNormal::DialogNormal(const VContainer *data, QWidget *parent)
|
||||||
:DialogTool(data, parent), ui(new Ui::DialogNormal), number(0), pointName(QString()),
|
:DialogTool(data, parent), ui(new Ui::DialogNormal), number(0), pointName(QString()),
|
||||||
typeLine(QString()), formula(QString()), angle(0), firstPointId(0), secondPointId(0)
|
typeLine(QString()), formula(QString()), angle(0), firstPointId(0), secondPointId(0)
|
||||||
|
@ -68,6 +73,11 @@ DialogNormal::~DialogNormal()
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief ChoosedObject gets id and type of selected object. Save right data and ignore wrong.
|
||||||
|
* @param id id of point or detail
|
||||||
|
* @param type type of object
|
||||||
|
*/
|
||||||
void DialogNormal::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
void DialogNormal::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
||||||
{
|
{
|
||||||
if (type == Valentina::Point)
|
if (type == Valentina::Point)
|
||||||
|
@ -95,6 +105,9 @@ void DialogNormal::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief DialogAccepted save data and emit signal about closed dialog.
|
||||||
|
*/
|
||||||
void DialogNormal::DialogAccepted()
|
void DialogNormal::DialogAccepted()
|
||||||
{
|
{
|
||||||
pointName = ui->lineEditNamePoint->text();
|
pointName = ui->lineEditNamePoint->text();
|
||||||
|
@ -107,18 +120,32 @@ void DialogNormal::DialogAccepted()
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief setSecondPointId set id of second point
|
||||||
|
* @param value id
|
||||||
|
* @param id don't show this id in list
|
||||||
|
*/
|
||||||
void DialogNormal::setSecondPointId(const quint32 &value, const quint32 &id)
|
void DialogNormal::setSecondPointId(const quint32 &value, const quint32 &id)
|
||||||
{
|
{
|
||||||
setCurrentPointId(ui->comboBoxSecondPoint, secondPointId, value, id);
|
setCurrentPointId(ui->comboBoxSecondPoint, secondPointId, value, id);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief setFirstPointId set id of first point
|
||||||
|
* @param value id
|
||||||
|
* @param id don't show this id in list
|
||||||
|
*/
|
||||||
void DialogNormal::setFirstPointId(const quint32 &value, const quint32 &id)
|
void DialogNormal::setFirstPointId(const quint32 &value, const quint32 &id)
|
||||||
{
|
{
|
||||||
setCurrentPointId(ui->comboBoxFirstPoint, firstPointId, value, id);
|
setCurrentPointId(ui->comboBoxFirstPoint, firstPointId, value, id);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief setAngle set aditional angle of normal
|
||||||
|
* @param value angle in degree
|
||||||
|
*/
|
||||||
void DialogNormal::setAngle(const qreal &value)
|
void DialogNormal::setAngle(const qreal &value)
|
||||||
{
|
{
|
||||||
angle = value;
|
angle = value;
|
||||||
|
@ -126,6 +153,10 @@ void DialogNormal::setAngle(const qreal &value)
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief setFormula set string of formula
|
||||||
|
* @param value formula
|
||||||
|
*/
|
||||||
void DialogNormal::setFormula(const QString &value)
|
void DialogNormal::setFormula(const QString &value)
|
||||||
{
|
{
|
||||||
formula = qApp->FormulaToUser(value);
|
formula = qApp->FormulaToUser(value);
|
||||||
|
@ -133,6 +164,10 @@ void DialogNormal::setFormula(const QString &value)
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief setTypeLine set type of line
|
||||||
|
* @param value type
|
||||||
|
*/
|
||||||
void DialogNormal::setTypeLine(const QString &value)
|
void DialogNormal::setTypeLine(const QString &value)
|
||||||
{
|
{
|
||||||
typeLine = value;
|
typeLine = value;
|
||||||
|
@ -140,6 +175,10 @@ void DialogNormal::setTypeLine(const QString &value)
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief setPointName set name of point
|
||||||
|
* @param value name
|
||||||
|
*/
|
||||||
void DialogNormal::setPointName(const QString &value)
|
void DialogNormal::setPointName(const QString &value)
|
||||||
{
|
{
|
||||||
pointName = value;
|
pointName = value;
|
||||||
|
|
|
@ -43,147 +43,112 @@ class DialogNormal : public DialogTool
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
/**
|
|
||||||
* @brief DialogNormal create dialog
|
|
||||||
* @param data container with data
|
|
||||||
* @param parent parent widget
|
|
||||||
*/
|
|
||||||
DialogNormal(const VContainer *data, QWidget *parent = nullptr);
|
DialogNormal(const VContainer *data, QWidget *parent = nullptr);
|
||||||
~DialogNormal();
|
~DialogNormal();
|
||||||
/**
|
|
||||||
* @brief getPointName return name of point
|
|
||||||
* @return name
|
|
||||||
*/
|
|
||||||
QString getPointName() const;
|
QString getPointName() const;
|
||||||
/**
|
|
||||||
* @brief setPointName set name of point
|
|
||||||
* @param value name
|
|
||||||
*/
|
|
||||||
void setPointName(const QString &value);
|
void setPointName(const QString &value);
|
||||||
/**
|
|
||||||
* @brief getTypeLine return type of line
|
|
||||||
* @return type
|
|
||||||
*/
|
|
||||||
QString getTypeLine() const;
|
QString getTypeLine() const;
|
||||||
/**
|
|
||||||
* @brief setTypeLine set type of line
|
|
||||||
* @param value type
|
|
||||||
*/
|
|
||||||
void setTypeLine(const QString &value);
|
void setTypeLine(const QString &value);
|
||||||
/**
|
|
||||||
* @brief getFormula return string of formula
|
|
||||||
* @return formula
|
|
||||||
*/
|
|
||||||
QString getFormula() const;
|
QString getFormula() const;
|
||||||
/**
|
|
||||||
* @brief setFormula set string of formula
|
|
||||||
* @param value formula
|
|
||||||
*/
|
|
||||||
void setFormula(const QString &value);
|
void setFormula(const QString &value);
|
||||||
/**
|
|
||||||
* @brief getAngle return aditional angle of normal
|
|
||||||
* @return angle in degree
|
|
||||||
*/
|
|
||||||
qreal getAngle() const;
|
qreal getAngle() const;
|
||||||
/**
|
|
||||||
* @brief setAngle set aditional angle of normal
|
|
||||||
* @param value angle in degree
|
|
||||||
*/
|
|
||||||
void setAngle(const qreal &value);
|
void setAngle(const qreal &value);
|
||||||
/**
|
|
||||||
* @brief getFirstPointId return id of first point
|
|
||||||
* @return id
|
|
||||||
*/
|
|
||||||
quint32 getFirstPointId() const;
|
quint32 getFirstPointId() const;
|
||||||
/**
|
|
||||||
* @brief setFirstPointId set id of first point
|
|
||||||
* @param value id
|
|
||||||
* @param id don't show this id in list
|
|
||||||
*/
|
|
||||||
void setFirstPointId(const quint32 &value, const quint32 &id);
|
void setFirstPointId(const quint32 &value, const quint32 &id);
|
||||||
/**
|
|
||||||
* @brief getSecondPointId return id of second point
|
|
||||||
* @return id
|
|
||||||
*/
|
|
||||||
quint32 getSecondPointId() const;
|
quint32 getSecondPointId() const;
|
||||||
/**
|
|
||||||
* @brief setSecondPointId set id of second point
|
|
||||||
* @param value id
|
|
||||||
* @param id don't show this id in list
|
|
||||||
*/
|
|
||||||
void setSecondPointId(const quint32 &value, const quint32 &id);
|
void setSecondPointId(const quint32 &value, const quint32 &id);
|
||||||
public slots:
|
public slots:
|
||||||
/**
|
|
||||||
* @brief ChoosedObject gets id and type of selected object. Save right data and ignore wrong.
|
|
||||||
* @param id id of point or detail
|
|
||||||
* @param type type of object
|
|
||||||
*/
|
|
||||||
virtual void ChoosedObject(quint32 id, const Valentina::Scenes &type);
|
virtual void ChoosedObject(quint32 id, const Valentina::Scenes &type);
|
||||||
/**
|
|
||||||
* @brief DialogAccepted save data and emit signal about closed dialog.
|
|
||||||
*/
|
|
||||||
virtual void DialogAccepted();
|
virtual void DialogAccepted();
|
||||||
private:
|
private:
|
||||||
Q_DISABLE_COPY(DialogNormal)
|
Q_DISABLE_COPY(DialogNormal)
|
||||||
/**
|
|
||||||
* @brief ui keeps information about user interface
|
/** @brief ui keeps information about user interface */
|
||||||
*/
|
|
||||||
Ui::DialogNormal *ui;
|
Ui::DialogNormal *ui;
|
||||||
/**
|
|
||||||
* @brief number number of handled objects
|
/** @brief number number of handled objects */
|
||||||
*/
|
|
||||||
qint32 number;
|
qint32 number;
|
||||||
/**
|
|
||||||
* @brief pointName name of point
|
/** @brief pointName name of point */
|
||||||
*/
|
|
||||||
QString pointName;
|
QString pointName;
|
||||||
/**
|
|
||||||
* @brief typeLine type of line
|
/** @brief typeLine type of line */
|
||||||
*/
|
|
||||||
QString typeLine;
|
QString typeLine;
|
||||||
/**
|
|
||||||
* @brief formula formula
|
/** @brief formula formula */
|
||||||
*/
|
|
||||||
QString formula;
|
QString formula;
|
||||||
/**
|
|
||||||
* @brief angle aditional angle of normal
|
/** @brief angle aditional angle of normal */
|
||||||
*/
|
|
||||||
qreal angle;
|
qreal angle;
|
||||||
/**
|
|
||||||
* @brief firstPointId id first point of line
|
/** @brief firstPointId id first point of line */
|
||||||
*/
|
|
||||||
quint32 firstPointId;
|
quint32 firstPointId;
|
||||||
/**
|
|
||||||
* @brief secondPointId id second point of line
|
/** @brief secondPointId id second point of line */
|
||||||
*/
|
|
||||||
quint32 secondPointId;
|
quint32 secondPointId;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief getPointName return name of point
|
||||||
|
* @return name
|
||||||
|
*/
|
||||||
inline QString DialogNormal::getPointName() const
|
inline QString DialogNormal::getPointName() const
|
||||||
{
|
{
|
||||||
return pointName;
|
return pointName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief getTypeLine return type of line
|
||||||
|
* @return type
|
||||||
|
*/
|
||||||
inline QString DialogNormal::getTypeLine() const
|
inline QString DialogNormal::getTypeLine() const
|
||||||
{
|
{
|
||||||
return typeLine;
|
return typeLine;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief getFormula return string of formula
|
||||||
|
* @return formula
|
||||||
|
*/
|
||||||
inline QString DialogNormal::getFormula() const
|
inline QString DialogNormal::getFormula() const
|
||||||
{
|
{
|
||||||
return qApp->FormulaFromUser(formula);
|
return qApp->FormulaFromUser(formula);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief getAngle return aditional angle of normal
|
||||||
|
* @return angle in degree
|
||||||
|
*/
|
||||||
inline qreal DialogNormal::getAngle() const
|
inline qreal DialogNormal::getAngle() const
|
||||||
{
|
{
|
||||||
return angle;
|
return angle;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief getFirstPointId return id of first point
|
||||||
|
* @return id
|
||||||
|
*/
|
||||||
inline quint32 DialogNormal::getFirstPointId() const
|
inline quint32 DialogNormal::getFirstPointId() const
|
||||||
{
|
{
|
||||||
return firstPointId;
|
return firstPointId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief getSecondPointId return id of second point
|
||||||
|
* @return id
|
||||||
|
*/
|
||||||
inline quint32 DialogNormal::getSecondPointId() const
|
inline quint32 DialogNormal::getSecondPointId() const
|
||||||
{
|
{
|
||||||
return secondPointId;
|
return secondPointId;
|
||||||
|
|
|
@ -31,6 +31,11 @@
|
||||||
#include <QPushButton>
|
#include <QPushButton>
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief DialogPointOfContact create dialog
|
||||||
|
* @param data container with data
|
||||||
|
* @param parent parent widget
|
||||||
|
*/
|
||||||
DialogPointOfContact::DialogPointOfContact(const VContainer *data, QWidget *parent)
|
DialogPointOfContact::DialogPointOfContact(const VContainer *data, QWidget *parent)
|
||||||
:DialogTool(data, parent), ui(), number(0), pointName(QString()), radius(QString()), center(0),
|
:DialogTool(data, parent), ui(), number(0), pointName(QString()), radius(QString()), center(0),
|
||||||
firstPoint(0), secondPoint(0)
|
firstPoint(0), secondPoint(0)
|
||||||
|
@ -89,6 +94,11 @@ DialogPointOfContact::DialogPointOfContact(const VContainer *data, QWidget *pare
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief ChoosedObject gets id and type of selected object. Save right data and ignore wrong.
|
||||||
|
* @param id id of point or detail
|
||||||
|
* @param type type of object
|
||||||
|
*/
|
||||||
void DialogPointOfContact::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
void DialogPointOfContact::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
||||||
{
|
{
|
||||||
if (type == Valentina::Point)
|
if (type == Valentina::Point)
|
||||||
|
@ -134,6 +144,9 @@ void DialogPointOfContact::ChoosedObject(quint32 id, const Valentina::Scenes &ty
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief DialogAccepted save data and emit signal about closed dialog.
|
||||||
|
*/
|
||||||
void DialogPointOfContact::DialogAccepted()
|
void DialogPointOfContact::DialogAccepted()
|
||||||
{
|
{
|
||||||
pointName = ui.lineEditNamePoint->text();
|
pointName = ui.lineEditNamePoint->text();
|
||||||
|
@ -145,18 +158,33 @@ void DialogPointOfContact::DialogAccepted()
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief setSecondPoint set id second point
|
||||||
|
* @param value id
|
||||||
|
* @param id don't show this id in list.
|
||||||
|
*/
|
||||||
void DialogPointOfContact::setSecondPoint(const quint32 &value, const quint32 &id)
|
void DialogPointOfContact::setSecondPoint(const quint32 &value, const quint32 &id)
|
||||||
{
|
{
|
||||||
setCurrentPointId(ui.comboBoxSecondPoint, secondPoint, value, id);
|
setCurrentPointId(ui.comboBoxSecondPoint, secondPoint, value, id);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief setFirstPoint set id first point
|
||||||
|
* @param value id
|
||||||
|
* @param id don't show this id in list.
|
||||||
|
*/
|
||||||
void DialogPointOfContact::setFirstPoint(const quint32 &value, const quint32 &id)
|
void DialogPointOfContact::setFirstPoint(const quint32 &value, const quint32 &id)
|
||||||
{
|
{
|
||||||
setCurrentPointId(ui.comboBoxFirstPoint, firstPoint, value, id);
|
setCurrentPointId(ui.comboBoxFirstPoint, firstPoint, value, id);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief SetCenter set id of center point
|
||||||
|
* @param value id
|
||||||
|
* @param id don't show this id in list.
|
||||||
|
*/
|
||||||
void DialogPointOfContact::setCenter(const quint32 &value, const quint32 &id)
|
void DialogPointOfContact::setCenter(const quint32 &value, const quint32 &id)
|
||||||
{
|
{
|
||||||
setCurrentPointId(ui.comboBoxCenter, center, value, id);
|
setCurrentPointId(ui.comboBoxCenter, center, value, id);
|
||||||
|
@ -164,6 +192,10 @@ void DialogPointOfContact::setCenter(const quint32 &value, const quint32 &id)
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief setRadius set formula radius of arc
|
||||||
|
* @param value formula
|
||||||
|
*/
|
||||||
void DialogPointOfContact::setRadius(const QString &value)
|
void DialogPointOfContact::setRadius(const QString &value)
|
||||||
{
|
{
|
||||||
radius = value;
|
radius = value;
|
||||||
|
@ -171,6 +203,10 @@ void DialogPointOfContact::setRadius(const QString &value)
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief setPointName set name of point
|
||||||
|
* @param value name
|
||||||
|
*/
|
||||||
void DialogPointOfContact::setPointName(const QString &value)
|
void DialogPointOfContact::setPointName(const QString &value)
|
||||||
{
|
{
|
||||||
pointName = value;
|
pointName = value;
|
||||||
|
|
|
@ -39,128 +39,95 @@ class DialogPointOfContact : public DialogTool
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
/**
|
|
||||||
* @brief DialogPointOfContact create dialog
|
|
||||||
* @param data container with data
|
|
||||||
* @param parent parent widget
|
|
||||||
*/
|
|
||||||
DialogPointOfContact(const VContainer *data, QWidget *parent = nullptr);
|
DialogPointOfContact(const VContainer *data, QWidget *parent = nullptr);
|
||||||
/**
|
|
||||||
* @brief getPointName return name of point
|
|
||||||
* @return name
|
|
||||||
*/
|
|
||||||
QString getPointName() const;
|
QString getPointName() const;
|
||||||
/**
|
|
||||||
* @brief setPointName set name of point
|
|
||||||
* @param value name
|
|
||||||
*/
|
|
||||||
void setPointName(const QString &value);
|
void setPointName(const QString &value);
|
||||||
/**
|
|
||||||
* @brief getRadius return formula radius of arc
|
|
||||||
* @return formula
|
|
||||||
*/
|
|
||||||
QString getRadius() const;
|
QString getRadius() const;
|
||||||
/**
|
|
||||||
* @brief setRadius set formula radius of arc
|
|
||||||
* @param value formula
|
|
||||||
*/
|
|
||||||
void setRadius(const QString &value);
|
void setRadius(const QString &value);
|
||||||
/**
|
|
||||||
* @brief GetCenter return id of center point
|
|
||||||
* @return id
|
|
||||||
*/
|
|
||||||
quint32 getCenter() const;
|
quint32 getCenter() const;
|
||||||
/**
|
|
||||||
* @brief SetCenter set id of center point
|
|
||||||
* @param value id
|
|
||||||
* @param id don't show this id in list.
|
|
||||||
*/
|
|
||||||
void setCenter(const quint32 &value, const quint32 &id);
|
void setCenter(const quint32 &value, const quint32 &id);
|
||||||
/**
|
|
||||||
* @brief getFirstPoint return id first point
|
|
||||||
* @return id
|
|
||||||
*/
|
|
||||||
quint32 getFirstPoint() const;
|
quint32 getFirstPoint() const;
|
||||||
/**
|
|
||||||
* @brief setFirstPoint set id first point
|
|
||||||
* @param value id
|
|
||||||
* @param id don't show this id in list.
|
|
||||||
*/
|
|
||||||
void setFirstPoint(const quint32 &value, const quint32 &id);
|
void setFirstPoint(const quint32 &value, const quint32 &id);
|
||||||
/**
|
|
||||||
* @brief getSecondPoint return id second point
|
|
||||||
* @return id
|
|
||||||
*/
|
|
||||||
quint32 getSecondPoint() const;
|
quint32 getSecondPoint() const;
|
||||||
/**
|
|
||||||
* @brief setSecondPoint set id second point
|
|
||||||
* @param value id
|
|
||||||
* @param id don't show this id in list.
|
|
||||||
*/
|
|
||||||
void setSecondPoint(const quint32 &value, const quint32 &id);
|
void setSecondPoint(const quint32 &value, const quint32 &id);
|
||||||
public slots:
|
public slots:
|
||||||
/**
|
|
||||||
* @brief ChoosedObject gets id and type of selected object. Save right data and ignore wrong.
|
|
||||||
* @param id id of point or detail
|
|
||||||
* @param type type of object
|
|
||||||
*/
|
|
||||||
virtual void ChoosedObject(quint32 id, const Valentina::Scenes &type);
|
virtual void ChoosedObject(quint32 id, const Valentina::Scenes &type);
|
||||||
/**
|
|
||||||
* @brief DialogAccepted save data and emit signal about closed dialog.
|
|
||||||
*/
|
|
||||||
virtual void DialogAccepted();
|
virtual void DialogAccepted();
|
||||||
private:
|
private:
|
||||||
Q_DISABLE_COPY(DialogPointOfContact)
|
Q_DISABLE_COPY(DialogPointOfContact)
|
||||||
/**
|
|
||||||
* @brief ui keeps information about user interface
|
/** @brief ui keeps information about user interface */
|
||||||
*/
|
|
||||||
Ui::DialogPointOfContact ui;
|
Ui::DialogPointOfContact ui;
|
||||||
/**
|
|
||||||
* @brief number number of handled objects
|
/** @brief number number of handled objects */
|
||||||
*/
|
|
||||||
qint32 number;
|
qint32 number;
|
||||||
/**
|
|
||||||
* @brief pointName name of point
|
/** @brief pointName name of point */
|
||||||
*/
|
|
||||||
QString pointName;
|
QString pointName;
|
||||||
/**
|
|
||||||
* @brief radius radius of arc
|
/** @brief radius radius of arc */
|
||||||
*/
|
|
||||||
QString radius;
|
QString radius;
|
||||||
/**
|
|
||||||
* @brief center id center point of arc
|
/** @brief center id center point of arc */
|
||||||
*/
|
|
||||||
quint32 center;
|
quint32 center;
|
||||||
/**
|
|
||||||
* @brief firstPoint id first point of line
|
/** @brief firstPoint id first point of line */
|
||||||
*/
|
|
||||||
quint32 firstPoint;
|
quint32 firstPoint;
|
||||||
/**
|
|
||||||
* @brief secondPoint id second point of line
|
/** @brief secondPoint id second point of line */
|
||||||
*/
|
|
||||||
quint32 secondPoint;
|
quint32 secondPoint;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief getPointName return name of point
|
||||||
|
* @return name
|
||||||
|
*/
|
||||||
inline QString DialogPointOfContact::getPointName() const
|
inline QString DialogPointOfContact::getPointName() const
|
||||||
{
|
{
|
||||||
return pointName;
|
return pointName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief getRadius return formula radius of arc
|
||||||
|
* @return formula
|
||||||
|
*/
|
||||||
inline QString DialogPointOfContact::getRadius() const
|
inline QString DialogPointOfContact::getRadius() const
|
||||||
{
|
{
|
||||||
return radius;
|
return radius;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief GetCenter return id of center point
|
||||||
|
* @return id
|
||||||
|
*/
|
||||||
inline quint32 DialogPointOfContact::getCenter() const
|
inline quint32 DialogPointOfContact::getCenter() const
|
||||||
{
|
{
|
||||||
return center;
|
return center;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief getFirstPoint return id first point
|
||||||
|
* @return id
|
||||||
|
*/
|
||||||
inline quint32 DialogPointOfContact::getFirstPoint() const
|
inline quint32 DialogPointOfContact::getFirstPoint() const
|
||||||
{
|
{
|
||||||
return firstPoint;
|
return firstPoint;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief getSecondPoint return id second point
|
||||||
|
* @return id
|
||||||
|
*/
|
||||||
inline quint32 DialogPointOfContact::getSecondPoint() const
|
inline quint32 DialogPointOfContact::getSecondPoint() const
|
||||||
{
|
{
|
||||||
return secondPoint;
|
return secondPoint;
|
||||||
|
|
|
@ -32,6 +32,11 @@
|
||||||
#include <QPushButton>
|
#include <QPushButton>
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief DialogPointOfIntersection create dialog
|
||||||
|
* @param data container with data
|
||||||
|
* @param parent parent widget
|
||||||
|
*/
|
||||||
DialogPointOfIntersection::DialogPointOfIntersection(const VContainer *data, QWidget *parent)
|
DialogPointOfIntersection::DialogPointOfIntersection(const VContainer *data, QWidget *parent)
|
||||||
:DialogTool(data, parent), ui(new Ui::DialogPointOfIntersection), number(0), pointName(QString()),
|
:DialogTool(data, parent), ui(new Ui::DialogPointOfIntersection), number(0), pointName(QString()),
|
||||||
firstPointId(0), secondPointId(0)
|
firstPointId(0), secondPointId(0)
|
||||||
|
@ -55,6 +60,11 @@ DialogPointOfIntersection::~DialogPointOfIntersection()
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief setSecondPointId set id of second point
|
||||||
|
* @param value id
|
||||||
|
* @param id don't show this id in list.
|
||||||
|
*/
|
||||||
void DialogPointOfIntersection::setSecondPointId(const quint32 &value, const quint32 &id)
|
void DialogPointOfIntersection::setSecondPointId(const quint32 &value, const quint32 &id)
|
||||||
{
|
{
|
||||||
secondPointId = value;
|
secondPointId = value;
|
||||||
|
@ -62,6 +72,11 @@ void DialogPointOfIntersection::setSecondPointId(const quint32 &value, const qui
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief ChoosedObject gets id and type of selected object. Save right data and ignore wrong.
|
||||||
|
* @param id id of point or detail
|
||||||
|
* @param type type of object
|
||||||
|
*/
|
||||||
void DialogPointOfIntersection::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
void DialogPointOfIntersection::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
||||||
{
|
{
|
||||||
if (type == Valentina::Point)
|
if (type == Valentina::Point)
|
||||||
|
@ -96,6 +111,9 @@ void DialogPointOfIntersection::ChoosedObject(quint32 id, const Valentina::Scene
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief DialogAccepted save data and emit signal about closed dialog.
|
||||||
|
*/
|
||||||
void DialogPointOfIntersection::DialogAccepted()
|
void DialogPointOfIntersection::DialogAccepted()
|
||||||
{
|
{
|
||||||
pointName = ui->lineEditNamePoint->text();
|
pointName = ui->lineEditNamePoint->text();
|
||||||
|
@ -105,6 +123,11 @@ void DialogPointOfIntersection::DialogAccepted()
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief setFirstPointId set id of first point
|
||||||
|
* @param value id
|
||||||
|
* @param id don't show this id in list.
|
||||||
|
*/
|
||||||
void DialogPointOfIntersection::setFirstPointId(const quint32 &value, const quint32 &id)
|
void DialogPointOfIntersection::setFirstPointId(const quint32 &value, const quint32 &id)
|
||||||
{
|
{
|
||||||
firstPointId = value;
|
firstPointId = value;
|
||||||
|
@ -112,6 +135,10 @@ void DialogPointOfIntersection::setFirstPointId(const quint32 &value, const quin
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief setPointName set name of point
|
||||||
|
* @param value name
|
||||||
|
*/
|
||||||
void DialogPointOfIntersection::setPointName(const QString &value)
|
void DialogPointOfIntersection::setPointName(const QString &value)
|
||||||
{
|
{
|
||||||
pointName = value;
|
pointName = value;
|
||||||
|
|
|
@ -43,90 +43,64 @@ class DialogPointOfIntersection : public DialogTool
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
/**
|
|
||||||
* @brief DialogPointOfIntersection create dialog
|
|
||||||
* @param data container with data
|
|
||||||
* @param parent parent widget
|
|
||||||
*/
|
|
||||||
DialogPointOfIntersection(const VContainer *data, QWidget *parent = nullptr);
|
DialogPointOfIntersection(const VContainer *data, QWidget *parent = nullptr);
|
||||||
~DialogPointOfIntersection();
|
~DialogPointOfIntersection();
|
||||||
/**
|
|
||||||
* @brief getPointName return name of point
|
|
||||||
* @return name
|
|
||||||
*/
|
|
||||||
QString getPointName() const;
|
QString getPointName() const;
|
||||||
/**
|
|
||||||
* @brief setPointName set name of point
|
|
||||||
* @param value name
|
|
||||||
*/
|
|
||||||
void setPointName(const QString &value);
|
void setPointName(const QString &value);
|
||||||
/**
|
|
||||||
* @brief getFirstPointId return id of first point
|
|
||||||
* @return id
|
|
||||||
*/
|
|
||||||
quint32 getFirstPointId() const;
|
quint32 getFirstPointId() const;
|
||||||
/**
|
|
||||||
* @brief setFirstPointId set id of first point
|
|
||||||
* @param value id
|
|
||||||
* @param id don't show this id in list.
|
|
||||||
*/
|
|
||||||
void setFirstPointId(const quint32 &value, const quint32 &id);
|
void setFirstPointId(const quint32 &value, const quint32 &id);
|
||||||
/**
|
|
||||||
* @brief getSecondPointId return id of second point
|
|
||||||
* @return id
|
|
||||||
*/
|
|
||||||
quint32 getSecondPointId() const;
|
quint32 getSecondPointId() const;
|
||||||
/**
|
|
||||||
* @brief setSecondPointId set id of second point
|
|
||||||
* @param value id
|
|
||||||
* @param id don't show this id in list.
|
|
||||||
*/
|
|
||||||
void setSecondPointId(const quint32 &value, const quint32 &id);
|
void setSecondPointId(const quint32 &value, const quint32 &id);
|
||||||
public slots:
|
public slots:
|
||||||
/**
|
|
||||||
* @brief ChoosedObject gets id and type of selected object. Save right data and ignore wrong.
|
|
||||||
* @param id id of point or detail
|
|
||||||
* @param type type of object
|
|
||||||
*/
|
|
||||||
virtual void ChoosedObject(quint32 id, const Valentina::Scenes &type);
|
virtual void ChoosedObject(quint32 id, const Valentina::Scenes &type);
|
||||||
/**
|
|
||||||
* @brief DialogAccepted save data and emit signal about closed dialog.
|
|
||||||
*/
|
|
||||||
virtual void DialogAccepted();
|
virtual void DialogAccepted();
|
||||||
private:
|
private:
|
||||||
Q_DISABLE_COPY(DialogPointOfIntersection)
|
Q_DISABLE_COPY(DialogPointOfIntersection)
|
||||||
/**
|
|
||||||
* @brief ui keeps information about user interface
|
/** @brief ui keeps information about user interface */
|
||||||
*/
|
|
||||||
Ui::DialogPointOfIntersection *ui;
|
Ui::DialogPointOfIntersection *ui;
|
||||||
/**
|
|
||||||
* @brief number number of handled objects
|
/** @brief number number of handled objects */
|
||||||
*/
|
|
||||||
qint32 number;
|
qint32 number;
|
||||||
/**
|
|
||||||
* @brief pointName name of point
|
/** @brief pointName name of point */
|
||||||
*/
|
|
||||||
QString pointName;
|
QString pointName;
|
||||||
/**
|
|
||||||
* @brief firstPointId id first point of line
|
/** @brief firstPointId id first point of line */
|
||||||
*/
|
|
||||||
quint32 firstPointId;
|
quint32 firstPointId;
|
||||||
/**
|
|
||||||
* @brief secondPointId id second point of line
|
/** @brief secondPointId id second point of line */
|
||||||
*/
|
|
||||||
quint32 secondPointId;
|
quint32 secondPointId;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief getPointName return name of point
|
||||||
|
* @return name
|
||||||
|
*/
|
||||||
inline QString DialogPointOfIntersection::getPointName() const
|
inline QString DialogPointOfIntersection::getPointName() const
|
||||||
{
|
{
|
||||||
return pointName;
|
return pointName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief getFirstPointId return id of first point
|
||||||
|
* @return id
|
||||||
|
*/
|
||||||
inline quint32 DialogPointOfIntersection::getFirstPointId() const
|
inline quint32 DialogPointOfIntersection::getFirstPointId() const
|
||||||
{
|
{
|
||||||
return firstPointId;
|
return firstPointId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief getSecondPointId return id of second point
|
||||||
|
* @return id
|
||||||
|
*/
|
||||||
inline quint32 DialogPointOfIntersection::getSecondPointId() const
|
inline quint32 DialogPointOfIntersection::getSecondPointId() const
|
||||||
{
|
{
|
||||||
return secondPointId;
|
return secondPointId;
|
||||||
|
|
|
@ -32,6 +32,11 @@
|
||||||
#include <QPushButton>
|
#include <QPushButton>
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief DialogShoulderPoint create dialog
|
||||||
|
* @param data container with data
|
||||||
|
* @param parent parent widget
|
||||||
|
*/
|
||||||
DialogShoulderPoint::DialogShoulderPoint(const VContainer *data, QWidget *parent)
|
DialogShoulderPoint::DialogShoulderPoint(const VContainer *data, QWidget *parent)
|
||||||
:DialogTool(data, parent), ui(new Ui::DialogShoulderPoint), number(0), pointName(QString()),
|
:DialogTool(data, parent), ui(new Ui::DialogShoulderPoint), number(0), pointName(QString()),
|
||||||
typeLine(QString()), formula(QString()), p1Line(0), p2Line(0), pShoulder(0)
|
typeLine(QString()), formula(QString()), p1Line(0), p2Line(0), pShoulder(0)
|
||||||
|
@ -68,6 +73,11 @@ DialogShoulderPoint::~DialogShoulderPoint()
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief ChoosedObject gets id and type of selected object. Save right data and ignore wrong.
|
||||||
|
* @param id id of point or detail
|
||||||
|
* @param type type of object
|
||||||
|
*/
|
||||||
void DialogShoulderPoint::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
void DialogShoulderPoint::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
||||||
{
|
{
|
||||||
if (type == Valentina::Point)
|
if (type == Valentina::Point)
|
||||||
|
@ -113,6 +123,9 @@ void DialogShoulderPoint::ChoosedObject(quint32 id, const Valentina::Scenes &typ
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief DialogAccepted save data and emit signal about closed dialog.
|
||||||
|
*/
|
||||||
void DialogShoulderPoint::DialogAccepted()
|
void DialogShoulderPoint::DialogAccepted()
|
||||||
{
|
{
|
||||||
pointName = ui->lineEditNamePoint->text();
|
pointName = ui->lineEditNamePoint->text();
|
||||||
|
@ -125,24 +138,43 @@ void DialogShoulderPoint::DialogAccepted()
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief setPShoulder set id shoulder point
|
||||||
|
* @param value id
|
||||||
|
* @param id don't show this id in list
|
||||||
|
*/
|
||||||
void DialogShoulderPoint::setPShoulder(const quint32 &value, const quint32 &id)
|
void DialogShoulderPoint::setPShoulder(const quint32 &value, const quint32 &id)
|
||||||
{
|
{
|
||||||
setCurrentPointId(ui->comboBoxPShoulder, pShoulder, value, id);
|
setCurrentPointId(ui->comboBoxPShoulder, pShoulder, value, id);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief setP2Line set id second point of line
|
||||||
|
* @param value id
|
||||||
|
* @param id don't show this id in list
|
||||||
|
*/
|
||||||
void DialogShoulderPoint::setP2Line(const quint32 &value, const quint32 &id)
|
void DialogShoulderPoint::setP2Line(const quint32 &value, const quint32 &id)
|
||||||
{
|
{
|
||||||
setCurrentPointId(ui->comboBoxP2Line, p2Line, value, id);
|
setCurrentPointId(ui->comboBoxP2Line, p2Line, value, id);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief setP1Line set id first point of line
|
||||||
|
* @param value id
|
||||||
|
* @param id don't show this id in list
|
||||||
|
*/
|
||||||
void DialogShoulderPoint::setP1Line(const quint32 &value, const quint32 &id)
|
void DialogShoulderPoint::setP1Line(const quint32 &value, const quint32 &id)
|
||||||
{
|
{
|
||||||
setCurrentPointId(ui->comboBoxP1Line, p1Line, value, id);
|
setCurrentPointId(ui->comboBoxP1Line, p1Line, value, id);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief setFormula set string of formula
|
||||||
|
* @param value formula
|
||||||
|
*/
|
||||||
void DialogShoulderPoint::setFormula(const QString &value)
|
void DialogShoulderPoint::setFormula(const QString &value)
|
||||||
{
|
{
|
||||||
formula = qApp->FormulaToUser(value);
|
formula = qApp->FormulaToUser(value);
|
||||||
|
@ -150,6 +182,10 @@ void DialogShoulderPoint::setFormula(const QString &value)
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief setTypeLine set type of line
|
||||||
|
* @param value type
|
||||||
|
*/
|
||||||
void DialogShoulderPoint::setTypeLine(const QString &value)
|
void DialogShoulderPoint::setTypeLine(const QString &value)
|
||||||
{
|
{
|
||||||
typeLine = value;
|
typeLine = value;
|
||||||
|
@ -157,6 +193,10 @@ void DialogShoulderPoint::setTypeLine(const QString &value)
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief setPointName set name of point
|
||||||
|
* @param value name
|
||||||
|
*/
|
||||||
void DialogShoulderPoint::setPointName(const QString &value)
|
void DialogShoulderPoint::setPointName(const QString &value)
|
||||||
{
|
{
|
||||||
pointName = value;
|
pointName = value;
|
||||||
|
|
|
@ -43,148 +43,112 @@ class DialogShoulderPoint : public DialogTool
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
/**
|
|
||||||
* @brief DialogShoulderPoint create dialog
|
|
||||||
* @param data container with data
|
|
||||||
* @param parent parent widget
|
|
||||||
*/
|
|
||||||
DialogShoulderPoint(const VContainer *data, QWidget *parent = nullptr);
|
DialogShoulderPoint(const VContainer *data, QWidget *parent = nullptr);
|
||||||
~DialogShoulderPoint();
|
~DialogShoulderPoint();
|
||||||
/**
|
|
||||||
* @brief getPointName return name of point
|
|
||||||
* @return name
|
|
||||||
*/
|
|
||||||
QString getPointName() const;
|
QString getPointName() const;
|
||||||
/**
|
|
||||||
* @brief setPointName set name of point
|
|
||||||
* @param value name
|
|
||||||
*/
|
|
||||||
void setPointName(const QString &value);
|
void setPointName(const QString &value);
|
||||||
/**
|
|
||||||
* @brief getTypeLine return type of line
|
|
||||||
* @return type
|
|
||||||
*/
|
|
||||||
QString getTypeLine() const;
|
QString getTypeLine() const;
|
||||||
/**
|
|
||||||
* @brief setTypeLine set type of line
|
|
||||||
* @param value type
|
|
||||||
*/
|
|
||||||
void setTypeLine(const QString &value);
|
void setTypeLine(const QString &value);
|
||||||
/**
|
|
||||||
* @brief getFormula return string of formula
|
|
||||||
* @return formula
|
|
||||||
*/
|
|
||||||
QString getFormula() const;
|
QString getFormula() const;
|
||||||
/**
|
|
||||||
* @brief setFormula set string of formula
|
|
||||||
* @param value formula
|
|
||||||
*/
|
|
||||||
void setFormula(const QString &value);
|
void setFormula(const QString &value);
|
||||||
/**
|
|
||||||
* @brief getP1Line return id first point of line
|
|
||||||
* @return id
|
|
||||||
*/
|
|
||||||
quint32 getP1Line() const;
|
quint32 getP1Line() const;
|
||||||
/**
|
|
||||||
* @brief setP1Line set id first point of line
|
|
||||||
* @param value id
|
|
||||||
* @param id don't show this id in list
|
|
||||||
*/
|
|
||||||
void setP1Line(const quint32 &value, const quint32 &id);
|
void setP1Line(const quint32 &value, const quint32 &id);
|
||||||
/**
|
|
||||||
* @brief getP2Line return id second point of line
|
|
||||||
* @return id
|
|
||||||
*/
|
|
||||||
quint32 getP2Line() const;
|
quint32 getP2Line() const;
|
||||||
/**
|
|
||||||
* @brief setP2Line set id second point of line
|
|
||||||
* @param value id
|
|
||||||
* @param id don't show this id in list
|
|
||||||
*/
|
|
||||||
void setP2Line(const quint32 &value, const quint32 &id);
|
void setP2Line(const quint32 &value, const quint32 &id);
|
||||||
/**
|
|
||||||
* @brief getPShoulder return id shoulder point
|
|
||||||
* @return id
|
|
||||||
*/
|
|
||||||
quint32 getPShoulder() const;
|
quint32 getPShoulder() const;
|
||||||
/**
|
|
||||||
* @brief setPShoulder set id shoulder point
|
|
||||||
* @param value id
|
|
||||||
* @param id don't show this id in list
|
|
||||||
*/
|
|
||||||
void setPShoulder(const quint32 &value, const quint32 &id);
|
void setPShoulder(const quint32 &value, const quint32 &id);
|
||||||
public slots:
|
public slots:
|
||||||
/**
|
|
||||||
* @brief ChoosedObject gets id and type of selected object. Save right data and ignore wrong.
|
|
||||||
* @param id id of point or detail
|
|
||||||
* @param type type of object
|
|
||||||
*/
|
|
||||||
virtual void ChoosedObject(quint32 id, const Valentina::Scenes &type);
|
virtual void ChoosedObject(quint32 id, const Valentina::Scenes &type);
|
||||||
/**
|
|
||||||
* @brief DialogAccepted save data and emit signal about closed dialog.
|
|
||||||
*/
|
|
||||||
virtual void DialogAccepted();
|
virtual void DialogAccepted();
|
||||||
private:
|
private:
|
||||||
Q_DISABLE_COPY(DialogShoulderPoint)
|
Q_DISABLE_COPY(DialogShoulderPoint)
|
||||||
/**
|
|
||||||
* @brief ui keeps information about user interface
|
/** @brief ui keeps information about user interface */
|
||||||
*/
|
|
||||||
Ui::DialogShoulderPoint *ui;
|
Ui::DialogShoulderPoint *ui;
|
||||||
/**
|
|
||||||
* @brief number number of handled objects
|
/** @brief number number of handled objects */
|
||||||
*/
|
|
||||||
qint32 number;
|
qint32 number;
|
||||||
/**
|
|
||||||
* @brief pointName name of point
|
/** @brief pointName name of point */
|
||||||
*/
|
|
||||||
QString pointName;
|
QString pointName;
|
||||||
/**
|
|
||||||
* @brief typeLine type of line
|
/** @brief typeLine type of line */
|
||||||
*/
|
|
||||||
QString typeLine;
|
QString typeLine;
|
||||||
/**
|
|
||||||
* @brief formula formula
|
/** @brief formula formula */
|
||||||
*/
|
|
||||||
QString formula;
|
QString formula;
|
||||||
/**
|
|
||||||
* @brief p1Line id first point of line
|
/** @brief p1Line id first point of line */
|
||||||
*/
|
|
||||||
quint32 p1Line;
|
quint32 p1Line;
|
||||||
/**
|
|
||||||
* @brief p2Line id second point of line
|
/** @brief p2Line id second point of line */
|
||||||
*/
|
|
||||||
quint32 p2Line;
|
quint32 p2Line;
|
||||||
/**
|
|
||||||
* @brief pShoulder id shoulder point
|
/** @brief pShoulder id shoulder point */
|
||||||
*/
|
|
||||||
quint32 pShoulder;
|
quint32 pShoulder;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief getPointName return name of point
|
||||||
|
* @return name
|
||||||
|
*/
|
||||||
inline QString DialogShoulderPoint::getPointName() const
|
inline QString DialogShoulderPoint::getPointName() const
|
||||||
{
|
{
|
||||||
return pointName;
|
return pointName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief getTypeLine return type of line
|
||||||
|
* @return type
|
||||||
|
*/
|
||||||
inline QString DialogShoulderPoint::getTypeLine() const
|
inline QString DialogShoulderPoint::getTypeLine() const
|
||||||
{
|
{
|
||||||
return typeLine;
|
return typeLine;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief getFormula return string of formula
|
||||||
|
* @return formula
|
||||||
|
*/
|
||||||
inline QString DialogShoulderPoint::getFormula() const
|
inline QString DialogShoulderPoint::getFormula() const
|
||||||
{
|
{
|
||||||
return qApp->FormulaFromUser(formula);
|
return qApp->FormulaFromUser(formula);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief getP1Line return id first point of line
|
||||||
|
* @return id
|
||||||
|
*/
|
||||||
inline quint32 DialogShoulderPoint::getP1Line() const
|
inline quint32 DialogShoulderPoint::getP1Line() const
|
||||||
{
|
{
|
||||||
return p1Line;
|
return p1Line;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief getP2Line return id second point of line
|
||||||
|
* @return id
|
||||||
|
*/
|
||||||
inline quint32 DialogShoulderPoint::getP2Line() const
|
inline quint32 DialogShoulderPoint::getP2Line() const
|
||||||
{
|
{
|
||||||
return p2Line;
|
return p2Line;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief getPShoulder return id shoulder point
|
||||||
|
* @return id
|
||||||
|
*/
|
||||||
inline quint32 DialogShoulderPoint::getPShoulder() const
|
inline quint32 DialogShoulderPoint::getPShoulder() const
|
||||||
{
|
{
|
||||||
return pShoulder;
|
return pShoulder;
|
||||||
|
|
|
@ -32,6 +32,11 @@
|
||||||
#include <QPushButton>
|
#include <QPushButton>
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief DialogSinglePoint create dialog
|
||||||
|
* @param data container with data
|
||||||
|
* @param parent parent widget
|
||||||
|
*/
|
||||||
DialogSinglePoint::DialogSinglePoint(const VContainer *data, QWidget *parent)
|
DialogSinglePoint::DialogSinglePoint(const VContainer *data, QWidget *parent)
|
||||||
:DialogTool(data, parent), ui(new Ui::DialogSinglePoint), name(QString()),
|
:DialogTool(data, parent), ui(new Ui::DialogSinglePoint), name(QString()),
|
||||||
point(QPointF())
|
point(QPointF())
|
||||||
|
@ -49,6 +54,10 @@ DialogSinglePoint::DialogSinglePoint(const VContainer *data, QWidget *parent)
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief mousePress get mouse position
|
||||||
|
* @param scenePos position of cursor
|
||||||
|
*/
|
||||||
void DialogSinglePoint::mousePress(const QPointF &scenePos)
|
void DialogSinglePoint::mousePress(const QPointF &scenePos)
|
||||||
{
|
{
|
||||||
if (isInitialized == false)
|
if (isInitialized == false)
|
||||||
|
@ -65,6 +74,9 @@ void DialogSinglePoint::mousePress(const QPointF &scenePos)
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief DialogAccepted save data and emit signal about closed dialog.
|
||||||
|
*/
|
||||||
void DialogSinglePoint::DialogAccepted()
|
void DialogSinglePoint::DialogAccepted()
|
||||||
{
|
{
|
||||||
point = QPointF(qApp->toPixel(ui->doubleSpinBoxX->value()), qApp->toPixel(ui->doubleSpinBoxY->value()));
|
point = QPointF(qApp->toPixel(ui->doubleSpinBoxX->value()), qApp->toPixel(ui->doubleSpinBoxY->value()));
|
||||||
|
@ -73,6 +85,11 @@ void DialogSinglePoint::DialogAccepted()
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief setData set name and point
|
||||||
|
* @param name name of point
|
||||||
|
* @param point data for point
|
||||||
|
*/
|
||||||
void DialogSinglePoint::setData(const QString &name, const QPointF &point)
|
void DialogSinglePoint::setData(const QString &name, const QPointF &point)
|
||||||
{
|
{
|
||||||
this->name = name;
|
this->name = name;
|
||||||
|
|
|
@ -43,60 +43,42 @@ class DialogSinglePoint : public DialogTool
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
/**
|
|
||||||
* @brief DialogSinglePoint create dialog
|
|
||||||
* @param data container with data
|
|
||||||
* @param parent parent widget
|
|
||||||
*/
|
|
||||||
DialogSinglePoint(const VContainer *data, QWidget *parent = nullptr);
|
DialogSinglePoint(const VContainer *data, QWidget *parent = nullptr);
|
||||||
~DialogSinglePoint();
|
~DialogSinglePoint();
|
||||||
/**
|
|
||||||
* @brief setData set name and point
|
|
||||||
* @param name name of point
|
|
||||||
* @param point data for point
|
|
||||||
*/
|
|
||||||
void setData(const QString &name, const QPointF &point);
|
void setData(const QString &name, const QPointF &point);
|
||||||
/**
|
|
||||||
* @brief getName return name
|
|
||||||
* @return name
|
|
||||||
*/
|
|
||||||
QString getName()const;
|
QString getName()const;
|
||||||
/**
|
|
||||||
* @brief getPoint return point
|
|
||||||
* @return point
|
|
||||||
*/
|
|
||||||
QPointF getPoint()const;
|
QPointF getPoint()const;
|
||||||
public slots:
|
public slots:
|
||||||
/**
|
|
||||||
* @brief mousePress get mouse position
|
|
||||||
* @param scenePos position of cursor
|
|
||||||
*/
|
|
||||||
void mousePress(const QPointF &scenePos);
|
void mousePress(const QPointF &scenePos);
|
||||||
/**
|
|
||||||
* @brief DialogAccepted save data and emit signal about closed dialog.
|
|
||||||
*/
|
|
||||||
virtual void DialogAccepted();
|
virtual void DialogAccepted();
|
||||||
private:
|
private:
|
||||||
Q_DISABLE_COPY(DialogSinglePoint)
|
Q_DISABLE_COPY(DialogSinglePoint)
|
||||||
/**
|
|
||||||
* @brief ui keeps information about user interface
|
/** @brief ui keeps information about user interface */
|
||||||
*/
|
|
||||||
Ui::DialogSinglePoint *ui;
|
Ui::DialogSinglePoint *ui;
|
||||||
/**
|
|
||||||
* @brief name name of point
|
/** @brief name name of point */
|
||||||
*/
|
|
||||||
QString name;
|
QString name;
|
||||||
/**
|
|
||||||
* @brief point data of point
|
/** @brief point data of point */
|
||||||
*/
|
|
||||||
QPointF point;
|
QPointF point;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief getName return name
|
||||||
|
* @return name
|
||||||
|
*/
|
||||||
inline QString DialogSinglePoint::getName() const
|
inline QString DialogSinglePoint::getName() const
|
||||||
{
|
{
|
||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief getPoint return point
|
||||||
|
* @return point
|
||||||
|
*/
|
||||||
inline QPointF DialogSinglePoint::getPoint() const
|
inline QPointF DialogSinglePoint::getPoint() const
|
||||||
{
|
{
|
||||||
return point;
|
return point;
|
||||||
|
|
|
@ -32,6 +32,11 @@
|
||||||
#include <QPushButton>
|
#include <QPushButton>
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief DialogSpline create dialog
|
||||||
|
* @param data container with data
|
||||||
|
* @param parent parent widget
|
||||||
|
*/
|
||||||
DialogSpline::DialogSpline(const VContainer *data, QWidget *parent)
|
DialogSpline::DialogSpline(const VContainer *data, QWidget *parent)
|
||||||
:DialogTool(data, parent), ui(new Ui::DialogSpline), number(0), p1(0), p4(0), angle1(0), angle2(0),
|
:DialogTool(data, parent), ui(new Ui::DialogSpline), number(0), p1(0), p4(0), angle1(0), angle2(0),
|
||||||
kAsm1(1), kAsm2(1), kCurve(1)
|
kAsm1(1), kAsm2(1), kCurve(1)
|
||||||
|
@ -50,12 +55,21 @@ DialogSpline::~DialogSpline()
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief getP1 return id first point of spline
|
||||||
|
* @return id
|
||||||
|
*/
|
||||||
quint32 DialogSpline::getP1() const
|
quint32 DialogSpline::getP1() const
|
||||||
{
|
{
|
||||||
return p1;
|
return p1;
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief ChoosedObject gets id and type of selected object. Save right data and ignore wrong.
|
||||||
|
* @param id id of point or detail
|
||||||
|
* @param type type of object
|
||||||
|
*/
|
||||||
void DialogSpline::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
void DialogSpline::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
||||||
{
|
{
|
||||||
if (type == Valentina::Point)
|
if (type == Valentina::Point)
|
||||||
|
@ -98,6 +112,9 @@ void DialogSpline::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief DialogAccepted save data and emit signal about closed dialog.
|
||||||
|
*/
|
||||||
void DialogSpline::DialogAccepted()
|
void DialogSpline::DialogAccepted()
|
||||||
{
|
{
|
||||||
p1 = getCurrentObjectId(ui->comboBoxP1);
|
p1 = getCurrentObjectId(ui->comboBoxP1);
|
||||||
|
@ -111,6 +128,10 @@ void DialogSpline::DialogAccepted()
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief setKCurve set coefficient curve
|
||||||
|
* @param value value. Can be >= 0.
|
||||||
|
*/
|
||||||
void DialogSpline::setKCurve(const qreal &value)
|
void DialogSpline::setKCurve(const qreal &value)
|
||||||
{
|
{
|
||||||
kCurve = value;
|
kCurve = value;
|
||||||
|
@ -118,6 +139,10 @@ void DialogSpline::setKCurve(const qreal &value)
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief setKAsm2 set second coefficient asymmetry
|
||||||
|
* @param value value. Can be >= 0.
|
||||||
|
*/
|
||||||
void DialogSpline::setKAsm2(const qreal &value)
|
void DialogSpline::setKAsm2(const qreal &value)
|
||||||
{
|
{
|
||||||
kAsm2 = value;
|
kAsm2 = value;
|
||||||
|
@ -125,6 +150,10 @@ void DialogSpline::setKAsm2(const qreal &value)
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief setKAsm1 set first coefficient asymmetry
|
||||||
|
* @param value value. Can be >= 0.
|
||||||
|
*/
|
||||||
void DialogSpline::setKAsm1(const qreal &value)
|
void DialogSpline::setKAsm1(const qreal &value)
|
||||||
{
|
{
|
||||||
kAsm1 = value;
|
kAsm1 = value;
|
||||||
|
@ -132,6 +161,10 @@ void DialogSpline::setKAsm1(const qreal &value)
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief setAngle2 set second angle of spline
|
||||||
|
* @param value angle in degree
|
||||||
|
*/
|
||||||
void DialogSpline::setAngle2(const qreal &value)
|
void DialogSpline::setAngle2(const qreal &value)
|
||||||
{
|
{
|
||||||
angle2 = value;
|
angle2 = value;
|
||||||
|
@ -139,6 +172,10 @@ void DialogSpline::setAngle2(const qreal &value)
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief setAngle1 set first angle of spline
|
||||||
|
* @param value angle in degree
|
||||||
|
*/
|
||||||
void DialogSpline::setAngle1(const qreal &value)
|
void DialogSpline::setAngle1(const qreal &value)
|
||||||
{
|
{
|
||||||
angle1 = value;
|
angle1 = value;
|
||||||
|
@ -146,6 +183,10 @@ void DialogSpline::setAngle1(const qreal &value)
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief setP4 set id fourth point of spline
|
||||||
|
* @param value id
|
||||||
|
*/
|
||||||
void DialogSpline::setP4(const quint32 &value)
|
void DialogSpline::setP4(const quint32 &value)
|
||||||
{
|
{
|
||||||
p4 = value;
|
p4 = value;
|
||||||
|
@ -153,6 +194,10 @@ void DialogSpline::setP4(const quint32 &value)
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief setP1 set id first point of spline
|
||||||
|
* @param value id
|
||||||
|
*/
|
||||||
void DialogSpline::setP1(const quint32 &value)
|
void DialogSpline::setP1(const quint32 &value)
|
||||||
{
|
{
|
||||||
p1 = value;
|
p1 = value;
|
||||||
|
@ -160,6 +205,10 @@ void DialogSpline::setP1(const quint32 &value)
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief getP4 return id fourth point of spline
|
||||||
|
* @return id
|
||||||
|
*/
|
||||||
quint32 DialogSpline::getP4() const
|
quint32 DialogSpline::getP4() const
|
||||||
{
|
{
|
||||||
return p4;
|
return p4;
|
||||||
|
|
|
@ -43,154 +43,108 @@ class DialogSpline : public DialogTool
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
/**
|
|
||||||
* @brief DialogSpline create dialog
|
|
||||||
* @param data container with data
|
|
||||||
* @param parent parent widget
|
|
||||||
*/
|
|
||||||
DialogSpline(const VContainer *data, QWidget *parent = nullptr);
|
DialogSpline(const VContainer *data, QWidget *parent = nullptr);
|
||||||
~DialogSpline();
|
~DialogSpline();
|
||||||
/**
|
|
||||||
* @brief getP1 return id first point of spline
|
|
||||||
* @return id
|
|
||||||
*/
|
|
||||||
quint32 getP1() const;
|
quint32 getP1() const;
|
||||||
/**
|
|
||||||
* @brief setP1 set id first point of spline
|
|
||||||
* @param value id
|
|
||||||
*/
|
|
||||||
void setP1(const quint32 &value);
|
void setP1(const quint32 &value);
|
||||||
/**
|
|
||||||
* @brief getP4 return id fourth point of spline
|
|
||||||
* @return id
|
|
||||||
*/
|
|
||||||
quint32 getP4() const;
|
quint32 getP4() const;
|
||||||
/**
|
|
||||||
* @brief setP4 set id fourth point of spline
|
|
||||||
* @param value id
|
|
||||||
*/
|
|
||||||
void setP4(const quint32 &value);
|
void setP4(const quint32 &value);
|
||||||
/**
|
|
||||||
* @brief getAngle1 return first angle of spline
|
|
||||||
* @return angle in degree
|
|
||||||
*/
|
|
||||||
qreal getAngle1() const;
|
qreal getAngle1() const;
|
||||||
/**
|
|
||||||
* @brief setAngle1 set first angle of spline
|
|
||||||
* @param value angle in degree
|
|
||||||
*/
|
|
||||||
void setAngle1(const qreal &value);
|
void setAngle1(const qreal &value);
|
||||||
/**
|
|
||||||
* @brief getAngle2 return second angle of spline
|
|
||||||
* @return angle in degree
|
|
||||||
*/
|
|
||||||
qreal getAngle2() const;
|
qreal getAngle2() const;
|
||||||
/**
|
|
||||||
* @brief setAngle2 set second angle of spline
|
|
||||||
* @param value angle in degree
|
|
||||||
*/
|
|
||||||
void setAngle2(const qreal &value);
|
void setAngle2(const qreal &value);
|
||||||
/**
|
|
||||||
* @brief getKAsm1 return first coefficient asymmetry
|
|
||||||
* @return value. Can be >= 0.
|
|
||||||
*/
|
|
||||||
qreal getKAsm1() const;
|
qreal getKAsm1() const;
|
||||||
/**
|
|
||||||
* @brief setKAsm1 set first coefficient asymmetry
|
|
||||||
* @param value value. Can be >= 0.
|
|
||||||
*/
|
|
||||||
void setKAsm1(const qreal &value);
|
void setKAsm1(const qreal &value);
|
||||||
/**
|
|
||||||
* @brief getKAsm2 return second coefficient asymmetry
|
|
||||||
* @return value. Can be >= 0.
|
|
||||||
*/
|
|
||||||
qreal getKAsm2() const;
|
qreal getKAsm2() const;
|
||||||
/**
|
|
||||||
* @brief setKAsm2 set second coefficient asymmetry
|
|
||||||
* @param value value. Can be >= 0.
|
|
||||||
*/
|
|
||||||
void setKAsm2(const qreal &value);
|
void setKAsm2(const qreal &value);
|
||||||
/**
|
|
||||||
* @brief getKCurve return coefficient curve
|
|
||||||
* @return value. Can be >= 0.
|
|
||||||
*/
|
|
||||||
qreal getKCurve() const;
|
qreal getKCurve() const;
|
||||||
/**
|
|
||||||
* @brief setKCurve set coefficient curve
|
|
||||||
* @param value value. Can be >= 0.
|
|
||||||
*/
|
|
||||||
void setKCurve(const qreal &value);
|
void setKCurve(const qreal &value);
|
||||||
public slots:
|
public slots:
|
||||||
/**
|
|
||||||
* @brief ChoosedObject gets id and type of selected object. Save right data and ignore wrong.
|
|
||||||
* @param id id of point or detail
|
|
||||||
* @param type type of object
|
|
||||||
*/
|
|
||||||
virtual void ChoosedObject(quint32 id, const Valentina::Scenes &type);
|
virtual void ChoosedObject(quint32 id, const Valentina::Scenes &type);
|
||||||
/**
|
|
||||||
* @brief DialogAccepted save data and emit signal about closed dialog.
|
|
||||||
*/
|
|
||||||
virtual void DialogAccepted();
|
virtual void DialogAccepted();
|
||||||
private:
|
private:
|
||||||
Q_DISABLE_COPY(DialogSpline)
|
Q_DISABLE_COPY(DialogSpline)
|
||||||
/**
|
|
||||||
* @brief ui keeps information about user interface
|
/** @brief ui keeps information about user interface */
|
||||||
*/
|
|
||||||
Ui::DialogSpline *ui;
|
Ui::DialogSpline *ui;
|
||||||
/**
|
|
||||||
* @brief number number of handled objects
|
/** @brief number number of handled objects */
|
||||||
*/
|
|
||||||
qint32 number;
|
qint32 number;
|
||||||
/**
|
|
||||||
* @brief p1 id first point of spline
|
/** @brief p1 id first point of spline */
|
||||||
*/
|
|
||||||
quint32 p1;
|
quint32 p1;
|
||||||
/**
|
|
||||||
* @brief p4 id fourth point of spline
|
/** @brief p4 id fourth point of spline */
|
||||||
*/
|
|
||||||
quint32 p4;
|
quint32 p4;
|
||||||
/**
|
|
||||||
* @brief angle1 first angle of spline in degree
|
/** @brief angle1 first angle of spline in degree */
|
||||||
*/
|
|
||||||
qreal angle1;
|
qreal angle1;
|
||||||
/**
|
|
||||||
* @brief angle2 second angle of spline in degree
|
/** @brief angle2 second angle of spline in degree */
|
||||||
*/
|
|
||||||
qreal angle2;
|
qreal angle2;
|
||||||
/**
|
|
||||||
* @brief kAsm1 first coefficient asymmetry
|
/** @brief kAsm1 first coefficient asymmetry */
|
||||||
*/
|
|
||||||
qreal kAsm1;
|
qreal kAsm1;
|
||||||
/**
|
|
||||||
* @brief kAsm2 second coefficient asymmetry
|
/** @brief kAsm2 second coefficient asymmetry */
|
||||||
*/
|
|
||||||
qreal kAsm2;
|
qreal kAsm2;
|
||||||
/**
|
|
||||||
* @brief kCurve coefficient curve
|
/** @brief kCurve coefficient curve */
|
||||||
*/
|
|
||||||
qreal kCurve;
|
qreal kCurve;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief getAngle1 return first angle of spline
|
||||||
|
* @return angle in degree
|
||||||
|
*/
|
||||||
inline qreal DialogSpline::getAngle1() const
|
inline qreal DialogSpline::getAngle1() const
|
||||||
{
|
{
|
||||||
return angle1;
|
return angle1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief getAngle2 return second angle of spline
|
||||||
|
* @return angle in degree
|
||||||
|
*/
|
||||||
inline qreal DialogSpline::getAngle2() const
|
inline qreal DialogSpline::getAngle2() const
|
||||||
{
|
{
|
||||||
return angle2;
|
return angle2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief getKAsm1 return first coefficient asymmetry
|
||||||
|
* @return value. Can be >= 0.
|
||||||
|
*/
|
||||||
inline qreal DialogSpline::getKAsm1() const
|
inline qreal DialogSpline::getKAsm1() const
|
||||||
{
|
{
|
||||||
return kAsm1;
|
return kAsm1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief getKAsm2 return second coefficient asymmetry
|
||||||
|
* @return value. Can be >= 0.
|
||||||
|
*/
|
||||||
inline qreal DialogSpline::getKAsm2() const
|
inline qreal DialogSpline::getKAsm2() const
|
||||||
{
|
{
|
||||||
return kAsm2;
|
return kAsm2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief getKCurve return coefficient curve
|
||||||
|
* @return value. Can be >= 0.
|
||||||
|
*/
|
||||||
inline qreal DialogSpline::getKCurve() const
|
inline qreal DialogSpline::getKCurve() const
|
||||||
{
|
{
|
||||||
return kCurve;
|
return kCurve;
|
||||||
|
|
|
@ -33,6 +33,11 @@
|
||||||
#include <QPushButton>
|
#include <QPushButton>
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief DialogSplinePath create dialog
|
||||||
|
* @param data container with data
|
||||||
|
* @param parent parent widget
|
||||||
|
*/
|
||||||
DialogSplinePath::DialogSplinePath(const VContainer *data, QWidget *parent)
|
DialogSplinePath::DialogSplinePath(const VContainer *data, QWidget *parent)
|
||||||
:DialogTool(data, parent), ui(new Ui::DialogSplinePath), path(VSplinePath())
|
:DialogTool(data, parent), ui(new Ui::DialogSplinePath), path(VSplinePath())
|
||||||
{
|
{
|
||||||
|
@ -62,6 +67,10 @@ DialogSplinePath::~DialogSplinePath()
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief SetPath set spline path
|
||||||
|
* @param value path
|
||||||
|
*/
|
||||||
void DialogSplinePath::SetPath(const VSplinePath &value)
|
void DialogSplinePath::SetPath(const VSplinePath &value)
|
||||||
{
|
{
|
||||||
this->path = value;
|
this->path = value;
|
||||||
|
@ -75,6 +84,11 @@ void DialogSplinePath::SetPath(const VSplinePath &value)
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief ChoosedObject gets id and type of selected object. Save right data and ignore wrong.
|
||||||
|
* @param id id of point or detail
|
||||||
|
* @param type don't show this id in list
|
||||||
|
*/
|
||||||
void DialogSplinePath::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
void DialogSplinePath::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
||||||
{
|
{
|
||||||
if (type == Valentina::Point)
|
if (type == Valentina::Point)
|
||||||
|
@ -86,6 +100,9 @@ void DialogSplinePath::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief DialogAccepted save data and emit signal about closed dialog.
|
||||||
|
*/
|
||||||
void DialogSplinePath::DialogAccepted()
|
void DialogSplinePath::DialogAccepted()
|
||||||
{
|
{
|
||||||
path.Clear();
|
path.Clear();
|
||||||
|
@ -100,6 +117,10 @@ void DialogSplinePath::DialogAccepted()
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief PointChanged selected another point in list
|
||||||
|
* @param row number of row
|
||||||
|
*/
|
||||||
void DialogSplinePath::PointChanged(int row)
|
void DialogSplinePath::PointChanged(int row)
|
||||||
{
|
{
|
||||||
if (ui->listWidget->count() == 0)
|
if (ui->listWidget->count() == 0)
|
||||||
|
@ -113,6 +134,10 @@ void DialogSplinePath::PointChanged(int row)
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief currentPointChanged changed point in combo box
|
||||||
|
* @param index index in list
|
||||||
|
*/
|
||||||
void DialogSplinePath::currentPointChanged(int index)
|
void DialogSplinePath::currentPointChanged(int index)
|
||||||
{
|
{
|
||||||
quint32 id = qvariant_cast<quint32>(ui->comboBoxPoint->itemData(index));
|
quint32 id = qvariant_cast<quint32>(ui->comboBoxPoint->itemData(index));
|
||||||
|
@ -127,6 +152,10 @@ void DialogSplinePath::currentPointChanged(int index)
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief Angle1Changed changed first angle
|
||||||
|
* @param index index in list
|
||||||
|
*/
|
||||||
void DialogSplinePath::Angle1Changed(qreal index)
|
void DialogSplinePath::Angle1Changed(qreal index)
|
||||||
{
|
{
|
||||||
qint32 row = ui->listWidget->currentRow();
|
qint32 row = ui->listWidget->currentRow();
|
||||||
|
@ -139,6 +168,10 @@ void DialogSplinePath::Angle1Changed(qreal index)
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief Angle2Changed changed second angle
|
||||||
|
* @param index index in list
|
||||||
|
*/
|
||||||
void DialogSplinePath::Angle2Changed(qreal index)
|
void DialogSplinePath::Angle2Changed(qreal index)
|
||||||
{
|
{
|
||||||
qint32 row = ui->listWidget->currentRow();
|
qint32 row = ui->listWidget->currentRow();
|
||||||
|
@ -151,6 +184,10 @@ void DialogSplinePath::Angle2Changed(qreal index)
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief KAsm1Changed changed first coefficient asymmetry
|
||||||
|
* @param d value
|
||||||
|
*/
|
||||||
void DialogSplinePath::KAsm1Changed(qreal d)
|
void DialogSplinePath::KAsm1Changed(qreal d)
|
||||||
{
|
{
|
||||||
qint32 row = ui->listWidget->currentRow();
|
qint32 row = ui->listWidget->currentRow();
|
||||||
|
@ -161,6 +198,10 @@ void DialogSplinePath::KAsm1Changed(qreal d)
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief KAsm2Changed changed second coefficient asymmetry
|
||||||
|
* @param d value
|
||||||
|
*/
|
||||||
void DialogSplinePath::KAsm2Changed(qreal d)
|
void DialogSplinePath::KAsm2Changed(qreal d)
|
||||||
{
|
{
|
||||||
qint32 row = ui->listWidget->currentRow();
|
qint32 row = ui->listWidget->currentRow();
|
||||||
|
@ -171,6 +212,14 @@ void DialogSplinePath::KAsm2Changed(qreal d)
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief NewItem add point to list
|
||||||
|
* @param id id
|
||||||
|
* @param kAsm1 first coefficient asymmetry
|
||||||
|
* @param angle1 first angle in degree
|
||||||
|
* @param kAsm2 second coefficient asymmetry
|
||||||
|
* @param angle2 second angle in degree
|
||||||
|
*/
|
||||||
void DialogSplinePath::NewItem(quint32 id, qreal kAsm1, qreal angle1, qreal kAsm2, qreal angle2)
|
void DialogSplinePath::NewItem(quint32 id, qreal kAsm1, qreal angle1, qreal kAsm2, qreal angle2)
|
||||||
{
|
{
|
||||||
const VPointF *point = data->GeometricObject<const VPointF *>(id);
|
const VPointF *point = data->GeometricObject<const VPointF *>(id);
|
||||||
|
@ -190,6 +239,14 @@ void DialogSplinePath::NewItem(quint32 id, qreal kAsm1, qreal angle1, qreal kAsm
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief dataPoint show data of point in fields
|
||||||
|
* @param id id
|
||||||
|
* @param kAsm1 first coefficient asymmetry
|
||||||
|
* @param angle1 first angle of spline
|
||||||
|
* @param kAsm2 second coefficient asymmetry
|
||||||
|
* @param angle2 second angle of spline
|
||||||
|
*/
|
||||||
void DialogSplinePath::DataPoint(quint32 id, qreal kAsm1, qreal angle1, qreal kAsm2, qreal angle2)
|
void DialogSplinePath::DataPoint(quint32 id, qreal kAsm1, qreal angle1, qreal kAsm2, qreal angle2)
|
||||||
{
|
{
|
||||||
disconnect(ui->comboBoxPoint, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged),
|
disconnect(ui->comboBoxPoint, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged),
|
||||||
|
@ -222,6 +279,9 @@ void DialogSplinePath::DataPoint(quint32 id, qreal kAsm1, qreal angle1, qreal kA
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief EnableFields enable or disable fields
|
||||||
|
*/
|
||||||
void DialogSplinePath::EnableFields()
|
void DialogSplinePath::EnableFields()
|
||||||
{
|
{
|
||||||
ui->doubleSpinBoxKasm1->setEnabled(true);
|
ui->doubleSpinBoxKasm1->setEnabled(true);
|
||||||
|
|
|
@ -44,98 +44,39 @@ class DialogSplinePath : public DialogTool
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
/**
|
|
||||||
* @brief DialogSplinePath create dialog
|
|
||||||
* @param data container with data
|
|
||||||
* @param parent parent widget
|
|
||||||
*/
|
|
||||||
DialogSplinePath(const VContainer *data, QWidget *parent = nullptr);
|
DialogSplinePath(const VContainer *data, QWidget *parent = nullptr);
|
||||||
~DialogSplinePath();
|
~DialogSplinePath();
|
||||||
/**
|
|
||||||
* @brief GetPath return spline path
|
|
||||||
* @return path
|
|
||||||
*/
|
|
||||||
VSplinePath GetPath() const;
|
VSplinePath GetPath() const;
|
||||||
/**
|
|
||||||
* @brief SetPath set spline path
|
|
||||||
* @param value path
|
|
||||||
*/
|
|
||||||
void SetPath(const VSplinePath &value);
|
void SetPath(const VSplinePath &value);
|
||||||
public slots:
|
public slots:
|
||||||
/**
|
|
||||||
* @brief ChoosedObject gets id and type of selected object. Save right data and ignore wrong.
|
|
||||||
* @param id id of point or detail
|
|
||||||
* @param type don't show this id in list
|
|
||||||
*/
|
|
||||||
virtual void ChoosedObject(quint32 id, const Valentina::Scenes &type);
|
virtual void ChoosedObject(quint32 id, const Valentina::Scenes &type);
|
||||||
/**
|
|
||||||
* @brief DialogAccepted save data and emit signal about closed dialog.
|
|
||||||
*/
|
|
||||||
virtual void DialogAccepted();
|
virtual void DialogAccepted();
|
||||||
/**
|
|
||||||
* @brief PointChanged selected another point in list
|
|
||||||
* @param row number of row
|
|
||||||
*/
|
|
||||||
void PointChanged(int row);
|
void PointChanged(int row);
|
||||||
/**
|
|
||||||
* @brief currentPointChanged changed point in combo box
|
|
||||||
* @param index index in list
|
|
||||||
*/
|
|
||||||
void currentPointChanged( int index );
|
void currentPointChanged( int index );
|
||||||
/**
|
|
||||||
* @brief Angle1Changed changed first angle
|
|
||||||
* @param index index in list
|
|
||||||
*/
|
|
||||||
void Angle1Changed(qreal index );
|
void Angle1Changed(qreal index );
|
||||||
/**
|
|
||||||
* @brief Angle2Changed changed second angle
|
|
||||||
* @param index index in list
|
|
||||||
*/
|
|
||||||
void Angle2Changed( qreal index );
|
void Angle2Changed( qreal index );
|
||||||
/**
|
|
||||||
* @brief KAsm1Changed changed first coefficient asymmetry
|
|
||||||
* @param d value
|
|
||||||
*/
|
|
||||||
void KAsm1Changed(qreal d);
|
void KAsm1Changed(qreal d);
|
||||||
/**
|
|
||||||
* @brief KAsm2Changed changed second coefficient asymmetry
|
|
||||||
* @param d value
|
|
||||||
*/
|
|
||||||
void KAsm2Changed(qreal d);
|
void KAsm2Changed(qreal d);
|
||||||
private:
|
private:
|
||||||
Q_DISABLE_COPY(DialogSplinePath)
|
Q_DISABLE_COPY(DialogSplinePath)
|
||||||
/**
|
|
||||||
* @brief ui keeps information about user interface
|
/** @brief ui keeps information about user interface */
|
||||||
*/
|
|
||||||
Ui::DialogSplinePath *ui;
|
Ui::DialogSplinePath *ui;
|
||||||
/**
|
|
||||||
* @brief path spline path
|
/** @brief path spline path */
|
||||||
*/
|
|
||||||
VSplinePath path;
|
VSplinePath path;
|
||||||
/**
|
|
||||||
* @brief NewItem add point to list
|
|
||||||
* @param id id
|
|
||||||
* @param kAsm1 first coefficient asymmetry
|
|
||||||
* @param angle1 first angle in degree
|
|
||||||
* @param kAsm2 second coefficient asymmetry
|
|
||||||
* @param angle2 second angle in degree
|
|
||||||
*/
|
|
||||||
void NewItem(quint32 id, qreal kAsm1, qreal angle1, qreal kAsm2, qreal angle2);
|
void NewItem(quint32 id, qreal kAsm1, qreal angle1, qreal kAsm2, qreal angle2);
|
||||||
/**
|
|
||||||
* @brief dataPoint show data of point in fields
|
|
||||||
* @param id id
|
|
||||||
* @param kAsm1 first coefficient asymmetry
|
|
||||||
* @param angle1 first angle of spline
|
|
||||||
* @param kAsm2 second coefficient asymmetry
|
|
||||||
* @param angle2 second angle of spline
|
|
||||||
*/
|
|
||||||
void DataPoint(quint32 id, qreal kAsm1, qreal angle1, qreal kAsm2, qreal angle2);
|
void DataPoint(quint32 id, qreal kAsm1, qreal angle1, qreal kAsm2, qreal angle2);
|
||||||
/**
|
|
||||||
* @brief EnableFields enable or disable fields
|
|
||||||
*/
|
|
||||||
void EnableFields();
|
void EnableFields();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief GetPath return spline path
|
||||||
|
* @return path
|
||||||
|
*/
|
||||||
inline VSplinePath DialogSplinePath::GetPath() const
|
inline VSplinePath DialogSplinePath::GetPath() const
|
||||||
{
|
{
|
||||||
return path;
|
return path;
|
||||||
|
|
|
@ -35,6 +35,11 @@
|
||||||
#include "../../../libs/qmuparser/qmuparsererror.h"
|
#include "../../../libs/qmuparser/qmuparsererror.h"
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief DialogTool create dialog
|
||||||
|
* @param data container with data
|
||||||
|
* @param parent parent widget
|
||||||
|
*/
|
||||||
DialogTool::DialogTool(const VContainer *data, QWidget *parent)
|
DialogTool::DialogTool(const VContainer *data, QWidget *parent)
|
||||||
:QDialog(parent), data(data), isInitialized(false), flagName(true), flagFormula(true), timerFormula(nullptr),
|
:QDialog(parent), data(data), isInitialized(false), flagName(true), flagFormula(true), timerFormula(nullptr),
|
||||||
bOk(nullptr), spinBoxAngle(nullptr), lineEditFormula(nullptr), listWidget(nullptr),
|
bOk(nullptr), spinBoxAngle(nullptr), lineEditFormula(nullptr), listWidget(nullptr),
|
||||||
|
@ -54,6 +59,10 @@ DialogTool::DialogTool(const VContainer *data, QWidget *parent)
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief closeEvent handle when dialog cloded
|
||||||
|
* @param event event
|
||||||
|
*/
|
||||||
void DialogTool::closeEvent(QCloseEvent *event)
|
void DialogTool::closeEvent(QCloseEvent *event)
|
||||||
{
|
{
|
||||||
DialogClosed(QDialog::Rejected);
|
DialogClosed(QDialog::Rejected);
|
||||||
|
@ -61,6 +70,10 @@ void DialogTool::closeEvent(QCloseEvent *event)
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief showEvent handle when window show
|
||||||
|
* @param event event
|
||||||
|
*/
|
||||||
void DialogTool::showEvent(QShowEvent *event)
|
void DialogTool::showEvent(QShowEvent *event)
|
||||||
{
|
{
|
||||||
QDialog::showEvent( event );
|
QDialog::showEvent( event );
|
||||||
|
@ -76,6 +89,11 @@ void DialogTool::showEvent(QShowEvent *event)
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief FillComboBoxPoints fill comboBox list of points
|
||||||
|
* @param box comboBox
|
||||||
|
* @param id don't show this id in list
|
||||||
|
*/
|
||||||
void DialogTool::FillComboBoxPoints(QComboBox *box, const quint32 &id) const
|
void DialogTool::FillComboBoxPoints(QComboBox *box, const quint32 &id) const
|
||||||
{
|
{
|
||||||
Q_CHECK_PTR(box);
|
Q_CHECK_PTR(box);
|
||||||
|
@ -137,6 +155,12 @@ void DialogTool::FillComboBoxArcs(QComboBox *box, const quint32 &id, ComboMode::
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief FillComboBoxSplines fill comboBox list of splines
|
||||||
|
* @param box comboBox
|
||||||
|
* @param id don't show id in list
|
||||||
|
* @param cut if set to ComboMode::CutSpline don't show id+1 and id+2
|
||||||
|
*/
|
||||||
void DialogTool::FillComboBoxSplines(QComboBox *box, const quint32 &id, ComboMode::ComboBoxCutSpline cut) const
|
void DialogTool::FillComboBoxSplines(QComboBox *box, const quint32 &id, ComboMode::ComboBoxCutSpline cut) const
|
||||||
{
|
{
|
||||||
Q_CHECK_PTR(box);
|
Q_CHECK_PTR(box);
|
||||||
|
@ -175,6 +199,12 @@ void DialogTool::FillComboBoxSplines(QComboBox *box, const quint32 &id, ComboMod
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief FillComboBoxSplinesPath
|
||||||
|
* @param box comboBox
|
||||||
|
* @param id don't show id in list
|
||||||
|
* @param cut if set to ComboMode::CutSpline don't show id+1 and id+2
|
||||||
|
*/
|
||||||
void DialogTool::FillComboBoxSplinesPath(QComboBox *box, const quint32 &id, ComboMode::ComboBoxCutSpline cut) const
|
void DialogTool::FillComboBoxSplinesPath(QComboBox *box, const quint32 &id, ComboMode::ComboBoxCutSpline cut) const
|
||||||
{
|
{
|
||||||
Q_CHECK_PTR(box);
|
Q_CHECK_PTR(box);
|
||||||
|
@ -213,6 +243,10 @@ void DialogTool::FillComboBoxSplinesPath(QComboBox *box, const quint32 &id, Comb
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief FillComboBoxTypeLine fill comboBox list of type lines
|
||||||
|
* @param box comboBox
|
||||||
|
*/
|
||||||
void DialogTool::FillComboBoxTypeLine(QComboBox *box) const
|
void DialogTool::FillComboBoxTypeLine(QComboBox *box) const
|
||||||
{
|
{
|
||||||
Q_CHECK_PTR(box);
|
Q_CHECK_PTR(box);
|
||||||
|
@ -221,6 +255,11 @@ void DialogTool::FillComboBoxTypeLine(QComboBox *box) const
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief getTypeLine return type of line
|
||||||
|
* @param box combobox
|
||||||
|
* @return type
|
||||||
|
*/
|
||||||
QString DialogTool::GetTypeLine(const QComboBox *box) const
|
QString DialogTool::GetTypeLine(const QComboBox *box) const
|
||||||
{
|
{
|
||||||
switch (lineStyles.indexOf(box->currentText()))
|
switch (lineStyles.indexOf(box->currentText()))
|
||||||
|
@ -250,6 +289,11 @@ QString DialogTool::GetTypeLine(const QComboBox *box) const
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief SetupTypeLine setupe type of line
|
||||||
|
* @param box combobox
|
||||||
|
* @param value string from pattern file
|
||||||
|
*/
|
||||||
void DialogTool::SetupTypeLine(QComboBox *box, const QString &value)
|
void DialogTool::SetupTypeLine(QComboBox *box, const QString &value)
|
||||||
{
|
{
|
||||||
QStringList styles = VAbstractTool::Styles();
|
QStringList styles = VAbstractTool::Styles();
|
||||||
|
@ -261,6 +305,11 @@ void DialogTool::SetupTypeLine(QComboBox *box, const QString &value)
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief ChangeCurrentText select item in combobox by name
|
||||||
|
* @param box combobox
|
||||||
|
* @param value name of item
|
||||||
|
*/
|
||||||
void DialogTool::ChangeCurrentText(QComboBox *box, const QString &value)
|
void DialogTool::ChangeCurrentText(QComboBox *box, const QString &value)
|
||||||
{
|
{
|
||||||
qint32 index = box->findText(value);
|
qint32 index = box->findText(value);
|
||||||
|
@ -275,6 +324,11 @@ void DialogTool::ChangeCurrentText(QComboBox *box, const QString &value)
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief ChangeCurrentData select item in combobox by id
|
||||||
|
* @param box combobox
|
||||||
|
* @param value id of item
|
||||||
|
*/
|
||||||
void DialogTool::ChangeCurrentData(QComboBox *box, const quint32 &value) const
|
void DialogTool::ChangeCurrentData(QComboBox *box, const quint32 &value) const
|
||||||
{
|
{
|
||||||
qint32 index = box->findData(value);
|
qint32 index = box->findData(value);
|
||||||
|
@ -285,6 +339,11 @@ void DialogTool::ChangeCurrentData(QComboBox *box, const quint32 &value) const
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief PutValHere put variable into line edit from list
|
||||||
|
* @param lineEdit lineEdit
|
||||||
|
* @param listWidget listWidget
|
||||||
|
*/
|
||||||
void DialogTool::PutValHere(QLineEdit *lineEdit, QListWidget *listWidget)
|
void DialogTool::PutValHere(QLineEdit *lineEdit, QListWidget *listWidget)
|
||||||
{
|
{
|
||||||
Q_CHECK_PTR(lineEdit);
|
Q_CHECK_PTR(lineEdit);
|
||||||
|
@ -298,6 +357,12 @@ void DialogTool::PutValHere(QLineEdit *lineEdit, QListWidget *listWidget)
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief ValFormulaChanged handle change formula
|
||||||
|
* @param flag flag state of formula
|
||||||
|
* @param edit LineEdit
|
||||||
|
* @param timer timer of formula
|
||||||
|
*/
|
||||||
void DialogTool::ValFormulaChanged(bool &flag, QLineEdit *edit, QTimer *timer)
|
void DialogTool::ValFormulaChanged(bool &flag, QLineEdit *edit, QTimer *timer)
|
||||||
{
|
{
|
||||||
Q_CHECK_PTR(edit);
|
Q_CHECK_PTR(edit);
|
||||||
|
@ -316,6 +381,13 @@ void DialogTool::ValFormulaChanged(bool &flag, QLineEdit *edit, QTimer *timer)
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief Eval evaluate formula and show result
|
||||||
|
* @param edit lineEdit of formula
|
||||||
|
* @param flag flag state of formula
|
||||||
|
* @param timer timer of formula
|
||||||
|
* @param label label for signal error
|
||||||
|
*/
|
||||||
void DialogTool::Eval(QLineEdit *edit, bool &flag, QTimer *timer, QLabel *label)
|
void DialogTool::Eval(QLineEdit *edit, bool &flag, QTimer *timer, QLabel *label)
|
||||||
{
|
{
|
||||||
Q_CHECK_PTR(edit);
|
Q_CHECK_PTR(edit);
|
||||||
|
@ -374,6 +446,13 @@ void DialogTool::Eval(QLineEdit *edit, bool &flag, QTimer *timer, QLabel *label)
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief setCurrentPointId set current point id in combobox
|
||||||
|
* @param box combobox
|
||||||
|
* @param pointId save current point id
|
||||||
|
* @param value point id
|
||||||
|
* @param id don't show this id in list
|
||||||
|
*/
|
||||||
void DialogTool::setCurrentPointId(QComboBox *box, quint32 &pointId, const quint32 &value, const quint32 &id) const
|
void DialogTool::setCurrentPointId(QComboBox *box, quint32 &pointId, const quint32 &value, const quint32 &id) const
|
||||||
{
|
{
|
||||||
Q_CHECK_PTR(box);
|
Q_CHECK_PTR(box);
|
||||||
|
@ -383,6 +462,14 @@ void DialogTool::setCurrentPointId(QComboBox *box, quint32 &pointId, const quint
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief setCurrentSplineId set current spline id in combobox
|
||||||
|
* @param box combobox
|
||||||
|
* @param splineId save current spline id
|
||||||
|
* @param value spline id
|
||||||
|
* @param id don't show this id in list
|
||||||
|
* @param cut if set to ComboMode::CutSpline don't show id+1 and id+2
|
||||||
|
*/
|
||||||
void DialogTool::setCurrentSplineId(QComboBox *box, quint32 &splineId, const quint32 &value, const quint32 &id,
|
void DialogTool::setCurrentSplineId(QComboBox *box, quint32 &splineId, const quint32 &value, const quint32 &id,
|
||||||
ComboMode::ComboBoxCutSpline cut) const
|
ComboMode::ComboBoxCutSpline cut) const
|
||||||
{
|
{
|
||||||
|
@ -393,6 +480,14 @@ void DialogTool::setCurrentSplineId(QComboBox *box, quint32 &splineId, const qui
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief setCurrentArcId
|
||||||
|
* @param box combobox
|
||||||
|
* @param arcId save current arc id
|
||||||
|
* @param value arc id
|
||||||
|
* @param id don't show this id in list
|
||||||
|
* @param cut if set to ComboMode::CutArc don't show id+1 and id+2
|
||||||
|
*/
|
||||||
void DialogTool::setCurrentArcId(QComboBox *box, quint32 &arcId, const quint32 &value, const quint32 &id,
|
void DialogTool::setCurrentArcId(QComboBox *box, quint32 &arcId, const quint32 &value, const quint32 &id,
|
||||||
ComboMode::ComboBoxCutArc cut) const
|
ComboMode::ComboBoxCutArc cut) const
|
||||||
{
|
{
|
||||||
|
@ -403,6 +498,14 @@ void DialogTool::setCurrentArcId(QComboBox *box, quint32 &arcId, const quint32 &
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief setCurrentSplinePathId set current splinePath id in combobox
|
||||||
|
* @param box combobox
|
||||||
|
* @param splinePathId save current splinePath id
|
||||||
|
* @param value splinePath id
|
||||||
|
* @param id don't show this id in list
|
||||||
|
* @param cut if set to ComboMode::CutSpline don't show id+1 and id+2
|
||||||
|
*/
|
||||||
void DialogTool::setCurrentSplinePathId(QComboBox *box, quint32 &splinePathId, const quint32 &value,
|
void DialogTool::setCurrentSplinePathId(QComboBox *box, quint32 &splinePathId, const quint32 &value,
|
||||||
const quint32 &id, ComboMode::ComboBoxCutSpline cut) const
|
const quint32 &id, ComboMode::ComboBoxCutSpline cut) const
|
||||||
{
|
{
|
||||||
|
@ -413,6 +516,11 @@ void DialogTool::setCurrentSplinePathId(QComboBox *box, quint32 &splinePathId, c
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief getCurrentPointId return current point id stored in combobox
|
||||||
|
* @param box combobox
|
||||||
|
* @return id or 0 if combobox is empty
|
||||||
|
*/
|
||||||
quint32 DialogTool::getCurrentObjectId(QComboBox *box) const
|
quint32 DialogTool::getCurrentObjectId(QComboBox *box) const
|
||||||
{
|
{
|
||||||
Q_CHECK_PTR(box);
|
Q_CHECK_PTR(box);
|
||||||
|
@ -445,6 +553,11 @@ bool DialogTool::ChoosedPoint(const quint32 &id, QComboBox *box, const QString &
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief FillList fill combobox list
|
||||||
|
* @param box combobox
|
||||||
|
* @param list list with ids and names
|
||||||
|
*/
|
||||||
void DialogTool::FillList(QComboBox *box, const QMap<QString, quint32> &list) const
|
void DialogTool::FillList(QComboBox *box, const QMap<QString, quint32> &list) const
|
||||||
{
|
{
|
||||||
Q_CHECK_PTR(box);
|
Q_CHECK_PTR(box);
|
||||||
|
@ -459,6 +572,9 @@ void DialogTool::FillList(QComboBox *box, const QMap<QString, quint32> &list) co
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief CheckState enable, when all is correct, or disable, when something wrong, button ok
|
||||||
|
*/
|
||||||
void DialogTool::CheckState()
|
void DialogTool::CheckState()
|
||||||
{
|
{
|
||||||
Q_CHECK_PTR(bOk);
|
Q_CHECK_PTR(bOk);
|
||||||
|
@ -466,6 +582,11 @@ void DialogTool::CheckState()
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief ChoosedObject gets id and type of selected object. Save right data and ignore wrong.
|
||||||
|
* @param id id of point or detail
|
||||||
|
* @param type type of object
|
||||||
|
*/
|
||||||
void DialogTool::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
void DialogTool::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
||||||
{
|
{
|
||||||
Q_UNUSED(id);
|
Q_UNUSED(id);
|
||||||
|
@ -473,6 +594,9 @@ void DialogTool::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief NamePointChanged check name of point
|
||||||
|
*/
|
||||||
void DialogTool::NamePointChanged()
|
void DialogTool::NamePointChanged()
|
||||||
{
|
{
|
||||||
Q_CHECK_PTR(labelEditNamePoint);
|
Q_CHECK_PTR(labelEditNamePoint);
|
||||||
|
@ -499,18 +623,27 @@ void DialogTool::NamePointChanged()
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief DialogAccepted save data and emit signal about closed dialog.
|
||||||
|
*/
|
||||||
void DialogTool::DialogAccepted()
|
void DialogTool::DialogAccepted()
|
||||||
{
|
{
|
||||||
emit DialogClosed(QDialog::Accepted);
|
emit DialogClosed(QDialog::Accepted);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief DialogRejected emit signal dialog rejected
|
||||||
|
*/
|
||||||
void DialogTool::DialogRejected()
|
void DialogTool::DialogRejected()
|
||||||
{
|
{
|
||||||
emit DialogClosed(QDialog::Rejected);
|
emit DialogClosed(QDialog::Rejected);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief formula check formula
|
||||||
|
*/
|
||||||
void DialogTool::FormulaChanged()
|
void DialogTool::FormulaChanged()
|
||||||
{
|
{
|
||||||
QLineEdit* edit = qobject_cast<QLineEdit*>(sender());
|
QLineEdit* edit = qobject_cast<QLineEdit*>(sender());
|
||||||
|
@ -521,6 +654,9 @@ void DialogTool::FormulaChanged()
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief ArrowUp set angle value 90 degree
|
||||||
|
*/
|
||||||
void DialogTool::ArrowUp()
|
void DialogTool::ArrowUp()
|
||||||
{
|
{
|
||||||
Q_CHECK_PTR(spinBoxAngle);
|
Q_CHECK_PTR(spinBoxAngle);
|
||||||
|
@ -528,6 +664,9 @@ void DialogTool::ArrowUp()
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief ArrowDown set angle value 270 degree
|
||||||
|
*/
|
||||||
void DialogTool::ArrowDown()
|
void DialogTool::ArrowDown()
|
||||||
{
|
{
|
||||||
Q_CHECK_PTR(spinBoxAngle);
|
Q_CHECK_PTR(spinBoxAngle);
|
||||||
|
@ -535,6 +674,9 @@ void DialogTool::ArrowDown()
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief ArrowLeft set angle value 180 degree
|
||||||
|
*/
|
||||||
void DialogTool::ArrowLeft()
|
void DialogTool::ArrowLeft()
|
||||||
{
|
{
|
||||||
Q_CHECK_PTR(spinBoxAngle);
|
Q_CHECK_PTR(spinBoxAngle);
|
||||||
|
@ -542,6 +684,9 @@ void DialogTool::ArrowLeft()
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief ArrowRight set angle value 0 degree
|
||||||
|
*/
|
||||||
void DialogTool::ArrowRight()
|
void DialogTool::ArrowRight()
|
||||||
{
|
{
|
||||||
Q_CHECK_PTR(spinBoxAngle);
|
Q_CHECK_PTR(spinBoxAngle);
|
||||||
|
@ -549,6 +694,9 @@ void DialogTool::ArrowRight()
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief ArrowLeftUp set angle value 135 degree
|
||||||
|
*/
|
||||||
void DialogTool::ArrowLeftUp()
|
void DialogTool::ArrowLeftUp()
|
||||||
{
|
{
|
||||||
Q_CHECK_PTR(spinBoxAngle);
|
Q_CHECK_PTR(spinBoxAngle);
|
||||||
|
@ -556,6 +704,9 @@ void DialogTool::ArrowLeftUp()
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief ArrowLeftDown set angle value 225 degree
|
||||||
|
*/
|
||||||
void DialogTool::ArrowLeftDown()
|
void DialogTool::ArrowLeftDown()
|
||||||
{
|
{
|
||||||
Q_CHECK_PTR(spinBoxAngle);
|
Q_CHECK_PTR(spinBoxAngle);
|
||||||
|
@ -563,6 +714,9 @@ void DialogTool::ArrowLeftDown()
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief ArrowRightUp set angle value 45 degree
|
||||||
|
*/
|
||||||
void DialogTool::ArrowRightUp()
|
void DialogTool::ArrowRightUp()
|
||||||
{
|
{
|
||||||
Q_CHECK_PTR(spinBoxAngle);
|
Q_CHECK_PTR(spinBoxAngle);
|
||||||
|
@ -570,6 +724,9 @@ void DialogTool::ArrowRightUp()
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief ArrowRightDown set angle value 315 degree
|
||||||
|
*/
|
||||||
void DialogTool::ArrowRightDown()
|
void DialogTool::ArrowRightDown()
|
||||||
{
|
{
|
||||||
Q_CHECK_PTR(spinBoxAngle);
|
Q_CHECK_PTR(spinBoxAngle);
|
||||||
|
@ -577,6 +734,9 @@ void DialogTool::ArrowRightDown()
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief EvalFormula evaluate formula
|
||||||
|
*/
|
||||||
void DialogTool::EvalFormula()
|
void DialogTool::EvalFormula()
|
||||||
{
|
{
|
||||||
Q_CHECK_PTR(lineEditFormula);
|
Q_CHECK_PTR(lineEditFormula);
|
||||||
|
@ -585,6 +745,9 @@ void DialogTool::EvalFormula()
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief SizeHeight show in list base variables
|
||||||
|
*/
|
||||||
void DialogTool::SizeHeight()
|
void DialogTool::SizeHeight()
|
||||||
{
|
{
|
||||||
Q_CHECK_PTR(listWidget);
|
Q_CHECK_PTR(listWidget);
|
||||||
|
@ -606,42 +769,64 @@ void DialogTool::SizeHeight()
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief Measurements show in list measurements
|
||||||
|
*/
|
||||||
void DialogTool::Measurements()
|
void DialogTool::Measurements()
|
||||||
{
|
{
|
||||||
ShowVariable(data->DataMeasurements());
|
ShowVariable(data->DataMeasurements());
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief LengthLines show in list lengths of lines variables
|
||||||
|
*/
|
||||||
void DialogTool::LengthLines()
|
void DialogTool::LengthLines()
|
||||||
{
|
{
|
||||||
ShowVariable(data->DataLengthLines());
|
ShowVariable(data->DataLengthLines());
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief LengthArcs show in list lengths of arcs variables
|
||||||
|
*/
|
||||||
void DialogTool::LengthArcs()
|
void DialogTool::LengthArcs()
|
||||||
{
|
{
|
||||||
ShowVariable(data->DataLengthArcs());
|
ShowVariable(data->DataLengthArcs());
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief LengthCurves show in list lengths of curves variables
|
||||||
|
*/
|
||||||
void DialogTool::LengthCurves()
|
void DialogTool::LengthCurves()
|
||||||
{
|
{
|
||||||
ShowVariable(data->DataLengthSplines());
|
ShowVariable(data->DataLengthSplines());
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief Increments show in list increment variables
|
||||||
|
*/
|
||||||
void DialogTool::Increments()
|
void DialogTool::Increments()
|
||||||
{
|
{
|
||||||
ShowVariable(data->DataIncrements());
|
ShowVariable(data->DataIncrements());
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief PutHere put variable into edit
|
||||||
|
*/
|
||||||
void DialogTool::PutHere()
|
void DialogTool::PutHere()
|
||||||
{
|
{
|
||||||
PutValHere(lineEditFormula, listWidget);
|
PutValHere(lineEditFormula, listWidget);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief PutVal put variable into edit
|
||||||
|
* @param item chosen item of list widget
|
||||||
|
*/
|
||||||
void DialogTool::PutVal(QListWidgetItem *item)
|
void DialogTool::PutVal(QListWidgetItem *item)
|
||||||
{
|
{
|
||||||
Q_CHECK_PTR(lineEditFormula);
|
Q_CHECK_PTR(lineEditFormula);
|
||||||
|
@ -654,6 +839,10 @@ void DialogTool::PutVal(QListWidgetItem *item)
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief ValChenged show description when current variable changed
|
||||||
|
* @param row number of row
|
||||||
|
*/
|
||||||
void DialogTool::ValChenged(int row)
|
void DialogTool::ValChenged(int row)
|
||||||
{
|
{
|
||||||
Q_CHECK_PTR(listWidget);
|
Q_CHECK_PTR(listWidget);
|
||||||
|
@ -724,6 +913,9 @@ void DialogTool::ValChenged(int row)
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief UpdateList update lists of variables
|
||||||
|
*/
|
||||||
void DialogTool::UpdateList()
|
void DialogTool::UpdateList()
|
||||||
{
|
{
|
||||||
Q_CHECK_PTR(radioButtonSizeGrowth);
|
Q_CHECK_PTR(radioButtonSizeGrowth);
|
||||||
|
@ -760,6 +952,10 @@ void DialogTool::UpdateList()
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief ShowVariable show variables in list
|
||||||
|
* @param var container with variables
|
||||||
|
*/
|
||||||
template <class key, class val>
|
template <class key, class val>
|
||||||
void DialogTool::ShowVariable(const QHash<key, val> *var)
|
void DialogTool::ShowVariable(const QHash<key, val> *var)
|
||||||
{
|
{
|
||||||
|
|
|
@ -61,12 +61,7 @@ class DialogTool : public QDialog
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
/**
|
DialogTool(const VContainer *data, QWidget *parent = nullptr);
|
||||||
* @brief DialogTool create dialog
|
|
||||||
* @param data container with data
|
|
||||||
* @param parent parent widget
|
|
||||||
*/
|
|
||||||
DialogTool(const VContainer *data, QWidget *parent = nullptr);
|
|
||||||
virtual ~DialogTool() {}
|
virtual ~DialogTool() {}
|
||||||
signals:
|
signals:
|
||||||
/**
|
/**
|
||||||
|
@ -80,326 +75,121 @@ signals:
|
||||||
*/
|
*/
|
||||||
void ToolTip(const QString &toolTip);
|
void ToolTip(const QString &toolTip);
|
||||||
public slots:
|
public slots:
|
||||||
/**
|
|
||||||
* @brief ChoosedObject gets id and type of selected object. Save right data and ignore wrong.
|
|
||||||
* @param id id of point or detail
|
|
||||||
* @param type type of object
|
|
||||||
*/
|
|
||||||
virtual void ChoosedObject(quint32 id, const Valentina::Scenes &type);
|
virtual void ChoosedObject(quint32 id, const Valentina::Scenes &type);
|
||||||
/**
|
|
||||||
* @brief NamePointChanged check name of point
|
|
||||||
*/
|
|
||||||
void NamePointChanged();
|
void NamePointChanged();
|
||||||
/**
|
|
||||||
* @brief DialogAccepted save data and emit signal about closed dialog.
|
|
||||||
*/
|
|
||||||
virtual void DialogAccepted();
|
virtual void DialogAccepted();
|
||||||
/**
|
|
||||||
* @brief DialogRejected emit signal dialog rejected
|
|
||||||
*/
|
|
||||||
virtual void DialogRejected();
|
virtual void DialogRejected();
|
||||||
/**
|
|
||||||
* @brief formula check formula
|
|
||||||
*/
|
|
||||||
void FormulaChanged();
|
void FormulaChanged();
|
||||||
/**
|
|
||||||
* @brief ArrowUp set angle value 90 degree
|
|
||||||
*/
|
|
||||||
void ArrowUp();
|
void ArrowUp();
|
||||||
/**
|
|
||||||
* @brief ArrowDown set angle value 270 degree
|
|
||||||
*/
|
|
||||||
void ArrowDown();
|
void ArrowDown();
|
||||||
/**
|
|
||||||
* @brief ArrowLeft set angle value 180 degree
|
|
||||||
*/
|
|
||||||
void ArrowLeft();
|
void ArrowLeft();
|
||||||
/**
|
|
||||||
* @brief ArrowRight set angle value 0 degree
|
|
||||||
*/
|
|
||||||
void ArrowRight();
|
void ArrowRight();
|
||||||
/**
|
|
||||||
* @brief ArrowLeftUp set angle value 135 degree
|
|
||||||
*/
|
|
||||||
void ArrowLeftUp();
|
void ArrowLeftUp();
|
||||||
/**
|
|
||||||
* @brief ArrowLeftDown set angle value 225 degree
|
|
||||||
*/
|
|
||||||
void ArrowLeftDown();
|
void ArrowLeftDown();
|
||||||
/**
|
|
||||||
* @brief ArrowRightUp set angle value 45 degree
|
|
||||||
*/
|
|
||||||
void ArrowRightUp();
|
void ArrowRightUp();
|
||||||
/**
|
|
||||||
* @brief ArrowRightDown set angle value 315 degree
|
|
||||||
*/
|
|
||||||
void ArrowRightDown();
|
void ArrowRightDown();
|
||||||
/**
|
|
||||||
* @brief EvalFormula evaluate formula
|
|
||||||
*/
|
|
||||||
void EvalFormula();
|
void EvalFormula();
|
||||||
/**
|
|
||||||
* @brief SizeHeight show in list base variables
|
|
||||||
*/
|
|
||||||
void SizeHeight();
|
void SizeHeight();
|
||||||
/**
|
|
||||||
* @brief Measurements show in list measurements
|
|
||||||
*/
|
|
||||||
void Measurements();
|
void Measurements();
|
||||||
/**
|
|
||||||
* @brief LengthLines show in list lengths of lines variables
|
|
||||||
*/
|
|
||||||
void LengthLines();
|
void LengthLines();
|
||||||
/**
|
|
||||||
* @brief LengthArcs show in list lengths of arcs variables
|
|
||||||
*/
|
|
||||||
void LengthArcs();
|
void LengthArcs();
|
||||||
/**
|
|
||||||
* @brief LengthCurves show in list lengths of curves variables
|
|
||||||
*/
|
|
||||||
void LengthCurves();
|
void LengthCurves();
|
||||||
/**
|
|
||||||
* @brief Increments show in list increment variables
|
|
||||||
*/
|
|
||||||
void Increments();
|
void Increments();
|
||||||
/**
|
|
||||||
* @brief PutHere put variable into edit
|
|
||||||
*/
|
|
||||||
void PutHere();
|
void PutHere();
|
||||||
/**
|
|
||||||
* @brief PutVal put variable into edit
|
|
||||||
* @param item chosen item of list widget
|
|
||||||
*/
|
|
||||||
void PutVal(QListWidgetItem * item);
|
void PutVal(QListWidgetItem * item);
|
||||||
/**
|
|
||||||
* @brief ValChenged show description when current variable changed
|
|
||||||
* @param row number of row
|
|
||||||
*/
|
|
||||||
virtual void ValChenged(int row);
|
virtual void ValChenged(int row);
|
||||||
/**
|
|
||||||
* @brief UpdateList update lists of variables
|
|
||||||
*/
|
|
||||||
void UpdateList();
|
void UpdateList();
|
||||||
protected:
|
protected:
|
||||||
Q_DISABLE_COPY(DialogTool)
|
Q_DISABLE_COPY(DialogTool)
|
||||||
/**
|
|
||||||
* @brief data container with data
|
/** @brief data container with data */
|
||||||
*/
|
|
||||||
const VContainer *data;
|
const VContainer *data;
|
||||||
/**
|
|
||||||
* @brief isInitialized true if window is initialized
|
/** @brief isInitialized true if window is initialized */
|
||||||
*/
|
|
||||||
bool isInitialized;
|
bool isInitialized;
|
||||||
/**
|
|
||||||
* @brief flagName true if name is correct
|
/** @brief flagName true if name is correct */
|
||||||
*/
|
|
||||||
bool flagName;
|
bool flagName;
|
||||||
/**
|
|
||||||
* @brief flagFormula true if formula correct
|
/** @brief flagFormula true if formula correct */
|
||||||
*/
|
|
||||||
bool flagFormula;
|
bool flagFormula;
|
||||||
/**
|
|
||||||
* @brief timerFormula timer for check formula
|
/** @brief timerFormula timer for check formula */
|
||||||
*/
|
|
||||||
QTimer *timerFormula;
|
QTimer *timerFormula;
|
||||||
/**
|
|
||||||
* @brief bOk button ok
|
/** @brief bOk button ok */
|
||||||
*/
|
|
||||||
QPushButton *bOk;
|
QPushButton *bOk;
|
||||||
/**
|
|
||||||
* @brief spinBoxAngle spinbox for angle
|
/** @brief spinBoxAngle spinbox for angle */
|
||||||
*/
|
|
||||||
QDoubleSpinBox *spinBoxAngle;
|
QDoubleSpinBox *spinBoxAngle;
|
||||||
/**
|
|
||||||
* @brief lineEditFormula linEdit for formula
|
/** @brief lineEditFormula linEdit for formula */
|
||||||
*/
|
|
||||||
QLineEdit *lineEditFormula;
|
QLineEdit *lineEditFormula;
|
||||||
/**
|
|
||||||
* @brief listWidget listWidget with variables
|
/** @brief listWidget listWidget with variables */
|
||||||
*/
|
|
||||||
QListWidget *listWidget;
|
QListWidget *listWidget;
|
||||||
/**
|
|
||||||
* @brief labelResultCalculation label with result of calculation
|
/** @brief labelResultCalculation label with result of calculation */
|
||||||
*/
|
|
||||||
QLabel *labelResultCalculation;
|
QLabel *labelResultCalculation;
|
||||||
/**
|
|
||||||
* @brief labelDescription description of variable
|
/** @brief labelDescription description of variable */
|
||||||
*/
|
|
||||||
QLabel *labelDescription;
|
QLabel *labelDescription;
|
||||||
/**
|
|
||||||
* @brief labelEditNamePoint label used when need show wrong name of point
|
/** @brief labelEditNamePoint label used when need show wrong name of point */
|
||||||
*/
|
|
||||||
QLabel *labelEditNamePoint;
|
QLabel *labelEditNamePoint;
|
||||||
/**
|
|
||||||
* @brief labelEditFormula label used when need show wrong formula
|
/** @brief labelEditFormula label used when need show wrong formula */
|
||||||
*/
|
|
||||||
QLabel *labelEditFormula;
|
QLabel *labelEditFormula;
|
||||||
/**
|
|
||||||
* @brief radioButtonSizeGrowth radio button for base variables
|
/** @brief radioButtonSizeGrowth radio button for base variables */
|
||||||
*/
|
|
||||||
QRadioButton *radioButtonSizeGrowth;
|
QRadioButton *radioButtonSizeGrowth;
|
||||||
/**
|
|
||||||
* @brief radioButtonStandardTable radio button for standard table variables
|
/** @brief radioButtonStandardTable radio button for standard table variables */
|
||||||
*/
|
|
||||||
QRadioButton *radioButtonStandardTable;
|
QRadioButton *radioButtonStandardTable;
|
||||||
/**
|
|
||||||
* @brief radioButtonIncrements radio button for increments variables
|
/** @brief radioButtonIncrements radio button for increments variables */
|
||||||
*/
|
|
||||||
QRadioButton *radioButtonIncrements;
|
QRadioButton *radioButtonIncrements;
|
||||||
/**
|
|
||||||
* @brief radioButtonLengthLine radio button for lengths od lines variables
|
/** @brief radioButtonLengthLine radio button for lengths od lines variables */
|
||||||
*/
|
|
||||||
QRadioButton *radioButtonLengthLine;
|
QRadioButton *radioButtonLengthLine;
|
||||||
/**
|
|
||||||
* @brief radioButtonLengthArc radio button for lengths of arcs variables
|
/** @brief radioButtonLengthArc radio button for lengths of arcs variables */
|
||||||
*/
|
|
||||||
QRadioButton *radioButtonLengthArc;
|
QRadioButton *radioButtonLengthArc;
|
||||||
/**
|
|
||||||
* @brief radioButtonLengthCurve radio button for lengths of curves variables
|
/** @brief radioButtonLengthCurve radio button for lengths of curves variables */
|
||||||
*/
|
|
||||||
QRadioButton *radioButtonLengthCurve;
|
QRadioButton *radioButtonLengthCurve;
|
||||||
/**
|
|
||||||
* @brief lineStyles list supported line styles.
|
/** @brief lineStyles list supported line styles. */
|
||||||
*/
|
|
||||||
QStringList lineStyles;
|
QStringList lineStyles;
|
||||||
/**
|
|
||||||
* @brief closeEvent handle when dialog cloded
|
|
||||||
* @param event event
|
|
||||||
*/
|
|
||||||
virtual void closeEvent ( QCloseEvent * event );
|
virtual void closeEvent ( QCloseEvent * event );
|
||||||
/**
|
|
||||||
* @brief showEvent handle when window show
|
|
||||||
* @param event event
|
|
||||||
*/
|
|
||||||
virtual void showEvent( QShowEvent *event );
|
virtual void showEvent( QShowEvent *event );
|
||||||
/**
|
|
||||||
* @brief FillComboBoxPoints fill comboBox list of points
|
|
||||||
* @param box comboBox
|
|
||||||
* @param id don't show this id in list
|
|
||||||
*/
|
|
||||||
void FillComboBoxPoints(QComboBox *box, const quint32 &id = 0)const;
|
void FillComboBoxPoints(QComboBox *box, const quint32 &id = 0)const;
|
||||||
void FillComboBoxArcs(QComboBox *box, const quint32 &id = 0,
|
void FillComboBoxArcs(QComboBox *box, const quint32 &id = 0,
|
||||||
ComboMode::ComboBoxCutArc cut = ComboMode::NoCutArc)const;
|
ComboMode::ComboBoxCutArc cut = ComboMode::NoCutArc)const;
|
||||||
/**
|
|
||||||
* @brief FillComboBoxSplines fill comboBox list of splines
|
|
||||||
* @param box comboBox
|
|
||||||
* @param id don't show id in list
|
|
||||||
* @param cut if set to ComboMode::CutSpline don't show id+1 and id+2
|
|
||||||
*/
|
|
||||||
void FillComboBoxSplines(QComboBox *box, const quint32 &id = 0,
|
void FillComboBoxSplines(QComboBox *box, const quint32 &id = 0,
|
||||||
ComboMode::ComboBoxCutSpline cut = ComboMode::NoCutSpline)const;
|
ComboMode::ComboBoxCutSpline cut = ComboMode::NoCutSpline)const;
|
||||||
/**
|
|
||||||
* @brief FillComboBoxSplinesPath
|
|
||||||
* @param box comboBox
|
|
||||||
* @param id don't show id in list
|
|
||||||
* @param cut if set to ComboMode::CutSpline don't show id+1 and id+2
|
|
||||||
*/
|
|
||||||
void FillComboBoxSplinesPath(QComboBox *box, const quint32 &id = 0,
|
void FillComboBoxSplinesPath(QComboBox *box, const quint32 &id = 0,
|
||||||
ComboMode::ComboBoxCutSpline cut = ComboMode::NoCutSpline)const;
|
ComboMode::ComboBoxCutSpline cut = ComboMode::NoCutSpline)const;
|
||||||
/**
|
|
||||||
* @brief FillComboBoxTypeLine fill comboBox list of type lines
|
|
||||||
* @param box comboBox
|
|
||||||
*/
|
|
||||||
void FillComboBoxTypeLine(QComboBox *box) const;
|
void FillComboBoxTypeLine(QComboBox *box) const;
|
||||||
/**
|
|
||||||
* @brief CheckState enable, when all is correct, or disable, when something wrong, button ok
|
|
||||||
*/
|
|
||||||
virtual void CheckState();
|
virtual void CheckState();
|
||||||
/**
|
|
||||||
* @brief getTypeLine return type of line
|
|
||||||
* @param box combobox
|
|
||||||
* @return type
|
|
||||||
*/
|
|
||||||
QString GetTypeLine(const QComboBox *box)const;
|
QString GetTypeLine(const QComboBox *box)const;
|
||||||
template <class key, class val>
|
template <class key, class val>
|
||||||
/**
|
|
||||||
* @brief ShowVariable show variables in list
|
|
||||||
* @param var container with variables
|
|
||||||
*/
|
|
||||||
void ShowVariable(const QHash<key, val> *var);
|
void ShowVariable(const QHash<key, val> *var);
|
||||||
/**
|
|
||||||
* @brief SetupTypeLine setupe type of line
|
|
||||||
* @param box combobox
|
|
||||||
* @param value string from pattern file
|
|
||||||
*/
|
|
||||||
void SetupTypeLine(QComboBox *box, const QString &value);
|
void SetupTypeLine(QComboBox *box, const QString &value);
|
||||||
/**
|
|
||||||
* @brief ChangeCurrentText select item in combobox by name
|
|
||||||
* @param box combobox
|
|
||||||
* @param value name of item
|
|
||||||
*/
|
|
||||||
void ChangeCurrentText(QComboBox *box, const QString &value);
|
void ChangeCurrentText(QComboBox *box, const QString &value);
|
||||||
/**
|
|
||||||
* @brief ChangeCurrentData select item in combobox by id
|
|
||||||
* @param box combobox
|
|
||||||
* @param value id of item
|
|
||||||
*/
|
|
||||||
void ChangeCurrentData(QComboBox *box, const quint32 &value) const;
|
void ChangeCurrentData(QComboBox *box, const quint32 &value) const;
|
||||||
/**
|
|
||||||
* @brief PutValHere put variable into line edit from list
|
|
||||||
* @param lineEdit lineEdit
|
|
||||||
* @param listWidget listWidget
|
|
||||||
*/
|
|
||||||
void PutValHere(QLineEdit *lineEdit, QListWidget *listWidget);
|
void PutValHere(QLineEdit *lineEdit, QListWidget *listWidget);
|
||||||
/**
|
|
||||||
* @brief ValFormulaChanged handle change formula
|
|
||||||
* @param flag flag state of formula
|
|
||||||
* @param edit LineEdit
|
|
||||||
* @param timer timer of formula
|
|
||||||
*/
|
|
||||||
void ValFormulaChanged(bool &flag, QLineEdit *edit, QTimer * timer);
|
void ValFormulaChanged(bool &flag, QLineEdit *edit, QTimer * timer);
|
||||||
/**
|
|
||||||
* @brief Eval evaluate formula and show result
|
|
||||||
* @param edit lineEdit of formula
|
|
||||||
* @param flag flag state of formula
|
|
||||||
* @param timer timer of formula
|
|
||||||
* @param label label for signal error
|
|
||||||
*/
|
|
||||||
void Eval(QLineEdit *edit, bool &flag, QTimer *timer, QLabel *label);
|
void Eval(QLineEdit *edit, bool &flag, QTimer *timer, QLabel *label);
|
||||||
/**
|
|
||||||
* @brief setCurrentPointId set current point id in combobox
|
|
||||||
* @param box combobox
|
|
||||||
* @param pointId save current point id
|
|
||||||
* @param value point id
|
|
||||||
* @param id don't show this id in list
|
|
||||||
*/
|
|
||||||
void setCurrentPointId(QComboBox *box, quint32 &pointId, const quint32 &value, const quint32 &id) const;
|
void setCurrentPointId(QComboBox *box, quint32 &pointId, const quint32 &value, const quint32 &id) const;
|
||||||
/**
|
|
||||||
* @brief setCurrentSplineId set current spline id in combobox
|
|
||||||
* @param box combobox
|
|
||||||
* @param splineId save current spline id
|
|
||||||
* @param value spline id
|
|
||||||
* @param id don't show this id in list
|
|
||||||
* @param cut if set to ComboMode::CutSpline don't show id+1 and id+2
|
|
||||||
*/
|
|
||||||
void setCurrentSplineId(QComboBox *box, quint32 &splineId, const quint32 &value, const quint32 &id,
|
void setCurrentSplineId(QComboBox *box, quint32 &splineId, const quint32 &value, const quint32 &id,
|
||||||
ComboMode::ComboBoxCutSpline cut = ComboMode::NoCutSpline) const;
|
ComboMode::ComboBoxCutSpline cut = ComboMode::NoCutSpline) const;
|
||||||
/**
|
|
||||||
* @brief setCurrentArcId
|
|
||||||
* @param box combobox
|
|
||||||
* @param arcId save current arc id
|
|
||||||
* @param value arc id
|
|
||||||
* @param id don't show this id in list
|
|
||||||
* @param cut if set to ComboMode::CutArc don't show id+1 and id+2
|
|
||||||
*/
|
|
||||||
void setCurrentArcId(QComboBox *box, quint32 &arcId, const quint32 &value, const quint32 &id,
|
void setCurrentArcId(QComboBox *box, quint32 &arcId, const quint32 &value, const quint32 &id,
|
||||||
ComboMode::ComboBoxCutArc cut = ComboMode::NoCutArc) const;
|
ComboMode::ComboBoxCutArc cut = ComboMode::NoCutArc) const;
|
||||||
/**
|
|
||||||
* @brief setCurrentSplinePathId set current splinePath id in combobox
|
|
||||||
* @param box combobox
|
|
||||||
* @param splinePathId save current splinePath id
|
|
||||||
* @param value splinePath id
|
|
||||||
* @param id don't show this id in list
|
|
||||||
* @param cut if set to ComboMode::CutSpline don't show id+1 and id+2
|
|
||||||
*/
|
|
||||||
void setCurrentSplinePathId(QComboBox *box, quint32 &splinePathId, const quint32 &value,
|
void setCurrentSplinePathId(QComboBox *box, quint32 &splinePathId, const quint32 &value,
|
||||||
const quint32 &id,
|
const quint32 &id,
|
||||||
ComboMode::ComboBoxCutSpline cut = ComboMode::NoCutSpline) const;
|
ComboMode::ComboBoxCutSpline cut = ComboMode::NoCutSpline) const;
|
||||||
/**
|
|
||||||
* @brief getCurrentPointId return current point id stored in combobox
|
|
||||||
* @param box combobox
|
|
||||||
* @return id or 0 if combobox is empty
|
|
||||||
*/
|
|
||||||
quint32 getCurrentObjectId(QComboBox *box) const;
|
quint32 getCurrentObjectId(QComboBox *box) const;
|
||||||
bool ChoosedPoint(const quint32 &id, QComboBox *box, const QString &toolTip);
|
bool ChoosedPoint(const quint32 &id, QComboBox *box, const QString &toolTip);
|
||||||
template <typename T>
|
template <typename T>
|
||||||
|
@ -459,11 +249,6 @@ protected:
|
||||||
connect(bCansel, &QPushButton::clicked, this, &DialogTool::DialogRejected);
|
connect(bCansel, &QPushButton::clicked, this, &DialogTool::DialogRejected);
|
||||||
}
|
}
|
||||||
private:
|
private:
|
||||||
/**
|
|
||||||
* @brief FillList fill combobox list
|
|
||||||
* @param box combobox
|
|
||||||
* @param list list with ids and names
|
|
||||||
*/
|
|
||||||
void FillList(QComboBox *box, const QMap<QString, quint32> &list)const;
|
void FillList(QComboBox *box, const QMap<QString, quint32> &list)const;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -32,6 +32,11 @@
|
||||||
#include <QPushButton>
|
#include <QPushButton>
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief DialogTriangle create dialog
|
||||||
|
* @param data container with data
|
||||||
|
* @param parent parent widget
|
||||||
|
*/
|
||||||
DialogTriangle::DialogTriangle(const VContainer *data, QWidget *parent)
|
DialogTriangle::DialogTriangle(const VContainer *data, QWidget *parent)
|
||||||
:DialogTool(data, parent), ui(new Ui::DialogTriangle), number(0), pointName(QString()), axisP1Id(0),
|
:DialogTool(data, parent), ui(new Ui::DialogTriangle), number(0), pointName(QString()), axisP1Id(0),
|
||||||
axisP2Id(0), firstPointId(0), secondPointId(0)
|
axisP2Id(0), firstPointId(0), secondPointId(0)
|
||||||
|
@ -57,6 +62,11 @@ DialogTriangle::~DialogTriangle()
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief ChoosedObject gets id and type of selected object. Save right data and ignore wrong.
|
||||||
|
* @param id id of point or detail
|
||||||
|
* @param type type of object
|
||||||
|
*/
|
||||||
void DialogTriangle::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
void DialogTriangle::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
||||||
{
|
{
|
||||||
if (type == Valentina::Point)
|
if (type == Valentina::Point)
|
||||||
|
@ -95,6 +105,9 @@ void DialogTriangle::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief DialogAccepted save data and emit signal about closed dialog.
|
||||||
|
*/
|
||||||
void DialogTriangle::DialogAccepted()
|
void DialogTriangle::DialogAccepted()
|
||||||
{
|
{
|
||||||
pointName = ui->lineEditNamePoint->text();
|
pointName = ui->lineEditNamePoint->text();
|
||||||
|
@ -106,6 +119,10 @@ void DialogTriangle::DialogAccepted()
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief setPointName set name of point
|
||||||
|
* @param value name
|
||||||
|
*/
|
||||||
void DialogTriangle::setPointName(const QString &value)
|
void DialogTriangle::setPointName(const QString &value)
|
||||||
{
|
{
|
||||||
pointName = value;
|
pointName = value;
|
||||||
|
@ -113,6 +130,11 @@ void DialogTriangle::setPointName(const QString &value)
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief setSecondPointId set id of second point
|
||||||
|
* @param value id
|
||||||
|
* @param id don't show this point in list
|
||||||
|
*/
|
||||||
void DialogTriangle::setSecondPointId(const quint32 &value, const quint32 &id)
|
void DialogTriangle::setSecondPointId(const quint32 &value, const quint32 &id)
|
||||||
{
|
{
|
||||||
secondPointId = value;
|
secondPointId = value;
|
||||||
|
@ -120,6 +142,11 @@ void DialogTriangle::setSecondPointId(const quint32 &value, const quint32 &id)
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief setFirstPointId set id of first point
|
||||||
|
* @param value id
|
||||||
|
* @param id don't show this point in list
|
||||||
|
*/
|
||||||
void DialogTriangle::setFirstPointId(const quint32 &value, const quint32 &id)
|
void DialogTriangle::setFirstPointId(const quint32 &value, const quint32 &id)
|
||||||
{
|
{
|
||||||
firstPointId = value;
|
firstPointId = value;
|
||||||
|
@ -127,6 +154,11 @@ void DialogTriangle::setFirstPointId(const quint32 &value, const quint32 &id)
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief setAxisP2Id set id second point of axis
|
||||||
|
* @param value id
|
||||||
|
* @param id don't show this point in list
|
||||||
|
*/
|
||||||
void DialogTriangle::setAxisP2Id(const quint32 &value, const quint32 &id)
|
void DialogTriangle::setAxisP2Id(const quint32 &value, const quint32 &id)
|
||||||
{
|
{
|
||||||
axisP2Id = value;
|
axisP2Id = value;
|
||||||
|
@ -134,6 +166,11 @@ void DialogTriangle::setAxisP2Id(const quint32 &value, const quint32 &id)
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief setAxisP1Id set id first point of axis
|
||||||
|
* @param value id
|
||||||
|
* @param id don't show this point in list
|
||||||
|
*/
|
||||||
void DialogTriangle::setAxisP1Id(const quint32 &value, const quint32 &id)
|
void DialogTriangle::setAxisP1Id(const quint32 &value, const quint32 &id)
|
||||||
{
|
{
|
||||||
axisP1Id = value;
|
axisP1Id = value;
|
||||||
|
|
|
@ -43,130 +43,96 @@ class DialogTriangle : public DialogTool
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
/**
|
|
||||||
* @brief DialogTriangle create dialog
|
|
||||||
* @param data container with data
|
|
||||||
* @param parent parent widget
|
|
||||||
*/
|
|
||||||
DialogTriangle(const VContainer *data, QWidget *parent = nullptr);
|
DialogTriangle(const VContainer *data, QWidget *parent = nullptr);
|
||||||
~DialogTriangle();
|
~DialogTriangle();
|
||||||
/**
|
|
||||||
* @brief getAxisP1Id return id first point of axis
|
|
||||||
* @return id
|
|
||||||
*/
|
|
||||||
quint32 getAxisP1Id() const;
|
quint32 getAxisP1Id() const;
|
||||||
/**
|
|
||||||
* @brief setAxisP1Id set id first point of axis
|
|
||||||
* @param value id
|
|
||||||
* @param id don't show this point in list
|
|
||||||
*/
|
|
||||||
void setAxisP1Id(const quint32 &value, const quint32 &id);
|
void setAxisP1Id(const quint32 &value, const quint32 &id);
|
||||||
/**
|
|
||||||
* @brief getAxisP2Id return id second point of axis
|
|
||||||
* @return id
|
|
||||||
*/
|
|
||||||
quint32 getAxisP2Id() const;
|
quint32 getAxisP2Id() const;
|
||||||
/**
|
|
||||||
* @brief setAxisP2Id set id second point of axis
|
|
||||||
* @param value id
|
|
||||||
* @param id don't show this point in list
|
|
||||||
*/
|
|
||||||
void setAxisP2Id(const quint32 &value, const quint32 &id);
|
void setAxisP2Id(const quint32 &value, const quint32 &id);
|
||||||
/**
|
|
||||||
* @brief getFirstPointId return id of first point
|
|
||||||
* @return id
|
|
||||||
*/
|
|
||||||
quint32 getFirstPointId() const;
|
quint32 getFirstPointId() const;
|
||||||
/**
|
|
||||||
* @brief setFirstPointId set id of first point
|
|
||||||
* @param value id
|
|
||||||
* @param id don't show this point in list
|
|
||||||
*/
|
|
||||||
void setFirstPointId(const quint32 &value, const quint32 &id);
|
void setFirstPointId(const quint32 &value, const quint32 &id);
|
||||||
/**
|
|
||||||
* @brief getSecondPointId return id of second point
|
|
||||||
* @return id
|
|
||||||
*/
|
|
||||||
quint32 getSecondPointId() const;
|
quint32 getSecondPointId() const;
|
||||||
/**
|
|
||||||
* @brief setSecondPointId set id of second point
|
|
||||||
* @param value id
|
|
||||||
* @param id don't show this point in list
|
|
||||||
*/
|
|
||||||
void setSecondPointId(const quint32 &value, const quint32 &id);
|
void setSecondPointId(const quint32 &value, const quint32 &id);
|
||||||
/**
|
|
||||||
* @brief getPointName return name of point
|
|
||||||
* @return name
|
|
||||||
*/
|
|
||||||
QString getPointName() const;
|
QString getPointName() const;
|
||||||
/**
|
|
||||||
* @brief setPointName set name of point
|
|
||||||
* @param value name
|
|
||||||
*/
|
|
||||||
void setPointName(const QString &value);
|
void setPointName(const QString &value);
|
||||||
public slots:
|
public slots:
|
||||||
/**
|
|
||||||
* @brief ChoosedObject gets id and type of selected object. Save right data and ignore wrong.
|
|
||||||
* @param id id of point or detail
|
|
||||||
* @param type type of object
|
|
||||||
*/
|
|
||||||
virtual void ChoosedObject(quint32 id, const Valentina::Scenes &type);
|
virtual void ChoosedObject(quint32 id, const Valentina::Scenes &type);
|
||||||
/**
|
|
||||||
* @brief DialogAccepted save data and emit signal about closed dialog.
|
|
||||||
*/
|
|
||||||
virtual void DialogAccepted();
|
virtual void DialogAccepted();
|
||||||
private:
|
private:
|
||||||
Q_DISABLE_COPY(DialogTriangle)
|
Q_DISABLE_COPY(DialogTriangle)
|
||||||
/**
|
|
||||||
* @brief ui keeps information about user interface
|
/** @brief ui keeps information about user interface */
|
||||||
*/
|
|
||||||
Ui::DialogTriangle *ui;
|
Ui::DialogTriangle *ui;
|
||||||
/**
|
|
||||||
* @brief number number of handled objects
|
/** @brief number number of handled objects */
|
||||||
*/
|
|
||||||
qint32 number;
|
qint32 number;
|
||||||
/**
|
|
||||||
* @brief pointName name of point
|
/** @brief pointName name of point */
|
||||||
*/
|
|
||||||
QString pointName;
|
QString pointName;
|
||||||
/**
|
|
||||||
* @brief axisP1Id id first point of axis
|
/** @brief axisP1Id id first point of axis */
|
||||||
*/
|
|
||||||
quint32 axisP1Id;
|
quint32 axisP1Id;
|
||||||
/**
|
|
||||||
* @brief axisP2Id id second point of axis
|
/** @brief axisP2Id id second point of axis */
|
||||||
*/
|
|
||||||
quint32 axisP2Id;
|
quint32 axisP2Id;
|
||||||
/**
|
|
||||||
* @brief firstPointId id first point of line
|
/** @brief firstPointId id first point of line */
|
||||||
*/
|
|
||||||
quint32 firstPointId;
|
quint32 firstPointId;
|
||||||
/**
|
|
||||||
* @brief secondPointId id second point of line
|
/** @brief secondPointId id second point of line */
|
||||||
*/
|
|
||||||
quint32 secondPointId;
|
quint32 secondPointId;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief getAxisP1Id return id first point of axis
|
||||||
|
* @return id
|
||||||
|
*/
|
||||||
inline quint32 DialogTriangle::getAxisP1Id() const
|
inline quint32 DialogTriangle::getAxisP1Id() const
|
||||||
{
|
{
|
||||||
return axisP1Id;
|
return axisP1Id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief getAxisP2Id return id second point of axis
|
||||||
|
* @return id
|
||||||
|
*/
|
||||||
inline quint32 DialogTriangle::getAxisP2Id() const
|
inline quint32 DialogTriangle::getAxisP2Id() const
|
||||||
{
|
{
|
||||||
return axisP2Id;
|
return axisP2Id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief getFirstPointId return id of first point
|
||||||
|
* @return id
|
||||||
|
*/
|
||||||
inline quint32 DialogTriangle::getFirstPointId() const
|
inline quint32 DialogTriangle::getFirstPointId() const
|
||||||
{
|
{
|
||||||
return firstPointId;
|
return firstPointId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief getSecondPointId return id of second point
|
||||||
|
* @return id
|
||||||
|
*/
|
||||||
inline quint32 DialogTriangle::getSecondPointId() const
|
inline quint32 DialogTriangle::getSecondPointId() const
|
||||||
{
|
{
|
||||||
return secondPointId;
|
return secondPointId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief getPointName return name of point
|
||||||
|
* @return name
|
||||||
|
*/
|
||||||
inline QString DialogTriangle::getPointName() const
|
inline QString DialogTriangle::getPointName() const
|
||||||
{
|
{
|
||||||
return pointName;
|
return pointName;
|
||||||
|
|
|
@ -30,6 +30,11 @@
|
||||||
#include "ui_dialoguniondetails.h"
|
#include "ui_dialoguniondetails.h"
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief DialogUnionDetails create dialog
|
||||||
|
* @param data container with data
|
||||||
|
* @param parent parent widget
|
||||||
|
*/
|
||||||
DialogUnionDetails::DialogUnionDetails(const VContainer *data, QWidget *parent) :
|
DialogUnionDetails::DialogUnionDetails(const VContainer *data, QWidget *parent) :
|
||||||
DialogTool(data, parent), ui(new Ui::DialogUnionDetails), indexD1(0), indexD2(0), d1(0), d2(0), numberD(0),
|
DialogTool(data, parent), ui(new Ui::DialogUnionDetails), indexD1(0), indexD2(0), d1(0), d2(0), numberD(0),
|
||||||
numberP(0), p1(0), p2(0)
|
numberP(0), p1(0), p2(0)
|
||||||
|
@ -45,6 +50,11 @@ DialogUnionDetails::~DialogUnionDetails()
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief ChoosedObject gets id and type of selected object. Save correct data and ignore wrong.
|
||||||
|
* @param id id of point or detail
|
||||||
|
* @param type type of object
|
||||||
|
*/
|
||||||
void DialogUnionDetails::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
void DialogUnionDetails::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
||||||
{
|
{
|
||||||
if (numberD == 0)
|
if (numberD == 0)
|
||||||
|
@ -58,12 +68,21 @@ void DialogUnionDetails::ChoosedObject(quint32 id, const Valentina::Scenes &type
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief DialogAccepted save data and emit signal about closed dialog.
|
||||||
|
*/
|
||||||
void DialogUnionDetails::DialogAccepted()
|
void DialogUnionDetails::DialogAccepted()
|
||||||
{
|
{
|
||||||
emit DialogClosed(QDialog::Accepted);
|
emit DialogClosed(QDialog::Accepted);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief CheckObject check if detail contain this id
|
||||||
|
* @param id id of item
|
||||||
|
* @param idDetail detail id
|
||||||
|
* @return true if contain
|
||||||
|
*/
|
||||||
bool DialogUnionDetails::CheckObject(const quint32 &id, const quint32 &idDetail) const
|
bool DialogUnionDetails::CheckObject(const quint32 &id, const quint32 &idDetail) const
|
||||||
{
|
{
|
||||||
if (idDetail == 0)
|
if (idDetail == 0)
|
||||||
|
@ -75,6 +94,13 @@ bool DialogUnionDetails::CheckObject(const quint32 &id, const quint32 &idDetail)
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief ChoosedDetail help save information about detail and points on detail
|
||||||
|
* @param id id selected object
|
||||||
|
* @param type type selected object
|
||||||
|
* @param idDetail id detail
|
||||||
|
* @param index index of edge
|
||||||
|
*/
|
||||||
void DialogUnionDetails::ChoosedDetail(const quint32 &id, const Valentina::Scenes &type, quint32 &idDetail,
|
void DialogUnionDetails::ChoosedDetail(const quint32 &id, const Valentina::Scenes &type, quint32 &idDetail,
|
||||||
ptrdiff_t &index)
|
ptrdiff_t &index)
|
||||||
{
|
{
|
||||||
|
|
|
@ -43,115 +43,86 @@ class DialogUnionDetails : public DialogTool
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
/**
|
|
||||||
* @brief DialogUnionDetails create dialog
|
|
||||||
* @param data container with data
|
|
||||||
* @param parent parent widget
|
|
||||||
*/
|
|
||||||
DialogUnionDetails(const VContainer *data, QWidget *parent = nullptr);
|
DialogUnionDetails(const VContainer *data, QWidget *parent = nullptr);
|
||||||
~DialogUnionDetails();
|
~DialogUnionDetails();
|
||||||
/**
|
|
||||||
* @brief getD1 return id first detail
|
|
||||||
* @return id
|
|
||||||
*/
|
|
||||||
quint32 getD1() const;
|
quint32 getD1() const;
|
||||||
/**
|
|
||||||
* @brief getD2 return id second detail
|
|
||||||
* @return id
|
|
||||||
*/
|
|
||||||
quint32 getD2() const;
|
quint32 getD2() const;
|
||||||
/**
|
|
||||||
* @brief getIndexD1 return index edge first detail
|
|
||||||
* @return index
|
|
||||||
*/
|
|
||||||
ptrdiff_t getIndexD1() const;
|
ptrdiff_t getIndexD1() const;
|
||||||
/**
|
|
||||||
* @brief getIndexD2 return index edge second detail
|
|
||||||
* @return index
|
|
||||||
*/
|
|
||||||
ptrdiff_t getIndexD2() const;
|
ptrdiff_t getIndexD2() const;
|
||||||
public slots:
|
public slots:
|
||||||
/**
|
|
||||||
* @brief ChoosedObject gets id and type of selected object. Save correct data and ignore wrong.
|
|
||||||
* @param id id of point or detail
|
|
||||||
* @param type type of object
|
|
||||||
*/
|
|
||||||
void ChoosedObject(quint32 id, const Valentina::Scenes &type);
|
void ChoosedObject(quint32 id, const Valentina::Scenes &type);
|
||||||
/**
|
|
||||||
* @brief DialogAccepted save data and emit signal about closed dialog.
|
|
||||||
*/
|
|
||||||
virtual void DialogAccepted();
|
virtual void DialogAccepted();
|
||||||
private:
|
private:
|
||||||
Q_DISABLE_COPY(DialogUnionDetails)
|
Q_DISABLE_COPY(DialogUnionDetails)
|
||||||
/**
|
|
||||||
* @brief ui keeps information about user interface
|
/** @brief ui keeps information about user interface */
|
||||||
*/
|
|
||||||
Ui::DialogUnionDetails *ui;
|
Ui::DialogUnionDetails *ui;
|
||||||
/**
|
|
||||||
* @brief indexD1 index edge first detail
|
/** @brief indexD1 index edge first detail */
|
||||||
*/
|
|
||||||
ptrdiff_t indexD1;
|
ptrdiff_t indexD1;
|
||||||
/**
|
|
||||||
* @brief indexD2 index edge second detail
|
/** @brief indexD2 index edge second detail */
|
||||||
*/
|
|
||||||
ptrdiff_t indexD2;
|
ptrdiff_t indexD2;
|
||||||
/**
|
|
||||||
* @brief d1 id first detail
|
/** @brief d1 id first detail */
|
||||||
*/
|
|
||||||
quint32 d1;
|
quint32 d1;
|
||||||
/**
|
|
||||||
* @brief d2 id second detail
|
/** @brief d2 id second detail */
|
||||||
*/
|
|
||||||
quint32 d2;
|
quint32 d2;
|
||||||
/**
|
|
||||||
* @brief numberD number of detail, what we already have
|
/** @brief numberD number of detail, what we already have */
|
||||||
*/
|
|
||||||
qint32 numberD;
|
qint32 numberD;
|
||||||
/**
|
|
||||||
* @brief numberP number of points, what we already have
|
/** @brief numberP number of points, what we already have */
|
||||||
*/
|
|
||||||
qint32 numberP;
|
qint32 numberP;
|
||||||
/**
|
|
||||||
* @brief p1 id first point of detail
|
/** @brief p1 id first point of detail */
|
||||||
*/
|
|
||||||
quint32 p1;
|
quint32 p1;
|
||||||
/**
|
|
||||||
* @brief p2 id second point of detail
|
/** @brief p2 id second point of detail */
|
||||||
*/
|
|
||||||
quint32 p2;
|
quint32 p2;
|
||||||
/**
|
|
||||||
* @brief CheckObject check if detail contain this id
|
|
||||||
* @param id id of item
|
|
||||||
* @param idDetail detail id
|
|
||||||
* @return true if contain
|
|
||||||
*/
|
|
||||||
bool CheckObject(const quint32 &id, const quint32 &idDetail) const;
|
bool CheckObject(const quint32 &id, const quint32 &idDetail) const;
|
||||||
/**
|
|
||||||
* @brief ChoosedDetail help save information about detail and points on detail
|
|
||||||
* @param id id selected object
|
|
||||||
* @param type type selected object
|
|
||||||
* @param idDetail id detail
|
|
||||||
* @param index index of edge
|
|
||||||
*/
|
|
||||||
void ChoosedDetail(const quint32 &id, const Valentina::Scenes &type, quint32 &idDetail,
|
void ChoosedDetail(const quint32 &id, const Valentina::Scenes &type, quint32 &idDetail,
|
||||||
ptrdiff_t &index);
|
ptrdiff_t &index);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief getD1 return id first detail
|
||||||
|
* @return id
|
||||||
|
*/
|
||||||
inline quint32 DialogUnionDetails::getD1() const
|
inline quint32 DialogUnionDetails::getD1() const
|
||||||
{
|
{
|
||||||
return d1;
|
return d1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief getD2 return id second detail
|
||||||
|
* @return id
|
||||||
|
*/
|
||||||
inline quint32 DialogUnionDetails::getD2() const
|
inline quint32 DialogUnionDetails::getD2() const
|
||||||
{
|
{
|
||||||
return d2;
|
return d2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief getIndexD1 return index edge first detail
|
||||||
|
* @return index
|
||||||
|
*/
|
||||||
inline ptrdiff_t DialogUnionDetails::getIndexD1() const
|
inline ptrdiff_t DialogUnionDetails::getIndexD1() const
|
||||||
{
|
{
|
||||||
return indexD1;
|
return indexD1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief getIndexD2 return index edge second detail
|
||||||
|
* @return index
|
||||||
|
*/
|
||||||
inline ptrdiff_t DialogUnionDetails::getIndexD2() const
|
inline ptrdiff_t DialogUnionDetails::getIndexD2() const
|
||||||
{
|
{
|
||||||
return indexD2;
|
return indexD2;
|
||||||
|
|
|
@ -32,16 +32,28 @@
|
||||||
#include <QGridLayout>
|
#include <QGridLayout>
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief VException constructor exception
|
||||||
|
* @param what string with error
|
||||||
|
*/
|
||||||
VException::VException(const QString &what):QException(), what(what), moreInfo(QString())
|
VException::VException(const QString &what):QException(), what(what), moreInfo(QString())
|
||||||
{
|
{
|
||||||
Q_ASSERT_X(what.isEmpty() == false, Q_FUNC_INFO, "Error message is empty");
|
Q_ASSERT_X(what.isEmpty() == false, Q_FUNC_INFO, "Error message is empty");
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief VException copy constructor
|
||||||
|
* @param e exception
|
||||||
|
*/
|
||||||
VException::VException(const VException &e):what(e.What()), moreInfo(e.MoreInformation())
|
VException::VException(const VException &e):what(e.What()), moreInfo(e.MoreInformation())
|
||||||
{}
|
{}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief ErrorMessage return main error message
|
||||||
|
* @return error message
|
||||||
|
*/
|
||||||
QString VException::ErrorMessage() const
|
QString VException::ErrorMessage() const
|
||||||
{
|
{
|
||||||
QString error = QString("Exception: %1").arg(what);
|
QString error = QString("Exception: %1").arg(what);
|
||||||
|
@ -49,6 +61,10 @@ QString VException::ErrorMessage() const
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief CriticalMessageBox show Critical Message Box.
|
||||||
|
* @param situation main text message box.
|
||||||
|
*/
|
||||||
void VException::CriticalMessageBox(const QString &situation, QWidget * parent) const
|
void VException::CriticalMessageBox(const QString &situation, QWidget * parent) const
|
||||||
{
|
{
|
||||||
QMessageBox msgBox(parent);
|
QMessageBox msgBox(parent);
|
||||||
|
@ -74,6 +90,10 @@ void VException::CriticalMessageBox(const QString &situation, QWidget * parent)
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief AddMoreInformation add more information for error
|
||||||
|
* @param info information
|
||||||
|
*/
|
||||||
void VException::AddMoreInformation(const QString &info)
|
void VException::AddMoreInformation(const QString &info)
|
||||||
{
|
{
|
||||||
if (info.isEmpty())
|
if (info.isEmpty())
|
||||||
|
@ -97,19 +117,30 @@ QString VException::MoreInfo(const QString &detInfo) const
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief DetailedInformation return detailed information about error
|
||||||
|
* @return detailed information
|
||||||
|
*/
|
||||||
QString VException::DetailedInformation() const
|
QString VException::DetailedInformation() const
|
||||||
{
|
{
|
||||||
return moreInfo;
|
return moreInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief clone clone exception
|
||||||
|
* @return new exception
|
||||||
|
*/
|
||||||
VException *VException::clone() const
|
VException *VException::clone() const
|
||||||
{
|
{
|
||||||
return new VException(*this);
|
return new VException(*this);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VException::raise() const
|
/**
|
||||||
|
* @brief raise method raise for exception
|
||||||
|
*/
|
||||||
|
Q_NORETURN void VException::raise() const
|
||||||
{
|
{
|
||||||
throw *this;
|
throw *this;
|
||||||
}
|
}
|
||||||
|
|
|
@ -42,75 +42,43 @@ class VException : public QException
|
||||||
{
|
{
|
||||||
Q_DECLARE_TR_FUNCTIONS(VException)
|
Q_DECLARE_TR_FUNCTIONS(VException)
|
||||||
public:
|
public:
|
||||||
/**
|
|
||||||
* @brief VException constructor exception
|
|
||||||
* @param what string with error
|
|
||||||
*/
|
|
||||||
VException(const QString &what);
|
VException(const QString &what);
|
||||||
/**
|
|
||||||
* @brief VException copy constructor
|
|
||||||
* @param e exception
|
|
||||||
*/
|
|
||||||
VException(const VException &e);
|
VException(const VException &e);
|
||||||
virtual ~VException() noexcept (true){}
|
virtual ~VException() noexcept (true){}
|
||||||
/**
|
|
||||||
* @brief raise method raise for exception
|
|
||||||
*/
|
|
||||||
virtual void raise() const;
|
virtual void raise() const;
|
||||||
/**
|
|
||||||
* @brief clone clone exception
|
|
||||||
* @return new exception
|
|
||||||
*/
|
|
||||||
virtual VException *clone() const;
|
virtual VException *clone() const;
|
||||||
/**
|
|
||||||
* @brief ErrorMessage return main error message
|
|
||||||
* @return error message
|
|
||||||
*/
|
|
||||||
virtual QString ErrorMessage() const;
|
virtual QString ErrorMessage() const;
|
||||||
/**
|
|
||||||
* @brief DetailedInformation return detailed information about error
|
|
||||||
* @return detailed information
|
|
||||||
*/
|
|
||||||
virtual QString DetailedInformation() const;
|
virtual QString DetailedInformation() const;
|
||||||
/**
|
|
||||||
* @brief What return string with error
|
|
||||||
* @return string with error
|
|
||||||
*/
|
|
||||||
QString What() const;
|
QString What() const;
|
||||||
/**
|
|
||||||
* @brief CriticalMessageBox show Critical Message Box.
|
|
||||||
* @param situation main text message box.
|
|
||||||
*/
|
|
||||||
virtual void CriticalMessageBox(const QString &situation, QWidget *parent = nullptr) const;
|
virtual void CriticalMessageBox(const QString &situation, QWidget *parent = nullptr) const;
|
||||||
/**
|
|
||||||
* @brief AddMoreInformation add more information for error
|
|
||||||
* @param info information
|
|
||||||
*/
|
|
||||||
void AddMoreInformation(const QString &info);
|
void AddMoreInformation(const QString &info);
|
||||||
/**
|
|
||||||
* @brief MoreInformation return more information for error
|
|
||||||
* @return information
|
|
||||||
*/
|
|
||||||
QString MoreInformation() const;
|
QString MoreInformation() const;
|
||||||
protected:
|
protected:
|
||||||
/**
|
/** @brief what string with error */
|
||||||
* @brief what string with error
|
|
||||||
*/
|
|
||||||
QString what;
|
QString what;
|
||||||
/**
|
|
||||||
* @brief moreInfo more information about error
|
/** @brief moreInfo more information about error */
|
||||||
*/
|
|
||||||
QString moreInfo;
|
QString moreInfo;
|
||||||
|
|
||||||
QString MoreInfo(const QString &detInfo) const;
|
QString MoreInfo(const QString &detInfo) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief What return string with error
|
||||||
|
* @return string with error
|
||||||
|
*/
|
||||||
inline QString VException::What() const
|
inline QString VException::What() const
|
||||||
{
|
{
|
||||||
return what;
|
return what;
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief MoreInformation return more information for error
|
||||||
|
* @return information
|
||||||
|
*/
|
||||||
inline QString VException::MoreInformation() const
|
inline QString VException::MoreInformation() const
|
||||||
{
|
{
|
||||||
return moreInfo;
|
return moreInfo;
|
||||||
|
|
|
@ -29,6 +29,36 @@
|
||||||
#include "vexceptionbadid.h"
|
#include "vexceptionbadid.h"
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief VExceptionBadId exception bad id
|
||||||
|
* @param what string with error
|
||||||
|
* @param id id
|
||||||
|
*/
|
||||||
|
VExceptionBadId::VExceptionBadId(const QString &what, const quint32 &id)
|
||||||
|
:VException(what), id(id), key(QString()){}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief VExceptionBadId exception bad id
|
||||||
|
* @param what string with error
|
||||||
|
* @param key string key
|
||||||
|
*/
|
||||||
|
VExceptionBadId::VExceptionBadId(const QString &what, const QString &key)
|
||||||
|
:VException(what), id(0), key(key){}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief VExceptionBadId copy constructor
|
||||||
|
* @param e exception
|
||||||
|
*/
|
||||||
|
VExceptionBadId::VExceptionBadId(const VExceptionBadId &e)
|
||||||
|
:VException(e), id(e.BadId()), key(e.BadKey()){}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief ErrorMessage return main error message
|
||||||
|
* @return main error message
|
||||||
|
*/
|
||||||
QString VExceptionBadId::ErrorMessage() const
|
QString VExceptionBadId::ErrorMessage() const
|
||||||
{
|
{
|
||||||
QString error;
|
QString error;
|
||||||
|
|
|
@ -37,58 +37,36 @@
|
||||||
class VExceptionBadId : public VException
|
class VExceptionBadId : public VException
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
/**
|
VExceptionBadId(const QString &what, const quint32 &id);
|
||||||
* @brief VExceptionBadId exception bad id
|
VExceptionBadId(const QString &what, const QString &key);
|
||||||
* @param what string with error
|
VExceptionBadId(const VExceptionBadId &e);
|
||||||
* @param id id
|
|
||||||
*/
|
|
||||||
VExceptionBadId(const QString &what, const quint32 &id)
|
|
||||||
:VException(what), id(id), key(QString()){}
|
|
||||||
/**
|
|
||||||
* @brief VExceptionBadId exception bad id
|
|
||||||
* @param what string with error
|
|
||||||
* @param key string key
|
|
||||||
*/
|
|
||||||
VExceptionBadId(const QString &what, const QString &key)
|
|
||||||
:VException(what), id(0), key(key){}
|
|
||||||
/**
|
|
||||||
* @brief VExceptionBadId copy constructor
|
|
||||||
* @param e exception
|
|
||||||
*/
|
|
||||||
VExceptionBadId(const VExceptionBadId &e)
|
|
||||||
:VException(e), id(e.BadId()), key(e.BadKey()){}
|
|
||||||
virtual ~VExceptionBadId() noexcept (true){}
|
virtual ~VExceptionBadId() noexcept (true){}
|
||||||
/**
|
|
||||||
* @brief ErrorMessage return main error message
|
|
||||||
* @return main error message
|
|
||||||
*/
|
|
||||||
virtual QString ErrorMessage() const;
|
virtual QString ErrorMessage() const;
|
||||||
/**
|
|
||||||
* @brief BadId return bad id
|
|
||||||
* @return id
|
|
||||||
*/
|
|
||||||
quint32 BadId() const;
|
quint32 BadId() const;
|
||||||
/**
|
|
||||||
* @brief BadKey return bad key
|
|
||||||
* @return key
|
|
||||||
*/
|
|
||||||
QString BadKey() const;
|
QString BadKey() const;
|
||||||
protected:
|
protected:
|
||||||
/**
|
/** @brief id id */
|
||||||
* @brief id id
|
|
||||||
*/
|
|
||||||
quint32 id;
|
quint32 id;
|
||||||
/**
|
|
||||||
* @brief key key
|
/** @brief key key */
|
||||||
*/
|
|
||||||
QString key;
|
QString key;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief BadId return bad id
|
||||||
|
* @return id
|
||||||
|
*/
|
||||||
inline quint32 VExceptionBadId::BadId() const
|
inline quint32 VExceptionBadId::BadId() const
|
||||||
{
|
{
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief BadKey return bad key
|
||||||
|
* @return key
|
||||||
|
*/
|
||||||
inline QString VExceptionBadId::BadKey() const
|
inline QString VExceptionBadId::BadKey() const
|
||||||
{
|
{
|
||||||
return key;
|
return key;
|
||||||
|
|
|
@ -29,6 +29,11 @@
|
||||||
#include "vexceptionconversionerror.h"
|
#include "vexceptionconversionerror.h"
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief VExceptionConversionError exception conversion error
|
||||||
|
* @param what string with error
|
||||||
|
* @param str string, where happend error
|
||||||
|
*/
|
||||||
VExceptionConversionError::VExceptionConversionError(const QString &what, const QString &str)
|
VExceptionConversionError::VExceptionConversionError(const QString &what, const QString &str)
|
||||||
:VException(what), str(str)
|
:VException(what), str(str)
|
||||||
{
|
{
|
||||||
|
@ -36,11 +41,23 @@ VExceptionConversionError::VExceptionConversionError(const QString &what, const
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief VExceptionConversionError copy constructor
|
||||||
|
* @param e exception
|
||||||
|
*/
|
||||||
VExceptionConversionError::VExceptionConversionError(const VExceptionConversionError &e)
|
VExceptionConversionError::VExceptionConversionError(const VExceptionConversionError &e)
|
||||||
:VException(e), str(e.String())
|
:VException(e), str(e.String())
|
||||||
{}
|
{}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
VExceptionConversionError::~VExceptionConversionError()
|
||||||
|
{}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief ErrorMessage return main error message
|
||||||
|
* @return main error message
|
||||||
|
*/
|
||||||
QString VExceptionConversionError::ErrorMessage() const
|
QString VExceptionConversionError::ErrorMessage() const
|
||||||
{
|
{
|
||||||
QString error = QString("ExceptionConversionError: %1 %2").arg(what, str);
|
QString error = QString("ExceptionConversionError: %1 %2").arg(what, str);
|
||||||
|
|
|
@ -37,35 +37,21 @@
|
||||||
class VExceptionConversionError : public VException
|
class VExceptionConversionError : public VException
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
/**
|
VExceptionConversionError(const QString &what, const QString &str);
|
||||||
* @brief VExceptionConversionError exception conversion error
|
VExceptionConversionError(const VExceptionConversionError &e);
|
||||||
* @param what string with error
|
virtual ~VExceptionConversionError() noexcept (true);
|
||||||
* @param str string, where happend error
|
|
||||||
*/
|
|
||||||
VExceptionConversionError(const QString &what, const QString &str);
|
|
||||||
/**
|
|
||||||
* @brief VExceptionConversionError copy constructor
|
|
||||||
* @param e exception
|
|
||||||
*/
|
|
||||||
VExceptionConversionError(const VExceptionConversionError &e);
|
|
||||||
virtual ~VExceptionConversionError() noexcept (true) {}
|
|
||||||
/**
|
|
||||||
* @brief ErrorMessage return main error message
|
|
||||||
* @return main error message
|
|
||||||
*/
|
|
||||||
virtual QString ErrorMessage() const;
|
virtual QString ErrorMessage() const;
|
||||||
/**
|
|
||||||
* @brief String return string, where happend error
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
QString String() const;
|
QString String() const;
|
||||||
protected:
|
protected:
|
||||||
/**
|
/** @brief str string, where happend error */
|
||||||
* @brief str string, where happend error
|
|
||||||
*/
|
|
||||||
QString str;
|
QString str;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief String return string, where happend error
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
inline QString VExceptionConversionError::String() const
|
inline QString VExceptionConversionError::String() const
|
||||||
{
|
{
|
||||||
return str;
|
return str;
|
||||||
|
|
|
@ -31,6 +31,12 @@
|
||||||
#include <QtWidgets>
|
#include <QtWidgets>
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief VExceptionEmptyParameter exception empty parameter
|
||||||
|
* @param what string with error
|
||||||
|
* @param name name of attribute where error
|
||||||
|
* @param domElement dom element
|
||||||
|
*/
|
||||||
VExceptionEmptyParameter::VExceptionEmptyParameter(const QString &what, const QString &name,
|
VExceptionEmptyParameter::VExceptionEmptyParameter(const QString &what, const QString &name,
|
||||||
const QDomElement &domElement)
|
const QDomElement &domElement)
|
||||||
: VException(what), name(name), tagText(QString()), tagName(QString()), lineNumber(-1)
|
: VException(what), name(name), tagText(QString()), tagName(QString()), lineNumber(-1)
|
||||||
|
@ -44,11 +50,23 @@ VExceptionEmptyParameter::VExceptionEmptyParameter(const QString &what, const QS
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief VExceptionEmptyParameter copy constructor
|
||||||
|
* @param e exception
|
||||||
|
*/
|
||||||
VExceptionEmptyParameter::VExceptionEmptyParameter(const VExceptionEmptyParameter &e)
|
VExceptionEmptyParameter::VExceptionEmptyParameter(const VExceptionEmptyParameter &e)
|
||||||
:VException(e), name(e.Name()), tagText(e.TagText()), tagName(e.TagName()), lineNumber(e.LineNumber())
|
:VException(e), name(e.Name()), tagText(e.TagText()), tagName(e.TagName()), lineNumber(e.LineNumber())
|
||||||
{}
|
{}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
VExceptionEmptyParameter::~VExceptionEmptyParameter()
|
||||||
|
{}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief ErrorMessage return main error message
|
||||||
|
* @return main error message
|
||||||
|
*/
|
||||||
QString VExceptionEmptyParameter::ErrorMessage() const
|
QString VExceptionEmptyParameter::ErrorMessage() const
|
||||||
{
|
{
|
||||||
QString error = QString("ExceptionEmptyParameter: %1 %2").arg(what, name);
|
QString error = QString("ExceptionEmptyParameter: %1 %2").arg(what, name);
|
||||||
|
@ -56,6 +74,10 @@ QString VExceptionEmptyParameter::ErrorMessage() const
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief DetailedInformation return detailed information about error
|
||||||
|
* @return detailed information
|
||||||
|
*/
|
||||||
QString VExceptionEmptyParameter::DetailedInformation() const
|
QString VExceptionEmptyParameter::DetailedInformation() const
|
||||||
{
|
{
|
||||||
return MoreInfo(QString("tag: %1 in line %2\nFull tag:\n%3").arg(tagName).arg(lineNumber).arg(tagText));
|
return MoreInfo(QString("tag: %1 in line %2\nFull tag:\n%3").arg(tagName).arg(lineNumber).arg(tagText));
|
||||||
|
|
|
@ -39,83 +39,64 @@
|
||||||
class VExceptionEmptyParameter : public VException
|
class VExceptionEmptyParameter : public VException
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
/**
|
VExceptionEmptyParameter(const QString &what, const QString &name, const QDomElement &domElement);
|
||||||
* @brief VExceptionEmptyParameter exception empty parameter
|
VExceptionEmptyParameter(const VExceptionEmptyParameter &e);
|
||||||
* @param what string with error
|
virtual ~VExceptionEmptyParameter() noexcept (true);
|
||||||
* @param name name of attribute where error
|
|
||||||
* @param domElement dom element
|
|
||||||
*/
|
|
||||||
VExceptionEmptyParameter(const QString &what, const QString &name, const QDomElement &domElement);
|
|
||||||
/**
|
|
||||||
* @brief VExceptionEmptyParameter copy constructor
|
|
||||||
* @param e exception
|
|
||||||
*/
|
|
||||||
VExceptionEmptyParameter(const VExceptionEmptyParameter &e);
|
|
||||||
virtual ~VExceptionEmptyParameter() noexcept (true) {}
|
|
||||||
/**
|
|
||||||
* @brief ErrorMessage return main error message
|
|
||||||
* @return main error message
|
|
||||||
*/
|
|
||||||
virtual QString ErrorMessage() const;
|
virtual QString ErrorMessage() const;
|
||||||
/**
|
|
||||||
* @brief DetailedInformation return detailed information about error
|
|
||||||
* @return detailed information
|
|
||||||
*/
|
|
||||||
virtual QString DetailedInformation() const;
|
virtual QString DetailedInformation() const;
|
||||||
/**
|
|
||||||
* @brief Name return name of attribute where error
|
|
||||||
* @return name
|
|
||||||
*/
|
|
||||||
QString Name() const;
|
QString Name() const;
|
||||||
/**
|
|
||||||
* @brief TagText return tag text
|
|
||||||
* @return tag text
|
|
||||||
*/
|
|
||||||
QString TagText() const;
|
QString TagText() const;
|
||||||
/**
|
|
||||||
* @brief TagName return tag name
|
|
||||||
* @return tag name
|
|
||||||
*/
|
|
||||||
QString TagName() const;
|
QString TagName() const;
|
||||||
/**
|
|
||||||
* @brief LineNumber return line number of tag
|
|
||||||
* @return line number
|
|
||||||
*/
|
|
||||||
qint32 LineNumber() const;
|
qint32 LineNumber() const;
|
||||||
protected:
|
protected:
|
||||||
/**
|
/** @brief name name attribute */
|
||||||
* @brief name name attribute
|
|
||||||
*/
|
|
||||||
QString name;
|
QString name;
|
||||||
/**
|
|
||||||
* @brief tagText tag text
|
/** @brief tagText tag text */
|
||||||
*/
|
|
||||||
QString tagText;
|
QString tagText;
|
||||||
/**
|
|
||||||
* @brief tagName tag name
|
/** @brief tagName tag name */
|
||||||
*/
|
|
||||||
QString tagName;
|
QString tagName;
|
||||||
/**
|
|
||||||
* @brief lineNumber line number
|
/** @brief lineNumber line number */
|
||||||
*/
|
|
||||||
qint32 lineNumber;
|
qint32 lineNumber;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief Name return name of attribute where error
|
||||||
|
* @return name
|
||||||
|
*/
|
||||||
inline QString VExceptionEmptyParameter::Name() const
|
inline QString VExceptionEmptyParameter::Name() const
|
||||||
{
|
{
|
||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief TagText return tag text
|
||||||
|
* @return tag text
|
||||||
|
*/
|
||||||
inline QString VExceptionEmptyParameter::TagText() const
|
inline QString VExceptionEmptyParameter::TagText() const
|
||||||
{
|
{
|
||||||
return tagText;
|
return tagText;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief TagName return tag name
|
||||||
|
* @return tag name
|
||||||
|
*/
|
||||||
inline QString VExceptionEmptyParameter::TagName() const
|
inline QString VExceptionEmptyParameter::TagName() const
|
||||||
{
|
{
|
||||||
return tagName;
|
return tagName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief LineNumber return line number of tag
|
||||||
|
* @return line number
|
||||||
|
*/
|
||||||
inline qint32 VExceptionEmptyParameter::LineNumber() const
|
inline qint32 VExceptionEmptyParameter::LineNumber() const
|
||||||
{
|
{
|
||||||
return lineNumber;
|
return lineNumber;
|
||||||
|
|
|
@ -30,6 +30,11 @@
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief VExceptionObjectError exception object error
|
||||||
|
* @param what string with error
|
||||||
|
* @param domElement dom element
|
||||||
|
*/
|
||||||
VExceptionObjectError::VExceptionObjectError(const QString &what, const QDomElement &domElement)
|
VExceptionObjectError::VExceptionObjectError(const QString &what, const QDomElement &domElement)
|
||||||
:VException(what), tagText(QString()), tagName(QString()), lineNumber(-1)
|
:VException(what), tagText(QString()), tagName(QString()), lineNumber(-1)
|
||||||
{
|
{
|
||||||
|
@ -41,11 +46,19 @@ VExceptionObjectError::VExceptionObjectError(const QString &what, const QDomElem
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief VExceptionObjectError copy constructor
|
||||||
|
* @param e exception
|
||||||
|
*/
|
||||||
VExceptionObjectError::VExceptionObjectError(const VExceptionObjectError &e)
|
VExceptionObjectError::VExceptionObjectError(const VExceptionObjectError &e)
|
||||||
:VException(e), tagText(e.TagText()), tagName(e.TagName()), lineNumber(e.LineNumber())
|
:VException(e), tagText(e.TagText()), tagName(e.TagName()), lineNumber(e.LineNumber())
|
||||||
{}
|
{}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief ErrorMessage return main error message
|
||||||
|
* @return main error message
|
||||||
|
*/
|
||||||
QString VExceptionObjectError::ErrorMessage() const
|
QString VExceptionObjectError::ErrorMessage() const
|
||||||
{
|
{
|
||||||
QString error = QString("ExceptionObjectError: %1").arg(what);
|
QString error = QString("ExceptionObjectError: %1").arg(what);
|
||||||
|
@ -53,6 +66,10 @@ QString VExceptionObjectError::ErrorMessage() const
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief DetailedInformation return detailed information about error
|
||||||
|
* @return detailed information
|
||||||
|
*/
|
||||||
QString VExceptionObjectError::DetailedInformation() const
|
QString VExceptionObjectError::DetailedInformation() const
|
||||||
{
|
{
|
||||||
return MoreInfo(QString("tag: %1 in line %2\n%3").arg(tagName).arg(lineNumber).arg(tagText));
|
return MoreInfo(QString("tag: %1 in line %2\n%3").arg(tagName).arg(lineNumber).arg(tagText));
|
||||||
|
|
|
@ -39,68 +39,50 @@
|
||||||
class VExceptionObjectError : public VException
|
class VExceptionObjectError : public VException
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
/**
|
|
||||||
* @brief VExceptionObjectError exception object error
|
|
||||||
* @param what string with error
|
|
||||||
* @param domElement dom element
|
|
||||||
*/
|
|
||||||
VExceptionObjectError(const QString &what, const QDomElement &domElement);
|
VExceptionObjectError(const QString &what, const QDomElement &domElement);
|
||||||
/**
|
|
||||||
* @brief VExceptionObjectError copy constructor
|
|
||||||
* @param e exception
|
|
||||||
*/
|
|
||||||
VExceptionObjectError(const VExceptionObjectError &e);
|
VExceptionObjectError(const VExceptionObjectError &e);
|
||||||
virtual ~VExceptionObjectError() noexcept (true) {}
|
virtual ~VExceptionObjectError() noexcept (true) {}
|
||||||
/**
|
|
||||||
* @brief ErrorMessage return main error message
|
|
||||||
* @return main error message
|
|
||||||
*/
|
|
||||||
virtual QString ErrorMessage() const;
|
virtual QString ErrorMessage() const;
|
||||||
/**
|
|
||||||
* @brief DetailedInformation return detailed information about error
|
|
||||||
* @return detailed information
|
|
||||||
*/
|
|
||||||
virtual QString DetailedInformation() const;
|
virtual QString DetailedInformation() const;
|
||||||
/**
|
|
||||||
* @brief TagText return tag text
|
|
||||||
* @return tag text
|
|
||||||
*/
|
|
||||||
QString TagText() const;
|
QString TagText() const;
|
||||||
/**
|
|
||||||
* @brief TagName return tag name
|
|
||||||
* @return tag name
|
|
||||||
*/
|
|
||||||
QString TagName() const;
|
QString TagName() const;
|
||||||
/**
|
|
||||||
* @brief LineNumber return line number in file
|
|
||||||
* @return line number
|
|
||||||
*/
|
|
||||||
qint32 LineNumber() const;
|
qint32 LineNumber() const;
|
||||||
protected:
|
protected:
|
||||||
/**
|
/** @brief tagText tag text */
|
||||||
* @brief tagText tag text
|
|
||||||
*/
|
|
||||||
QString tagText;
|
QString tagText;
|
||||||
/**
|
|
||||||
* @brief tagName tag name
|
/** @brief tagName tag name */
|
||||||
*/
|
|
||||||
QString tagName;
|
QString tagName;
|
||||||
/**
|
|
||||||
* @brief lineNumber line number
|
/** @brief lineNumber line number */
|
||||||
*/
|
|
||||||
qint32 lineNumber;
|
qint32 lineNumber;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief TagText return tag text
|
||||||
|
* @return tag text
|
||||||
|
*/
|
||||||
inline QString VExceptionObjectError::TagText() const
|
inline QString VExceptionObjectError::TagText() const
|
||||||
{
|
{
|
||||||
return tagText;
|
return tagText;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief TagName return tag name
|
||||||
|
* @return tag name
|
||||||
|
*/
|
||||||
inline QString VExceptionObjectError::TagName() const
|
inline QString VExceptionObjectError::TagName() const
|
||||||
{
|
{
|
||||||
return tagName;
|
return tagName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief LineNumber return line number in file
|
||||||
|
* @return line number
|
||||||
|
*/
|
||||||
inline qint32 VExceptionObjectError::LineNumber() const
|
inline qint32 VExceptionObjectError::LineNumber() const
|
||||||
{
|
{
|
||||||
return lineNumber;
|
return lineNumber;
|
||||||
|
|
|
@ -30,6 +30,11 @@
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief VExceptionWrongId exception wrong parameter id
|
||||||
|
* @param what string with error
|
||||||
|
* @param domElement som element
|
||||||
|
*/
|
||||||
VExceptionWrongId::VExceptionWrongId(const QString &what, const QDomElement &domElement)
|
VExceptionWrongId::VExceptionWrongId(const QString &what, const QDomElement &domElement)
|
||||||
:VException(what), tagText(QString()), tagName(QString()), lineNumber(-1)
|
:VException(what), tagText(QString()), tagName(QString()), lineNumber(-1)
|
||||||
{
|
{
|
||||||
|
@ -41,11 +46,19 @@ VExceptionWrongId::VExceptionWrongId(const QString &what, const QDomElement &dom
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief VExceptionWrongId copy constructor
|
||||||
|
* @param e exception
|
||||||
|
*/
|
||||||
VExceptionWrongId::VExceptionWrongId(const VExceptionWrongId &e)
|
VExceptionWrongId::VExceptionWrongId(const VExceptionWrongId &e)
|
||||||
:VException(e), tagText(e.TagText()), tagName(e.TagName()), lineNumber(e.LineNumber())
|
:VException(e), tagText(e.TagText()), tagName(e.TagName()), lineNumber(e.LineNumber())
|
||||||
{}
|
{}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief ErrorMessage return main error message
|
||||||
|
* @return main error message
|
||||||
|
*/
|
||||||
QString VExceptionWrongId::ErrorMessage() const
|
QString VExceptionWrongId::ErrorMessage() const
|
||||||
{
|
{
|
||||||
QString error = QString("ExceptionWrongId: %1").arg(what);
|
QString error = QString("ExceptionWrongId: %1").arg(what);
|
||||||
|
@ -53,6 +66,10 @@ QString VExceptionWrongId::ErrorMessage() const
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief DetailedInformation return detailed information about error
|
||||||
|
* @return detailed information
|
||||||
|
*/
|
||||||
QString VExceptionWrongId::DetailedInformation() const
|
QString VExceptionWrongId::DetailedInformation() const
|
||||||
{
|
{
|
||||||
return MoreInfo(QString("tag: %1 in line %2\nFull tag:\n%3").arg(tagName).arg(lineNumber).arg(tagText));
|
return MoreInfo(QString("tag: %1 in line %2\nFull tag:\n%3").arg(tagName).arg(lineNumber).arg(tagText));
|
||||||
|
|
|
@ -39,68 +39,50 @@
|
||||||
class VExceptionWrongId : public VException
|
class VExceptionWrongId : public VException
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
/**
|
|
||||||
* @brief VExceptionWrongId exception wrong parameter id
|
|
||||||
* @param what string with error
|
|
||||||
* @param domElement som element
|
|
||||||
*/
|
|
||||||
VExceptionWrongId(const QString &what, const QDomElement &domElement);
|
VExceptionWrongId(const QString &what, const QDomElement &domElement);
|
||||||
/**
|
|
||||||
* @brief VExceptionWrongId copy constructor
|
|
||||||
* @param e exception
|
|
||||||
*/
|
|
||||||
VExceptionWrongId(const VExceptionWrongId &e);
|
VExceptionWrongId(const VExceptionWrongId &e);
|
||||||
virtual ~VExceptionWrongId() noexcept (true){}
|
virtual ~VExceptionWrongId() noexcept (true){}
|
||||||
/**
|
|
||||||
* @brief ErrorMessage return main error message
|
|
||||||
* @return main error message
|
|
||||||
*/
|
|
||||||
virtual QString ErrorMessage() const;
|
virtual QString ErrorMessage() const;
|
||||||
/**
|
|
||||||
* @brief DetailedInformation return detailed information about error
|
|
||||||
* @return detailed information
|
|
||||||
*/
|
|
||||||
virtual QString DetailedInformation() const;
|
virtual QString DetailedInformation() const;
|
||||||
/**
|
|
||||||
* @brief TagText return tag text
|
|
||||||
* @return tag text
|
|
||||||
*/
|
|
||||||
QString TagText() const;
|
QString TagText() const;
|
||||||
/**
|
|
||||||
* @brief TagName return tag name
|
|
||||||
* @return tag name
|
|
||||||
*/
|
|
||||||
QString TagName() const;
|
QString TagName() const;
|
||||||
/**
|
|
||||||
* @brief LineNumber return line number in file
|
|
||||||
* @return line number
|
|
||||||
*/
|
|
||||||
qint32 LineNumber() const;
|
qint32 LineNumber() const;
|
||||||
protected:
|
protected:
|
||||||
/**
|
/** @brief tagText tag text */
|
||||||
* @brief tagText tag text
|
|
||||||
*/
|
|
||||||
QString tagText;
|
QString tagText;
|
||||||
/**
|
|
||||||
* @brief tagName tag name
|
/** @brief tagName tag name */
|
||||||
*/
|
|
||||||
QString tagName;
|
QString tagName;
|
||||||
/**
|
|
||||||
* @brief lineNumber line number
|
/** @brief lineNumber line number */
|
||||||
*/
|
|
||||||
qint32 lineNumber;
|
qint32 lineNumber;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief TagText return tag text
|
||||||
|
* @return tag text
|
||||||
|
*/
|
||||||
inline QString VExceptionWrongId::TagText() const
|
inline QString VExceptionWrongId::TagText() const
|
||||||
{
|
{
|
||||||
return tagText;
|
return tagText;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief TagName return tag name
|
||||||
|
* @return tag name
|
||||||
|
*/
|
||||||
inline QString VExceptionWrongId::TagName() const
|
inline QString VExceptionWrongId::TagName() const
|
||||||
{
|
{
|
||||||
return tagName;
|
return tagName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief LineNumber return line number in file
|
||||||
|
* @return line number
|
||||||
|
*/
|
||||||
inline qint32 VExceptionWrongId::LineNumber() const
|
inline qint32 VExceptionWrongId::LineNumber() const
|
||||||
{
|
{
|
||||||
return lineNumber;
|
return lineNumber;
|
||||||
|
|
|
@ -34,12 +34,22 @@
|
||||||
class QRectF;
|
class QRectF;
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief VArc default constructor.
|
||||||
|
*/
|
||||||
VArc::VArc ()
|
VArc::VArc ()
|
||||||
:VGObject(GObject::Arc), f1(0), formulaF1(QString()), f2(0), formulaF2(QString()), radius(0),
|
:VGObject(GObject::Arc), f1(0), formulaF1(QString()), f2(0), formulaF2(QString()), radius(0),
|
||||||
formulaRadius(QString()), center(VPointF())
|
formulaRadius(QString()), center(VPointF())
|
||||||
{}
|
{}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief VArc constructor.
|
||||||
|
* @param center center point.
|
||||||
|
* @param radius arc radius.
|
||||||
|
* @param f1 start angle (degree).
|
||||||
|
* @param f2 end angle (degree).
|
||||||
|
*/
|
||||||
VArc::VArc (VPointF center, qreal radius, QString formulaRadius, qreal f1, QString formulaF1, qreal f2,
|
VArc::VArc (VPointF center, qreal radius, QString formulaRadius, qreal f1, QString formulaF1, qreal f2,
|
||||||
QString formulaF2, quint32 idObject, Valentina::Draws mode)
|
QString formulaF2, quint32 idObject, Valentina::Draws mode)
|
||||||
: VGObject(GObject::Arc, idObject, mode), f1(f1), formulaF1(formulaF1), f2(f2), formulaF2(formulaF2),
|
: VGObject(GObject::Arc, idObject, mode), f1(f1), formulaF1(formulaF1), f2(f2), formulaF2(formulaF2),
|
||||||
|
@ -49,6 +59,10 @@ VArc::VArc (VPointF center, qreal radius, QString formulaRadius, qreal f1, QStri
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief VArc copy constructor
|
||||||
|
* @param arc arc
|
||||||
|
*/
|
||||||
VArc::VArc(const VArc &arc)
|
VArc::VArc(const VArc &arc)
|
||||||
: VGObject(arc), f1(arc.GetF1()), formulaF1(arc.GetFormulaF1()), f2(arc.GetF2()),
|
: VGObject(arc), f1(arc.GetF1()), formulaF1(arc.GetFormulaF1()), f2(arc.GetF2()),
|
||||||
formulaF2(arc.GetFormulaF2()), radius(arc.GetRadius()), formulaRadius(arc.GetFormulaRadius()),
|
formulaF2(arc.GetFormulaF2()), radius(arc.GetRadius()), formulaRadius(arc.GetFormulaRadius()),
|
||||||
|
@ -56,6 +70,11 @@ VArc::VArc(const VArc &arc)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief operator = assignment operator
|
||||||
|
* @param arc arc
|
||||||
|
* @return arc
|
||||||
|
*/
|
||||||
VArc &VArc::operator =(const VArc &arc)
|
VArc &VArc::operator =(const VArc &arc)
|
||||||
{
|
{
|
||||||
VGObject::operator=(arc);
|
VGObject::operator=(arc);
|
||||||
|
@ -70,12 +89,20 @@ VArc &VArc::operator =(const VArc &arc)
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief GetLength return arc length.
|
||||||
|
* @return length.
|
||||||
|
*/
|
||||||
qreal VArc::GetLength() const
|
qreal VArc::GetLength() const
|
||||||
{
|
{
|
||||||
return (M_PI * radius)/180 * AngleArc();
|
return (M_PI * radius)/180 * AngleArc();
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief GetP1 return point associated with start angle.
|
||||||
|
* @return point.
|
||||||
|
*/
|
||||||
QPointF VArc::GetP1() const
|
QPointF VArc::GetP1() const
|
||||||
{
|
{
|
||||||
QPointF p1 ( GetCenter().x () + radius, GetCenter().y () );
|
QPointF p1 ( GetCenter().x () + radius, GetCenter().y () );
|
||||||
|
@ -85,6 +112,10 @@ QPointF VArc::GetP1() const
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief GetP2 return point associated with end angle.
|
||||||
|
* @return точку point.
|
||||||
|
*/
|
||||||
QPointF VArc::GetP2 () const
|
QPointF VArc::GetP2 () const
|
||||||
{
|
{
|
||||||
QPointF p2 ( GetCenter().x () + radius, GetCenter().y () );
|
QPointF p2 ( GetCenter().x () + radius, GetCenter().y () );
|
||||||
|
@ -94,6 +125,10 @@ QPointF VArc::GetP2 () const
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief GetPath return QPainterPath for this arc.
|
||||||
|
* @return path.
|
||||||
|
*/
|
||||||
QPainterPath VArc::GetPath() const
|
QPainterPath VArc::GetPath() const
|
||||||
{
|
{
|
||||||
QPainterPath path;
|
QPainterPath path;
|
||||||
|
@ -115,6 +150,10 @@ QPainterPath VArc::GetPath() const
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief AngleArc calculate arc angle.
|
||||||
|
* @return angle in degree.
|
||||||
|
*/
|
||||||
qreal VArc::AngleArc() const
|
qreal VArc::AngleArc() const
|
||||||
{
|
{
|
||||||
QLineF l1(0, 0, 100, 100);
|
QLineF l1(0, 0, 100, 100);
|
||||||
|
@ -125,6 +164,10 @@ qreal VArc::AngleArc() const
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief GetPoints return list of points needed for drawing arc.
|
||||||
|
* @return list of points
|
||||||
|
*/
|
||||||
QVector<QPointF> VArc::GetPoints() const
|
QVector<QPointF> VArc::GetPoints() const
|
||||||
{
|
{
|
||||||
QVector<QPointF> points;
|
QVector<QPointF> points;
|
||||||
|
@ -149,12 +192,23 @@ QVector<QPointF> VArc::GetPoints() const
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief name return arc name. This name used in variables.
|
||||||
|
* @return name
|
||||||
|
*/
|
||||||
QString VArc::name() const
|
QString VArc::name() const
|
||||||
{
|
{
|
||||||
return _name;
|
return _name;
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief CutArc cut arc into two arcs.
|
||||||
|
* @param length length first arc.
|
||||||
|
* @param arc1 first arc.
|
||||||
|
* @param arc2 second arc.
|
||||||
|
* @return point cutting
|
||||||
|
*/
|
||||||
QPointF VArc::CutArc(const qreal &length, VArc &arc1, VArc &arc2) const
|
QPointF VArc::CutArc(const qreal &length, VArc &arc1, VArc &arc2) const
|
||||||
{
|
{
|
||||||
//Always need return two arcs, so we must correct wrong length.
|
//Always need return two arcs, so we must correct wrong length.
|
||||||
|
@ -185,6 +239,10 @@ QPointF VArc::CutArc(const qreal &length, VArc &arc1, VArc &arc2) const
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief setId keep id arc in data.
|
||||||
|
* @param id id arc in data.
|
||||||
|
*/
|
||||||
void VArc::setId(const quint32 &id)
|
void VArc::setId(const quint32 &id)
|
||||||
{
|
{
|
||||||
_id = id;
|
_id = id;
|
||||||
|
|
|
@ -44,174 +44,115 @@ class VArc: public VGObject
|
||||||
{
|
{
|
||||||
Q_DECLARE_TR_FUNCTIONS(VArc)
|
Q_DECLARE_TR_FUNCTIONS(VArc)
|
||||||
public:
|
public:
|
||||||
/**
|
|
||||||
* @brief VArc default constructor.
|
|
||||||
*/
|
|
||||||
VArc ();
|
VArc ();
|
||||||
/**
|
|
||||||
* @brief VArc constructor.
|
|
||||||
* @param center center point.
|
|
||||||
* @param radius arc radius.
|
|
||||||
* @param f1 start angle (degree).
|
|
||||||
* @param f2 end angle (degree).
|
|
||||||
*/
|
|
||||||
VArc (VPointF center, qreal radius, QString formulaRadius, qreal f1, QString formulaF1, qreal f2,
|
VArc (VPointF center, qreal radius, QString formulaRadius, qreal f1, QString formulaF1, qreal f2,
|
||||||
QString formulaF2, quint32 idObject = 0, Valentina::Draws mode = Valentina::Calculation);
|
QString formulaF2, quint32 idObject = 0, Valentina::Draws mode = Valentina::Calculation);
|
||||||
/**
|
|
||||||
* @brief VArc copy constructor
|
|
||||||
* @param arc arc
|
|
||||||
*/
|
|
||||||
VArc(const VArc &arc);
|
VArc(const VArc &arc);
|
||||||
/**
|
|
||||||
* @brief operator = assignment operator
|
|
||||||
* @param arc arc
|
|
||||||
* @return arc
|
|
||||||
*/
|
|
||||||
VArc& operator= (const VArc &arc);
|
VArc& operator= (const VArc &arc);
|
||||||
/**
|
|
||||||
* @brief GetF1 return start angle.
|
|
||||||
* @return angle in degree.
|
|
||||||
*/
|
|
||||||
QString GetFormulaF1 () const;
|
QString GetFormulaF1 () const;
|
||||||
/**
|
|
||||||
* @brief GetF1 return formula for start angle.
|
|
||||||
* @return string with formula.
|
|
||||||
*/
|
|
||||||
qreal GetF1 () const;
|
qreal GetF1 () const;
|
||||||
/**
|
|
||||||
* @brief GetF2 return end angle.
|
|
||||||
* @return angle in degree.
|
|
||||||
*/
|
|
||||||
QString GetFormulaF2 () const;
|
QString GetFormulaF2 () const;
|
||||||
/**
|
|
||||||
* @brief GetF2 return formula for end angle.
|
|
||||||
* @return string with formula.
|
|
||||||
*/
|
|
||||||
qreal GetF2 () const;
|
qreal GetF2 () const;
|
||||||
/**
|
|
||||||
* @brief GetLength return arc length.
|
|
||||||
* @return length.
|
|
||||||
*/
|
|
||||||
qreal GetLength () const;
|
qreal GetLength () const;
|
||||||
/**
|
|
||||||
* @brief GetRadius return arc radius.
|
|
||||||
* @return radius.
|
|
||||||
*/
|
|
||||||
QString GetFormulaRadius () const;
|
QString GetFormulaRadius () const;
|
||||||
/**
|
|
||||||
* @brief GetRadius return formula for radius.
|
|
||||||
* @return string with formula.
|
|
||||||
*/
|
|
||||||
qreal GetRadius () const;
|
qreal GetRadius () const;
|
||||||
/**
|
|
||||||
* @brief GetCenter return center point.
|
|
||||||
* @return center point.
|
|
||||||
*/
|
|
||||||
VPointF GetCenter () const;
|
VPointF GetCenter () const;
|
||||||
/**
|
|
||||||
* @brief GetP1 return point associated with start angle.
|
|
||||||
* @return point.
|
|
||||||
*/
|
|
||||||
QPointF GetP1() const;
|
QPointF GetP1() const;
|
||||||
/**
|
|
||||||
* @brief GetP2 return point associated with end angle.
|
|
||||||
* @return точку point.
|
|
||||||
*/
|
|
||||||
QPointF GetP2 () const;
|
QPointF GetP2 () const;
|
||||||
/**
|
|
||||||
* @brief GetPath return QPainterPath for this arc.
|
|
||||||
* @return path.
|
|
||||||
*/
|
|
||||||
QPainterPath GetPath() const;
|
QPainterPath GetPath() const;
|
||||||
/**
|
|
||||||
* @brief AngleArc calculate arc angle.
|
|
||||||
* @return angle in degree.
|
|
||||||
*/
|
|
||||||
qreal AngleArc() const;
|
qreal AngleArc() const;
|
||||||
/**
|
|
||||||
* @brief GetPoints return list of points needed for drawing arc.
|
|
||||||
* @return list of points
|
|
||||||
*/
|
|
||||||
QVector<QPointF> GetPoints () const;
|
QVector<QPointF> GetPoints () const;
|
||||||
/**
|
|
||||||
* @brief name return arc name. This name used in variables.
|
|
||||||
* @return name
|
|
||||||
*/
|
|
||||||
virtual QString name() const;
|
virtual QString name() const;
|
||||||
/**
|
|
||||||
* @brief CutArc cut arc into two arcs.
|
|
||||||
* @param length length first arc.
|
|
||||||
* @param arc1 first arc.
|
|
||||||
* @param arc2 second arc.
|
|
||||||
* @return point cutting
|
|
||||||
*/
|
|
||||||
QPointF CutArc (const qreal &length, VArc &arc1, VArc &arc2) const;
|
QPointF CutArc (const qreal &length, VArc &arc1, VArc &arc2) const;
|
||||||
/**
|
|
||||||
* @brief setId keep id arc in data.
|
|
||||||
* @param id id arc in data.
|
|
||||||
*/
|
|
||||||
virtual void setId(const quint32 &id);
|
virtual void setId(const quint32 &id);
|
||||||
private:
|
private:
|
||||||
/**
|
/** @brief f1 start angle in degree. */
|
||||||
* @brief f1 start angle in degree.
|
|
||||||
*/
|
|
||||||
qreal f1;
|
qreal f1;
|
||||||
/**
|
|
||||||
* @brief formulaF1 formula for start angle.
|
/** @brief formulaF1 formula for start angle. */
|
||||||
*/
|
|
||||||
QString formulaF1;
|
QString formulaF1;
|
||||||
/**
|
|
||||||
* @brief f2 end angle in degree.
|
/** @brief f2 end angle in degree. */
|
||||||
*/
|
|
||||||
qreal f2;
|
qreal f2;
|
||||||
/**
|
|
||||||
* @brief formulaF2 formula for end angle.
|
/** @brief formulaF2 formula for end angle. */
|
||||||
*/
|
|
||||||
QString formulaF2;
|
QString formulaF2;
|
||||||
/**
|
|
||||||
* @brief radius arc radius.
|
/** @brief radius arc radius. */
|
||||||
*/
|
|
||||||
qreal radius;
|
qreal radius;
|
||||||
/**
|
|
||||||
* @brief formulaRadius formula for arc radius.
|
/** @brief formulaRadius formula for arc radius. */
|
||||||
*/
|
|
||||||
QString formulaRadius;
|
QString formulaRadius;
|
||||||
/**
|
|
||||||
* @brief center center point of arc.
|
/** @brief center center point of arc. */
|
||||||
*/
|
|
||||||
VPointF center;
|
VPointF center;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief GetF1 return start angle.
|
||||||
|
* @return angle in degree.
|
||||||
|
*/
|
||||||
inline QString VArc::GetFormulaF1() const
|
inline QString VArc::GetFormulaF1() const
|
||||||
{
|
{
|
||||||
return formulaF1;
|
return formulaF1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief GetF1 return formula for start angle.
|
||||||
|
* @return string with formula.
|
||||||
|
*/
|
||||||
inline qreal VArc::GetF1() const
|
inline qreal VArc::GetF1() const
|
||||||
{
|
{
|
||||||
return f1;
|
return f1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief GetF2 return end angle.
|
||||||
|
* @return angle in degree.
|
||||||
|
*/
|
||||||
inline QString VArc::GetFormulaF2() const
|
inline QString VArc::GetFormulaF2() const
|
||||||
{
|
{
|
||||||
return formulaF2;
|
return formulaF2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief GetF2 return formula for end angle.
|
||||||
|
* @return string with formula.
|
||||||
|
*/
|
||||||
inline qreal VArc::GetF2() const
|
inline qreal VArc::GetF2() const
|
||||||
{
|
{
|
||||||
return f2;
|
return f2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief GetRadius return arc radius.
|
||||||
|
* @return radius.
|
||||||
|
*/
|
||||||
inline QString VArc::GetFormulaRadius() const
|
inline QString VArc::GetFormulaRadius() const
|
||||||
{
|
{
|
||||||
return formulaRadius;
|
return formulaRadius;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief GetRadius return formula for radius.
|
||||||
|
* @return string with formula.
|
||||||
|
*/
|
||||||
inline qreal VArc::GetRadius() const
|
inline qreal VArc::GetRadius() const
|
||||||
{
|
{
|
||||||
return radius;
|
return radius;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief GetCenter return center point.
|
||||||
|
* @return center point.
|
||||||
|
*/
|
||||||
inline VPointF VArc::GetCenter() const
|
inline VPointF VArc::GetCenter() const
|
||||||
{
|
{
|
||||||
return center;
|
return center;
|
||||||
|
|
|
@ -243,7 +243,7 @@ void QmuParserError::Reset()
|
||||||
/**
|
/**
|
||||||
* @brief raise method raise for exception
|
* @brief raise method raise for exception
|
||||||
*/
|
*/
|
||||||
void qmu::QmuParserError::raise() const
|
Q_NORETURN void QmuParserError::raise() const
|
||||||
{
|
{
|
||||||
throw *this;
|
throw *this;
|
||||||
}
|
}
|
||||||
|
@ -253,7 +253,7 @@ void qmu::QmuParserError::raise() const
|
||||||
* @brief clone clone exception
|
* @brief clone clone exception
|
||||||
* @return new exception
|
* @return new exception
|
||||||
*/
|
*/
|
||||||
QmuParserError *qmu::QmuParserError::clone() const
|
QmuParserError *QmuParserError::clone() const
|
||||||
{
|
{
|
||||||
return new QmuParserError(*this);
|
return new QmuParserError(*this);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user