Highlight start of method.
--HG-- branch : feature
This commit is contained in:
parent
9ca9455c80
commit
bdb788e7a7
|
@ -38,6 +38,7 @@
|
|||
#define FINISHED 10
|
||||
#define EOL 9
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
qreal Calculator::eval(QString prog, QString *errorMsg)
|
||||
{
|
||||
this->errorMsg = errorMsg;
|
||||
|
@ -53,6 +54,7 @@ qreal Calculator::eval(QString prog, QString *errorMsg)
|
|||
return result;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
qreal Calculator::get_exp()
|
||||
{
|
||||
qreal result = 0;
|
||||
|
@ -67,7 +69,7 @@ qreal Calculator::get_exp()
|
|||
return result;
|
||||
}
|
||||
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void Calculator::level2(qreal *result)
|
||||
{
|
||||
QChar op;
|
||||
|
@ -82,6 +84,7 @@ void Calculator::level2(qreal *result)
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void Calculator::level3(qreal *result)
|
||||
{
|
||||
QChar op;
|
||||
|
@ -97,6 +100,7 @@ void Calculator::level3(qreal *result)
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void Calculator::level4(qreal *result)
|
||||
{
|
||||
qreal hold;
|
||||
|
@ -110,6 +114,7 @@ void Calculator::level4(qreal *result)
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void Calculator::level5(qreal *result)
|
||||
{
|
||||
QChar op;
|
||||
|
@ -127,6 +132,7 @@ void Calculator::level5(qreal *result)
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void Calculator::level6(qreal *result)
|
||||
{
|
||||
if ((token[0] == '(') && (token_type == DELIMITER))
|
||||
|
@ -142,6 +148,7 @@ void Calculator::level6(qreal *result)
|
|||
primitive(result);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void Calculator::primitive(qreal *result)
|
||||
{
|
||||
QString str;
|
||||
|
@ -164,6 +171,7 @@ void Calculator::primitive(qreal *result)
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void Calculator::arith(QChar o, qreal *r, qreal *h)
|
||||
{
|
||||
qreal t;//, ex;
|
||||
|
@ -194,6 +202,7 @@ void Calculator::arith(QChar o, qreal *r, qreal *h)
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void Calculator::unary(QChar o, qreal *r)
|
||||
{
|
||||
if (o=='-')
|
||||
|
@ -202,6 +211,7 @@ void Calculator::unary(QChar o, qreal *r)
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
qreal Calculator::find_var(QString s)
|
||||
{
|
||||
bool ok = false;
|
||||
|
@ -215,6 +225,7 @@ qreal Calculator::find_var(QString s)
|
|||
return value;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void Calculator::serror(qint32 error)
|
||||
{
|
||||
QString e[]=
|
||||
|
@ -230,6 +241,7 @@ void Calculator::serror(qint32 error)
|
|||
qDebug()<<e[error];
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
char Calculator::look_up(QString s)
|
||||
{
|
||||
QString p;
|
||||
|
@ -240,6 +252,7 @@ char Calculator::look_up(QString s)
|
|||
return 0;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
bool Calculator::isdelim(QChar c)
|
||||
{
|
||||
if (StrChr(" ;,+-<>/*%^=()", c) || c=='\n' || c=='\r' || c=='\0')
|
||||
|
@ -249,6 +262,7 @@ bool Calculator::isdelim(QChar c)
|
|||
return false;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
bool Calculator::iswhite(QChar c)
|
||||
{
|
||||
if (c==' ' || c=='\t')
|
||||
|
@ -261,6 +275,7 @@ bool Calculator::iswhite(QChar c)
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void Calculator::get_token()
|
||||
{
|
||||
QString *temp;
|
||||
|
@ -355,11 +370,13 @@ void Calculator::get_token()
|
|||
return;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
bool Calculator::StrChr(QString string, QChar c)
|
||||
{
|
||||
return string.contains(c, Qt::CaseInsensitive);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void Calculator::putback()
|
||||
{
|
||||
QString t;
|
||||
|
|
|
@ -34,20 +34,22 @@
|
|||
|
||||
quint32 VContainer::_id = 0;
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VContainer::VContainer()
|
||||
:_size(50), sizeName("Сг"), _height(176), heightName("P"), gObjects(QHash<quint32, VGObject *>()),
|
||||
measurements(QHash<QString, VMeasurement>()), increments(QHash<QString, VIncrement>()),
|
||||
lengthLines(QHash<QString, qreal>()), lineAngles(QHash<QString, qreal>()), lengthSplines(QHash<QString, qreal>()),
|
||||
lengthArcs(QHash<QString, qreal>()), details(QHash<quint32, VDetail>())
|
||||
{
|
||||
}
|
||||
{}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VContainer &VContainer::operator =(const VContainer &data)
|
||||
{
|
||||
setData(data);
|
||||
return *this;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VContainer::VContainer(const VContainer &data)
|
||||
:_size(50), sizeName("Сг"), _height(176), heightName("P"), gObjects(QHash<quint32, VGObject *>()),
|
||||
measurements(QHash<QString, VMeasurement>()), increments(QHash<QString, VIncrement>()),
|
||||
|
@ -57,12 +59,14 @@ VContainer::VContainer(const VContainer &data)
|
|||
setData(data);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VContainer::~VContainer()
|
||||
{
|
||||
qDeleteAll(gObjects);
|
||||
gObjects.clear();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VContainer::setData(const VContainer &data)
|
||||
{
|
||||
_size = data.size();
|
||||
|
@ -106,12 +110,14 @@ void VContainer::setData(const VContainer &data)
|
|||
details = *data.DataDetails();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
// cppcheck-suppress unusedFunction
|
||||
const VGObject *VContainer::GetGObject(quint32 id)const
|
||||
{
|
||||
return GetObject(gObjects, id);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
template <typename key, typename val>
|
||||
const val VContainer::GetObject(const QHash<key, val> &obj, key id) const
|
||||
{
|
||||
|
@ -125,6 +131,7 @@ const val VContainer::GetObject(const QHash<key, val> &obj, key id) const
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
template <typename key, typename val>
|
||||
val VContainer::GetVariable(const QHash<key, val> &obj, key id) const
|
||||
{
|
||||
|
@ -138,52 +145,61 @@ val VContainer::GetVariable(const QHash<key, val> &obj, key id) const
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
const VMeasurement VContainer::GetMeasurement(const QString &name) const
|
||||
{
|
||||
Q_ASSERT(name.isEmpty()==false);
|
||||
return GetVariable(measurements, name);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
const VIncrement VContainer::GetIncrement(const QString& name) const
|
||||
{
|
||||
Q_ASSERT(name.isEmpty()==false);
|
||||
return GetVariable(increments, name);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
qreal VContainer::GetLine(const QString &name) const
|
||||
{
|
||||
Q_ASSERT(name.isEmpty()==false);
|
||||
return GetVariable(lengthLines, name);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
qreal VContainer::GetLengthArc(const QString &name) const
|
||||
{
|
||||
Q_ASSERT(name.isEmpty()==false);
|
||||
return GetVariable(lengthArcs, name);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
qreal VContainer::GetLengthSpline(const QString &name) const
|
||||
{
|
||||
Q_ASSERT(name.isEmpty()==false);
|
||||
return GetVariable(lengthSplines, name);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
qreal VContainer::GetLineAngle(const QString &name) const
|
||||
{
|
||||
Q_ASSERT(name.isEmpty()==false);
|
||||
return GetVariable(lineAngles, name);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
const VDetail VContainer::GetDetail(quint32 id) const
|
||||
{
|
||||
return GetVariable(details, id);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
quint32 VContainer::AddGObject(VGObject *obj)
|
||||
{
|
||||
return AddObject(gObjects, obj);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
quint32 VContainer::AddDetail(VDetail detail)
|
||||
{
|
||||
quint32 id = getNextId();
|
||||
|
@ -191,17 +207,20 @@ quint32 VContainer::AddDetail(VDetail detail)
|
|||
return id;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VContainer::AddIncrement(const QString &name, VIncrement incr)
|
||||
{
|
||||
increments[name] = incr;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
quint32 VContainer::getNextId()
|
||||
{
|
||||
_id++;
|
||||
return _id;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VContainer::UpdateId(quint32 newId)
|
||||
{
|
||||
if (newId > _id)
|
||||
|
@ -210,6 +229,7 @@ void VContainer::UpdateId(quint32 newId)
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
template <typename val>
|
||||
void VContainer::UpdateObject(QHash<quint32, val> &obj, const quint32 &id, val point)
|
||||
{
|
||||
|
@ -225,24 +245,28 @@ void VContainer::UpdateObject(QHash<quint32, val> &obj, const quint32 &id, val p
|
|||
UpdateId(id);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VContainer::AddLengthSpline(const QString &name, const qreal &value)
|
||||
{
|
||||
Q_ASSERT(name.isEmpty() == false);
|
||||
lengthSplines[name] = value;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VContainer::AddLengthArc(const quint32 &id)
|
||||
{
|
||||
const VArc * arc = GeometricObject<const VArc *>(id);
|
||||
lengthArcs[arc->name()] = qApp->fromPixel(arc->GetLength());
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VContainer::AddLineAngle(const QString &name, const qreal &value)
|
||||
{
|
||||
Q_ASSERT(name.isEmpty() == false);
|
||||
lineAngles[name] = value;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
qreal VContainer::GetValueStandardTableRow(const QString& name) const
|
||||
{
|
||||
const VMeasurement m = GetMeasurement(name);
|
||||
|
@ -256,6 +280,7 @@ qreal VContainer::GetValueStandardTableRow(const QString& name) const
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
qreal VContainer::GetValueIncrementTableRow(const QString& name) const
|
||||
{
|
||||
const VIncrement icr = GetIncrement(name);
|
||||
|
@ -269,6 +294,7 @@ qreal VContainer::GetValueIncrementTableRow(const QString& name) const
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VContainer::Clear()
|
||||
{
|
||||
_id = 0;
|
||||
|
@ -282,6 +308,7 @@ void VContainer::Clear()
|
|||
ClearGObjects();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VContainer::ClearGObjects()
|
||||
{
|
||||
if (gObjects.size()>0)
|
||||
|
@ -291,6 +318,7 @@ void VContainer::ClearGObjects()
|
|||
gObjects.clear();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VContainer::ClearCalculationGObjects()
|
||||
{
|
||||
if (gObjects.size()>0)
|
||||
|
@ -308,6 +336,7 @@ void VContainer::ClearCalculationGObjects()
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
qreal VContainer::FindVar(const QString &name, bool *ok)const
|
||||
{
|
||||
if (sizeName == name)
|
||||
|
@ -354,6 +383,7 @@ qreal VContainer::FindVar(const QString &name, bool *ok)const
|
|||
return 0;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VContainer::AddLine(const quint32 &firstPointId, const quint32 &secondPointId)
|
||||
{
|
||||
QString nameLine = GetNameLine(firstPointId, secondPointId);
|
||||
|
@ -364,6 +394,7 @@ void VContainer::AddLine(const quint32 &firstPointId, const quint32 &secondPoint
|
|||
AddLineAngle(nameLine, QLineF(first->toQPointF(), second->toQPointF()).angle());
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
template <typename key, typename val>
|
||||
quint32 VContainer::AddObject(QHash<key, val> &obj, val value)
|
||||
{
|
||||
|
@ -374,6 +405,7 @@ quint32 VContainer::AddObject(QHash<key, val> &obj, val value)
|
|||
return id;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
QString VContainer::GetNameLine(const quint32 &firstPoint, const quint32 &secondPoint) const
|
||||
{
|
||||
const VPointF *first = GeometricObject<const VPointF *>(firstPoint);
|
||||
|
@ -382,6 +414,7 @@ QString VContainer::GetNameLine(const quint32 &firstPoint, const quint32 &second
|
|||
return QString("Line_%1_%2").arg(first->name(), second->name());
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
QString VContainer::GetNameLineAngle(const quint32 &firstPoint, const quint32 &secondPoint) const
|
||||
{
|
||||
const VPointF *first = GeometricObject<const VPointF *>(firstPoint);
|
||||
|
@ -390,11 +423,13 @@ QString VContainer::GetNameLineAngle(const quint32 &firstPoint, const quint32 &s
|
|||
return QString("AngleLine_%1_%2").arg(first->name(), second->name());
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VContainer::UpdateGObject(quint32 id, VGObject* obj)
|
||||
{
|
||||
UpdateObject(gObjects, id, obj);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VContainer::UpdateDetail(quint32 id, const VDetail &detail)
|
||||
{
|
||||
Q_ASSERT_X(id > 0, Q_FUNC_INFO, "id <= 0");
|
||||
|
@ -402,6 +437,7 @@ void VContainer::UpdateDetail(quint32 id, const VDetail &detail)
|
|||
UpdateId(id);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VContainer::AddLengthLine(const QString &name, const qreal &value)
|
||||
{
|
||||
Q_ASSERT(name.isEmpty() == false);
|
||||
|
|
|
@ -28,17 +28,21 @@
|
|||
|
||||
#include "vincrement.h"
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VIncrement::VIncrement()
|
||||
:id(0), base(0), ksize(50.0), kheight(176.0), description(QString()){}
|
||||
|
||||
VIncrement::VIncrement(quint32 id, qreal base, qreal ksize, qreal kheight, QString description)
|
||||
:id(id), base(base), ksize(ksize), kheight(kheight), description(description){}
|
||||
:id(id), base(base), ksize(ksize), kheight(kheight), description(description)
|
||||
{}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
qreal VIncrement::GetValue() const
|
||||
{
|
||||
return base;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
qreal VIncrement::GetValue(const qreal &size, const qreal &height) const
|
||||
{
|
||||
const qreal k_size = ( size - 50.0 ) / 2.0;
|
||||
|
|
|
@ -28,33 +28,32 @@
|
|||
|
||||
#include "vmeasurement.h"
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VMeasurement::VMeasurement()
|
||||
:base(0), ksize(50.0), kheight(176.0), gui_text(QString()), number(QString()), virtualM(false),
|
||||
_tagName(QString())
|
||||
{
|
||||
|
||||
}
|
||||
{}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VMeasurement::VMeasurement(const qreal &base, const qreal &ksize, const qreal &kgrowth,
|
||||
const QString &gui_text, const QString &number, const QString &tagName)
|
||||
:base(base), ksize(ksize), kheight(kgrowth), gui_text(gui_text), number(number), virtualM(false),
|
||||
_tagName(tagName)
|
||||
{
|
||||
|
||||
}
|
||||
{}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VMeasurement::VMeasurement(const qreal &base, const QString &gui_text, const QString &number, const QString &tagName)
|
||||
:base(base), ksize(50.0), kheight(176.0), gui_text(gui_text), number(number), virtualM(false),
|
||||
_tagName(tagName)
|
||||
{
|
||||
|
||||
}
|
||||
{}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
qreal VMeasurement::GetValue() const
|
||||
{
|
||||
return base;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
qreal VMeasurement::GetValue(const qreal &size, const qreal &height) const
|
||||
{
|
||||
const qreal k_size = ( size - 50.0 ) / 2.0;
|
||||
|
|
|
@ -28,6 +28,7 @@
|
|||
|
||||
#include "configdialog.h"
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
ConfigDialog::ConfigDialog(QWidget *parent) :
|
||||
QDialog(parent), contentsWidget(nullptr), pagesWidget(nullptr), configurationPage(nullptr), patternPage(nullptr)
|
||||
{
|
||||
|
@ -76,6 +77,7 @@ ConfigDialog::ConfigDialog(QWidget *parent) :
|
|||
setWindowTitle(tr("Config Dialog"));
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void ConfigDialog::changePage(QListWidgetItem *current, QListWidgetItem *previous)
|
||||
{
|
||||
if (current == false)
|
||||
|
@ -85,6 +87,7 @@ void ConfigDialog::changePage(QListWidgetItem *current, QListWidgetItem *previou
|
|||
pagesWidget->setCurrentIndex(contentsWidget->row(current));
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void ConfigDialog::closeEvent(QCloseEvent *event)
|
||||
{
|
||||
if (result() == QDialog::Accepted)
|
||||
|
@ -94,6 +97,7 @@ void ConfigDialog::closeEvent(QCloseEvent *event)
|
|||
event->accept();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void ConfigDialog::createIcons()
|
||||
{
|
||||
QListWidgetItem *configButton = new QListWidgetItem(contentsWidget);
|
||||
|
@ -111,6 +115,7 @@ void ConfigDialog::createIcons()
|
|||
connect(contentsWidget, &QListWidget::currentItemChanged, this, &ConfigDialog::changePage);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void ConfigDialog::Apply()
|
||||
{
|
||||
switch (contentsWidget->currentRow())
|
||||
|
@ -127,6 +132,7 @@ void ConfigDialog::Apply()
|
|||
setResult(QDialog::Accepted);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void ConfigDialog::Ok()
|
||||
{
|
||||
Apply();
|
||||
|
|
|
@ -38,6 +38,7 @@
|
|||
#include <QDebug>
|
||||
#include <QPushButton>
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
DialogHistory::DialogHistory(VContainer *data, VPattern *doc, QWidget *parent)
|
||||
:DialogTool(data, parent), ui(new Ui::DialogHistory), doc(doc), cursorRow(0),
|
||||
cursorToolRecordRow(0)
|
||||
|
@ -55,11 +56,13 @@ DialogHistory::DialogHistory(VContainer *data, VPattern *doc, QWidget *parent)
|
|||
ShowPoint();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
DialogHistory::~DialogHistory()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogHistory::DialogAccepted()
|
||||
{
|
||||
QTableWidgetItem *item = ui->tableWidget->item(cursorToolRecordRow, 0);
|
||||
|
@ -68,6 +71,7 @@ void DialogHistory::DialogAccepted()
|
|||
emit DialogClosed(QDialog::Accepted);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogHistory::cellClicked(int row, int column)
|
||||
{
|
||||
if (column == 0)
|
||||
|
@ -96,6 +100,7 @@ void DialogHistory::cellClicked(int row, int column)
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogHistory::ChangedCursor(quint32 id)
|
||||
{
|
||||
for (qint32 i = 0; i< ui->tableWidget->rowCount(); ++i)
|
||||
|
@ -112,12 +117,14 @@ void DialogHistory::ChangedCursor(quint32 id)
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogHistory::UpdateHistory()
|
||||
{
|
||||
FillTable();
|
||||
InitialTable();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogHistory::FillTable()
|
||||
{
|
||||
ui->tableWidget->clear();
|
||||
|
@ -165,6 +172,7 @@ void DialogHistory::FillTable()
|
|||
ui->tableWidget->verticalHeader()->setDefaultSectionSize(20);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
QString DialogHistory::Record(const VToolRecord &tool)
|
||||
{
|
||||
const QDomElement domElement = doc->elementById(QString().setNum(tool.getId()));
|
||||
|
@ -407,6 +415,7 @@ QString DialogHistory::Record(const VToolRecord &tool)
|
|||
return QString();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogHistory::InitialTable()
|
||||
{
|
||||
ui->tableWidget->setSortingEnabled(false);
|
||||
|
@ -414,6 +423,7 @@ void DialogHistory::InitialTable()
|
|||
ui->tableWidget->setHorizontalHeaderItem(1, new QTableWidgetItem(tr("Tool")));
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogHistory::ShowPoint()
|
||||
{
|
||||
QVector<VToolRecord> *history = doc->getHistory();
|
||||
|
@ -428,6 +438,7 @@ void DialogHistory::ShowPoint()
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogHistory::closeEvent(QCloseEvent *event)
|
||||
{
|
||||
QTableWidgetItem *item = ui->tableWidget->item(cursorToolRecordRow, 0);
|
||||
|
|
|
@ -40,6 +40,7 @@
|
|||
#include <QMessageBox>
|
||||
#include <QCloseEvent>
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
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)
|
||||
{
|
||||
|
@ -135,6 +136,7 @@ DialogIncrements::DialogIncrements(VContainer *data, VPattern *doc, QWidget *par
|
|||
connect(ui->toolButtonOpenMeasurements, &QToolButton::clicked, this, &DialogIncrements::OpenTable);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogIncrements::FillMeasurements()
|
||||
{
|
||||
const QHash<QString, VMeasurement> *table = data->DataMeasurements();
|
||||
|
@ -212,6 +214,7 @@ void DialogIncrements::FillMeasurements()
|
|||
ui->tableWidgetMeasurements->resizeRowsToContents();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogIncrements::FillIncrements()
|
||||
{
|
||||
const QHash<QString, VIncrement> *increments = data->DataIncrements();
|
||||
|
@ -279,6 +282,7 @@ void DialogIncrements::FillIncrements()
|
|||
ui->tableWidgetIncrement->setCurrentCell( row, column );
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogIncrements::FillLengthLines()
|
||||
{
|
||||
const QHash<QString, qreal> *linesTable = data->DataLengthLines();
|
||||
|
@ -314,6 +318,7 @@ void DialogIncrements::FillLengthLines()
|
|||
ui->tableWidgetLines->verticalHeader()->setDefaultSectionSize(20);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogIncrements::FillLengthSplines()
|
||||
{
|
||||
const QHash<QString, qreal> *splinesTable = data->DataLengthSplines();
|
||||
|
@ -349,6 +354,7 @@ void DialogIncrements::FillLengthSplines()
|
|||
ui->tableWidgetSplines->verticalHeader()->setDefaultSectionSize(20);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogIncrements::FillLengthArcs()
|
||||
{
|
||||
const QHash<QString, qreal> *arcsTable = data->DataLengthArcs();
|
||||
|
@ -384,6 +390,7 @@ void DialogIncrements::FillLengthArcs()
|
|||
ui->tableWidgetArcs->resizeRowsToContents();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogIncrements::FullUpdateFromFile()
|
||||
{
|
||||
disconnect(ui->tableWidgetMeasurements, &QTableWidget::cellChanged, this, &DialogIncrements::MeasurementChanged);
|
||||
|
@ -406,6 +413,7 @@ void DialogIncrements::FullUpdateFromFile()
|
|||
FillLengthArcs();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogIncrements::SaveGivenName()
|
||||
{
|
||||
m->setGivenName(ui->lineEditGivenName->text());
|
||||
|
@ -415,6 +423,7 @@ void DialogIncrements::SaveGivenName()
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogIncrements::SaveFamilyName()
|
||||
{
|
||||
|
||||
|
@ -425,6 +434,7 @@ void DialogIncrements::SaveFamilyName()
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogIncrements::SaveEmail()
|
||||
{
|
||||
m->setMail(ui->lineEditMail->text());
|
||||
|
@ -434,6 +444,7 @@ void DialogIncrements::SaveEmail()
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogIncrements::SaveSex(int index)
|
||||
{
|
||||
m->setSex(m->StrToGender(ui->comboBoxSex->itemData(index).toString()));
|
||||
|
@ -443,6 +454,7 @@ void DialogIncrements::SaveSex(int index)
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogIncrements::SaveBirthDate(const QDate & date)
|
||||
{
|
||||
m->setBirthDate(date);
|
||||
|
@ -452,6 +464,7 @@ void DialogIncrements::SaveBirthDate(const QDate & date)
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogIncrements::OpenTable()
|
||||
{
|
||||
QString text = tr("Measurements use different units than pattern. This pattern required measurements in %1")
|
||||
|
@ -539,6 +552,7 @@ void DialogIncrements::OpenTable()
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogIncrements::clickedToolButtonAdd()
|
||||
{
|
||||
ui->tableWidgetIncrement->setFocus(Qt::OtherFocusReason);
|
||||
|
@ -599,6 +613,7 @@ void DialogIncrements::clickedToolButtonAdd()
|
|||
emit haveLiteChange();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogIncrements::clickedToolButtonRemove()
|
||||
{
|
||||
disconnect(ui->tableWidgetIncrement, &QTableWidget::cellChanged, this,
|
||||
|
@ -624,6 +639,7 @@ void DialogIncrements::clickedToolButtonRemove()
|
|||
emit haveLiteChange();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogIncrements::AddIncrementToFile(const quint32 &id, const QString &name, const qreal &base, const qreal &ksize,
|
||||
const qreal &kheight, const QString &description)
|
||||
{
|
||||
|
@ -640,6 +656,7 @@ void DialogIncrements::AddIncrementToFile(const quint32 &id, const QString &name
|
|||
list.at(0).appendChild(element);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogIncrements::IncrementChanged ( qint32 row, qint32 column )
|
||||
{
|
||||
|
||||
|
@ -694,6 +711,7 @@ void DialogIncrements::IncrementChanged ( qint32 row, qint32 column )
|
|||
emit haveLiteChange();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogIncrements::MeasurementChanged(qint32 row, qint32 column)
|
||||
{
|
||||
switch (column)
|
||||
|
@ -740,12 +758,14 @@ void DialogIncrements::MeasurementChanged(qint32 row, qint32 column)
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogIncrements::closeEvent(QCloseEvent *event)
|
||||
{
|
||||
emit DialogClosed(QDialog::Accepted);
|
||||
event->accept();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
DialogIncrements::~DialogIncrements()
|
||||
{
|
||||
delete ui;
|
||||
|
|
|
@ -36,6 +36,7 @@
|
|||
#include "../../widgets/vapplication.h"
|
||||
#include <QPushButton>
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
DialogIndividualMeasurements::DialogIndividualMeasurements(VContainer *data, const QString &patternPieceName,
|
||||
QWidget *parent) :
|
||||
QDialog(parent), ui(new Ui::DialogIndividualMeasurements), _name(patternPieceName), _tablePath(QString()),
|
||||
|
@ -67,11 +68,13 @@ DialogIndividualMeasurements::DialogIndividualMeasurements(VContainer *data, con
|
|||
connect(ui->toolButtonOpenNew, &QToolButton::clicked, this, &DialogIndividualMeasurements::NewTable);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
DialogIndividualMeasurements::~DialogIndividualMeasurements()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogIndividualMeasurements::DialogAccepted()
|
||||
{
|
||||
_name = ui->lineEditName->text();
|
||||
|
@ -125,6 +128,7 @@ void DialogIndividualMeasurements::DialogAccepted()
|
|||
accept();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogIndividualMeasurements::DialogRejected()
|
||||
{
|
||||
_name.clear();
|
||||
|
@ -132,6 +136,7 @@ void DialogIndividualMeasurements::DialogRejected()
|
|||
reject();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogIndividualMeasurements::CheckState()
|
||||
{
|
||||
bool flagName = false;
|
||||
|
@ -187,6 +192,7 @@ void DialogIndividualMeasurements::CheckState()
|
|||
bOk->setEnabled(flagName && flagPath && flagLang);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogIndividualMeasurements::LoadIndividualTables()
|
||||
{
|
||||
QStringList filters;
|
||||
|
@ -236,6 +242,7 @@ void DialogIndividualMeasurements::LoadIndividualTables()
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogIndividualMeasurements::OpenTable()
|
||||
{
|
||||
const QString filter(tr("Individual measurements (*.vit)"));
|
||||
|
@ -259,6 +266,7 @@ void DialogIndividualMeasurements::OpenTable()
|
|||
CheckState();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogIndividualMeasurements::NewTable()
|
||||
{
|
||||
QString dir = QDir::homePath()+"/measurements.vit";
|
||||
|
@ -281,6 +289,7 @@ void DialogIndividualMeasurements::NewTable()
|
|||
CheckState();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogIndividualMeasurements::InitUnits()
|
||||
{
|
||||
ui->comboBoxUnits->addItem(tr("centimeter"), QVariant(VDomDocument::UnitsToStr(Valentina::Cm)));
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
#include "dialogmeasurements.h"
|
||||
#include "ui_dialogmeasurements.h"
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
DialogMeasurements::DialogMeasurements(QWidget *parent) :
|
||||
QDialog(parent), ui(new Ui::DialogMeasurements), result(Measurements::Individual)
|
||||
{
|
||||
|
@ -37,22 +38,26 @@ DialogMeasurements::DialogMeasurements(QWidget *parent) :
|
|||
connect(ui->toolButtonIndividual, &QToolButton::clicked, this, &DialogMeasurements::IndividualMeasurements);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
DialogMeasurements::~DialogMeasurements()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
Measurements::Type DialogMeasurements::type() const
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogMeasurements::StandardMeasurements()
|
||||
{
|
||||
result = Measurements::Standard;
|
||||
accept();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogMeasurements::IndividualMeasurements()
|
||||
{
|
||||
result = Measurements::Individual;
|
||||
|
|
|
@ -31,6 +31,7 @@
|
|||
#include <QSettings>
|
||||
#include <QPushButton>
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
DialogPatternProperties::DialogPatternProperties(VPattern *doc, QWidget *parent) :
|
||||
QDialog(parent), ui(new Ui::DialogPatternProperties), doc(doc)
|
||||
{
|
||||
|
@ -61,11 +62,13 @@ DialogPatternProperties::DialogPatternProperties(VPattern *doc, QWidget *parent)
|
|||
connect(this, &DialogPatternProperties::haveChange, this->doc, &VPattern::haveLiteChange);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
DialogPatternProperties::~DialogPatternProperties()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogPatternProperties::Apply()
|
||||
{
|
||||
Write("notes", ui->plainTextEditTechNotes->document()->toPlainText());
|
||||
|
@ -75,6 +78,7 @@ void DialogPatternProperties::Apply()
|
|||
close();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogPatternProperties::Write(const QString &tagName, const QString &text) const
|
||||
{
|
||||
QDomNodeList nodeList = doc->elementsByTagName(tagName);
|
||||
|
|
|
@ -33,6 +33,7 @@
|
|||
#include "../../widgets/vapplication.h"
|
||||
#include <QPushButton>
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
DialogStandardMeasurements::DialogStandardMeasurements(VContainer *data, const QString &patternPieceName,
|
||||
QWidget *parent) :
|
||||
QDialog(parent), ui(new Ui::DialogStandardMeasurements), data(data), _name(patternPieceName), _tablePath(QString())
|
||||
|
@ -58,21 +59,25 @@ DialogStandardMeasurements::DialogStandardMeasurements(VContainer *data, const Q
|
|||
connect(ui->lineEditName, &QLineEdit::textChanged, this, &DialogStandardMeasurements::CheckState);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
DialogStandardMeasurements::~DialogStandardMeasurements()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
QString DialogStandardMeasurements::name() const
|
||||
{
|
||||
return _name;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
QString DialogStandardMeasurements::tablePath() const
|
||||
{
|
||||
return _tablePath;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogStandardMeasurements::DialogAccepted()
|
||||
{
|
||||
_name = ui->lineEditName->text();
|
||||
|
@ -96,6 +101,7 @@ void DialogStandardMeasurements::DialogAccepted()
|
|||
accept();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogStandardMeasurements::DialogRejected()
|
||||
{
|
||||
_name.clear();
|
||||
|
@ -103,6 +109,7 @@ void DialogStandardMeasurements::DialogRejected()
|
|||
reject();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogStandardMeasurements::CheckState()
|
||||
{
|
||||
bool flagName = false;
|
||||
|
@ -126,6 +133,7 @@ void DialogStandardMeasurements::CheckState()
|
|||
bOk->setEnabled(flagTable && flagName);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogStandardMeasurements::LoadStandardTables()
|
||||
{
|
||||
QStringList filters;
|
||||
|
|
|
@ -30,6 +30,7 @@
|
|||
#include "../../options.h"
|
||||
#include "../../widgets/vapplication.h"
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
ConfigurationPage::ConfigurationPage(QWidget *parent):
|
||||
QWidget(parent), autoSaveCheck(0), autoTime(0), langCombo(0), osOptionCheck(0), langChanged(false)
|
||||
{
|
||||
|
@ -43,6 +44,7 @@ ConfigurationPage::ConfigurationPage(QWidget *parent):
|
|||
setLayout(mainLayout);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void ConfigurationPage::Apply()
|
||||
{
|
||||
QSettings settings(QSettings::IniFormat, QSettings::UserScope, QApplication::organizationName(),
|
||||
|
@ -61,11 +63,13 @@ void ConfigurationPage::Apply()
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void ConfigurationPage::LangChenged()
|
||||
{
|
||||
langChanged = true;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
QGroupBox *ConfigurationPage::SaveGroup()
|
||||
{
|
||||
QSettings settings(QSettings::IniFormat, QSettings::UserScope, QApplication::organizationName(),
|
||||
|
@ -101,6 +105,7 @@ QGroupBox *ConfigurationPage::SaveGroup()
|
|||
return saveGroup;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
QGroupBox *ConfigurationPage::LangGroup()
|
||||
{
|
||||
QSettings settings(QSettings::IniFormat, QSettings::UserScope, QApplication::organizationName(),
|
||||
|
@ -168,7 +173,7 @@ QGroupBox *ConfigurationPage::LangGroup()
|
|||
return langGroup;
|
||||
}
|
||||
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
PatternPage::PatternPage(QWidget *parent):
|
||||
QWidget(parent), userName(0), graphOutputCheck(0), undoneCount(0)
|
||||
{
|
||||
|
@ -184,6 +189,7 @@ PatternPage::PatternPage(QWidget *parent):
|
|||
setLayout(mainLayout);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void PatternPage::Apply()
|
||||
{
|
||||
QSettings settings(QSettings::IniFormat, QSettings::UserScope, QApplication::organizationName(),
|
||||
|
@ -193,6 +199,7 @@ void PatternPage::Apply()
|
|||
settings.setValue("pattern/undone", undoneCount->value());
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
QGroupBox *PatternPage::UserGroup()
|
||||
{
|
||||
QSettings settings(QSettings::IniFormat, QSettings::UserScope, QApplication::organizationName(),
|
||||
|
@ -219,6 +226,7 @@ QGroupBox *PatternPage::UserGroup()
|
|||
return userGroup;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
QGroupBox *PatternPage::GraphOutputGroup()
|
||||
{
|
||||
// QSettings settings(QSettings::IniFormat, QSettings::UserScope, QApplication::organizationName(),
|
||||
|
@ -240,6 +248,7 @@ QGroupBox *PatternPage::GraphOutputGroup()
|
|||
return graphOutputGroup;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
QGroupBox *PatternPage::UndoneGroup()
|
||||
{
|
||||
// QSettings settings(QSettings::IniFormat, QSettings::UserScope, QApplication::organizationName(),
|
||||
|
|
|
@ -31,6 +31,7 @@
|
|||
|
||||
#include <QPushButton>
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
DialogAlongLine::DialogAlongLine(const VContainer *data, QWidget *parent)
|
||||
:DialogTool(data, parent), ui(new Ui::DialogAlongLine), number(0), pointName(QString()),
|
||||
typeLine(QString()), formula(QString()), firstPointId(0), secondPointId(0)
|
||||
|
@ -59,11 +60,13 @@ DialogAlongLine::DialogAlongLine(const VContainer *data, QWidget *parent)
|
|||
connect(listWidget, &QListWidget::itemDoubleClicked, this, &DialogTool::PutVal);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
DialogAlongLine::~DialogAlongLine()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogAlongLine::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
||||
{
|
||||
if (type == Valentina::Point)
|
||||
|
@ -90,6 +93,7 @@ void DialogAlongLine::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogAlongLine::DialogAccepted()
|
||||
{
|
||||
pointName = ui->lineEditNamePoint->text();
|
||||
|
@ -100,28 +104,33 @@ void DialogAlongLine::DialogAccepted()
|
|||
emit DialogClosed(QDialog::Accepted);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogAlongLine::setSecondPointId(const quint32 &value, const quint32 &id)
|
||||
{
|
||||
setCurrentPointId(ui->comboBoxSecondPoint, secondPointId, value, id);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogAlongLine::setFirstPointId(const quint32 &value, const quint32 &id)
|
||||
{
|
||||
setCurrentPointId(ui->comboBoxFirstPoint, firstPointId, value, id);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogAlongLine::setFormula(const QString &value)
|
||||
{
|
||||
formula = value;
|
||||
ui->lineEditFormula->setText(formula);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogAlongLine::setTypeLine(const QString &value)
|
||||
{
|
||||
typeLine = value;
|
||||
SetupTypeLine(ui->comboBoxLineType, value);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogAlongLine::setPointName(const QString &value)
|
||||
{
|
||||
pointName = value;
|
||||
|
|
|
@ -32,6 +32,7 @@
|
|||
#include <QPushButton>
|
||||
#include <QtWidgets>
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
DialogArc::DialogArc(const VContainer *data, QWidget *parent)
|
||||
: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())
|
||||
|
@ -68,35 +69,41 @@ DialogArc::DialogArc(const VContainer *data, QWidget *parent)
|
|||
connect(ui->lineEditF2, &QLineEdit::textChanged, this, &DialogArc::F2Changed);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
DialogArc::~DialogArc()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogArc::SetCenter(const quint32 &value)
|
||||
{
|
||||
center = value;
|
||||
ChangeCurrentData(ui->comboBoxBasePoint, center);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogArc::SetF2(const QString &value)
|
||||
{
|
||||
f2 = value;
|
||||
ui->lineEditF2->setText(f2);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogArc::SetF1(const QString &value)
|
||||
{
|
||||
f1 = value;
|
||||
ui->lineEditF1->setText(f1);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogArc::SetRadius(const QString &value)
|
||||
{
|
||||
radius = value;
|
||||
ui->lineEditRadius->setText(radius);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogArc::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
||||
{
|
||||
if (type == Valentina::Point)
|
||||
|
@ -109,6 +116,7 @@ void DialogArc::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogArc::DialogAccepted()
|
||||
{
|
||||
radius = ui->lineEditRadius->text();
|
||||
|
@ -118,6 +126,7 @@ void DialogArc::DialogAccepted()
|
|||
emit DialogClosed(QDialog::Accepted);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogArc::ValChenged(int row)
|
||||
{
|
||||
if (ui->listWidget->count() == 0)
|
||||
|
@ -135,68 +144,80 @@ void DialogArc::ValChenged(int row)
|
|||
DialogTool::ValChenged(row);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogArc::PutRadius()
|
||||
{
|
||||
PutValHere(ui->lineEditRadius, ui->listWidget);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogArc::PutF1()
|
||||
{
|
||||
PutValHere(ui->lineEditF1, ui->listWidget);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogArc::PutF2()
|
||||
{
|
||||
PutValHere(ui->lineEditF2, ui->listWidget);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogArc::LineAngles()
|
||||
{
|
||||
ShowLineAngles();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogArc::RadiusChanged()
|
||||
{
|
||||
labelEditFormula = ui->labelEditRadius;
|
||||
ValFormulaChanged(flagRadius, ui->lineEditRadius, timerRadius);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogArc::F1Changed()
|
||||
{
|
||||
labelEditFormula = ui->labelEditF1;
|
||||
ValFormulaChanged(flagF1, ui->lineEditF1, timerF1);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogArc::F2Changed()
|
||||
{
|
||||
labelEditFormula = ui->labelEditF2;
|
||||
ValFormulaChanged(flagF2, ui->lineEditF2, timerF2);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogArc::CheckState()
|
||||
{
|
||||
Q_CHECK_PTR(bOk);
|
||||
bOk->setEnabled(flagRadius && flagF1 && flagF2);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogArc::EvalRadius()
|
||||
{
|
||||
labelEditFormula = ui->labelEditRadius;
|
||||
Eval(ui->lineEditRadius, flagRadius, timerRadius, ui->labelResultRadius);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogArc::EvalF1()
|
||||
{
|
||||
labelEditFormula = ui->labelEditF1;
|
||||
Eval(ui->lineEditF1, flagF1, timerF1, ui->labelResultF1);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogArc::EvalF2()
|
||||
{
|
||||
labelEditFormula = ui->labelEditF2;
|
||||
Eval(ui->lineEditF2, flagF2, timerF2, ui->labelResultF2);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogArc::ShowLineAngles()
|
||||
{
|
||||
disconnect(ui->listWidget, &QListWidget::currentRowChanged, this, &DialogArc::ValChenged);
|
||||
|
|
|
@ -31,6 +31,7 @@
|
|||
|
||||
#include <QPushButton>
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
DialogBisector::DialogBisector(const VContainer *data, QWidget *parent)
|
||||
:DialogTool(data, parent), ui(new Ui::DialogBisector), number(0), pointName(QString()),
|
||||
typeLine(QString()), formula(QString()), firstPointId(0), secondPointId(0), thirdPointId(0)
|
||||
|
@ -59,11 +60,13 @@ DialogBisector::DialogBisector(const VContainer *data, QWidget *parent)
|
|||
connect(ui->lineEditFormula, &QLineEdit::textChanged, this, &DialogBisector::FormulaChanged);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
DialogBisector::~DialogBisector()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogBisector::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
||||
{
|
||||
if (type == Valentina::Point)
|
||||
|
@ -108,39 +111,46 @@ void DialogBisector::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogBisector::setPointName(const QString &value)
|
||||
{
|
||||
pointName = value;
|
||||
ui->lineEditNamePoint->setText(pointName);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogBisector::setTypeLine(const QString &value)
|
||||
{
|
||||
typeLine = value;
|
||||
SetupTypeLine(ui->comboBoxLineType, value);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogBisector::setFormula(const QString &value)
|
||||
{
|
||||
formula = value;
|
||||
ui->lineEditFormula->setText(formula);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogBisector::setFirstPointId(const quint32 &value, const quint32 &id)
|
||||
{
|
||||
setCurrentPointId(ui->comboBoxFirstPoint, firstPointId, value, id);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogBisector::setSecondPointId(const quint32 &value, const quint32 &id)
|
||||
{
|
||||
setCurrentPointId(ui->comboBoxSecondPoint, secondPointId, value, id);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogBisector::setThirdPointId(const quint32 &value, const quint32 &id)
|
||||
{
|
||||
setCurrentPointId(ui->comboBoxThirdPoint, thirdPointId, value, id);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogBisector::DialogAccepted()
|
||||
{
|
||||
pointName = ui->lineEditNamePoint->text();
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
#include "dialogcutarc.h"
|
||||
#include "ui_dialogcutarc.h"
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
DialogCutArc::DialogCutArc(const VContainer *data, QWidget *parent) :
|
||||
DialogTool(data, parent), ui(new Ui::DialogCutArc), pointName(QString()), formula(QString()), arcId(0)
|
||||
{
|
||||
|
@ -54,11 +55,13 @@ DialogCutArc::DialogCutArc(const VContainer *data, QWidget *parent) :
|
|||
connect(ui->lineEditFormula, &QLineEdit::textChanged, this, &DialogCutArc::FormulaChanged);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
DialogCutArc::~DialogCutArc()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogCutArc::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
||||
{
|
||||
if (type == Valentina::Arc)
|
||||
|
@ -70,6 +73,7 @@ void DialogCutArc::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogCutArc::DialogAccepted()
|
||||
{
|
||||
pointName = ui->lineEditNamePoint->text();
|
||||
|
@ -78,17 +82,20 @@ void DialogCutArc::DialogAccepted()
|
|||
emit DialogClosed(QDialog::Accepted);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogCutArc::setArcId(const quint32 &value, const quint32 &id)
|
||||
{
|
||||
setCurrentArcId(ui->comboBoxArc, arcId, value, id, ComboMode::CutArc);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogCutArc::setFormula(const QString &value)
|
||||
{
|
||||
formula = value;
|
||||
ui->lineEditFormula->setText(formula);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogCutArc::setPointName(const QString &value)
|
||||
{
|
||||
pointName = value;
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
#include "dialogcutspline.h"
|
||||
#include "ui_dialogcutspline.h"
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
DialogCutSpline::DialogCutSpline(const VContainer *data, QWidget *parent)
|
||||
:DialogTool(data, parent), ui(new Ui::DialogCutSpline), pointName(QString()), formula(QString()), splineId(0)
|
||||
{
|
||||
|
@ -53,28 +54,33 @@ DialogCutSpline::DialogCutSpline(const VContainer *data, QWidget *parent)
|
|||
connect(ui->lineEditFormula, &QLineEdit::textChanged, this, &DialogCutSpline::FormulaChanged);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
DialogCutSpline::~DialogCutSpline()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogCutSpline::setPointName(const QString &value)
|
||||
{
|
||||
pointName = value;
|
||||
ui->lineEditNamePoint->setText(pointName);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogCutSpline::setFormula(const QString &value)
|
||||
{
|
||||
formula = value;
|
||||
ui->lineEditFormula->setText(formula);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogCutSpline::setSplineId(const quint32 &value, const quint32 &id)
|
||||
{
|
||||
setCurrentSplineId(ui->comboBoxSpline, splineId, value, id, ComboMode::CutSpline);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogCutSpline::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
||||
{
|
||||
if (type == Valentina::Spline)
|
||||
|
@ -86,6 +92,7 @@ void DialogCutSpline::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogCutSpline::DialogAccepted()
|
||||
{
|
||||
pointName = ui->lineEditNamePoint->text();
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
#include "dialogcutsplinepath.h"
|
||||
#include "ui_dialogcutsplinepath.h"
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
DialogCutSplinePath::DialogCutSplinePath(const VContainer *data, QWidget *parent)
|
||||
:DialogTool(data, parent), ui(new Ui::DialogCutSplinePath), pointName(QString()), formula(QString()),
|
||||
splinePathId(0)
|
||||
|
@ -54,28 +55,33 @@ DialogCutSplinePath::DialogCutSplinePath(const VContainer *data, QWidget *parent
|
|||
connect(ui->lineEditFormula, &QLineEdit::textChanged, this, &DialogCutSplinePath::FormulaChanged);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
DialogCutSplinePath::~DialogCutSplinePath()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogCutSplinePath::setPointName(const QString &value)
|
||||
{
|
||||
pointName = value;
|
||||
ui->lineEditNamePoint->setText(pointName);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogCutSplinePath::setFormula(const QString &value)
|
||||
{
|
||||
formula = value;
|
||||
ui->lineEditFormula->setText(formula);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogCutSplinePath::setSplinePathId(const quint32 &value, const quint32 &id)
|
||||
{
|
||||
setCurrentSplinePathId(ui->comboBoxSplinePath, splinePathId, value, id, ComboMode::CutSpline);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogCutSplinePath::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
||||
{
|
||||
if (type == Valentina::SplinePath)
|
||||
|
@ -87,6 +93,7 @@ void DialogCutSplinePath::ChoosedObject(quint32 id, const Valentina::Scenes &typ
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogCutSplinePath::DialogAccepted()
|
||||
{
|
||||
pointName = ui->lineEditNamePoint->text();
|
||||
|
|
|
@ -31,6 +31,7 @@
|
|||
#include <QPushButton>
|
||||
#include <QDebug>
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
DialogDetail::DialogDetail(const VContainer *data, QWidget *parent)
|
||||
:DialogTool(data, parent), ui(), details(VDetail()), supplement(true), closed(true)
|
||||
{
|
||||
|
@ -62,6 +63,7 @@ DialogDetail::DialogDetail(const VContainer *data, QWidget *parent)
|
|||
connect(ui.toolButtonDelete, &QToolButton::clicked, this, &DialogDetail::DeleteItem);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogDetail::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
||||
{
|
||||
if (type != Valentina::Line && type != Valentina::Detail)
|
||||
|
@ -89,6 +91,7 @@ void DialogDetail::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogDetail::DialogAccepted()
|
||||
{
|
||||
details.Clear();
|
||||
|
@ -105,6 +108,7 @@ void DialogDetail::DialogAccepted()
|
|||
emit DialogClosed(QDialog::Accepted);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogDetail::NewItem(quint32 id, const Valentina::Tools &typeTool, const NodeDetail::NodeDetails &typeNode,
|
||||
qreal mx, qreal my)
|
||||
{
|
||||
|
@ -158,6 +162,7 @@ void DialogDetail::NewItem(quint32 id, const Valentina::Tools &typeTool, const N
|
|||
this, &DialogDetail::BiasYChanged);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogDetail::setDetails(const VDetail &value)
|
||||
{
|
||||
details = value;
|
||||
|
@ -178,6 +183,7 @@ void DialogDetail::setDetails(const VDetail &value)
|
|||
ui.toolButtonDelete->setEnabled(true);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogDetail::BiasXChanged(qreal d)
|
||||
{
|
||||
qint32 row = ui.listWidget->currentRow();
|
||||
|
@ -188,6 +194,7 @@ void DialogDetail::BiasXChanged(qreal d)
|
|||
item->setData(Qt::UserRole, QVariant::fromValue(node));
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogDetail::BiasYChanged(qreal d)
|
||||
{
|
||||
qint32 row = ui.listWidget->currentRow();
|
||||
|
@ -198,6 +205,7 @@ void DialogDetail::BiasYChanged(qreal d)
|
|||
item->setData(Qt::UserRole, QVariant::fromValue(node));
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogDetail::ClickedSeams(bool checked)
|
||||
{
|
||||
supplement = checked;
|
||||
|
@ -205,11 +213,13 @@ void DialogDetail::ClickedSeams(bool checked)
|
|||
ui.spinBoxSeams->setEnabled(checked);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogDetail::ClickedClosed(bool checked)
|
||||
{
|
||||
closed = checked;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogDetail::ObjectChanged(int row)
|
||||
{
|
||||
if (ui.listWidget->count() == 0)
|
||||
|
@ -222,6 +232,7 @@ void DialogDetail::ObjectChanged(int row)
|
|||
ui.spinBoxBiasY->setValue(static_cast<qint32>(qApp->fromPixel(node.getMy())));
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogDetail::DeleteItem()
|
||||
{
|
||||
qint32 row = ui.listWidget->currentRow();
|
||||
|
|
|
@ -31,6 +31,7 @@
|
|||
|
||||
#include <QPushButton>
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
DialogEndLine::DialogEndLine(const VContainer *data, QWidget *parent)
|
||||
:DialogTool(data, parent), ui(new Ui::DialogEndLine), pointName(QString()), typeLine(QString()),
|
||||
formula(QString()), angle(0), basePointId(0)
|
||||
|
@ -59,6 +60,7 @@ DialogEndLine::DialogEndLine(const VContainer *data, QWidget *parent)
|
|||
connect(ui->lineEditFormula, &QLineEdit::textChanged, this, &DialogEndLine::FormulaChanged);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogEndLine::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
||||
{
|
||||
if (type == Valentina::Point)
|
||||
|
@ -70,35 +72,41 @@ void DialogEndLine::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogEndLine::setPointName(const QString &value)
|
||||
{
|
||||
pointName = value;
|
||||
ui->lineEditNamePoint->setText(pointName);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogEndLine::setTypeLine(const QString &value)
|
||||
{
|
||||
typeLine = value;
|
||||
SetupTypeLine(ui->comboBoxLineType, value);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogEndLine::setFormula(const QString &value)
|
||||
{
|
||||
formula = value;
|
||||
ui->lineEditFormula->setText(formula);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogEndLine::setAngle(const qreal &value)
|
||||
{
|
||||
angle = value;
|
||||
ui->doubleSpinBoxAngle->setValue(angle);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogEndLine::setBasePointId(const quint32 &value, const quint32 &id)
|
||||
{
|
||||
setCurrentPointId(ui->comboBoxBasePoint, basePointId, value, id);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogEndLine::DialogAccepted()
|
||||
{
|
||||
pointName = ui->lineEditNamePoint->text();
|
||||
|
@ -109,6 +117,7 @@ void DialogEndLine::DialogAccepted()
|
|||
emit DialogClosed(QDialog::Accepted);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
DialogEndLine::~DialogEndLine()
|
||||
{
|
||||
delete ui;
|
||||
|
|
|
@ -31,6 +31,7 @@
|
|||
|
||||
#include <QPushButton>
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
DialogHeight::DialogHeight(const VContainer *data, QWidget *parent)
|
||||
:DialogTool(data, parent), ui(new Ui::DialogHeight), number(0), pointName(QString()),
|
||||
typeLine(QString()), basePointId(0), p1LineId(0), p2LineId(0)
|
||||
|
@ -48,41 +49,48 @@ DialogHeight::DialogHeight(const VContainer *data, QWidget *parent)
|
|||
connect(ui->lineEditNamePoint, &QLineEdit::textChanged, this, &DialogHeight::NamePointChanged);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
DialogHeight::~DialogHeight()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogHeight::setPointName(const QString &value)
|
||||
{
|
||||
pointName = value;
|
||||
ui->lineEditNamePoint->setText(pointName);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogHeight::setTypeLine(const QString &value)
|
||||
{
|
||||
typeLine = value;
|
||||
SetupTypeLine(ui->comboBoxLineType, value);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogHeight::setBasePointId(const quint32 &value, const quint32 &id)
|
||||
{
|
||||
basePointId = value;
|
||||
setCurrentPointId(ui->comboBoxBasePoint, basePointId, value, id);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogHeight::setP1LineId(const quint32 &value, const quint32 &id)
|
||||
{
|
||||
p1LineId = value;
|
||||
setCurrentPointId(ui->comboBoxP1Line, p1LineId, value, id);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogHeight::setP2LineId(const quint32 &value, const quint32 &id)
|
||||
{
|
||||
p2LineId = value;
|
||||
setCurrentPointId(ui->comboBoxP2Line, p2LineId, value, id);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogHeight::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
||||
{
|
||||
if (type == Valentina::Point)
|
||||
|
@ -115,6 +123,7 @@ void DialogHeight::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogHeight::DialogAccepted()
|
||||
{
|
||||
pointName = ui->lineEditNamePoint->text();
|
||||
|
|
|
@ -31,6 +31,7 @@
|
|||
|
||||
#include <QPushButton>
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
DialogLine::DialogLine(const VContainer *data, QWidget *parent)
|
||||
:DialogTool(data, parent), ui(new Ui::DialogLine), number(0), firstPoint(0), secondPoint(0), typeLine(QString())
|
||||
{
|
||||
|
@ -44,11 +45,13 @@ DialogLine::DialogLine(const VContainer *data, QWidget *parent)
|
|||
number = 0;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
DialogLine::~DialogLine()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogLine::setSecondPoint(const quint32 &value)
|
||||
{
|
||||
secondPoint = value;
|
||||
|
@ -60,12 +63,14 @@ void DialogLine::setSecondPoint(const quint32 &value)
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogLine::setTypeLine(const QString &value)
|
||||
{
|
||||
typeLine = value;
|
||||
SetupTypeLine(ui->comboBoxLineType, value);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogLine::setFirstPoint(const quint32 &value)
|
||||
{
|
||||
firstPoint = value;
|
||||
|
@ -77,7 +82,7 @@ void DialogLine::setFirstPoint(const quint32 &value)
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogLine::DialogAccepted()
|
||||
{
|
||||
qint32 index = ui->comboBoxFirstPoint->currentIndex();
|
||||
|
@ -88,6 +93,7 @@ void DialogLine::DialogAccepted()
|
|||
DialogClosed(QDialog::Accepted);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogLine::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
||||
{
|
||||
if (type == Valentina::Point)
|
||||
|
|
|
@ -31,6 +31,7 @@
|
|||
|
||||
#include <QPushButton>
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
DialogLineIntersect::DialogLineIntersect(const VContainer *data, QWidget *parent)
|
||||
:DialogTool(data, parent), ui(new Ui::DialogLineIntersect), number(0), pointName(QString()),
|
||||
p1Line1(0), p2Line1(0), p1Line2(0), p2Line2(0), flagPoint(true)
|
||||
|
@ -49,11 +50,13 @@ DialogLineIntersect::DialogLineIntersect(const VContainer *data, QWidget *parent
|
|||
connect(ui->lineEditNamePoint, &QLineEdit::textChanged, this, &DialogLineIntersect::NamePointChanged);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
DialogLineIntersect::~DialogLineIntersect()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogLineIntersect::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
||||
{
|
||||
if (type == Valentina::Point)
|
||||
|
@ -127,6 +130,7 @@ void DialogLineIntersect::ChoosedObject(quint32 id, const Valentina::Scenes &typ
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogLineIntersect::DialogAccepted()
|
||||
{
|
||||
pointName = ui->lineEditNamePoint->text();
|
||||
|
@ -137,6 +141,7 @@ void DialogLineIntersect::DialogAccepted()
|
|||
emit DialogClosed(QDialog::Accepted);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogLineIntersect::P1Line1Changed( int index)
|
||||
{
|
||||
p1Line1 = qvariant_cast<quint32>(ui->comboBoxP1Line1->itemData(index));
|
||||
|
@ -144,6 +149,7 @@ void DialogLineIntersect::P1Line1Changed( int index)
|
|||
CheckState();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogLineIntersect::P2Line1Changed(int index)
|
||||
{
|
||||
p2Line1 = qvariant_cast<quint32>(ui->comboBoxP2Line1->itemData(index));
|
||||
|
@ -151,6 +157,7 @@ void DialogLineIntersect::P2Line1Changed(int index)
|
|||
CheckState();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogLineIntersect::P1Line2Changed(int index)
|
||||
{
|
||||
p1Line2 = qvariant_cast<quint32>(ui->comboBoxP1Line2->itemData(index));
|
||||
|
@ -158,6 +165,7 @@ void DialogLineIntersect::P1Line2Changed(int index)
|
|||
CheckState();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogLineIntersect::P2Line2Changed(int index)
|
||||
{
|
||||
p2Line2 = qvariant_cast<quint32>(ui->comboBoxP2Line2->itemData(index));
|
||||
|
@ -165,12 +173,14 @@ void DialogLineIntersect::P2Line2Changed(int index)
|
|||
CheckState();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogLineIntersect::CheckState()
|
||||
{
|
||||
Q_CHECK_PTR(bOk);
|
||||
bOk->setEnabled(flagName && flagPoint);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
bool DialogLineIntersect::CheckIntersecion()
|
||||
{
|
||||
const VPointF *p1L1 = data->GeometricObject<const VPointF *>(p1Line1);
|
||||
|
@ -192,30 +202,35 @@ bool DialogLineIntersect::CheckIntersecion()
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogLineIntersect::setP2Line2(const quint32 &value)
|
||||
{
|
||||
p2Line2 = value;
|
||||
ChangeCurrentData(ui->comboBoxP2Line2, value);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogLineIntersect::setP1Line2(const quint32 &value)
|
||||
{
|
||||
p1Line2 = value;
|
||||
ChangeCurrentData(ui->comboBoxP1Line2, value);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogLineIntersect::setP2Line1(const quint32 &value)
|
||||
{
|
||||
p2Line1 = value;
|
||||
ChangeCurrentData(ui->comboBoxP2Line1, value);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogLineIntersect::setP1Line1(const quint32 &value)
|
||||
{
|
||||
p1Line1 = value;
|
||||
ChangeCurrentData(ui->comboBoxP1Line1, value);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogLineIntersect::setPointName(const QString &value)
|
||||
{
|
||||
pointName = value;
|
||||
|
|
|
@ -31,6 +31,7 @@
|
|||
|
||||
#include <QPushButton>
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
DialogNormal::DialogNormal(const VContainer *data, QWidget *parent)
|
||||
:DialogTool(data, parent), ui(new Ui::DialogNormal), number(0), pointName(QString()),
|
||||
typeLine(QString()), formula(QString()), angle(0), firstPointId(0), secondPointId(0)
|
||||
|
@ -60,11 +61,13 @@ DialogNormal::DialogNormal(const VContainer *data, QWidget *parent)
|
|||
connect(ui->lineEditFormula, &QLineEdit::textChanged, this, &DialogNormal::FormulaChanged);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
DialogNormal::~DialogNormal()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogNormal::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
||||
{
|
||||
if (type == Valentina::Point)
|
||||
|
@ -91,6 +94,7 @@ void DialogNormal::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogNormal::DialogAccepted()
|
||||
{
|
||||
pointName = ui->lineEditNamePoint->text();
|
||||
|
@ -102,34 +106,40 @@ void DialogNormal::DialogAccepted()
|
|||
emit DialogClosed(QDialog::Accepted);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogNormal::setSecondPointId(const quint32 &value, const quint32 &id)
|
||||
{
|
||||
setCurrentPointId(ui->comboBoxSecondPoint, secondPointId, value, id);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogNormal::setFirstPointId(const quint32 &value, const quint32 &id)
|
||||
{
|
||||
setCurrentPointId(ui->comboBoxFirstPoint, firstPointId, value, id);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogNormal::setAngle(const qreal &value)
|
||||
{
|
||||
angle = value;
|
||||
ui->doubleSpinBoxAngle->setValue(angle);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogNormal::setFormula(const QString &value)
|
||||
{
|
||||
formula = value;
|
||||
ui->lineEditFormula->setText(formula);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogNormal::setTypeLine(const QString &value)
|
||||
{
|
||||
typeLine = value;
|
||||
SetupTypeLine(ui->comboBoxLineType, value);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogNormal::setPointName(const QString &value)
|
||||
{
|
||||
pointName = value;
|
||||
|
|
|
@ -30,6 +30,7 @@
|
|||
|
||||
#include <QPushButton>
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
DialogPointOfContact::DialogPointOfContact(const VContainer *data, QWidget *parent)
|
||||
:DialogTool(data, parent), ui(), number(0), pointName(QString()), radius(QString()), center(0),
|
||||
firstPoint(0), secondPoint(0)
|
||||
|
@ -87,6 +88,7 @@ DialogPointOfContact::DialogPointOfContact(const VContainer *data, QWidget *pare
|
|||
connect(ui.lineEditFormula, &QLineEdit::textChanged, this, &DialogPointOfContact::FormulaChanged);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogPointOfContact::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
||||
{
|
||||
if (type == Valentina::Point)
|
||||
|
@ -131,6 +133,7 @@ void DialogPointOfContact::ChoosedObject(quint32 id, const Valentina::Scenes &ty
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogPointOfContact::DialogAccepted()
|
||||
{
|
||||
pointName = ui.lineEditNamePoint->text();
|
||||
|
@ -141,28 +144,33 @@ void DialogPointOfContact::DialogAccepted()
|
|||
emit DialogClosed(QDialog::Accepted);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogPointOfContact::setSecondPoint(const quint32 &value, const quint32 &id)
|
||||
{
|
||||
setCurrentPointId(ui.comboBoxSecondPoint, secondPoint, value, id);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogPointOfContact::setFirstPoint(const quint32 &value, const quint32 &id)
|
||||
{
|
||||
setCurrentPointId(ui.comboBoxFirstPoint, firstPoint, value, id);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogPointOfContact::setCenter(const quint32 &value, const quint32 &id)
|
||||
{
|
||||
setCurrentPointId(ui.comboBoxCenter, center, value, id);
|
||||
center = value;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogPointOfContact::setRadius(const QString &value)
|
||||
{
|
||||
radius = value;
|
||||
ui.lineEditFormula->setText(radius);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogPointOfContact::setPointName(const QString &value)
|
||||
{
|
||||
pointName = value;
|
||||
|
|
|
@ -31,6 +31,7 @@
|
|||
|
||||
#include <QPushButton>
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
DialogPointOfIntersection::DialogPointOfIntersection(const VContainer *data, QWidget *parent)
|
||||
:DialogTool(data, parent), ui(new Ui::DialogPointOfIntersection), number(0), pointName(QString()),
|
||||
firstPointId(0), secondPointId(0)
|
||||
|
@ -47,17 +48,20 @@ DialogPointOfIntersection::DialogPointOfIntersection(const VContainer *data, QWi
|
|||
connect(ui->lineEditNamePoint, &QLineEdit::textChanged, this, &DialogPointOfIntersection::NamePointChanged);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
DialogPointOfIntersection::~DialogPointOfIntersection()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogPointOfIntersection::setSecondPointId(const quint32 &value, const quint32 &id)
|
||||
{
|
||||
secondPointId = value;
|
||||
setCurrentPointId(ui->comboBoxSecondPoint, secondPointId, value, id);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogPointOfIntersection::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
||||
{
|
||||
if (type == Valentina::Point)
|
||||
|
@ -91,6 +95,7 @@ void DialogPointOfIntersection::ChoosedObject(quint32 id, const Valentina::Scene
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogPointOfIntersection::DialogAccepted()
|
||||
{
|
||||
pointName = ui->lineEditNamePoint->text();
|
||||
|
@ -99,12 +104,14 @@ void DialogPointOfIntersection::DialogAccepted()
|
|||
emit DialogClosed(QDialog::Accepted);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogPointOfIntersection::setFirstPointId(const quint32 &value, const quint32 &id)
|
||||
{
|
||||
firstPointId = value;
|
||||
setCurrentPointId(ui->comboBoxFirstPoint, firstPointId, value, id);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogPointOfIntersection::setPointName(const QString &value)
|
||||
{
|
||||
pointName = value;
|
||||
|
|
|
@ -31,6 +31,7 @@
|
|||
|
||||
#include <QPushButton>
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
DialogShoulderPoint::DialogShoulderPoint(const VContainer *data, QWidget *parent)
|
||||
:DialogTool(data, parent), ui(new Ui::DialogShoulderPoint), number(0), pointName(QString()),
|
||||
typeLine(QString()), formula(QString()), p1Line(0), p2Line(0), pShoulder(0)
|
||||
|
@ -60,11 +61,13 @@ DialogShoulderPoint::DialogShoulderPoint(const VContainer *data, QWidget *parent
|
|||
connect(ui->lineEditFormula, &QLineEdit::textChanged, this, &DialogShoulderPoint::FormulaChanged);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
DialogShoulderPoint::~DialogShoulderPoint()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogShoulderPoint::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
||||
{
|
||||
if (type == Valentina::Point)
|
||||
|
@ -109,6 +112,7 @@ void DialogShoulderPoint::ChoosedObject(quint32 id, const Valentina::Scenes &typ
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogShoulderPoint::DialogAccepted()
|
||||
{
|
||||
pointName = ui->lineEditNamePoint->text();
|
||||
|
@ -120,33 +124,39 @@ void DialogShoulderPoint::DialogAccepted()
|
|||
emit DialogClosed(QDialog::Accepted);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogShoulderPoint::setPShoulder(const quint32 &value, const quint32 &id)
|
||||
{
|
||||
setCurrentPointId(ui->comboBoxPShoulder, pShoulder, value, id);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogShoulderPoint::setP2Line(const quint32 &value, const quint32 &id)
|
||||
{
|
||||
setCurrentPointId(ui->comboBoxP2Line, p2Line, value, id);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogShoulderPoint::setP1Line(const quint32 &value, const quint32 &id)
|
||||
{
|
||||
setCurrentPointId(ui->comboBoxP1Line, p1Line, value, id);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogShoulderPoint::setFormula(const QString &value)
|
||||
{
|
||||
formula = value;
|
||||
ui->lineEditFormula->setText(formula);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogShoulderPoint::setTypeLine(const QString &value)
|
||||
{
|
||||
typeLine = value;
|
||||
SetupTypeLine(ui->comboBoxLineType, value);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogShoulderPoint::setPointName(const QString &value)
|
||||
{
|
||||
pointName = value;
|
||||
|
|
|
@ -31,6 +31,7 @@
|
|||
|
||||
#include <QPushButton>
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
DialogSinglePoint::DialogSinglePoint(const VContainer *data, QWidget *parent)
|
||||
:DialogTool(data, parent), ui(new Ui::DialogSinglePoint), name(QString()),
|
||||
point(QPointF())
|
||||
|
@ -47,6 +48,7 @@ DialogSinglePoint::DialogSinglePoint(const VContainer *data, QWidget *parent)
|
|||
connect(ui->lineEditName, &QLineEdit::textChanged, this, &DialogSinglePoint::NamePointChanged);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogSinglePoint::mousePress(const QPointF &scenePos)
|
||||
{
|
||||
if (isInitialized == false)
|
||||
|
@ -62,6 +64,7 @@ void DialogSinglePoint::mousePress(const QPointF &scenePos)
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogSinglePoint::DialogAccepted()
|
||||
{
|
||||
point = QPointF(qApp->toPixel(ui->doubleSpinBoxX->value()), qApp->toPixel(ui->doubleSpinBoxY->value()));
|
||||
|
@ -69,6 +72,7 @@ void DialogSinglePoint::DialogAccepted()
|
|||
emit DialogClosed(QDialog::Accepted);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogSinglePoint::setData(const QString &name, const QPointF &point)
|
||||
{
|
||||
this->name = name;
|
||||
|
@ -79,6 +83,7 @@ void DialogSinglePoint::setData(const QString &name, const QPointF &point)
|
|||
ui->doubleSpinBoxY->setValue(qApp->fromPixel(point.y()));
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
DialogSinglePoint::~DialogSinglePoint()
|
||||
{
|
||||
delete ui;
|
||||
|
|
|
@ -31,6 +31,7 @@
|
|||
|
||||
#include <QPushButton>
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
DialogSpline::DialogSpline(const VContainer *data, QWidget *parent)
|
||||
:DialogTool(data, parent), ui(new Ui::DialogSpline), number(0), p1(0), p4(0), angle1(0), angle2(0),
|
||||
kAsm1(1), kAsm2(1), kCurve(1)
|
||||
|
@ -42,16 +43,19 @@ DialogSpline::DialogSpline(const VContainer *data, QWidget *parent)
|
|||
FillComboBoxPoints(ui->comboBoxP4);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
DialogSpline::~DialogSpline()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
quint32 DialogSpline::getP1() const
|
||||
{
|
||||
return p1;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogSpline::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
||||
{
|
||||
if (type == Valentina::Point)
|
||||
|
@ -93,6 +97,7 @@ void DialogSpline::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogSpline::DialogAccepted()
|
||||
{
|
||||
p1 = getCurrentObjectId(ui->comboBoxP1);
|
||||
|
@ -105,48 +110,56 @@ void DialogSpline::DialogAccepted()
|
|||
emit DialogClosed(QDialog::Accepted);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogSpline::setKCurve(const qreal &value)
|
||||
{
|
||||
kCurve = value;
|
||||
ui->doubleSpinBoxKcurve->setValue(value);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogSpline::setKAsm2(const qreal &value)
|
||||
{
|
||||
kAsm2 = value;
|
||||
ui->doubleSpinBoxKasm2->setValue(value);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogSpline::setKAsm1(const qreal &value)
|
||||
{
|
||||
kAsm1 = value;
|
||||
ui->doubleSpinBoxKasm1->setValue(value);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogSpline::setAngle2(const qreal &value)
|
||||
{
|
||||
angle2 = value;
|
||||
ui->spinBoxAngle2->setValue(static_cast<qint32>(value));
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogSpline::setAngle1(const qreal &value)
|
||||
{
|
||||
angle1 = value;
|
||||
ui->spinBoxAngle1->setValue(static_cast<qint32>(value));
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogSpline::setP4(const quint32 &value)
|
||||
{
|
||||
p4 = value;
|
||||
ChangeCurrentData(ui->comboBoxP4, value);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogSpline::setP1(const quint32 &value)
|
||||
{
|
||||
p1 = value;
|
||||
ChangeCurrentData(ui->comboBoxP1, value);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
quint32 DialogSpline::getP4() const
|
||||
{
|
||||
return p4;
|
||||
|
|
|
@ -32,6 +32,7 @@
|
|||
|
||||
#include <QPushButton>
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
DialogSplinePath::DialogSplinePath(const VContainer *data, QWidget *parent)
|
||||
:DialogTool(data, parent), ui(new Ui::DialogSplinePath), path(VSplinePath())
|
||||
{
|
||||
|
@ -54,11 +55,13 @@ DialogSplinePath::DialogSplinePath(const VContainer *data, QWidget *parent)
|
|||
this, &DialogSplinePath::KAsm2Changed);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
DialogSplinePath::~DialogSplinePath()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogSplinePath::SetPath(const VSplinePath &value)
|
||||
{
|
||||
this->path = value;
|
||||
|
@ -71,7 +74,7 @@ void DialogSplinePath::SetPath(const VSplinePath &value)
|
|||
ui->doubleSpinBoxKcurve->setValue(path.getKCurve());
|
||||
}
|
||||
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogSplinePath::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
||||
{
|
||||
if (type == Valentina::Point)
|
||||
|
@ -82,6 +85,7 @@ void DialogSplinePath::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogSplinePath::DialogAccepted()
|
||||
{
|
||||
path.Clear();
|
||||
|
@ -95,6 +99,7 @@ void DialogSplinePath::DialogAccepted()
|
|||
emit DialogClosed(QDialog::Accepted);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogSplinePath::PointChanged(int row)
|
||||
{
|
||||
if (ui->listWidget->count() == 0)
|
||||
|
@ -107,6 +112,7 @@ void DialogSplinePath::PointChanged(int row)
|
|||
EnableFields();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogSplinePath::currentPointChanged(int index)
|
||||
{
|
||||
quint32 id = qvariant_cast<quint32>(ui->comboBoxPoint->itemData(index));
|
||||
|
@ -120,6 +126,7 @@ void DialogSplinePath::currentPointChanged(int index)
|
|||
item->setData(Qt::UserRole, QVariant::fromValue(p));
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogSplinePath::Angle1Changed(qreal index)
|
||||
{
|
||||
qint32 row = ui->listWidget->currentRow();
|
||||
|
@ -131,6 +138,7 @@ void DialogSplinePath::Angle1Changed(qreal index)
|
|||
item->setData(Qt::UserRole, QVariant::fromValue(p));
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogSplinePath::Angle2Changed(qreal index)
|
||||
{
|
||||
qint32 row = ui->listWidget->currentRow();
|
||||
|
@ -142,6 +150,7 @@ void DialogSplinePath::Angle2Changed(qreal index)
|
|||
item->setData(Qt::UserRole, QVariant::fromValue(p));
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogSplinePath::KAsm1Changed(qreal d)
|
||||
{
|
||||
qint32 row = ui->listWidget->currentRow();
|
||||
|
@ -151,6 +160,7 @@ void DialogSplinePath::KAsm1Changed(qreal d)
|
|||
item->setData(Qt::UserRole, QVariant::fromValue(p));
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogSplinePath::KAsm2Changed(qreal d)
|
||||
{
|
||||
qint32 row = ui->listWidget->currentRow();
|
||||
|
@ -160,6 +170,7 @@ void DialogSplinePath::KAsm2Changed(qreal d)
|
|||
item->setData(Qt::UserRole, QVariant::fromValue(p));
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogSplinePath::NewItem(quint32 id, qreal kAsm1, qreal angle1, qreal kAsm2, qreal angle2)
|
||||
{
|
||||
const VPointF *point = data->GeometricObject<const VPointF *>(id);
|
||||
|
@ -178,6 +189,7 @@ void DialogSplinePath::NewItem(quint32 id, qreal kAsm1, qreal angle1, qreal kAsm
|
|||
EnableFields();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogSplinePath::DataPoint(quint32 id, qreal kAsm1, qreal angle1, qreal kAsm2, qreal angle2)
|
||||
{
|
||||
disconnect(ui->comboBoxPoint, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged),
|
||||
|
@ -209,6 +221,7 @@ void DialogSplinePath::DataPoint(quint32 id, qreal kAsm1, qreal angle1, qreal kA
|
|||
this, &DialogSplinePath::KAsm2Changed);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogSplinePath::EnableFields()
|
||||
{
|
||||
ui->doubleSpinBoxKasm1->setEnabled(true);
|
||||
|
|
|
@ -33,6 +33,7 @@
|
|||
|
||||
#include <QtWidgets>
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
DialogTool::DialogTool(const VContainer *data, QWidget *parent)
|
||||
:QDialog(parent), data(data), isInitialized(false), flagName(true), flagFormula(true), timerFormula(nullptr),
|
||||
bOk(nullptr), spinBoxAngle(nullptr), lineEditFormula(nullptr), listWidget(nullptr),
|
||||
|
@ -51,12 +52,14 @@ DialogTool::DialogTool(const VContainer *data, QWidget *parent)
|
|||
setWindowFlags(flags | Qt::WindowStaysOnTopHint);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogTool::closeEvent(QCloseEvent *event)
|
||||
{
|
||||
DialogClosed(QDialog::Rejected);
|
||||
event->accept();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogTool::showEvent(QShowEvent *event)
|
||||
{
|
||||
QDialog::showEvent( event );
|
||||
|
@ -71,6 +74,7 @@ void DialogTool::showEvent(QShowEvent *event)
|
|||
isInitialized = true;//first show windows are held
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogTool::FillComboBoxPoints(QComboBox *box, const quint32 &id) const
|
||||
{
|
||||
Q_CHECK_PTR(box);
|
||||
|
@ -93,6 +97,7 @@ void DialogTool::FillComboBoxPoints(QComboBox *box, const quint32 &id) const
|
|||
FillList(box, list);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogTool::FillComboBoxArcs(QComboBox *box, const quint32 &id, ComboMode::ComboBoxCutArc cut) const
|
||||
{
|
||||
Q_CHECK_PTR(box);
|
||||
|
@ -130,6 +135,7 @@ void DialogTool::FillComboBoxArcs(QComboBox *box, const quint32 &id, ComboMode::
|
|||
FillList(box, list);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogTool::FillComboBoxSplines(QComboBox *box, const quint32 &id, ComboMode::ComboBoxCutSpline cut) const
|
||||
{
|
||||
Q_CHECK_PTR(box);
|
||||
|
@ -167,6 +173,7 @@ void DialogTool::FillComboBoxSplines(QComboBox *box, const quint32 &id, ComboMod
|
|||
FillList(box, list);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogTool::FillComboBoxSplinesPath(QComboBox *box, const quint32 &id, ComboMode::ComboBoxCutSpline cut) const
|
||||
{
|
||||
Q_CHECK_PTR(box);
|
||||
|
@ -204,6 +211,7 @@ void DialogTool::FillComboBoxSplinesPath(QComboBox *box, const quint32 &id, Comb
|
|||
FillList(box, list);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogTool::FillComboBoxTypeLine(QComboBox *box) const
|
||||
{
|
||||
Q_CHECK_PTR(box);
|
||||
|
@ -211,6 +219,7 @@ void DialogTool::FillComboBoxTypeLine(QComboBox *box) const
|
|||
box->setCurrentIndex(1);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
QString DialogTool::GetTypeLine(const QComboBox *box) const
|
||||
{
|
||||
switch (lineStyles.indexOf(box->currentText()))
|
||||
|
@ -239,6 +248,7 @@ QString DialogTool::GetTypeLine(const QComboBox *box) const
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogTool::SetupTypeLine(QComboBox *box, const QString &value)
|
||||
{
|
||||
QStringList styles = VAbstractTool::Styles();
|
||||
|
@ -249,6 +259,7 @@ void DialogTool::SetupTypeLine(QComboBox *box, const QString &value)
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogTool::ChangeCurrentText(QComboBox *box, const QString &value)
|
||||
{
|
||||
qint32 index = box->findText(value);
|
||||
|
@ -262,6 +273,7 @@ void DialogTool::ChangeCurrentText(QComboBox *box, const QString &value)
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogTool::ChangeCurrentData(QComboBox *box, const quint32 &value) const
|
||||
{
|
||||
qint32 index = box->findData(value);
|
||||
|
@ -271,6 +283,7 @@ void DialogTool::ChangeCurrentData(QComboBox *box, const quint32 &value) const
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogTool::PutValHere(QLineEdit *lineEdit, QListWidget *listWidget)
|
||||
{
|
||||
Q_CHECK_PTR(lineEdit);
|
||||
|
@ -283,6 +296,7 @@ void DialogTool::PutValHere(QLineEdit *lineEdit, QListWidget *listWidget)
|
|||
lineEdit->setCursorPosition(pos + item->text().size());
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogTool::ValFormulaChanged(bool &flag, QLineEdit *edit, QTimer *timer)
|
||||
{
|
||||
Q_CHECK_PTR(edit);
|
||||
|
@ -300,6 +314,7 @@ void DialogTool::ValFormulaChanged(bool &flag, QLineEdit *edit, QTimer *timer)
|
|||
timer->start(1000);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogTool::Eval(QLineEdit *edit, bool &flag, QTimer *timer, QLabel *label)
|
||||
{
|
||||
Q_CHECK_PTR(edit);
|
||||
|
@ -335,6 +350,7 @@ void DialogTool::Eval(QLineEdit *edit, bool &flag, QTimer *timer, QLabel *label)
|
|||
labelEditFormula->setPalette(palette);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogTool::setCurrentPointId(QComboBox *box, quint32 &pointId, const quint32 &value, const quint32 &id) const
|
||||
{
|
||||
Q_CHECK_PTR(box);
|
||||
|
@ -343,6 +359,7 @@ void DialogTool::setCurrentPointId(QComboBox *box, quint32 &pointId, const quint
|
|||
ChangeCurrentData(box, value);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogTool::setCurrentSplineId(QComboBox *box, quint32 &splineId, const quint32 &value, const quint32 &id,
|
||||
ComboMode::ComboBoxCutSpline cut) const
|
||||
{
|
||||
|
@ -352,6 +369,7 @@ void DialogTool::setCurrentSplineId(QComboBox *box, quint32 &splineId, const qui
|
|||
ChangeCurrentData(box, value);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogTool::setCurrentArcId(QComboBox *box, quint32 &arcId, const quint32 &value, const quint32 &id,
|
||||
ComboMode::ComboBoxCutArc cut) const
|
||||
{
|
||||
|
@ -361,6 +379,7 @@ void DialogTool::setCurrentArcId(QComboBox *box, quint32 &arcId, const quint32 &
|
|||
ChangeCurrentData(box, value);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogTool::setCurrentSplinePathId(QComboBox *box, quint32 &splinePathId, const quint32 &value,
|
||||
const quint32 &id, ComboMode::ComboBoxCutSpline cut) const
|
||||
{
|
||||
|
@ -370,6 +389,7 @@ void DialogTool::setCurrentSplinePathId(QComboBox *box, quint32 &splinePathId, c
|
|||
ChangeCurrentData(box, value);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
quint32 DialogTool::getCurrentObjectId(QComboBox *box) const
|
||||
{
|
||||
Q_CHECK_PTR(box);
|
||||
|
@ -385,6 +405,7 @@ quint32 DialogTool::getCurrentObjectId(QComboBox *box) const
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
bool DialogTool::ChoosedPoint(const quint32 &id, QComboBox *box, const QString &toolTip)
|
||||
{
|
||||
Q_CHECK_PTR(box);
|
||||
|
@ -400,6 +421,7 @@ bool DialogTool::ChoosedPoint(const quint32 &id, QComboBox *box, const QString &
|
|||
return false;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogTool::FillList(QComboBox *box, const QMap<QString, quint32> &list) const
|
||||
{
|
||||
Q_CHECK_PTR(box);
|
||||
|
@ -413,18 +435,21 @@ void DialogTool::FillList(QComboBox *box, const QMap<QString, quint32> &list) co
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogTool::CheckState()
|
||||
{
|
||||
Q_CHECK_PTR(bOk);
|
||||
bOk->setEnabled(flagFormula && flagName);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogTool::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
||||
{
|
||||
Q_UNUSED(id);
|
||||
Q_UNUSED(type);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogTool::NamePointChanged()
|
||||
{
|
||||
Q_CHECK_PTR(labelEditNamePoint);
|
||||
|
@ -450,16 +475,19 @@ void DialogTool::NamePointChanged()
|
|||
CheckState();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogTool::DialogAccepted()
|
||||
{
|
||||
emit DialogClosed(QDialog::Accepted);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogTool::DialogRejected()
|
||||
{
|
||||
emit DialogClosed(QDialog::Rejected);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogTool::FormulaChanged()
|
||||
{
|
||||
QLineEdit* edit = qobject_cast<QLineEdit*>(sender());
|
||||
|
@ -469,54 +497,63 @@ void DialogTool::FormulaChanged()
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogTool::ArrowUp()
|
||||
{
|
||||
Q_CHECK_PTR(spinBoxAngle);
|
||||
spinBoxAngle->setValue(90);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogTool::ArrowDown()
|
||||
{
|
||||
Q_CHECK_PTR(spinBoxAngle);
|
||||
spinBoxAngle->setValue(270);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogTool::ArrowLeft()
|
||||
{
|
||||
Q_CHECK_PTR(spinBoxAngle);
|
||||
spinBoxAngle->setValue(180);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogTool::ArrowRight()
|
||||
{
|
||||
Q_CHECK_PTR(spinBoxAngle);
|
||||
spinBoxAngle->setValue(0);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogTool::ArrowLeftUp()
|
||||
{
|
||||
Q_CHECK_PTR(spinBoxAngle);
|
||||
spinBoxAngle->setValue(135);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogTool::ArrowLeftDown()
|
||||
{
|
||||
Q_CHECK_PTR(spinBoxAngle);
|
||||
spinBoxAngle->setValue(225);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogTool::ArrowRightUp()
|
||||
{
|
||||
Q_CHECK_PTR(spinBoxAngle);
|
||||
spinBoxAngle->setValue(45);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogTool::ArrowRightDown()
|
||||
{
|
||||
Q_CHECK_PTR(spinBoxAngle);
|
||||
spinBoxAngle->setValue(315);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogTool::EvalFormula()
|
||||
{
|
||||
Q_CHECK_PTR(lineEditFormula);
|
||||
|
@ -524,6 +561,7 @@ void DialogTool::EvalFormula()
|
|||
Eval(lineEditFormula, flagFormula, timerFormula, labelResultCalculation);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogTool::SizeHeight()
|
||||
{
|
||||
Q_CHECK_PTR(listWidget);
|
||||
|
@ -544,36 +582,43 @@ void DialogTool::SizeHeight()
|
|||
listWidget->setCurrentRow (0);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogTool::Measurements()
|
||||
{
|
||||
ShowVariable(data->DataMeasurements());
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogTool::LengthLines()
|
||||
{
|
||||
ShowVariable(data->DataLengthLines());
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogTool::LengthArcs()
|
||||
{
|
||||
ShowVariable(data->DataLengthArcs());
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogTool::LengthCurves()
|
||||
{
|
||||
ShowVariable(data->DataLengthSplines());
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogTool::Increments()
|
||||
{
|
||||
ShowVariable(data->DataIncrements());
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogTool::PutHere()
|
||||
{
|
||||
PutValHere(lineEditFormula, listWidget);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogTool::PutVal(QListWidgetItem *item)
|
||||
{
|
||||
Q_CHECK_PTR(lineEditFormula);
|
||||
|
@ -585,6 +630,7 @@ void DialogTool::PutVal(QListWidgetItem *item)
|
|||
lineEditFormula->setCursorPosition(pos + item->text().size());
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogTool::ValChenged(int row)
|
||||
{
|
||||
Q_CHECK_PTR(listWidget);
|
||||
|
@ -653,6 +699,7 @@ void DialogTool::ValChenged(int row)
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogTool::UpdateList()
|
||||
{
|
||||
Q_CHECK_PTR(radioButtonSizeGrowth);
|
||||
|
@ -688,6 +735,7 @@ void DialogTool::UpdateList()
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
template <class key, class val>
|
||||
void DialogTool::ShowVariable(const QHash<key, val> *var)
|
||||
{
|
||||
|
|
|
@ -31,6 +31,7 @@
|
|||
|
||||
#include <QPushButton>
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
DialogTriangle::DialogTriangle(const VContainer *data, QWidget *parent)
|
||||
:DialogTool(data, parent), ui(new Ui::DialogTriangle), number(0), pointName(QString()), axisP1Id(0),
|
||||
axisP2Id(0), firstPointId(0), secondPointId(0)
|
||||
|
@ -49,11 +50,13 @@ DialogTriangle::DialogTriangle(const VContainer *data, QWidget *parent)
|
|||
connect(ui->lineEditNamePoint, &QLineEdit::textChanged, this, &DialogTriangle::NamePointChanged);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
DialogTriangle::~DialogTriangle()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogTriangle::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
||||
{
|
||||
if (type == Valentina::Point)
|
||||
|
@ -91,6 +94,7 @@ void DialogTriangle::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogTriangle::DialogAccepted()
|
||||
{
|
||||
pointName = ui->lineEditNamePoint->text();
|
||||
|
@ -101,30 +105,35 @@ void DialogTriangle::DialogAccepted()
|
|||
emit DialogClosed(QDialog::Accepted);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogTriangle::setPointName(const QString &value)
|
||||
{
|
||||
pointName = value;
|
||||
ui->lineEditNamePoint->setText(pointName);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogTriangle::setSecondPointId(const quint32 &value, const quint32 &id)
|
||||
{
|
||||
secondPointId = value;
|
||||
setCurrentPointId(ui->comboBoxSecondPoint, secondPointId, value, id);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogTriangle::setFirstPointId(const quint32 &value, const quint32 &id)
|
||||
{
|
||||
firstPointId = value;
|
||||
setCurrentPointId(ui->comboBoxFirstPoint, firstPointId, value, id);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogTriangle::setAxisP2Id(const quint32 &value, const quint32 &id)
|
||||
{
|
||||
axisP2Id = value;
|
||||
setCurrentPointId(ui->comboBoxAxisP2, axisP2Id, value, id);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogTriangle::setAxisP1Id(const quint32 &value, const quint32 &id)
|
||||
{
|
||||
axisP1Id = value;
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
#include "dialoguniondetails.h"
|
||||
#include "ui_dialoguniondetails.h"
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
DialogUnionDetails::DialogUnionDetails(const VContainer *data, QWidget *parent) :
|
||||
DialogTool(data, parent), ui(new Ui::DialogUnionDetails), indexD1(0), indexD2(0), d1(0), d2(0), numberD(0),
|
||||
numberP(0), p1(0), p2(0)
|
||||
|
@ -37,11 +38,13 @@ DialogUnionDetails::DialogUnionDetails(const VContainer *data, QWidget *parent)
|
|||
InitOkCansel(ui);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
DialogUnionDetails::~DialogUnionDetails()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogUnionDetails::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
||||
{
|
||||
if (numberD == 0)
|
||||
|
@ -54,11 +57,13 @@ void DialogUnionDetails::ChoosedObject(quint32 id, const Valentina::Scenes &type
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogUnionDetails::DialogAccepted()
|
||||
{
|
||||
emit DialogClosed(QDialog::Accepted);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
bool DialogUnionDetails::CheckObject(const quint32 &id, const quint32 &idDetail) const
|
||||
{
|
||||
if (idDetail == 0)
|
||||
|
@ -69,6 +74,7 @@ bool DialogUnionDetails::CheckObject(const quint32 &id, const quint32 &idDetail)
|
|||
return det.Containes(id);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogUnionDetails::ChoosedDetail(const quint32 &id, const Valentina::Scenes &type, quint32 &idDetail,
|
||||
ptrdiff_t &index)
|
||||
{
|
||||
|
|
|
@ -31,22 +31,24 @@
|
|||
#include <QSpacerItem>
|
||||
#include <QGridLayout>
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VException::VException(const QString &what):QException(), what(what), moreInfo(QString())
|
||||
{
|
||||
Q_ASSERT_X(what.isEmpty() == false, Q_FUNC_INFO, "Error message is empty");
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VException::VException(const VException &e):what(e.What()), moreInfo(e.MoreInformation())
|
||||
{
|
||||
|
||||
}
|
||||
{}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
QString VException::ErrorMessage() const
|
||||
{
|
||||
QString error = QString("Exception: %1").arg(what);
|
||||
return error;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VException::CriticalMessageBox(const QString &situation, QWidget * parent) const
|
||||
{
|
||||
QMessageBox msgBox(parent);
|
||||
|
@ -67,6 +69,7 @@ void VException::CriticalMessageBox(const QString &situation, QWidget * parent)
|
|||
msgBox.exec();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VException::AddMoreInformation(const QString &info)
|
||||
{
|
||||
if (info.isEmpty())
|
||||
|
@ -76,6 +79,7 @@ void VException::AddMoreInformation(const QString &info)
|
|||
moreInfo = QString("%1\n%2").arg(moreInfo, info);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
QString VException::MoreInfo(const QString &detInfo) const
|
||||
{
|
||||
if (moreInfo.isEmpty() == false)
|
||||
|
|
|
@ -28,6 +28,7 @@
|
|||
|
||||
#include "vexceptionbadid.h"
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
QString VExceptionBadId::ErrorMessage() const
|
||||
{
|
||||
QString error;
|
||||
|
|
|
@ -28,18 +28,19 @@
|
|||
|
||||
#include "vexceptionconversionerror.h"
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VExceptionConversionError::VExceptionConversionError(const QString &what, const QString &str)
|
||||
:VException(what), str(str)
|
||||
{
|
||||
Q_ASSERT_X(str.isEmpty() == false, Q_FUNC_INFO, "Error converting string is empty");
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VExceptionConversionError::VExceptionConversionError(const VExceptionConversionError &e)
|
||||
:VException(e), str(e.String())
|
||||
{
|
||||
|
||||
}
|
||||
{}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
QString VExceptionConversionError::ErrorMessage() const
|
||||
{
|
||||
QString error = QString("ExceptionConversionError: %1 %2").arg(what, str);
|
||||
|
|
|
@ -30,6 +30,7 @@
|
|||
|
||||
#include <QtWidgets>
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VExceptionEmptyParameter::VExceptionEmptyParameter(const QString &what, const QString &name,
|
||||
const QDomElement &domElement)
|
||||
: VException(what), name(name), tagText(QString()), tagName(QString()), lineNumber(-1)
|
||||
|
@ -42,18 +43,19 @@ VExceptionEmptyParameter::VExceptionEmptyParameter(const QString &what, const QS
|
|||
lineNumber = domElement.lineNumber();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VExceptionEmptyParameter::VExceptionEmptyParameter(const VExceptionEmptyParameter &e)
|
||||
:VException(e), name(e.Name()), tagText(e.TagText()), tagName(e.TagName()), lineNumber(e.LineNumber())
|
||||
{
|
||||
|
||||
}
|
||||
{}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
QString VExceptionEmptyParameter::ErrorMessage() const
|
||||
{
|
||||
QString error = QString("ExceptionEmptyParameter: %1 %2").arg(what, name);
|
||||
return error;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
QString VExceptionEmptyParameter::DetailedInformation() const
|
||||
{
|
||||
return MoreInfo(QString("tag: %1 in line %2\nFull tag:\n%3").arg(tagName).arg(lineNumber).arg(tagText));
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
#include "vexceptionobjecterror.h"
|
||||
#include <QDebug>
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VExceptionObjectError::VExceptionObjectError(const QString &what, const QDomElement &domElement)
|
||||
:VException(what), tagText(QString()), tagName(QString()), lineNumber(-1)
|
||||
{
|
||||
|
@ -39,18 +40,19 @@ VExceptionObjectError::VExceptionObjectError(const QString &what, const QDomElem
|
|||
lineNumber = domElement.lineNumber();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VExceptionObjectError::VExceptionObjectError(const VExceptionObjectError &e)
|
||||
:VException(e), tagText(e.TagText()), tagName(e.TagName()), lineNumber(e.LineNumber())
|
||||
{
|
||||
|
||||
}
|
||||
{}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
QString VExceptionObjectError::ErrorMessage() const
|
||||
{
|
||||
QString error = QString("ExceptionObjectError: %1").arg(what);
|
||||
return error;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
QString VExceptionObjectError::DetailedInformation() const
|
||||
{
|
||||
return MoreInfo(QString("tag: %1 in line %2\n%3").arg(tagName).arg(lineNumber).arg(tagText));
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
#include "vexceptionwrongid.h"
|
||||
#include <QDebug>
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VExceptionWrongId::VExceptionWrongId(const QString &what, const QDomElement &domElement)
|
||||
:VException(what), tagText(QString()), tagName(QString()), lineNumber(-1)
|
||||
{
|
||||
|
@ -39,18 +40,19 @@ VExceptionWrongId::VExceptionWrongId(const QString &what, const QDomElement &dom
|
|||
lineNumber = domElement.lineNumber();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VExceptionWrongId::VExceptionWrongId(const VExceptionWrongId &e)
|
||||
:VException(e), tagText(e.TagText()), tagName(e.TagName()), lineNumber(e.LineNumber())
|
||||
{
|
||||
|
||||
}
|
||||
{}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
QString VExceptionWrongId::ErrorMessage() const
|
||||
{
|
||||
QString error = QString("ExceptionWrongId: %1").arg(what);
|
||||
return error;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
QString VExceptionWrongId::DetailedInformation() const
|
||||
{
|
||||
return MoreInfo(QString("tag: %1 in line %2\nFull tag:\n%3").arg(tagName).arg(lineNumber).arg(tagText));
|
||||
|
|
|
@ -33,12 +33,13 @@
|
|||
|
||||
class QRectF;
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VArc::VArc ()
|
||||
:VGObject(GObject::Arc), f1(0), formulaF1(QString()), f2(0), formulaF2(QString()), radius(0),
|
||||
formulaRadius(QString()), center(VPointF())
|
||||
{
|
||||
}
|
||||
{}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VArc::VArc (VPointF center, qreal radius, QString formulaRadius, qreal f1, QString formulaF1, qreal f2,
|
||||
QString formulaF2, quint32 idObject, Valentina::Draws mode)
|
||||
: VGObject(GObject::Arc, idObject, mode), f1(f1), formulaF1(formulaF1), f2(f2), formulaF2(formulaF2),
|
||||
|
@ -47,13 +48,14 @@ VArc::VArc (VPointF center, qreal radius, QString formulaRadius, qreal f1, QStri
|
|||
_name = QString ("Arc_%1").arg(this->GetCenter().name());
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VArc::VArc(const VArc &arc)
|
||||
: VGObject(arc), f1(arc.GetF1()), formulaF1(arc.GetFormulaF1()), f2(arc.GetF2()),
|
||||
formulaF2(arc.GetFormulaF2()), radius(arc.GetRadius()), formulaRadius(arc.GetFormulaRadius()),
|
||||
center(arc.GetCenter())
|
||||
{
|
||||
}
|
||||
{}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VArc &VArc::operator =(const VArc &arc)
|
||||
{
|
||||
VGObject::operator=(arc);
|
||||
|
@ -67,11 +69,13 @@ VArc &VArc::operator =(const VArc &arc)
|
|||
return *this;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
qreal VArc::GetLength() const
|
||||
{
|
||||
return (M_PI * radius)/180 * AngleArc();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
QPointF VArc::GetP1() const
|
||||
{
|
||||
QPointF p1 ( GetCenter().x () + radius, GetCenter().y () );
|
||||
|
@ -80,6 +84,7 @@ QPointF VArc::GetP1() const
|
|||
return centerP1.p2();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
QPointF VArc::GetP2 () const
|
||||
{
|
||||
QPointF p2 ( GetCenter().x () + radius, GetCenter().y () );
|
||||
|
@ -88,6 +93,7 @@ QPointF VArc::GetP2 () const
|
|||
return centerP2.p2();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
QPainterPath VArc::GetPath() const
|
||||
{
|
||||
QPainterPath path;
|
||||
|
@ -108,6 +114,7 @@ QPainterPath VArc::GetPath() const
|
|||
return path;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
qreal VArc::AngleArc() const
|
||||
{
|
||||
QLineF l1(0, 0, 100, 100);
|
||||
|
@ -117,6 +124,7 @@ qreal VArc::AngleArc() const
|
|||
return l1.angleTo(l2);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
QVector<QPointF> VArc::GetPoints() const
|
||||
{
|
||||
QVector<QPointF> points;
|
||||
|
@ -140,11 +148,13 @@ QVector<QPointF> VArc::GetPoints() const
|
|||
return points;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
QString VArc::name() const
|
||||
{
|
||||
return _name;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
QPointF VArc::CutArc(const qreal &length, VArc &arc1, VArc &arc2) const
|
||||
{
|
||||
//Always need return two arcs, so we must correct wrong length.
|
||||
|
@ -174,6 +184,7 @@ QPointF VArc::CutArc(const qreal &length, VArc &arc1, VArc &arc2) const
|
|||
return line.p2();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VArc::setId(const quint32 &id)
|
||||
{
|
||||
_id = id;
|
||||
|
|
|
@ -29,10 +29,13 @@
|
|||
#include "vdetail.h"
|
||||
#include <QDebug>
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VDetail::VDetail()
|
||||
:_id(0), nodes(QVector<VNodeDetail>()), name(QString()), mx(0), my(0), seamAllowance(true), closed(true),
|
||||
width(10){}
|
||||
width(10)
|
||||
{}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VDetail::VDetail(const QString &name, const QVector<VNodeDetail> &nodes)
|
||||
:_id(0), nodes(QVector<VNodeDetail>()), name(name), mx(0), my(0), seamAllowance(true), closed(true),
|
||||
width(10)
|
||||
|
@ -40,10 +43,13 @@ VDetail::VDetail(const QString &name, const QVector<VNodeDetail> &nodes)
|
|||
this->nodes = nodes;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VDetail::VDetail(const VDetail &detail)
|
||||
:_id(0), nodes(detail.getNodes()), name(detail.getName()), mx(detail.getMx()), my(detail.getMy()),
|
||||
seamAllowance(detail.getSeamAllowance()), closed(detail.getClosed()), width(detail.getWidth()){}
|
||||
seamAllowance(detail.getSeamAllowance()), closed(detail.getClosed()), width(detail.getWidth())
|
||||
{}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VDetail &VDetail::operator =(const VDetail &detail)
|
||||
{
|
||||
_id = detail.id();
|
||||
|
@ -57,6 +63,7 @@ VDetail &VDetail::operator =(const VDetail &detail)
|
|||
return *this;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VDetail::Clear()
|
||||
{
|
||||
nodes.clear();
|
||||
|
@ -68,11 +75,13 @@ void VDetail::Clear()
|
|||
width = 10;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VDetail::ClearNodes()
|
||||
{
|
||||
nodes.clear();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
bool VDetail::Containes(const quint32 &id) const
|
||||
{
|
||||
for (ptrdiff_t i = 0; i < nodes.size(); ++i)
|
||||
|
@ -86,31 +95,37 @@ bool VDetail::Containes(const quint32 &id) const
|
|||
return false;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VNodeDetail &VDetail::operator [](ptrdiff_t indx)
|
||||
{
|
||||
return nodes[indx];
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
const VNodeDetail &VDetail::at(ptrdiff_t indx) const
|
||||
{
|
||||
return nodes[indx];
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
ptrdiff_t VDetail::indexOfNode(const quint32 &id) const
|
||||
{
|
||||
return indexOfNode(nodes, id);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
quint32 VDetail::id() const
|
||||
{
|
||||
return _id;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VDetail::setId(const quint32 &id)
|
||||
{
|
||||
_id = id;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
bool VDetail::OnEdge(const quint32 &p1, const quint32 &p2) const
|
||||
{
|
||||
QVector<VNodeDetail> list = listNodePoint();
|
||||
|
@ -148,6 +163,7 @@ bool VDetail::OnEdge(const quint32 &p1, const quint32 &p2) const
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
ptrdiff_t VDetail::Edge(const quint32 &p1, const quint32 &p2) const
|
||||
{
|
||||
if (OnEdge(p1, p2) == false)
|
||||
|
@ -172,6 +188,7 @@ ptrdiff_t VDetail::Edge(const quint32 &p1, const quint32 &p2) const
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VDetail::NodeOnEdge(const quint32 &index, VNodeDetail &p1, VNodeDetail &p2) const
|
||||
{
|
||||
QVector<VNodeDetail> list = listNodePoint();
|
||||
|
@ -191,6 +208,7 @@ void VDetail::NodeOnEdge(const quint32 &index, VNodeDetail &p1, VNodeDetail &p2)
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VDetail VDetail::RemoveEdge(const quint32 &index) const
|
||||
{
|
||||
VDetail det(*this);
|
||||
|
@ -233,6 +251,7 @@ VDetail VDetail::RemoveEdge(const quint32 &index) const
|
|||
return det;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
QList<quint32> VDetail::Missing(const VDetail &det) const
|
||||
{
|
||||
QList<quint32> list;
|
||||
|
@ -256,6 +275,7 @@ QList<quint32> VDetail::Missing(const VDetail &det) const
|
|||
return list;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
QVector<VNodeDetail> VDetail::listNodePoint() const
|
||||
{
|
||||
QVector<VNodeDetail> list;
|
||||
|
@ -269,6 +289,7 @@ QVector<VNodeDetail> VDetail::listNodePoint() const
|
|||
return list;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
ptrdiff_t VDetail::indexOfNode(const QVector<VNodeDetail> &list, const quint32 &id)
|
||||
{
|
||||
for (ptrdiff_t i = 0; i < list.size(); ++i)
|
||||
|
|
|
@ -30,6 +30,7 @@
|
|||
#include "../widgets/vapplication.h"
|
||||
#include <QDebug>
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
QPainterPath VEquidistant::ContourPath(const quint32 &idDetail, const VContainer *data) const
|
||||
{
|
||||
Q_CHECK_PTR(data);
|
||||
|
@ -159,6 +160,7 @@ QPainterPath VEquidistant::ContourPath(const quint32 &idDetail, const VContainer
|
|||
return path;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
qreal VEquidistant::GetLengthContour(const QVector<QPointF> &contour, const QVector<QPointF> &newPoints)
|
||||
{
|
||||
qreal length = 0;
|
||||
|
@ -172,6 +174,7 @@ qreal VEquidistant::GetLengthContour(const QVector<QPointF> &contour, const QVec
|
|||
return length;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
QVector<QPointF> VEquidistant::biasPoints(const QVector<QPointF> &points, const qreal &mx, const qreal &my)
|
||||
{
|
||||
QVector<QPointF> p;
|
||||
|
@ -185,6 +188,7 @@ QVector<QPointF> VEquidistant::biasPoints(const QVector<QPointF> &points, const
|
|||
return p;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
QVector<QPointF> VEquidistant::CorrectEquidistantPoints(const QVector<QPointF> &points)
|
||||
{
|
||||
QVector<QPointF> correctPoints;
|
||||
|
@ -230,6 +234,7 @@ QVector<QPointF> VEquidistant::CorrectEquidistantPoints(const QVector<QPointF> &
|
|||
return correctPoints;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
QPainterPath VEquidistant::Equidistant(QVector<QPointF> points, const Detail::Equidistant &eqv,
|
||||
const qreal &width)
|
||||
{
|
||||
|
@ -297,6 +302,7 @@ QPainterPath VEquidistant::Equidistant(QVector<QPointF> points, const Detail::Eq
|
|||
return ekv;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
QVector<QPointF> VEquidistant::CheckLoops(const QVector<QPointF> &points)
|
||||
{
|
||||
QVector<QPointF> ekvPoints;
|
||||
|
@ -355,6 +361,7 @@ QVector<QPointF> VEquidistant::CheckLoops(const QVector<QPointF> &points)
|
|||
return ekvPoints;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
QVector<QPointF> VEquidistant::GetReversePoint(const QVector<QPointF> &points)
|
||||
{
|
||||
Q_ASSERT(points.size() > 0);
|
||||
|
@ -366,6 +373,7 @@ QVector<QPointF> VEquidistant::GetReversePoint(const QVector<QPointF> &points)
|
|||
return reversePoints;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
QVector<QPointF> VEquidistant::EkvPoint(const QLineF &line1, const QLineF &line2, const qreal &width)
|
||||
{
|
||||
Q_ASSERT(width > 0);
|
||||
|
@ -415,6 +423,7 @@ QVector<QPointF> VEquidistant::EkvPoint(const QLineF &line1, const QLineF &line2
|
|||
return points;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
QLineF VEquidistant::ParallelLine(const QLineF &line, qreal width)
|
||||
{
|
||||
Q_ASSERT(width > 0);
|
||||
|
@ -423,6 +432,7 @@ QLineF VEquidistant::ParallelLine(const QLineF &line, qreal width)
|
|||
return paralel;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
QPointF VEquidistant::SingleParallelPoint(const QLineF &line, const qreal &angle, const qreal &width)
|
||||
{
|
||||
Q_ASSERT(width > 0);
|
||||
|
|
|
@ -28,21 +28,22 @@
|
|||
|
||||
#include "vgobject.h"
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VGObject::VGObject()
|
||||
:_id(0), type(GObject::Point), idObject(0), _name(QString()), mode(Valentina::Calculation)
|
||||
{
|
||||
}
|
||||
{}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VGObject::VGObject(const GObject::Type &type, const quint32 &idObject, const Valentina::Draws &mode)
|
||||
:_id(0), type(type), idObject(idObject), _name(QString()), mode(mode)
|
||||
{
|
||||
}
|
||||
{}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VGObject::VGObject(const VGObject &obj)
|
||||
:_id(obj.id()), type(obj.getType()), idObject(obj.getIdObject()), _name(obj.name()), mode(obj.getMode())
|
||||
{
|
||||
}
|
||||
{}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VGObject &VGObject::operator=(const VGObject &obj)
|
||||
{
|
||||
this->_id = obj.id();
|
||||
|
@ -53,21 +54,25 @@ VGObject &VGObject::operator=(const VGObject &obj)
|
|||
return *this;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
quint32 VGObject::getIdObject() const
|
||||
{
|
||||
return idObject;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VGObject::setIdObject(const quint32 &value)
|
||||
{
|
||||
idObject = value;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
QString VGObject::name() const
|
||||
{
|
||||
return _name;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VGObject::setName(const QString &name)
|
||||
{
|
||||
_name = name;
|
||||
|
@ -78,21 +83,25 @@ Valentina::Draws VGObject::getMode() const
|
|||
return mode;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VGObject::setMode(const Valentina::Draws &value)
|
||||
{
|
||||
mode = value;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
GObject::Type VGObject::getType() const
|
||||
{
|
||||
return type;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
quint32 VGObject::id() const
|
||||
{
|
||||
return _id;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VGObject::setId(const quint32 &id)
|
||||
{
|
||||
_id = id;
|
||||
|
|
|
@ -28,15 +28,22 @@
|
|||
|
||||
#include "vnodedetail.h"
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VNodeDetail::VNodeDetail()
|
||||
:id(0), typeTool(Valentina::NodePoint), typeNode(NodeDetail::Contour), mx(0), my(0){}
|
||||
:id(0), typeTool(Valentina::NodePoint), typeNode(NodeDetail::Contour), mx(0), my(0)
|
||||
{}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VNodeDetail::VNodeDetail(quint32 id, Valentina::Tools typeTool, NodeDetail::NodeDetails typeNode, qreal mx, qreal my)
|
||||
:id(id), typeTool(typeTool), typeNode(typeNode), mx(mx), my(my){}
|
||||
:id(id), typeTool(typeTool), typeNode(typeNode), mx(mx), my(my)
|
||||
{}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VNodeDetail::VNodeDetail(const VNodeDetail &node)
|
||||
:id(node.getId()), typeTool(node.getTypeTool()), typeNode(node.getTypeNode()), mx(node.getMx()), my(node.getMy()){}
|
||||
:id(node.getId()), typeTool(node.getTypeTool()), typeNode(node.getTypeNode()), mx(node.getMx()), my(node.getMy())
|
||||
{}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VNodeDetail &VNodeDetail::operator =(const VNodeDetail &node)
|
||||
{
|
||||
id = node.getId();
|
||||
|
|
|
@ -28,27 +28,26 @@
|
|||
|
||||
#include "vpointf.h"
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VPointF::VPointF(qreal x, qreal y, QString name, qreal mx, qreal my, quint32 idObject, Valentina::Draws mode)
|
||||
:VGObject(GObject::Point, idObject, mode), _mx(mx), _my(my), _x(x), _y(y)
|
||||
{
|
||||
this->_name = name;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VPointF::VPointF() :VGObject(GObject::Point, 0, Valentina::Calculation), _mx(0), _my(0), _x(0), _y(0)
|
||||
{
|
||||
|
||||
}
|
||||
{}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VPointF::VPointF(const VPointF &point) :VGObject(point), _mx(point.mx()), _my(point.my()), _x(point.x()), _y(point.y())
|
||||
{
|
||||
|
||||
}
|
||||
{}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VPointF::VPointF(const QPointF &point) :VGObject(VPointF()), _mx(0), _my(0), _x(point.x()), _y(point.y())
|
||||
{
|
||||
|
||||
}
|
||||
{}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VPointF &VPointF::operator =(const VPointF &point)
|
||||
{
|
||||
VGObject::operator=(point);
|
||||
|
|
|
@ -30,15 +30,20 @@
|
|||
|
||||
#include <QDebug>
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VSpline::VSpline()
|
||||
:VGObject(GObject::Spline), p1(VPointF()), p2(QPointF()), p3(QPointF()), p4(VPointF()), angle1(0), angle2(0),
|
||||
kAsm1(1), kAsm2(1), kCurve(1){}
|
||||
kAsm1(1), kAsm2(1), kCurve(1)
|
||||
{}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VSpline::VSpline ( const VSpline & spline )
|
||||
:VGObject(spline), p1(spline.GetP1 ()), p2(spline.GetP2 ()), p3(spline.GetP3 ()), p4(spline.GetP4 ()),
|
||||
angle1(spline.GetAngle1 ()), angle2(spline.GetAngle2 ()), kAsm1(spline.GetKasm1()), kAsm2(spline.GetKasm2()),
|
||||
kCurve(spline.GetKcurve()){}
|
||||
kCurve(spline.GetKcurve())
|
||||
{}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VSpline::VSpline (VPointF p1, VPointF p4, qreal angle1, qreal angle2, qreal kAsm1, qreal kAsm2, qreal kCurve,
|
||||
quint32 idObject, Valentina::Draws mode)
|
||||
:VGObject(GObject::Spline, idObject, mode), p1(p1), p2(QPointF()), p3(QPointF()), p4(p4), angle1(angle1),
|
||||
|
@ -67,6 +72,7 @@ VSpline::VSpline (VPointF p1, VPointF p4, qreal angle1, qreal angle2, qreal kAsm
|
|||
this->p3 = p4p3.p2();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VSpline::VSpline (VPointF p1, QPointF p2, QPointF p3, VPointF p4, qreal kCurve, quint32 idObject, Valentina::Draws mode)
|
||||
:VGObject(GObject::Spline, idObject, mode), p1(p1), p2(p2), p3(p3), p4(p4), angle1(0), angle2(0), kAsm1(1),
|
||||
kAsm2(1), kCurve(1)
|
||||
|
@ -91,16 +97,19 @@ VSpline::VSpline (VPointF p1, QPointF p2, QPointF p3, VPointF p4, qreal kCurve,
|
|||
this->kAsm2 = QLineF ( GetP4().toQPointF(), p3 ).length()/L;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
qreal VSpline::GetLength () const
|
||||
{
|
||||
return LengthBezier ( GetP1().toQPointF(), this->p2, this->p3, GetP4().toQPointF());
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
QString VSpline::name() const
|
||||
{
|
||||
return _name;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
QLineF::IntersectType VSpline::CrossingSplLine ( const QLineF &line, QPointF *intersectionPoint ) const
|
||||
{
|
||||
QVector<qreal> px;
|
||||
|
@ -130,6 +139,7 @@ QLineF::IntersectType VSpline::CrossingSplLine ( const QLineF &line, QPointF *in
|
|||
throw "Can't found point of intersection spline and line.";
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
qreal VSpline::LengthT(qreal t) const
|
||||
{
|
||||
if (t < 0 || t > 1)
|
||||
|
@ -164,6 +174,7 @@ qreal VSpline::LengthT(qreal t) const
|
|||
return LengthBezier ( GetP1().toQPointF(), p12, p123, p1234);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
QPointF VSpline::CutSpline ( qreal length, QPointF &spl1p2, QPointF &spl1p3, QPointF &spl2p2, QPointF &spl2p3 ) const
|
||||
{
|
||||
//Always need return two splines, so we must correct wrong length.
|
||||
|
@ -223,11 +234,13 @@ QPointF VSpline::CutSpline ( qreal length, QPointF &spl1p2, QPointF &spl1p3, QPo
|
|||
return p1234;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
QVector<QPointF> VSpline::GetPoints () const
|
||||
{
|
||||
return GetPoints(GetP1().toQPointF(), p2, p3, GetP4().toQPointF());
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
QVector<QPointF> VSpline::GetPoints (const QPointF &p1, const QPointF &p2, const QPointF &p3, const QPointF &p4)
|
||||
{
|
||||
QVector<QPointF> pvector;
|
||||
|
@ -248,6 +261,7 @@ QVector<QPointF> VSpline::GetPoints (const QPointF &p1, const QPointF &p2, const
|
|||
return pvector;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
qreal VSpline::LengthBezier ( const QPointF &p1, const QPointF &p2, const QPointF &p3, const QPointF &p4 ) const
|
||||
{
|
||||
QPainterPath splinePath;
|
||||
|
@ -260,6 +274,7 @@ qreal VSpline::LengthBezier ( const QPointF &p1, const QPointF &p2, const QPoint
|
|||
return splinePath.length();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VSpline::PointBezier_r ( qreal x1, qreal y1, qreal x2, qreal y2,
|
||||
qreal x3, qreal y3, qreal x4, qreal y4,
|
||||
qint16 level, QVector<qreal> &px, QVector<qreal> &py)
|
||||
|
@ -271,15 +286,15 @@ void VSpline::PointBezier_r ( qreal x1, qreal y1, qreal x2, qreal y2,
|
|||
const double m_cusp_limit = 0.0;
|
||||
double m_approximation_scale = 1.0;
|
||||
double m_distance_tolerance_square;
|
||||
|
||||
|
||||
m_distance_tolerance_square = 0.5 / m_approximation_scale;
|
||||
m_distance_tolerance_square *= m_distance_tolerance_square;
|
||||
|
||||
|
||||
if (level > curve_recursion_limit)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// Calculate all the mid-points of the line segments
|
||||
//----------------------
|
||||
const double x12 = (x1 + x2) / 2;
|
||||
|
@ -294,16 +309,16 @@ void VSpline::PointBezier_r ( qreal x1, qreal y1, qreal x2, qreal y2,
|
|||
const double y234 = (y23 + y34) / 2;
|
||||
const double x1234 = (x123 + x234) / 2;
|
||||
const double y1234 = (y123 + y234) / 2;
|
||||
|
||||
|
||||
|
||||
|
||||
// Try to approximate the full cubic curve by a single straight line
|
||||
//------------------
|
||||
const double dx = x4-x1;
|
||||
const double dy = y4-y1;
|
||||
|
||||
|
||||
double d2 = fabs((x2 - x4) * dy - (y2 - y4) * dx);
|
||||
double d3 = fabs((x3 - x4) * dy - (y3 - y4) * dx);
|
||||
|
||||
|
||||
switch ((static_cast<int>(d2 > curve_collinearity_epsilon) << 1) +
|
||||
static_cast<int>(d3 > curve_collinearity_epsilon))
|
||||
{
|
||||
|
@ -531,13 +546,14 @@ void VSpline::PointBezier_r ( qreal x1, qreal y1, qreal x2, qreal y2,
|
|||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
// Continue subdivision
|
||||
//----------------------
|
||||
PointBezier_r(x1, y1, x12, y12, x123, y123, x1234, y1234, static_cast<qint16>(level + 1), px, py);
|
||||
PointBezier_r(x1234, y1234, x234, y234, x34, y34, x4, y4, static_cast<qint16>(level + 1), px, py);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
qreal VSpline::CalcSqDistance (qreal x1, qreal y1, qreal x2, qreal y2)
|
||||
{
|
||||
qreal dx = x2 - x1;
|
||||
|
@ -545,11 +561,13 @@ qreal VSpline::CalcSqDistance (qreal x1, qreal y1, qreal x2, qreal y2)
|
|||
return dx * dx + dy * dy;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VSpline::CreateName()
|
||||
{
|
||||
_name = QString("Spl_%1_%2").arg(this->GetP1().name(), this->GetP4().name());
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
QPainterPath VSpline::GetPath() const
|
||||
{
|
||||
QPainterPath splinePath;
|
||||
|
@ -569,6 +587,7 @@ QPainterPath VSpline::GetPath() const
|
|||
return splinePath;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
QVector<QPointF> VSpline::SplinePoints(const QPointF &p1, const QPointF &p4, qreal angle1, qreal angle2, qreal kAsm1,
|
||||
qreal kAsm2, qreal kCurve)
|
||||
{
|
||||
|
@ -586,6 +605,7 @@ QVector<QPointF> VSpline::SplinePoints(const QPointF &p1, const QPointF &p4, qre
|
|||
return GetPoints(p1, p2, p3, p4);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VSpline &VSpline::operator =(const VSpline &spline)
|
||||
{
|
||||
VGObject::operator=(spline);
|
||||
|
|
|
@ -29,17 +29,18 @@
|
|||
#include "vsplinepath.h"
|
||||
#include "../exception/vexception.h"
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VSplinePath::VSplinePath(qreal kCurve, quint32 idObject, Valentina::Draws mode)
|
||||
: VGObject(GObject::SplinePath, idObject, mode), path(QVector<VSplinePoint>()), kCurve(kCurve), maxCountPoints(0)
|
||||
{
|
||||
}
|
||||
{}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VSplinePath::VSplinePath(const VSplinePath &splPath)
|
||||
: VGObject(splPath), path(*splPath.GetPoint()), kCurve(splPath.getKCurve()),
|
||||
maxCountPoints(splPath.getMaxCountPoints())
|
||||
{
|
||||
}
|
||||
{}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VSplinePath::append(const VSplinePoint &point)
|
||||
{
|
||||
path.append(point);
|
||||
|
@ -51,6 +52,7 @@ void VSplinePath::append(const VSplinePoint &point)
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
qint32 VSplinePath::Count() const
|
||||
{
|
||||
if (path.size() == 0)
|
||||
|
@ -63,6 +65,7 @@ qint32 VSplinePath::Count() const
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VSpline VSplinePath::GetSpline(qint32 index) const
|
||||
{
|
||||
if (Count()<1)
|
||||
|
@ -78,6 +81,7 @@ VSpline VSplinePath::GetSpline(qint32 index) const
|
|||
return spl;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
QPainterPath VSplinePath::GetPath() const
|
||||
{
|
||||
QPainterPath painterPath;
|
||||
|
@ -90,6 +94,7 @@ QPainterPath VSplinePath::GetPath() const
|
|||
return painterPath;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
QVector<QPointF> VSplinePath::GetPathPoints() const
|
||||
{
|
||||
QVector<QPointF> pathPoints;
|
||||
|
@ -102,6 +107,7 @@ QVector<QPointF> VSplinePath::GetPathPoints() const
|
|||
return pathPoints;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
qreal VSplinePath::GetLength() const
|
||||
{
|
||||
qreal length = 0;
|
||||
|
@ -114,6 +120,7 @@ qreal VSplinePath::GetLength() const
|
|||
return length;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VSplinePath::UpdatePoint(qint32 indexSpline, const SplinePoint::Position &pos, const VSplinePoint &point)
|
||||
{
|
||||
if (indexSpline < 1 || indexSpline > Count())
|
||||
|
@ -130,6 +137,7 @@ void VSplinePath::UpdatePoint(qint32 indexSpline, const SplinePoint::Position &p
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VSplinePoint VSplinePath::GetSplinePoint(qint32 indexSpline, SplinePoint::Position pos) const
|
||||
{
|
||||
if (indexSpline < 1 || indexSpline > Count())
|
||||
|
@ -146,6 +154,7 @@ VSplinePoint VSplinePath::GetSplinePoint(qint32 indexSpline, SplinePoint::Positi
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VSplinePath &VSplinePath::operator =(const VSplinePath &path)
|
||||
{
|
||||
VGObject::operator=(path);
|
||||
|
@ -155,16 +164,19 @@ VSplinePath &VSplinePath::operator =(const VSplinePath &path)
|
|||
return *this;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VSplinePoint & VSplinePath::operator[](ptrdiff_t indx)
|
||||
{
|
||||
return path[indx];
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
const VSplinePoint &VSplinePath::at(ptrdiff_t indx) const
|
||||
{
|
||||
return path[indx];
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
QPointF VSplinePath::CutSplinePath(qreal length, qint32 &p1, qint32 &p2, QPointF &spl1p2, QPointF &spl1p3,
|
||||
QPointF &spl2p2, QPointF &spl2p3) const
|
||||
{
|
||||
|
@ -199,11 +211,14 @@ QPointF VSplinePath::CutSplinePath(qreal length, qint32 &p1, qint32 &p2, QPointF
|
|||
}
|
||||
return QPointF();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
qint32 VSplinePath::getMaxCountPoints() const
|
||||
{
|
||||
return maxCountPoints;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VSplinePath::setMaxCountPoints(const qint32 &value)
|
||||
{
|
||||
maxCountPoints = value;
|
||||
|
|
|
@ -29,9 +29,12 @@
|
|||
#include "vsplinepoint.h"
|
||||
#include <QDebug>
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VSplinePoint::VSplinePoint()
|
||||
:pSpline(VPointF()), angle1(0), angle2(180), kAsm1(1), kAsm2(1){}
|
||||
:pSpline(VPointF()), angle1(0), angle2(180), kAsm1(1), kAsm2(1)
|
||||
{}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VSplinePoint::VSplinePoint(VPointF pSpline, qreal kAsm1, qreal angle1, qreal kAsm2, qreal angle2)
|
||||
:pSpline(pSpline), angle1(0), angle2(180), kAsm1(kAsm1), kAsm2(kAsm2)
|
||||
{
|
||||
|
@ -42,9 +45,12 @@ VSplinePoint::VSplinePoint(VPointF pSpline, qreal kAsm1, qreal angle1, qreal kAs
|
|||
SetAngle2(angle2);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VSplinePoint::VSplinePoint(const VSplinePoint &point)
|
||||
:pSpline(point.P()), angle1(point.Angle1()), angle2(point.Angle2()), kAsm1(point.KAsm1()), kAsm2(point.KAsm2()){}
|
||||
:pSpline(point.P()), angle1(point.Angle1()), angle2(point.Angle2()), kAsm1(point.KAsm1()), kAsm2(point.KAsm2())
|
||||
{}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VSplinePoint::SetAngle1(const qreal &value)
|
||||
{
|
||||
QLineF line(0, 0, 100, 0);
|
||||
|
@ -55,6 +61,7 @@ void VSplinePoint::SetAngle1(const qreal &value)
|
|||
angle2 = line.angle();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VSplinePoint::SetAngle2(const qreal &value)
|
||||
{
|
||||
QLineF line(0, 0, 100, 0);
|
||||
|
|
|
@ -35,6 +35,7 @@
|
|||
#include "tablewindow.h"
|
||||
#include "version.h"
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void noisyFailureMsgHandler(QtMsgType type, const QMessageLogContext &context, const QString &msg)
|
||||
{
|
||||
// Why on earth didn't Qt want to make failed signal/slot connections qWarning?
|
||||
|
@ -116,6 +117,7 @@ void noisyFailureMsgHandler(QtMsgType type, const QMessageLogContext &context, c
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
Q_INIT_RESOURCE(cursor);
|
||||
|
|
|
@ -46,6 +46,7 @@
|
|||
#include <QFileDialog>
|
||||
#include <QSourceLocation>
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
MainWindow::MainWindow(QWidget *parent)
|
||||
:QMainWindow(parent), ui(new Ui::MainWindow), pattern(nullptr), doc(nullptr), tool(Valentina::ArrowTool),
|
||||
currentScene(nullptr), sceneDraw(nullptr), sceneDetails(nullptr), mouseCoordinate(nullptr), helpLabel(nullptr),
|
||||
|
@ -92,6 +93,7 @@ MainWindow::MainWindow(QWidget *parent)
|
|||
setCurrentFile("");
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void MainWindow::ActionNewDraw()
|
||||
{
|
||||
QString patternPieceName = QString(tr("Pattern piece %1")).arg(comboBoxDraws->count()+1);
|
||||
|
@ -180,6 +182,7 @@ void MainWindow::ActionNewDraw()
|
|||
&MainWindow::currentDrawChanged);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void MainWindow::OptionDraw()
|
||||
{
|
||||
const QString activDraw = doc->GetNameActivDraw();
|
||||
|
@ -198,6 +201,7 @@ void MainWindow::OptionDraw()
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
template <typename Dialog, typename Func>
|
||||
void MainWindow::SetToolButton(bool checked, Valentina::Tools t, const QString &cursor, const QString &toolTip,
|
||||
Func closeDialogSlot)
|
||||
|
@ -226,6 +230,7 @@ void MainWindow::SetToolButton(bool checked, Valentina::Tools t, const QString &
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
template <typename DrawTool>
|
||||
void MainWindow::ClosedDialog(int result)
|
||||
{
|
||||
|
@ -237,127 +242,150 @@ void MainWindow::ClosedDialog(int result)
|
|||
ArrowTool();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void MainWindow::ToolEndLine(bool checked)
|
||||
{
|
||||
SetToolButton<DialogEndLine>(checked, Valentina::EndLineTool, ":/cursor/endline_cursor.png", tr("Select point"),
|
||||
&MainWindow::ClosedDialogEndLine);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void MainWindow::ClosedDialogEndLine(int result)
|
||||
{
|
||||
ClosedDialog<VToolEndLine>(result);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void MainWindow::ToolLine(bool checked)
|
||||
{
|
||||
SetToolButton<DialogLine>(checked, Valentina::LineTool, ":/cursor/line_cursor.png", tr("Select first point"),
|
||||
&MainWindow::ClosedDialogLine);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void MainWindow::ClosedDialogLine(int result)
|
||||
{
|
||||
ClosedDialog<VToolLine>(result);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void MainWindow::ToolAlongLine(bool checked)
|
||||
{
|
||||
SetToolButton<DialogAlongLine>(checked, Valentina::AlongLineTool, ":/cursor/alongline_cursor.png",
|
||||
tr("Select point"), &MainWindow::ClosedDialogAlongLine);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void MainWindow::ClosedDialogAlongLine(int result)
|
||||
{
|
||||
ClosedDialog<VToolAlongLine>(result);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void MainWindow::ToolShoulderPoint(bool checked)
|
||||
{
|
||||
SetToolButton<DialogShoulderPoint>(checked, Valentina::ShoulderPointTool, ":/cursor/shoulder_cursor.png",
|
||||
tr("Select first point of line"), &MainWindow::ClosedDialogShoulderPoint);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void MainWindow::ClosedDialogShoulderPoint(int result)
|
||||
{
|
||||
ClosedDialog<VToolShoulderPoint>(result);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void MainWindow::ToolNormal(bool checked)
|
||||
{
|
||||
SetToolButton<DialogNormal>(checked, Valentina::NormalTool, ":/cursor/normal_cursor.png",
|
||||
tr("Select first point of line"), &MainWindow::ClosedDialogNormal);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void MainWindow::ClosedDialogNormal(int result)
|
||||
{
|
||||
ClosedDialog<VToolNormal>(result);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void MainWindow::ToolBisector(bool checked)
|
||||
{
|
||||
SetToolButton<DialogBisector>(checked, Valentina::BisectorTool, ":/cursor/bisector_cursor.png",
|
||||
tr("Select first point of angle"), &MainWindow::ClosedDialogBisector);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void MainWindow::ClosedDialogBisector(int result)
|
||||
{
|
||||
ClosedDialog<VToolBisector>(result);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void MainWindow::ToolLineIntersect(bool checked)
|
||||
{
|
||||
SetToolButton<DialogLineIntersect>(checked, Valentina::LineIntersectTool, ":/cursor/intersect_cursor.png",
|
||||
tr("Select first point of first line"), &MainWindow::ClosedDialogLineIntersect);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void MainWindow::ClosedDialogLineIntersect(int result)
|
||||
{
|
||||
ClosedDialog<VToolLineIntersect>(result);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void MainWindow::ToolSpline(bool checked)
|
||||
{
|
||||
SetToolButton<DialogSpline>(checked, Valentina::SplineTool, ":/cursor/spline_cursor.png",
|
||||
tr("Select first point curve"), &MainWindow::ClosedDialogSpline);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void MainWindow::ClosedDialogSpline(int result)
|
||||
{
|
||||
ClosedDialog<VToolSpline>(result);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void MainWindow::ToolCutSpline(bool checked)
|
||||
{
|
||||
SetToolButton<DialogCutSpline>(checked, Valentina::CutSplineTool, ":/cursor/spline_cut_point_cursor.png",
|
||||
tr("Select simple curve"), &MainWindow::ClosedDialogCutSpline);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void MainWindow::ClosedDialogCutSpline(int result)
|
||||
{
|
||||
ClosedDialog<VToolCutSpline>(result);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void MainWindow::ToolArc(bool checked)
|
||||
{
|
||||
SetToolButton<DialogArc>(checked, Valentina::ArcTool, ":/cursor/arc_cursor.png",
|
||||
tr("Select point of center of arc"), &MainWindow::ClosedDialogArc);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void MainWindow::ClosedDialogArc(int result)
|
||||
{
|
||||
ClosedDialog<VToolArc>(result);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void MainWindow::ToolSplinePath(bool checked)
|
||||
{
|
||||
SetToolButton<DialogSplinePath>(checked, Valentina::SplinePathTool, ":/cursor/splinepath_cursor.png",
|
||||
tr("Select point of curve path"), &MainWindow::ClosedDialogSplinePath);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void MainWindow::ClosedDialogSplinePath(int result)
|
||||
{
|
||||
ClosedDialog<VToolSplinePath>(result);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void MainWindow::ToolCutSplinePath(bool checked)
|
||||
{
|
||||
SetToolButton<DialogCutSplinePath>(checked, Valentina::CutSplinePathTool,
|
||||
|
@ -365,28 +393,33 @@ void MainWindow::ToolCutSplinePath(bool checked)
|
|||
&MainWindow::ClosedDialogCutSplinePath);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void MainWindow::ClosedDialogCutSplinePath(int result)
|
||||
{
|
||||
ClosedDialog<VToolCutSplinePath>(result);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void MainWindow::ToolPointOfContact(bool checked)
|
||||
{
|
||||
SetToolButton<DialogPointOfContact>(checked, Valentina::PointOfContact, ":/cursor/pointcontact_cursor.png",
|
||||
tr("Select first point of line"), &MainWindow::ClosedDialogPointOfContact);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void MainWindow::ClosedDialogPointOfContact(int result)
|
||||
{
|
||||
ClosedDialog<VToolPointOfContact>(result);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void MainWindow::ToolDetail(bool checked)
|
||||
{
|
||||
SetToolButton<DialogDetail>(checked, Valentina::DetailTool, "://cursor/new_detail_cursor.png",
|
||||
tr("Select points, arcs, curves clockwise."), &MainWindow::ClosedDialogDetail);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void MainWindow::ClosedDialogDetail(int result)
|
||||
{
|
||||
if (result == QDialog::Accepted)
|
||||
|
@ -397,28 +430,33 @@ void MainWindow::ClosedDialogDetail(int result)
|
|||
doc->FullUpdateTree();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void MainWindow::ToolHeight(bool checked)
|
||||
{
|
||||
SetToolButton<DialogHeight>(checked, Valentina::Height, ":/cursor/height_cursor.png", tr("Select base point"),
|
||||
&MainWindow::ClosedDialogHeight);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void MainWindow::ClosedDialogHeight(int result)
|
||||
{
|
||||
ClosedDialog<VToolHeight>(result);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void MainWindow::ToolTriangle(bool checked)
|
||||
{
|
||||
SetToolButton<DialogTriangle>(checked, Valentina::Triangle, ":/cursor/triangle_cursor.png",
|
||||
tr("Select first point of axis"), &MainWindow::ClosedDialogTriangle);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void MainWindow::ClosedDialogTriangle(int result)
|
||||
{
|
||||
ClosedDialog<VToolTriangle>(result);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void MainWindow::ToolPointOfIntersection(bool checked)
|
||||
{
|
||||
SetToolButton<DialogPointOfIntersection>(checked, Valentina::PointOfIntersection,
|
||||
|
@ -426,11 +464,13 @@ void MainWindow::ToolPointOfIntersection(bool checked)
|
|||
&MainWindow::ClosedDialogPointOfIntersection);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void MainWindow::ClosedDialogPointOfIntersection(int result)
|
||||
{
|
||||
ClosedDialog<VToolPointOfIntersection>(result);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void MainWindow::ToolUnionDetails(bool checked)
|
||||
{
|
||||
SetToolButton<DialogUnionDetails>(checked, Valentina::UnionDetails, ":/cursor/union_cursor.png",
|
||||
|
@ -439,23 +479,27 @@ void MainWindow::ToolUnionDetails(bool checked)
|
|||
disconnect(doc, &VPattern::FullUpdateFromFile, dialogTool, &DialogTool::UpdateList);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void MainWindow::ClosedDialogUnionDetails(int result)
|
||||
{
|
||||
ClosedDialog<VToolUnionDetails>(result);
|
||||
doc->FullUpdateTree();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void MainWindow::ToolCutArc(bool checked)
|
||||
{
|
||||
SetToolButton<DialogCutArc>(checked, Valentina::CutArcTool, ":/cursor/arc_cut_cursor.png", tr("Select arc"),
|
||||
&MainWindow::ClosedDialogCutArc);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void MainWindow::ClosedDialogCutArc(int result)
|
||||
{
|
||||
ClosedDialog<VToolCutArc>(result);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void MainWindow::About()
|
||||
{
|
||||
QDate date = QLocale(QLocale::C).toDate(QString(__DATE__).simplified(), QLatin1String("MMM d yyyy"));
|
||||
|
@ -468,22 +512,26 @@ void MainWindow::About()
|
|||
QMessageBox::about(this, tr("About Valentina"), about);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void MainWindow::AboutQt()
|
||||
{
|
||||
QMessageBox::aboutQt(this, tr("About Qt"));
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void MainWindow::ShowToolTip(const QString &toolTip)
|
||||
{
|
||||
helpLabel->setText(toolTip);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void MainWindow::tableClosed()
|
||||
{
|
||||
show();
|
||||
MinimumScrollBar();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void MainWindow::OpenRecentFile()
|
||||
{
|
||||
QAction *action = qobject_cast<QAction *>(sender());
|
||||
|
@ -493,12 +541,14 @@ void MainWindow::OpenRecentFile()
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void MainWindow::PatternProperties()
|
||||
{
|
||||
DialogPatternProperties proper(doc, this);
|
||||
proper.exec();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void MainWindow::showEvent( QShowEvent *event )
|
||||
{
|
||||
QMainWindow::showEvent( event );
|
||||
|
@ -518,6 +568,7 @@ void MainWindow::showEvent( QShowEvent *event )
|
|||
isInitialized = true;//first show windows are held
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void MainWindow::closeEvent(QCloseEvent *event)
|
||||
{
|
||||
if (MaybeSave())
|
||||
|
@ -531,6 +582,7 @@ void MainWindow::closeEvent(QCloseEvent *event)
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void MainWindow::ToolBarOption()
|
||||
{
|
||||
if (qApp->patternType() == Pattern::Standard)
|
||||
|
@ -566,6 +618,7 @@ void MainWindow::ToolBarOption()
|
|||
ui->toolBarOption->addWidget(mouseCoordinate);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void MainWindow::ToolBarDraws()
|
||||
{
|
||||
QLabel *labelPtternPieceName = new QLabel(tr("Pattern Piece: "));
|
||||
|
@ -592,6 +645,7 @@ void MainWindow::ToolBarDraws()
|
|||
ui->actionLayout->setEnabled(false);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void MainWindow::InitToolButtons()
|
||||
{
|
||||
connect(ui->toolButtonEndLine, &QToolButton::clicked, this, &MainWindow::ToolEndLine);
|
||||
|
@ -615,6 +669,7 @@ void MainWindow::InitToolButtons()
|
|||
connect(ui->toolButtonArcCutPoint, &QToolButton::clicked, this, &MainWindow::ToolCutArc);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void MainWindow::currentDrawChanged( int index )
|
||||
{
|
||||
if (index != -1)
|
||||
|
@ -634,6 +689,7 @@ void MainWindow::currentDrawChanged( int index )
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void MainWindow::mouseMove(const QPointF &scenePos)
|
||||
{
|
||||
QString string = QString("%1, %2").arg(static_cast<qint32>(qApp->fromPixel(scenePos.x())))
|
||||
|
@ -644,6 +700,7 @@ void MainWindow::mouseMove(const QPointF &scenePos)
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void MainWindow::CancelTool()
|
||||
{
|
||||
delete dialogTool;
|
||||
|
@ -757,6 +814,7 @@ void MainWindow::CancelTool()
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void MainWindow::ArrowTool()
|
||||
{
|
||||
CancelTool();
|
||||
|
@ -767,11 +825,13 @@ void MainWindow::ArrowTool()
|
|||
helpLabel->setText("");
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void MainWindow::ActionAroowTool()
|
||||
{
|
||||
ArrowTool();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void MainWindow::keyPressEvent ( QKeyEvent * event )
|
||||
{
|
||||
switch (event->key())
|
||||
|
@ -785,6 +845,7 @@ void MainWindow::keyPressEvent ( QKeyEvent * event )
|
|||
QMainWindow::keyPressEvent ( event );
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void MainWindow::SaveCurrentScene()
|
||||
{
|
||||
/*Save transform*/
|
||||
|
@ -796,6 +857,7 @@ void MainWindow::SaveCurrentScene()
|
|||
currentScene->setVerScrollBar(verScrollBar->value());
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void MainWindow::RestoreCurrentScene()
|
||||
{
|
||||
/*Set transform for current scene*/
|
||||
|
@ -807,6 +869,7 @@ void MainWindow::RestoreCurrentScene()
|
|||
verScrollBar->setValue(currentScene->getVerScrollBar());
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void MainWindow::ActionDraw(bool checked)
|
||||
{
|
||||
if (checked)
|
||||
|
@ -839,6 +902,7 @@ void MainWindow::ActionDraw(bool checked)
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void MainWindow::ActionDetails(bool checked)
|
||||
{
|
||||
if (checked)
|
||||
|
@ -873,6 +937,7 @@ void MainWindow::ActionDetails(bool checked)
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
bool MainWindow::SaveAs()
|
||||
{
|
||||
QString filters(tr("Pattern files (*.val)"));
|
||||
|
@ -899,6 +964,7 @@ bool MainWindow::SaveAs()
|
|||
return SavePattern(fileName);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
bool MainWindow::Save()
|
||||
{
|
||||
if (curFile.isEmpty())
|
||||
|
@ -918,6 +984,7 @@ bool MainWindow::Save()
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void MainWindow::Open()
|
||||
{
|
||||
if (MaybeSave())
|
||||
|
@ -943,6 +1010,7 @@ void MainWindow::Open()
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void MainWindow::Options()
|
||||
{
|
||||
ConfigDialog dlg(this);
|
||||
|
@ -952,6 +1020,7 @@ void MainWindow::Options()
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void MainWindow::Clear()
|
||||
{
|
||||
setCurrentFile("");
|
||||
|
@ -973,6 +1042,7 @@ void MainWindow::Clear()
|
|||
#endif
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void MainWindow::NewPattern()
|
||||
{
|
||||
QProcess *v = new QProcess(this);
|
||||
|
@ -980,12 +1050,14 @@ void MainWindow::NewPattern()
|
|||
delete v;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void MainWindow::PatternWasModified()
|
||||
{
|
||||
setWindowModified(doc->isPatternModified());
|
||||
ui->actionSave->setEnabled(true);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void MainWindow::ChangedSize(const QString & text)
|
||||
{
|
||||
qint32 size = text.toInt();
|
||||
|
@ -993,6 +1065,7 @@ void MainWindow::ChangedSize(const QString & text)
|
|||
doc->FullUpdateTree();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void MainWindow::ChangedHeight(const QString &text)
|
||||
{
|
||||
qint32 growth = text.toInt();
|
||||
|
@ -1000,6 +1073,7 @@ void MainWindow::ChangedHeight(const QString &text)
|
|||
doc->FullUpdateTree();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void MainWindow::SetEnableWidgets(bool enable)
|
||||
{
|
||||
ui->actionSaveAs->setEnabled(enable);
|
||||
|
@ -1014,6 +1088,7 @@ void MainWindow::SetEnableWidgets(bool enable)
|
|||
ui->actionHistory->setEnabled(enable);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void MainWindow::ActionTable(bool checked)
|
||||
{
|
||||
if (checked)
|
||||
|
@ -1029,6 +1104,7 @@ void MainWindow::ActionTable(bool checked)
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void MainWindow::ClosedActionTable()
|
||||
{
|
||||
ui->actionTable->setChecked(false);
|
||||
|
@ -1036,6 +1112,7 @@ void MainWindow::ClosedActionTable()
|
|||
dialogTable = nullptr;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void MainWindow::ActionHistory(bool checked)
|
||||
{
|
||||
if (checked)
|
||||
|
@ -1052,6 +1129,7 @@ void MainWindow::ActionHistory(bool checked)
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void MainWindow::ActionLayout(bool checked)
|
||||
{
|
||||
Q_UNUSED(checked);
|
||||
|
@ -1069,12 +1147,14 @@ void MainWindow::ActionLayout(bool checked)
|
|||
emit ModelChosen(listDetails, curFile, description);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void MainWindow::ClosedActionHistory()
|
||||
{
|
||||
ui->actionHistory->setChecked(false);
|
||||
delete dialogHistory;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void MainWindow::SetEnableTool(bool enable)
|
||||
{
|
||||
bool drawTools = false;
|
||||
|
@ -1111,6 +1191,7 @@ void MainWindow::SetEnableTool(bool enable)
|
|||
ui->toolButtonUnionDetails->setEnabled(modelingTools);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void MainWindow::MinimumScrollBar()
|
||||
{
|
||||
QScrollBar *horScrollBar = view->horizontalScrollBar();
|
||||
|
@ -1119,6 +1200,7 @@ void MainWindow::MinimumScrollBar()
|
|||
verScrollBar->setValue(verScrollBar->minimum());
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
bool MainWindow::SavePattern(const QString &fileName)
|
||||
{
|
||||
QFileInfo tempInfo(fileName);
|
||||
|
@ -1134,6 +1216,7 @@ bool MainWindow::SavePattern(const QString &fileName)
|
|||
return result;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void MainWindow::AutoSavePattern()
|
||||
{
|
||||
if (curFile.isEmpty() == false && doc->isPatternModified() == true)
|
||||
|
@ -1146,6 +1229,7 @@ void MainWindow::AutoSavePattern()
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void MainWindow::setCurrentFile(const QString &fileName)
|
||||
{
|
||||
curFile = fileName;
|
||||
|
@ -1176,6 +1260,7 @@ void MainWindow::setCurrentFile(const QString &fileName)
|
|||
setWindowTitle(shownName);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
QString MainWindow::strippedName(const QString &fullFileName)
|
||||
{
|
||||
return QFileInfo(fullFileName).fileName();
|
||||
|
@ -1191,6 +1276,7 @@ void MainWindow::ReadSettings()
|
|||
move(pos);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void MainWindow::WriteSettings()
|
||||
{
|
||||
QSettings settings(QSettings::IniFormat, QSettings::UserScope, QApplication::organizationName(),
|
||||
|
@ -1199,6 +1285,7 @@ void MainWindow::WriteSettings()
|
|||
settings.setValue("size", size());
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
bool MainWindow::MaybeSave()
|
||||
{
|
||||
if (doc->isPatternModified())
|
||||
|
@ -1219,6 +1306,7 @@ bool MainWindow::MaybeSave()
|
|||
return true;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void MainWindow::UpdateRecentFileActions()
|
||||
{
|
||||
QSettings settings(QSettings::IniFormat, QSettings::UserScope, QApplication::organizationName(),
|
||||
|
@ -1242,6 +1330,7 @@ void MainWindow::UpdateRecentFileActions()
|
|||
separatorAct->setVisible(numRecentFiles > 0);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void MainWindow::CreateMenus()
|
||||
{
|
||||
for (int i = 0; i < MaxRecentFiles; ++i)
|
||||
|
@ -1254,6 +1343,7 @@ void MainWindow::CreateMenus()
|
|||
UpdateRecentFileActions();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void MainWindow::CreateActions()
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
@ -1284,6 +1374,7 @@ void MainWindow::CreateActions()
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void MainWindow::InitAutoSave()
|
||||
{
|
||||
//Autosaving file each 5 minutes
|
||||
|
@ -1309,6 +1400,7 @@ void MainWindow::InitAutoSave()
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
QString MainWindow::PatternPieceName(const QString &text)
|
||||
{
|
||||
QInputDialog *dlg = new QInputDialog(this);
|
||||
|
@ -1337,6 +1429,7 @@ QString MainWindow::PatternPieceName(const QString &text)
|
|||
return nameDraw;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
MainWindow::~MainWindow()
|
||||
{
|
||||
CancelTool();
|
||||
|
@ -1348,6 +1441,7 @@ MainWindow::~MainWindow()
|
|||
delete sceneDraw;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void MainWindow::LoadPattern(const QString &fileName)
|
||||
{
|
||||
try
|
||||
|
@ -1470,6 +1564,7 @@ void MainWindow::LoadPattern(const QString &fileName)
|
|||
helpLabel->setText(tr("File loaded"));
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
QString MainWindow::CheckPathToMeasurements(const QString &path, const Pattern::Measurements &patternType)
|
||||
{
|
||||
QFile table(path);
|
||||
|
|
|
@ -33,6 +33,7 @@
|
|||
#include <QPrinter>
|
||||
#include "widgets/vapplication.h"
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
TableWindow::TableWindow(QWidget *parent)
|
||||
:QMainWindow(parent), numberDetal(nullptr), colission(nullptr), ui(new Ui::TableWindow),
|
||||
listDetails(QVector<VItem*>()), outItems(false), collidingItems(false), tableScene(nullptr),
|
||||
|
@ -67,12 +68,14 @@ TableWindow::TableWindow(QWidget *parent)
|
|||
connect(view, &VTableGraphicsView::itemChect, this, &TableWindow::itemChect);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
TableWindow::~TableWindow()
|
||||
{
|
||||
delete tableScene;
|
||||
delete ui;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void TableWindow::AddPaper()
|
||||
{
|
||||
qreal x1, y1, x2, y2;
|
||||
|
@ -87,6 +90,7 @@ void TableWindow::AddPaper()
|
|||
qDebug()<<paper->rect().size().toSize();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void TableWindow::AddDetail()
|
||||
{
|
||||
if (indexDetail<listDetails.count())
|
||||
|
@ -115,6 +119,7 @@ void TableWindow::AddDetail()
|
|||
numberDetal->setText(QString(tr("%1 details left.")).arg(listDetails.count()-indexDetail));
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
/*
|
||||
* Get details for creation layout.
|
||||
*/
|
||||
|
@ -142,12 +147,14 @@ void TableWindow::ModelChosen(QVector<VItem*> listDetails, const QString &fileNa
|
|||
show();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void TableWindow::closeEvent(QCloseEvent *event)
|
||||
{
|
||||
event->ignore();
|
||||
StopTable();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void TableWindow::moveToCenter()
|
||||
{
|
||||
QRect rect = frameGeometry();
|
||||
|
@ -155,12 +162,14 @@ void TableWindow::moveToCenter()
|
|||
move(rect.topLeft());
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void TableWindow::showEvent ( QShowEvent * event )
|
||||
{
|
||||
QMainWindow::showEvent(event);
|
||||
moveToCenter();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void TableWindow::StopTable()
|
||||
{
|
||||
hide();
|
||||
|
@ -172,6 +181,7 @@ void TableWindow::StopTable()
|
|||
emit closed();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void TableWindow::saveScene()
|
||||
{
|
||||
QMap<QString, QString> extByMessage;
|
||||
|
@ -251,12 +261,14 @@ void TableWindow::saveScene()
|
|||
delete brush;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void TableWindow::itemChect(bool flag)
|
||||
{
|
||||
ui->actionTurn->setDisabled(flag);
|
||||
ui->actionMirror->setDisabled(flag);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void TableWindow::checkNext()
|
||||
{
|
||||
if (outItems == true && collidingItems == true)
|
||||
|
@ -281,6 +293,7 @@ void TableWindow::checkNext()
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void TableWindow::itemOut(int number, bool flag)
|
||||
{
|
||||
listOutItems->setBit(number, flag);
|
||||
|
@ -298,6 +311,7 @@ void TableWindow::itemOut(int number, bool flag)
|
|||
checkNext();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void TableWindow::itemColliding(QList<QGraphicsItem *> list, int number)
|
||||
{
|
||||
//qDebug()<<"number="<<number;
|
||||
|
@ -364,11 +378,13 @@ void TableWindow::itemColliding(QList<QGraphicsItem *> list, int number)
|
|||
checkNext();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void TableWindow::GetNextDetail()
|
||||
{
|
||||
AddDetail();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void TableWindow::AddLength()
|
||||
{
|
||||
QRectF rect = tableScene->sceneRect();
|
||||
|
@ -384,6 +400,7 @@ void TableWindow::AddLength()
|
|||
emit LengthChanged();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void TableWindow::RemoveLength()
|
||||
{
|
||||
if (sceneRect.height() <= tableScene->sceneRect().height() - 100)
|
||||
|
@ -409,6 +426,7 @@ void TableWindow::RemoveLength()
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void TableWindow::keyPressEvent ( QKeyEvent * event )
|
||||
{
|
||||
if ( event->key() == Qt::Key_Enter || event->key() == Qt::Key_Return )
|
||||
|
@ -422,7 +440,7 @@ void TableWindow::keyPressEvent ( QKeyEvent * event )
|
|||
QMainWindow::keyPressEvent ( event );
|
||||
}
|
||||
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void TableWindow::SvgFile(const QString &name) const
|
||||
{
|
||||
QSvgGenerator generator;
|
||||
|
@ -442,6 +460,7 @@ void TableWindow::SvgFile(const QString &name) const
|
|||
painter.end();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void TableWindow::PngFile(const QString &name) const
|
||||
{
|
||||
QRectF r = paper->rect();
|
||||
|
@ -459,6 +478,7 @@ void TableWindow::PngFile(const QString &name) const
|
|||
image.save(name);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void TableWindow::PdfFile(const QString &name) const
|
||||
{
|
||||
QPrinter printer;
|
||||
|
@ -483,6 +503,7 @@ void TableWindow::PdfFile(const QString &name) const
|
|||
painter.end();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void TableWindow::EpsFile(const QString &name) const
|
||||
{
|
||||
QTemporaryFile tmp;
|
||||
|
@ -497,6 +518,7 @@ void TableWindow::EpsFile(const QString &name) const
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void TableWindow::PsFile(const QString &name) const
|
||||
{
|
||||
QTemporaryFile tmp;
|
||||
|
@ -511,6 +533,7 @@ void TableWindow::PsFile(const QString &name) const
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void TableWindow::PdfToPs(const QStringList ¶ms) const
|
||||
{
|
||||
#ifndef QT_NO_CURSOR
|
||||
|
|
|
@ -31,17 +31,20 @@
|
|||
|
||||
const QString VAbstractSpline::TagName = QStringLiteral("spline");
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VAbstractSpline::VAbstractSpline(VPattern *doc, VContainer *data, quint32 id, QGraphicsItem *parent)
|
||||
:VDrawTool(doc, data, id), QGraphicsPathItem(parent), controlPoints(QVector<VControlPointSpline *>())
|
||||
{
|
||||
ignoreFullUpdate = true;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VAbstractSpline::FullUpdateFromFile()
|
||||
{
|
||||
RefreshGeometry();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VAbstractSpline::ChangedActivDraw(const QString &newName)
|
||||
{
|
||||
bool selectable = false;
|
||||
|
@ -62,17 +65,20 @@ void VAbstractSpline::ChangedActivDraw(const QString &newName)
|
|||
VDrawTool::ChangedActivDraw(newName);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VAbstractSpline::ShowTool(quint32 id, Qt::GlobalColor color, bool enable)
|
||||
{
|
||||
ShowItem(this, id, color, enable);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VAbstractSpline::SetFactor(qreal factor)
|
||||
{
|
||||
VDrawTool::SetFactor(factor);
|
||||
RefreshGeometry();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
// cppcheck-suppress unusedFunction
|
||||
void VAbstractSpline::hoverMoveEvent(QGraphicsSceneHoverEvent *event)
|
||||
{
|
||||
|
@ -80,6 +86,7 @@ void VAbstractSpline::hoverMoveEvent(QGraphicsSceneHoverEvent *event)
|
|||
this->setPen(QPen(currentColor, qApp->toPixel(qApp->widthMainLine())/factor));
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
// cppcheck-suppress unusedFunction
|
||||
void VAbstractSpline::hoverLeaveEvent(QGraphicsSceneHoverEvent *event)
|
||||
{
|
||||
|
@ -87,6 +94,7 @@ void VAbstractSpline::hoverLeaveEvent(QGraphicsSceneHoverEvent *event)
|
|||
this->setPen(QPen(currentColor, qApp->toPixel(qApp->widthHairLine())/factor));
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
QVariant VAbstractSpline::itemChange(QGraphicsItem::GraphicsItemChange change, const QVariant &value)
|
||||
{
|
||||
if (change == QGraphicsItem::ItemSelectedChange)
|
||||
|
@ -105,6 +113,7 @@ QVariant VAbstractSpline::itemChange(QGraphicsItem::GraphicsItemChange change, c
|
|||
return QGraphicsItem::itemChange(change, value);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VAbstractSpline::keyReleaseEvent(QKeyEvent *event)
|
||||
{
|
||||
switch (event->key())
|
||||
|
|
|
@ -30,6 +30,7 @@
|
|||
|
||||
qreal VDrawTool::factor = 1;
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VDrawTool::VDrawTool(VPattern *doc, VContainer *data, quint32 id)
|
||||
:VAbstractTool(doc, data, id), ignoreContextMenuEvent(false), ignoreFullUpdate(false),
|
||||
nameActivDraw(doc->GetNameActivDraw()), dialog(nullptr)
|
||||
|
@ -39,11 +40,13 @@ VDrawTool::VDrawTool(VPattern *doc, VContainer *data, quint32 id)
|
|||
connect(this->doc, &VPattern::ShowTool, this, &VDrawTool::ShowTool);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VDrawTool::~VDrawTool()
|
||||
{
|
||||
delete dialog;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VDrawTool::ShowTool(quint32 id, Qt::GlobalColor color, bool enable)
|
||||
{
|
||||
Q_UNUSED(id);
|
||||
|
@ -51,6 +54,7 @@ void VDrawTool::ShowTool(quint32 id, Qt::GlobalColor color, bool enable)
|
|||
Q_UNUSED(enable);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VDrawTool::ChangedActivDraw(const QString &newName)
|
||||
{
|
||||
if (nameActivDraw == newName)
|
||||
|
@ -63,6 +67,7 @@ void VDrawTool::ChangedActivDraw(const QString &newName)
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VDrawTool::ChangedNameDraw(const QString &oldName, const QString &newName)
|
||||
{
|
||||
if (nameActivDraw == oldName)
|
||||
|
@ -71,6 +76,7 @@ void VDrawTool::ChangedNameDraw(const QString &oldName, const QString &newName)
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VDrawTool::FullUpdateFromGui(int result)
|
||||
{
|
||||
if (result == QDialog::Accepted)
|
||||
|
@ -88,6 +94,7 @@ void VDrawTool::FullUpdateFromGui(int result)
|
|||
dialog = nullptr;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VDrawTool::SetFactor(qreal factor)
|
||||
{
|
||||
if (factor <= 2 && factor >= 0.5)
|
||||
|
@ -96,6 +103,7 @@ void VDrawTool::SetFactor(qreal factor)
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VDrawTool::AddToCalculation(const QDomElement &domElement)
|
||||
{
|
||||
QDomElement calcElement;
|
||||
|
|
|
@ -32,6 +32,7 @@
|
|||
|
||||
const QString VToolAlongLine::ToolType = QStringLiteral("alongLine");
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VToolAlongLine::VToolAlongLine(VPattern *doc, VContainer *data, quint32 id, const QString &formula,
|
||||
const quint32 &firstPointId, const quint32 &secondPointId,
|
||||
const QString &typeLine, const Valentina::Sources &typeCreation,
|
||||
|
@ -49,6 +50,7 @@ VToolAlongLine::VToolAlongLine(VPattern *doc, VContainer *data, quint32 id, cons
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolAlongLine::FullUpdateFromFile()
|
||||
{
|
||||
QDomElement domElement = doc->elementById(QString().setNum(id));
|
||||
|
@ -62,23 +64,27 @@ void VToolAlongLine::FullUpdateFromFile()
|
|||
RefreshGeometry();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolAlongLine::SetFactor(qreal factor)
|
||||
{
|
||||
VDrawTool::SetFactor(factor);
|
||||
RefreshGeometry();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
//cppcheck-suppress unusedFunction
|
||||
void VToolAlongLine::contextMenuEvent(QGraphicsSceneContextMenuEvent *event)
|
||||
{
|
||||
ContextMenu<DialogAlongLine>(this, event);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolAlongLine::ShowContextMenu(QGraphicsSceneContextMenuEvent *event)
|
||||
{
|
||||
ContextMenu<DialogAlongLine>(this, event);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolAlongLine::AddToFile()
|
||||
{
|
||||
const VPointF *point = VAbstractTool::data.GeometricObject<const VPointF *>(id);
|
||||
|
@ -98,6 +104,7 @@ void VToolAlongLine::AddToFile()
|
|||
AddToCalculation(domElement);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolAlongLine::RefreshDataInFile()
|
||||
{
|
||||
const VPointF *point = VAbstractTool::data.GeometricObject<const VPointF *>(id);
|
||||
|
@ -114,12 +121,14 @@ void VToolAlongLine::RefreshDataInFile()
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolAlongLine::RemoveReferens()
|
||||
{
|
||||
doc->DecrementReferens(secondPointId);
|
||||
VToolLinePoint::RemoveReferens();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolAlongLine::SaveDialog(QDomElement &domElement)
|
||||
{
|
||||
Q_CHECK_PTR(dialog);
|
||||
|
@ -132,6 +141,7 @@ void VToolAlongLine::SaveDialog(QDomElement &domElement)
|
|||
doc->SetAttribute(domElement, AttrSecondPoint, dialogTool->getSecondPointId());
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolAlongLine::setDialog()
|
||||
{
|
||||
Q_CHECK_PTR(dialog);
|
||||
|
@ -145,6 +155,7 @@ void VToolAlongLine::setDialog()
|
|||
dialogTool->setPointName(p->name());
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolAlongLine::Create(DialogTool *dialog, VMainGraphicsScene *scene, VPattern *doc, VContainer *data)
|
||||
{
|
||||
Q_CHECK_PTR(dialog);
|
||||
|
@ -159,6 +170,7 @@ void VToolAlongLine::Create(DialogTool *dialog, VMainGraphicsScene *scene, VPatt
|
|||
Document::FullParse, Valentina::FromGui);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolAlongLine::Create(const quint32 _id, const QString &pointName, const QString &typeLine,
|
||||
const QString &formula, const quint32 &firstPointId, const quint32 &secondPointId,
|
||||
const qreal &mx, const qreal &my, VMainGraphicsScene *scene, VPattern *doc,
|
||||
|
|
|
@ -34,6 +34,7 @@
|
|||
const QString VToolArc::TagName = QStringLiteral("arc");
|
||||
const QString VToolArc::ToolType = QStringLiteral("simple");
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VToolArc::VToolArc(VPattern *doc, VContainer *data, quint32 id, const Valentina::Sources &typeCreation,
|
||||
QGraphicsItem *parent)
|
||||
:VDrawTool(doc, data, id), QGraphicsPathItem(parent)
|
||||
|
@ -58,6 +59,7 @@ VToolArc::VToolArc(VPattern *doc, VContainer *data, quint32 id, const Valentina:
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolArc::setDialog()
|
||||
{
|
||||
Q_CHECK_PTR(dialog);
|
||||
|
@ -70,6 +72,7 @@ void VToolArc::setDialog()
|
|||
dialogTool->SetRadius(arc->GetFormulaRadius());
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolArc::Create(DialogTool *dialog, VMainGraphicsScene *scene, VPattern *doc,
|
||||
VContainer *data)
|
||||
{
|
||||
|
@ -83,6 +86,7 @@ void VToolArc::Create(DialogTool *dialog, VMainGraphicsScene *scene, VPattern *d
|
|||
Create(0, center, radius, f1, f2, scene, doc, data, Document::FullParse, Valentina::FromGui);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolArc::Create(const quint32 _id, const quint32 ¢er, const QString &radius, const QString &f1,
|
||||
const QString &f2, VMainGraphicsScene *scene, VPattern *doc, VContainer *data,
|
||||
const Document::Documents &parse, const Valentina::Sources &typeCreation)
|
||||
|
@ -138,11 +142,13 @@ void VToolArc::Create(const quint32 _id, const quint32 ¢er, const QString &r
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolArc::FullUpdateFromFile()
|
||||
{
|
||||
RefreshGeometry();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolArc::ChangedActivDraw(const QString &newName)
|
||||
{
|
||||
bool selectable = false;
|
||||
|
@ -162,22 +168,26 @@ void VToolArc::ChangedActivDraw(const QString &newName)
|
|||
VDrawTool::ChangedActivDraw(newName);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolArc::ShowTool(quint32 id, Qt::GlobalColor color, bool enable)
|
||||
{
|
||||
ShowItem(this, id, color, enable);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolArc::SetFactor(qreal factor)
|
||||
{
|
||||
VDrawTool::SetFactor(factor);
|
||||
RefreshGeometry();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolArc::contextMenuEvent(QGraphicsSceneContextMenuEvent *event)
|
||||
{
|
||||
ContextMenu<DialogArc>(this, event);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolArc::AddToFile()
|
||||
{
|
||||
const VArc *arc = VAbstractTool::data.GeometricObject<const VArc *>(id);
|
||||
|
@ -193,6 +203,7 @@ void VToolArc::AddToFile()
|
|||
AddToCalculation(domElement);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolArc::RefreshDataInFile()
|
||||
{
|
||||
const VArc *arc = VAbstractTool::data.GeometricObject<const VArc *>(id);
|
||||
|
@ -206,6 +217,7 @@ void VToolArc::RefreshDataInFile()
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolArc::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
|
||||
{
|
||||
if (event->button() == Qt::LeftButton)
|
||||
|
@ -215,6 +227,7 @@ void VToolArc::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
|
|||
QGraphicsItem::mouseReleaseEvent(event);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
//cppcheck-suppress unusedFunction
|
||||
void VToolArc::hoverMoveEvent(QGraphicsSceneHoverEvent *event)
|
||||
{
|
||||
|
@ -222,6 +235,7 @@ void VToolArc::hoverMoveEvent(QGraphicsSceneHoverEvent *event)
|
|||
this->setPen(QPen(currentColor, qApp->toPixel(qApp->widthMainLine())/factor));
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
//cppcheck-suppress unusedFunction
|
||||
void VToolArc::hoverLeaveEvent(QGraphicsSceneHoverEvent *event)
|
||||
{
|
||||
|
@ -229,12 +243,14 @@ void VToolArc::hoverLeaveEvent(QGraphicsSceneHoverEvent *event)
|
|||
this->setPen(QPen(currentColor, qApp->toPixel(qApp->widthHairLine())/factor));
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolArc::RemoveReferens()
|
||||
{
|
||||
const VArc *arc = VAbstractTool::data.GeometricObject<const VArc *>(id);
|
||||
doc->DecrementReferens(arc->GetCenter().id());
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
QVariant VToolArc::itemChange(QGraphicsItem::GraphicsItemChange change, const QVariant &value)
|
||||
{
|
||||
if (change == QGraphicsItem::ItemSelectedChange)
|
||||
|
@ -253,6 +269,7 @@ QVariant VToolArc::itemChange(QGraphicsItem::GraphicsItemChange change, const QV
|
|||
return QGraphicsItem::itemChange(change, value);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolArc::keyReleaseEvent(QKeyEvent *event)
|
||||
{
|
||||
switch (event->key())
|
||||
|
@ -266,6 +283,7 @@ void VToolArc::keyReleaseEvent(QKeyEvent *event)
|
|||
QGraphicsItem::keyReleaseEvent ( event );
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolArc::SaveDialog(QDomElement &domElement)
|
||||
{
|
||||
Q_CHECK_PTR(dialog);
|
||||
|
@ -277,6 +295,7 @@ void VToolArc::SaveDialog(QDomElement &domElement)
|
|||
doc->SetAttribute(domElement, AttrAngle2, dialogTool->GetF2());
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolArc::RefreshGeometry()
|
||||
{
|
||||
this->setPen(QPen(currentColor, qApp->toPixel(qApp->widthHairLine())/factor));
|
||||
|
|
|
@ -32,6 +32,7 @@
|
|||
|
||||
const QString VToolBisector::ToolType = QStringLiteral("bisector");
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VToolBisector::VToolBisector(VPattern *doc, VContainer *data, const quint32 &id, const QString &typeLine,
|
||||
const QString &formula, const quint32 &firstPointId, const quint32 &secondPointId,
|
||||
const quint32 &thirdPointId, const Valentina::Sources &typeCreation, QGraphicsItem *parent)
|
||||
|
@ -50,6 +51,7 @@ VToolBisector::VToolBisector(VPattern *doc, VContainer *data, const quint32 &id,
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
QPointF VToolBisector::FindPoint(const QPointF &firstPoint, const QPointF &secondPoint,
|
||||
const QPointF &thirdPoint, const qreal &length)
|
||||
{
|
||||
|
@ -69,6 +71,7 @@ QPointF VToolBisector::FindPoint(const QPointF &firstPoint, const QPointF &secon
|
|||
return line1.p2();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolBisector::setDialog()
|
||||
{
|
||||
Q_CHECK_PTR(dialog);
|
||||
|
@ -83,6 +86,7 @@ void VToolBisector::setDialog()
|
|||
dialogTool->setPointName(p->name());
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolBisector::Create(DialogTool *dialog, VMainGraphicsScene *scene, VPattern *doc,
|
||||
VContainer *data)
|
||||
{
|
||||
|
@ -99,6 +103,7 @@ void VToolBisector::Create(DialogTool *dialog, VMainGraphicsScene *scene, VPatte
|
|||
Document::FullParse, Valentina::FromGui);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolBisector::Create(const quint32 _id, const QString &formula, const quint32 &firstPointId,
|
||||
const quint32 &secondPointId, const quint32 &thirdPointId, const QString &typeLine,
|
||||
const QString &pointName, const qreal &mx, const qreal &my,
|
||||
|
@ -147,6 +152,7 @@ void VToolBisector::Create(const quint32 _id, const QString &formula, const quin
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolBisector::FullUpdateFromFile()
|
||||
{
|
||||
QDomElement domElement = doc->elementById(QString().setNum(id));
|
||||
|
@ -161,22 +167,26 @@ void VToolBisector::FullUpdateFromFile()
|
|||
RefreshGeometry();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolBisector::SetFactor(qreal factor)
|
||||
{
|
||||
VDrawTool::SetFactor(factor);
|
||||
RefreshGeometry();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolBisector::ShowContextMenu(QGraphicsSceneContextMenuEvent *event)
|
||||
{
|
||||
ContextMenu<DialogBisector>(this, event);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolBisector::contextMenuEvent(QGraphicsSceneContextMenuEvent *event)
|
||||
{
|
||||
ContextMenu<DialogBisector>(this, event);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolBisector::AddToFile()
|
||||
{
|
||||
const VPointF *point = VAbstractTool::data.GeometricObject<const VPointF *>(id);
|
||||
|
@ -197,6 +207,7 @@ void VToolBisector::AddToFile()
|
|||
AddToCalculation(domElement);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolBisector::RefreshDataInFile()
|
||||
{
|
||||
const VPointF *point = VAbstractTool::data.GeometricObject<const VPointF *>(id);
|
||||
|
@ -214,6 +225,7 @@ void VToolBisector::RefreshDataInFile()
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolBisector::RemoveReferens()
|
||||
{
|
||||
doc->DecrementReferens(firstPointId);
|
||||
|
@ -221,6 +233,7 @@ void VToolBisector::RemoveReferens()
|
|||
VToolLinePoint::RemoveReferens();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolBisector::SaveDialog(QDomElement &domElement)
|
||||
{
|
||||
Q_CHECK_PTR(dialog);
|
||||
|
|
|
@ -33,6 +33,7 @@
|
|||
const QString VToolCutArc::ToolType = QStringLiteral("cutArc");
|
||||
const QString VToolCutArc::AttrArc = QStringLiteral("arc");
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VToolCutArc::VToolCutArc(VPattern *doc, VContainer *data, const quint32 &id, const QString &formula,
|
||||
const quint32 &arcId, const quint32 &arc1id, const quint32 &arc2id,
|
||||
const Valentina::Sources &typeCreation, QGraphicsItem * parent)
|
||||
|
@ -63,6 +64,7 @@ VToolCutArc::VToolCutArc(VPattern *doc, VContainer *data, const quint32 &id, con
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolCutArc::setDialog()
|
||||
{
|
||||
Q_CHECK_PTR(dialog);
|
||||
|
@ -74,6 +76,7 @@ void VToolCutArc::setDialog()
|
|||
dialogTool->setPointName(point->name());
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolCutArc::Create(DialogTool *dialog, VMainGraphicsScene *scene, VPattern *doc,
|
||||
VContainer *data)
|
||||
{
|
||||
|
@ -86,6 +89,7 @@ void VToolCutArc::Create(DialogTool *dialog, VMainGraphicsScene *scene, VPattern
|
|||
Create(0, pointName, formula, arcId, 5, 10, scene, doc, data, Document::FullParse, Valentina::FromGui);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolCutArc::Create(const quint32 _id, const QString &pointName, const QString &formula, const quint32 &arcId,
|
||||
const qreal &mx, const qreal &my, VMainGraphicsScene *scene, VPattern *doc,
|
||||
VContainer *data, const Document::Documents &parse, const Valentina::Sources &typeCreation)
|
||||
|
@ -151,6 +155,7 @@ void VToolCutArc::Create(const quint32 _id, const QString &pointName, const QStr
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolCutArc::FullUpdateFromFile()
|
||||
{
|
||||
QDomElement domElement = doc->elementById(QString().setNum(id));
|
||||
|
@ -162,11 +167,13 @@ void VToolCutArc::FullUpdateFromFile()
|
|||
RefreshGeometry();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolCutArc::ArcChoosed(quint32 id)
|
||||
{
|
||||
emit ChoosedTool(id, Valentina::Arc);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolCutArc::ChangedActivDraw(const QString &newName)
|
||||
{
|
||||
if (nameActivDraw == newName)
|
||||
|
@ -190,16 +197,19 @@ void VToolCutArc::ChangedActivDraw(const QString &newName)
|
|||
VToolPoint::ChangedActivDraw(newName);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolCutArc::ShowContextMenu(QGraphicsSceneContextMenuEvent *event)
|
||||
{
|
||||
ContextMenu<DialogCutArc>(this, event);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolCutArc::contextMenuEvent(QGraphicsSceneContextMenuEvent *event)
|
||||
{
|
||||
ContextMenu<DialogCutArc>(this, event);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolCutArc::AddToFile()
|
||||
{
|
||||
const VPointF *point = VAbstractTool::data.GeometricObject<const VPointF *>(id);
|
||||
|
@ -217,6 +227,7 @@ void VToolCutArc::AddToFile()
|
|||
AddToCalculation(domElement);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolCutArc::RefreshDataInFile()
|
||||
{
|
||||
const VPointF *point = VAbstractTool::data.GeometricObject<const VPointF *>(id);
|
||||
|
@ -231,6 +242,7 @@ void VToolCutArc::RefreshDataInFile()
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolCutArc::RefreshGeometry()
|
||||
{
|
||||
RefreshArc(firstArc, arc1id, SimpleArc::ForthPoint);
|
||||
|
@ -238,6 +250,7 @@ void VToolCutArc::RefreshGeometry()
|
|||
VToolPoint::RefreshPointGeometry(*VDrawTool::data.GeometricObject<const VPointF *>(id));
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolCutArc::SaveDialog(QDomElement &domElement)
|
||||
{
|
||||
Q_CHECK_PTR(dialog);
|
||||
|
@ -248,6 +261,7 @@ void VToolCutArc::SaveDialog(QDomElement &domElement)
|
|||
doc->SetAttribute(domElement, AttrArc, QString().setNum(dialogTool->getArcId()));
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolCutArc::RefreshArc(VSimpleArc *sArc, quint32 arcid, SimpleArc::Translation tr)
|
||||
{
|
||||
const VArc *arc = VAbstractTool::data.GeometricObject<const VArc *>(arcid);
|
||||
|
|
|
@ -33,6 +33,7 @@
|
|||
const QString VToolCutSpline::ToolType = QStringLiteral("cutSpline");
|
||||
const QString VToolCutSpline::AttrSpline = QStringLiteral("spline");
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VToolCutSpline::VToolCutSpline(VPattern *doc, VContainer *data, const quint32 &id, const QString &formula,
|
||||
const quint32 &splineId, const quint32 &spl1id, const quint32 &spl2id,
|
||||
const Valentina::Sources &typeCreation, QGraphicsItem *parent)
|
||||
|
@ -63,6 +64,7 @@ VToolCutSpline::VToolCutSpline(VPattern *doc, VContainer *data, const quint32 &i
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolCutSpline::setDialog()
|
||||
{
|
||||
Q_CHECK_PTR(dialog);
|
||||
|
@ -74,6 +76,7 @@ void VToolCutSpline::setDialog()
|
|||
dialogTool->setPointName(point->name());
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolCutSpline::Create(DialogTool *dialog, VMainGraphicsScene *scene,
|
||||
VPattern *doc, VContainer *data)
|
||||
{
|
||||
|
@ -86,6 +89,7 @@ void VToolCutSpline::Create(DialogTool *dialog, VMainGraphicsScene *scene,
|
|||
Create(0, pointName, formula, splineId, 5, 10, scene, doc, data, Document::FullParse, Valentina::FromGui);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolCutSpline::Create(const quint32 _id, const QString &pointName,
|
||||
const QString &formula, const quint32 &splineId, const qreal &mx, const qreal &my,
|
||||
VMainGraphicsScene *scene, VPattern *doc, VContainer *data,
|
||||
|
@ -152,6 +156,7 @@ void VToolCutSpline::Create(const quint32 _id, const QString &pointName,
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolCutSpline::FullUpdateFromFile()
|
||||
{
|
||||
QDomElement domElement = doc->elementById(QString().setNum(id));
|
||||
|
@ -163,11 +168,13 @@ void VToolCutSpline::FullUpdateFromFile()
|
|||
RefreshGeometry();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolCutSpline::SplineChoosed(quint32 id)
|
||||
{
|
||||
emit ChoosedTool(id, Valentina::Spline);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolCutSpline::ChangedActivDraw(const QString &newName)
|
||||
{
|
||||
bool flag = true;
|
||||
|
@ -186,16 +193,19 @@ void VToolCutSpline::ChangedActivDraw(const QString &newName)
|
|||
VToolPoint::ChangedActivDraw(newName);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolCutSpline::ShowContextMenu(QGraphicsSceneContextMenuEvent *event)
|
||||
{
|
||||
ContextMenu<DialogCutSpline>(this, event);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolCutSpline::contextMenuEvent(QGraphicsSceneContextMenuEvent *event)
|
||||
{
|
||||
ContextMenu<DialogCutSpline>(this, event);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolCutSpline::AddToFile()
|
||||
{
|
||||
const VPointF *point = VAbstractTool::data.GeometricObject<const VPointF *>(id);
|
||||
|
@ -213,6 +223,7 @@ void VToolCutSpline::AddToFile()
|
|||
AddToCalculation(domElement);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolCutSpline::RefreshDataInFile()
|
||||
{
|
||||
const VPointF *point = VAbstractTool::data.GeometricObject<const VPointF *>(id);
|
||||
|
@ -227,6 +238,7 @@ void VToolCutSpline::RefreshDataInFile()
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolCutSpline::RefreshGeometry()
|
||||
{
|
||||
RefreshSpline(firstSpline, spl1id, SimpleSpline::ForthPoint);
|
||||
|
@ -234,11 +246,13 @@ void VToolCutSpline::RefreshGeometry()
|
|||
VToolPoint::RefreshPointGeometry(*VDrawTool::data.GeometricObject<const VPointF *>(id));
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolCutSpline::RemoveReferens()
|
||||
{
|
||||
doc->DecrementReferens(splineId);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolCutSpline::SaveDialog(QDomElement &domElement)
|
||||
{
|
||||
Q_CHECK_PTR(dialog);
|
||||
|
@ -249,6 +263,7 @@ void VToolCutSpline::SaveDialog(QDomElement &domElement)
|
|||
doc->SetAttribute(domElement, AttrSpline, QString().setNum(dialogTool->getSplineId()));
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolCutSpline::RefreshSpline(VSimpleSpline *spline, quint32 splid, SimpleSpline::Translation tr)
|
||||
{
|
||||
const VSpline *spl = VAbstractTool::data.GeometricObject<const VSpline *>(splid);
|
||||
|
|
|
@ -33,6 +33,7 @@
|
|||
const QString VToolCutSplinePath::ToolType = QStringLiteral("cutSplinePath");
|
||||
const QString VToolCutSplinePath::AttrSplinePath = QStringLiteral("splinePath");
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VToolCutSplinePath::VToolCutSplinePath(VPattern *doc, VContainer *data, const quint32 &id,
|
||||
const QString &formula, const quint32 &splinePathId,
|
||||
const quint32 &splPath1id, const quint32 &splPath2id,
|
||||
|
@ -64,6 +65,7 @@ VToolCutSplinePath::VToolCutSplinePath(VPattern *doc, VContainer *data, const qu
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolCutSplinePath::setDialog()
|
||||
{
|
||||
Q_CHECK_PTR(dialog);
|
||||
|
@ -75,6 +77,7 @@ void VToolCutSplinePath::setDialog()
|
|||
dialogTool->setPointName(point->name());
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolCutSplinePath::Create(DialogTool *dialog, VMainGraphicsScene *scene, VPattern *doc, VContainer *data)
|
||||
{
|
||||
Q_CHECK_PTR(dialog);
|
||||
|
@ -86,6 +89,7 @@ void VToolCutSplinePath::Create(DialogTool *dialog, VMainGraphicsScene *scene, V
|
|||
Create(0, pointName, formula, splinePathId, 5, 10, scene, doc, data, Document::FullParse, Valentina::FromGui);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolCutSplinePath::Create(const quint32 _id, const QString &pointName, const QString &formula,
|
||||
const quint32 &splinePathId, const qreal &mx, const qreal &my,
|
||||
VMainGraphicsScene *scene, VPattern *doc, VContainer *data,
|
||||
|
@ -226,6 +230,7 @@ void VToolCutSplinePath::Create(const quint32 _id, const QString &pointName, con
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolCutSplinePath::FullUpdateFromFile()
|
||||
{
|
||||
QDomElement domElement = doc->elementById(QString().setNum(id));
|
||||
|
@ -237,11 +242,13 @@ void VToolCutSplinePath::FullUpdateFromFile()
|
|||
RefreshGeometry();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolCutSplinePath::SplineChoosed(quint32 id)
|
||||
{
|
||||
emit ChoosedTool(id, Valentina::SplinePath);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolCutSplinePath::ChangedActivDraw(const QString &newName)
|
||||
{
|
||||
bool flag = true;
|
||||
|
@ -260,16 +267,19 @@ void VToolCutSplinePath::ChangedActivDraw(const QString &newName)
|
|||
VToolPoint::ChangedActivDraw(newName);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolCutSplinePath::ShowContextMenu(QGraphicsSceneContextMenuEvent *event)
|
||||
{
|
||||
ContextMenu<DialogCutSplinePath>(this, event);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolCutSplinePath::contextMenuEvent(QGraphicsSceneContextMenuEvent *event)
|
||||
{
|
||||
ContextMenu<DialogCutSplinePath>(this, event);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolCutSplinePath::AddToFile()
|
||||
{
|
||||
const VPointF *point = VAbstractTool::data.GeometricObject<const VPointF *>(id);
|
||||
|
@ -287,6 +297,7 @@ void VToolCutSplinePath::AddToFile()
|
|||
AddToCalculation(domElement);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolCutSplinePath::RefreshDataInFile()
|
||||
{
|
||||
const VPointF *point = VAbstractTool::data.GeometricObject<const VPointF *>(id);
|
||||
|
@ -301,6 +312,7 @@ void VToolCutSplinePath::RefreshDataInFile()
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolCutSplinePath::RefreshGeometry()
|
||||
{
|
||||
RefreshSpline(firstSpline, splPath1id, SimpleSpline::ForthPoint);
|
||||
|
@ -308,11 +320,13 @@ void VToolCutSplinePath::RefreshGeometry()
|
|||
VToolPoint::RefreshPointGeometry(*VDrawTool::data.GeometricObject<const VPointF *>(id));
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolCutSplinePath::RemoveReferens()
|
||||
{
|
||||
doc->DecrementReferens(splinePathId);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolCutSplinePath::SaveDialog(QDomElement &domElement)
|
||||
{
|
||||
Q_CHECK_PTR(dialog);
|
||||
|
@ -323,6 +337,7 @@ void VToolCutSplinePath::SaveDialog(QDomElement &domElement)
|
|||
doc->SetAttribute(domElement, AttrSplinePath, QString().setNum(dialogTool->getSplinePathId()));
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolCutSplinePath::RefreshSpline(VSimpleSpline *spline, quint32 splPathid, SimpleSpline::Translation tr)
|
||||
{
|
||||
const VSplinePath *splPath = VAbstractTool::data.GeometricObject<const VSplinePath *>(splPathid);
|
||||
|
|
|
@ -33,6 +33,7 @@
|
|||
|
||||
const QString VToolEndLine::ToolType = QStringLiteral("endLine");
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VToolEndLine::VToolEndLine(VPattern *doc, VContainer *data, const quint32 &id, const QString &typeLine,
|
||||
const QString &formula, const qreal &angle, const quint32 &basePointId,
|
||||
const Valentina::Sources &typeCreation, QGraphicsItem *parent)
|
||||
|
@ -49,6 +50,7 @@ VToolEndLine::VToolEndLine(VPattern *doc, VContainer *data, const quint32 &id,
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolEndLine::setDialog()
|
||||
{
|
||||
Q_CHECK_PTR(dialog);
|
||||
|
@ -62,6 +64,7 @@ void VToolEndLine::setDialog()
|
|||
dialogTool->setPointName(p->name());
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolEndLine::Create(DialogTool *dialog, VMainGraphicsScene *scene, VPattern *doc,
|
||||
VContainer *data)
|
||||
{
|
||||
|
@ -77,6 +80,7 @@ void VToolEndLine::Create(DialogTool *dialog, VMainGraphicsScene *scene, VPatter
|
|||
Valentina::FromGui);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolEndLine::Create(const quint32 _id, const QString &pointName, const QString &typeLine,
|
||||
const QString &formula, const qreal &angle, const quint32 &basePointId,
|
||||
const qreal &mx, const qreal &my, VMainGraphicsScene *scene, VPattern *doc,
|
||||
|
@ -120,6 +124,7 @@ void VToolEndLine::Create(const quint32 _id, const QString &pointName, const QSt
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolEndLine::FullUpdateFromFile()
|
||||
{
|
||||
QDomElement domElement = doc->elementById(QString().setNum(id));
|
||||
|
@ -133,16 +138,19 @@ void VToolEndLine::FullUpdateFromFile()
|
|||
RefreshGeometry();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolEndLine::contextMenuEvent(QGraphicsSceneContextMenuEvent *event)
|
||||
{
|
||||
ContextMenu<DialogEndLine>(this, event);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolEndLine::ShowContextMenu(QGraphicsSceneContextMenuEvent *event)
|
||||
{
|
||||
ContextMenu<DialogEndLine>(this, event);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolEndLine::AddToFile()
|
||||
{
|
||||
const VPointF *point = VAbstractTool::data.GeometricObject<const VPointF *>(id);
|
||||
|
@ -162,6 +170,7 @@ void VToolEndLine::AddToFile()
|
|||
AddToCalculation(domElement);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolEndLine::RefreshDataInFile()
|
||||
{
|
||||
const VPointF *point = VAbstractTool::data.GeometricObject<const VPointF *>(id);
|
||||
|
@ -178,6 +187,7 @@ void VToolEndLine::RefreshDataInFile()
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolEndLine::SaveDialog(QDomElement &domElement)
|
||||
{
|
||||
Q_CHECK_PTR(dialog);
|
||||
|
|
|
@ -31,6 +31,7 @@
|
|||
|
||||
const QString VToolHeight::ToolType = QStringLiteral("height");
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VToolHeight::VToolHeight(VPattern *doc, VContainer *data, const quint32 &id, const QString &typeLine,
|
||||
const quint32 &basePointId, const quint32 &p1LineId, const quint32 &p2LineId,
|
||||
const Valentina::Sources &typeCreation, QGraphicsItem * parent)
|
||||
|
@ -47,6 +48,7 @@ VToolHeight::VToolHeight(VPattern *doc, VContainer *data, const quint32 &id, con
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolHeight::setDialog()
|
||||
{
|
||||
Q_CHECK_PTR(dialog);
|
||||
|
@ -60,6 +62,7 @@ void VToolHeight::setDialog()
|
|||
dialogTool->setPointName(p->name());
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolHeight::Create(DialogTool *dialog, VMainGraphicsScene *scene, VPattern *doc,
|
||||
VContainer *data)
|
||||
{
|
||||
|
@ -76,6 +79,7 @@ void VToolHeight::Create(DialogTool *dialog, VMainGraphicsScene *scene, VPattern
|
|||
Document::FullParse, Valentina::FromGui);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolHeight::Create(const quint32 _id, const QString &pointName, const QString &typeLine,
|
||||
const quint32 &basePointId, const quint32 &p1LineId, const quint32 &p2LineId,
|
||||
const qreal &mx, const qreal &my, VMainGraphicsScene *scene, VPattern *doc,
|
||||
|
@ -120,11 +124,13 @@ void VToolHeight::Create(const quint32 _id, const QString &pointName, const QStr
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
QPointF VToolHeight::FindPoint(const QLineF &line, const QPointF &point)
|
||||
{
|
||||
return VAbstractTool::ClosestPoint(line, point);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolHeight::FullUpdateFromFile()
|
||||
{
|
||||
QDomElement domElement = doc->elementById(QString().setNum(id));
|
||||
|
@ -139,16 +145,19 @@ void VToolHeight::FullUpdateFromFile()
|
|||
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolHeight::ShowContextMenu(QGraphicsSceneContextMenuEvent *event)
|
||||
{
|
||||
ContextMenu<DialogHeight>(this, event);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolHeight::contextMenuEvent(QGraphicsSceneContextMenuEvent *event)
|
||||
{
|
||||
ContextMenu<DialogHeight>(this, event);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolHeight::AddToFile()
|
||||
{
|
||||
const VPointF *point = VAbstractTool::data.GeometricObject<const VPointF *>(id);
|
||||
|
@ -169,6 +178,7 @@ void VToolHeight::AddToFile()
|
|||
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolHeight::RefreshDataInFile()
|
||||
{
|
||||
const VPointF *point = VAbstractTool::data.GeometricObject<const VPointF *>(id);
|
||||
|
@ -185,6 +195,7 @@ void VToolHeight::RefreshDataInFile()
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolHeight::SaveDialog(QDomElement &domElement)
|
||||
{
|
||||
Q_CHECK_PTR(dialog);
|
||||
|
|
|
@ -32,6 +32,7 @@
|
|||
|
||||
const QString VToolLine::TagName = QStringLiteral("line");
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VToolLine::VToolLine(VPattern *doc, VContainer *data, quint32 id, quint32 firstPoint, quint32 secondPoint,
|
||||
const QString &typeLine, const Valentina::Sources &typeCreation, QGraphicsItem *parent)
|
||||
:VDrawTool(doc, data, id), QGraphicsLineItem(parent), firstPoint(firstPoint), secondPoint(secondPoint)
|
||||
|
@ -58,6 +59,7 @@ VToolLine::VToolLine(VPattern *doc, VContainer *data, quint32 id, quint32 firstP
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolLine::setDialog()
|
||||
{
|
||||
Q_CHECK_PTR(dialog);
|
||||
|
@ -68,6 +70,7 @@ void VToolLine::setDialog()
|
|||
dialogTool->setTypeLine(typeLine);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolLine::Create(DialogTool *dialog, VMainGraphicsScene *scene, VPattern *doc, VContainer *data)
|
||||
{
|
||||
Q_CHECK_PTR(dialog);
|
||||
|
@ -79,6 +82,7 @@ void VToolLine::Create(DialogTool *dialog, VMainGraphicsScene *scene, VPattern *
|
|||
Create(0, firstPoint, secondPoint, typeLine, scene, doc, data, Document::FullParse, Valentina::FromGui);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolLine::Create(const quint32 &_id, const quint32 &firstPoint, const quint32 &secondPoint,
|
||||
const QString &typeLine, VMainGraphicsScene *scene, VPattern *doc, VContainer *data,
|
||||
const Document::Documents &parse, const Valentina::Sources &typeCreation)
|
||||
|
@ -114,22 +118,26 @@ void VToolLine::Create(const quint32 &_id, const quint32 &firstPoint, const quin
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolLine::FullUpdateFromFile()
|
||||
{
|
||||
RefreshGeometry();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolLine::ShowTool(quint32 id, Qt::GlobalColor color, bool enable)
|
||||
{
|
||||
ShowItem(this, id, color, enable);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolLine::SetFactor(qreal factor)
|
||||
{
|
||||
VDrawTool::SetFactor(factor);
|
||||
RefreshGeometry();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolLine::ChangedActivDraw(const QString &newName)
|
||||
{
|
||||
bool selectable = false;
|
||||
|
@ -148,11 +156,13 @@ void VToolLine::ChangedActivDraw(const QString &newName)
|
|||
VDrawTool::ChangedActivDraw(newName);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolLine::contextMenuEvent(QGraphicsSceneContextMenuEvent *event)
|
||||
{
|
||||
ContextMenu<DialogLine>(this, event);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolLine::AddToFile()
|
||||
{
|
||||
QDomElement domElement = doc->createElement(TagName);
|
||||
|
@ -164,6 +174,7 @@ void VToolLine::AddToFile()
|
|||
AddToCalculation(domElement);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolLine::RefreshDataInFile()
|
||||
{
|
||||
QDomElement domElement = doc->elementById(QString().setNum(id));
|
||||
|
@ -175,24 +186,28 @@ void VToolLine::RefreshDataInFile()
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolLine::hoverMoveEvent(QGraphicsSceneHoverEvent *event)
|
||||
{
|
||||
Q_UNUSED(event);
|
||||
this->setPen(QPen(currentColor, qApp->toPixel(qApp->widthMainLine())/factor, LineStyle()));
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolLine::hoverLeaveEvent(QGraphicsSceneHoverEvent *event)
|
||||
{
|
||||
Q_UNUSED(event);
|
||||
this->setPen(QPen(currentColor, qApp->toPixel(qApp->widthHairLine())/factor, LineStyle()));
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolLine::RemoveReferens()
|
||||
{
|
||||
doc->DecrementReferens(firstPoint);
|
||||
doc->DecrementReferens(secondPoint);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
QVariant VToolLine::itemChange(QGraphicsItem::GraphicsItemChange change, const QVariant &value)
|
||||
{
|
||||
if (change == QGraphicsItem::ItemSelectedChange)
|
||||
|
@ -211,6 +226,7 @@ QVariant VToolLine::itemChange(QGraphicsItem::GraphicsItemChange change, const Q
|
|||
return QGraphicsItem::itemChange(change, value);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolLine::keyReleaseEvent(QKeyEvent *event)
|
||||
{
|
||||
switch (event->key())
|
||||
|
@ -224,6 +240,7 @@ void VToolLine::keyReleaseEvent(QKeyEvent *event)
|
|||
QGraphicsItem::keyReleaseEvent ( event );
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolLine::SaveDialog(QDomElement &domElement)
|
||||
{
|
||||
Q_CHECK_PTR(dialog);
|
||||
|
@ -234,6 +251,7 @@ void VToolLine::SaveDialog(QDomElement &domElement)
|
|||
doc->SetAttribute(domElement, AttrTypeLine, dialogTool->getTypeLine());
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolLine::RefreshGeometry()
|
||||
{
|
||||
QDomElement domElement = doc->elementById(QString().setNum(id));
|
||||
|
|
|
@ -31,6 +31,7 @@
|
|||
|
||||
const QString VToolLineIntersect::ToolType = QStringLiteral("lineIntersect");
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VToolLineIntersect::VToolLineIntersect(VPattern *doc, VContainer *data, const quint32 &id,
|
||||
const quint32 &p1Line1, const quint32 &p2Line1, const quint32 &p1Line2,
|
||||
const quint32 &p2Line2, const Valentina::Sources &typeCreation,
|
||||
|
@ -49,6 +50,7 @@ VToolLineIntersect::VToolLineIntersect(VPattern *doc, VContainer *data, const qu
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolLineIntersect::setDialog()
|
||||
{
|
||||
Q_CHECK_PTR(dialog);
|
||||
|
@ -62,6 +64,7 @@ void VToolLineIntersect::setDialog()
|
|||
dialogTool->setPointName(p->name());
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolLineIntersect::Create(DialogTool *dialog, VMainGraphicsScene *scene, VPattern *doc, VContainer *data)
|
||||
{
|
||||
Q_CHECK_PTR(dialog);
|
||||
|
@ -76,6 +79,7 @@ void VToolLineIntersect::Create(DialogTool *dialog, VMainGraphicsScene *scene, V
|
|||
Document::FullParse, Valentina::FromGui);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolLineIntersect::Create(const quint32 _id, const quint32 &p1Line1Id, const quint32 &p2Line1Id,
|
||||
const quint32 &p1Line2Id, const quint32 &p2Line2Id, const QString &pointName,
|
||||
const qreal &mx, const qreal &my, VMainGraphicsScene *scene,
|
||||
|
@ -131,6 +135,7 @@ void VToolLineIntersect::Create(const quint32 _id, const quint32 &p1Line1Id, con
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolLineIntersect::FullUpdateFromFile()
|
||||
{
|
||||
QDomElement domElement = doc->elementById(QString().setNum(id));
|
||||
|
@ -144,22 +149,26 @@ void VToolLineIntersect::FullUpdateFromFile()
|
|||
RefreshPointGeometry(*VAbstractTool::data.GeometricObject<const VPointF *>(id));
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolLineIntersect::SetFactor(qreal factor)
|
||||
{
|
||||
VDrawTool::SetFactor(factor);
|
||||
RefreshPointGeometry(*VAbstractTool::data.GeometricObject<const VPointF *>(id));
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolLineIntersect::ShowContextMenu(QGraphicsSceneContextMenuEvent *event)
|
||||
{
|
||||
ContextMenu<DialogLineIntersect>(this, event);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolLineIntersect::contextMenuEvent(QGraphicsSceneContextMenuEvent *event)
|
||||
{
|
||||
ContextMenu<DialogLineIntersect>(this, event);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolLineIntersect::AddToFile()
|
||||
{
|
||||
const VPointF *point = VAbstractTool::data.GeometricObject<const VPointF *>(id);
|
||||
|
@ -179,6 +188,7 @@ void VToolLineIntersect::AddToFile()
|
|||
AddToCalculation(domElement);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolLineIntersect::RefreshDataInFile()
|
||||
{
|
||||
const VPointF *point = VAbstractTool::data.GeometricObject<const VPointF *>(id);
|
||||
|
@ -195,6 +205,7 @@ void VToolLineIntersect::RefreshDataInFile()
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolLineIntersect::RemoveReferens()
|
||||
{
|
||||
doc->DecrementReferens(p1Line1);
|
||||
|
@ -203,6 +214,7 @@ void VToolLineIntersect::RemoveReferens()
|
|||
doc->DecrementReferens(p2Line2);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolLineIntersect::SaveDialog(QDomElement &domElement)
|
||||
{
|
||||
Q_CHECK_PTR(dialog);
|
||||
|
|
|
@ -28,6 +28,7 @@
|
|||
|
||||
#include "vtoollinepoint.h"
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VToolLinePoint::VToolLinePoint(VPattern *doc, VContainer *data, const quint32 &id,
|
||||
const QString &typeLine, const QString &formula, const quint32 &basePointId,
|
||||
const qreal &angle, QGraphicsItem *parent)
|
||||
|
@ -43,6 +44,7 @@ VToolLinePoint::VToolLinePoint(VPattern *doc, VContainer *data, const quint32 &i
|
|||
mainLine->setFlag(QGraphicsItem::ItemStacksBehindParent, true);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolLinePoint::ChangedActivDraw(const QString &newName)
|
||||
{
|
||||
if (nameActivDraw == newName)
|
||||
|
@ -57,6 +59,7 @@ void VToolLinePoint::ChangedActivDraw(const QString &newName)
|
|||
VToolPoint::ChangedActivDraw(newName);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolLinePoint::RefreshGeometry()
|
||||
{
|
||||
mainLine->setPen(QPen(currentColor, qApp->toPixel(qApp->widthHairLine())/factor, LineStyle()));
|
||||
|
@ -66,6 +69,7 @@ void VToolLinePoint::RefreshGeometry()
|
|||
mainLine->setLine(QLineF(basePoint - point, QPointF()));
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolLinePoint::SetFactor(qreal factor)
|
||||
{
|
||||
VDrawTool::SetFactor(factor);
|
||||
|
|
|
@ -32,6 +32,7 @@
|
|||
|
||||
const QString VToolNormal::ToolType = QStringLiteral("normal");
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VToolNormal::VToolNormal(VPattern *doc, VContainer *data, const quint32 &id, const QString &typeLine,
|
||||
const QString &formula, const qreal &angle, const quint32 &firstPointId,
|
||||
const quint32 &secondPointId, const Valentina::Sources &typeCreation, QGraphicsItem *parent)
|
||||
|
@ -49,6 +50,7 @@ VToolNormal::VToolNormal(VPattern *doc, VContainer *data, const quint32 &id, con
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolNormal::setDialog()
|
||||
{
|
||||
Q_CHECK_PTR(dialog);
|
||||
|
@ -63,6 +65,7 @@ void VToolNormal::setDialog()
|
|||
dialogTool->setPointName(p->name());
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolNormal::Create(DialogTool *dialog, VMainGraphicsScene *scene, VPattern *doc, VContainer *data)
|
||||
{
|
||||
Q_CHECK_PTR(dialog);
|
||||
|
@ -78,6 +81,7 @@ void VToolNormal::Create(DialogTool *dialog, VMainGraphicsScene *scene, VPattern
|
|||
Document::FullParse, Valentina::FromGui);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolNormal::Create(const quint32 _id, const QString &formula, const quint32 &firstPointId,
|
||||
const quint32 &secondPointId, const QString &typeLine, const QString &pointName,
|
||||
const qreal angle, const qreal &mx, const qreal &my, VMainGraphicsScene *scene,
|
||||
|
@ -123,6 +127,7 @@ void VToolNormal::Create(const quint32 _id, const QString &formula, const quint3
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
QPointF VToolNormal::FindPoint(const QPointF &firstPoint, const QPointF &secondPoint, const qreal &length,
|
||||
const qreal &angle)
|
||||
{
|
||||
|
@ -133,6 +138,7 @@ QPointF VToolNormal::FindPoint(const QPointF &firstPoint, const QPointF &secondP
|
|||
return normal.p2();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolNormal::FullUpdateFromFile()
|
||||
{
|
||||
QDomElement domElement = doc->elementById(QString().setNum(id));
|
||||
|
@ -147,22 +153,26 @@ void VToolNormal::FullUpdateFromFile()
|
|||
RefreshGeometry();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolNormal::SetFactor(qreal factor)
|
||||
{
|
||||
VDrawTool::SetFactor(factor);
|
||||
RefreshGeometry();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolNormal::ShowContextMenu(QGraphicsSceneContextMenuEvent *event)
|
||||
{
|
||||
ContextMenu<DialogNormal>(this, event);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolNormal::contextMenuEvent(QGraphicsSceneContextMenuEvent *event)
|
||||
{
|
||||
ContextMenu<DialogNormal>(this, event);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolNormal::AddToFile()
|
||||
{
|
||||
const VPointF *point = VAbstractTool::data.GeometricObject<const VPointF *>(id);
|
||||
|
@ -183,6 +193,7 @@ void VToolNormal::AddToFile()
|
|||
AddToCalculation(domElement);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolNormal::RefreshDataInFile()
|
||||
{
|
||||
const VPointF *point = VAbstractTool::data.GeometricObject<const VPointF *>(id);
|
||||
|
@ -200,12 +211,14 @@ void VToolNormal::RefreshDataInFile()
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolNormal::RemoveReferens()
|
||||
{
|
||||
doc->DecrementReferens(secondPointId);
|
||||
VToolLinePoint::RemoveReferens();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolNormal::SaveDialog(QDomElement &domElement)
|
||||
{
|
||||
Q_CHECK_PTR(dialog);
|
||||
|
|
|
@ -33,6 +33,7 @@ const QString VToolPoint::TagName = QStringLiteral("point");
|
|||
|
||||
#define DefRadius 2.0//mm
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VToolPoint::VToolPoint(VPattern *doc, VContainer *data, quint32 id, QGraphicsItem *parent):VDrawTool(doc, data, id),
|
||||
QGraphicsEllipseItem(parent), radius(DefRadius), namePoint(0), lineName(0)
|
||||
{
|
||||
|
@ -65,6 +66,7 @@ VToolPoint::VToolPoint(VPattern *doc, VContainer *data, quint32 id, QGraphicsIte
|
|||
RefreshPointGeometry(*VAbstractTool::data.GeometricObject<const VPointF *>(id));
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolPoint::NameChangePosition(const QPointF &pos)
|
||||
{
|
||||
VPointF *point = new VPointF(*VAbstractTool::data.GeometricObject<const VPointF *>(id));
|
||||
|
@ -76,6 +78,7 @@ void VToolPoint::NameChangePosition(const QPointF &pos)
|
|||
VAbstractTool::data.UpdateGObject(id, point);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolPoint::UpdateNamePosition(qreal mx, qreal my)
|
||||
{
|
||||
QDomElement domElement = doc->elementById(QString().setNum(id));
|
||||
|
@ -87,6 +90,7 @@ void VToolPoint::UpdateNamePosition(qreal mx, qreal my)
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolPoint::ChangedActivDraw(const QString &newName)
|
||||
{
|
||||
bool selectable = false;
|
||||
|
@ -112,22 +116,26 @@ void VToolPoint::ChangedActivDraw(const QString &newName)
|
|||
VDrawTool::ChangedActivDraw(newName);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolPoint::ShowTool(quint32 id, Qt::GlobalColor color, bool enable)
|
||||
{
|
||||
ShowItem(this, id, color, enable);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolPoint::SetFactor(qreal factor)
|
||||
{
|
||||
VDrawTool::SetFactor(factor);
|
||||
RefreshPointGeometry(*VAbstractTool::data.GeometricObject<const VPointF *>(id));
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolPoint::ShowContextMenu(QGraphicsSceneContextMenuEvent *event)
|
||||
{
|
||||
Q_UNUSED(event);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolPoint::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
|
||||
{
|
||||
if (event->button() == Qt::LeftButton)
|
||||
|
@ -137,18 +145,21 @@ void VToolPoint::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
|
|||
QGraphicsItem::mouseReleaseEvent(event);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolPoint::hoverMoveEvent(QGraphicsSceneHoverEvent *event)
|
||||
{
|
||||
Q_UNUSED(event);
|
||||
this->setPen(QPen(currentColor, qApp->toPixel(qApp->widthMainLine())/factor));
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolPoint::hoverLeaveEvent(QGraphicsSceneHoverEvent *event)
|
||||
{
|
||||
Q_UNUSED(event);
|
||||
this->setPen(QPen(currentColor, qApp->toPixel(qApp->widthHairLine())/factor));
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolPoint::RefreshPointGeometry(const VPointF &point)
|
||||
{
|
||||
this->setPen(QPen(currentColor, qApp->toPixel(qApp->widthHairLine())/factor));
|
||||
|
@ -166,6 +177,7 @@ void VToolPoint::RefreshPointGeometry(const VPointF &point)
|
|||
RefreshLine();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolPoint::RefreshLine()
|
||||
{
|
||||
QRectF nameRec = namePoint->sceneBoundingRect();
|
||||
|
@ -191,6 +203,7 @@ void VToolPoint::RefreshLine()
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
QVariant VToolPoint::itemChange(QGraphicsItem::GraphicsItemChange change, const QVariant &value)
|
||||
{
|
||||
if (change == QGraphicsItem::ItemSelectedChange)
|
||||
|
@ -209,6 +222,7 @@ QVariant VToolPoint::itemChange(QGraphicsItem::GraphicsItemChange change, const
|
|||
return QGraphicsItem::itemChange(change, value);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolPoint::keyReleaseEvent(QKeyEvent *event)
|
||||
{
|
||||
switch (event->key())
|
||||
|
|
|
@ -32,6 +32,7 @@
|
|||
|
||||
const QString VToolPointOfContact::ToolType = QStringLiteral("pointOfContact");
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VToolPointOfContact::VToolPointOfContact(VPattern *doc, VContainer *data, const quint32 &id,
|
||||
const QString &radius, const quint32 ¢er,
|
||||
const quint32 &firstPointId, const quint32 &secondPointId,
|
||||
|
@ -49,6 +50,7 @@ VToolPointOfContact::VToolPointOfContact(VPattern *doc, VContainer *data, const
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolPointOfContact::setDialog()
|
||||
{
|
||||
Q_CHECK_PTR(dialog);
|
||||
|
@ -62,6 +64,7 @@ void VToolPointOfContact::setDialog()
|
|||
dialogTool->setPointName(p->name());
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
QPointF VToolPointOfContact::FindPoint(const qreal &radius, const QPointF ¢er, const QPointF &firstPoint,
|
||||
const QPointF &secondPoint)
|
||||
{
|
||||
|
@ -88,6 +91,7 @@ QPointF VToolPointOfContact::FindPoint(const qreal &radius, const QPointF ¢e
|
|||
return pArc;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolPointOfContact::Create(DialogTool *dialog, VMainGraphicsScene *scene, VPattern *doc, VContainer *data)
|
||||
{
|
||||
Q_CHECK_PTR(dialog);
|
||||
|
@ -102,6 +106,7 @@ void VToolPointOfContact::Create(DialogTool *dialog, VMainGraphicsScene *scene,
|
|||
Document::FullParse, Valentina::FromGui);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolPointOfContact::Create(const quint32 _id, const QString &radius, const quint32 ¢er,
|
||||
const quint32 &firstPointId, const quint32 &secondPointId,
|
||||
const QString &pointName, const qreal &mx, const qreal &my,
|
||||
|
@ -154,6 +159,7 @@ void VToolPointOfContact::Create(const quint32 _id, const QString &radius, const
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolPointOfContact::FullUpdateFromFile()
|
||||
{
|
||||
QDomElement domElement = doc->elementById(QString().setNum(id));
|
||||
|
@ -167,22 +173,26 @@ void VToolPointOfContact::FullUpdateFromFile()
|
|||
RefreshPointGeometry(*VAbstractTool::data.GeometricObject<const VPointF *>(id));
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolPointOfContact::SetFactor(qreal factor)
|
||||
{
|
||||
VDrawTool::SetFactor(factor);
|
||||
RefreshPointGeometry(*VAbstractTool::data.GeometricObject<const VPointF *>(id));
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolPointOfContact::ShowContextMenu(QGraphicsSceneContextMenuEvent *event)
|
||||
{
|
||||
ContextMenu<DialogPointOfContact>(this, event);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolPointOfContact::contextMenuEvent(QGraphicsSceneContextMenuEvent *event)
|
||||
{
|
||||
ContextMenu<DialogPointOfContact>(this, event);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolPointOfContact::AddToFile()
|
||||
{
|
||||
const VPointF *point = VAbstractTool::data.GeometricObject<const VPointF *>(id);
|
||||
|
@ -202,6 +212,7 @@ void VToolPointOfContact::AddToFile()
|
|||
AddToCalculation(domElement);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolPointOfContact::RefreshDataInFile()
|
||||
{
|
||||
const VPointF *point = VAbstractTool::data.GeometricObject<const VPointF *>(id);
|
||||
|
@ -218,6 +229,7 @@ void VToolPointOfContact::RefreshDataInFile()
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolPointOfContact::RemoveReferens()
|
||||
{
|
||||
doc->DecrementReferens(center);
|
||||
|
@ -225,6 +237,7 @@ void VToolPointOfContact::RemoveReferens()
|
|||
doc->DecrementReferens(secondPointId);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolPointOfContact::SaveDialog(QDomElement &domElement)
|
||||
{
|
||||
Q_CHECK_PTR(dialog);
|
||||
|
|
|
@ -31,6 +31,7 @@
|
|||
|
||||
const QString VToolPointOfIntersection::ToolType = QStringLiteral("pointOfIntersection");
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VToolPointOfIntersection::VToolPointOfIntersection(VPattern *doc, VContainer *data, const quint32 &id,
|
||||
const quint32 &firstPointId, const quint32 &secondPointId,
|
||||
const Valentina::Sources &typeCreation, QGraphicsItem *parent)
|
||||
|
@ -47,6 +48,7 @@ VToolPointOfIntersection::VToolPointOfIntersection(VPattern *doc, VContainer *da
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolPointOfIntersection::setDialog()
|
||||
{
|
||||
Q_CHECK_PTR(dialog);
|
||||
|
@ -58,6 +60,7 @@ void VToolPointOfIntersection::setDialog()
|
|||
dialogTool->setPointName(p->name());
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolPointOfIntersection::Create(DialogTool *dialog, VMainGraphicsScene *scene, VPattern *doc,
|
||||
VContainer *data)
|
||||
{
|
||||
|
@ -70,6 +73,7 @@ void VToolPointOfIntersection::Create(DialogTool *dialog, VMainGraphicsScene *sc
|
|||
Create(0, pointName, firstPointId, secondPointId, 5, 10, scene, doc, data, Document::FullParse, Valentina::FromGui);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolPointOfIntersection::Create(const quint32 _id, const QString &pointName, const quint32 &firstPointId,
|
||||
const quint32 &secondPointId, const qreal &mx, const qreal &my,
|
||||
VMainGraphicsScene *scene, VPattern *doc, VContainer *data,
|
||||
|
@ -106,6 +110,7 @@ void VToolPointOfIntersection::Create(const quint32 _id, const QString &pointNam
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolPointOfIntersection::FullUpdateFromFile()
|
||||
{
|
||||
QDomElement domElement = doc->elementById(QString().setNum(id));
|
||||
|
@ -117,22 +122,26 @@ void VToolPointOfIntersection::FullUpdateFromFile()
|
|||
VToolPoint::RefreshPointGeometry(*VDrawTool::data.GeometricObject<const VPointF *>(id));
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolPointOfIntersection::ShowContextMenu(QGraphicsSceneContextMenuEvent *event)
|
||||
{
|
||||
ContextMenu<DialogPointOfIntersection>(this, event);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolPointOfIntersection::RemoveReferens()
|
||||
{
|
||||
doc->DecrementReferens(firstPointId);
|
||||
doc->DecrementReferens(secondPointId);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolPointOfIntersection::contextMenuEvent(QGraphicsSceneContextMenuEvent *event)
|
||||
{
|
||||
ContextMenu<DialogPointOfIntersection>(this, event);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolPointOfIntersection::AddToFile()
|
||||
{
|
||||
const VPointF *point = VAbstractTool::data.GeometricObject<const VPointF *>(id);
|
||||
|
@ -150,6 +159,7 @@ void VToolPointOfIntersection::AddToFile()
|
|||
AddToCalculation(domElement);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolPointOfIntersection::RefreshDataInFile()
|
||||
{
|
||||
const VPointF *point = VAbstractTool::data.GeometricObject<const VPointF *>(id);
|
||||
|
@ -164,6 +174,7 @@ void VToolPointOfIntersection::RefreshDataInFile()
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolPointOfIntersection::SaveDialog(QDomElement &domElement)
|
||||
{
|
||||
Q_CHECK_PTR(dialog);
|
||||
|
|
|
@ -32,6 +32,7 @@
|
|||
|
||||
const QString VToolShoulderPoint::ToolType = QStringLiteral("shoulder");
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VToolShoulderPoint::VToolShoulderPoint(VPattern *doc, VContainer *data, const quint32 &id, const QString &typeLine,
|
||||
const QString &formula, const quint32 &p1Line, const quint32 &p2Line,
|
||||
const quint32 &pShoulder, const Valentina::Sources &typeCreation,
|
||||
|
@ -48,6 +49,7 @@ VToolShoulderPoint::VToolShoulderPoint(VPattern *doc, VContainer *data, const qu
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolShoulderPoint::setDialog()
|
||||
{
|
||||
Q_CHECK_PTR(dialog);
|
||||
|
@ -62,6 +64,7 @@ void VToolShoulderPoint::setDialog()
|
|||
dialogTool->setPointName(p->name());
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
QPointF VToolShoulderPoint::FindPoint(const QPointF &p1Line, const QPointF &p2Line, const QPointF &pShoulder,
|
||||
const qreal &length)
|
||||
{
|
||||
|
@ -89,6 +92,7 @@ QPointF VToolShoulderPoint::FindPoint(const QPointF &p1Line, const QPointF &p2Li
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolShoulderPoint::Create(DialogTool *dialog, VMainGraphicsScene *scene, VPattern *doc, VContainer *data)
|
||||
{
|
||||
Q_CHECK_PTR(dialog);
|
||||
|
@ -104,6 +108,7 @@ void VToolShoulderPoint::Create(DialogTool *dialog, VMainGraphicsScene *scene, V
|
|||
Document::FullParse, Valentina::FromGui);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolShoulderPoint::Create(const quint32 _id, const QString &formula, const quint32 &p1Line,
|
||||
const quint32 &p2Line, const quint32 &pShoulder, const QString &typeLine,
|
||||
const QString &pointName, const qreal &mx, const qreal &my,
|
||||
|
@ -155,6 +160,7 @@ void VToolShoulderPoint::Create(const quint32 _id, const QString &formula, const
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolShoulderPoint::FullUpdateFromFile()
|
||||
{
|
||||
QDomElement domElement = doc->elementById(QString().setNum(id));
|
||||
|
@ -169,22 +175,26 @@ void VToolShoulderPoint::FullUpdateFromFile()
|
|||
RefreshGeometry();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolShoulderPoint::SetFactor(qreal factor)
|
||||
{
|
||||
VDrawTool::SetFactor(factor);
|
||||
RefreshGeometry();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolShoulderPoint::ShowContextMenu(QGraphicsSceneContextMenuEvent *event)
|
||||
{
|
||||
ContextMenu<DialogShoulderPoint>(this, event);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolShoulderPoint::contextMenuEvent(QGraphicsSceneContextMenuEvent *event)
|
||||
{
|
||||
ContextMenu<DialogShoulderPoint>(this, event);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolShoulderPoint::AddToFile()
|
||||
{
|
||||
const VPointF *point = VAbstractTool::data.GeometricObject<const VPointF *>(id);
|
||||
|
@ -205,6 +215,7 @@ void VToolShoulderPoint::AddToFile()
|
|||
AddToCalculation(domElement);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolShoulderPoint::RefreshDataInFile()
|
||||
{
|
||||
const VPointF *point = VAbstractTool::data.GeometricObject<const VPointF *>(id);
|
||||
|
@ -222,6 +233,7 @@ void VToolShoulderPoint::RefreshDataInFile()
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolShoulderPoint::RemoveReferens()
|
||||
{
|
||||
doc->DecrementReferens(p2Line);
|
||||
|
@ -229,6 +241,7 @@ void VToolShoulderPoint::RemoveReferens()
|
|||
VToolLinePoint::RemoveReferens();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolShoulderPoint::SaveDialog(QDomElement &domElement)
|
||||
{
|
||||
Q_CHECK_PTR(dialog);
|
||||
|
|
|
@ -31,6 +31,7 @@
|
|||
|
||||
const QString VToolSinglePoint::ToolType = QStringLiteral("single");
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VToolSinglePoint::VToolSinglePoint (VPattern *doc, VContainer *data, quint32 id, const Valentina::Sources &typeCreation,
|
||||
QGraphicsItem * parent )
|
||||
:VToolPoint(doc, data, id, parent)
|
||||
|
@ -53,6 +54,7 @@ VToolSinglePoint::VToolSinglePoint (VPattern *doc, VContainer *data, quint32 id,
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolSinglePoint::setDialog()
|
||||
{
|
||||
Q_CHECK_PTR(dialog);
|
||||
|
@ -62,6 +64,7 @@ void VToolSinglePoint::setDialog()
|
|||
dialogTool->setData(p->name(), p->toQPointF());
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolSinglePoint::AddToFile()
|
||||
{
|
||||
const VPointF *point = VAbstractTool::data.GeometricObject<const VPointF *>(id);
|
||||
|
@ -78,6 +81,7 @@ void VToolSinglePoint::AddToFile()
|
|||
AddToCalculation(domElement);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolSinglePoint::RefreshDataInFile()
|
||||
{
|
||||
const VPointF *point = VAbstractTool::data.GeometricObject<const VPointF *>(id);
|
||||
|
@ -92,6 +96,7 @@ void VToolSinglePoint::RefreshDataInFile()
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
QVariant VToolSinglePoint::itemChange(QGraphicsItem::GraphicsItemChange change, const QVariant &value)
|
||||
{
|
||||
if (change == ItemPositionChange && scene())
|
||||
|
@ -128,6 +133,7 @@ QVariant VToolSinglePoint::itemChange(QGraphicsItem::GraphicsItemChange change,
|
|||
return QGraphicsItem::itemChange(change, value);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolSinglePoint::decrementReferens()
|
||||
{
|
||||
if (_referens > 1)
|
||||
|
@ -136,6 +142,7 @@ void VToolSinglePoint::decrementReferens()
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolSinglePoint::SaveDialog(QDomElement &domElement)
|
||||
{
|
||||
Q_CHECK_PTR(dialog);
|
||||
|
@ -148,23 +155,27 @@ void VToolSinglePoint::SaveDialog(QDomElement &domElement)
|
|||
doc->SetAttribute(domElement, AttrY, QString().setNum(qApp->fromPixel(p.y())));
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolSinglePoint::setColorLabel(const Qt::GlobalColor &color)
|
||||
{
|
||||
namePoint->setBrush(color);
|
||||
lineName->setPen(QPen(color, qApp->toPixel(qApp->widthHairLine())/factor));
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolSinglePoint::contextMenuEvent ( QGraphicsSceneContextMenuEvent * event )
|
||||
{
|
||||
ContextMenu<DialogSinglePoint>(this, event, false);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolSinglePoint::FullUpdateFromFile()
|
||||
{
|
||||
VPointF point = *VAbstractTool::data.GeometricObject<const VPointF *>(id);
|
||||
RefreshPointGeometry(point);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolSinglePoint::ChangedActivDraw(const QString &newName)
|
||||
{
|
||||
if (nameActivDraw == newName)
|
||||
|
@ -181,12 +192,14 @@ void VToolSinglePoint::ChangedActivDraw(const QString &newName)
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolSinglePoint::SetFactor(qreal factor)
|
||||
{
|
||||
VDrawTool::SetFactor(factor);
|
||||
RefreshPointGeometry(*(VAbstractTool::data.GeometricObject<const VPointF *>(id)));
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolSinglePoint::ShowContextMenu(QGraphicsSceneContextMenuEvent *event)
|
||||
{
|
||||
ContextMenu<DialogSinglePoint>(this, event, false);
|
||||
|
|
|
@ -32,6 +32,7 @@
|
|||
|
||||
const QString VToolSpline::ToolType = QStringLiteral("simple");
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VToolSpline::VToolSpline(VPattern *doc, VContainer *data, quint32 id, const Valentina::Sources &typeCreation,
|
||||
QGraphicsItem *parent) :VAbstractSpline(doc, data, id, parent)
|
||||
{
|
||||
|
@ -71,6 +72,7 @@ VToolSpline::VToolSpline(VPattern *doc, VContainer *data, quint32 id, const Vale
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolSpline::setDialog()
|
||||
{
|
||||
Q_CHECK_PTR(dialog);
|
||||
|
@ -86,6 +88,7 @@ void VToolSpline::setDialog()
|
|||
dialogTool->setKCurve(spl->GetKcurve());
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolSpline::Create(DialogTool *dialog, VMainGraphicsScene *scene, VPattern *doc,
|
||||
VContainer *data)
|
||||
{
|
||||
|
@ -103,6 +106,7 @@ void VToolSpline::Create(DialogTool *dialog, VMainGraphicsScene *scene, VPattern
|
|||
Valentina::FromGui);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolSpline::Create(const quint32 _id, const quint32 &p1, const quint32 &p4, const qreal &kAsm1,
|
||||
const qreal kAsm2, const qreal &angle1, const qreal &angle2, const qreal &kCurve,
|
||||
VMainGraphicsScene *scene, VPattern *doc, VContainer *data,
|
||||
|
@ -139,6 +143,7 @@ void VToolSpline::Create(const quint32 _id, const quint32 &p1, const quint32 &p4
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolSpline::ControlPointChangePosition(const qint32 &indexSpline, const SplinePoint::Position &position,
|
||||
const QPointF &pos)
|
||||
{
|
||||
|
@ -166,6 +171,7 @@ void VToolSpline::ControlPointChangePosition(const qint32 &indexSpline, const Sp
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolSpline::contextMenuEvent(QGraphicsSceneContextMenuEvent *event)
|
||||
{
|
||||
ContextMenu<DialogSpline>(this, event);
|
||||
|
@ -189,6 +195,7 @@ void VToolSpline::AddToFile()
|
|||
AddToCalculation(domElement);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolSpline::RefreshDataInFile()
|
||||
{
|
||||
const VSpline *spl = VAbstractTool::data.GeometricObject<const VSpline *>(id);
|
||||
|
@ -205,6 +212,7 @@ void VToolSpline::RefreshDataInFile()
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolSpline::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
|
||||
{
|
||||
if (event->button() == Qt::LeftButton)
|
||||
|
@ -214,6 +222,7 @@ void VToolSpline::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
|
|||
QGraphicsItem::mouseReleaseEvent(event);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolSpline::RemoveReferens()
|
||||
{
|
||||
const VSpline *spl = VAbstractTool::data.GeometricObject<const VSpline *>(id);
|
||||
|
@ -221,6 +230,7 @@ void VToolSpline::RemoveReferens()
|
|||
doc->DecrementReferens(spl->GetP4().id());
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolSpline::SaveDialog(QDomElement &domElement)
|
||||
{
|
||||
Q_CHECK_PTR(dialog);
|
||||
|
@ -254,6 +264,7 @@ void VToolSpline::SaveDialog(QDomElement &domElement)
|
|||
doc->SetAttribute(domElement, AttrKCurve, spl.GetKcurve());
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolSpline::RefreshGeometry()
|
||||
{
|
||||
this->setPen(QPen(currentColor, qApp->toPixel(qApp->widthHairLine())/factor));
|
||||
|
|
|
@ -31,6 +31,7 @@
|
|||
|
||||
const QString VToolSplinePath::ToolType = QStringLiteral("path");
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VToolSplinePath::VToolSplinePath(VPattern *doc, VContainer *data, quint32 id, const Valentina::Sources &typeCreation,
|
||||
QGraphicsItem *parent) :VAbstractSpline(doc, data, id, parent)
|
||||
{
|
||||
|
@ -72,6 +73,7 @@ VToolSplinePath::VToolSplinePath(VPattern *doc, VContainer *data, quint32 id, co
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolSplinePath::setDialog()
|
||||
{
|
||||
Q_CHECK_PTR(dialog);
|
||||
|
@ -81,6 +83,7 @@ void VToolSplinePath::setDialog()
|
|||
dialogTool->SetPath(*splPath);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolSplinePath::Create(DialogTool *dialog, VMainGraphicsScene *scene, VPattern *doc, VContainer *data)
|
||||
{
|
||||
Q_CHECK_PTR(dialog);
|
||||
|
@ -94,6 +97,7 @@ void VToolSplinePath::Create(DialogTool *dialog, VMainGraphicsScene *scene, VPat
|
|||
Create(0, path, scene, doc, data, Document::FullParse, Valentina::FromGui);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolSplinePath::Create(const quint32 _id, VSplinePath *path, VMainGraphicsScene *scene,
|
||||
VPattern *doc, VContainer *data, const Document::Documents &parse,
|
||||
const Valentina::Sources &typeCreation)
|
||||
|
@ -124,6 +128,7 @@ void VToolSplinePath::Create(const quint32 _id, VSplinePath *path, VMainGraphics
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolSplinePath::ControlPointChangePosition(const qint32 &indexSpline, const SplinePoint::Position &position,
|
||||
const QPointF &pos)
|
||||
{
|
||||
|
@ -149,6 +154,7 @@ void VToolSplinePath::ControlPointChangePosition(const qint32 &indexSpline, cons
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolSplinePath::CorectControlPoints(const VSpline &spl, VSplinePath &splPath, const qint32 &indexSpline)
|
||||
{
|
||||
VSplinePoint p = splPath.GetSplinePoint(indexSpline, SplinePoint::FirstPoint);
|
||||
|
@ -162,6 +168,7 @@ void VToolSplinePath::CorectControlPoints(const VSpline &spl, VSplinePath &splPa
|
|||
splPath.UpdatePoint(indexSpline, SplinePoint::LastPoint, p);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolSplinePath::RefreshSplinePath(VSplinePath &splPath)
|
||||
{
|
||||
for (qint32 i = 1; i<=splPath.Count(); ++i)
|
||||
|
@ -186,6 +193,7 @@ void VToolSplinePath::RefreshSplinePath(VSplinePath &splPath)
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolSplinePath::UpdatePathPoint(QDomNode& node, VSplinePath &path)
|
||||
{
|
||||
QDomNodeList nodeList = node.childNodes();
|
||||
|
@ -204,11 +212,13 @@ void VToolSplinePath::UpdatePathPoint(QDomNode& node, VSplinePath &path)
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolSplinePath::contextMenuEvent(QGraphicsSceneContextMenuEvent *event)
|
||||
{
|
||||
ContextMenu<DialogSplinePath>(this, event);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolSplinePath::AddToFile()
|
||||
{
|
||||
VSplinePath splPath = *VAbstractTool::data.GeometricObject<const VSplinePath *>(id);
|
||||
|
@ -226,6 +236,7 @@ void VToolSplinePath::AddToFile()
|
|||
AddToCalculation(domElement);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolSplinePath::RefreshDataInFile()
|
||||
{
|
||||
QDomElement domElement = doc->elementById(QString().setNum(id));
|
||||
|
@ -240,6 +251,7 @@ void VToolSplinePath::RefreshDataInFile()
|
|||
UpdatePathPoint(domElement, splPath);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolSplinePath::AddPathPoint(QDomElement &domElement, const VSplinePoint &splPoint)
|
||||
{
|
||||
QDomElement pathPoint = doc->createElement(AttrPathPoint);
|
||||
|
@ -252,6 +264,7 @@ void VToolSplinePath::AddPathPoint(QDomElement &domElement, const VSplinePoint &
|
|||
domElement.appendChild(pathPoint);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolSplinePath::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
|
||||
{
|
||||
if (event->button() == Qt::LeftButton)
|
||||
|
@ -261,6 +274,7 @@ void VToolSplinePath::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
|
|||
QGraphicsItem::mouseReleaseEvent(event);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolSplinePath::RemoveReferens()
|
||||
{
|
||||
VSplinePath splPath = *VAbstractTool::data.GeometricObject<const VSplinePath *>(id);
|
||||
|
@ -270,6 +284,7 @@ void VToolSplinePath::RemoveReferens()
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolSplinePath::SaveDialog(QDomElement &domElement)
|
||||
{
|
||||
Q_CHECK_PTR(dialog);
|
||||
|
@ -282,6 +297,7 @@ void VToolSplinePath::SaveDialog(QDomElement &domElement)
|
|||
UpdatePathPoint(domElement, splPath);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolSplinePath::RefreshGeometry()
|
||||
{
|
||||
this->setPen(QPen(currentColor, qApp->toPixel(qApp->widthHairLine())/factor));
|
||||
|
|
|
@ -31,6 +31,7 @@
|
|||
|
||||
const QString VToolTriangle::ToolType = QStringLiteral("triangle");
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VToolTriangle::VToolTriangle(VPattern *doc, VContainer *data, const quint32 &id, const quint32 &axisP1Id,
|
||||
const quint32 &axisP2Id, const quint32 &firstPointId, const quint32 &secondPointId,
|
||||
const Valentina::Sources &typeCreation, QGraphicsItem *parent)
|
||||
|
@ -48,6 +49,7 @@ VToolTriangle::VToolTriangle(VPattern *doc, VContainer *data, const quint32 &id,
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolTriangle::setDialog()
|
||||
{
|
||||
Q_CHECK_PTR(dialog);
|
||||
|
@ -61,6 +63,7 @@ void VToolTriangle::setDialog()
|
|||
dialogTool->setPointName(p->name());
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolTriangle::Create(DialogTool *dialog, VMainGraphicsScene *scene,
|
||||
VPattern *doc, VContainer *data)
|
||||
{
|
||||
|
@ -76,6 +79,7 @@ void VToolTriangle::Create(DialogTool *dialog, VMainGraphicsScene *scene,
|
|||
Document::FullParse, Valentina::FromGui);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolTriangle::Create(const quint32 _id, const QString &pointName, const quint32 &axisP1Id,
|
||||
const quint32 &axisP2Id, const quint32 &firstPointId, const quint32 &secondPointId,
|
||||
const qreal &mx, const qreal &my, VMainGraphicsScene *scene, VPattern *doc,
|
||||
|
@ -117,6 +121,7 @@ void VToolTriangle::Create(const quint32 _id, const QString &pointName, const qu
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
QPointF VToolTriangle::FindPoint(const QPointF &axisP1, const QPointF &axisP2, const QPointF &firstPoint,
|
||||
const QPointF &secondPoint)
|
||||
{
|
||||
|
@ -158,6 +163,7 @@ QPointF VToolTriangle::FindPoint(const QPointF &axisP1, const QPointF &axisP2, c
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolTriangle::FullUpdateFromFile()
|
||||
{
|
||||
QDomElement domElement = doc->elementById(QString().setNum(id));
|
||||
|
@ -171,11 +177,13 @@ void VToolTriangle::FullUpdateFromFile()
|
|||
VToolPoint::RefreshPointGeometry(*VDrawTool::data.GeometricObject<const VPointF *>(id));
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolTriangle::ShowContextMenu(QGraphicsSceneContextMenuEvent *event)
|
||||
{
|
||||
ContextMenu<DialogTriangle>(this, event);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolTriangle::RemoveReferens()
|
||||
{
|
||||
doc->DecrementReferens(axisP1Id);
|
||||
|
@ -184,11 +192,13 @@ void VToolTriangle::RemoveReferens()
|
|||
doc->DecrementReferens(secondPointId);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolTriangle::contextMenuEvent(QGraphicsSceneContextMenuEvent *event)
|
||||
{
|
||||
ContextMenu<DialogTriangle>(this, event);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolTriangle::AddToFile()
|
||||
{
|
||||
const VPointF *point = VAbstractTool::data.GeometricObject<const VPointF *>(id);
|
||||
|
@ -208,6 +218,7 @@ void VToolTriangle::AddToFile()
|
|||
AddToCalculation(domElement);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolTriangle::RefreshDataInFile()
|
||||
{
|
||||
const VPointF *point = VAbstractTool::data.GeometricObject<const VPointF *>(id);
|
||||
|
@ -224,6 +235,7 @@ void VToolTriangle::RefreshDataInFile()
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolTriangle::SaveDialog(QDomElement &domElement)
|
||||
{
|
||||
Q_CHECK_PTR(dialog);
|
||||
|
|
|
@ -32,6 +32,7 @@
|
|||
const QString VAbstractNode::AttrIdObject = QStringLiteral("idObject");
|
||||
const QString VAbstractNode::AttrIdTool = QStringLiteral("idTool");
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VAbstractNode::VAbstractNode(VPattern *doc, VContainer *data, const quint32 &id, const quint32 &idNode,
|
||||
const quint32 &idTool, QObject *parent)
|
||||
: VAbstractTool(doc, data, id, parent), idNode(idNode), idTool(idTool)
|
||||
|
@ -39,6 +40,7 @@ VAbstractNode::VAbstractNode(VPattern *doc, VContainer *data, const quint32 &id,
|
|||
_referens = 0;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VAbstractNode::DeleteNode()
|
||||
{
|
||||
if (_referens <= 1)
|
||||
|
@ -73,6 +75,7 @@ void VAbstractNode::DeleteNode()
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VAbstractNode::AddToModeling(const QDomElement &domElement)
|
||||
{
|
||||
QDomElement modelingElement;
|
||||
|
@ -88,6 +91,7 @@ void VAbstractNode::AddToModeling(const QDomElement &domElement)
|
|||
emit toolhaveChange();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VAbstractNode::decrementReferens()
|
||||
{
|
||||
if (_referens > 0)
|
||||
|
|
|
@ -34,6 +34,7 @@
|
|||
const QString VNodeArc::TagName = QStringLiteral("arc");
|
||||
const QString VNodeArc::ToolType = QStringLiteral("modeling");
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VNodeArc::VNodeArc(VPattern *doc, VContainer *data, quint32 id, quint32 idArc, const Valentina::Sources &typeCreation,
|
||||
const quint32 &idTool, QObject *qoParent, QGraphicsItem *parent)
|
||||
:VAbstractNode(doc, data, id, idArc, idTool, qoParent), QGraphicsPathItem(parent)
|
||||
|
@ -51,6 +52,7 @@ VNodeArc::VNodeArc(VPattern *doc, VContainer *data, quint32 id, quint32 idArc, c
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VNodeArc::Create(VPattern *doc, VContainer *data, quint32 id, quint32 idArc, const Document::Documents &parse,
|
||||
const Valentina::Sources &typeCreation, const quint32 &idTool, QObject *parent)
|
||||
{
|
||||
|
@ -78,17 +80,20 @@ void VNodeArc::Create(VPattern *doc, VContainer *data, quint32 id, quint32 idArc
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VNodeArc::DeleteNode()
|
||||
{
|
||||
VAbstractNode::DeleteNode();
|
||||
this->setVisible(false);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VNodeArc::FullUpdateFromFile()
|
||||
{
|
||||
RefreshGeometry();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VNodeArc::AddToFile()
|
||||
{
|
||||
QDomElement domElement = doc->createElement(TagName);
|
||||
|
@ -104,6 +109,7 @@ void VNodeArc::AddToFile()
|
|||
AddToModeling(domElement);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VNodeArc::RefreshDataInFile()
|
||||
{
|
||||
QDomElement domElement = doc->elementById(QString().setNum(id));
|
||||
|
@ -117,6 +123,7 @@ void VNodeArc::RefreshDataInFile()
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VNodeArc::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
|
||||
{
|
||||
if (event->button() == Qt::LeftButton)
|
||||
|
@ -126,18 +133,21 @@ void VNodeArc::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
|
|||
QGraphicsItem::mouseReleaseEvent(event);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VNodeArc::hoverMoveEvent(QGraphicsSceneHoverEvent *event)
|
||||
{
|
||||
Q_UNUSED(event);
|
||||
this->setPen(QPen(currentColor, qApp->toPixel(qApp->widthMainLine())));
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VNodeArc::hoverLeaveEvent(QGraphicsSceneHoverEvent *event)
|
||||
{
|
||||
Q_UNUSED(event);
|
||||
this->setPen(QPen(currentColor, qApp->toPixel(qApp->widthHairLine())));
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VNodeArc::RefreshGeometry()
|
||||
{
|
||||
const VArc *arc = VAbstractTool::data.GeometricObject<const VArc *>(id);
|
||||
|
|
|
@ -34,6 +34,7 @@
|
|||
const QString VNodePoint::TagName = QStringLiteral("point");
|
||||
const QString VNodePoint::ToolType = QStringLiteral("modeling");
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VNodePoint::VNodePoint(VPattern *doc, VContainer *data, quint32 id, quint32 idPoint,
|
||||
const Valentina::Sources &typeCreation, const quint32 &idTool, QObject *qoParent,
|
||||
QGraphicsItem *parent)
|
||||
|
@ -59,6 +60,7 @@ VNodePoint::VNodePoint(VPattern *doc, VContainer *data, quint32 id, quint32 idPo
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VNodePoint::Create(VPattern *doc, VContainer *data, quint32 id, quint32 idPoint,
|
||||
const Document::Documents &parse, const Valentina::Sources &typeCreation, const quint32 &idTool,
|
||||
QObject *parent)
|
||||
|
@ -89,17 +91,20 @@ void VNodePoint::Create(VPattern *doc, VContainer *data, quint32 id, quint32 idP
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VNodePoint::DeleteNode()
|
||||
{
|
||||
VAbstractNode::DeleteNode();
|
||||
this->setVisible(false);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VNodePoint::FullUpdateFromFile()
|
||||
{
|
||||
RefreshPointGeometry(*VAbstractTool::data.GeometricObject<const VPointF *>(id));
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VNodePoint::AddToFile()
|
||||
{
|
||||
const VPointF *point = VAbstractTool::data.GeometricObject<const VPointF *>(id);
|
||||
|
@ -118,6 +123,7 @@ void VNodePoint::AddToFile()
|
|||
AddToModeling(domElement);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VNodePoint::RefreshDataInFile()
|
||||
{
|
||||
const VPointF *point = VAbstractTool::data.GeometricObject<const VPointF *>(id);
|
||||
|
@ -134,6 +140,7 @@ void VNodePoint::RefreshDataInFile()
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VNodePoint::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
|
||||
{
|
||||
if (event->button() == Qt::LeftButton)
|
||||
|
@ -143,19 +150,21 @@ void VNodePoint::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
|
|||
QGraphicsItem::mouseReleaseEvent(event);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VNodePoint::hoverMoveEvent(QGraphicsSceneHoverEvent *event)
|
||||
{
|
||||
Q_UNUSED(event);
|
||||
this->setPen(QPen(currentColor, qApp->toPixel(qApp->widthMainLine())));
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VNodePoint::hoverLeaveEvent(QGraphicsSceneHoverEvent *event)
|
||||
{
|
||||
Q_UNUSED(event);
|
||||
this->setPen(QPen(currentColor, qApp->toPixel(qApp->widthHairLine())));
|
||||
}
|
||||
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VNodePoint::NameChangePosition(const QPointF &pos)
|
||||
{
|
||||
VPointF *point = new VPointF(*VAbstractTool::data.GeometricObject<const VPointF *>(id));
|
||||
|
@ -167,6 +176,7 @@ void VNodePoint::NameChangePosition(const QPointF &pos)
|
|||
VAbstractTool::data.UpdateGObject(id, point);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VNodePoint::UpdateNamePosition(qreal mx, qreal my)
|
||||
{
|
||||
QDomElement domElement = doc->elementById(QString().setNum(id));
|
||||
|
@ -178,6 +188,7 @@ void VNodePoint::UpdateNamePosition(qreal mx, qreal my)
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VNodePoint::RefreshPointGeometry(const VPointF &point)
|
||||
{
|
||||
QRectF rec = QRectF(0, 0, radius*2, radius*2);
|
||||
|
@ -194,6 +205,7 @@ void VNodePoint::RefreshPointGeometry(const VPointF &point)
|
|||
RefreshLine();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VNodePoint::RefreshLine()
|
||||
{
|
||||
QRectF nameRec = namePoint->sceneBoundingRect();
|
||||
|
|
|
@ -34,6 +34,7 @@
|
|||
const QString VNodeSpline::TagName = QStringLiteral("spline");
|
||||
const QString VNodeSpline::ToolType = QStringLiteral("modelingSpline");
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VNodeSpline::VNodeSpline(VPattern *doc, VContainer *data, quint32 id, quint32 idSpline,
|
||||
const Valentina::Sources &typeCreation, const quint32 &idTool, QObject *qoParent,
|
||||
QGraphicsItem * parent)
|
||||
|
@ -52,6 +53,7 @@ VNodeSpline::VNodeSpline(VPattern *doc, VContainer *data, quint32 id, quint32 id
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VNodeSpline *VNodeSpline::Create(VPattern *doc, VContainer *data, quint32 id, quint32 idSpline,
|
||||
const Document::Documents &parse, const Valentina::Sources &typeCreation,
|
||||
const quint32 &idTool, QObject *parent)
|
||||
|
@ -82,17 +84,20 @@ VNodeSpline *VNodeSpline::Create(VPattern *doc, VContainer *data, quint32 id, qu
|
|||
return spl;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VNodeSpline::DeleteNode()
|
||||
{
|
||||
VAbstractNode::DeleteNode();
|
||||
this->setVisible(false);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VNodeSpline::FullUpdateFromFile()
|
||||
{
|
||||
RefreshGeometry();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VNodeSpline::AddToFile()
|
||||
{
|
||||
QDomElement domElement = doc->createElement(TagName);
|
||||
|
@ -108,6 +113,7 @@ void VNodeSpline::AddToFile()
|
|||
AddToModeling(domElement);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VNodeSpline::RefreshDataInFile()
|
||||
{
|
||||
QDomElement domElement = doc->elementById(QString().setNum(id));
|
||||
|
@ -121,6 +127,7 @@ void VNodeSpline::RefreshDataInFile()
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VNodeSpline::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
|
||||
{
|
||||
if (event->button() == Qt::LeftButton)
|
||||
|
@ -130,18 +137,21 @@ void VNodeSpline::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
|
|||
QGraphicsItem::mouseReleaseEvent(event);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VNodeSpline::hoverMoveEvent(QGraphicsSceneHoverEvent *event)
|
||||
{
|
||||
Q_UNUSED(event);
|
||||
this->setPen(QPen(currentColor, qApp->toPixel(qApp->widthMainLine())));
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VNodeSpline::hoverLeaveEvent(QGraphicsSceneHoverEvent *event)
|
||||
{
|
||||
Q_UNUSED(event);
|
||||
this->setPen(QPen(currentColor, qApp->toPixel(qApp->widthHairLine())));
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VNodeSpline::RefreshGeometry()
|
||||
{
|
||||
const VSpline *spl = VAbstractTool::data.GeometricObject<const VSpline *>(id);
|
||||
|
|
|
@ -34,6 +34,7 @@
|
|||
const QString VNodeSplinePath::TagName = QStringLiteral("spline");
|
||||
const QString VNodeSplinePath::ToolType = QStringLiteral("modelingPath");
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VNodeSplinePath::VNodeSplinePath(VPattern *doc, VContainer *data, quint32 id, quint32 idSpline,
|
||||
const Valentina::Sources &typeCreation, const quint32 &idTool, QObject *qoParent,
|
||||
QGraphicsItem * parent)
|
||||
|
@ -52,6 +53,7 @@ VNodeSplinePath::VNodeSplinePath(VPattern *doc, VContainer *data, quint32 id, qu
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VNodeSplinePath::Create(VPattern *doc, VContainer *data, quint32 id, quint32 idSpline,
|
||||
const Document::Documents &parse, const Valentina::Sources &typeCreation,
|
||||
const quint32 &idTool, QObject *parent)
|
||||
|
@ -85,17 +87,20 @@ void VNodeSplinePath::Create(VPattern *doc, VContainer *data, quint32 id, quint3
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VNodeSplinePath::DeleteNode()
|
||||
{
|
||||
VAbstractNode::DeleteNode();
|
||||
this->setVisible(false);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VNodeSplinePath::FullUpdateFromFile()
|
||||
{
|
||||
RefreshGeometry();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VNodeSplinePath::AddToFile()
|
||||
{
|
||||
QDomElement domElement = doc->createElement(TagName);
|
||||
|
@ -111,6 +116,7 @@ void VNodeSplinePath::AddToFile()
|
|||
AddToModeling(domElement);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VNodeSplinePath::RefreshDataInFile()
|
||||
{
|
||||
QDomElement domElement = doc->elementById(QString().setNum(id));
|
||||
|
@ -124,6 +130,7 @@ void VNodeSplinePath::RefreshDataInFile()
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VNodeSplinePath::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
|
||||
{
|
||||
if (event->button() == Qt::LeftButton)
|
||||
|
@ -133,18 +140,21 @@ void VNodeSplinePath::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
|
|||
QGraphicsItem::mouseReleaseEvent(event);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VNodeSplinePath::hoverMoveEvent(QGraphicsSceneHoverEvent *event)
|
||||
{
|
||||
Q_UNUSED(event);
|
||||
this->setPen(QPen(currentColor, qApp->toPixel(qApp->widthMainLine())));
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VNodeSplinePath::hoverLeaveEvent(QGraphicsSceneHoverEvent *event)
|
||||
{
|
||||
Q_UNUSED(event);
|
||||
this->setPen(QPen(currentColor, qApp->toPixel(qApp->widthHairLine())));
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VNodeSplinePath::RefreshGeometry()
|
||||
{
|
||||
const VSplinePath *splPath = VAbstractTool::data.GeometricObject<const VSplinePath *>(id);
|
||||
|
|
|
@ -70,6 +70,7 @@ const QString VAbstractTool::TypeLineDotLine = QStringLiteral("dotLine");
|
|||
const QString VAbstractTool::TypeLineDashDotLine = QStringLiteral("dashDotLine");
|
||||
const QString VAbstractTool::TypeLineDashDotDotLine = QStringLiteral("dashDotDotLine");
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VAbstractTool::VAbstractTool(VPattern *doc, VContainer *data, quint32 id, QObject *parent)
|
||||
:VDataTool(data, parent), doc(doc), id(id), baseColor(Qt::black), currentColor(Qt::black), typeLine(TypeLineLine)
|
||||
{
|
||||
|
@ -80,6 +81,7 @@ VAbstractTool::VAbstractTool(VPattern *doc, VContainer *data, quint32 id, QObjec
|
|||
emit toolhaveChange();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VAbstractTool::NewSceneRect(QGraphicsScene *sc, QGraphicsView *view)
|
||||
{
|
||||
QRectF rect = sc->itemsBoundingRect();
|
||||
|
@ -108,6 +110,7 @@ void VAbstractTool::NewSceneRect(QGraphicsScene *sc, QGraphicsView *view)
|
|||
sc->setSceneRect(rec1);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
QPointF VAbstractTool::LineIntersectRect(QRectF rec, QLineF line)
|
||||
{
|
||||
qreal x1, y1, x2, y2;
|
||||
|
@ -137,6 +140,7 @@ QPointF VAbstractTool::LineIntersectRect(QRectF rec, QLineF line)
|
|||
return point;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
qint32 VAbstractTool::LineIntersectCircle(const QPointF ¢er, qreal radius, const QLineF &line, QPointF &p1,
|
||||
QPointF &p2)
|
||||
{
|
||||
|
@ -172,6 +176,7 @@ qint32 VAbstractTool::LineIntersectCircle(const QPointF ¢er, qreal radius, c
|
|||
return flag;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
QPointF VAbstractTool::ClosestPoint(const QLineF &line, const QPointF &point)
|
||||
{
|
||||
qreal a = 0, b = 0, c = 0;
|
||||
|
@ -191,11 +196,13 @@ QPointF VAbstractTool::ClosestPoint(const QLineF &line, const QPointF &point)
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
QPointF VAbstractTool::addVector(const QPointF &p, const QPointF &p1, const QPointF &p2, qreal k)
|
||||
{
|
||||
return QPointF (p.x() + (p2.x() - p1.x()) * k, p.y() + (p2.y() - p1.y()) * k);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VAbstractTool::RemoveAllChild(QDomElement &domElement)
|
||||
{
|
||||
if ( domElement.hasChildNodes() )
|
||||
|
@ -207,6 +214,7 @@ void VAbstractTool::RemoveAllChild(QDomElement &domElement)
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VAbstractTool::DeleteTool(QGraphicsItem *tool)
|
||||
{
|
||||
if (_referens <= 1)
|
||||
|
@ -257,6 +265,7 @@ void VAbstractTool::DeleteTool(QGraphicsItem *tool)
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
Qt::PenStyle VAbstractTool::LineStyle()
|
||||
{
|
||||
QStringList styles = Styles();
|
||||
|
@ -286,6 +295,7 @@ Qt::PenStyle VAbstractTool::LineStyle()
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VAbstractTool::LineCoefficients(const QLineF &line, qreal *a, qreal *b, qreal *c)
|
||||
{
|
||||
//coefficient for equation of segment
|
||||
|
@ -295,6 +305,7 @@ void VAbstractTool::LineCoefficients(const QLineF &line, qreal *a, qreal *b, qre
|
|||
*c = - *a * p1.x() - *b * p1.y();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
const QStringList VAbstractTool::Styles()
|
||||
{
|
||||
//Keep synchronize with DialogTool lineStyles list!!!
|
||||
|
@ -304,6 +315,7 @@ const QStringList VAbstractTool::Styles()
|
|||
return styles;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VAbstractTool::AddRecord(const quint32 id, const Valentina::Tools &toolType, VPattern *doc)
|
||||
{
|
||||
quint32 cursor = doc->getCursor();
|
||||
|
|
|
@ -28,11 +28,13 @@
|
|||
|
||||
#include "vdatatool.h"
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VDataTool::VDataTool(VContainer *data, QObject *parent): QObject(parent), data(*data), _referens(1)
|
||||
{
|
||||
Q_CHECK_PTR(data);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VDataTool &VDataTool::operator =(const VDataTool &tool)
|
||||
{
|
||||
data = tool.getData();
|
||||
|
@ -40,6 +42,7 @@ VDataTool &VDataTool::operator =(const VDataTool &tool)
|
|||
return *this;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VDataTool::decrementReferens()
|
||||
{
|
||||
if (_referens > 0)
|
||||
|
|
|
@ -50,6 +50,7 @@ const QString VToolDetail::NodePoint = QStringLiteral("NodePoint");
|
|||
const QString VToolDetail::NodeSpline = QStringLiteral("NodeSpline");
|
||||
const QString VToolDetail::NodeSplinePath = QStringLiteral("NodeSplinePath");
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VToolDetail::VToolDetail(VPattern *doc, VContainer *data, const quint32 &id, const Valentina::Sources &typeCreation,
|
||||
VMainGraphicsScene *scene, QGraphicsItem *parent)
|
||||
:VAbstractTool(doc, data, id), QGraphicsPathItem(parent), dialog(nullptr), sceneDetails(scene)
|
||||
|
@ -89,11 +90,13 @@ VToolDetail::VToolDetail(VPattern *doc, VContainer *data, const quint32 &id, con
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VToolDetail::~VToolDetail()
|
||||
{
|
||||
delete dialog;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolDetail::setDialog()
|
||||
{
|
||||
Q_CHECK_PTR(dialog);
|
||||
|
@ -103,6 +106,7 @@ void VToolDetail::setDialog()
|
|||
dialogTool->setDetails(detail);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolDetail::Create(DialogTool *dialog, VMainGraphicsScene *scene, VPattern *doc, VContainer *data)
|
||||
{
|
||||
Q_CHECK_PTR(dialog);
|
||||
|
@ -150,6 +154,7 @@ void VToolDetail::Create(DialogTool *dialog, VMainGraphicsScene *scene, VPattern
|
|||
Create(0, det, scene, doc, data, Document::FullParse, Valentina::FromGui);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolDetail::Create(const quint32 &_id, const VDetail &newDetail, VMainGraphicsScene *scene, VPattern *doc,
|
||||
VContainer *data, const Document::Documents &parse, const Valentina::Sources &typeCreation)
|
||||
{
|
||||
|
@ -177,16 +182,19 @@ void VToolDetail::Create(const quint32 &_id, const VDetail &newDetail, VMainGrap
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolDetail::Remove()
|
||||
{
|
||||
DeleteTool(this);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolDetail::FullUpdateFromFile()
|
||||
{
|
||||
RefreshGeometry();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolDetail::FullUpdateFromGui(int result)
|
||||
{
|
||||
if (result == QDialog::Accepted)
|
||||
|
@ -226,6 +234,7 @@ void VToolDetail::FullUpdateFromGui(int result)
|
|||
dialog = 0;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolDetail::AddToFile()
|
||||
{
|
||||
VDetail detail = VAbstractTool::data.GetDetail(id);
|
||||
|
@ -252,6 +261,7 @@ void VToolDetail::AddToFile()
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolDetail::RefreshDataInFile()
|
||||
{
|
||||
QDomElement domElement = doc->elementById(QString().setNum(id));
|
||||
|
@ -270,6 +280,7 @@ void VToolDetail::RefreshDataInFile()
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
QVariant VToolDetail::itemChange(QGraphicsItem::GraphicsItemChange change, const QVariant &value)
|
||||
{
|
||||
if (change == ItemPositionHasChanged && scene())
|
||||
|
@ -306,6 +317,7 @@ QVariant VToolDetail::itemChange(QGraphicsItem::GraphicsItemChange change, const
|
|||
return QGraphicsItem::itemChange(change, value);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolDetail::keyReleaseEvent(QKeyEvent *event)
|
||||
{
|
||||
switch (event->key())
|
||||
|
@ -319,6 +331,7 @@ void VToolDetail::keyReleaseEvent(QKeyEvent *event)
|
|||
QGraphicsItem::keyReleaseEvent ( event );
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolDetail::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
|
||||
{
|
||||
if (event->button() == Qt::LeftButton)
|
||||
|
@ -328,6 +341,7 @@ void VToolDetail::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
|
|||
QGraphicsItem::mouseReleaseEvent(event);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolDetail::contextMenuEvent(QGraphicsSceneContextMenuEvent *event)
|
||||
{
|
||||
QMenu menu;
|
||||
|
@ -359,6 +373,7 @@ void VToolDetail::contextMenuEvent(QGraphicsSceneContextMenuEvent *event)
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolDetail::RemoveReferens()
|
||||
{
|
||||
VDetail detail = VAbstractTool::data.GetDetail(id);
|
||||
|
@ -368,6 +383,7 @@ void VToolDetail::RemoveReferens()
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolDetail::AddNode(QDomElement &domElement, const VNodeDetail &node)
|
||||
{
|
||||
QDomElement nod = doc->createElement(TagNode);
|
||||
|
@ -404,12 +420,14 @@ void VToolDetail::AddNode(QDomElement &domElement, const VNodeDetail &node)
|
|||
domElement.appendChild(nod);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolDetail::RefreshGeometry()
|
||||
{
|
||||
QPainterPath path = VEquidistant().ContourPath(id, this->getData());
|
||||
this->setPath(path);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
template <typename Tool>
|
||||
//cppcheck-suppress unusedFunction
|
||||
void VToolDetail::InitTool(VMainGraphicsScene *scene, const VNodeDetail &node)
|
||||
|
|
|
@ -41,6 +41,7 @@ const QString VToolUnionDetails::AttrNodeType = QStringLiteral("nodeType");
|
|||
const QString VToolUnionDetails::NodeTypeContour = QStringLiteral("Contour");
|
||||
const QString VToolUnionDetails::NodeTypeModeling = QStringLiteral("Modeling");
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VToolUnionDetails::VToolUnionDetails(VPattern *doc, VContainer *data, const quint32 &id, const VDetail &d1,
|
||||
const VDetail &d2, const quint32 &indexD1, const quint32 &indexD2,
|
||||
const Valentina::Sources &typeCreation, QObject *parent)
|
||||
|
@ -56,6 +57,7 @@ VToolUnionDetails::VToolUnionDetails(VPattern *doc, VContainer *data, const quin
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolUnionDetails::AddToNewDetail(QObject *tool, VPattern *doc, VContainer *data, VDetail &newDetail,
|
||||
const VDetail &det, const ptrdiff_t &i, const quint32 &idTool, const qreal &dx,
|
||||
const qreal &dy, const quint32 &pRotate, const qreal &angle)
|
||||
|
@ -222,6 +224,7 @@ void VToolUnionDetails::AddToNewDetail(QObject *tool, VPattern *doc, VContainer
|
|||
newDetail.append(VNodeDetail(id, det.at(i).getTypeTool(), NodeDetail::Contour));
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolUnionDetails::UpdatePoints(const quint32 &idDetail, VContainer *data, const VDetail &det, const ptrdiff_t &i,
|
||||
quint32 &idCount, const qreal &dx, const qreal &dy, const quint32 &pRotate,
|
||||
const qreal &angle)
|
||||
|
@ -369,6 +372,7 @@ void VToolUnionDetails::UpdatePoints(const quint32 &idDetail, VContainer *data,
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolUnionDetails::BiasRotatePoint(VPointF *point, const qreal &dx, const qreal &dy, const QPointF &pRotate,
|
||||
const qreal angle)
|
||||
{
|
||||
|
@ -380,6 +384,7 @@ void VToolUnionDetails::BiasRotatePoint(VPointF *point, const qreal &dx, const q
|
|||
point->setY(line.p2().y());
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolUnionDetails::Create(DialogTool *dialog, VMainGraphicsScene *scene, VPattern *doc, VContainer *data)
|
||||
{
|
||||
Q_CHECK_PTR(dialog);
|
||||
|
@ -393,6 +398,7 @@ void VToolUnionDetails::Create(DialogTool *dialog, VMainGraphicsScene *scene, VP
|
|||
Valentina::FromGui);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolUnionDetails::Create(const quint32 _id, const VDetail &d1, const VDetail &d2, const quint32 &d1id,
|
||||
const quint32 &d2id, const quint32 &indexD1, const quint32 &indexD2,
|
||||
VMainGraphicsScene *scene, VPattern *doc, VContainer *data,
|
||||
|
@ -528,6 +534,7 @@ void VToolUnionDetails::Create(const quint32 _id, const VDetail &d1, const VDeta
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolUnionDetails::PointsOnEdge(const VDetail &d, const qint32 &index, VPointF &p1, VPointF &p2, VContainer *data)
|
||||
{
|
||||
VNodeDetail det2p1;
|
||||
|
@ -537,6 +544,7 @@ void VToolUnionDetails::PointsOnEdge(const VDetail &d, const qint32 &index, VPoi
|
|||
p2 = VPointF(*data->GeometricObject<const VPointF *>(det2p2.getId()));
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolUnionDetails::FindJ(const qint32 &pointsD2, const VDetail &d2, const qint32 &indexD2, qint32 &j)
|
||||
{
|
||||
if (pointsD2 == 0)
|
||||
|
@ -556,6 +564,7 @@ void VToolUnionDetails::FindJ(const qint32 &pointsD2, const VDetail &d2, const q
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
QVector<VDetail> VToolUnionDetails::GetDetailFromFile(VPattern *doc, const QDomElement &domElement)
|
||||
{
|
||||
QVector<VDetail> vector;
|
||||
|
@ -611,6 +620,7 @@ QVector<VDetail> VToolUnionDetails::GetDetailFromFile(VPattern *doc, const QDomE
|
|||
return vector;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolUnionDetails::AddToFile()
|
||||
{
|
||||
QDomElement domElement = doc->createElement(TagName);
|
||||
|
@ -626,6 +636,7 @@ void VToolUnionDetails::AddToFile()
|
|||
AddToModeling(domElement);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolUnionDetails::RefreshDataInFile()
|
||||
{
|
||||
QDomElement domElement = doc->elementById(QString().setNum(id));
|
||||
|
@ -640,6 +651,7 @@ void VToolUnionDetails::RefreshDataInFile()
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolUnionDetails::AddDetail(QDomElement &domElement, VDetail &d)
|
||||
{
|
||||
QDomElement det = doc->createElement(TagDetail);
|
||||
|
@ -652,6 +664,7 @@ void VToolUnionDetails::AddDetail(QDomElement &domElement, VDetail &d)
|
|||
domElement.appendChild(det);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolUnionDetails::AddNode(QDomElement &domElement, const VNodeDetail &node)
|
||||
{
|
||||
QDomElement nod = doc->createElement(TagNode);
|
||||
|
@ -688,6 +701,7 @@ void VToolUnionDetails::AddNode(QDomElement &domElement, const VNodeDetail &node
|
|||
domElement.appendChild(nod);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
QDomNode VToolUnionDetails::UpdateDetail(const QDomNode &domNode, const VDetail &d)
|
||||
{
|
||||
//QDomNode domNode = domElement.firstChild();
|
||||
|
@ -713,6 +727,7 @@ QDomNode VToolUnionDetails::UpdateDetail(const QDomNode &domNode, const VDetail
|
|||
return domNode.nextSibling();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolUnionDetails::AddToModeling(const QDomElement &domElement)
|
||||
{
|
||||
QDomElement modelingElement;
|
||||
|
|
|
@ -30,6 +30,7 @@
|
|||
|
||||
#include <QDoubleSpinBox>
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
//cppcheck-suppress unusedFunction
|
||||
QWidget *DoubleSpinBoxDelegate::createEditor(QWidget *parent, const QStyleOptionViewItem &option,
|
||||
const QModelIndex &index ) const
|
||||
|
@ -43,6 +44,7 @@ QWidget *DoubleSpinBoxDelegate::createEditor(QWidget *parent, const QStyleOption
|
|||
return editor;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
//cppcheck-suppress unusedFunction
|
||||
void DoubleSpinBoxDelegate::setEditorData(QWidget *editor, const QModelIndex &index) const
|
||||
{
|
||||
|
@ -53,6 +55,7 @@ void DoubleSpinBoxDelegate::setEditorData(QWidget *editor, const QModelIndex &in
|
|||
spinBox->setValue(value);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
//cppcheck-suppress unusedFunction
|
||||
void DoubleSpinBoxDelegate::setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const
|
||||
{
|
||||
|
@ -64,6 +67,7 @@ void DoubleSpinBoxDelegate::setModelData(QWidget *editor, QAbstractItemModel *mo
|
|||
model->setData(index, value, Qt::EditRole);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
//cppcheck-suppress unusedFunction
|
||||
void DoubleSpinBoxDelegate::updateEditorGeometry(QWidget *editor, const QStyleOptionViewItem &option,
|
||||
const QModelIndex &index) const
|
||||
|
@ -72,6 +76,7 @@ void DoubleSpinBoxDelegate::updateEditorGeometry(QWidget *editor, const QStyleOp
|
|||
editor->setGeometry(option.rect);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DoubleSpinBoxDelegate::commitAndCloseEditor()
|
||||
{
|
||||
QDoubleSpinBox *spinBox = qobject_cast<QDoubleSpinBox*>(sender());
|
||||
|
|
|
@ -30,6 +30,7 @@
|
|||
|
||||
#include <QLineEdit>
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
TextDelegate::TextDelegate(const QString ®ex, QObject *parent): QItemDelegate(parent), lastText(QString("Name_")),
|
||||
regex(regex)
|
||||
{
|
||||
|
@ -37,6 +38,7 @@ TextDelegate::TextDelegate(const QString ®ex, QObject *parent): QItemDelegate
|
|||
connect(this, &TextDelegate::SaveText, this, &TextDelegate::InitText);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
QWidget *TextDelegate::createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const
|
||||
{
|
||||
Q_UNUSED(option);
|
||||
|
@ -48,6 +50,7 @@ QWidget *TextDelegate::createEditor(QWidget *parent, const QStyleOptionViewItem
|
|||
return editor;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void TextDelegate::setEditorData(QWidget *editor, const QModelIndex &index) const
|
||||
{
|
||||
QString text = index.model()->data(index, Qt::EditRole).toString();
|
||||
|
@ -62,6 +65,7 @@ void TextDelegate::setEditorData(QWidget *editor, const QModelIndex &index) cons
|
|||
lineEdit->setText(text);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void TextDelegate::setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const
|
||||
{
|
||||
QLineEdit *lineEdit = qobject_cast<QLineEdit*>(editor);
|
||||
|
@ -75,6 +79,7 @@ void TextDelegate::setModelData(QWidget *editor, QAbstractItemModel *model, cons
|
|||
model->setData(index, text, Qt::EditRole);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void TextDelegate::updateEditorGeometry(QWidget *editor, const QStyleOptionViewItem &option,
|
||||
const QModelIndex &index) const
|
||||
{
|
||||
|
@ -82,6 +87,7 @@ void TextDelegate::updateEditorGeometry(QWidget *editor, const QStyleOptionViewI
|
|||
editor->setGeometry(option.rect);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void TextDelegate::commitAndCloseEditor()
|
||||
{
|
||||
QLineEdit *lineEdit = qobject_cast<QLineEdit*>(sender());
|
||||
|
@ -100,6 +106,7 @@ void TextDelegate::commitAndCloseEditor()
|
|||
emit closeEditor(lineEdit);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void TextDelegate::InitText(const QString &text)
|
||||
{
|
||||
lastText = text;
|
||||
|
|
|
@ -40,6 +40,7 @@ const qreal VApplication::PrintDPI = 96.0;
|
|||
|
||||
#define DefWidth 1.2//mm
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VApplication::VApplication(int &argc, char **argv)
|
||||
: QApplication(argc, argv), _patternUnit(Valentina::Cm), _patternType(Pattern::Individual),
|
||||
_widthMainLine(DefWidth), _widthHairLine(DefWidth/3.0)
|
||||
|
@ -47,6 +48,7 @@ VApplication::VApplication(int &argc, char **argv)
|
|||
InitLineWidth();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
// reimplemented from QApplication so we can throw exceptions in slots
|
||||
bool VApplication::notify(QObject *receiver, QEvent *event)
|
||||
{
|
||||
|
@ -91,6 +93,7 @@ bool VApplication::notify(QObject *receiver, QEvent *event)
|
|||
return false;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
double VApplication::toPixel(double unit) const
|
||||
{
|
||||
double result = 0;
|
||||
|
@ -111,6 +114,7 @@ double VApplication::toPixel(double unit) const
|
|||
return result;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
double VApplication::fromPixel(double pix) const
|
||||
{
|
||||
double result = 0;
|
||||
|
@ -130,6 +134,8 @@ double VApplication::fromPixel(double pix) const
|
|||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
QString VApplication::pathToTables() const
|
||||
{
|
||||
if (_patternType == Pattern::Individual)
|
||||
|
@ -158,6 +164,7 @@ QString VApplication::pathToTables() const
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
QString VApplication::translationsPath() const
|
||||
{
|
||||
#ifdef Q_OS_WIN
|
||||
|
@ -171,7 +178,7 @@ QString VApplication::translationsPath() const
|
|||
#endif
|
||||
}
|
||||
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VApplication::InitLineWidth()
|
||||
{
|
||||
switch (_patternUnit)
|
||||
|
@ -192,7 +199,7 @@ void VApplication::InitLineWidth()
|
|||
_widthHairLine = _widthMainLine/3.0;
|
||||
}
|
||||
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VApplication::setPatternUnit(const Valentina::Units &patternUnit)
|
||||
{
|
||||
_patternUnit = patternUnit;
|
||||
|
|
|
@ -32,6 +32,7 @@
|
|||
#include <QPen>
|
||||
#include "../widgets/vapplication.h"
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VControlPointSpline::VControlPointSpline(const qint32 &indexSpline, SplinePoint::Position position,
|
||||
const QPointF &controlPoint, const QPointF &splinePoint,
|
||||
QGraphicsItem *parent)
|
||||
|
@ -57,18 +58,21 @@ VControlPointSpline::VControlPointSpline(const qint32 &indexSpline, SplinePoint:
|
|||
controlLine->setFlag(QGraphicsItem::ItemStacksBehindParent, true);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VControlPointSpline::hoverMoveEvent(QGraphicsSceneHoverEvent *event)
|
||||
{
|
||||
Q_UNUSED(event);
|
||||
this->setPen(QPen(Qt::black, qApp->toPixel(qApp->widthMainLine())));
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VControlPointSpline::hoverLeaveEvent(QGraphicsSceneHoverEvent *event)
|
||||
{
|
||||
Q_UNUSED(event);
|
||||
this->setPen(QPen(Qt::black, qApp->toPixel(qApp->widthHairLine())));
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
QVariant VControlPointSpline::itemChange(QGraphicsItem::GraphicsItemChange change, const QVariant &value)
|
||||
{
|
||||
if (change == ItemPositionChange && scene())
|
||||
|
@ -80,6 +84,7 @@ QVariant VControlPointSpline::itemChange(QGraphicsItem::GraphicsItemChange chang
|
|||
return QGraphicsItem::itemChange(change, value);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VControlPointSpline::RefreshLine(const qint32 &indexSpline, SplinePoint::Position pos,
|
||||
const QPointF &controlPoint, const QPointF &splinePoint)
|
||||
{
|
||||
|
@ -91,6 +96,7 @@ void VControlPointSpline::RefreshLine(const qint32 &indexSpline, SplinePoint::Po
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VControlPointSpline::setEnabledPoint(bool enable)
|
||||
{
|
||||
if (enable == true)
|
||||
|
|
|
@ -30,6 +30,7 @@
|
|||
|
||||
#include <QtWidgets>
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VGraphicsSimpleTextItem::VGraphicsSimpleTextItem(QGraphicsItem * parent)
|
||||
:QGraphicsSimpleTextItem(parent), fontSize(0)
|
||||
{
|
||||
|
@ -43,6 +44,7 @@ VGraphicsSimpleTextItem::VGraphicsSimpleTextItem(QGraphicsItem * parent)
|
|||
this->setFont(font);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VGraphicsSimpleTextItem::VGraphicsSimpleTextItem( const QString & text, QGraphicsItem * parent )
|
||||
:QGraphicsSimpleTextItem(text, parent), fontSize(0)
|
||||
{
|
||||
|
@ -52,6 +54,7 @@ VGraphicsSimpleTextItem::VGraphicsSimpleTextItem( const QString & text, QGraphic
|
|||
this->setAcceptHoverEvents(true);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
QVariant VGraphicsSimpleTextItem::itemChange(GraphicsItemChange change, const QVariant &value)
|
||||
{
|
||||
if (change == ItemPositionChange && scene())
|
||||
|
@ -62,18 +65,21 @@ QVariant VGraphicsSimpleTextItem::itemChange(GraphicsItemChange change, const QV
|
|||
return QGraphicsItem::itemChange(change, value);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VGraphicsSimpleTextItem::hoverMoveEvent(QGraphicsSceneHoverEvent *event)
|
||||
{
|
||||
Q_UNUSED(event);
|
||||
this->setBrush(Qt::green);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VGraphicsSimpleTextItem::hoverLeaveEvent(QGraphicsSceneHoverEvent *event)
|
||||
{
|
||||
Q_UNUSED(event);
|
||||
this->setBrush(Qt::black);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VGraphicsSimpleTextItem::contextMenuEvent(QGraphicsSceneContextMenuEvent *event)
|
||||
{
|
||||
emit ShowContextMenu(event);
|
||||
|
|
|
@ -32,22 +32,21 @@
|
|||
#include <QDebug>
|
||||
#include "../widgets/vapplication.h"
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VItem::VItem (const QPainterPath & path, int numInList, QGraphicsItem * parent )
|
||||
:QGraphicsPathItem ( path, parent ), numInOutList(numInList), paper(nullptr)
|
||||
{
|
||||
}
|
||||
{}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VItem::VItem():numInOutList(0), paper(nullptr)
|
||||
{
|
||||
|
||||
}
|
||||
{}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VItem::VItem(int numInList, QGraphicsItem *parent):QGraphicsPathItem (parent), numInOutList(numInList),
|
||||
paper(nullptr)
|
||||
{
|
||||
|
||||
}
|
||||
{}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VItem::checkItemChange()
|
||||
{
|
||||
QRectF rect;
|
||||
|
@ -87,6 +86,7 @@ void VItem::checkItemChange()
|
|||
//qDebug()<<"list="<<list.size();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
QVariant VItem::itemChange( GraphicsItemChange change, const QVariant &value )
|
||||
{
|
||||
if ( change == QGraphicsItem::ItemPositionHasChanged && scene() )
|
||||
|
@ -102,6 +102,7 @@ QVariant VItem::itemChange( GraphicsItemChange change, const QVariant &value )
|
|||
return QGraphicsPathItem::itemChange( change, value );
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VItem::LengthChanged()
|
||||
{
|
||||
checkItemChange();
|
||||
|
|
|
@ -30,43 +30,49 @@
|
|||
|
||||
#include <QtWidgets>
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VMainGraphicsScene::VMainGraphicsScene()
|
||||
:QGraphicsScene(), horScrollBar(0), verScrollBar(0), scaleFactor(1), _transform(QTransform())
|
||||
{
|
||||
}
|
||||
{}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VMainGraphicsScene::VMainGraphicsScene(const QRectF & sceneRect, QObject * parent)
|
||||
:QGraphicsScene ( sceneRect, parent ), horScrollBar(0), verScrollBar(0), scaleFactor(1), _transform(QTransform())
|
||||
{
|
||||
}
|
||||
{}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VMainGraphicsScene::mouseMoveEvent(QGraphicsSceneMouseEvent* event)
|
||||
{
|
||||
emit mouseMove(event->scenePos());
|
||||
QGraphicsScene::mouseMoveEvent(event);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VMainGraphicsScene::mousePressEvent(QGraphicsSceneMouseEvent *event)
|
||||
{
|
||||
emit mousePress(event->scenePos());
|
||||
QGraphicsScene::mousePressEvent(event);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
QTransform VMainGraphicsScene::transform() const
|
||||
{
|
||||
return _transform;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VMainGraphicsScene::setTransform(const QTransform &transform)
|
||||
{
|
||||
_transform = transform;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VMainGraphicsScene::ChoosedItem(quint32 id, const Valentina::Scenes &type)
|
||||
{
|
||||
emit ChoosedObject(id, type);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VMainGraphicsScene::SetFactor(qreal factor)
|
||||
{
|
||||
scaleFactor=scaleFactor*factor;
|
||||
|
|
|
@ -34,6 +34,7 @@
|
|||
#include <QScrollBar>
|
||||
#include "../tools/vabstracttool.h"
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VMainGraphicsView::VMainGraphicsView(QWidget *parent)
|
||||
:QGraphicsView(parent), _numScheduledScalings(0)
|
||||
{
|
||||
|
@ -42,6 +43,7 @@ VMainGraphicsView::VMainGraphicsView(QWidget *parent)
|
|||
this->setRenderHints(QPainter::Antialiasing | QPainter::SmoothPixmapTransform);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
//cppcheck-suppress unusedFunction
|
||||
void VMainGraphicsView::wheelEvent(QWheelEvent *event)
|
||||
{
|
||||
|
@ -68,6 +70,7 @@ void VMainGraphicsView::wheelEvent(QWheelEvent *event)
|
|||
anim->start();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VMainGraphicsView::scalingTime(qreal x)
|
||||
{
|
||||
Q_UNUSED(x);
|
||||
|
@ -86,6 +89,7 @@ void VMainGraphicsView::scalingTime(qreal x)
|
|||
emit NewFactor(factor);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VMainGraphicsView::scrollingTime(qreal x)
|
||||
{
|
||||
Q_UNUSED(x);
|
||||
|
@ -105,6 +109,7 @@ void VMainGraphicsView::scrollingTime(qreal x)
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VMainGraphicsView::animFinished()
|
||||
{
|
||||
if (_numScheduledScalings > 0)
|
||||
|
@ -118,6 +123,7 @@ void VMainGraphicsView::animFinished()
|
|||
sender()->~QObject();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VMainGraphicsView::mousePressEvent(QMouseEvent *mousePress)
|
||||
{
|
||||
if (mousePress->button() & Qt::LeftButton)
|
||||
|
@ -135,6 +141,7 @@ void VMainGraphicsView::mousePressEvent(QMouseEvent *mousePress)
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VMainGraphicsView::mouseReleaseEvent(QMouseEvent *event)
|
||||
{
|
||||
QGraphicsView::mouseReleaseEvent ( event );
|
||||
|
|
|
@ -31,6 +31,7 @@
|
|||
#include <QPen>
|
||||
#include <QGraphicsSceneMouseEvent>
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VSimpleArc::VSimpleArc(quint32 id, Qt::GlobalColor *currentColor, qreal *factor, QObject *parent)
|
||||
:QObject(parent), QGraphicsPathItem(), id (id), factor(factor), currentColor(currentColor)
|
||||
{
|
||||
|
@ -46,6 +47,7 @@ VSimpleArc::VSimpleArc(quint32 id, Qt::GlobalColor *currentColor, qreal *factor,
|
|||
setAcceptHoverEvents(true);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VSimpleArc::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
|
||||
{
|
||||
if (event->button() == Qt::LeftButton)
|
||||
|
@ -55,6 +57,7 @@ void VSimpleArc::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
|
|||
QGraphicsItem::mouseReleaseEvent(event);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VSimpleArc::hoverMoveEvent(QGraphicsSceneHoverEvent *event)
|
||||
{
|
||||
Q_UNUSED(event);
|
||||
|
@ -68,6 +71,7 @@ void VSimpleArc::hoverMoveEvent(QGraphicsSceneHoverEvent *event)
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VSimpleArc::hoverLeaveEvent(QGraphicsSceneHoverEvent *event)
|
||||
{
|
||||
Q_UNUSED(event);
|
||||
|
|
|
@ -30,6 +30,7 @@
|
|||
#include "../widgets/vapplication.h"
|
||||
#include <QPen>
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VSimpleSpline::VSimpleSpline(quint32 id, Qt::GlobalColor *currentColor, qreal *factor, QObject *parent)
|
||||
:QObject(parent), QGraphicsPathItem(), id (id), factor(factor), currentColor(currentColor)
|
||||
{
|
||||
|
@ -45,6 +46,7 @@ VSimpleSpline::VSimpleSpline(quint32 id, Qt::GlobalColor *currentColor, qreal *f
|
|||
setAcceptHoverEvents(true);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VSimpleSpline::ChangedActivDraw(const bool &flag)
|
||||
{
|
||||
setFlag(QGraphicsItem::ItemIsSelectable, flag);
|
||||
|
@ -52,6 +54,7 @@ void VSimpleSpline::ChangedActivDraw(const bool &flag)
|
|||
setPen(QPen(*currentColor, qApp->toPixel(qApp->widthHairLine())/ *factor));
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VSimpleSpline::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
|
||||
{
|
||||
if (event->button() == Qt::LeftButton)
|
||||
|
@ -61,6 +64,7 @@ void VSimpleSpline::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
|
|||
QGraphicsItem::mouseReleaseEvent(event);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VSimpleSpline::hoverMoveEvent(QGraphicsSceneHoverEvent *event)
|
||||
{
|
||||
Q_UNUSED(event);
|
||||
|
@ -74,6 +78,7 @@ void VSimpleSpline::hoverMoveEvent(QGraphicsSceneHoverEvent *event)
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VSimpleSpline::hoverLeaveEvent(QGraphicsSceneHoverEvent *event)
|
||||
{
|
||||
Q_UNUSED(event);
|
||||
|
|
|
@ -30,11 +30,12 @@
|
|||
#include "../widgets/vapplication.h"
|
||||
#include <QGraphicsSceneMouseEvent>
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VSimpleSplinePath::VSimpleSplinePath(VPattern *doc, VContainer *data, quint32 id, qreal *factor)
|
||||
:VAbstractTool(doc, data, id), factor(factor)
|
||||
{
|
||||
}
|
||||
{}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VSimpleSplinePath::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
|
||||
{
|
||||
if (event->button() == Qt::LeftButton)
|
||||
|
@ -44,12 +45,14 @@ void VSimpleSplinePath::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
|
|||
QGraphicsItem::mouseReleaseEvent(event);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VSimpleSplinePath::hoverMoveEvent(QGraphicsSceneHoverEvent *event)
|
||||
{
|
||||
Q_UNUSED(event);
|
||||
this->setPen(QPen(currentColor, qApp->toPixel(qApp->widthMainLine())/ *factor));
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VSimpleSplinePath::hoverLeaveEvent(QGraphicsSceneHoverEvent *event)
|
||||
{
|
||||
Q_UNUSED(event);
|
||||
|
|
|
@ -32,6 +32,7 @@
|
|||
#include <QtWidgets>
|
||||
#include <QWheelEvent>
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VTableGraphicsView::VTableGraphicsView(QGraphicsScene* pScene, QWidget *parent)
|
||||
:QGraphicsView(pScene, parent)
|
||||
{
|
||||
|
@ -39,6 +40,7 @@ VTableGraphicsView::VTableGraphicsView(QGraphicsScene* pScene, QWidget *parent)
|
|||
connect(pScene, &QGraphicsScene::selectionChanged, this, &VTableGraphicsView::selectionChanged);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VTableGraphicsView::selectionChanged()
|
||||
{
|
||||
QList<QGraphicsItem *> listSelectedItems = scene()->selectedItems();
|
||||
|
@ -54,6 +56,7 @@ void VTableGraphicsView::selectionChanged()
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VTableGraphicsView::MirrorItem()
|
||||
{
|
||||
QList<QGraphicsItem *> list = scene()->selectedItems();
|
||||
|
@ -94,6 +97,7 @@ void VTableGraphicsView::MirrorItem()
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VTableGraphicsView::wheelEvent(QWheelEvent *event)
|
||||
{
|
||||
if (QGuiApplication::keyboardModifiers() == Qt::ControlModifier)
|
||||
|
@ -114,6 +118,7 @@ void VTableGraphicsView::wheelEvent(QWheelEvent *event)
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VTableGraphicsView::mousePressEvent(QMouseEvent *mousePress)
|
||||
{
|
||||
if (mousePress->button() & Qt::LeftButton)
|
||||
|
@ -131,12 +136,14 @@ void VTableGraphicsView::mousePressEvent(QMouseEvent *mousePress)
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VTableGraphicsView::mouseReleaseEvent(QMouseEvent *event)
|
||||
{
|
||||
QGraphicsView::mouseReleaseEvent ( event );
|
||||
QGraphicsView::setDragMode( QGraphicsView::RubberBandDrag );
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VTableGraphicsView::keyPressEvent(QKeyEvent *event)
|
||||
{
|
||||
switch (event->key())
|
||||
|
@ -162,6 +169,7 @@ void VTableGraphicsView::keyPressEvent(QKeyEvent *event)
|
|||
QGraphicsView::keyPressEvent ( event );
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VTableGraphicsView::rotateIt()
|
||||
{
|
||||
QList<QGraphicsItem *> list = scene()->selectedItems();
|
||||
|
@ -177,6 +185,7 @@ void VTableGraphicsView::rotateIt()
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VTableGraphicsView::MoveItem(VTableGraphicsView::typeMove_e move)
|
||||
{
|
||||
qreal dx = 0, dy = 0;
|
||||
|
|
|
@ -64,16 +64,19 @@ private:
|
|||
QSourceLocation m_sourceLocation;
|
||||
};
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
inline QString MessageHandler::statusMessage() const
|
||||
{
|
||||
return m_description;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
inline qint64 MessageHandler::line() const
|
||||
{
|
||||
return m_sourceLocation.line();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
inline qint64 MessageHandler::column() const
|
||||
{
|
||||
return m_sourceLocation.column();
|
||||
|
@ -85,12 +88,12 @@ const QString VDomDocument::UnitMM = QStringLiteral("mm");
|
|||
const QString VDomDocument::UnitCM = QStringLiteral("cm");
|
||||
const QString VDomDocument::UnitINCH = QStringLiteral("inch");
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VDomDocument::VDomDocument(VContainer *data)
|
||||
: QDomDocument(), data(data), map(QHash<QString, QDomElement>())
|
||||
{
|
||||
|
||||
}
|
||||
{}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
QDomElement VDomDocument::elementById(const QString& id)
|
||||
{
|
||||
if (map.contains(id))
|
||||
|
@ -111,6 +114,7 @@ QDomElement VDomDocument::elementById(const QString& id)
|
|||
return QDomElement();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VDomDocument::removeAllChilds(QDomElement &element)
|
||||
{
|
||||
QDomNode domNode = element.firstChild();
|
||||
|
@ -128,6 +132,7 @@ void VDomDocument::removeAllChilds(QDomElement &element)
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
bool VDomDocument::find(const QDomElement &node, const QString& id)
|
||||
{
|
||||
if (node.hasAttribute(AttrId))
|
||||
|
@ -154,6 +159,7 @@ bool VDomDocument::find(const QDomElement &node, const QString& id)
|
|||
return false;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
quint32 VDomDocument::GetParametrUInt(const QDomElement &domElement, const QString &name, const QString &defValue) const
|
||||
{
|
||||
Q_ASSERT_X(name.isEmpty() == false, Q_FUNC_INFO, "name of parametr is empty");
|
||||
|
@ -183,6 +189,7 @@ quint32 VDomDocument::GetParametrUInt(const QDomElement &domElement, const QStri
|
|||
return id;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
QString VDomDocument::GetParametrString(const QDomElement &domElement, const QString &name,
|
||||
const QString &defValue) const
|
||||
{
|
||||
|
@ -203,6 +210,7 @@ QString VDomDocument::GetParametrString(const QDomElement &domElement, const QSt
|
|||
return parameter;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
qreal VDomDocument::GetParametrDouble(const QDomElement &domElement, const QString &name, const QString &defValue) const
|
||||
{
|
||||
Q_ASSERT_X(name.isEmpty() == false, Q_FUNC_INFO, "name of parametr is empty");
|
||||
|
@ -230,6 +238,7 @@ qreal VDomDocument::GetParametrDouble(const QDomElement &domElement, const QStri
|
|||
return param;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
QString VDomDocument::UniqueTagText(const QString &tagName, const QString &defVal) const
|
||||
{
|
||||
const QDomNodeList nodeList = this->elementsByTagName(tagName);
|
||||
|
@ -252,6 +261,7 @@ QString VDomDocument::UniqueTagText(const QString &tagName, const QString &defVa
|
|||
return defVal;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VDomDocument::ValidateXML(const QString &schema, const QString &fileName)
|
||||
{
|
||||
QFile pattern(fileName);
|
||||
|
@ -301,6 +311,7 @@ void VDomDocument::ValidateXML(const QString &schema, const QString &fileName)
|
|||
fileSchema.close();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VDomDocument::setContent(const QString &fileName)
|
||||
{
|
||||
QFile file(fileName);
|
||||
|
@ -322,6 +333,7 @@ void VDomDocument::setContent(const QString &fileName)
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
Valentina::Units VDomDocument::StrToUnits(const QString &unit)
|
||||
{
|
||||
QStringList units;
|
||||
|
@ -345,6 +357,7 @@ Valentina::Units VDomDocument::StrToUnits(const QString &unit)
|
|||
return result;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
QString VDomDocument::UnitsToStr(const Valentina::Units &unit)
|
||||
{
|
||||
QString result;
|
||||
|
@ -366,6 +379,7 @@ QString VDomDocument::UnitsToStr(const Valentina::Units &unit)
|
|||
return result;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
bool VDomDocument::SaveDocument(const QString &fileName)
|
||||
{
|
||||
if (fileName.isEmpty())
|
||||
|
@ -416,6 +430,7 @@ bool VDomDocument::SaveDocument(const QString &fileName)
|
|||
return result;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VDomDocument::setTagText(const QString &tag, const QString &text)
|
||||
{
|
||||
const QDomNodeList nodeList = this->elementsByTagName(tag);
|
||||
|
|
|
@ -46,21 +46,24 @@ const QString VIndividualMeasurements::TagEmail = QStringLiteral("email")
|
|||
const QString VIndividualMeasurements::SexMale = QStringLiteral("male");
|
||||
const QString VIndividualMeasurements::SexFemale = QStringLiteral("female");
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VIndividualMeasurements::VIndividualMeasurements(VContainer *data):VDomDocument(data)
|
||||
{
|
||||
}
|
||||
{}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
Valentina::Units VIndividualMeasurements::Unit() const
|
||||
{
|
||||
const QString unit = UniqueTagText(TagUnit, UnitCM);
|
||||
return VDomDocument::StrToUnits(unit);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VIndividualMeasurements::setUnit(const Valentina::Units &unit)
|
||||
{
|
||||
setTagText(TagUnit, UnitsToStr(unit));
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VIndividualMeasurements::Measurements()
|
||||
{
|
||||
//head and neck
|
||||
|
@ -152,6 +155,7 @@ void VIndividualMeasurements::Measurements()
|
|||
Measurement("crotch_height");
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VIndividualMeasurements::Measurement(const QString &tag)
|
||||
{
|
||||
const QDomNodeList nodeList = this->elementsByTagName(tag);
|
||||
|
@ -218,62 +222,74 @@ void VIndividualMeasurements::Measurement(const QString &tag)
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
QString VIndividualMeasurements::Language() const
|
||||
{
|
||||
return UniqueTagText(TagLang, "en");
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
QString VIndividualMeasurements::FamilyName() const
|
||||
{
|
||||
return UniqueTagText(TagFamily_name, "");
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VIndividualMeasurements::setFamilyName(const QString &text)
|
||||
{
|
||||
setTagText(TagFamily_name, text);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
QString VIndividualMeasurements::GivenName() const
|
||||
{
|
||||
return UniqueTagText(TagGiven_name, "");
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VIndividualMeasurements::setGivenName(const QString &text)
|
||||
{
|
||||
setTagText(TagGiven_name, text);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
QDate VIndividualMeasurements::BirthDate() const
|
||||
{
|
||||
const QString date = UniqueTagText(TagBirth_date, "1900-01-01");
|
||||
return QDate::fromString(date, "yyyy-MM-dd");
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VIndividualMeasurements::setBirthDate(const QDate &date)
|
||||
{
|
||||
setTagText(TagBirth_date, date.toString("yyyy-MM-dd"));
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VIndividualMeasurements::Genders VIndividualMeasurements::Sex() const
|
||||
{
|
||||
return StrToGender(UniqueTagText(TagSex, ""));
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VIndividualMeasurements::setSex(const VIndividualMeasurements::Genders &sex)
|
||||
{
|
||||
setTagText(TagSex, GenderToStr(sex));
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
QString VIndividualMeasurements::Mail() const
|
||||
{
|
||||
return UniqueTagText(TagEmail, "");
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VIndividualMeasurements::setMail(const QString &text)
|
||||
{
|
||||
setTagText(TagEmail, text);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
QString VIndividualMeasurements::GenderToStr(const VIndividualMeasurements::Genders &sex)
|
||||
{
|
||||
switch (sex)
|
||||
|
@ -287,6 +303,7 @@ QString VIndividualMeasurements::GenderToStr(const VIndividualMeasurements::Gend
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VIndividualMeasurements::Genders VIndividualMeasurements::StrToGender(const QString &sex)
|
||||
{
|
||||
QStringList genders;
|
||||
|
|
|
@ -67,12 +67,13 @@ const QString VPattern::IncrementKsize = QStringLiteral("ksize");
|
|||
const QString VPattern::IncrementKgrowth = QStringLiteral("kgrowth");
|
||||
const QString VPattern::IncrementDescription = QStringLiteral("description");
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VPattern::VPattern(VContainer *data, QComboBox *comboBoxDraws, Valentina::Draws *mode, QObject *parent)
|
||||
: QObject(parent), VDomDocument(data), nameActivDraw(QString()), tools(QHash<quint32, VDataTool*>()),
|
||||
history(QVector<VToolRecord>()), cursor(0), comboBoxDraws(comboBoxDraws), mode(mode), patternModified(false)
|
||||
{
|
||||
}
|
||||
{}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VPattern::CreateEmptyFile(const QString &tablePath)
|
||||
{
|
||||
if (tablePath.isEmpty())
|
||||
|
@ -98,6 +99,7 @@ void VPattern::CreateEmptyFile(const QString &tablePath)
|
|||
insertBefore(createProcessingInstruction("xml", "version=\"1.0\" encoding=\"UTF-8\""), this->firstChild());
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VPattern::ChangeActivDraw(const QString &name, const Document::Documents &parse)
|
||||
{
|
||||
Q_ASSERT_X(name.isEmpty() == false, "ChangeActivDraw", "name draw is empty");
|
||||
|
@ -111,6 +113,7 @@ void VPattern::ChangeActivDraw(const QString &name, const Document::Documents &p
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
bool VPattern::GetActivDrawElement(QDomElement &element)
|
||||
{
|
||||
if (nameActivDraw.isEmpty() == false)
|
||||
|
@ -136,6 +139,7 @@ bool VPattern::GetActivDrawElement(QDomElement &element)
|
|||
return false;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
bool VPattern::appendDraw(const QString &name)
|
||||
{
|
||||
Q_ASSERT_X(name.isEmpty() == false, "appendDraw", "name draw is empty");
|
||||
|
@ -169,6 +173,7 @@ bool VPattern::appendDraw(const QString &name)
|
|||
return false;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
bool VPattern::SetNameDraw(const QString &name)
|
||||
{
|
||||
Q_ASSERT_X(name.isEmpty() == false, "SetNameDraw", "name draw is empty");
|
||||
|
@ -189,6 +194,7 @@ bool VPattern::SetNameDraw(const QString &name)
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VPattern::Parse(const Document::Documents &parse, VMainGraphicsScene *sceneDraw, VMainGraphicsScene *sceneDetail)
|
||||
{
|
||||
Q_CHECK_PTR(sceneDraw);
|
||||
|
@ -246,6 +252,7 @@ void VPattern::Parse(const Document::Documents &parse, VMainGraphicsScene *scene
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VDataTool *VPattern::getTool(const quint32 &id)
|
||||
{
|
||||
if (tools.contains(id))
|
||||
|
@ -260,12 +267,14 @@ VDataTool *VPattern::getTool(const quint32 &id)
|
|||
return 0;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VPattern::setCursor(const quint32 &value)
|
||||
{
|
||||
cursor = value;
|
||||
emit ChangedCursor(cursor);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VPattern::setCurrentData()
|
||||
{
|
||||
if (*mode == Valentina::Calculation)
|
||||
|
@ -305,6 +314,7 @@ void VPattern::setCurrentData()
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VPattern::AddTool(const quint32 &id, VDataTool *tool)
|
||||
{
|
||||
Q_ASSERT_X(id > 0, Q_FUNC_INFO, "id <= 0");
|
||||
|
@ -312,6 +322,7 @@ void VPattern::AddTool(const quint32 &id, VDataTool *tool)
|
|||
tools.insert(id, tool);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VPattern::UpdateToolData(const quint32 &id, VContainer *data)
|
||||
{
|
||||
Q_ASSERT_X(id > 0, Q_FUNC_INFO, "id <= 0");
|
||||
|
@ -321,6 +332,7 @@ void VPattern::UpdateToolData(const quint32 &id, VContainer *data)
|
|||
tool->VDataTool::setData(data);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VPattern::IncrementReferens(quint32 id) const
|
||||
{
|
||||
Q_ASSERT_X(id > 0, Q_FUNC_INFO, "id <= 0");
|
||||
|
@ -329,6 +341,7 @@ void VPattern::IncrementReferens(quint32 id) const
|
|||
tool->incrementReferens();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VPattern::DecrementReferens(quint32 id) const
|
||||
{
|
||||
Q_ASSERT_X(id > 0, Q_FUNC_INFO, "id <= 0");
|
||||
|
@ -337,12 +350,14 @@ void VPattern::DecrementReferens(quint32 id) const
|
|||
tool->decrementReferens();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VPattern::TestUniqueId() const
|
||||
{
|
||||
QVector<quint32> vector;
|
||||
CollectId(documentElement(), vector);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
quint32 VPattern::SPointActiveDraw()
|
||||
{
|
||||
QDomElement calcElement;
|
||||
|
@ -365,6 +380,7 @@ quint32 VPattern::SPointActiveDraw()
|
|||
return 0;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
bool VPattern::CheckNameDraw(const QString &name) const
|
||||
{
|
||||
Q_ASSERT_X(name.isEmpty() == false, "CheckNameDraw", "name draw is empty");
|
||||
|
@ -387,12 +403,14 @@ bool VPattern::CheckNameDraw(const QString &name) const
|
|||
return false;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VPattern::SetActivDraw(const QString &name)
|
||||
{
|
||||
Q_ASSERT_X(name.isEmpty() == false, "SetActivDraw", "name draw is empty");
|
||||
this->nameActivDraw = name;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
bool VPattern::GetActivNodeElement(const QString &name, QDomElement &element)
|
||||
{
|
||||
Q_ASSERT_X(name.isEmpty() == false, "GetActivNodeElement", "name draw is empty");
|
||||
|
@ -417,6 +435,7 @@ bool VPattern::GetActivNodeElement(const QString &name, QDomElement &element)
|
|||
return false;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
QString VPattern::MPath() const
|
||||
{
|
||||
QDomNodeList list = elementsByTagName(TagMeasurements);
|
||||
|
@ -431,6 +450,7 @@ QString VPattern::MPath() const
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VPattern::SetPath(const QString &path)
|
||||
{
|
||||
if (path.isEmpty())
|
||||
|
@ -451,6 +471,7 @@ void VPattern::SetPath(const QString &path)
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
Valentina::Units VPattern::MUnit() const
|
||||
{
|
||||
QDomNodeList list = elementsByTagName(VPattern::TagMeasurements);
|
||||
|
@ -482,6 +503,7 @@ Valentina::Units VPattern::MUnit() const
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
Pattern::Measurements VPattern::MType() const
|
||||
{
|
||||
QDomNodeList list = elementsByTagName(VPattern::TagMeasurements);
|
||||
|
@ -510,6 +532,7 @@ Pattern::Measurements VPattern::MType() const
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
bool VPattern::SaveDocument(const QString &fileName)
|
||||
{
|
||||
try
|
||||
|
@ -524,6 +547,7 @@ bool VPattern::SaveDocument(const QString &fileName)
|
|||
return VDomDocument::SaveDocument(fileName);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VPattern::FullUpdateTree()
|
||||
{
|
||||
VMainGraphicsScene *scene = new VMainGraphicsScene();
|
||||
|
@ -555,17 +579,20 @@ void VPattern::FullUpdateTree()
|
|||
emit FullUpdateFromFile();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VPattern::haveLiteChange()
|
||||
{
|
||||
patternModified = true;
|
||||
emit patternChanged();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VPattern::ShowHistoryTool(quint32 id, Qt::GlobalColor color, bool enable)
|
||||
{
|
||||
emit ShowTool(id, color, enable);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VPattern::ParseDrawElement(VMainGraphicsScene *sceneDraw, VMainGraphicsScene *sceneDetail, const QDomNode &node,
|
||||
const Document::Documents &parse)
|
||||
{
|
||||
|
@ -601,6 +628,7 @@ void VPattern::ParseDrawElement(VMainGraphicsScene *sceneDraw, VMainGraphicsScen
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VPattern::ParseDrawMode(VMainGraphicsScene *sceneDraw, VMainGraphicsScene *sceneDetail, const QDomNode &node,
|
||||
const Document::Documents &parse, const Valentina::Draws &mode)
|
||||
{
|
||||
|
@ -649,6 +677,7 @@ void VPattern::ParseDrawMode(VMainGraphicsScene *sceneDraw, VMainGraphicsScene *
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VPattern::ParseDetailElement(VMainGraphicsScene *sceneDetail, const QDomElement &domElement,
|
||||
const Document::Documents &parse)
|
||||
{
|
||||
|
@ -716,6 +745,7 @@ void VPattern::ParseDetailElement(VMainGraphicsScene *sceneDetail, const QDomEle
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VPattern::ParseDetails(VMainGraphicsScene *sceneDetail, const QDomElement &domElement,
|
||||
const Document::Documents &parse)
|
||||
{
|
||||
|
@ -739,6 +769,7 @@ void VPattern::ParseDetails(VMainGraphicsScene *sceneDetail, const QDomElement &
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VPattern::ParsePointElement(VMainGraphicsScene *scene, const QDomElement &domElement,
|
||||
const Document::Documents &parse, const QString &type)
|
||||
{
|
||||
|
@ -1104,6 +1135,7 @@ void VPattern::ParsePointElement(VMainGraphicsScene *scene, const QDomElement &d
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VPattern::ParseLineElement(VMainGraphicsScene *scene, const QDomElement &domElement,
|
||||
const Document::Documents &parse)
|
||||
{
|
||||
|
@ -1127,6 +1159,7 @@ void VPattern::ParseLineElement(VMainGraphicsScene *scene, const QDomElement &do
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VPattern::ParseSplineElement(VMainGraphicsScene *scene, const QDomElement &domElement,
|
||||
const Document::Documents &parse, const QString &type)
|
||||
{
|
||||
|
@ -1248,6 +1281,7 @@ void VPattern::ParseSplineElement(VMainGraphicsScene *scene, const QDomElement &
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VPattern::ParseArcElement(VMainGraphicsScene *scene, const QDomElement &domElement,
|
||||
const Document::Documents &parse, const QString &type)
|
||||
{
|
||||
|
@ -1303,6 +1337,7 @@ void VPattern::ParseArcElement(VMainGraphicsScene *scene, const QDomElement &dom
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VPattern::ParseToolsElement(VMainGraphicsScene *scene, const QDomElement &domElement,
|
||||
const Document::Documents &parse, const QString &type)
|
||||
{
|
||||
|
@ -1340,6 +1375,7 @@ void VPattern::ParseToolsElement(VMainGraphicsScene *scene, const QDomElement &d
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VPattern::ParseIncrementsElement(const QDomNode &node)
|
||||
{
|
||||
QDomNode domNode = node.firstChild();
|
||||
|
@ -1367,6 +1403,7 @@ void VPattern::ParseIncrementsElement(const QDomNode &node)
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
quint32 VPattern::GetParametrId(const QDomElement &domElement) const
|
||||
{
|
||||
Q_ASSERT_X(domElement.isNull() == false, Q_FUNC_INFO, "domElement is null");
|
||||
|
@ -1391,6 +1428,7 @@ quint32 VPattern::GetParametrId(const QDomElement &domElement) const
|
|||
return id;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VPattern::CollectId(const QDomElement &node, QVector<quint32> &vector) const
|
||||
{
|
||||
if (node.hasAttribute(VDomDocument::AttrId))
|
||||
|
@ -1413,6 +1451,7 @@ void VPattern::CollectId(const QDomElement &node, QVector<quint32> &vector) cons
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VPattern::PrepareForParse(const Document::Documents &parse, VMainGraphicsScene *sceneDraw,
|
||||
VMainGraphicsScene *sceneDetail)
|
||||
{
|
||||
|
@ -1438,6 +1477,7 @@ void VPattern::PrepareForParse(const Document::Documents &parse, VMainGraphicsSc
|
|||
history.clear();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VPattern::UpdateMeasurements()
|
||||
{
|
||||
const QString path = MPath();
|
||||
|
|
|
@ -40,16 +40,18 @@ const QString VStandardMeasurements::AttrSize_increace = QStringLiteral("size_
|
|||
const QString VStandardMeasurements::AttrHeight_increase = QStringLiteral("height_increase");
|
||||
const QString VStandardMeasurements::AttrNumber = QStringLiteral("number");
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VStandardMeasurements::VStandardMeasurements(VContainer *data):VDomDocument(data)
|
||||
{
|
||||
}
|
||||
{}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
Valentina::Units VStandardMeasurements::Unit()
|
||||
{
|
||||
const QString unit = UniqueTagText(AttrUnit, UnitCM);
|
||||
return VDomDocument::StrToUnits(unit);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
QString VStandardMeasurements::Description()
|
||||
{
|
||||
const QString desc = UniqueTagText(TagDescription, "");
|
||||
|
@ -60,6 +62,7 @@ QString VStandardMeasurements::Description()
|
|||
return desc;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VStandardMeasurements::Measurements()
|
||||
{
|
||||
const QDomNodeList nodeList = this->elementsByTagName(TagMeasurement);
|
||||
|
@ -105,6 +108,7 @@ void VStandardMeasurements::Measurements()
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VStandardMeasurements::SetSize()
|
||||
{
|
||||
const QDomNodeList nodeList = this->elementsByTagName(TagSize);
|
||||
|
@ -138,6 +142,7 @@ void VStandardMeasurements::SetSize()
|
|||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VStandardMeasurements::SetHeight()
|
||||
{
|
||||
const QDomNodeList nodeList = this->elementsByTagName(TagHeight);
|
||||
|
|
|
@ -28,8 +28,12 @@
|
|||
|
||||
#include "vtoolrecord.h"
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VToolRecord::VToolRecord()
|
||||
:id(0), typeTool(Valentina::ArrowTool), nameDraw(QString()){}
|
||||
:id(0), typeTool(Valentina::ArrowTool), nameDraw(QString())
|
||||
{}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VToolRecord::VToolRecord(const quint32 &id, const Valentina::Tools &typeTool, const QString &nameDraw)
|
||||
:id(id), typeTool(typeTool), nameDraw(nameDraw){}
|
||||
:id(id), typeTool(typeTool), nameDraw(nameDraw)
|
||||
{}
|
||||
|
|
Loading…
Reference in New Issue
Block a user