Merge with feature
--HG-- branch : develop
This commit is contained in:
commit
e3a55e58d6
|
@ -41,6 +41,7 @@ include(geometry/geometry.pri)
|
||||||
include(tools/tools.pri)
|
include(tools/tools.pri)
|
||||||
include(widgets/widgets.pri)
|
include(widgets/widgets.pri)
|
||||||
include(xml/xml.pri)
|
include(xml/xml.pri)
|
||||||
|
include(undocommands/undocommands.pri)
|
||||||
|
|
||||||
SOURCES += \
|
SOURCES += \
|
||||||
main.cpp \
|
main.cpp \
|
||||||
|
|
|
@ -30,6 +30,7 @@
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include <QSettings>
|
#include <QSettings>
|
||||||
#include "../widgets/vapplication.h"
|
#include "../widgets/vapplication.h"
|
||||||
|
#include "vcontainer.h"
|
||||||
|
|
||||||
using namespace qmu;
|
using namespace qmu;
|
||||||
|
|
||||||
|
@ -150,7 +151,7 @@ qreal Calculator::EvalFormula(const QString &formula)
|
||||||
void Calculator::InitVariables(const VContainer *data)
|
void Calculator::InitVariables(const VContainer *data)
|
||||||
{
|
{
|
||||||
int num = 0;
|
int num = 0;
|
||||||
if (qApp->patternType() == Pattern::Standard)
|
if (qApp->patternType() == MeasurementsType::Standard)
|
||||||
{
|
{
|
||||||
num +=2;
|
num +=2;
|
||||||
}
|
}
|
||||||
|
@ -176,7 +177,7 @@ void Calculator::InitVariables(const VContainer *data)
|
||||||
vVarVal = new qreal[num];
|
vVarVal = new qreal[num];
|
||||||
int j = 0;
|
int j = 0;
|
||||||
|
|
||||||
if (qApp->patternType() == Pattern::Standard)
|
if (qApp->patternType() == MeasurementsType::Standard)
|
||||||
{
|
{
|
||||||
vVarVal[j] = data->size();
|
vVarVal[j] = data->size();
|
||||||
DefineVar(data->SizeName(), &vVarVal[j]);
|
DefineVar(data->SizeName(), &vVarVal[j]);
|
||||||
|
@ -235,7 +236,7 @@ void Calculator::InitVariables(const VContainer *data)
|
||||||
QHash<QString, VMeasurement>::const_iterator i = measurements->constBegin();
|
QHash<QString, VMeasurement>::const_iterator i = measurements->constBegin();
|
||||||
while (i != measurements->constEnd())
|
while (i != measurements->constEnd())
|
||||||
{
|
{
|
||||||
if (qApp->patternType() == Pattern::Standard)
|
if (qApp->patternType() == MeasurementsType::Standard)
|
||||||
{
|
{
|
||||||
vVarVal[j] = i.value().GetValue(data->size(), data->height());
|
vVarVal[j] = i.value().GetValue(data->size(), data->height());
|
||||||
}
|
}
|
||||||
|
@ -253,7 +254,7 @@ void Calculator::InitVariables(const VContainer *data)
|
||||||
QHash<QString, VIncrement>::const_iterator i = increments->constBegin();
|
QHash<QString, VIncrement>::const_iterator i = increments->constBegin();
|
||||||
while (i != increments->constEnd())
|
while (i != increments->constEnd())
|
||||||
{
|
{
|
||||||
if (qApp->patternType() == Pattern::Standard)
|
if (qApp->patternType() == MeasurementsType::Standard)
|
||||||
{
|
{
|
||||||
vVarVal[j] = i.value().GetValue(data->size(), data->height());
|
vVarVal[j] = i.value().GetValue(data->size(), data->height());
|
||||||
}
|
}
|
||||||
|
@ -293,12 +294,12 @@ qreal Calculator::CmUnit(qreal val)
|
||||||
qreal unit = val;
|
qreal unit = val;
|
||||||
switch(qApp->patternUnit())
|
switch(qApp->patternUnit())
|
||||||
{
|
{
|
||||||
case Valentina::Mm:
|
case Unit::Mm:
|
||||||
unit = val * 10.0;
|
unit = val * 10.0;
|
||||||
break;
|
break;
|
||||||
case Valentina::Cm:
|
case Unit::Cm:
|
||||||
break;
|
break;
|
||||||
case Valentina::Inch:
|
case Unit::Inch:
|
||||||
unit = val / 2.54;
|
unit = val / 2.54;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -314,12 +315,12 @@ qreal Calculator::MmUnit(qreal val)
|
||||||
qreal unit = val;
|
qreal unit = val;
|
||||||
switch(qApp->patternUnit())
|
switch(qApp->patternUnit())
|
||||||
{
|
{
|
||||||
case Valentina::Mm:
|
case Unit::Mm:
|
||||||
break;
|
break;
|
||||||
case Valentina::Cm:
|
case Unit::Cm:
|
||||||
unit = val / 10.0;
|
unit = val / 10.0;
|
||||||
break;
|
break;
|
||||||
case Valentina::Inch:
|
case Unit::Inch:
|
||||||
unit = val / 25.4;
|
unit = val / 25.4;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -335,13 +336,13 @@ qreal Calculator::InchUnit(qreal val)
|
||||||
qreal unit = val;
|
qreal unit = val;
|
||||||
switch(qApp->patternUnit())
|
switch(qApp->patternUnit())
|
||||||
{
|
{
|
||||||
case Valentina::Mm:
|
case Unit::Mm:
|
||||||
unit = val * 25.4;
|
unit = val * 25.4;
|
||||||
break;
|
break;
|
||||||
case Valentina::Cm:
|
case Unit::Cm:
|
||||||
unit = val * 2.54;
|
unit = val * 2.54;
|
||||||
break;
|
break;
|
||||||
case Valentina::Inch:
|
case Unit::Inch:
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -29,10 +29,10 @@
|
||||||
#ifndef CALCULATOR_H
|
#ifndef CALCULATOR_H
|
||||||
#define CALCULATOR_H
|
#define CALCULATOR_H
|
||||||
|
|
||||||
#include "vcontainer.h"
|
|
||||||
|
|
||||||
#include "../../libs/qmuparser/qmuparser.h"
|
#include "../../libs/qmuparser/qmuparser.h"
|
||||||
|
|
||||||
|
class VContainer;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief The Calculator class for calculation formula.
|
* @brief The Calculator class for calculation formula.
|
||||||
*
|
*
|
||||||
|
|
|
@ -27,10 +27,10 @@
|
||||||
*************************************************************************/
|
*************************************************************************/
|
||||||
|
|
||||||
#include "vcontainer.h"
|
#include "vcontainer.h"
|
||||||
|
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include <QtAlgorithms>
|
|
||||||
#include "../widgets/vapplication.h"
|
#include "../widgets/vapplication.h"
|
||||||
|
#include "../geometry/varc.h"
|
||||||
|
#include "../geometry/vsplinepath.h"
|
||||||
|
|
||||||
quint32 VContainer::_id = 0;
|
quint32 VContainer::_id = 0;
|
||||||
|
|
||||||
|
@ -100,16 +100,16 @@ void VContainer::setData(const VContainer &data)
|
||||||
i.next();
|
i.next();
|
||||||
switch (i.value()->getType())
|
switch (i.value()->getType())
|
||||||
{
|
{
|
||||||
case (GObject::Arc):
|
case (GOType::Arc):
|
||||||
CopyGObject<VArc>(data, i.key());
|
CopyGObject<VArc>(data, i.key());
|
||||||
break;
|
break;
|
||||||
case (GObject::Point):
|
case (GOType::Point):
|
||||||
CopyGObject<VPointF>(data, i.key());
|
CopyGObject<VPointF>(data, i.key());
|
||||||
break;
|
break;
|
||||||
case (GObject::Spline):
|
case (GOType::Spline):
|
||||||
CopyGObject<VSpline>(data, i.key());
|
CopyGObject<VSpline>(data, i.key());
|
||||||
break;
|
break;
|
||||||
case (GObject::SplinePath):
|
case (GOType::SplinePath):
|
||||||
CopyGObject<VSplinePath>(data, i.key());
|
CopyGObject<VSplinePath>(data, i.key());
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -386,7 +386,7 @@ void VContainer::AddLineAngle(const QString &name, const qreal &value)
|
||||||
qreal VContainer::GetValueStandardTableRow(const QString& name) const
|
qreal VContainer::GetValueStandardTableRow(const QString& name) const
|
||||||
{
|
{
|
||||||
const VMeasurement m = GetMeasurement(name);
|
const VMeasurement m = GetMeasurement(name);
|
||||||
if (qApp->patternType() == Pattern::Individual)
|
if (qApp->patternType() == MeasurementsType::Individual)
|
||||||
{
|
{
|
||||||
return m.GetValue();
|
return m.GetValue();
|
||||||
}
|
}
|
||||||
|
@ -405,7 +405,7 @@ qreal VContainer::GetValueStandardTableRow(const QString& name) const
|
||||||
qreal VContainer::GetValueIncrementTableRow(const QString& name) const
|
qreal VContainer::GetValueIncrementTableRow(const QString& name) const
|
||||||
{
|
{
|
||||||
const VIncrement icr = GetIncrement(name);
|
const VIncrement icr = GetIncrement(name);
|
||||||
if (qApp->patternType() == Pattern::Individual)
|
if (qApp->patternType() == MeasurementsType::Individual)
|
||||||
{
|
{
|
||||||
return icr.GetValue();
|
return icr.GetValue();
|
||||||
}
|
}
|
||||||
|
@ -454,7 +454,7 @@ void VContainer::ClearCalculationGObjects()
|
||||||
while (i.hasNext())
|
while (i.hasNext())
|
||||||
{
|
{
|
||||||
i.next();
|
i.next();
|
||||||
if (i.value()->getMode() == Valentina::Calculation)
|
if (i.value()->getMode() == Draw::Calculation)
|
||||||
{
|
{
|
||||||
delete i.value();
|
delete i.value();
|
||||||
gObjects.remove(i.key());
|
gObjects.remove(i.key());
|
||||||
|
|
|
@ -31,10 +31,7 @@
|
||||||
|
|
||||||
#include "vmeasurement.h"
|
#include "vmeasurement.h"
|
||||||
#include "vincrement.h"
|
#include "vincrement.h"
|
||||||
#include "../geometry/varc.h"
|
|
||||||
#include "../geometry/vsplinepath.h"
|
|
||||||
#include "../geometry/vdetail.h"
|
#include "../geometry/vdetail.h"
|
||||||
#include "../widgets/vitem.h"
|
|
||||||
#include "../geometry/vgobject.h"
|
#include "../geometry/vgobject.h"
|
||||||
#include "../exception/vexceptionbadid.h"
|
#include "../exception/vexceptionbadid.h"
|
||||||
|
|
||||||
|
|
|
@ -49,6 +49,23 @@ VIncrement::VIncrement(quint32 id, qreal base, qreal ksize, qreal kheight, QStri
|
||||||
:id(id), base(base), ksize(ksize), kheight(kheight), description(description)
|
:id(id), base(base), ksize(ksize), kheight(kheight), description(description)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
VIncrement::VIncrement(const VIncrement &incr)
|
||||||
|
:id(incr.getId()), base(incr.getBase()), ksize(incr.getKsize()), kheight(incr.getKheight()),
|
||||||
|
description(incr.getDescription())
|
||||||
|
{}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
VIncrement &VIncrement::operator=(const VIncrement &incr)
|
||||||
|
{
|
||||||
|
this->id = incr.getId();
|
||||||
|
this->base = incr.getBase();
|
||||||
|
this->ksize = incr.getKsize();
|
||||||
|
this->kheight = incr.getKheight();
|
||||||
|
this->description = incr.getDescription();
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
qreal VIncrement::GetValue() const
|
qreal VIncrement::GetValue() const
|
||||||
{
|
{
|
||||||
|
|
|
@ -39,6 +39,8 @@ class VIncrement
|
||||||
public:
|
public:
|
||||||
VIncrement();
|
VIncrement();
|
||||||
VIncrement(quint32 id, qreal base, qreal ksize, qreal kheight, QString description = QString());
|
VIncrement(quint32 id, qreal base, qreal ksize, qreal kheight, QString description = QString());
|
||||||
|
VIncrement(const VIncrement &incr);
|
||||||
|
VIncrement &operator=(const VIncrement &incr);
|
||||||
quint32 getId() const;
|
quint32 getId() const;
|
||||||
void setId(const quint32 &value);
|
void setId(const quint32 &value);
|
||||||
qreal getBase() const;
|
qreal getBase() const;
|
||||||
|
|
|
@ -30,11 +30,11 @@
|
||||||
#define CONFIGDIALOG_H
|
#define CONFIGDIALOG_H
|
||||||
|
|
||||||
#include <QDialog>
|
#include <QDialog>
|
||||||
#include <QListWidget>
|
|
||||||
#include "pages.h"
|
#include "pages.h"
|
||||||
|
|
||||||
class QListWidgetItem;
|
class QListWidgetItem;
|
||||||
class QStackedWidget;
|
class QStackedWidget;
|
||||||
|
class QListWidget;
|
||||||
|
|
||||||
class ConfigDialog : public QDialog
|
class ConfigDialog : public QDialog
|
||||||
{
|
{
|
||||||
|
|
|
@ -29,14 +29,13 @@
|
||||||
#include "dialoghistory.h"
|
#include "dialoghistory.h"
|
||||||
#include "ui_dialoghistory.h"
|
#include "ui_dialoghistory.h"
|
||||||
#include "../../geometry/varc.h"
|
#include "../../geometry/varc.h"
|
||||||
#include "../../geometry/vspline.h"
|
|
||||||
#include "../../geometry/vsplinepath.h"
|
#include "../../geometry/vsplinepath.h"
|
||||||
|
#include "../../geometry/vpointf.h"
|
||||||
#include "../../tools/vabstracttool.h"
|
#include "../../tools/vabstracttool.h"
|
||||||
#include "../../tools/drawTools/vtoolcutspline.h"
|
#include "../../tools/drawTools/vtoolcutspline.h"
|
||||||
#include "../../tools/drawTools/vtoolcutsplinepath.h"
|
#include "../../tools/drawTools/vtoolcutsplinepath.h"
|
||||||
#include "../../tools/drawTools/vtoolcutarc.h"
|
#include "../../tools/drawTools/vtoolcutarc.h"
|
||||||
#include <QDebug>
|
#include "../../xml/vpattern.h"
|
||||||
#include <QPushButton>
|
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
|
@ -58,7 +57,7 @@ DialogHistory::DialogHistory(VContainer *data, VPattern *doc, QWidget *parent)
|
||||||
connect(this, &DialogHistory::ShowHistoryTool, doc, &VPattern::ShowHistoryTool);
|
connect(this, &DialogHistory::ShowHistoryTool, doc, &VPattern::ShowHistoryTool);
|
||||||
connect(doc, &VPattern::ChangedCursor, this, &DialogHistory::ChangedCursor);
|
connect(doc, &VPattern::ChangedCursor, this, &DialogHistory::ChangedCursor);
|
||||||
connect(doc, &VPattern::patternChanged, this, &DialogHistory::UpdateHistory);
|
connect(doc, &VPattern::patternChanged, this, &DialogHistory::UpdateHistory);
|
||||||
connect(doc, &VPattern::ChangedActivDraw, this, &DialogHistory::UpdateHistory);
|
connect(doc, &VPattern::ChangedActivPP, this, &DialogHistory::UpdateHistory);
|
||||||
ShowPoint();
|
ShowPoint();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -214,22 +213,22 @@ QString DialogHistory::Record(const VToolRecord &tool)
|
||||||
{
|
{
|
||||||
switch ( tool.getTypeTool() )
|
switch ( tool.getTypeTool() )
|
||||||
{
|
{
|
||||||
case Valentina::ArrowTool:
|
case Tool::ArrowTool:
|
||||||
Q_UNREACHABLE();
|
Q_UNREACHABLE();
|
||||||
break;
|
break;
|
||||||
case Valentina::SinglePointTool:
|
case Tool::SinglePointTool:
|
||||||
{
|
{
|
||||||
const QString name = data->GeometricObject<const VPointF *>(tool.getId())->name();
|
const QString name = data->GeometricObject<const VPointF *>(tool.getId())->name();
|
||||||
return QString(tr("%1 - Base point")).arg(name);
|
return QString(tr("%1 - Base point")).arg(name);
|
||||||
}
|
}
|
||||||
case Valentina::EndLineTool:
|
case Tool::EndLineTool:
|
||||||
{
|
{
|
||||||
const quint32 basePointId = doc->GetParametrUInt(domElement, VAbstractTool::AttrBasePoint, "0");
|
const quint32 basePointId = doc->GetParametrUInt(domElement, VAbstractTool::AttrBasePoint, "0");
|
||||||
const QString basePointIdName = data->GeometricObject<const VPointF *>(basePointId)->name();
|
const QString basePointIdName = data->GeometricObject<const VPointF *>(basePointId)->name();
|
||||||
const QString toolIdName = data->GeometricObject<const VPointF *>(tool.getId())->name();
|
const QString toolIdName = data->GeometricObject<const VPointF *>(tool.getId())->name();
|
||||||
return QString(tr("%1_%2 - Line from point %1 to point %2")).arg(basePointIdName, toolIdName);
|
return QString(tr("%1_%2 - Line from point %1 to point %2")).arg(basePointIdName, toolIdName);
|
||||||
}
|
}
|
||||||
case Valentina::LineTool:
|
case Tool::LineTool:
|
||||||
{
|
{
|
||||||
const quint32 firstPointId = doc->GetParametrUInt(domElement, VAbstractTool::AttrFirstPoint, "0");
|
const quint32 firstPointId = doc->GetParametrUInt(domElement, VAbstractTool::AttrFirstPoint, "0");
|
||||||
const quint32 secondPointId = doc->GetParametrUInt(domElement, VAbstractTool::AttrSecondPoint, "0");
|
const quint32 secondPointId = doc->GetParametrUInt(domElement, VAbstractTool::AttrSecondPoint, "0");
|
||||||
|
@ -237,7 +236,7 @@ QString DialogHistory::Record(const VToolRecord &tool)
|
||||||
const QString secondPointIdName = data->GeometricObject<const VPointF *>(secondPointId)->name();
|
const QString secondPointIdName = data->GeometricObject<const VPointF *>(secondPointId)->name();
|
||||||
return QString(tr("%1_%2 - Line from point %1 to point %2")).arg(firstPointIdName, secondPointIdName);
|
return QString(tr("%1_%2 - Line from point %1 to point %2")).arg(firstPointIdName, secondPointIdName);
|
||||||
}
|
}
|
||||||
case Valentina::AlongLineTool:
|
case Tool::AlongLineTool:
|
||||||
{
|
{
|
||||||
const quint32 basePointId = doc->GetParametrUInt(domElement, VAbstractTool::AttrFirstPoint, "0");
|
const quint32 basePointId = doc->GetParametrUInt(domElement, VAbstractTool::AttrFirstPoint, "0");
|
||||||
const quint32 secondPointId = doc->GetParametrUInt(domElement, VAbstractTool::AttrSecondPoint, "0");
|
const quint32 secondPointId = doc->GetParametrUInt(domElement, VAbstractTool::AttrSecondPoint, "0");
|
||||||
|
@ -246,12 +245,12 @@ QString DialogHistory::Record(const VToolRecord &tool)
|
||||||
const QString toolIdName = data->GeometricObject<const VPointF *>(tool.getId())->name();
|
const QString toolIdName = data->GeometricObject<const VPointF *>(tool.getId())->name();
|
||||||
return QString(tr("%3 - Point along line %1_%2")).arg(basePointIdName, secondPointIdName, toolIdName);
|
return QString(tr("%3 - Point along line %1_%2")).arg(basePointIdName, secondPointIdName, toolIdName);
|
||||||
}
|
}
|
||||||
case Valentina::ShoulderPointTool:
|
case Tool::ShoulderPointTool:
|
||||||
{
|
{
|
||||||
const QString name = data->GeometricObject<const VPointF *>(tool.getId())->name();
|
const QString name = data->GeometricObject<const VPointF *>(tool.getId())->name();
|
||||||
return QString(tr("%1 - Point of shoulder")).arg(name);
|
return QString(tr("%1 - Point of shoulder")).arg(name);
|
||||||
}
|
}
|
||||||
case Valentina::NormalTool:
|
case Tool::NormalTool:
|
||||||
{
|
{
|
||||||
const quint32 basePointId = doc->GetParametrUInt(domElement, VAbstractTool::AttrFirstPoint, "0");
|
const quint32 basePointId = doc->GetParametrUInt(domElement, VAbstractTool::AttrFirstPoint, "0");
|
||||||
const quint32 secondPointId = doc->GetParametrUInt(domElement, VAbstractTool::AttrSecondPoint, "0");
|
const quint32 secondPointId = doc->GetParametrUInt(domElement, VAbstractTool::AttrSecondPoint, "0");
|
||||||
|
@ -260,7 +259,7 @@ QString DialogHistory::Record(const VToolRecord &tool)
|
||||||
const QString toolIdName = data->GeometricObject<const VPointF *>(tool.getId())->name();
|
const QString toolIdName = data->GeometricObject<const VPointF *>(tool.getId())->name();
|
||||||
return QString(tr("%3 - normal to line %1_%2")).arg(basePointIdName, secondPointIdName, toolIdName);
|
return QString(tr("%3 - normal to line %1_%2")).arg(basePointIdName, secondPointIdName, toolIdName);
|
||||||
}
|
}
|
||||||
case Valentina::BisectorTool:
|
case Tool::BisectorTool:
|
||||||
{
|
{
|
||||||
const quint32 firstPointId = doc->GetParametrUInt(domElement, VAbstractTool::AttrFirstPoint, "0");
|
const quint32 firstPointId = doc->GetParametrUInt(domElement, VAbstractTool::AttrFirstPoint, "0");
|
||||||
const quint32 secondPointId = doc->GetParametrUInt(domElement, VAbstractTool::AttrSecondPoint, "0");
|
const quint32 secondPointId = doc->GetParametrUInt(domElement, VAbstractTool::AttrSecondPoint, "0");
|
||||||
|
@ -272,7 +271,7 @@ QString DialogHistory::Record(const VToolRecord &tool)
|
||||||
return QString(tr("%4 - bisector of angle %1_%2_%3")).arg(firstPointIdName, secondPointIdName,
|
return QString(tr("%4 - bisector of angle %1_%2_%3")).arg(firstPointIdName, secondPointIdName,
|
||||||
thirdPointIdName, toolIdName);
|
thirdPointIdName, toolIdName);
|
||||||
}
|
}
|
||||||
case Valentina::LineIntersectTool:
|
case Tool::LineIntersectTool:
|
||||||
{
|
{
|
||||||
const quint32 p1Line1 = doc->GetParametrUInt(domElement, VAbstractTool::AttrP1Line1, "0");
|
const quint32 p1Line1 = doc->GetParametrUInt(domElement, VAbstractTool::AttrP1Line1, "0");
|
||||||
const quint32 p2Line1 = doc->GetParametrUInt(domElement, VAbstractTool::AttrP2Line1, "0");
|
const quint32 p2Line1 = doc->GetParametrUInt(domElement, VAbstractTool::AttrP2Line1, "0");
|
||||||
|
@ -287,7 +286,7 @@ QString DialogHistory::Record(const VToolRecord &tool)
|
||||||
p1Line2Name, p2Line2Name,
|
p1Line2Name, p2Line2Name,
|
||||||
toolIdName);
|
toolIdName);
|
||||||
}
|
}
|
||||||
case Valentina::SplineTool:
|
case Tool::SplineTool:
|
||||||
{
|
{
|
||||||
const VSpline *spl = data->GeometricObject<const VSpline *>(tool.getId());
|
const VSpline *spl = data->GeometricObject<const VSpline *>(tool.getId());
|
||||||
SCASSERT(spl != nullptr);
|
SCASSERT(spl != nullptr);
|
||||||
|
@ -295,14 +294,14 @@ QString DialogHistory::Record(const VToolRecord &tool)
|
||||||
const QString splP4Name = data->GeometricObject<const VPointF *>(spl->GetP4().id())->name();
|
const QString splP4Name = data->GeometricObject<const VPointF *>(spl->GetP4().id())->name();
|
||||||
return QString(tr("Curve %1_%2")).arg(splP1Name, splP4Name);
|
return QString(tr("Curve %1_%2")).arg(splP1Name, splP4Name);
|
||||||
}
|
}
|
||||||
case Valentina::ArcTool:
|
case Tool::ArcTool:
|
||||||
{
|
{
|
||||||
const VArc *arc = data->GeometricObject<const VArc *>(tool.getId());
|
const VArc *arc = data->GeometricObject<const VArc *>(tool.getId());
|
||||||
SCASSERT(arc != nullptr);
|
SCASSERT(arc != nullptr);
|
||||||
const QString arcCenterName = data->GeometricObject<const VArc *>(arc->GetCenter().id())->name();
|
const QString arcCenterName = data->GeometricObject<const VArc *>(arc->GetCenter().id())->name();
|
||||||
return QString(tr("Arc with center in point %1")).arg(arcCenterName);
|
return QString(tr("Arc with center in point %1")).arg(arcCenterName);
|
||||||
}
|
}
|
||||||
case Valentina::SplinePathTool:
|
case Tool::SplinePathTool:
|
||||||
{
|
{
|
||||||
const VSplinePath *splPath = data->GeometricObject<const VSplinePath *>(tool.getId());
|
const VSplinePath *splPath = data->GeometricObject<const VSplinePath *>(tool.getId());
|
||||||
SCASSERT(splPath != nullptr);
|
SCASSERT(splPath != nullptr);
|
||||||
|
@ -325,7 +324,7 @@ QString DialogHistory::Record(const VToolRecord &tool)
|
||||||
}
|
}
|
||||||
return record;
|
return record;
|
||||||
}
|
}
|
||||||
case Valentina::PointOfContact:
|
case Tool::PointOfContact:
|
||||||
{
|
{
|
||||||
const quint32 center = doc->GetParametrUInt(domElement, VAbstractTool::AttrCenter, "0");
|
const quint32 center = doc->GetParametrUInt(domElement, VAbstractTool::AttrCenter, "0");
|
||||||
const quint32 firstPointId = doc->GetParametrUInt(domElement, VAbstractTool::AttrFirstPoint, "0");
|
const quint32 firstPointId = doc->GetParametrUInt(domElement, VAbstractTool::AttrFirstPoint, "0");
|
||||||
|
@ -337,7 +336,7 @@ QString DialogHistory::Record(const VToolRecord &tool)
|
||||||
return QString(tr("%4 - point of contact of arc with the center in point %1 and line %2_%3")).arg(
|
return QString(tr("%4 - point of contact of arc with the center in point %1 and line %2_%3")).arg(
|
||||||
centerName, firstPointIdName, secondPointIdName, toolIdName);
|
centerName, firstPointIdName, secondPointIdName, toolIdName);
|
||||||
}
|
}
|
||||||
case Valentina::Height:
|
case Tool::Height:
|
||||||
{
|
{
|
||||||
const quint32 basePointId = doc->GetParametrUInt(domElement, VAbstractTool::AttrBasePoint, "0");
|
const quint32 basePointId = doc->GetParametrUInt(domElement, VAbstractTool::AttrBasePoint, "0");
|
||||||
const quint32 p1LineId = doc->GetParametrUInt(domElement, VAbstractTool::AttrP1Line, "0");
|
const quint32 p1LineId = doc->GetParametrUInt(domElement, VAbstractTool::AttrP1Line, "0");
|
||||||
|
@ -349,7 +348,7 @@ QString DialogHistory::Record(const VToolRecord &tool)
|
||||||
p1LineIdName,
|
p1LineIdName,
|
||||||
p2LineIdName);
|
p2LineIdName);
|
||||||
}
|
}
|
||||||
case Valentina::Triangle:
|
case Tool::Triangle:
|
||||||
{
|
{
|
||||||
const quint32 axisP1Id = doc->GetParametrUInt(domElement, VAbstractTool::AttrAxisP1, "0");
|
const quint32 axisP1Id = doc->GetParametrUInt(domElement, VAbstractTool::AttrAxisP1, "0");
|
||||||
const quint32 axisP2Id = doc->GetParametrUInt(domElement, VAbstractTool::AttrAxisP2, "0");
|
const quint32 axisP2Id = doc->GetParametrUInt(domElement, VAbstractTool::AttrAxisP2, "0");
|
||||||
|
@ -362,7 +361,7 @@ QString DialogHistory::Record(const VToolRecord &tool)
|
||||||
return QString(tr("Triangle: axis %1_%2, points %3 and %4")).arg(axisP1IdName, axisP2IdName,
|
return QString(tr("Triangle: axis %1_%2, points %3 and %4")).arg(axisP1IdName, axisP2IdName,
|
||||||
firstPointIdName, secondPointIdName);
|
firstPointIdName, secondPointIdName);
|
||||||
}
|
}
|
||||||
case Valentina::PointOfIntersection:
|
case Tool::PointOfIntersection:
|
||||||
{
|
{
|
||||||
const quint32 firstPointId = doc->GetParametrUInt(domElement, VAbstractTool::AttrFirstPoint, "0");
|
const quint32 firstPointId = doc->GetParametrUInt(domElement, VAbstractTool::AttrFirstPoint, "0");
|
||||||
const quint32 secondPointId = doc->GetParametrUInt(domElement, VAbstractTool::AttrSecondPoint, "0");
|
const quint32 secondPointId = doc->GetParametrUInt(domElement, VAbstractTool::AttrSecondPoint, "0");
|
||||||
|
@ -372,7 +371,7 @@ QString DialogHistory::Record(const VToolRecord &tool)
|
||||||
return QString(tr("%1 - point of intersection %2 and %3")).arg(toolIdName, firstPointIdName,
|
return QString(tr("%1 - point of intersection %2 and %3")).arg(toolIdName, firstPointIdName,
|
||||||
secondPointIdName);
|
secondPointIdName);
|
||||||
}
|
}
|
||||||
case Valentina::CutArcTool:
|
case Tool::CutArcTool:
|
||||||
{
|
{
|
||||||
const quint32 arcId = doc->GetParametrUInt(domElement, VToolCutArc::AttrArc, "0");
|
const quint32 arcId = doc->GetParametrUInt(domElement, VToolCutArc::AttrArc, "0");
|
||||||
const VArc *arc = data->GeometricObject<const VArc *>(arcId);
|
const VArc *arc = data->GeometricObject<const VArc *>(arcId);
|
||||||
|
@ -381,7 +380,7 @@ QString DialogHistory::Record(const VToolRecord &tool)
|
||||||
const QString toolIdName = data->GeometricObject<const VPointF *>(tool.getId())->name();
|
const QString toolIdName = data->GeometricObject<const VPointF *>(tool.getId())->name();
|
||||||
return QString(tr("%1 - cut arc with center %2")).arg(toolIdName, arcCenterName);
|
return QString(tr("%1 - cut arc with center %2")).arg(toolIdName, arcCenterName);
|
||||||
}
|
}
|
||||||
case Valentina::CutSplineTool:
|
case Tool::CutSplineTool:
|
||||||
{
|
{
|
||||||
const quint32 splineId = doc->GetParametrUInt(domElement, VToolCutSpline::AttrSpline, "0");
|
const quint32 splineId = doc->GetParametrUInt(domElement, VToolCutSpline::AttrSpline, "0");
|
||||||
const VSpline *spl = data->GeometricObject<const VSpline *>(splineId);
|
const VSpline *spl = data->GeometricObject<const VSpline *>(splineId);
|
||||||
|
@ -391,7 +390,7 @@ QString DialogHistory::Record(const VToolRecord &tool)
|
||||||
const QString splP4Name = data->GeometricObject<const VPointF *>(spl->GetP4().id())->name();
|
const QString splP4Name = data->GeometricObject<const VPointF *>(spl->GetP4().id())->name();
|
||||||
return QString(tr("%1 - cut curve %2_%3")).arg(toolIdName, splP1Name, splP4Name);
|
return QString(tr("%1 - cut curve %2_%3")).arg(toolIdName, splP1Name, splP4Name);
|
||||||
}
|
}
|
||||||
case Valentina::CutSplinePathTool:
|
case Tool::CutSplinePathTool:
|
||||||
{
|
{
|
||||||
const quint32 splinePathId = doc->GetParametrUInt(domElement, VToolCutSplinePath::AttrSplinePath, "0");
|
const quint32 splinePathId = doc->GetParametrUInt(domElement, VToolCutSplinePath::AttrSplinePath, "0");
|
||||||
const VSplinePath *splPath = data->GeometricObject<const VSplinePath *>(splinePathId);
|
const VSplinePath *splPath = data->GeometricObject<const VSplinePath *>(splinePathId);
|
||||||
|
@ -419,17 +418,17 @@ QString DialogHistory::Record(const VToolRecord &tool)
|
||||||
}
|
}
|
||||||
//Because "history" not only show history of pattern, but help restore current data for each pattern's
|
//Because "history" not only show history of pattern, but help restore current data for each pattern's
|
||||||
//piece, we need add record about details and nodes, but don't show them.
|
//piece, we need add record about details and nodes, but don't show them.
|
||||||
case Valentina::DetailTool:
|
case Tool::DetailTool:
|
||||||
break;
|
break;
|
||||||
case Valentina::UnionDetails:
|
case Tool::UnionDetails:
|
||||||
break;
|
break;
|
||||||
case Valentina::NodeArc:
|
case Tool::NodeArc:
|
||||||
break;
|
break;
|
||||||
case Valentina::NodePoint:
|
case Tool::NodePoint:
|
||||||
break;
|
break;
|
||||||
case Valentina::NodeSpline:
|
case Tool::NodeSpline:
|
||||||
break;
|
break;
|
||||||
case Valentina::NodeSplinePath:
|
case Tool::NodeSplinePath:
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
qDebug()<<"Got wrong tool type. Ignore.";
|
qDebug()<<"Got wrong tool type. Ignore.";
|
||||||
|
|
|
@ -30,7 +30,9 @@
|
||||||
#define DIALOGHISTORY_H
|
#define DIALOGHISTORY_H
|
||||||
|
|
||||||
#include "../tools/dialogtool.h"
|
#include "../tools/dialogtool.h"
|
||||||
#include "../../xml/vpattern.h"
|
|
||||||
|
class VPattern;
|
||||||
|
class VToolRecord;
|
||||||
|
|
||||||
namespace Ui
|
namespace Ui
|
||||||
{
|
{
|
||||||
|
|
|
@ -30,15 +30,13 @@
|
||||||
#include "ui_dialogincrements.h"
|
#include "ui_dialogincrements.h"
|
||||||
#include "../../widgets/doubledelegate.h"
|
#include "../../widgets/doubledelegate.h"
|
||||||
#include "../../widgets/textdelegate.h"
|
#include "../../widgets/textdelegate.h"
|
||||||
#include "../../exception/vexception.h"
|
|
||||||
#include "../../xml/vstandardmeasurements.h"
|
#include "../../xml/vstandardmeasurements.h"
|
||||||
|
#include "../../xml/vpattern.h"
|
||||||
|
#include "../../xml/vindividualmeasurements.h"
|
||||||
|
|
||||||
#include <QPushButton>
|
|
||||||
#include <QFile>
|
|
||||||
#include <QFileDialog>
|
#include <QFileDialog>
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
#include <QCloseEvent>
|
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
|
@ -52,7 +50,7 @@ DialogIncrements::DialogIncrements(VContainer *data, VPattern *doc, QWidget *par
|
||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
|
|
||||||
if (qApp->patternType() == Pattern::Individual)
|
if (qApp->patternType() == MeasurementsType::Individual)
|
||||||
{
|
{
|
||||||
const QString filePath = doc->MPath();
|
const QString filePath = doc->MPath();
|
||||||
try
|
try
|
||||||
|
@ -84,7 +82,7 @@ DialogIncrements::DialogIncrements(VContainer *data, VPattern *doc, QWidget *par
|
||||||
FillLengthSplines();
|
FillLengthSplines();
|
||||||
FillLengthArcs();
|
FillLengthArcs();
|
||||||
|
|
||||||
if (qApp->patternType() == Pattern::Standard)
|
if (qApp->patternType() == MeasurementsType::Standard)
|
||||||
{
|
{
|
||||||
ui->pagePersonalInformation->setVisible(false);
|
ui->pagePersonalInformation->setVisible(false);
|
||||||
}
|
}
|
||||||
|
@ -108,8 +106,8 @@ DialogIncrements::DialogIncrements(VContainer *data, VPattern *doc, QWidget *par
|
||||||
ui->lineEditGivenName->setText(m->GivenName());
|
ui->lineEditGivenName->setText(m->GivenName());
|
||||||
ui->lineEditFamilyName->setText(m->FamilyName());
|
ui->lineEditFamilyName->setText(m->FamilyName());
|
||||||
|
|
||||||
ui->comboBoxSex->addItem(tr("male"), QVariant(m->GenderToStr(VIndividualMeasurements::Male)));
|
ui->comboBoxSex->addItem(tr("male"), QVariant(m->GenderToStr(SexType::Male)));
|
||||||
ui->comboBoxSex->addItem(tr("female"), QVariant(m->GenderToStr(VIndividualMeasurements::Female)));
|
ui->comboBoxSex->addItem(tr("female"), QVariant(m->GenderToStr(SexType::Female)));
|
||||||
qint32 index = ui->comboBoxSex->findData(m->GenderToStr(m->Sex()));
|
qint32 index = ui->comboBoxSex->findData(m->GenderToStr(m->Sex()));
|
||||||
if (index != -1)
|
if (index != -1)
|
||||||
{
|
{
|
||||||
|
@ -133,7 +131,7 @@ DialogIncrements::DialogIncrements(VContainer *data, VPattern *doc, QWidget *par
|
||||||
connect(ui->toolButtonAdd, &QPushButton::clicked, this, &DialogIncrements::clickedToolButtonAdd);
|
connect(ui->toolButtonAdd, &QPushButton::clicked, this, &DialogIncrements::clickedToolButtonAdd);
|
||||||
connect(ui->toolButtonRemove, &QPushButton::clicked, this, &DialogIncrements::clickedToolButtonRemove);
|
connect(ui->toolButtonRemove, &QPushButton::clicked, this, &DialogIncrements::clickedToolButtonRemove);
|
||||||
|
|
||||||
connect(this, &DialogIncrements::FullUpdateTree, this->doc, &VPattern::FullUpdateTree);
|
connect(this, &DialogIncrements::FullUpdateTree, this->doc, &VPattern::LiteParseTree);
|
||||||
connect(this, &DialogIncrements::haveLiteChange, this->doc, &VPattern::haveLiteChange);
|
connect(this, &DialogIncrements::haveLiteChange, this->doc, &VPattern::haveLiteChange);
|
||||||
connect(this->doc, &VPattern::FullUpdateFromFile, this, &DialogIncrements::FullUpdateFromFile);
|
connect(this->doc, &VPattern::FullUpdateFromFile, this, &DialogIncrements::FullUpdateFromFile);
|
||||||
|
|
||||||
|
@ -177,7 +175,7 @@ void DialogIncrements::FillMeasurements()
|
||||||
item->setTextAlignment(Qt::AlignLeft);
|
item->setTextAlignment(Qt::AlignLeft);
|
||||||
ui->tableWidgetMeasurements->setItem(currentRow, 0, item);
|
ui->tableWidgetMeasurements->setItem(currentRow, 0, item);
|
||||||
|
|
||||||
if (qApp->patternType() == Pattern::Standard)
|
if (qApp->patternType() == MeasurementsType::Standard)
|
||||||
{
|
{
|
||||||
QTableWidgetItem *item = new QTableWidgetItem(QString().setNum(data->GetValueStandardTableRow(iMap.key())));
|
QTableWidgetItem *item = new QTableWidgetItem(QString().setNum(data->GetValueStandardTableRow(iMap.key())));
|
||||||
item->setTextAlignment(Qt::AlignHCenter);
|
item->setTextAlignment(Qt::AlignHCenter);
|
||||||
|
@ -192,7 +190,7 @@ void DialogIncrements::FillMeasurements()
|
||||||
item->setTextAlignment(Qt::AlignHCenter);
|
item->setTextAlignment(Qt::AlignHCenter);
|
||||||
ui->tableWidgetMeasurements->setItem(currentRow, 2, item);
|
ui->tableWidgetMeasurements->setItem(currentRow, 2, item);
|
||||||
|
|
||||||
if (qApp->patternType() == Pattern::Standard)
|
if (qApp->patternType() == MeasurementsType::Standard)
|
||||||
{
|
{
|
||||||
QTableWidgetItem *item = new QTableWidgetItem(QString().setNum(m.GetKsize()));
|
QTableWidgetItem *item = new QTableWidgetItem(QString().setNum(m.GetKsize()));
|
||||||
item->setTextAlignment(Qt::AlignHCenter);
|
item->setTextAlignment(Qt::AlignHCenter);
|
||||||
|
@ -257,7 +255,7 @@ void DialogIncrements::FillIncrements()
|
||||||
item->setData(Qt::UserRole, incr.getId());
|
item->setData(Qt::UserRole, incr.getId());
|
||||||
ui->tableWidgetIncrement->setItem(currentRow, 0, item);
|
ui->tableWidgetIncrement->setItem(currentRow, 0, item);
|
||||||
|
|
||||||
if (qApp->patternType() == Pattern::Standard)
|
if (qApp->patternType() == MeasurementsType::Standard)
|
||||||
{
|
{
|
||||||
item = new QTableWidgetItem(QString().setNum(data->GetValueIncrementTableRow(iMap.value())));
|
item = new QTableWidgetItem(QString().setNum(data->GetValueIncrementTableRow(iMap.value())));
|
||||||
item->setTextAlignment(Qt::AlignHCenter);
|
item->setTextAlignment(Qt::AlignHCenter);
|
||||||
|
@ -272,7 +270,7 @@ void DialogIncrements::FillIncrements()
|
||||||
item->setTextAlignment(Qt::AlignHCenter);
|
item->setTextAlignment(Qt::AlignHCenter);
|
||||||
ui->tableWidgetIncrement->setItem(currentRow, 2, item);
|
ui->tableWidgetIncrement->setItem(currentRow, 2, item);
|
||||||
|
|
||||||
if (qApp->patternType() == Pattern::Standard)
|
if (qApp->patternType() == MeasurementsType::Standard)
|
||||||
{
|
{
|
||||||
item = new QTableWidgetItem(QString().setNum(incr.getKsize()));
|
item = new QTableWidgetItem(QString().setNum(incr.getKsize()));
|
||||||
item->setTextAlignment(Qt::AlignHCenter);
|
item->setTextAlignment(Qt::AlignHCenter);
|
||||||
|
@ -495,7 +493,7 @@ void DialogIncrements::OpenTable()
|
||||||
{
|
{
|
||||||
QString text = tr("Measurements use different units than pattern. This pattern required measurements in %1")
|
QString text = tr("Measurements use different units than pattern. This pattern required measurements in %1")
|
||||||
.arg(doc->UnitsToStr(qApp->patternUnit()));
|
.arg(doc->UnitsToStr(qApp->patternUnit()));
|
||||||
if (qApp->patternType() == Pattern::Individual)
|
if (qApp->patternType() == MeasurementsType::Individual)
|
||||||
{
|
{
|
||||||
const QString filter(tr("Individual measurements (*.vit)"));
|
const QString filter(tr("Individual measurements (*.vit)"));
|
||||||
const QString filePath = QFileDialog::getOpenFileName(this, tr("Open file"), QDir::homePath(), filter);
|
const QString filePath = QFileDialog::getOpenFileName(this, tr("Open file"), QDir::homePath(), filter);
|
||||||
|
@ -519,7 +517,7 @@ void DialogIncrements::OpenTable()
|
||||||
emit DialogClosed(QDialog::Rejected);
|
emit DialogClosed(QDialog::Rejected);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Valentina::Units mUnit = m1->Unit();
|
Unit mUnit = m1->MUnit();
|
||||||
if (qApp->patternUnit() != mUnit)
|
if (qApp->patternUnit() != mUnit)
|
||||||
{
|
{
|
||||||
QMessageBox::critical(this, tr("Wrong units."), text);
|
QMessageBox::critical(this, tr("Wrong units."), text);
|
||||||
|
@ -551,7 +549,7 @@ void DialogIncrements::OpenTable()
|
||||||
|
|
||||||
m1 = new VStandardMeasurements(data);
|
m1 = new VStandardMeasurements(data);
|
||||||
m1->setContent(filePath);
|
m1->setContent(filePath);
|
||||||
Valentina::Units mUnit = m1->Unit();
|
Unit mUnit = m1->MUnit();
|
||||||
if (qApp->patternUnit() != mUnit)
|
if (qApp->patternUnit() != mUnit)
|
||||||
{
|
{
|
||||||
QMessageBox::critical(this, tr("Wrong units."), text);
|
QMessageBox::critical(this, tr("Wrong units."), text);
|
||||||
|
|
|
@ -30,8 +30,9 @@
|
||||||
#define DIALOGINCREMENTS_H
|
#define DIALOGINCREMENTS_H
|
||||||
|
|
||||||
#include "../tools/dialogtool.h"
|
#include "../tools/dialogtool.h"
|
||||||
#include "../../xml/vpattern.h"
|
|
||||||
#include "../../xml/vindividualmeasurements.h"
|
class VPattern;
|
||||||
|
class VIndividualMeasurements;
|
||||||
|
|
||||||
namespace Ui
|
namespace Ui
|
||||||
{
|
{
|
||||||
|
|
|
@ -28,13 +28,11 @@
|
||||||
|
|
||||||
#include "dialogindividualmeasurements.h"
|
#include "dialogindividualmeasurements.h"
|
||||||
#include "ui_dialogindividualmeasurements.h"
|
#include "ui_dialogindividualmeasurements.h"
|
||||||
#include <QButtonGroup>
|
|
||||||
#include "../../xml/vindividualmeasurements.h"
|
#include "../../xml/vindividualmeasurements.h"
|
||||||
#include <QSettings>
|
|
||||||
#include <QFileDialog>
|
#include <QFileDialog>
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
#include "../../widgets/vapplication.h"
|
#include "../../widgets/vapplication.h"
|
||||||
#include <QPushButton>
|
#include "../../container/vcontainer.h"
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
DialogIndividualMeasurements::DialogIndividualMeasurements(VContainer *data, const QString &patternPieceName,
|
DialogIndividualMeasurements::DialogIndividualMeasurements(VContainer *data, const QString &patternPieceName,
|
||||||
|
@ -105,9 +103,9 @@ void DialogIndividualMeasurements::DialogAccepted()
|
||||||
VIndividualMeasurements m(data);
|
VIndividualMeasurements m(data);
|
||||||
m.setContent(_tablePath);
|
m.setContent(_tablePath);
|
||||||
const qint32 index = ui->comboBoxUnits->currentIndex();
|
const qint32 index = ui->comboBoxUnits->currentIndex();
|
||||||
Valentina::Units unit = VDomDocument::StrToUnits(ui->comboBoxUnits->itemData(index).toString());
|
Unit unit = VDomDocument::StrToUnits(ui->comboBoxUnits->itemData(index).toString());
|
||||||
m.setUnit(unit);
|
m.setUnit(unit);
|
||||||
qApp->setPatternUnit( m.Unit());
|
qApp->setPatternUnit( m.MUnit());
|
||||||
QFile iMeasur(_tablePath);
|
QFile iMeasur(_tablePath);
|
||||||
if (iMeasur.open(QIODevice::WriteOnly| QIODevice::Truncate))
|
if (iMeasur.open(QIODevice::WriteOnly| QIODevice::Truncate))
|
||||||
{
|
{
|
||||||
|
@ -238,6 +236,6 @@ void DialogIndividualMeasurements::NewTable()
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void DialogIndividualMeasurements::InitUnits()
|
void DialogIndividualMeasurements::InitUnits()
|
||||||
{
|
{
|
||||||
ui->comboBoxUnits->addItem(tr("centimeter"), QVariant(VDomDocument::UnitsToStr(Valentina::Cm)));
|
ui->comboBoxUnits->addItem(tr("centimeter"), QVariant(VDomDocument::UnitsToStr(Unit::Cm)));
|
||||||
ui->comboBoxUnits->addItem(tr("inch"), QVariant(VDomDocument::UnitsToStr(Valentina::Inch)));
|
ui->comboBoxUnits->addItem(tr("inch"), QVariant(VDomDocument::UnitsToStr(Unit::Inch)));
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,7 +30,8 @@
|
||||||
#define DIALOGINDIVIDUALMEASUREMENTS_H
|
#define DIALOGINDIVIDUALMEASUREMENTS_H
|
||||||
|
|
||||||
#include <QDialog>
|
#include <QDialog>
|
||||||
#include "../../container/vcontainer.h"
|
|
||||||
|
class VContainer;
|
||||||
|
|
||||||
namespace Ui
|
namespace Ui
|
||||||
{
|
{
|
||||||
|
|
|
@ -31,7 +31,7 @@
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
DialogMeasurements::DialogMeasurements(QWidget *parent) :
|
DialogMeasurements::DialogMeasurements(QWidget *parent) :
|
||||||
QDialog(parent), ui(new Ui::DialogMeasurements), result(Measurements::Individual)
|
QDialog(parent), ui(new Ui::DialogMeasurements), result(MeasurementsType::Individual)
|
||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
connect(ui->toolButtonStandard, &QToolButton::clicked, this, &DialogMeasurements::StandardMeasurements);
|
connect(ui->toolButtonStandard, &QToolButton::clicked, this, &DialogMeasurements::StandardMeasurements);
|
||||||
|
@ -45,7 +45,7 @@ DialogMeasurements::~DialogMeasurements()
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
Measurements::Type DialogMeasurements::type() const
|
MeasurementsType DialogMeasurements::type() const
|
||||||
{
|
{
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
@ -53,13 +53,13 @@ Measurements::Type DialogMeasurements::type() const
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void DialogMeasurements::StandardMeasurements()
|
void DialogMeasurements::StandardMeasurements()
|
||||||
{
|
{
|
||||||
result = Measurements::Standard;
|
result = MeasurementsType::Standard;
|
||||||
accept();
|
accept();
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void DialogMeasurements::IndividualMeasurements()
|
void DialogMeasurements::IndividualMeasurements()
|
||||||
{
|
{
|
||||||
result = Measurements::Individual;
|
result = MeasurementsType::Individual;
|
||||||
accept();
|
accept();
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,33 +30,24 @@
|
||||||
#define DIALOGMEASUREMENTS_H
|
#define DIALOGMEASUREMENTS_H
|
||||||
|
|
||||||
#include <QDialog>
|
#include <QDialog>
|
||||||
|
#include "../../options.h"
|
||||||
|
|
||||||
namespace Ui
|
namespace Ui
|
||||||
{
|
{
|
||||||
class DialogMeasurements;
|
class DialogMeasurements;
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace Measurements
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* @brief The Type enum pattern measurements.
|
|
||||||
*/
|
|
||||||
enum Type { Standard, Individual };
|
|
||||||
Q_DECLARE_FLAGS(Types, Type)
|
|
||||||
}
|
|
||||||
Q_DECLARE_OPERATORS_FOR_FLAGS( Measurements::Types )
|
|
||||||
|
|
||||||
class DialogMeasurements : public QDialog
|
class DialogMeasurements : public QDialog
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
explicit DialogMeasurements(QWidget *parent = nullptr);
|
explicit DialogMeasurements(QWidget *parent = nullptr);
|
||||||
~DialogMeasurements();
|
~DialogMeasurements();
|
||||||
Measurements::Type type() const;
|
MeasurementsType type() const;
|
||||||
private:
|
private:
|
||||||
Q_DISABLE_COPY(DialogMeasurements)
|
Q_DISABLE_COPY(DialogMeasurements)
|
||||||
Ui::DialogMeasurements *ui;
|
Ui::DialogMeasurements *ui;
|
||||||
Measurements::Type result;
|
MeasurementsType result;
|
||||||
void StandardMeasurements();
|
void StandardMeasurements();
|
||||||
void IndividualMeasurements();
|
void IndividualMeasurements();
|
||||||
};
|
};
|
||||||
|
|
|
@ -29,7 +29,7 @@
|
||||||
#include "dialogpatternproperties.h"
|
#include "dialogpatternproperties.h"
|
||||||
#include "ui_dialogpatternproperties.h"
|
#include "ui_dialogpatternproperties.h"
|
||||||
#include <QSettings>
|
#include <QSettings>
|
||||||
#include <QPushButton>
|
#include "../../xml/vpattern.h"
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
DialogPatternProperties::DialogPatternProperties(VPattern *doc, QWidget *parent) :
|
DialogPatternProperties::DialogPatternProperties(VPattern *doc, QWidget *parent) :
|
||||||
|
|
|
@ -30,7 +30,8 @@
|
||||||
#define DIALOGPATTERNPROPERTIES_H
|
#define DIALOGPATTERNPROPERTIES_H
|
||||||
|
|
||||||
#include <QDialog>
|
#include <QDialog>
|
||||||
#include "../../xml/vpattern.h"
|
|
||||||
|
class VPattern;
|
||||||
|
|
||||||
namespace Ui
|
namespace Ui
|
||||||
{
|
{
|
||||||
|
|
|
@ -563,7 +563,7 @@ void DialogPatternXmlEdit::ButtonApplyChangesClicked()
|
||||||
QMessageBox::warning(this, "Error in changes", message);
|
QMessageBox::warning(this, "Error in changes", message);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this->doc->FullUpdateTree();
|
this->doc->LiteParseTree();
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
|
@ -31,7 +31,7 @@
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
#include "../../xml/vstandardmeasurements.h"
|
#include "../../xml/vstandardmeasurements.h"
|
||||||
#include "../../widgets/vapplication.h"
|
#include "../../widgets/vapplication.h"
|
||||||
#include <QPushButton>
|
#include "../../container/vcontainer.h"
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
DialogStandardMeasurements::DialogStandardMeasurements(VContainer *data, const QString &patternPieceName,
|
DialogStandardMeasurements::DialogStandardMeasurements(VContainer *data, const QString &patternPieceName,
|
||||||
|
@ -89,7 +89,7 @@ void DialogStandardMeasurements::DialogAccepted()
|
||||||
VDomDocument::ValidateXML("://schema/standard_measurements.xsd", _tablePath);
|
VDomDocument::ValidateXML("://schema/standard_measurements.xsd", _tablePath);
|
||||||
VStandardMeasurements m(data);
|
VStandardMeasurements m(data);
|
||||||
m.setContent(_tablePath);
|
m.setContent(_tablePath);
|
||||||
qApp->setPatternUnit(m.Unit());
|
qApp->setPatternUnit(m.MUnit());
|
||||||
}
|
}
|
||||||
catch (VException &e)
|
catch (VException &e)
|
||||||
{
|
{
|
||||||
|
|
|
@ -30,7 +30,8 @@
|
||||||
#define DIALOGSTANDARDMEASUREMENTS_H
|
#define DIALOGSTANDARDMEASUREMENTS_H
|
||||||
|
|
||||||
#include <QDialog>
|
#include <QDialog>
|
||||||
#include "../../container/vcontainer.h"
|
|
||||||
|
class VContainer;
|
||||||
|
|
||||||
namespace Ui
|
namespace Ui
|
||||||
{
|
{
|
||||||
|
|
|
@ -29,6 +29,7 @@
|
||||||
#include "pages.h"
|
#include "pages.h"
|
||||||
#include "../../options.h"
|
#include "../../options.h"
|
||||||
#include "../../widgets/vapplication.h"
|
#include "../../widgets/vapplication.h"
|
||||||
|
#include "../../widgets/vmaingraphicsview.h"
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
ConfigurationPage::ConfigurationPage(QWidget *parent):
|
ConfigurationPage::ConfigurationPage(QWidget *parent):
|
||||||
|
@ -51,7 +52,21 @@ void ConfigurationPage::Apply()
|
||||||
QApplication::applicationName());
|
QApplication::applicationName());
|
||||||
settings.setValue("configuration/autosave/state", autoSaveCheck->isChecked());
|
settings.setValue("configuration/autosave/state", autoSaveCheck->isChecked());
|
||||||
settings.setValue("configuration/autosave/time", autoTime->value());
|
settings.setValue("configuration/autosave/time", autoTime->value());
|
||||||
|
|
||||||
|
QTimer *autoSaveTimer = qApp->getAutoSaveTimer();
|
||||||
|
SCASSERT(autoSaveTimer);
|
||||||
|
|
||||||
|
if (autoSaveCheck->isChecked())
|
||||||
|
{
|
||||||
|
autoSaveTimer->start(autoTime->value()*60000);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
autoSaveTimer->stop();
|
||||||
|
}
|
||||||
|
|
||||||
settings.setValue("configuration/osSeparator", osOptionCheck->isChecked());
|
settings.setValue("configuration/osSeparator", osOptionCheck->isChecked());
|
||||||
|
|
||||||
if (langChanged)
|
if (langChanged)
|
||||||
{
|
{
|
||||||
QString locale = qvariant_cast<QString>(langCombo->itemData(langCombo->currentIndex()));
|
QString locale = qvariant_cast<QString>(langCombo->itemData(langCombo->currentIndex()));
|
||||||
|
@ -128,7 +143,7 @@ QGroupBox *ConfigurationPage::LangGroup()
|
||||||
{
|
{
|
||||||
// get locale extracted by filename
|
// get locale extracted by filename
|
||||||
QString locale;
|
QString locale;
|
||||||
locale = fileNames[i]; // "valentina_de.qm"
|
locale = fileNames.at(i); // "valentina_de.qm"
|
||||||
locale.truncate(locale.lastIndexOf('.')); // "valentina_de"
|
locale.truncate(locale.lastIndexOf('.')); // "valentina_de"
|
||||||
locale.remove(0, locale.indexOf('_') + 1); // "de"
|
locale.remove(0, locale.indexOf('_') + 1); // "de"
|
||||||
|
|
||||||
|
@ -174,16 +189,16 @@ QGroupBox *ConfigurationPage::LangGroup()
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
PatternPage::PatternPage(QWidget *parent):
|
PatternPage::PatternPage(QWidget *parent):
|
||||||
QWidget(parent), userName(0), graphOutputCheck(0), undoneCount(0)
|
QWidget(parent), userName(0), graphOutputCheck(0), undoCount(0)
|
||||||
{
|
{
|
||||||
QGroupBox *userGroup = UserGroup();
|
QGroupBox *userGroup = UserGroup();
|
||||||
QGroupBox *graphOutputGroup = GraphOutputGroup();
|
QGroupBox *graphOutputGroup = GraphOutputGroup();
|
||||||
QGroupBox *undoneGroup = UndoneGroup();
|
QGroupBox *undoGroup = UndoGroup();
|
||||||
|
|
||||||
QVBoxLayout *mainLayout = new QVBoxLayout;
|
QVBoxLayout *mainLayout = new QVBoxLayout;
|
||||||
mainLayout->addWidget(userGroup);
|
mainLayout->addWidget(userGroup);
|
||||||
mainLayout->addWidget(graphOutputGroup);
|
mainLayout->addWidget(graphOutputGroup);
|
||||||
mainLayout->addWidget(undoneGroup);
|
mainLayout->addWidget(undoGroup);
|
||||||
mainLayout->addStretch(1);
|
mainLayout->addStretch(1);
|
||||||
setLayout(mainLayout);
|
setLayout(mainLayout);
|
||||||
}
|
}
|
||||||
|
@ -194,8 +209,16 @@ void PatternPage::Apply()
|
||||||
QSettings settings(QSettings::IniFormat, QSettings::UserScope, QApplication::organizationName(),
|
QSettings settings(QSettings::IniFormat, QSettings::UserScope, QApplication::organizationName(),
|
||||||
QApplication::applicationName());
|
QApplication::applicationName());
|
||||||
settings.setValue("pattern/user", userName->text());
|
settings.setValue("pattern/user", userName->text());
|
||||||
//settings.setValue("pattern/graphicalOutput", graphOutputCheck->isChecked());
|
|
||||||
settings.setValue("pattern/undone", undoneCount->value());
|
// Scene antialiasing
|
||||||
|
settings.setValue("pattern/graphicalOutput", graphOutputCheck->isChecked());
|
||||||
|
qApp->getSceneView()->setRenderHint(QPainter::Antialiasing, graphOutputCheck->isChecked());
|
||||||
|
qApp->getSceneView()->setRenderHint(QPainter::SmoothPixmapTransform, graphOutputCheck->isChecked());
|
||||||
|
|
||||||
|
/* Maximum number of commands in undo stack may only be set when the undo stack is empty, since setting it on a
|
||||||
|
* non-empty stack might delete the command at the current index. Calling setUndoLimit() on a non-empty stack
|
||||||
|
* prints a warning and does nothing.*/
|
||||||
|
settings.setValue("pattern/undo", undoCount->value());
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
@ -228,15 +251,14 @@ QGroupBox *PatternPage::UserGroup()
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
QGroupBox *PatternPage::GraphOutputGroup()
|
QGroupBox *PatternPage::GraphOutputGroup()
|
||||||
{
|
{
|
||||||
// QSettings settings(QSettings::IniFormat, QSettings::UserScope, QApplication::organizationName(),
|
QSettings settings(QSettings::IniFormat, QSettings::UserScope, QApplication::organizationName(),
|
||||||
// QApplication::applicationName());
|
QApplication::applicationName());
|
||||||
|
|
||||||
QGroupBox *graphOutputGroup = new QGroupBox(tr("Graphical output"));
|
QGroupBox *graphOutputGroup = new QGroupBox(tr("Graphical output"));
|
||||||
|
|
||||||
graphOutputCheck = new QCheckBox(tr("Use antialiasing"));
|
graphOutputCheck = new QCheckBox(tr("Use antialiasing"));
|
||||||
//bool graphOutputValue = settings.value("pattern/graphicalOutput", 1).toBool();
|
bool graphOutputValue = settings.value("pattern/graphicalOutput", 1).toBool();
|
||||||
//graphOutputCheck->setChecked(graphOutputValue);
|
graphOutputCheck->setChecked(graphOutputValue);
|
||||||
graphOutputCheck->setEnabled(false);
|
|
||||||
|
|
||||||
QHBoxLayout *graphLayout = new QHBoxLayout;
|
QHBoxLayout *graphLayout = new QHBoxLayout;
|
||||||
graphLayout->addWidget(graphOutputCheck);
|
graphLayout->addWidget(graphOutputCheck);
|
||||||
|
@ -248,29 +270,29 @@ QGroupBox *PatternPage::GraphOutputGroup()
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
QGroupBox *PatternPage::UndoneGroup()
|
QGroupBox *PatternPage::UndoGroup()
|
||||||
{
|
{
|
||||||
// QSettings settings(QSettings::IniFormat, QSettings::UserScope, QApplication::organizationName(),
|
QSettings settings(QSettings::IniFormat, QSettings::UserScope, QApplication::organizationName(),
|
||||||
// QApplication::applicationName());
|
QApplication::applicationName());
|
||||||
|
|
||||||
QGroupBox *undoneGroup = new QGroupBox(tr("Undone"));
|
QGroupBox *undoGroup = new QGroupBox(tr("Undo"));
|
||||||
QLabel *undoneLabel = new QLabel(tr("Count steps"));
|
QLabel *undoLabel = new QLabel(tr("Count steps (0 - no limit)"));
|
||||||
undoneCount = new QSpinBox;
|
undoCount = new QSpinBox;
|
||||||
// bool ok = true;
|
undoCount->setMinimum(0);
|
||||||
// qint32 count = settings.value("pattern/undone", 100).toInt(&ok);
|
bool ok = true;
|
||||||
// if (ok == false)
|
qint32 count = settings.value("pattern/undo", 0).toInt(&ok);
|
||||||
// {
|
if (ok == false)
|
||||||
// count = 100;
|
{
|
||||||
// }
|
count = 0;
|
||||||
// undoneCount->setValue(count);
|
}
|
||||||
undoneCount->setEnabled(false);
|
undoCount->setValue(count);
|
||||||
|
|
||||||
QHBoxLayout *countLayout = new QHBoxLayout;
|
QHBoxLayout *countLayout = new QHBoxLayout;
|
||||||
countLayout->addWidget(undoneLabel);
|
countLayout->addWidget(undoLabel);
|
||||||
countLayout->addWidget(undoneCount);
|
countLayout->addWidget(undoCount);
|
||||||
|
|
||||||
QVBoxLayout *undoneLayout = new QVBoxLayout;
|
QVBoxLayout *undoLayout = new QVBoxLayout;
|
||||||
undoneLayout->addLayout(countLayout);
|
undoLayout->addLayout(countLayout);
|
||||||
undoneGroup->setLayout(undoneLayout);
|
undoGroup->setLayout(undoLayout);
|
||||||
return undoneGroup;
|
return undoGroup;
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,7 +29,13 @@
|
||||||
#ifndef PAGES_H
|
#ifndef PAGES_H
|
||||||
#define PAGES_H
|
#define PAGES_H
|
||||||
|
|
||||||
#include <QtWidgets>
|
#include <QObject>
|
||||||
|
|
||||||
|
class QCheckBox;
|
||||||
|
class QSpinBox;
|
||||||
|
class QComboBox;
|
||||||
|
class QGroupBox;
|
||||||
|
class QLineEdit;
|
||||||
|
|
||||||
class ConfigurationPage : public QWidget
|
class ConfigurationPage : public QWidget
|
||||||
{
|
{
|
||||||
|
@ -60,10 +66,10 @@ private:
|
||||||
Q_DISABLE_COPY(PatternPage)
|
Q_DISABLE_COPY(PatternPage)
|
||||||
QLineEdit *userName;
|
QLineEdit *userName;
|
||||||
QCheckBox *graphOutputCheck;
|
QCheckBox *graphOutputCheck;
|
||||||
QSpinBox *undoneCount;
|
QSpinBox *undoCount;
|
||||||
QGroupBox *UserGroup();
|
QGroupBox *UserGroup();
|
||||||
QGroupBox *GraphOutputGroup();
|
QGroupBox *GraphOutputGroup();
|
||||||
QGroupBox *UndoneGroup();
|
QGroupBox *UndoGroup();
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // PAGES_H
|
#endif // PAGES_H
|
||||||
|
|
|
@ -108,9 +108,9 @@ DialogAlongLine::~DialogAlongLine()
|
||||||
* @param id id of point or detail
|
* @param id id of point or detail
|
||||||
* @param type type of object
|
* @param type type of object
|
||||||
*/
|
*/
|
||||||
void DialogAlongLine::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
void DialogAlongLine::ChoosedObject(quint32 id, const SceneObject &type)
|
||||||
{
|
{
|
||||||
if (type == Valentina::Point)
|
if (type == SceneObject::Point)
|
||||||
{
|
{
|
||||||
if (number == 0)
|
if (number == 0)
|
||||||
{
|
{
|
||||||
|
|
|
@ -61,7 +61,7 @@ public:
|
||||||
quint32 getSecondPointId() const;
|
quint32 getSecondPointId() const;
|
||||||
void setSecondPointId(const quint32 &value, const quint32 &id);
|
void setSecondPointId(const quint32 &value, const quint32 &id);
|
||||||
public slots:
|
public slots:
|
||||||
virtual void ChoosedObject(quint32 id, const Valentina::Scenes &type);
|
virtual void ChoosedObject(quint32 id, const SceneObject &type);
|
||||||
virtual void DialogAccepted();
|
virtual void DialogAccepted();
|
||||||
/**
|
/**
|
||||||
* @brief DialogApply apply data and emit signal about applied dialog.
|
* @brief DialogApply apply data and emit signal about applied dialog.
|
||||||
|
|
|
@ -30,7 +30,9 @@
|
||||||
#include "ui_dialogarc.h"
|
#include "ui_dialogarc.h"
|
||||||
|
|
||||||
#include <QPushButton>
|
#include <QPushButton>
|
||||||
#include <QtWidgets>
|
|
||||||
|
#include "../../geometry/vpointf.h"
|
||||||
|
#include "../../container/vcontainer.h"
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
|
@ -161,9 +163,9 @@ void DialogArc::SetRadius(const QString &value)
|
||||||
* @param id id of point or detail
|
* @param id id of point or detail
|
||||||
* @param type type of object
|
* @param type type of object
|
||||||
*/
|
*/
|
||||||
void DialogArc::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
void DialogArc::ChoosedObject(quint32 id, const SceneObject &type)
|
||||||
{
|
{
|
||||||
if (type == Valentina::Point)
|
if (type == SceneObject::Point)
|
||||||
{
|
{
|
||||||
const VPointF *point = data->GeometricObject<const VPointF *>(id);
|
const VPointF *point = data->GeometricObject<const VPointF *>(id);
|
||||||
|
|
||||||
|
|
|
@ -59,7 +59,7 @@ public:
|
||||||
QString GetF2() const;
|
QString GetF2() const;
|
||||||
void SetF2(const QString &value);
|
void SetF2(const QString &value);
|
||||||
public slots:
|
public slots:
|
||||||
virtual void ChoosedObject(quint32 id, const Valentina::Scenes &type);
|
virtual void ChoosedObject(quint32 id, const SceneObject &type);
|
||||||
virtual void DialogAccepted();
|
virtual void DialogAccepted();
|
||||||
/** TODO ISSUE 79 : create real function
|
/** TODO ISSUE 79 : create real function
|
||||||
* @brief DialogApply apply data and emit signal about applied dialog.
|
* @brief DialogApply apply data and emit signal about applied dialog.
|
||||||
|
|
|
@ -29,7 +29,8 @@
|
||||||
#include "dialogbisector.h"
|
#include "dialogbisector.h"
|
||||||
#include "ui_dialogbisector.h"
|
#include "ui_dialogbisector.h"
|
||||||
|
|
||||||
#include <QPushButton>
|
#include "../../geometry/vpointf.h"
|
||||||
|
#include "../../container/vcontainer.h"
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
|
@ -109,9 +110,9 @@ DialogBisector::~DialogBisector()
|
||||||
* @param id id of point or detail
|
* @param id id of point or detail
|
||||||
* @param type type of object
|
* @param type type of object
|
||||||
*/
|
*/
|
||||||
void DialogBisector::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
void DialogBisector::ChoosedObject(quint32 id, const SceneObject &type)
|
||||||
{
|
{
|
||||||
if (type == Valentina::Point)
|
if (type == SceneObject::Point)
|
||||||
{
|
{
|
||||||
const VPointF *point = data->GeometricObject<const VPointF *>(id);
|
const VPointF *point = data->GeometricObject<const VPointF *>(id);
|
||||||
if (number == 0)
|
if (number == 0)
|
||||||
|
|
|
@ -66,7 +66,7 @@ public:
|
||||||
quint32 getThirdPointId() const;
|
quint32 getThirdPointId() const;
|
||||||
void setThirdPointId(const quint32 &value, const quint32 &id);
|
void setThirdPointId(const quint32 &value, const quint32 &id);
|
||||||
public slots:
|
public slots:
|
||||||
virtual void ChoosedObject(quint32 id, const Valentina::Scenes &type);
|
virtual void ChoosedObject(quint32 id, const SceneObject &type);
|
||||||
virtual void DialogAccepted();
|
virtual void DialogAccepted();
|
||||||
/**
|
/**
|
||||||
* @brief DialogApply apply data and emit signal about applied dialog.
|
* @brief DialogApply apply data and emit signal about applied dialog.
|
||||||
|
|
|
@ -29,6 +29,9 @@
|
||||||
#include "dialogcutarc.h"
|
#include "dialogcutarc.h"
|
||||||
#include "ui_dialogcutarc.h"
|
#include "ui_dialogcutarc.h"
|
||||||
|
|
||||||
|
#include "../../geometry/varc.h"
|
||||||
|
#include "../../container/vcontainer.h"
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief DialogCutArc create dialog.
|
* @brief DialogCutArc create dialog.
|
||||||
|
@ -103,9 +106,9 @@ DialogCutArc::~DialogCutArc()
|
||||||
* @param id id of point or detail
|
* @param id id of point or detail
|
||||||
* @param type type of object
|
* @param type type of object
|
||||||
*/
|
*/
|
||||||
void DialogCutArc::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
void DialogCutArc::ChoosedObject(quint32 id, const SceneObject &type)
|
||||||
{
|
{
|
||||||
if (type == Valentina::Arc)
|
if (type == SceneObject::Arc)
|
||||||
{
|
{
|
||||||
const VArc *arc = data->GeometricObject<const VArc *>(id);
|
const VArc *arc = data->GeometricObject<const VArc *>(id);
|
||||||
ChangeCurrentText(ui->comboBoxArc, arc->name());
|
ChangeCurrentText(ui->comboBoxArc, arc->name());
|
||||||
|
@ -147,7 +150,7 @@ void DialogCutArc::SaveData()
|
||||||
*/
|
*/
|
||||||
void DialogCutArc::setArcId(const quint32 &value, const quint32 &id)
|
void DialogCutArc::setArcId(const quint32 &value, const quint32 &id)
|
||||||
{
|
{
|
||||||
setCurrentArcId(ui->comboBoxArc, arcId, value, id, ComboMode::CutArc);
|
setCurrentArcId(ui->comboBoxArc, arcId, value, id, ComboBoxCutArc::CutArc);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
|
@ -57,7 +57,7 @@ public:
|
||||||
quint32 getArcId() const;
|
quint32 getArcId() const;
|
||||||
void setArcId(const quint32 &value, const quint32 &id);
|
void setArcId(const quint32 &value, const quint32 &id);
|
||||||
public slots:
|
public slots:
|
||||||
virtual void ChoosedObject(quint32 id, const Valentina::Scenes &type);
|
virtual void ChoosedObject(quint32 id, const SceneObject &type);
|
||||||
virtual void DialogAccepted();
|
virtual void DialogAccepted();
|
||||||
/**
|
/**
|
||||||
* @brief DialogApply apply data and emit signal about applied dialog.
|
* @brief DialogApply apply data and emit signal about applied dialog.
|
||||||
|
|
|
@ -29,6 +29,9 @@
|
||||||
#include "dialogcutspline.h"
|
#include "dialogcutspline.h"
|
||||||
#include "ui_dialogcutspline.h"
|
#include "ui_dialogcutspline.h"
|
||||||
|
|
||||||
|
#include "../../geometry/vspline.h"
|
||||||
|
#include "../../container/vcontainer.h"
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief DialogCutSpline create dialog.
|
* @brief DialogCutSpline create dialog.
|
||||||
|
@ -95,7 +98,7 @@ void DialogCutSpline::setFormula(const QString &value)
|
||||||
*/
|
*/
|
||||||
void DialogCutSpline::setSplineId(const quint32 &value, const quint32 &id)
|
void DialogCutSpline::setSplineId(const quint32 &value, const quint32 &id)
|
||||||
{
|
{
|
||||||
setCurrentSplineId(ui->comboBoxSpline, splineId, value, id, ComboMode::CutSpline);
|
setCurrentSplineId(ui->comboBoxSpline, splineId, value, id, ComboBoxCutSpline::CutSpline);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
@ -104,9 +107,9 @@ void DialogCutSpline::setSplineId(const quint32 &value, const quint32 &id)
|
||||||
* @param id id of point or detail
|
* @param id id of point or detail
|
||||||
* @param type type of object
|
* @param type type of object
|
||||||
*/
|
*/
|
||||||
void DialogCutSpline::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
void DialogCutSpline::ChoosedObject(quint32 id, const SceneObject &type)
|
||||||
{
|
{
|
||||||
if (type == Valentina::Spline)
|
if (type == SceneObject::Spline)
|
||||||
{
|
{
|
||||||
const VSpline *spl = data->GeometricObject<const VSpline *>(id);
|
const VSpline *spl = data->GeometricObject<const VSpline *>(id);
|
||||||
ChangeCurrentText(ui->comboBoxSpline, spl->name());
|
ChangeCurrentText(ui->comboBoxSpline, spl->name());
|
||||||
|
|
|
@ -55,7 +55,7 @@ public:
|
||||||
quint32 getSplineId() const;
|
quint32 getSplineId() const;
|
||||||
void setSplineId(const quint32 &value, const quint32 &id);
|
void setSplineId(const quint32 &value, const quint32 &id);
|
||||||
public slots:
|
public slots:
|
||||||
virtual void ChoosedObject(quint32 id, const Valentina::Scenes &type);
|
virtual void ChoosedObject(quint32 id, const SceneObject &type);
|
||||||
virtual void DialogAccepted();
|
virtual void DialogAccepted();
|
||||||
/** TODO ISSUE 79 : create real function
|
/** TODO ISSUE 79 : create real function
|
||||||
* @brief DialogApply apply data and emit signal about applied dialog.
|
* @brief DialogApply apply data and emit signal about applied dialog.
|
||||||
|
|
|
@ -29,6 +29,9 @@
|
||||||
#include "dialogcutsplinepath.h"
|
#include "dialogcutsplinepath.h"
|
||||||
#include "ui_dialogcutsplinepath.h"
|
#include "ui_dialogcutsplinepath.h"
|
||||||
|
|
||||||
|
#include "../../geometry/vsplinepath.h"
|
||||||
|
#include "../../container/vcontainer.h"
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief DialogCutSplinePath create dialog.
|
* @brief DialogCutSplinePath create dialog.
|
||||||
|
@ -96,7 +99,7 @@ void DialogCutSplinePath::setFormula(const QString &value)
|
||||||
*/
|
*/
|
||||||
void DialogCutSplinePath::setSplinePathId(const quint32 &value, const quint32 &id)
|
void DialogCutSplinePath::setSplinePathId(const quint32 &value, const quint32 &id)
|
||||||
{
|
{
|
||||||
setCurrentSplinePathId(ui->comboBoxSplinePath, splinePathId, value, id, ComboMode::CutSpline);
|
setCurrentSplinePathId(ui->comboBoxSplinePath, splinePathId, value, id, ComboBoxCutSpline::CutSpline);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
@ -105,9 +108,9 @@ void DialogCutSplinePath::setSplinePathId(const quint32 &value, const quint32 &i
|
||||||
* @param id id of point or detail
|
* @param id id of point or detail
|
||||||
* @param type type of object
|
* @param type type of object
|
||||||
*/
|
*/
|
||||||
void DialogCutSplinePath::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
void DialogCutSplinePath::ChoosedObject(quint32 id, const SceneObject &type)
|
||||||
{
|
{
|
||||||
if (type == Valentina::SplinePath)
|
if (type == SceneObject::SplinePath)
|
||||||
{
|
{
|
||||||
const VSplinePath *splPath = data->GeometricObject<const VSplinePath *>(id);
|
const VSplinePath *splPath = data->GeometricObject<const VSplinePath *>(id);
|
||||||
ChangeCurrentText(ui->comboBoxSplinePath, splPath->name());
|
ChangeCurrentText(ui->comboBoxSplinePath, splPath->name());
|
||||||
|
|
|
@ -55,7 +55,7 @@ public:
|
||||||
quint32 getSplinePathId() const;
|
quint32 getSplinePathId() const;
|
||||||
void setSplinePathId(const quint32 &value, const quint32 &id);
|
void setSplinePathId(const quint32 &value, const quint32 &id);
|
||||||
public slots:
|
public slots:
|
||||||
virtual void ChoosedObject(quint32 id, const Valentina::Scenes &type);
|
virtual void ChoosedObject(quint32 id, const SceneObject &type);
|
||||||
virtual void DialogAccepted();
|
virtual void DialogAccepted();
|
||||||
/** TODO ISSUE 79 : create real function
|
/** TODO ISSUE 79 : create real function
|
||||||
* @brief DialogApply apply data and emit signal about applied dialog.
|
* @brief DialogApply apply data and emit signal about applied dialog.
|
||||||
|
|
|
@ -28,9 +28,14 @@
|
||||||
|
|
||||||
#include "dialogdetail.h"
|
#include "dialogdetail.h"
|
||||||
|
|
||||||
#include <QPushButton>
|
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
|
|
||||||
|
#include "../../geometry/varc.h"
|
||||||
|
#include "../../geometry/vpointf.h"
|
||||||
|
#include "../../geometry/vsplinepath.h"
|
||||||
|
#include "../../container/vcontainer.h"
|
||||||
|
#include "../../xml/vdomdocument.h"
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief DialogDetail create dialog
|
* @brief DialogDetail create dialog
|
||||||
|
@ -42,6 +47,9 @@ DialogDetail::DialogDetail(const VContainer *data, QWidget *parent)
|
||||||
{
|
{
|
||||||
ui.setupUi(this);
|
ui.setupUi(this);
|
||||||
labelEditNamePoint = ui.labelEditNameDetail;
|
labelEditNamePoint = ui.labelEditNameDetail;
|
||||||
|
ui.labelUnit->setText( VDomDocument::UnitsToStr(qApp->patternUnit(), true));
|
||||||
|
ui.labelUnitX->setText(VDomDocument::UnitsToStr(qApp->patternUnit(), true));
|
||||||
|
ui.labelUnitY->setText(VDomDocument::UnitsToStr(qApp->patternUnit(), true));
|
||||||
|
|
||||||
bOk = ui.buttonBox->button(QDialogButtonBox::Ok);
|
bOk = ui.buttonBox->button(QDialogButtonBox::Ok);
|
||||||
SCASSERT(bOk != nullptr);
|
SCASSERT(bOk != nullptr);
|
||||||
|
@ -57,9 +65,9 @@ DialogDetail::DialogDetail(const VContainer *data, QWidget *parent)
|
||||||
CheckState();
|
CheckState();
|
||||||
|
|
||||||
connect(ui.listWidget, &QListWidget::currentRowChanged, this, &DialogDetail::ObjectChanged);
|
connect(ui.listWidget, &QListWidget::currentRowChanged, this, &DialogDetail::ObjectChanged);
|
||||||
connect(ui.spinBoxBiasX, static_cast<void (QSpinBox::*)(qint32)>(&QSpinBox::valueChanged),
|
connect(ui.doubleSpinBoxBiasX, static_cast<void (QDoubleSpinBox::*)(qreal)>(&QDoubleSpinBox::valueChanged),
|
||||||
this, &DialogDetail::BiasXChanged);
|
this, &DialogDetail::BiasXChanged);
|
||||||
connect(ui.spinBoxBiasY, static_cast<void (QSpinBox::*)(qint32)>(&QSpinBox::valueChanged),
|
connect(ui.doubleSpinBoxBiasY, static_cast<void (QDoubleSpinBox::*)(qreal)>(&QDoubleSpinBox::valueChanged),
|
||||||
this, &DialogDetail::BiasYChanged);
|
this, &DialogDetail::BiasYChanged);
|
||||||
connect(ui.checkBoxSeams, &QCheckBox::clicked, this, &DialogDetail::ClickedSeams);
|
connect(ui.checkBoxSeams, &QCheckBox::clicked, this, &DialogDetail::ClickedSeams);
|
||||||
connect(ui.checkBoxClosed, &QCheckBox::clicked, this, &DialogDetail::ClickedClosed);
|
connect(ui.checkBoxClosed, &QCheckBox::clicked, this, &DialogDetail::ClickedClosed);
|
||||||
|
@ -74,24 +82,26 @@ DialogDetail::DialogDetail(const VContainer *data, QWidget *parent)
|
||||||
* @param id id of objects (points, arcs, splines, spline paths)
|
* @param id id of objects (points, arcs, splines, spline paths)
|
||||||
* @param type type of object
|
* @param type type of object
|
||||||
*/
|
*/
|
||||||
void DialogDetail::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
void DialogDetail::ChoosedObject(quint32 id, const SceneObject &type)
|
||||||
{
|
{
|
||||||
if (type != Valentina::Line && type != Valentina::Detail)
|
if (type != SceneObject::Line && type != SceneObject::Detail)
|
||||||
{
|
{
|
||||||
switch (type)
|
switch (type)
|
||||||
{
|
{
|
||||||
case (Valentina::Arc):
|
case (SceneObject::Arc):
|
||||||
NewItem(id, Valentina::NodeArc, NodeDetail::Contour);
|
NewItem(id, Tool::NodeArc, NodeDetail::Contour);
|
||||||
break;
|
break;
|
||||||
case (Valentina::Point):
|
case (SceneObject::Point):
|
||||||
NewItem(id, Valentina::NodePoint, NodeDetail::Contour);
|
NewItem(id, Tool::NodePoint, NodeDetail::Contour);
|
||||||
break;
|
break;
|
||||||
case (Valentina::Spline):
|
case (SceneObject::Spline):
|
||||||
NewItem(id, Valentina::NodeSpline, NodeDetail::Contour);
|
NewItem(id, Tool::NodeSpline, NodeDetail::Contour);
|
||||||
break;
|
break;
|
||||||
case (Valentina::SplinePath):
|
case (SceneObject::SplinePath):
|
||||||
NewItem(id, Valentina::NodeSplinePath, NodeDetail::Contour);
|
NewItem(id, Tool::NodeSplinePath, NodeDetail::Contour);
|
||||||
break;
|
break;
|
||||||
|
case (SceneObject::Line):
|
||||||
|
case (SceneObject::Detail):
|
||||||
default:
|
default:
|
||||||
qDebug()<<tr("Got wrong scene object. Ignore.");
|
qDebug()<<tr("Got wrong scene object. Ignore.");
|
||||||
break;
|
break;
|
||||||
|
@ -113,7 +123,7 @@ void DialogDetail::DialogAccepted()
|
||||||
QListWidgetItem *item = ui.listWidget->item(i);
|
QListWidgetItem *item = ui.listWidget->item(i);
|
||||||
details.append( qvariant_cast<VNodeDetail>(item->data(Qt::UserRole)));
|
details.append( qvariant_cast<VNodeDetail>(item->data(Qt::UserRole)));
|
||||||
}
|
}
|
||||||
details.setWidth(ui.spinBoxSeams->value());
|
details.setWidth(ui.doubleSpinBoxSeams->value());
|
||||||
details.setName(ui.lineEditNameDetail->text());
|
details.setName(ui.lineEditNameDetail->text());
|
||||||
details.setSeamAllowance(supplement);
|
details.setSeamAllowance(supplement);
|
||||||
details.setClosed(closed);
|
details.setClosed(closed);
|
||||||
|
@ -130,36 +140,57 @@ void DialogDetail::DialogAccepted()
|
||||||
* @param mx offset respect to x
|
* @param mx offset respect to x
|
||||||
* @param my offset respect to y
|
* @param my offset respect to y
|
||||||
*/
|
*/
|
||||||
void DialogDetail::NewItem(quint32 id, const Valentina::Tools &typeTool, const NodeDetail::NodeDetails &typeNode,
|
void DialogDetail::NewItem(quint32 id, const Tool &typeTool, const NodeDetail &typeNode,
|
||||||
qreal mx, qreal my)
|
qreal mx, qreal my)
|
||||||
{
|
{
|
||||||
QString name;
|
QString name;
|
||||||
switch (typeTool)
|
switch (typeTool)
|
||||||
{
|
{
|
||||||
case (Valentina::NodePoint):
|
case (Tool::NodePoint):
|
||||||
{
|
{
|
||||||
const VPointF *point = data->GeometricObject<const VPointF *>(id);
|
const VPointF *point = data->GeometricObject<const VPointF *>(id);
|
||||||
name = point->name();
|
name = point->name();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case (Valentina::NodeArc):
|
case (Tool::NodeArc):
|
||||||
{
|
{
|
||||||
const VArc *arc = data->GeometricObject<const VArc *>(id);
|
const VArc *arc = data->GeometricObject<const VArc *>(id);
|
||||||
name = arc->name();
|
name = arc->name();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case (Valentina::NodeSpline):
|
case (Tool::NodeSpline):
|
||||||
{
|
{
|
||||||
const VSpline *spl = data->GeometricObject<const VSpline *>(id);
|
const VSpline *spl = data->GeometricObject<const VSpline *>(id);
|
||||||
name = spl->name();
|
name = spl->name();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case (Valentina::NodeSplinePath):
|
case (Tool::NodeSplinePath):
|
||||||
{
|
{
|
||||||
const VSplinePath *splPath = data->GeometricObject<const VSplinePath *>(id);
|
const VSplinePath *splPath = data->GeometricObject<const VSplinePath *>(id);
|
||||||
name = splPath->name();
|
name = splPath->name();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case (Tool::ArrowTool):
|
||||||
|
case (Tool::SinglePointTool):
|
||||||
|
case (Tool::EndLineTool):
|
||||||
|
case (Tool::LineTool):
|
||||||
|
case (Tool::AlongLineTool):
|
||||||
|
case (Tool::ShoulderPointTool):
|
||||||
|
case (Tool::NormalTool):
|
||||||
|
case (Tool::BisectorTool):
|
||||||
|
case (Tool::LineIntersectTool):
|
||||||
|
case (Tool::SplineTool):
|
||||||
|
case (Tool::CutSplineTool):
|
||||||
|
case (Tool::CutArcTool):
|
||||||
|
case (Tool::ArcTool):
|
||||||
|
case (Tool::SplinePathTool):
|
||||||
|
case (Tool::CutSplinePathTool):
|
||||||
|
case (Tool::PointOfContact):
|
||||||
|
case (Tool::DetailTool):
|
||||||
|
case (Tool::Height):
|
||||||
|
case (Tool::Triangle):
|
||||||
|
case (Tool::PointOfIntersection):
|
||||||
|
case (Tool::UnionDetails):
|
||||||
default:
|
default:
|
||||||
qDebug()<<"Got wrong tools. Ignore.";
|
qDebug()<<"Got wrong tools. Ignore.";
|
||||||
break;
|
break;
|
||||||
|
@ -171,15 +202,15 @@ void DialogDetail::NewItem(quint32 id, const Valentina::Tools &typeTool, const N
|
||||||
item->setData(Qt::UserRole, QVariant::fromValue(node));
|
item->setData(Qt::UserRole, QVariant::fromValue(node));
|
||||||
ui.listWidget->addItem(item);
|
ui.listWidget->addItem(item);
|
||||||
ui.listWidget->setCurrentRow(ui.listWidget->count()-1);
|
ui.listWidget->setCurrentRow(ui.listWidget->count()-1);
|
||||||
disconnect(ui.spinBoxBiasX, static_cast<void (QSpinBox::*)(qint32)>(&QSpinBox::valueChanged),
|
disconnect(ui.doubleSpinBoxBiasX, static_cast<void (QDoubleSpinBox::*)(qreal)>(&QDoubleSpinBox::valueChanged),
|
||||||
this, &DialogDetail::BiasXChanged);
|
this, &DialogDetail::BiasXChanged);
|
||||||
disconnect(ui.spinBoxBiasY, static_cast<void (QSpinBox::*)(qint32)>(&QSpinBox::valueChanged),
|
disconnect(ui.doubleSpinBoxBiasY, static_cast<void (QDoubleSpinBox::*)(qreal)>(&QDoubleSpinBox::valueChanged),
|
||||||
this, &DialogDetail::BiasYChanged);
|
this, &DialogDetail::BiasYChanged);
|
||||||
ui.spinBoxBiasX->setValue(static_cast<qint32>(qApp->fromPixel(node.getMx())));
|
ui.doubleSpinBoxBiasX->setValue(qApp->fromPixel(node.getMx()));
|
||||||
ui.spinBoxBiasY->setValue(static_cast<qint32>(qApp->fromPixel(node.getMy())));
|
ui.doubleSpinBoxBiasY->setValue(qApp->fromPixel(node.getMy()));
|
||||||
connect(ui.spinBoxBiasX, static_cast<void (QSpinBox::*)(qint32)>(&QSpinBox::valueChanged),
|
connect(ui.doubleSpinBoxBiasX, static_cast<void (QDoubleSpinBox::*)(qreal)>(&QDoubleSpinBox::valueChanged),
|
||||||
this, &DialogDetail::BiasXChanged);
|
this, &DialogDetail::BiasXChanged);
|
||||||
connect(ui.spinBoxBiasY, static_cast<void (QSpinBox::*)(qint32)>(&QSpinBox::valueChanged),
|
connect(ui.doubleSpinBoxBiasY, static_cast<void (QDoubleSpinBox::*)(qreal)>(&QDoubleSpinBox::valueChanged),
|
||||||
this, &DialogDetail::BiasYChanged);
|
this, &DialogDetail::BiasYChanged);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -194,15 +225,15 @@ void DialogDetail::setDetails(const VDetail &value)
|
||||||
ui.listWidget->clear();
|
ui.listWidget->clear();
|
||||||
for (ptrdiff_t i = 0; i < details.CountNode(); ++i)
|
for (ptrdiff_t i = 0; i < details.CountNode(); ++i)
|
||||||
{
|
{
|
||||||
NewItem(details[i].getId(), details[i].getTypeTool(), details[i].getTypeNode(), details[i].getMx(),
|
NewItem(details.at(i).getId(), details.at(i).getTypeTool(), details.at(i).getTypeNode(), details.at(i).getMx(),
|
||||||
details[i].getMy());
|
details.at(i).getMy());
|
||||||
}
|
}
|
||||||
ui.lineEditNameDetail->setText(details.getName());
|
ui.lineEditNameDetail->setText(details.getName());
|
||||||
ui.checkBoxSeams->setChecked(details.getSeamAllowance());
|
ui.checkBoxSeams->setChecked(details.getSeamAllowance());
|
||||||
ui.checkBoxClosed->setChecked(details.getClosed());
|
ui.checkBoxClosed->setChecked(details.getClosed());
|
||||||
ClickedClosed(details.getClosed());
|
ClickedClosed(details.getClosed());
|
||||||
ClickedSeams(details.getSeamAllowance());
|
ClickedSeams(details.getSeamAllowance());
|
||||||
ui.spinBoxSeams->setValue(static_cast<qint32>(details.getWidth()));
|
ui.doubleSpinBoxSeams->setValue(details.getWidth());
|
||||||
ui.listWidget->setCurrentRow(0);
|
ui.listWidget->setCurrentRow(0);
|
||||||
ui.listWidget->setFocus(Qt::OtherFocusReason);
|
ui.listWidget->setFocus(Qt::OtherFocusReason);
|
||||||
ui.toolButtonDelete->setEnabled(true);
|
ui.toolButtonDelete->setEnabled(true);
|
||||||
|
@ -247,7 +278,7 @@ void DialogDetail::ClickedSeams(bool checked)
|
||||||
{
|
{
|
||||||
supplement = checked;
|
supplement = checked;
|
||||||
ui.checkBoxClosed->setEnabled(checked);
|
ui.checkBoxClosed->setEnabled(checked);
|
||||||
ui.spinBoxSeams->setEnabled(checked);
|
ui.doubleSpinBoxSeams->setEnabled(checked);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
@ -273,8 +304,8 @@ void DialogDetail::ObjectChanged(int row)
|
||||||
}
|
}
|
||||||
QListWidgetItem *item = ui.listWidget->item( row );
|
QListWidgetItem *item = ui.listWidget->item( row );
|
||||||
VNodeDetail node = qvariant_cast<VNodeDetail>(item->data(Qt::UserRole));
|
VNodeDetail node = qvariant_cast<VNodeDetail>(item->data(Qt::UserRole));
|
||||||
ui.spinBoxBiasX->setValue(static_cast<qint32>(qApp->fromPixel(node.getMx())));
|
ui.doubleSpinBoxBiasX->setValue(qApp->fromPixel(node.getMx()));
|
||||||
ui.spinBoxBiasY->setValue(static_cast<qint32>(qApp->fromPixel(node.getMy())));
|
ui.doubleSpinBoxBiasY->setValue(qApp->fromPixel(node.getMy()));
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
|
@ -31,6 +31,7 @@
|
||||||
|
|
||||||
#include "ui_dialogdetail.h"
|
#include "ui_dialogdetail.h"
|
||||||
#include "dialogtool.h"
|
#include "dialogtool.h"
|
||||||
|
#include "../../geometry/vdetail.h"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief The DialogDetail class dialog for ToolDetai. Help create detail and edit option.
|
* @brief The DialogDetail class dialog for ToolDetai. Help create detail and edit option.
|
||||||
|
@ -44,7 +45,7 @@ public:
|
||||||
VDetail getDetails() const;
|
VDetail getDetails() const;
|
||||||
void setDetails(const VDetail &value);
|
void setDetails(const VDetail &value);
|
||||||
public slots:
|
public slots:
|
||||||
virtual void ChoosedObject(quint32 id, const Valentina::Scenes &type);
|
virtual void ChoosedObject(quint32 id, const SceneObject &type);
|
||||||
virtual void DialogAccepted();
|
virtual void DialogAccepted();
|
||||||
/** TODO ISSUE 79 : create real function
|
/** TODO ISSUE 79 : create real function
|
||||||
* @brief DialogApply apply data and emit signal about applied dialog.
|
* @brief DialogApply apply data and emit signal about applied dialog.
|
||||||
|
@ -70,7 +71,7 @@ private:
|
||||||
/** @brief closed keep option about equdistant (closed or not) */
|
/** @brief closed keep option about equdistant (closed or not) */
|
||||||
bool closed;
|
bool closed;
|
||||||
|
|
||||||
void NewItem(quint32 id, const Valentina::Tools &typeTool, const NodeDetail::NodeDetails &typeNode,
|
void NewItem(quint32 id, const Tool &typeTool, const NodeDetail &typeNode,
|
||||||
qreal mx = 0, qreal my = 0);
|
qreal mx = 0, qreal my = 0);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -41,18 +41,37 @@
|
||||||
</property>
|
</property>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="label">
|
<widget class="QLabel" name="label">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||||
|
<horstretch>1</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Bias X</string>
|
<string>Bias X</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QSpinBox" name="spinBoxBiasX">
|
<widget class="QDoubleSpinBox" name="doubleSpinBoxBiasX">
|
||||||
<property name="minimum">
|
<property name="sizePolicy">
|
||||||
<number>-3000</number>
|
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
||||||
|
<horstretch>1</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
</property>
|
</property>
|
||||||
<property name="maximum">
|
<property name="maximum">
|
||||||
<number>3000</number>
|
<double>900.990000000000009</double>
|
||||||
|
</property>
|
||||||
|
<property name="singleStep">
|
||||||
|
<double>0.100000000000000</double>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="labelUnitX">
|
||||||
|
<property name="text">
|
||||||
|
<string>cm</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
@ -64,7 +83,7 @@
|
||||||
<widget class="QLabel" name="label_2">
|
<widget class="QLabel" name="label_2">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||||
<horstretch>0</horstretch>
|
<horstretch>1</horstretch>
|
||||||
<verstretch>0</verstretch>
|
<verstretch>0</verstretch>
|
||||||
</sizepolicy>
|
</sizepolicy>
|
||||||
</property>
|
</property>
|
||||||
|
@ -74,12 +93,25 @@
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QSpinBox" name="spinBoxBiasY">
|
<widget class="QDoubleSpinBox" name="doubleSpinBoxBiasY">
|
||||||
<property name="minimum">
|
<property name="sizePolicy">
|
||||||
<number>-3000</number>
|
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
||||||
|
<horstretch>1</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
</property>
|
</property>
|
||||||
<property name="maximum">
|
<property name="maximum">
|
||||||
<number>3000</number>
|
<double>900.990000000000009</double>
|
||||||
|
</property>
|
||||||
|
<property name="singleStep">
|
||||||
|
<double>0.100000000000000</double>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="labelUnitY">
|
||||||
|
<property name="text">
|
||||||
|
<string>cm</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
@ -177,7 +209,7 @@
|
||||||
<widget class="QLabel" name="labelEditWidth">
|
<widget class="QLabel" name="labelEditWidth">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||||
<horstretch>0</horstretch>
|
<horstretch>1</horstretch>
|
||||||
<verstretch>0</verstretch>
|
<verstretch>0</verstretch>
|
||||||
</sizepolicy>
|
</sizepolicy>
|
||||||
</property>
|
</property>
|
||||||
|
@ -190,9 +222,31 @@
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QSpinBox" name="spinBoxSeams">
|
<widget class="QDoubleSpinBox" name="doubleSpinBoxSeams">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
||||||
|
<horstretch>1</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
<property name="maximum">
|
<property name="maximum">
|
||||||
<number>3000</number>
|
<double>900.990000000000009</double>
|
||||||
|
</property>
|
||||||
|
<property name="singleStep">
|
||||||
|
<double>0.100000000000000</double>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="labelUnit">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>cm</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
|
|
@ -29,8 +29,6 @@
|
||||||
#include "dialogeditwrongformula.h"
|
#include "dialogeditwrongformula.h"
|
||||||
#include "ui_dialogeditwrongformula.h"
|
#include "ui_dialogeditwrongformula.h"
|
||||||
|
|
||||||
#include <container/calculator.h>
|
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
DialogEditWrongFormula::DialogEditWrongFormula(const VContainer *data, QWidget *parent)
|
DialogEditWrongFormula::DialogEditWrongFormula(const VContainer *data, QWidget *parent)
|
||||||
:DialogTool(data, parent), ui(new Ui::DialogEditWrongFormula), formula(QString())
|
:DialogTool(data, parent), ui(new Ui::DialogEditWrongFormula), formula(QString())
|
||||||
|
|
|
@ -29,7 +29,8 @@
|
||||||
#include "dialogendline.h"
|
#include "dialogendline.h"
|
||||||
#include "ui_dialogendline.h"
|
#include "ui_dialogendline.h"
|
||||||
|
|
||||||
#include <QPushButton>
|
#include "../../geometry/vpointf.h"
|
||||||
|
#include "../../container/vcontainer.h"
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
|
@ -103,9 +104,9 @@ void DialogEndLine::DeployFormulaTextEdit()
|
||||||
* @param id id of point or detail
|
* @param id id of point or detail
|
||||||
* @param type type of object
|
* @param type type of object
|
||||||
*/
|
*/
|
||||||
void DialogEndLine::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
void DialogEndLine::ChoosedObject(quint32 id, const SceneObject &type)
|
||||||
{
|
{
|
||||||
if (type == Valentina::Point)
|
if (type == SceneObject::Point)
|
||||||
{
|
{
|
||||||
const VPointF *point = data->GeometricObject<const VPointF *>(id);
|
const VPointF *point = data->GeometricObject<const VPointF *>(id);
|
||||||
ChangeCurrentText(ui->comboBoxBasePoint, point->name());
|
ChangeCurrentText(ui->comboBoxBasePoint, point->name());
|
||||||
|
|
|
@ -63,7 +63,7 @@ public:
|
||||||
quint32 getBasePointId() const;
|
quint32 getBasePointId() const;
|
||||||
void setBasePointId(const quint32 &value, const quint32 &id);
|
void setBasePointId(const quint32 &value, const quint32 &id);
|
||||||
public slots:
|
public slots:
|
||||||
virtual void ChoosedObject(quint32 id, const Valentina::Scenes &type);
|
virtual void ChoosedObject(quint32 id, const SceneObject &type);
|
||||||
virtual void DialogAccepted();
|
virtual void DialogAccepted();
|
||||||
/**
|
/**
|
||||||
* @brief DialogApply apply data and emit signal about applied dialog.
|
* @brief DialogApply apply data and emit signal about applied dialog.
|
||||||
|
|
|
@ -29,7 +29,8 @@
|
||||||
#include "dialogheight.h"
|
#include "dialogheight.h"
|
||||||
#include "ui_dialogheight.h"
|
#include "ui_dialogheight.h"
|
||||||
|
|
||||||
#include <QPushButton>
|
#include "../../geometry/vpointf.h"
|
||||||
|
#include "../../container/vcontainer.h"
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
|
@ -124,9 +125,9 @@ void DialogHeight::setP2LineId(const quint32 &value, const quint32 &id)
|
||||||
* @param id id of point or detail
|
* @param id id of point or detail
|
||||||
* @param type type of object
|
* @param type type of object
|
||||||
*/
|
*/
|
||||||
void DialogHeight::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
void DialogHeight::ChoosedObject(quint32 id, const SceneObject &type)
|
||||||
{
|
{
|
||||||
if (type == Valentina::Point)
|
if (type == SceneObject::Point)
|
||||||
{
|
{
|
||||||
const VPointF *point = data->GeometricObject<const VPointF *>(id);
|
const VPointF *point = data->GeometricObject<const VPointF *>(id);
|
||||||
switch (number)
|
switch (number)
|
||||||
|
|
|
@ -61,7 +61,7 @@ public:
|
||||||
quint32 getP2LineId() const;
|
quint32 getP2LineId() const;
|
||||||
void setP2LineId(const quint32 &value, const quint32 &id);
|
void setP2LineId(const quint32 &value, const quint32 &id);
|
||||||
public slots:
|
public slots:
|
||||||
virtual void ChoosedObject(quint32 id, const Valentina::Scenes &type);
|
virtual void ChoosedObject(quint32 id, const SceneObject &type);
|
||||||
virtual void DialogAccepted();
|
virtual void DialogAccepted();
|
||||||
/** TODO ISSUE 79 : create real function
|
/** TODO ISSUE 79 : create real function
|
||||||
* @brief DialogApply apply data and emit signal about applied dialog.
|
* @brief DialogApply apply data and emit signal about applied dialog.
|
||||||
|
|
|
@ -29,7 +29,8 @@
|
||||||
#include "dialogline.h"
|
#include "dialogline.h"
|
||||||
#include "ui_dialogline.h"
|
#include "ui_dialogline.h"
|
||||||
|
|
||||||
#include <QPushButton>
|
#include "../../geometry/vpointf.h"
|
||||||
|
#include "../../container/vcontainer.h"
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
|
@ -119,9 +120,9 @@ void DialogLine::DialogAccepted()
|
||||||
* @param id id of point or detail
|
* @param id id of point or detail
|
||||||
* @param type type of object
|
* @param type type of object
|
||||||
*/
|
*/
|
||||||
void DialogLine::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
void DialogLine::ChoosedObject(quint32 id, const SceneObject &type)
|
||||||
{
|
{
|
||||||
if (type == Valentina::Point)
|
if (type == SceneObject::Point)
|
||||||
{
|
{
|
||||||
const VPointF *point = data->GeometricObject<const VPointF *>(id);
|
const VPointF *point = data->GeometricObject<const VPointF *>(id);
|
||||||
if (number == 0)
|
if (number == 0)
|
||||||
|
|
|
@ -55,7 +55,7 @@ public:
|
||||||
QString getTypeLine() const;
|
QString getTypeLine() const;
|
||||||
void setTypeLine(const QString &value);
|
void setTypeLine(const QString &value);
|
||||||
public slots:
|
public slots:
|
||||||
virtual void ChoosedObject(quint32 id, const Valentina::Scenes &type);
|
virtual void ChoosedObject(quint32 id, const SceneObject &type);
|
||||||
virtual void DialogAccepted();
|
virtual void DialogAccepted();
|
||||||
/** TODO ISSUE 79 : create real function
|
/** TODO ISSUE 79 : create real function
|
||||||
* @brief DialogApply apply data and emit signal about applied dialog.
|
* @brief DialogApply apply data and emit signal about applied dialog.
|
||||||
|
|
|
@ -29,7 +29,8 @@
|
||||||
#include "dialoglineintersect.h"
|
#include "dialoglineintersect.h"
|
||||||
#include "ui_dialoglineintersect.h"
|
#include "ui_dialoglineintersect.h"
|
||||||
|
|
||||||
#include <QPushButton>
|
#include "../../geometry/vpointf.h"
|
||||||
|
#include "../../container/vcontainer.h"
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
|
@ -67,9 +68,9 @@ DialogLineIntersect::~DialogLineIntersect()
|
||||||
* @param id id of point or detail
|
* @param id id of point or detail
|
||||||
* @param type type of object
|
* @param type type of object
|
||||||
*/
|
*/
|
||||||
void DialogLineIntersect::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
void DialogLineIntersect::ChoosedObject(quint32 id, const SceneObject &type)
|
||||||
{
|
{
|
||||||
if (type == Valentina::Point)
|
if (type == SceneObject::Point)
|
||||||
{
|
{
|
||||||
const VPointF *point = data->GeometricObject<const VPointF *>(id);
|
const VPointF *point = data->GeometricObject<const VPointF *>(id);
|
||||||
if (number == 0)
|
if (number == 0)
|
||||||
|
|
|
@ -61,7 +61,7 @@ public:
|
||||||
QString getPointName() const;
|
QString getPointName() const;
|
||||||
void setPointName(const QString &value);
|
void setPointName(const QString &value);
|
||||||
public slots:
|
public slots:
|
||||||
virtual void ChoosedObject(quint32 id, const Valentina::Scenes &type);
|
virtual void ChoosedObject(quint32 id, const SceneObject &type);
|
||||||
virtual void DialogAccepted();
|
virtual void DialogAccepted();
|
||||||
/** TODO ISSUE 79 : create real function
|
/** TODO ISSUE 79 : create real function
|
||||||
* @brief DialogApply apply data and emit signal about applied dialog.
|
* @brief DialogApply apply data and emit signal about applied dialog.
|
||||||
|
|
|
@ -29,8 +29,6 @@
|
||||||
#include "dialognormal.h"
|
#include "dialognormal.h"
|
||||||
#include "ui_dialognormal.h"
|
#include "ui_dialognormal.h"
|
||||||
|
|
||||||
#include <QPushButton>
|
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief DialogNormal create dialog
|
* @brief DialogNormal create dialog
|
||||||
|
@ -107,9 +105,9 @@ DialogNormal::~DialogNormal()
|
||||||
* @param id id of point or detail
|
* @param id id of point or detail
|
||||||
* @param type type of object
|
* @param type type of object
|
||||||
*/
|
*/
|
||||||
void DialogNormal::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
void DialogNormal::ChoosedObject(quint32 id, const SceneObject &type)
|
||||||
{
|
{
|
||||||
if (type == Valentina::Point)
|
if (type == SceneObject::Point)
|
||||||
{
|
{
|
||||||
if (number == 0)
|
if (number == 0)
|
||||||
{
|
{
|
||||||
|
|
|
@ -65,7 +65,7 @@ public:
|
||||||
quint32 getSecondPointId() const;
|
quint32 getSecondPointId() const;
|
||||||
void setSecondPointId(const quint32 &value, const quint32 &id);
|
void setSecondPointId(const quint32 &value, const quint32 &id);
|
||||||
public slots:
|
public slots:
|
||||||
virtual void ChoosedObject(quint32 id, const Valentina::Scenes &type);
|
virtual void ChoosedObject(quint32 id, const SceneObject &type);
|
||||||
virtual void DialogAccepted();
|
virtual void DialogAccepted();
|
||||||
/**
|
/**
|
||||||
* @brief DialogApply apply data and emit signal about applied dialog.
|
* @brief DialogApply apply data and emit signal about applied dialog.
|
||||||
|
|
|
@ -28,7 +28,8 @@
|
||||||
|
|
||||||
#include "dialogpointofcontact.h"
|
#include "dialogpointofcontact.h"
|
||||||
|
|
||||||
#include <QPushButton>
|
#include "../../geometry/vpointf.h"
|
||||||
|
#include "../../container/vcontainer.h"
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
|
@ -77,7 +78,7 @@ DialogPointOfContact::DialogPointOfContact(const VContainer *data, QWidget *pare
|
||||||
connect(ui->listWidget, &QListWidget::itemDoubleClicked, this, &DialogPointOfContact::PutVal);
|
connect(ui->listWidget, &QListWidget::itemDoubleClicked, this, &DialogPointOfContact::PutVal);
|
||||||
connect(ui->listWidget, &QListWidget::currentRowChanged, this, &DialogPointOfContact::ValChenged);
|
connect(ui->listWidget, &QListWidget::currentRowChanged, this, &DialogPointOfContact::ValChenged);
|
||||||
|
|
||||||
if (qApp->patternType() == Pattern::Standard)
|
if (qApp->patternType() == MeasurementsType::Standard)
|
||||||
{
|
{
|
||||||
SizeHeight();
|
SizeHeight();
|
||||||
connect(ui->radioButtonSizeGrowth, &QRadioButton::clicked, this, &DialogTool::SizeHeight);
|
connect(ui->radioButtonSizeGrowth, &QRadioButton::clicked, this, &DialogTool::SizeHeight);
|
||||||
|
@ -132,9 +133,9 @@ void DialogPointOfContact::DeployFormulaTextEdit()
|
||||||
* @param id id of point or detail
|
* @param id id of point or detail
|
||||||
* @param type type of object
|
* @param type type of object
|
||||||
*/
|
*/
|
||||||
void DialogPointOfContact::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
void DialogPointOfContact::ChoosedObject(quint32 id, const SceneObject &type)
|
||||||
{
|
{
|
||||||
if (type == Valentina::Point)
|
if (type == SceneObject::Point)
|
||||||
{
|
{
|
||||||
const VPointF *point = data->GeometricObject<const VPointF *>(id);
|
const VPointF *point = data->GeometricObject<const VPointF *>(id);
|
||||||
if (number == 0)
|
if (number == 0)
|
||||||
|
|
|
@ -61,7 +61,7 @@ public:
|
||||||
quint32 getSecondPoint() const;
|
quint32 getSecondPoint() const;
|
||||||
void setSecondPoint(const quint32 &value, const quint32 &id);
|
void setSecondPoint(const quint32 &value, const quint32 &id);
|
||||||
public slots:
|
public slots:
|
||||||
virtual void ChoosedObject(quint32 id, const Valentina::Scenes &type);
|
virtual void ChoosedObject(quint32 id, const SceneObject &type);
|
||||||
virtual void DialogAccepted();
|
virtual void DialogAccepted();
|
||||||
/**
|
/**
|
||||||
* @brief DialogApply apply data and emit signal about applied dialog.
|
* @brief DialogApply apply data and emit signal about applied dialog.
|
||||||
|
|
|
@ -29,7 +29,8 @@
|
||||||
#include "dialogpointofintersection.h"
|
#include "dialogpointofintersection.h"
|
||||||
#include "ui_dialogpointofintersection.h"
|
#include "ui_dialogpointofintersection.h"
|
||||||
|
|
||||||
#include <QPushButton>
|
#include "../../geometry/vpointf.h"
|
||||||
|
#include "../../container/vcontainer.h"
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
|
@ -77,9 +78,9 @@ void DialogPointOfIntersection::setSecondPointId(const quint32 &value, const qui
|
||||||
* @param id id of point or detail
|
* @param id id of point or detail
|
||||||
* @param type type of object
|
* @param type type of object
|
||||||
*/
|
*/
|
||||||
void DialogPointOfIntersection::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
void DialogPointOfIntersection::ChoosedObject(quint32 id, const SceneObject &type)
|
||||||
{
|
{
|
||||||
if (type == Valentina::Point)
|
if (type == SceneObject::Point)
|
||||||
{
|
{
|
||||||
const VPointF *point = data->GeometricObject<const VPointF *>(id);
|
const VPointF *point = data->GeometricObject<const VPointF *>(id);
|
||||||
if (number == 0)
|
if (number == 0)
|
||||||
|
|
|
@ -55,7 +55,7 @@ public:
|
||||||
quint32 getSecondPointId() const;
|
quint32 getSecondPointId() const;
|
||||||
void setSecondPointId(const quint32 &value, const quint32 &id);
|
void setSecondPointId(const quint32 &value, const quint32 &id);
|
||||||
public slots:
|
public slots:
|
||||||
virtual void ChoosedObject(quint32 id, const Valentina::Scenes &type);
|
virtual void ChoosedObject(quint32 id, const SceneObject &type);
|
||||||
virtual void DialogAccepted();
|
virtual void DialogAccepted();
|
||||||
/** TODO ISSUE 79 : create real function
|
/** TODO ISSUE 79 : create real function
|
||||||
* @brief DialogApply apply data and emit signal about applied dialog.
|
* @brief DialogApply apply data and emit signal about applied dialog.
|
||||||
|
|
|
@ -29,7 +29,8 @@
|
||||||
#include "dialogshoulderpoint.h"
|
#include "dialogshoulderpoint.h"
|
||||||
#include "ui_dialogshoulderpoint.h"
|
#include "ui_dialogshoulderpoint.h"
|
||||||
|
|
||||||
#include <QPushButton>
|
#include "../../geometry/vpointf.h"
|
||||||
|
#include "../../container/vcontainer.h"
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
|
@ -109,9 +110,9 @@ DialogShoulderPoint::~DialogShoulderPoint()
|
||||||
* @param id id of point or detail
|
* @param id id of point or detail
|
||||||
* @param type type of object
|
* @param type type of object
|
||||||
*/
|
*/
|
||||||
void DialogShoulderPoint::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
void DialogShoulderPoint::ChoosedObject(quint32 id, const SceneObject &type)
|
||||||
{
|
{
|
||||||
if (type == Valentina::Point)
|
if (type == SceneObject::Point)
|
||||||
{
|
{
|
||||||
const VPointF *point = data->GeometricObject<const VPointF *>(id);
|
const VPointF *point = data->GeometricObject<const VPointF *>(id);
|
||||||
if (number == 0)
|
if (number == 0)
|
||||||
|
|
|
@ -65,7 +65,7 @@ public:
|
||||||
quint32 getPShoulder() const;
|
quint32 getPShoulder() const;
|
||||||
void setPShoulder(const quint32 &value, const quint32 &id);
|
void setPShoulder(const quint32 &value, const quint32 &id);
|
||||||
public slots:
|
public slots:
|
||||||
virtual void ChoosedObject(quint32 id, const Valentina::Scenes &type);
|
virtual void ChoosedObject(quint32 id, const SceneObject &type);
|
||||||
virtual void DialogAccepted();
|
virtual void DialogAccepted();
|
||||||
/**
|
/**
|
||||||
* @brief DialogApply apply data and emit signal about applied dialog.
|
* @brief DialogApply apply data and emit signal about applied dialog.
|
||||||
|
|
|
@ -29,8 +29,6 @@
|
||||||
#include "dialogsinglepoint.h"
|
#include "dialogsinglepoint.h"
|
||||||
#include "ui_dialogsinglepoint.h"
|
#include "ui_dialogsinglepoint.h"
|
||||||
|
|
||||||
#include <QPushButton>
|
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief DialogSinglePoint create dialog
|
* @brief DialogSinglePoint create dialog
|
||||||
|
|
|
@ -29,7 +29,8 @@
|
||||||
#include "dialogspline.h"
|
#include "dialogspline.h"
|
||||||
#include "ui_dialogspline.h"
|
#include "ui_dialogspline.h"
|
||||||
|
|
||||||
#include <QPushButton>
|
#include "../../geometry/vpointf.h"
|
||||||
|
#include "../../container/vcontainer.h"
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
|
@ -70,9 +71,9 @@ quint32 DialogSpline::getP1() const
|
||||||
* @param id id of point or detail
|
* @param id id of point or detail
|
||||||
* @param type type of object
|
* @param type type of object
|
||||||
*/
|
*/
|
||||||
void DialogSpline::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
void DialogSpline::ChoosedObject(quint32 id, const SceneObject &type)
|
||||||
{
|
{
|
||||||
if (type == Valentina::Point)
|
if (type == SceneObject::Point)
|
||||||
{
|
{
|
||||||
const VPointF *point = data->GeometricObject<const VPointF *>(id);
|
const VPointF *point = data->GeometricObject<const VPointF *>(id);
|
||||||
if (number == 0)
|
if (number == 0)
|
||||||
|
|
|
@ -67,7 +67,7 @@ public:
|
||||||
qreal getKCurve() const;
|
qreal getKCurve() const;
|
||||||
void setKCurve(const qreal &value);
|
void setKCurve(const qreal &value);
|
||||||
public slots:
|
public slots:
|
||||||
virtual void ChoosedObject(quint32 id, const Valentina::Scenes &type);
|
virtual void ChoosedObject(quint32 id, const SceneObject &type);
|
||||||
virtual void DialogAccepted();
|
virtual void DialogAccepted();
|
||||||
/** TODO ISSUE 79 : create real function
|
/** TODO ISSUE 79 : create real function
|
||||||
* @brief DialogApply apply data and emit signal about applied dialog.
|
* @brief DialogApply apply data and emit signal about applied dialog.
|
||||||
|
|
|
@ -29,8 +29,7 @@
|
||||||
#include "dialogsplinepath.h"
|
#include "dialogsplinepath.h"
|
||||||
#include "ui_dialogsplinepath.h"
|
#include "ui_dialogsplinepath.h"
|
||||||
#include "../../geometry/vsplinepoint.h"
|
#include "../../geometry/vsplinepoint.h"
|
||||||
|
#include "../../container/vcontainer.h"
|
||||||
#include <QPushButton>
|
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
|
@ -77,7 +76,7 @@ void DialogSplinePath::SetPath(const VSplinePath &value)
|
||||||
ui->listWidget->clear();
|
ui->listWidget->clear();
|
||||||
for (qint32 i = 0; i < path.CountPoint(); ++i)
|
for (qint32 i = 0; i < path.CountPoint(); ++i)
|
||||||
{
|
{
|
||||||
NewItem(path[i].P().id(), path[i].KAsm1(), path[i].Angle1(), path[i].KAsm2(), path[i].Angle2());
|
NewItem(path.at(i).P().id(), path.at(i).KAsm1(), path.at(i).Angle1(), path.at(i).KAsm2(), path.at(i).Angle2());
|
||||||
}
|
}
|
||||||
ui->listWidget->setFocus(Qt::OtherFocusReason);
|
ui->listWidget->setFocus(Qt::OtherFocusReason);
|
||||||
ui->doubleSpinBoxKcurve->setValue(path.getKCurve());
|
ui->doubleSpinBoxKcurve->setValue(path.getKCurve());
|
||||||
|
@ -89,9 +88,9 @@ void DialogSplinePath::SetPath(const VSplinePath &value)
|
||||||
* @param id id of point or detail
|
* @param id id of point or detail
|
||||||
* @param type don't show this id in list
|
* @param type don't show this id in list
|
||||||
*/
|
*/
|
||||||
void DialogSplinePath::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
void DialogSplinePath::ChoosedObject(quint32 id, const SceneObject &type)
|
||||||
{
|
{
|
||||||
if (type == Valentina::Point)
|
if (type == SceneObject::Point)
|
||||||
{
|
{
|
||||||
NewItem(id, 1, 0, 1, 180);
|
NewItem(id, 1, 0, 1, 180);
|
||||||
emit ToolTip(tr("Select point of curve path"));
|
emit ToolTip(tr("Select point of curve path"));
|
||||||
|
|
|
@ -50,7 +50,7 @@ public:
|
||||||
VSplinePath GetPath() const;
|
VSplinePath GetPath() const;
|
||||||
void SetPath(const VSplinePath &value);
|
void SetPath(const VSplinePath &value);
|
||||||
public slots:
|
public slots:
|
||||||
virtual void ChoosedObject(quint32 id, const Valentina::Scenes &type);
|
virtual void ChoosedObject(quint32 id, const SceneObject &type);
|
||||||
virtual void DialogAccepted();
|
virtual void DialogAccepted();
|
||||||
/** TODO ISSUE 79 : create real function
|
/** TODO ISSUE 79 : create real function
|
||||||
* @brief DialogApply apply data and emit signal about applied dialog.
|
* @brief DialogApply apply data and emit signal about applied dialog.
|
||||||
|
|
|
@ -28,11 +28,14 @@
|
||||||
|
|
||||||
#include "dialogtool.h"
|
#include "dialogtool.h"
|
||||||
#include "../../container/calculator.h"
|
#include "../../container/calculator.h"
|
||||||
#include "../../geometry/vgobject.h"
|
#include "../../container/vcontainer.h"
|
||||||
|
#include "../../geometry/varc.h"
|
||||||
|
#include "../../geometry/vpointf.h"
|
||||||
|
#include "../../geometry/vsplinepath.h"
|
||||||
#include "../../tools/vabstracttool.h"
|
#include "../../tools/vabstracttool.h"
|
||||||
|
|
||||||
#include <QtWidgets>
|
|
||||||
#include "../../../libs/qmuparser/qmuparsererror.h"
|
#include "../../../libs/qmuparser/qmuparsererror.h"
|
||||||
|
#include "../../widgets/vapplication.h"
|
||||||
|
#include "../../xml/vdomdocument.h"
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
|
@ -106,7 +109,7 @@ void DialogTool::FillComboBoxPoints(QComboBox *box, const quint32 &id) const
|
||||||
if (i.key() != id)
|
if (i.key() != id)
|
||||||
{
|
{
|
||||||
VGObject *obj = i.value();
|
VGObject *obj = i.value();
|
||||||
if (obj->getType() == GObject::Point && obj->getMode() == Valentina::Calculation)
|
if (obj->getType() == GOType::Point && obj->getMode() == Draw::Calculation)
|
||||||
{
|
{
|
||||||
const VPointF *point = data->GeometricObject<const VPointF *>(i.key());
|
const VPointF *point = data->GeometricObject<const VPointF *>(i.key());
|
||||||
list[point->name()] = i.key();
|
list[point->name()] = i.key();
|
||||||
|
@ -117,7 +120,7 @@ void DialogTool::FillComboBoxPoints(QComboBox *box, const quint32 &id) const
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void DialogTool::FillComboBoxArcs(QComboBox *box, const quint32 &id, ComboMode::ComboBoxCutArc cut) const
|
void DialogTool::FillComboBoxArcs(QComboBox *box, const quint32 &id, ComboBoxCutArc cut) const
|
||||||
{
|
{
|
||||||
SCASSERT(box != nullptr);
|
SCASSERT(box != nullptr);
|
||||||
const QHash<quint32, VGObject *> *objs = data->DataGObjects();
|
const QHash<quint32, VGObject *> *objs = data->DataGObjects();
|
||||||
|
@ -126,12 +129,12 @@ void DialogTool::FillComboBoxArcs(QComboBox *box, const quint32 &id, ComboMode::
|
||||||
while (i.hasNext())
|
while (i.hasNext())
|
||||||
{
|
{
|
||||||
i.next();
|
i.next();
|
||||||
if (cut == ComboMode::CutArc)
|
if (cut == ComboBoxCutArc::CutArc)
|
||||||
{
|
{
|
||||||
if (i.key() != id + 1 && i.key() != id + 2)
|
if (i.key() != id + 1 && i.key() != id + 2)
|
||||||
{
|
{
|
||||||
VGObject *obj = i.value();
|
VGObject *obj = i.value();
|
||||||
if (obj->getType() == GObject::Arc && obj->getMode() == Valentina::Calculation)
|
if (obj->getType() == GOType::Arc && obj->getMode() == Draw::Calculation)
|
||||||
{
|
{
|
||||||
const VArc *arc = data->GeometricObject<const VArc *>(i.key());
|
const VArc *arc = data->GeometricObject<const VArc *>(i.key());
|
||||||
list[arc->name()] = i.key();
|
list[arc->name()] = i.key();
|
||||||
|
@ -143,7 +146,7 @@ void DialogTool::FillComboBoxArcs(QComboBox *box, const quint32 &id, ComboMode::
|
||||||
if (i.key() != id)
|
if (i.key() != id)
|
||||||
{
|
{
|
||||||
VGObject *obj = i.value();
|
VGObject *obj = i.value();
|
||||||
if (obj->getType() == GObject::Arc && obj->getMode() == Valentina::Calculation)
|
if (obj->getType() == GOType::Arc && obj->getMode() == Draw::Calculation)
|
||||||
{
|
{
|
||||||
const VArc *arc = data->GeometricObject<const VArc *>(i.key());
|
const VArc *arc = data->GeometricObject<const VArc *>(i.key());
|
||||||
list[arc->name()] = i.key();
|
list[arc->name()] = i.key();
|
||||||
|
@ -161,7 +164,7 @@ void DialogTool::FillComboBoxArcs(QComboBox *box, const quint32 &id, ComboMode::
|
||||||
* @param id don't show id in list
|
* @param id don't show id in list
|
||||||
* @param cut if set to ComboMode::CutSpline don't show id+1 and id+2
|
* @param cut if set to ComboMode::CutSpline don't show id+1 and id+2
|
||||||
*/
|
*/
|
||||||
void DialogTool::FillComboBoxSplines(QComboBox *box, const quint32 &id, ComboMode::ComboBoxCutSpline cut) const
|
void DialogTool::FillComboBoxSplines(QComboBox *box, const quint32 &id, ComboBoxCutSpline cut) const
|
||||||
{
|
{
|
||||||
SCASSERT(box != nullptr);
|
SCASSERT(box != nullptr);
|
||||||
const QHash<quint32, VGObject *> *objs = data->DataGObjects();
|
const QHash<quint32, VGObject *> *objs = data->DataGObjects();
|
||||||
|
@ -170,12 +173,12 @@ void DialogTool::FillComboBoxSplines(QComboBox *box, const quint32 &id, ComboMod
|
||||||
while (i.hasNext())
|
while (i.hasNext())
|
||||||
{
|
{
|
||||||
i.next();
|
i.next();
|
||||||
if (cut == ComboMode::CutSpline)
|
if (cut == ComboBoxCutSpline::CutSpline)
|
||||||
{
|
{
|
||||||
if (i.key() != id + 1 && i.key() != id + 2)
|
if (i.key() != id + 1 && i.key() != id + 2)
|
||||||
{
|
{
|
||||||
VGObject *obj = i.value();
|
VGObject *obj = i.value();
|
||||||
if (obj->getType() == GObject::Spline && obj->getMode() == Valentina::Calculation)
|
if (obj->getType() == GOType::Spline && obj->getMode() == Draw::Calculation)
|
||||||
{
|
{
|
||||||
const VSpline *spl = data->GeometricObject<const VSpline *>(i.key());
|
const VSpline *spl = data->GeometricObject<const VSpline *>(i.key());
|
||||||
list[spl->name()] = i.key();
|
list[spl->name()] = i.key();
|
||||||
|
@ -187,7 +190,7 @@ void DialogTool::FillComboBoxSplines(QComboBox *box, const quint32 &id, ComboMod
|
||||||
if (i.key() != id)
|
if (i.key() != id)
|
||||||
{
|
{
|
||||||
VGObject *obj = i.value();
|
VGObject *obj = i.value();
|
||||||
if (obj->getType() == GObject::Spline && obj->getMode() == Valentina::Calculation)
|
if (obj->getType() == GOType::Spline && obj->getMode() == Draw::Calculation)
|
||||||
{
|
{
|
||||||
const VSpline *spl = data->GeometricObject<const VSpline *>(i.key());
|
const VSpline *spl = data->GeometricObject<const VSpline *>(i.key());
|
||||||
list[spl->name()] = i.key();
|
list[spl->name()] = i.key();
|
||||||
|
@ -205,7 +208,7 @@ void DialogTool::FillComboBoxSplines(QComboBox *box, const quint32 &id, ComboMod
|
||||||
* @param id don't show id in list
|
* @param id don't show id in list
|
||||||
* @param cut if set to ComboMode::CutSpline don't show id+1 and id+2
|
* @param cut if set to ComboMode::CutSpline don't show id+1 and id+2
|
||||||
*/
|
*/
|
||||||
void DialogTool::FillComboBoxSplinesPath(QComboBox *box, const quint32 &id, ComboMode::ComboBoxCutSpline cut) const
|
void DialogTool::FillComboBoxSplinesPath(QComboBox *box, const quint32 &id, ComboBoxCutSpline cut) const
|
||||||
{
|
{
|
||||||
SCASSERT(box != nullptr);
|
SCASSERT(box != nullptr);
|
||||||
const QHash<quint32, VGObject *> *objs = data->DataGObjects();
|
const QHash<quint32, VGObject *> *objs = data->DataGObjects();
|
||||||
|
@ -214,12 +217,12 @@ void DialogTool::FillComboBoxSplinesPath(QComboBox *box, const quint32 &id, Comb
|
||||||
while (i.hasNext())
|
while (i.hasNext())
|
||||||
{
|
{
|
||||||
i.next();
|
i.next();
|
||||||
if (cut == ComboMode::CutSpline)
|
if (cut == ComboBoxCutSpline::CutSpline)
|
||||||
{
|
{
|
||||||
if (i.key() != id + 1 && i.key() != id + 2)
|
if (i.key() != id + 1 && i.key() != id + 2)
|
||||||
{
|
{
|
||||||
VGObject *obj = i.value();
|
VGObject *obj = i.value();
|
||||||
if (obj->getType() == GObject::SplinePath && obj->getMode() == Valentina::Calculation)
|
if (obj->getType() == GOType::SplinePath && obj->getMode() == Draw::Calculation)
|
||||||
{
|
{
|
||||||
const VSplinePath *splPath = data->GeometricObject<const VSplinePath *>(i.key());
|
const VSplinePath *splPath = data->GeometricObject<const VSplinePath *>(i.key());
|
||||||
list[splPath->name()] = i.key();
|
list[splPath->name()] = i.key();
|
||||||
|
@ -231,7 +234,7 @@ void DialogTool::FillComboBoxSplinesPath(QComboBox *box, const quint32 &id, Comb
|
||||||
if (i.key() != id)
|
if (i.key() != id)
|
||||||
{
|
{
|
||||||
VGObject *obj = i.value();
|
VGObject *obj = i.value();
|
||||||
if (obj->getType() == GObject::SplinePath && obj->getMode() == Valentina::Calculation)
|
if (obj->getType() == GOType::SplinePath && obj->getMode() == Draw::Calculation)
|
||||||
{
|
{
|
||||||
const VSplinePath *splPath = data->GeometricObject<const VSplinePath *>(i.key());
|
const VSplinePath *splPath = data->GeometricObject<const VSplinePath *>(i.key());
|
||||||
list[splPath->name()] = i.key();
|
list[splPath->name()] = i.key();
|
||||||
|
@ -453,12 +456,12 @@ void DialogTool::Eval(QLineEdit *edit, bool &flag, QTimer *timer, QLabel *label)
|
||||||
if (osSeparatorValue)
|
if (osSeparatorValue)
|
||||||
{
|
{
|
||||||
QLocale loc = QLocale::system();
|
QLocale loc = QLocale::system();
|
||||||
label->setText(loc.toString(result));
|
label->setText(loc.toString(result) + VDomDocument::UnitsToStr(qApp->patternUnit(), true));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
QLocale loc = QLocale(QLocale::C);
|
QLocale loc = QLocale(QLocale::C);
|
||||||
label->setText(loc.toString(result));
|
label->setText(loc.toString(result) + VDomDocument::UnitsToStr(qApp->patternUnit(), true));
|
||||||
}
|
}
|
||||||
flag = true;
|
flag = true;
|
||||||
palette.setColor(labelEditFormula->foregroundRole(), QColor(76, 76, 76));
|
palette.setColor(labelEditFormula->foregroundRole(), QColor(76, 76, 76));
|
||||||
|
@ -514,12 +517,12 @@ void DialogTool::Eval(QPlainTextEdit *edit, bool &flag, QTimer *timer, QLabel *l
|
||||||
if (osSeparatorValue)
|
if (osSeparatorValue)
|
||||||
{
|
{
|
||||||
QLocale loc = QLocale::system();
|
QLocale loc = QLocale::system();
|
||||||
label->setText(loc.toString(result));
|
label->setText(loc.toString(result) + VDomDocument::UnitsToStr(qApp->patternUnit(), true));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
QLocale loc = QLocale(QLocale::C);
|
QLocale loc = QLocale(QLocale::C);
|
||||||
label->setText(loc.toString(result));
|
label->setText(loc.toString(result) + VDomDocument::UnitsToStr(qApp->patternUnit(), true));
|
||||||
}
|
}
|
||||||
flag = true;
|
flag = true;
|
||||||
palette.setColor(labelEditFormula->foregroundRole(), QColor(76, 76, 76));
|
palette.setColor(labelEditFormula->foregroundRole(), QColor(76, 76, 76));
|
||||||
|
@ -562,7 +565,7 @@ void DialogTool::setCurrentPointId(QComboBox *box, quint32 &pointId, const quint
|
||||||
* @param cut if set to ComboMode::CutSpline don't show id+1 and id+2
|
* @param cut if set to ComboMode::CutSpline don't show id+1 and id+2
|
||||||
*/
|
*/
|
||||||
void DialogTool::setCurrentSplineId(QComboBox *box, quint32 &splineId, const quint32 &value, const quint32 &id,
|
void DialogTool::setCurrentSplineId(QComboBox *box, quint32 &splineId, const quint32 &value, const quint32 &id,
|
||||||
ComboMode::ComboBoxCutSpline cut) const
|
ComboBoxCutSpline cut) const
|
||||||
{
|
{
|
||||||
SCASSERT(box != nullptr);
|
SCASSERT(box != nullptr);
|
||||||
FillComboBoxSplines(box, id, cut);
|
FillComboBoxSplines(box, id, cut);
|
||||||
|
@ -580,7 +583,7 @@ void DialogTool::setCurrentSplineId(QComboBox *box, quint32 &splineId, const qui
|
||||||
* @param cut if set to ComboMode::CutArc don't show id+1 and id+2
|
* @param cut if set to ComboMode::CutArc don't show id+1 and id+2
|
||||||
*/
|
*/
|
||||||
void DialogTool::setCurrentArcId(QComboBox *box, quint32 &arcId, const quint32 &value, const quint32 &id,
|
void DialogTool::setCurrentArcId(QComboBox *box, quint32 &arcId, const quint32 &value, const quint32 &id,
|
||||||
ComboMode::ComboBoxCutArc cut) const
|
ComboBoxCutArc cut) const
|
||||||
{
|
{
|
||||||
SCASSERT(box != nullptr);
|
SCASSERT(box != nullptr);
|
||||||
FillComboBoxArcs(box, id, cut);
|
FillComboBoxArcs(box, id, cut);
|
||||||
|
@ -598,7 +601,7 @@ void DialogTool::setCurrentArcId(QComboBox *box, quint32 &arcId, const quint32 &
|
||||||
* @param cut if set to ComboMode::CutSpline don't show id+1 and id+2
|
* @param cut if set to ComboMode::CutSpline don't show id+1 and id+2
|
||||||
*/
|
*/
|
||||||
void DialogTool::setCurrentSplinePathId(QComboBox *box, quint32 &splinePathId, const quint32 &value,
|
void DialogTool::setCurrentSplinePathId(QComboBox *box, quint32 &splinePathId, const quint32 &value,
|
||||||
const quint32 &id, ComboMode::ComboBoxCutSpline cut) const
|
const quint32 &id, ComboBoxCutSpline cut) const
|
||||||
{
|
{
|
||||||
SCASSERT(box != nullptr);
|
SCASSERT(box != nullptr);
|
||||||
FillComboBoxSplinesPath(box, id, cut);
|
FillComboBoxSplinesPath(box, id, cut);
|
||||||
|
@ -683,7 +686,7 @@ void DialogTool::CheckState()
|
||||||
* @param id id of point or detail
|
* @param id id of point or detail
|
||||||
* @param type type of object
|
* @param type type of object
|
||||||
*/
|
*/
|
||||||
void DialogTool::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
void DialogTool::ChoosedObject(quint32 id, const SceneObject &type)
|
||||||
{
|
{
|
||||||
Q_UNUSED(id);
|
Q_UNUSED(id);
|
||||||
Q_UNUSED(type);
|
Q_UNUSED(type);
|
||||||
|
|
|
@ -29,32 +29,23 @@
|
||||||
#ifndef DIALOGTOOL_H
|
#ifndef DIALOGTOOL_H
|
||||||
#define DIALOGTOOL_H
|
#define DIALOGTOOL_H
|
||||||
|
|
||||||
#include <QComboBox>
|
|
||||||
#include <QDialog>
|
#include <QDialog>
|
||||||
#include <QDoubleSpinBox>
|
|
||||||
#include <QLabel>
|
|
||||||
#include <QListWidgetItem>
|
|
||||||
#include <QRadioButton>
|
|
||||||
#include <QDialogButtonBox>
|
#include <QDialogButtonBox>
|
||||||
#include <QPushButton>
|
|
||||||
#include <QPlainTextEdit>
|
|
||||||
#include "../../container/vcontainer.h"
|
|
||||||
#include "../../widgets/vapplication.h"
|
#include "../../widgets/vapplication.h"
|
||||||
#include "../../tools/vabstracttool.h"
|
|
||||||
|
|
||||||
namespace ComboMode
|
class QDoubleSpinBox;
|
||||||
{
|
class QLabel;
|
||||||
/**
|
class QRadioButton;
|
||||||
* @brief The ComboBoxCutSpline enum
|
class QComboBox;
|
||||||
*/
|
class QListWidgetItem;
|
||||||
enum ComboBoxCutSpline { CutSpline, NoCutSpline };
|
class QLineEdit;
|
||||||
Q_DECLARE_FLAGS(ComboBoxCutSplines, ComboBoxCutSpline)
|
class QListWidget;
|
||||||
|
class VContainer;
|
||||||
|
class QPlainTextEdit;
|
||||||
|
class VAbstractTool;
|
||||||
|
|
||||||
enum ComboBoxCutArc { CutArc, NoCutArc};
|
enum class ComboBoxCutSpline : char { CutSpline, NoCutSpline };
|
||||||
Q_DECLARE_FLAGS(ComboBoxCutArcs, ComboBoxCutArc)
|
enum class ComboBoxCutArc : char { CutArc, NoCutArc};
|
||||||
}
|
|
||||||
Q_DECLARE_OPERATORS_FOR_FLAGS( ComboMode::ComboBoxCutSplines )
|
|
||||||
Q_DECLARE_OPERATORS_FOR_FLAGS( ComboMode::ComboBoxCutArcs )
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief The DialogTool class parent for all dialog of tools.
|
* @brief The DialogTool class parent for all dialog of tools.
|
||||||
|
@ -65,14 +56,8 @@ class DialogTool : public QDialog
|
||||||
public:
|
public:
|
||||||
DialogTool(const VContainer *data, QWidget *parent = nullptr);
|
DialogTool(const VContainer *data, QWidget *parent = nullptr);
|
||||||
virtual ~DialogTool() {}
|
virtual ~DialogTool() {}
|
||||||
inline VAbstractTool* GetAssociatedTool()
|
VAbstractTool* GetAssociatedTool();
|
||||||
{
|
void SetAssociatedTool(VAbstractTool* tool);
|
||||||
return this->associatedTool;
|
|
||||||
}
|
|
||||||
inline void SetAssociatedTool(VAbstractTool* tool)
|
|
||||||
{
|
|
||||||
this->associatedTool=tool;
|
|
||||||
}
|
|
||||||
signals:
|
signals:
|
||||||
/**
|
/**
|
||||||
* @brief DialogClosed signal dialog closed
|
* @brief DialogClosed signal dialog closed
|
||||||
|
@ -89,7 +74,7 @@ signals:
|
||||||
*/
|
*/
|
||||||
void ToolTip(const QString &toolTip);
|
void ToolTip(const QString &toolTip);
|
||||||
public slots:
|
public slots:
|
||||||
virtual void ChoosedObject(quint32 id, const Valentina::Scenes &type);
|
virtual void ChoosedObject(quint32 id, const SceneObject &type);
|
||||||
void NamePointChanged();
|
void NamePointChanged();
|
||||||
virtual void DialogAccepted();
|
virtual void DialogAccepted();
|
||||||
/**
|
/**
|
||||||
|
@ -191,11 +176,11 @@ protected:
|
||||||
virtual void showEvent( QShowEvent *event );
|
virtual void showEvent( QShowEvent *event );
|
||||||
void FillComboBoxPoints(QComboBox *box, const quint32 &id = 0)const;
|
void FillComboBoxPoints(QComboBox *box, const quint32 &id = 0)const;
|
||||||
void FillComboBoxArcs(QComboBox *box, const quint32 &id = 0,
|
void FillComboBoxArcs(QComboBox *box, const quint32 &id = 0,
|
||||||
ComboMode::ComboBoxCutArc cut = ComboMode::NoCutArc)const;
|
ComboBoxCutArc cut = ComboBoxCutArc::NoCutArc)const;
|
||||||
void FillComboBoxSplines(QComboBox *box, const quint32 &id = 0,
|
void FillComboBoxSplines(QComboBox *box, const quint32 &id = 0,
|
||||||
ComboMode::ComboBoxCutSpline cut = ComboMode::NoCutSpline)const;
|
ComboBoxCutSpline cut = ComboBoxCutSpline::NoCutSpline)const;
|
||||||
void FillComboBoxSplinesPath(QComboBox *box, const quint32 &id = 0,
|
void FillComboBoxSplinesPath(QComboBox *box, const quint32 &id = 0,
|
||||||
ComboMode::ComboBoxCutSpline cut = ComboMode::NoCutSpline)const;
|
ComboBoxCutSpline cut = ComboBoxCutSpline::NoCutSpline)const;
|
||||||
void FillComboBoxTypeLine(QComboBox *box) const;
|
void FillComboBoxTypeLine(QComboBox *box) const;
|
||||||
virtual void CheckState();
|
virtual void CheckState();
|
||||||
QString GetTypeLine(const QComboBox *box)const;
|
QString GetTypeLine(const QComboBox *box)const;
|
||||||
|
@ -212,12 +197,12 @@ protected:
|
||||||
void Eval(QLineEdit *edit, bool &flag, QTimer *timer, QLabel *label);
|
void Eval(QLineEdit *edit, bool &flag, QTimer *timer, QLabel *label);
|
||||||
void setCurrentPointId(QComboBox *box, quint32 &pointId, const quint32 &value, const quint32 &id) const;
|
void setCurrentPointId(QComboBox *box, quint32 &pointId, const quint32 &value, const quint32 &id) const;
|
||||||
void setCurrentSplineId(QComboBox *box, quint32 &splineId, const quint32 &value, const quint32 &id,
|
void setCurrentSplineId(QComboBox *box, quint32 &splineId, const quint32 &value, const quint32 &id,
|
||||||
ComboMode::ComboBoxCutSpline cut = ComboMode::NoCutSpline) const;
|
ComboBoxCutSpline cut = ComboBoxCutSpline::NoCutSpline) const;
|
||||||
void setCurrentArcId(QComboBox *box, quint32 &arcId, const quint32 &value, const quint32 &id,
|
void setCurrentArcId(QComboBox *box, quint32 &arcId, const quint32 &value, const quint32 &id,
|
||||||
ComboMode::ComboBoxCutArc cut = ComboMode::NoCutArc) const;
|
ComboBoxCutArc cut = ComboBoxCutArc::NoCutArc) const;
|
||||||
void setCurrentSplinePathId(QComboBox *box, quint32 &splinePathId, const quint32 &value,
|
void setCurrentSplinePathId(QComboBox *box, quint32 &splinePathId, const quint32 &value,
|
||||||
const quint32 &id,
|
const quint32 &id,
|
||||||
ComboMode::ComboBoxCutSpline cut = ComboMode::NoCutSpline) const;
|
ComboBoxCutSpline cut = ComboBoxCutSpline::NoCutSpline) const;
|
||||||
quint32 getCurrentObjectId(QComboBox *box) const;
|
quint32 getCurrentObjectId(QComboBox *box) const;
|
||||||
bool ChoosedPoint(const quint32 &id, QComboBox *box, const QString &toolTip);
|
bool ChoosedPoint(const quint32 &id, QComboBox *box, const QString &toolTip);
|
||||||
template <typename T>
|
template <typename T>
|
||||||
|
@ -248,7 +233,7 @@ protected:
|
||||||
|
|
||||||
connect(listWidget, &QListWidget::currentRowChanged, this, &DialogTool::ValChenged);
|
connect(listWidget, &QListWidget::currentRowChanged, this, &DialogTool::ValChenged);
|
||||||
|
|
||||||
if (qApp->patternType() == Pattern::Standard)
|
if (qApp->patternType() == MeasurementsType::Standard)
|
||||||
{
|
{
|
||||||
SizeHeight();
|
SizeHeight();
|
||||||
connect(radioButtonSizeGrowth, &QRadioButton::clicked, this, &DialogTool::SizeHeight);
|
connect(radioButtonSizeGrowth, &QRadioButton::clicked, this, &DialogTool::SizeHeight);
|
||||||
|
@ -300,4 +285,16 @@ private:
|
||||||
void FillList(QComboBox *box, const QMap<QString, quint32> &list)const;
|
void FillList(QComboBox *box, const QMap<QString, quint32> &list)const;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
inline VAbstractTool *DialogTool::GetAssociatedTool()
|
||||||
|
{
|
||||||
|
return this->associatedTool;
|
||||||
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
inline void DialogTool::SetAssociatedTool(VAbstractTool *tool)
|
||||||
|
{
|
||||||
|
this->associatedTool=tool;
|
||||||
|
}
|
||||||
|
|
||||||
#endif // DIALOGTOOL_H
|
#endif // DIALOGTOOL_H
|
||||||
|
|
|
@ -28,8 +28,8 @@
|
||||||
|
|
||||||
#include "dialogtriangle.h"
|
#include "dialogtriangle.h"
|
||||||
#include "ui_dialogtriangle.h"
|
#include "ui_dialogtriangle.h"
|
||||||
|
#include "../../geometry/vpointf.h"
|
||||||
#include <QPushButton>
|
#include "../../container/vcontainer.h"
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
|
@ -67,9 +67,9 @@ DialogTriangle::~DialogTriangle()
|
||||||
* @param id id of point or detail
|
* @param id id of point or detail
|
||||||
* @param type type of object
|
* @param type type of object
|
||||||
*/
|
*/
|
||||||
void DialogTriangle::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
void DialogTriangle::ChoosedObject(quint32 id, const SceneObject &type)
|
||||||
{
|
{
|
||||||
if (type == Valentina::Point)
|
if (type == SceneObject::Point)
|
||||||
{
|
{
|
||||||
const VPointF *point = data->GeometricObject<const VPointF *>(id);
|
const VPointF *point = data->GeometricObject<const VPointF *>(id);
|
||||||
switch (number)
|
switch (number)
|
||||||
|
|
|
@ -61,7 +61,7 @@ public:
|
||||||
QString getPointName() const;
|
QString getPointName() const;
|
||||||
void setPointName(const QString &value);
|
void setPointName(const QString &value);
|
||||||
public slots:
|
public slots:
|
||||||
virtual void ChoosedObject(quint32 id, const Valentina::Scenes &type);
|
virtual void ChoosedObject(quint32 id, const SceneObject &type);
|
||||||
virtual void DialogAccepted();
|
virtual void DialogAccepted();
|
||||||
/** TODO ISSUE 79 : create real function
|
/** TODO ISSUE 79 : create real function
|
||||||
* @brief DialogApply apply data and emit signal about applied dialog.
|
* @brief DialogApply apply data and emit signal about applied dialog.
|
||||||
|
|
|
@ -28,6 +28,8 @@
|
||||||
|
|
||||||
#include "dialoguniondetails.h"
|
#include "dialoguniondetails.h"
|
||||||
#include "ui_dialoguniondetails.h"
|
#include "ui_dialoguniondetails.h"
|
||||||
|
#include "../../geometry/vdetail.h"
|
||||||
|
#include "../../container/vcontainer.h"
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
|
@ -55,7 +57,7 @@ DialogUnionDetails::~DialogUnionDetails()
|
||||||
* @param id id of point or detail
|
* @param id id of point or detail
|
||||||
* @param type type of object
|
* @param type type of object
|
||||||
*/
|
*/
|
||||||
void DialogUnionDetails::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
void DialogUnionDetails::ChoosedObject(quint32 id, const SceneObject &type)
|
||||||
{
|
{
|
||||||
if (numberD == 0)
|
if (numberD == 0)
|
||||||
{
|
{
|
||||||
|
@ -101,12 +103,12 @@ bool DialogUnionDetails::CheckObject(const quint32 &id, const quint32 &idDetail)
|
||||||
* @param idDetail id detail
|
* @param idDetail id detail
|
||||||
* @param index index of edge
|
* @param index index of edge
|
||||||
*/
|
*/
|
||||||
void DialogUnionDetails::ChoosedDetail(const quint32 &id, const Valentina::Scenes &type, quint32 &idDetail,
|
void DialogUnionDetails::ChoosedDetail(const quint32 &id, const SceneObject &type, quint32 &idDetail,
|
||||||
ptrdiff_t &index)
|
ptrdiff_t &index)
|
||||||
{
|
{
|
||||||
if (idDetail == 0)
|
if (idDetail == 0)
|
||||||
{
|
{
|
||||||
if (type == Valentina::Detail)
|
if (type == SceneObject::Detail)
|
||||||
{
|
{
|
||||||
idDetail = id;
|
idDetail = id;
|
||||||
emit ToolTip(tr("Select first point"));
|
emit ToolTip(tr("Select first point"));
|
||||||
|
@ -117,7 +119,7 @@ void DialogUnionDetails::ChoosedDetail(const quint32 &id, const Valentina::Scene
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (type == Valentina::Point)
|
if (type == SceneObject::Point)
|
||||||
{
|
{
|
||||||
if (numberP == 0)
|
if (numberP == 0)
|
||||||
{
|
{
|
||||||
|
|
|
@ -51,7 +51,7 @@ public:
|
||||||
ptrdiff_t getIndexD1() const;
|
ptrdiff_t getIndexD1() const;
|
||||||
ptrdiff_t getIndexD2() const;
|
ptrdiff_t getIndexD2() const;
|
||||||
public slots:
|
public slots:
|
||||||
void ChoosedObject(quint32 id, const Valentina::Scenes &type);
|
void ChoosedObject(quint32 id, const SceneObject &type);
|
||||||
virtual void DialogAccepted();
|
virtual void DialogAccepted();
|
||||||
/** TODO ISSUE 79 : create real function
|
/** TODO ISSUE 79 : create real function
|
||||||
* @brief DialogApply apply data and emit signal about applied dialog.
|
* @brief DialogApply apply data and emit signal about applied dialog.
|
||||||
|
@ -88,7 +88,7 @@ private:
|
||||||
quint32 p2;
|
quint32 p2;
|
||||||
|
|
||||||
bool CheckObject(const quint32 &id, const quint32 &idDetail) const;
|
bool CheckObject(const quint32 &id, const quint32 &idDetail) const;
|
||||||
void ChoosedDetail(const quint32 &id, const Valentina::Scenes &type, quint32 &idDetail,
|
void ChoosedDetail(const quint32 &id, const SceneObject &type, quint32 &idDetail,
|
||||||
ptrdiff_t &index);
|
ptrdiff_t &index);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -6,42 +6,32 @@
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>473</width>
|
<width>244</width>
|
||||||
<height>78</height>
|
<height>78</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
<string>Union details</string>
|
<string>Union details</string>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QDialogButtonBox" name="buttonBox">
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
<property name="geometry">
|
<item>
|
||||||
<rect>
|
<widget class="QLabel" name="label">
|
||||||
<x>120</x>
|
<property name="text">
|
||||||
<y>40</y>
|
<string><html><head/><body><p>Do you really want union details?</p></body></html></string>
|
||||||
<width>341</width>
|
</property>
|
||||||
<height>32</height>
|
</widget>
|
||||||
</rect>
|
</item>
|
||||||
</property>
|
<item>
|
||||||
<property name="orientation">
|
<widget class="QDialogButtonBox" name="buttonBox">
|
||||||
<enum>Qt::Horizontal</enum>
|
<property name="orientation">
|
||||||
</property>
|
<enum>Qt::Horizontal</enum>
|
||||||
<property name="standardButtons">
|
</property>
|
||||||
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
|
<property name="standardButtons">
|
||||||
</property>
|
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
|
||||||
</widget>
|
</property>
|
||||||
<widget class="QLabel" name="label">
|
</widget>
|
||||||
<property name="geometry">
|
</item>
|
||||||
<rect>
|
</layout>
|
||||||
<x>10</x>
|
|
||||||
<y>20</y>
|
|
||||||
<width>451</width>
|
|
||||||
<height>17</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Do you really want union details? This operation can't be undone.</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</widget>
|
</widget>
|
||||||
<resources/>
|
<resources/>
|
||||||
<connections>
|
<connections>
|
||||||
|
|
|
@ -28,10 +28,10 @@
|
||||||
|
|
||||||
#include "vexception.h"
|
#include "vexception.h"
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
#include <QSpacerItem>
|
|
||||||
#include <QGridLayout>
|
|
||||||
#include "../options.h"
|
#include "../options.h"
|
||||||
#include <QApplication>
|
|
||||||
|
class QSpacerItem;
|
||||||
|
class QGridLayout;
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -32,8 +32,8 @@
|
||||||
|
|
||||||
#include <QException>
|
#include <QException>
|
||||||
#include <QString>
|
#include <QString>
|
||||||
#include <QWidget>
|
|
||||||
#include <QCoreApplication>
|
class QWidget;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief The VException class parent for all exception. Could be use for abstract exception
|
* @brief The VException class parent for all exception. Could be use for abstract exception
|
||||||
|
|
|
@ -27,8 +27,7 @@
|
||||||
*************************************************************************/
|
*************************************************************************/
|
||||||
|
|
||||||
#include "vexceptionemptyparameter.h"
|
#include "vexceptionemptyparameter.h"
|
||||||
|
#include <QDomElement>
|
||||||
#include <QtWidgets>
|
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -31,7 +31,7 @@
|
||||||
|
|
||||||
#include "vexception.h"
|
#include "vexception.h"
|
||||||
|
|
||||||
#include <QDomElement>
|
class QDomElement;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief The VExceptionEmptyParameter class for exception empty parameter
|
* @brief The VExceptionEmptyParameter class for exception empty parameter
|
||||||
|
|
|
@ -28,6 +28,7 @@
|
||||||
|
|
||||||
#include "vexceptionobjecterror.h"
|
#include "vexceptionobjecterror.h"
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
|
#include <QDomElement>
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -31,7 +31,7 @@
|
||||||
|
|
||||||
#include "vexception.h"
|
#include "vexception.h"
|
||||||
|
|
||||||
#include <QDomElement>
|
class QDomElement;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief The VExceptionObjectError class for exception object error
|
* @brief The VExceptionObjectError class for exception object error
|
||||||
|
|
|
@ -28,6 +28,7 @@
|
||||||
|
|
||||||
#include "vexceptionwrongid.h"
|
#include "vexceptionwrongid.h"
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
|
#include <QDomElement>
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -31,7 +31,7 @@
|
||||||
|
|
||||||
#include "vexception.h"
|
#include "vexception.h"
|
||||||
|
|
||||||
#include <QDomElement>
|
class QDomElement;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief The VExceptionWrongId class for exception wrong id
|
* @brief The VExceptionWrongId class for exception wrong id
|
||||||
|
|
|
@ -27,19 +27,19 @@
|
||||||
*************************************************************************/
|
*************************************************************************/
|
||||||
|
|
||||||
#include "varc.h"
|
#include "varc.h"
|
||||||
#include "vspline.h"
|
|
||||||
#include "../exception/vexception.h"
|
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include <QtMath>
|
|
||||||
|
|
||||||
class QRectF;
|
#ifdef Q_OS_WIN32
|
||||||
|
# include <QtMath> // for M_PI on Windows
|
||||||
|
#endif /*Q_OS_WIN32*/
|
||||||
|
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief VArc default constructor.
|
* @brief VArc default constructor.
|
||||||
*/
|
*/
|
||||||
VArc::VArc ()
|
VArc::VArc ()
|
||||||
:VGObject(GObject::Arc), f1(0), formulaF1(QString()), f2(0), formulaF2(QString()), radius(0),
|
:VGObject(GOType::Arc), f1(0), formulaF1(QString()), f2(0), formulaF2(QString()), radius(0),
|
||||||
formulaRadius(QString()), center(VPointF())
|
formulaRadius(QString()), center(VPointF())
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
@ -52,8 +52,8 @@ VArc::VArc ()
|
||||||
* @param f2 end angle (degree).
|
* @param f2 end angle (degree).
|
||||||
*/
|
*/
|
||||||
VArc::VArc (VPointF center, qreal radius, QString formulaRadius, qreal f1, QString formulaF1, qreal f2,
|
VArc::VArc (VPointF center, qreal radius, QString formulaRadius, qreal f1, QString formulaF1, qreal f2,
|
||||||
QString formulaF2, quint32 idObject, Valentina::Draws mode)
|
QString formulaF2, quint32 idObject, Draw mode)
|
||||||
: VGObject(GObject::Arc, idObject, mode), f1(f1), formulaF1(formulaF1), f2(f2), formulaF2(formulaF2),
|
: VGObject(GOType::Arc, idObject, mode), f1(f1), formulaF1(formulaF1), f2(f2), formulaF2(formulaF2),
|
||||||
radius(radius), formulaRadius(formulaRadius), center(center)
|
radius(radius), formulaRadius(formulaRadius), center(center)
|
||||||
{
|
{
|
||||||
_name = QString (arc_+"%1").arg(this->GetCenter().name());
|
_name = QString (arc_+"%1").arg(this->GetCenter().name());
|
||||||
|
@ -139,8 +139,8 @@ QPainterPath VArc::GetPath() const
|
||||||
{
|
{
|
||||||
for (qint32 i = 0; i < points.count()-1; ++i)
|
for (qint32 i = 0; i < points.count()-1; ++i)
|
||||||
{
|
{
|
||||||
path.moveTo(points[i]);
|
path.moveTo(points.at(i));
|
||||||
path.lineTo(points[i+1]);
|
path.lineTo(points.at(i+1));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
@ -30,11 +30,8 @@
|
||||||
#define VARC_H
|
#define VARC_H
|
||||||
|
|
||||||
#include "vgobject.h"
|
#include "vgobject.h"
|
||||||
#include <QCoreApplication>
|
|
||||||
#include "../options.h"
|
|
||||||
#include "vpointf.h"
|
#include "vpointf.h"
|
||||||
class QString;
|
|
||||||
class QLineF;
|
|
||||||
class QPainterPath;
|
class QPainterPath;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -46,7 +43,7 @@ class VArc: public VGObject
|
||||||
public:
|
public:
|
||||||
VArc ();
|
VArc ();
|
||||||
VArc (VPointF center, qreal radius, QString formulaRadius, qreal f1, QString formulaF1, qreal f2,
|
VArc (VPointF center, qreal radius, QString formulaRadius, qreal f1, QString formulaF1, qreal f2,
|
||||||
QString formulaF2, quint32 idObject = 0, Valentina::Draws mode = Valentina::Calculation);
|
QString formulaF2, quint32 idObject = 0, Draw mode = Draw::Calculation);
|
||||||
VArc(const VArc &arc);
|
VArc(const VArc &arc);
|
||||||
VArc& operator= (const VArc &arc);
|
VArc& operator= (const VArc &arc);
|
||||||
QString GetFormulaF1 () const;
|
QString GetFormulaF1 () const;
|
||||||
|
|
|
@ -28,17 +28,18 @@
|
||||||
|
|
||||||
#include "vdetail.h"
|
#include "vdetail.h"
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
|
#include <QString>
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
VDetail::VDetail()
|
VDetail::VDetail()
|
||||||
:_id(0), nodes(QVector<VNodeDetail>()), name(QString()), mx(0), my(0), seamAllowance(true), closed(true),
|
:_id(0), nodes(QVector<VNodeDetail>()), name(QString()), mx(0), my(0), seamAllowance(true), closed(true),
|
||||||
width(10)
|
width(0)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
VDetail::VDetail(const QString &name, const QVector<VNodeDetail> &nodes)
|
VDetail::VDetail(const QString &name, const QVector<VNodeDetail> &nodes)
|
||||||
:_id(0), nodes(QVector<VNodeDetail>()), name(name), mx(0), my(0), seamAllowance(true), closed(true),
|
:_id(0), nodes(QVector<VNodeDetail>()), name(name), mx(0), my(0), seamAllowance(true), closed(true),
|
||||||
width(10)
|
width(0)
|
||||||
{
|
{
|
||||||
this->nodes = nodes;
|
this->nodes = nodes;
|
||||||
}
|
}
|
||||||
|
@ -72,7 +73,7 @@ void VDetail::Clear()
|
||||||
my = 0;
|
my = 0;
|
||||||
seamAllowance = true;
|
seamAllowance = true;
|
||||||
closed = true;
|
closed = true;
|
||||||
width = 10;
|
width = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
@ -86,7 +87,7 @@ bool VDetail::Containes(const quint32 &id) const
|
||||||
{
|
{
|
||||||
for (ptrdiff_t i = 0; i < nodes.size(); ++i)
|
for (ptrdiff_t i = 0; i < nodes.size(); ++i)
|
||||||
{
|
{
|
||||||
VNodeDetail node = nodes[i];
|
VNodeDetail node = nodes.at(i);
|
||||||
if (node.getId() == id)
|
if (node.getId() == id)
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
|
@ -104,7 +105,7 @@ VNodeDetail &VDetail::operator [](ptrdiff_t indx)
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
const VNodeDetail &VDetail::at(ptrdiff_t indx) const
|
const VNodeDetail &VDetail::at(ptrdiff_t indx) const
|
||||||
{
|
{
|
||||||
return nodes[indx];
|
return nodes.at(indx);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
@ -254,25 +255,26 @@ VDetail VDetail::RemoveEdge(const quint32 &index) const
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
QList<quint32> VDetail::Missing(const VDetail &det) const
|
QList<quint32> VDetail::Missing(const VDetail &det) const
|
||||||
{
|
{
|
||||||
QList<quint32> list;
|
|
||||||
if (nodes.size() == det.CountNode())
|
if (nodes.size() == det.CountNode())
|
||||||
{
|
{
|
||||||
return list;
|
return QList<quint32>();
|
||||||
}
|
}
|
||||||
|
|
||||||
qint32 j = 0;
|
QSet<quint32> set1;
|
||||||
for (qint32 i = 0; i < nodes.size(); ++i)
|
for (qint32 i = 0; i < nodes.size(); ++i)
|
||||||
{
|
{
|
||||||
if (nodes[i].getId() == det.at(j).getId())
|
set1.insert(nodes.at(i).getId());
|
||||||
{
|
|
||||||
++j;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
list.append(nodes[i].getId());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return list;
|
|
||||||
|
QSet<quint32> set2;
|
||||||
|
for (qint32 j = 0; j < det.CountNode(); ++j)
|
||||||
|
{
|
||||||
|
set2.insert(det.at(j).getId());
|
||||||
|
}
|
||||||
|
|
||||||
|
QSet<quint32> set3 = set1.subtract(set2);
|
||||||
|
|
||||||
|
return set3.toList();
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
@ -281,9 +283,9 @@ QVector<VNodeDetail> VDetail::listNodePoint() const
|
||||||
QVector<VNodeDetail> list;
|
QVector<VNodeDetail> list;
|
||||||
for (ptrdiff_t i = 0; i < nodes.size(); ++i)
|
for (ptrdiff_t i = 0; i < nodes.size(); ++i)
|
||||||
{
|
{
|
||||||
if (nodes[i].getTypeTool() == Valentina::NodePoint)
|
if (nodes.at(i).getTypeTool() == Tool::NodePoint)
|
||||||
{
|
{
|
||||||
list.append(nodes[i]);
|
list.append(nodes.at(i));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return list;
|
return list;
|
||||||
|
@ -294,7 +296,7 @@ ptrdiff_t VDetail::indexOfNode(const QVector<VNodeDetail> &list, const quint32 &
|
||||||
{
|
{
|
||||||
for (ptrdiff_t i = 0; i < list.size(); ++i)
|
for (ptrdiff_t i = 0; i < list.size(); ++i)
|
||||||
{
|
{
|
||||||
if (list[i].getId() == id)
|
if (list.at(i).getId() == id)
|
||||||
{
|
{
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,28 +30,12 @@
|
||||||
#define VDETAIL_H
|
#define VDETAIL_H
|
||||||
|
|
||||||
#include "vnodedetail.h"
|
#include "vnodedetail.h"
|
||||||
|
|
||||||
#include <QString>
|
|
||||||
#include <QVector>
|
#include <QVector>
|
||||||
|
|
||||||
namespace Detail
|
class QString;
|
||||||
{
|
|
||||||
/**
|
|
||||||
* @brief The Contour enum OpenContour - first and last points contour don't match,
|
|
||||||
* CloseContour - first and last points contour match.
|
|
||||||
*/
|
|
||||||
enum Contour { OpenContour, CloseContour };
|
|
||||||
Q_DECLARE_FLAGS(Contours, Contour)
|
|
||||||
|
|
||||||
/**
|
enum class Contour : char { OpenContour, CloseContour };
|
||||||
* @brief The Equidistant enum OpenEquidistant - first and last points equidistant don't match,
|
enum class EquidistantType : char { OpenEquidistant, CloseEquidistant };
|
||||||
* CloseEquidistant - first and last points equidistant match.
|
|
||||||
*/
|
|
||||||
enum Equidistant { OpenEquidistant, CloseEquidistant };
|
|
||||||
Q_DECLARE_FLAGS(Equidistants, Equidistant)
|
|
||||||
}
|
|
||||||
Q_DECLARE_OPERATORS_FOR_FLAGS(Detail::Contours)
|
|
||||||
Q_DECLARE_OPERATORS_FOR_FLAGS(Detail::Equidistants)
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief The VDetail class for path of object (points, arcs, splines).
|
* @brief The VDetail class for path of object (points, arcs, splines).
|
||||||
|
|
|
@ -26,9 +26,15 @@
|
||||||
**
|
**
|
||||||
*************************************************************************/
|
*************************************************************************/
|
||||||
|
|
||||||
|
#include "varc.h"
|
||||||
#include "vequidistant.h"
|
#include "vequidistant.h"
|
||||||
|
#include "vpointf.h"
|
||||||
|
#include "vspline.h"
|
||||||
|
#include "vsplinepath.h"
|
||||||
#include "../widgets/vapplication.h"
|
#include "../widgets/vapplication.h"
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
|
#include <QPainterPath>
|
||||||
|
#include "../container/vcontainer.h"
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
QPainterPath VEquidistant::ContourPath(const quint32 &idDetail, const VContainer *data) const
|
QPainterPath VEquidistant::ContourPath(const quint32 &idDetail, const VContainer *data) const
|
||||||
|
@ -41,7 +47,7 @@ QPainterPath VEquidistant::ContourPath(const quint32 &idDetail, const VContainer
|
||||||
{
|
{
|
||||||
switch (detail.at(i).getTypeTool())
|
switch (detail.at(i).getTypeTool())
|
||||||
{
|
{
|
||||||
case (Valentina::NodePoint):
|
case (Tool::NodePoint):
|
||||||
{
|
{
|
||||||
const VPointF *point = data->GeometricObject<const VPointF*>(detail.at(i).getId());
|
const VPointF *point = data->GeometricObject<const VPointF*>(detail.at(i).getId());
|
||||||
points.append(point->toQPointF());
|
points.append(point->toQPointF());
|
||||||
|
@ -54,7 +60,7 @@ QPainterPath VEquidistant::ContourPath(const quint32 &idDetail, const VContainer
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case (Valentina::NodeArc):
|
case (Tool::NodeArc):
|
||||||
{
|
{
|
||||||
const VArc *arc = data->GeometricObject<const VArc *>(detail.at(i).getId());
|
const VArc *arc = data->GeometricObject<const VArc *>(detail.at(i).getId());
|
||||||
qreal len1 = GetLengthContour(points, arc->GetPoints());
|
qreal len1 = GetLengthContour(points, arc->GetPoints());
|
||||||
|
@ -78,7 +84,7 @@ QPainterPath VEquidistant::ContourPath(const quint32 &idDetail, const VContainer
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case (Valentina::NodeSpline):
|
case (Tool::NodeSpline):
|
||||||
{
|
{
|
||||||
const VSpline *spline = data->GeometricObject<const VSpline *>(detail.at(i).getId());
|
const VSpline *spline = data->GeometricObject<const VSpline *>(detail.at(i).getId());
|
||||||
qreal len1 = GetLengthContour(points, spline->GetPoints());
|
qreal len1 = GetLengthContour(points, spline->GetPoints());
|
||||||
|
@ -102,7 +108,7 @@ QPainterPath VEquidistant::ContourPath(const quint32 &idDetail, const VContainer
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case (Valentina::NodeSplinePath):
|
case (Tool::NodeSplinePath):
|
||||||
{
|
{
|
||||||
const VSplinePath *splinePath = data->GeometricObject<const VSplinePath *>(detail.at(i).getId());
|
const VSplinePath *splinePath = data->GeometricObject<const VSplinePath *>(detail.at(i).getId());
|
||||||
qreal len1 = GetLengthContour(points, splinePath->GetPathPoints());
|
qreal len1 = GetLengthContour(points, splinePath->GetPathPoints());
|
||||||
|
@ -126,8 +132,29 @@ QPainterPath VEquidistant::ContourPath(const quint32 &idDetail, const VContainer
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case (Tool::ArrowTool):
|
||||||
|
case (Tool::SinglePointTool):
|
||||||
|
case (Tool::EndLineTool):
|
||||||
|
case (Tool::LineTool):
|
||||||
|
case (Tool::AlongLineTool):
|
||||||
|
case (Tool::ShoulderPointTool):
|
||||||
|
case (Tool::NormalTool):
|
||||||
|
case (Tool::BisectorTool):
|
||||||
|
case (Tool::LineIntersectTool):
|
||||||
|
case (Tool::SplineTool):
|
||||||
|
case (Tool::CutSplineTool):
|
||||||
|
case (Tool::CutArcTool):
|
||||||
|
case (Tool::ArcTool):
|
||||||
|
case (Tool::SplinePathTool):
|
||||||
|
case (Tool::CutSplinePathTool):
|
||||||
|
case (Tool::PointOfContact):
|
||||||
|
case (Tool::DetailTool):
|
||||||
|
case (Tool::Height):
|
||||||
|
case (Tool::Triangle):
|
||||||
|
case (Tool::PointOfIntersection):
|
||||||
|
case (Tool::UnionDetails):
|
||||||
default:
|
default:
|
||||||
qDebug()<<"Get wrong tool type. Ignore."<<detail.at(i).getTypeTool();
|
qDebug()<<"Get wrong tool type. Ignore."<< static_cast<char>(detail.at(i).getTypeTool());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -136,9 +163,9 @@ QPainterPath VEquidistant::ContourPath(const quint32 &idDetail, const VContainer
|
||||||
path.moveTo(points[0]);
|
path.moveTo(points[0]);
|
||||||
for (qint32 i = 1; i < points.count(); ++i)
|
for (qint32 i = 1; i < points.count(); ++i)
|
||||||
{
|
{
|
||||||
path.lineTo(points[i]);
|
path.lineTo(points.at(i));
|
||||||
}
|
}
|
||||||
path.lineTo(points[0]);
|
path.lineTo(points.at(0));
|
||||||
|
|
||||||
pointsEkv = CorrectEquidistantPoints(pointsEkv);
|
pointsEkv = CorrectEquidistantPoints(pointsEkv);
|
||||||
pointsEkv = CheckLoops(pointsEkv);
|
pointsEkv = CheckLoops(pointsEkv);
|
||||||
|
@ -148,11 +175,11 @@ QPainterPath VEquidistant::ContourPath(const quint32 &idDetail, const VContainer
|
||||||
QPainterPath ekv;
|
QPainterPath ekv;
|
||||||
if (detail.getClosed() == true)
|
if (detail.getClosed() == true)
|
||||||
{
|
{
|
||||||
ekv = Equidistant(pointsEkv, Detail::CloseEquidistant, qApp->toPixel(detail.getWidth()));
|
ekv = Equidistant(pointsEkv, EquidistantType::CloseEquidistant, qApp->toPixel(detail.getWidth()));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ekv = Equidistant(pointsEkv, Detail::OpenEquidistant, qApp->toPixel(detail.getWidth()));
|
ekv = Equidistant(pointsEkv, EquidistantType::OpenEquidistant, qApp->toPixel(detail.getWidth()));
|
||||||
}
|
}
|
||||||
path.addPath(ekv);
|
path.addPath(ekv);
|
||||||
path.setFillRule(Qt::WindingFill);
|
path.setFillRule(Qt::WindingFill);
|
||||||
|
@ -223,8 +250,8 @@ QVector<QPointF> VEquidistant::CorrectEquidistantPoints(const QVector<QPointF> &
|
||||||
QPointF point;
|
QPointF point;
|
||||||
for (qint32 i = 1; i <correctPoints.size()-1; ++i)
|
for (qint32 i = 1; i <correctPoints.size()-1; ++i)
|
||||||
{
|
{
|
||||||
QLineF l1(correctPoints[i-1], correctPoints[i]);
|
QLineF l1(correctPoints.at(i-1), correctPoints.at(i));
|
||||||
QLineF l2(correctPoints[i], correctPoints[i+1]);
|
QLineF l2(correctPoints.at(i), correctPoints.at(i+1));
|
||||||
QLineF::IntersectType intersect = l1.intersect(l2, &point);
|
QLineF::IntersectType intersect = l1.intersect(l2, &point);
|
||||||
if (intersect == QLineF::NoIntersection)
|
if (intersect == QLineF::NoIntersection)
|
||||||
{
|
{
|
||||||
|
@ -235,8 +262,7 @@ QVector<QPointF> VEquidistant::CorrectEquidistantPoints(const QVector<QPointF> &
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
QPainterPath VEquidistant::Equidistant(QVector<QPointF> points, const Detail::Equidistant &eqv,
|
QPainterPath VEquidistant::Equidistant(QVector<QPointF> points, const EquidistantType &eqv, const qreal &width)
|
||||||
const qreal &width)
|
|
||||||
{
|
{
|
||||||
QPainterPath ekv;
|
QPainterPath ekv;
|
||||||
QVector<QPointF> ekvPoints;
|
QVector<QPointF> ekvPoints;
|
||||||
|
@ -245,59 +271,64 @@ QPainterPath VEquidistant::Equidistant(QVector<QPointF> points, const Detail::Eq
|
||||||
qDebug()<<"Not enough points for building the equidistant.\n";
|
qDebug()<<"Not enough points for building the equidistant.\n";
|
||||||
return ekv;
|
return ekv;
|
||||||
}
|
}
|
||||||
|
if (width <= 0)
|
||||||
|
{
|
||||||
|
qDebug()<<"Width <= 0.\n";
|
||||||
|
return ekv;
|
||||||
|
}
|
||||||
for (qint32 i = 0; i < points.size(); ++i )
|
for (qint32 i = 0; i < points.size(); ++i )
|
||||||
{
|
{
|
||||||
if (i != points.size()-1)
|
if (i != points.size()-1)
|
||||||
{
|
{
|
||||||
if (points[i] == points[i+1])
|
if (points.at(i) == points.at(i+1))
|
||||||
{
|
{
|
||||||
points.remove(i+1);
|
points.remove(i+1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (points[i] == points[0])
|
if (points.at(i) == points.at(0))
|
||||||
{
|
{
|
||||||
points.remove(i);
|
points.remove(i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (eqv == Detail::CloseEquidistant)
|
if (eqv == EquidistantType::CloseEquidistant)
|
||||||
{
|
{
|
||||||
points.append(points.at(0));
|
points.append(points.at(0));
|
||||||
}
|
}
|
||||||
for (qint32 i = 0; i < points.size(); ++i )
|
for (qint32 i = 0; i < points.size(); ++i )
|
||||||
{
|
{
|
||||||
if ( i == 0 && eqv == Detail::CloseEquidistant)
|
if ( i == 0 && eqv == EquidistantType::CloseEquidistant)
|
||||||
{//first point, polyline closed
|
{//first point, polyline closed
|
||||||
ekvPoints<<EkvPoint(QLineF(points[points.size()-2], points[points.size()-1]), QLineF(points[1], points[0]),
|
ekvPoints<<EkvPoint(QLineF(points.at(points.size()-2), points.at(points.size()-1)),
|
||||||
width);
|
QLineF(points.at(1), points.at(0)), width);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
else if (i == 0 && eqv == Detail::OpenEquidistant)
|
else if (i == 0 && eqv == EquidistantType::OpenEquidistant)
|
||||||
{//first point, polyline doesn't closed
|
{//first point, polyline doesn't closed
|
||||||
ekvPoints.append(SingleParallelPoint(QLineF(points[0], points[1]), 90, width));
|
ekvPoints.append(SingleParallelPoint(QLineF(points.at(0), points.at(1)), 90, width));
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (i == points.size()-1 && eqv == Detail::CloseEquidistant)
|
if (i == points.size()-1 && eqv == EquidistantType::CloseEquidistant)
|
||||||
{//last point, polyline closed
|
{//last point, polyline closed
|
||||||
ekvPoints.append(ekvPoints.at(0));
|
ekvPoints.append(ekvPoints.at(0));
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
else if (i == points.size()-1 && eqv == Detail::OpenEquidistant)
|
else if (i == points.size()-1 && eqv == EquidistantType::OpenEquidistant)
|
||||||
{//last point, polyline doesn't closed
|
{//last point, polyline doesn't closed
|
||||||
ekvPoints.append(SingleParallelPoint(QLineF(points[points.size()-1], points[points.size()-2]), -90,
|
ekvPoints.append(SingleParallelPoint(QLineF(points.at(points.size()-1), points.at(points.size()-2)),
|
||||||
width));
|
-90, width));
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
//points in the middle of polyline
|
//points in the middle of polyline
|
||||||
ekvPoints<<EkvPoint(QLineF(points[i-1], points[i]), QLineF(points[i+1], points[i]), width);
|
ekvPoints<<EkvPoint(QLineF(points.at(i-1), points.at(i)), QLineF(points.at(i+1), points.at(i)), width);
|
||||||
}
|
}
|
||||||
ekvPoints = CheckLoops(ekvPoints);
|
ekvPoints = CheckLoops(ekvPoints);
|
||||||
ekv.moveTo(ekvPoints[0]);
|
ekv.moveTo(ekvPoints.at(0));
|
||||||
for (qint32 i = 1; i < ekvPoints.count(); ++i)
|
for (qint32 i = 1; i < ekvPoints.count(); ++i)
|
||||||
{
|
{
|
||||||
ekv.lineTo(ekvPoints[i]);
|
ekv.lineTo(ekvPoints.at(i));
|
||||||
}
|
}
|
||||||
return ekv;
|
return ekv;
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,8 +29,12 @@
|
||||||
#ifndef VEQUIDISTANT_H
|
#ifndef VEQUIDISTANT_H
|
||||||
#define VEQUIDISTANT_H
|
#define VEQUIDISTANT_H
|
||||||
|
|
||||||
#include <QPainterPath>
|
#include "vdetail.h"
|
||||||
#include "../container/vcontainer.h"
|
|
||||||
|
class QPainterPath;
|
||||||
|
class VContainer;
|
||||||
|
class QPointF;
|
||||||
|
class QLineF;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief The VEquidistant class calculate equidistant for detail.
|
* @brief The VEquidistant class calculate equidistant for detail.
|
||||||
|
@ -74,7 +78,7 @@ private:
|
||||||
* @param width width of equidistant.
|
* @param width width of equidistant.
|
||||||
* @return return painter path of equidistant.
|
* @return return painter path of equidistant.
|
||||||
*/
|
*/
|
||||||
static QPainterPath Equidistant(QVector<QPointF> points, const Detail::Equidistant &eqv, const qreal &width);
|
static QPainterPath Equidistant(QVector<QPointF> points, const EquidistantType &eqv, const qreal &width);
|
||||||
/**
|
/**
|
||||||
* @brief CheckLoops seek and delete loops in equidistant.
|
* @brief CheckLoops seek and delete loops in equidistant.
|
||||||
* @param points vector of points of equidistant.
|
* @param points vector of points of equidistant.
|
||||||
|
|
|
@ -33,7 +33,7 @@
|
||||||
* @brief VGObject default constructor.
|
* @brief VGObject default constructor.
|
||||||
*/
|
*/
|
||||||
VGObject::VGObject()
|
VGObject::VGObject()
|
||||||
:_id(0), type(GObject::Point), idObject(0), _name(QString()), mode(Valentina::Calculation)
|
:_id(0), type(GOType::Point), idObject(0), _name(QString()), mode(Draw::Calculation)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
@ -43,7 +43,7 @@ VGObject::VGObject()
|
||||||
* @param idObject id parent object.
|
* @param idObject id parent object.
|
||||||
* @param mode mode creation. Used in modeling mode.
|
* @param mode mode creation. Used in modeling mode.
|
||||||
*/
|
*/
|
||||||
VGObject::VGObject(const GObject::Type &type, const quint32 &idObject, const Valentina::Draws &mode)
|
VGObject::VGObject(const GOType &type, const quint32 &idObject, const Draw &mode)
|
||||||
:_id(0), type(type), idObject(idObject), _name(QString()), mode(mode)
|
:_id(0), type(type), idObject(idObject), _name(QString()), mode(mode)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
@ -117,7 +117,7 @@ void VGObject::setName(const QString &name)
|
||||||
* @brief getMode return mode creation.
|
* @brief getMode return mode creation.
|
||||||
* @return mode.
|
* @return mode.
|
||||||
*/
|
*/
|
||||||
Valentina::Draws VGObject::getMode() const
|
Draw VGObject::getMode() const
|
||||||
{
|
{
|
||||||
return mode;
|
return mode;
|
||||||
}
|
}
|
||||||
|
@ -127,7 +127,7 @@ Valentina::Draws VGObject::getMode() const
|
||||||
* @brief setMode set mode creation.
|
* @brief setMode set mode creation.
|
||||||
* @param value mode.
|
* @param value mode.
|
||||||
*/
|
*/
|
||||||
void VGObject::setMode(const Valentina::Draws &value)
|
void VGObject::setMode(const Draw &value)
|
||||||
{
|
{
|
||||||
mode = value;
|
mode = value;
|
||||||
}
|
}
|
||||||
|
@ -137,7 +137,7 @@ void VGObject::setMode(const Valentina::Draws &value)
|
||||||
* @brief getType return object type.
|
* @brief getType return object type.
|
||||||
* @return type.
|
* @return type.
|
||||||
*/
|
*/
|
||||||
GObject::Type VGObject::getType() const
|
GOType VGObject::getType() const
|
||||||
{
|
{
|
||||||
return type;
|
return type;
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,20 +30,8 @@
|
||||||
#define VGOBJECT_H
|
#define VGOBJECT_H
|
||||||
|
|
||||||
#include "../options.h"
|
#include "../options.h"
|
||||||
#include "../exception/vexception.h"
|
|
||||||
#include <QCoreApplication>
|
|
||||||
#include <QHash>
|
|
||||||
|
|
||||||
|
enum class GOType : char { Point, Arc, Spline, SplinePath };
|
||||||
namespace GObject
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* @brief The NodeDetail enum type of graphical objects.
|
|
||||||
*/
|
|
||||||
enum Type { Point, Arc, Spline, SplinePath };
|
|
||||||
Q_DECLARE_FLAGS(Types, Type)
|
|
||||||
}
|
|
||||||
Q_DECLARE_OPERATORS_FOR_FLAGS(GObject::Types)
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief The VGObject class keep information graphical objects.
|
* @brief The VGObject class keep information graphical objects.
|
||||||
|
@ -52,8 +40,7 @@ class VGObject
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
VGObject();
|
VGObject();
|
||||||
VGObject(const GObject::Type &type, const quint32 &idObject = 0,
|
VGObject(const GOType &type, const quint32 &idObject = 0, const Draw &mode = Draw::Calculation);
|
||||||
const Valentina::Draws &mode = Valentina::Calculation);
|
|
||||||
VGObject(const VGObject &obj);
|
VGObject(const VGObject &obj);
|
||||||
VGObject& operator= (const VGObject &obj);
|
VGObject& operator= (const VGObject &obj);
|
||||||
virtual ~VGObject(){}
|
virtual ~VGObject(){}
|
||||||
|
@ -61,9 +48,9 @@ public:
|
||||||
void setIdObject(const quint32 &value);
|
void setIdObject(const quint32 &value);
|
||||||
virtual QString name() const;
|
virtual QString name() const;
|
||||||
void setName(const QString &name);
|
void setName(const QString &name);
|
||||||
Valentina::Draws getMode() const;
|
Draw getMode() const;
|
||||||
void setMode(const Valentina::Draws &value);
|
void setMode(const Draw &value);
|
||||||
GObject::Type getType() const;
|
GOType getType() const;
|
||||||
quint32 id() const;
|
quint32 id() const;
|
||||||
virtual void setId(const quint32 &id);
|
virtual void setId(const quint32 &id);
|
||||||
protected:
|
protected:
|
||||||
|
@ -71,7 +58,7 @@ protected:
|
||||||
quint32 _id;
|
quint32 _id;
|
||||||
|
|
||||||
/** @brief type type of graphical object */
|
/** @brief type type of graphical object */
|
||||||
GObject::Type type;
|
GOType type;
|
||||||
|
|
||||||
/** @brief idObject id of parent object. Only for modeling. All another return 0. */
|
/** @brief idObject id of parent object. Only for modeling. All another return 0. */
|
||||||
quint32 idObject;
|
quint32 idObject;
|
||||||
|
@ -80,7 +67,7 @@ protected:
|
||||||
QString _name;
|
QString _name;
|
||||||
|
|
||||||
/** @brief mode object created in calculation or drawing mode */
|
/** @brief mode object created in calculation or drawing mode */
|
||||||
Valentina::Draws mode;
|
Draw mode;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // VGOBJECT_H
|
#endif // VGOBJECT_H
|
||||||
|
|
|
@ -30,11 +30,11 @@
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
VNodeDetail::VNodeDetail()
|
VNodeDetail::VNodeDetail()
|
||||||
:id(0), typeTool(Valentina::NodePoint), typeNode(NodeDetail::Contour), mx(0), my(0)
|
:id(0), typeTool(Tool::NodePoint), typeNode(NodeDetail::Contour), mx(0), my(0)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
VNodeDetail::VNodeDetail(quint32 id, Valentina::Tools typeTool, NodeDetail::NodeDetails typeNode, qreal mx, qreal my)
|
VNodeDetail::VNodeDetail(quint32 id, Tool typeTool, NodeDetail 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)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
|
@ -29,18 +29,9 @@
|
||||||
#ifndef VNODEDETAIL_H
|
#ifndef VNODEDETAIL_H
|
||||||
#define VNODEDETAIL_H
|
#define VNODEDETAIL_H
|
||||||
|
|
||||||
#include <QMetaType>
|
|
||||||
#include "../options.h"
|
#include "../options.h"
|
||||||
|
|
||||||
namespace NodeDetail
|
enum class NodeDetail : char { Contour, Modeling };
|
||||||
{
|
|
||||||
/**
|
|
||||||
* @brief The NodeDetail enum node can be node of contour or node modeling.
|
|
||||||
*/
|
|
||||||
enum NodeDetail { Contour, Modeling };
|
|
||||||
Q_DECLARE_FLAGS(NodeDetails, NodeDetail)
|
|
||||||
}
|
|
||||||
Q_DECLARE_OPERATORS_FOR_FLAGS(NodeDetail::NodeDetails)
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief The VNodeDetail class keep information about detail node.
|
* @brief The VNodeDetail class keep information about detail node.
|
||||||
|
@ -60,8 +51,7 @@ public:
|
||||||
* @param mx object bias x axis
|
* @param mx object bias x axis
|
||||||
* @param my object bias y axis
|
* @param my object bias y axis
|
||||||
*/
|
*/
|
||||||
VNodeDetail(quint32 id, Valentina::Tools typeTool, NodeDetail::NodeDetails typeNode, qreal mx = 0,
|
VNodeDetail(quint32 id, Tool typeTool, NodeDetail typeNode, qreal mx = 0, qreal my = 0);
|
||||||
qreal my = 0);
|
|
||||||
/**
|
/**
|
||||||
* @brief VNodeDetail copy constructor
|
* @brief VNodeDetail copy constructor
|
||||||
* @param node node
|
* @param node node
|
||||||
|
@ -87,22 +77,22 @@ public:
|
||||||
* @brief getTypeTool return tool type.
|
* @brief getTypeTool return tool type.
|
||||||
* @return tool type.
|
* @return tool type.
|
||||||
*/
|
*/
|
||||||
Valentina::Tools getTypeTool() const;
|
Tool getTypeTool() const;
|
||||||
/**
|
/**
|
||||||
* @brief setTypeTool set tool type.
|
* @brief setTypeTool set tool type.
|
||||||
* @param value tool type.
|
* @param value tool type.
|
||||||
*/
|
*/
|
||||||
void setTypeTool(const Valentina::Tools &value);
|
void setTypeTool(const Tool &value);
|
||||||
/**
|
/**
|
||||||
* @brief getTypeNode return node type.
|
* @brief getTypeNode return node type.
|
||||||
* @return node type.
|
* @return node type.
|
||||||
*/
|
*/
|
||||||
NodeDetail::NodeDetails getTypeNode() const;
|
NodeDetail getTypeNode() const;
|
||||||
/**
|
/**
|
||||||
* @brief setTypeNode set node type.
|
* @brief setTypeNode set node type.
|
||||||
* @param value node type.
|
* @param value node type.
|
||||||
*/
|
*/
|
||||||
void setTypeNode(const NodeDetail::NodeDetails &value);
|
void setTypeNode(const NodeDetail &value);
|
||||||
/**
|
/**
|
||||||
* @brief getMx return object bias x axis.
|
* @brief getMx return object bias x axis.
|
||||||
* @return bias x axis.
|
* @return bias x axis.
|
||||||
|
@ -131,11 +121,11 @@ private:
|
||||||
/**
|
/**
|
||||||
* @brief typeTool type of tool
|
* @brief typeTool type of tool
|
||||||
*/
|
*/
|
||||||
Valentina::Tools typeTool;
|
Tool typeTool;
|
||||||
/**
|
/**
|
||||||
* @brief typeNode node type.
|
* @brief typeNode node type.
|
||||||
*/
|
*/
|
||||||
NodeDetail::NodeDetails typeNode;
|
NodeDetail typeNode;
|
||||||
/**
|
/**
|
||||||
* @brief mx bias x axis.
|
* @brief mx bias x axis.
|
||||||
*/
|
*/
|
||||||
|
@ -156,22 +146,22 @@ inline void VNodeDetail::setId(const quint32 &value)
|
||||||
id = value;
|
id = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline Valentina::Tools VNodeDetail::getTypeTool() const
|
inline Tool VNodeDetail::getTypeTool() const
|
||||||
{
|
{
|
||||||
return typeTool;
|
return typeTool;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void VNodeDetail::setTypeTool(const Valentina::Tools &value)
|
inline void VNodeDetail::setTypeTool(const Tool &value)
|
||||||
{
|
{
|
||||||
typeTool = value;
|
typeTool = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline NodeDetail::NodeDetails VNodeDetail::getTypeNode() const
|
inline NodeDetail VNodeDetail::getTypeNode() const
|
||||||
{
|
{
|
||||||
return typeNode;
|
return typeNode;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void VNodeDetail::setTypeNode(const NodeDetail::NodeDetails &value)
|
inline void VNodeDetail::setTypeNode(const NodeDetail &value)
|
||||||
{
|
{
|
||||||
typeNode = value;
|
typeNode = value;
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,6 +27,8 @@
|
||||||
*************************************************************************/
|
*************************************************************************/
|
||||||
|
|
||||||
#include "vpointf.h"
|
#include "vpointf.h"
|
||||||
|
#include <QPointF>
|
||||||
|
#include <QString>
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
|
@ -36,8 +38,8 @@
|
||||||
* @param mx offset name respect to x
|
* @param mx offset name respect to x
|
||||||
* @param my offset name respect to y
|
* @param my offset name respect to y
|
||||||
*/
|
*/
|
||||||
VPointF::VPointF(qreal x, qreal y, QString name, qreal mx, qreal my, quint32 idObject, Valentina::Draws mode)
|
VPointF::VPointF(qreal x, qreal y, QString name, qreal mx, qreal my, quint32 idObject, Draw mode)
|
||||||
:VGObject(GObject::Point, idObject, mode), _mx(mx), _my(my), _x(x), _y(y)
|
:VGObject(GOType::Point, idObject, mode), _mx(mx), _my(my), _x(x), _y(y)
|
||||||
{
|
{
|
||||||
this->_name = name;
|
this->_name = name;
|
||||||
}
|
}
|
||||||
|
@ -46,7 +48,7 @@ VPointF::VPointF(qreal x, qreal y, QString name, qreal mx, qreal my, quint32 idO
|
||||||
/**
|
/**
|
||||||
* @brief VPointF creat empty point
|
* @brief VPointF creat empty point
|
||||||
*/
|
*/
|
||||||
VPointF::VPointF() :VGObject(GObject::Point, 0, Valentina::Calculation), _mx(0), _my(0), _x(0), _y(0)
|
VPointF::VPointF() :VGObject(GOType::Point, 0, Draw::Calculation), _mx(0), _my(0), _x(0), _y(0)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
@ -78,3 +80,13 @@ QString VPointF::name() const
|
||||||
{
|
{
|
||||||
return _name;
|
return _name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief toQPointF convert to QPointF
|
||||||
|
* @return QPointF point
|
||||||
|
*/
|
||||||
|
QPointF VPointF::toQPointF() const
|
||||||
|
{
|
||||||
|
return QPointF(_x, _y);
|
||||||
|
}
|
||||||
|
|
|
@ -29,11 +29,11 @@
|
||||||
#ifndef VPOINTF_H
|
#ifndef VPOINTF_H
|
||||||
#define VPOINTF_H
|
#define VPOINTF_H
|
||||||
|
|
||||||
#include <QPointF>
|
|
||||||
#include <QString>
|
|
||||||
#include "../options.h"
|
|
||||||
#include "vgobject.h"
|
#include "vgobject.h"
|
||||||
|
|
||||||
|
class QPointF;
|
||||||
|
class QString;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief The VPointF class keep data of point.
|
* @brief The VPointF class keep data of point.
|
||||||
*/
|
*/
|
||||||
|
@ -44,7 +44,7 @@ public:
|
||||||
VPointF (const VPointF &point );
|
VPointF (const VPointF &point );
|
||||||
VPointF (const QPointF &point );
|
VPointF (const QPointF &point );
|
||||||
VPointF ( qreal x, qreal y, QString name, qreal mx, qreal my, quint32 idObject = 0,
|
VPointF ( qreal x, qreal y, QString name, qreal mx, qreal my, quint32 idObject = 0,
|
||||||
Valentina::Draws mode = Valentina::Calculation);
|
Draw mode = Draw::Calculation);
|
||||||
virtual ~VPointF(){}
|
virtual ~VPointF(){}
|
||||||
VPointF &operator=(const VPointF &point);
|
VPointF &operator=(const VPointF &point);
|
||||||
qreal mx() const;
|
qreal mx() const;
|
||||||
|
@ -111,16 +111,6 @@ inline void VPointF::setMy(qreal my)
|
||||||
_my = my;
|
_my = my;
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
|
||||||
/**
|
|
||||||
* @brief toQPointF convert to QPointF
|
|
||||||
* @return QPointF point
|
|
||||||
*/
|
|
||||||
inline QPointF VPointF::toQPointF() const
|
|
||||||
{
|
|
||||||
return QPointF(_x, _y);
|
|
||||||
}
|
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief x return x coordinate
|
* @brief x return x coordinate
|
||||||
|
|
|
@ -27,16 +27,18 @@
|
||||||
*************************************************************************/
|
*************************************************************************/
|
||||||
|
|
||||||
#include "vspline.h"
|
#include "vspline.h"
|
||||||
#include <cmath>
|
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include <QtMath>
|
|
||||||
|
#ifdef Q_OS_WIN32
|
||||||
|
# include <QtMath> // for M_PI on Windows
|
||||||
|
#endif /*Q_OS_WIN32*/
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief VSpline default constructor
|
* @brief VSpline default constructor
|
||||||
*/
|
*/
|
||||||
VSpline::VSpline()
|
VSpline::VSpline()
|
||||||
:VGObject(GObject::Spline), p1(VPointF()), p2(QPointF()), p3(QPointF()), p4(VPointF()), angle1(0), angle2(0),
|
:VGObject(GOType::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)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
@ -63,8 +65,8 @@ VSpline::VSpline ( const VSpline & spline )
|
||||||
* @param kAsm2 coefficient of length second control line.
|
* @param kAsm2 coefficient of length second control line.
|
||||||
*/
|
*/
|
||||||
VSpline::VSpline (VPointF p1, VPointF p4, qreal angle1, qreal angle2, qreal kAsm1, qreal kAsm2, qreal kCurve,
|
VSpline::VSpline (VPointF p1, VPointF p4, qreal angle1, qreal angle2, qreal kAsm1, qreal kAsm2, qreal kCurve,
|
||||||
quint32 idObject, Valentina::Draws mode)
|
quint32 idObject, Draw mode)
|
||||||
:VGObject(GObject::Spline, idObject, mode), p1(p1), p2(QPointF()), p3(QPointF()), p4(p4), angle1(angle1),
|
:VGObject(GOType::Spline, idObject, mode), p1(p1), p2(QPointF()), p3(QPointF()), p4(p4), angle1(angle1),
|
||||||
angle2(angle2), kAsm1(kAsm1), kAsm2(kAsm2), kCurve(kCurve)
|
angle2(angle2), kAsm1(kAsm1), kAsm2(kAsm2), kCurve(kCurve)
|
||||||
{
|
{
|
||||||
CreateName();
|
CreateName();
|
||||||
|
@ -98,8 +100,8 @@ VSpline::VSpline (VPointF p1, VPointF p4, qreal angle1, qreal angle2, qreal kAsm
|
||||||
* @param p3 second control point.
|
* @param p3 second control point.
|
||||||
* @param p4 second point spline.
|
* @param p4 second point spline.
|
||||||
*/
|
*/
|
||||||
VSpline::VSpline (VPointF p1, QPointF p2, QPointF p3, VPointF p4, qreal kCurve, quint32 idObject, Valentina::Draws mode)
|
VSpline::VSpline (VPointF p1, QPointF p2, QPointF p3, VPointF p4, qreal kCurve, quint32 idObject, Draw mode)
|
||||||
:VGObject(GObject::Spline, idObject, mode), p1(p1), p2(p2), p3(p3), p4(p4), angle1(0), angle2(0), kAsm1(1),
|
:VGObject(GOType::Spline, idObject, mode), p1(p1), p2(p2), p3(p3), p4(p4), angle1(0), angle2(0), kAsm1(1),
|
||||||
kAsm2(1), kCurve(1)
|
kAsm2(1), kCurve(1)
|
||||||
{
|
{
|
||||||
CreateName();
|
CreateName();
|
||||||
|
@ -168,8 +170,8 @@ QLineF::IntersectType VSpline::CrossingSplLine ( const QLineF &line, QPointF *in
|
||||||
QLineF::IntersectType type = QLineF::NoIntersection;
|
QLineF::IntersectType type = QLineF::NoIntersection;
|
||||||
for ( i = 0; i < px.count()-1; ++i )
|
for ( i = 0; i < px.count()-1; ++i )
|
||||||
{
|
{
|
||||||
type = line.intersect(QLineF ( QPointF ( px[i], py[i] ),
|
type = line.intersect(QLineF ( QPointF ( px.at(i), py.at(i) ),
|
||||||
QPointF ( px[i+1], py[i+1] )), &crosPoint);
|
QPointF ( px.at(i+1), py.at(i+1) )), &crosPoint);
|
||||||
if ( type == QLineF::BoundedIntersection )
|
if ( type == QLineF::BoundedIntersection )
|
||||||
{
|
{
|
||||||
*intersectionPoint = crosPoint;
|
*intersectionPoint = crosPoint;
|
||||||
|
@ -318,7 +320,7 @@ QVector<QPointF> VSpline::GetPoints (const QPointF &p1, const QPointF &p2, const
|
||||||
y.append ( p4.y () );
|
y.append ( p4.y () );
|
||||||
for ( qint32 i = 0; i < x.count(); ++i )
|
for ( qint32 i = 0; i < x.count(); ++i )
|
||||||
{
|
{
|
||||||
pvector.append( QPointF ( x[i], y[i] ) );
|
pvector.append( QPointF ( x.at(i), y.at(i)) );
|
||||||
}
|
}
|
||||||
return pvector;
|
return pvector;
|
||||||
}
|
}
|
||||||
|
@ -336,10 +338,10 @@ qreal VSpline::LengthBezier ( const QPointF &p1, const QPointF &p2, const QPoint
|
||||||
{
|
{
|
||||||
QPainterPath splinePath;
|
QPainterPath splinePath;
|
||||||
QVector<QPointF> points = GetPoints (p1, p2, p3, p4);
|
QVector<QPointF> points = GetPoints (p1, p2, p3, p4);
|
||||||
splinePath.moveTo(points[0]);
|
splinePath.moveTo(points.at(0));
|
||||||
for (qint32 i = 1; i < points.count(); ++i)
|
for (qint32 i = 1; i < points.count(); ++i)
|
||||||
{
|
{
|
||||||
splinePath.lineTo(points[i]);
|
splinePath.lineTo(points.at(i));
|
||||||
}
|
}
|
||||||
return splinePath.length();
|
return splinePath.length();
|
||||||
}
|
}
|
||||||
|
@ -675,8 +677,8 @@ QPainterPath VSpline::GetPath() const
|
||||||
{
|
{
|
||||||
for (qint32 i = 0; i < points.count()-1; ++i)
|
for (qint32 i = 0; i < points.count()-1; ++i)
|
||||||
{
|
{
|
||||||
splinePath.moveTo(points[i]);
|
splinePath.moveTo(points.at(i));
|
||||||
splinePath.lineTo(points[i+1]);
|
splinePath.lineTo(points.at(i+1));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
@ -32,11 +32,8 @@
|
||||||
#include "vpointf.h"
|
#include "vpointf.h"
|
||||||
#include "vgobject.h"
|
#include "vgobject.h"
|
||||||
|
|
||||||
#include <QHash>
|
class QLineF;
|
||||||
#include <QLineF>
|
class QPainterPath;
|
||||||
#include <QPainterPath>
|
|
||||||
|
|
||||||
class QString;
|
|
||||||
|
|
||||||
#define M_2PI 6.28318530717958647692528676655900576
|
#define M_2PI 6.28318530717958647692528676655900576
|
||||||
|
|
||||||
|
@ -49,9 +46,10 @@ public:
|
||||||
VSpline();
|
VSpline();
|
||||||
VSpline (const VSpline &spline );
|
VSpline (const VSpline &spline );
|
||||||
VSpline (VPointF p1, VPointF p4, qreal angle1, qreal angle2, qreal kAsm1, qreal kAsm2, qreal kCurve,
|
VSpline (VPointF p1, VPointF p4, qreal angle1, qreal angle2, qreal kAsm1, qreal kAsm2, qreal kCurve,
|
||||||
quint32 idObject = 0, Valentina::Draws mode = Valentina::Calculation);
|
quint32 idObject = 0, Draw mode = Draw::Calculation);
|
||||||
VSpline (VPointF p1, QPointF p2, QPointF p3, VPointF p4, qreal kCurve, quint32 idObject = 0,
|
VSpline (VPointF p1, QPointF p2, QPointF p3, VPointF p4, qreal kCurve, quint32 idObject = 0,
|
||||||
Valentina::Draws mode = Valentina::Calculation);
|
Draw mode = Draw::Calculation);
|
||||||
|
VSpline &operator=(const VSpline &spl);
|
||||||
VPointF GetP1 () const;
|
VPointF GetP1 () const;
|
||||||
QPointF GetP2 () const;
|
QPointF GetP2 () const;
|
||||||
QPointF GetP3 () const;
|
QPointF GetP3 () const;
|
||||||
|
@ -72,7 +70,6 @@ public:
|
||||||
// cppcheck-suppress unusedFunction
|
// cppcheck-suppress unusedFunction
|
||||||
static QVector<QPointF> SplinePoints(const QPointF &p1, const QPointF &p4, qreal angle1, qreal angle2, qreal kAsm1,
|
static QVector<QPointF> SplinePoints(const QPointF &p1, const QPointF &p4, qreal angle1, qreal angle2, qreal kAsm1,
|
||||||
qreal kAsm2, qreal kCurve);
|
qreal kAsm2, qreal kCurve);
|
||||||
VSpline &operator=(const VSpline &spl);
|
|
||||||
protected:
|
protected:
|
||||||
static QVector<QPointF> GetPoints (const QPointF &p1, const QPointF &p2, const QPointF &p3, const QPointF &p4 );
|
static QVector<QPointF> GetPoints (const QPointF &p1, const QPointF &p2, const QPointF &p3, const QPointF &p4 );
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -30,8 +30,8 @@
|
||||||
#include "../exception/vexception.h"
|
#include "../exception/vexception.h"
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
VSplinePath::VSplinePath(qreal kCurve, quint32 idObject, Valentina::Draws mode)
|
VSplinePath::VSplinePath(qreal kCurve, quint32 idObject, Draw mode)
|
||||||
: VGObject(GObject::SplinePath, idObject, mode), path(QVector<VSplinePoint>()), kCurve(kCurve), maxCountPoints(0)
|
: VGObject(GOType::SplinePath, idObject, mode), path(QVector<VSplinePoint>()), kCurve(kCurve), maxCountPoints(0)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
@ -76,8 +76,8 @@ VSpline VSplinePath::GetSpline(qint32 index) const
|
||||||
{
|
{
|
||||||
throw VException(tr("This spline does not exist."));
|
throw VException(tr("This spline does not exist."));
|
||||||
}
|
}
|
||||||
VSpline spl(path[index-1].P(), path[index].P(), path[index-1].Angle2(), path[index].Angle1(),
|
VSpline spl(path.at(index-1).P(), path.at(index).P(), path.at(index-1).Angle2(), path.at(index).Angle1(),
|
||||||
path[index-1].KAsm2(), path[index].KAsm1(), this->kCurve);
|
path.at(index-1).KAsm2(), path.at(index).KAsm1(), this->kCurve);
|
||||||
return spl;
|
return spl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -87,8 +87,8 @@ QPainterPath VSplinePath::GetPath() const
|
||||||
QPainterPath painterPath;
|
QPainterPath painterPath;
|
||||||
for (qint32 i = 1; i <= Count(); ++i)
|
for (qint32 i = 1; i <= Count(); ++i)
|
||||||
{
|
{
|
||||||
VSpline spl(path[i-1].P(), path[i].P(), path[i-1].Angle2(), path[i].Angle1(),
|
VSpline spl(path.at(i-1).P(), path.at(i).P(), path.at(i-1).Angle2(), path.at(i).Angle1(),
|
||||||
path[i-1].KAsm2(), path[i].KAsm1(), this->kCurve);
|
path.at(i-1).KAsm2(), path.at(i).KAsm1(), this->kCurve);
|
||||||
painterPath.addPath(spl.GetPath());
|
painterPath.addPath(spl.GetPath());
|
||||||
}
|
}
|
||||||
return painterPath;
|
return painterPath;
|
||||||
|
@ -100,8 +100,8 @@ QVector<QPointF> VSplinePath::GetPathPoints() const
|
||||||
QVector<QPointF> pathPoints;
|
QVector<QPointF> pathPoints;
|
||||||
for (qint32 i = 1; i <= Count(); ++i)
|
for (qint32 i = 1; i <= Count(); ++i)
|
||||||
{
|
{
|
||||||
VSpline spl(path[i-1].P(), path[i].P(), path[i-1].Angle2(), path[i].Angle1(),
|
VSpline spl(path.at(i-1).P(), path.at(i).P(), path.at(i-1).Angle2(), path.at(i).Angle1(),
|
||||||
path[i-1].KAsm2(), path[i].KAsm1(), this->kCurve);
|
path.at(i-1).KAsm2(), path.at(i).KAsm1(), this->kCurve);
|
||||||
pathPoints += spl.GetPoints();
|
pathPoints += spl.GetPoints();
|
||||||
}
|
}
|
||||||
return pathPoints;
|
return pathPoints;
|
||||||
|
@ -113,21 +113,21 @@ qreal VSplinePath::GetLength() const
|
||||||
qreal length = 0;
|
qreal length = 0;
|
||||||
for (qint32 i = 1; i <= Count(); ++i)
|
for (qint32 i = 1; i <= Count(); ++i)
|
||||||
{
|
{
|
||||||
VSpline spl(path[i-1].P(), path[i].P(), path[i-1].Angle2(), path[i].Angle1(), path[i-1].KAsm2(),
|
VSpline spl(path.at(i-1).P(), path.at(i).P(), path.at(i-1).Angle2(), path.at(i).Angle1(), path.at(i-1).KAsm2(),
|
||||||
path[i].KAsm1(), kCurve);
|
path.at(i).KAsm1(), kCurve);
|
||||||
length += spl.GetLength();
|
length += spl.GetLength();
|
||||||
}
|
}
|
||||||
return length;
|
return length;
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VSplinePath::UpdatePoint(qint32 indexSpline, const SplinePoint::Position &pos, const VSplinePoint &point)
|
void VSplinePath::UpdatePoint(qint32 indexSpline, const SplinePointPosition &pos, const VSplinePoint &point)
|
||||||
{
|
{
|
||||||
if (indexSpline < 1 || indexSpline > Count())
|
if (indexSpline < 1 || indexSpline > Count())
|
||||||
{
|
{
|
||||||
throw VException(tr("This spline does not exist."));
|
throw VException(tr("This spline does not exist."));
|
||||||
}
|
}
|
||||||
if (pos == SplinePoint::FirstPoint)
|
if (pos == SplinePointPosition::FirstPoint)
|
||||||
{
|
{
|
||||||
path[indexSpline-1] = point;
|
path[indexSpline-1] = point;
|
||||||
}
|
}
|
||||||
|
@ -138,13 +138,13 @@ void VSplinePath::UpdatePoint(qint32 indexSpline, const SplinePoint::Position &p
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
VSplinePoint VSplinePath::GetSplinePoint(qint32 indexSpline, SplinePoint::Position pos) const
|
VSplinePoint VSplinePath::GetSplinePoint(qint32 indexSpline, SplinePointPosition pos) const
|
||||||
{
|
{
|
||||||
if (indexSpline < 1 || indexSpline > Count())
|
if (indexSpline < 1 || indexSpline > Count())
|
||||||
{
|
{
|
||||||
throw VException(tr("This spline does not exist."));
|
throw VException(tr("This spline does not exist."));
|
||||||
}
|
}
|
||||||
if (pos == SplinePoint::FirstPoint)
|
if (pos == SplinePointPosition::FirstPoint)
|
||||||
{
|
{
|
||||||
return path.at(indexSpline-1);
|
return path.at(indexSpline-1);
|
||||||
}
|
}
|
||||||
|
@ -199,8 +199,8 @@ QPointF VSplinePath::CutSplinePath(qreal length, qint32 &p1, qint32 &p2, QPointF
|
||||||
fullLength = 0;
|
fullLength = 0;
|
||||||
for (qint32 i = 1; i <= Count(); ++i)
|
for (qint32 i = 1; i <= Count(); ++i)
|
||||||
{
|
{
|
||||||
VSpline spl = VSpline(path[i-1].P(), path[i].P(), path[i-1].Angle2(), path[i].Angle1(), path[i-1].KAsm2(),
|
VSpline spl = VSpline(path.at(i-1).P(), path.at(i).P(), path.at(i-1).Angle2(), path.at(i).Angle1(),
|
||||||
path[i].KAsm1(), kCurve);
|
path.at(i-1).KAsm2(), path.at(i).KAsm1(), kCurve);
|
||||||
fullLength += spl.GetLength();
|
fullLength += spl.GetLength();
|
||||||
if (fullLength > length)
|
if (fullLength > length)
|
||||||
{
|
{
|
||||||
|
|
|
@ -29,22 +29,11 @@
|
||||||
#ifndef VSPLINEPATH_H
|
#ifndef VSPLINEPATH_H
|
||||||
#define VSPLINEPATH_H
|
#define VSPLINEPATH_H
|
||||||
|
|
||||||
#include "vsplinepoint.h"
|
|
||||||
#include "vpointf.h"
|
|
||||||
#include "vspline.h"
|
|
||||||
#include "vgobject.h"
|
#include "vgobject.h"
|
||||||
#include <QApplication>
|
#include "vspline.h"
|
||||||
#include "../container/vcontainer.h"
|
#include "vsplinepoint.h"
|
||||||
|
|
||||||
namespace SplinePoint
|
enum class SplinePointPosition : char { FirstPoint, LastPoint };
|
||||||
{
|
|
||||||
/**
|
|
||||||
* @brief The Position enum position in spline.
|
|
||||||
*/
|
|
||||||
enum Position { FirstPoint, LastPoint };
|
|
||||||
Q_DECLARE_FLAGS(Positions, Position)
|
|
||||||
}
|
|
||||||
Q_DECLARE_OPERATORS_FOR_FLAGS( SplinePoint::Positions )
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief The VSplinePath class keep information about splinePath.
|
* @brief The VSplinePath class keep information about splinePath.
|
||||||
|
@ -59,7 +48,7 @@ public:
|
||||||
* @param idObject parent id.
|
* @param idObject parent id.
|
||||||
* @param mode mode creation spline path.
|
* @param mode mode creation spline path.
|
||||||
*/
|
*/
|
||||||
VSplinePath(qreal kCurve = 1, quint32 idObject = 0, Valentina::Draws mode = Valentina::Calculation);
|
VSplinePath(qreal kCurve = 1, quint32 idObject = 0, Draw mode = Draw::Calculation);
|
||||||
/**
|
/**
|
||||||
* @brief VSplinePath copy constructor.
|
* @brief VSplinePath copy constructor.
|
||||||
* @param splPath spline path.
|
* @param splPath spline path.
|
||||||
|
@ -112,14 +101,14 @@ public:
|
||||||
* @param pos position point in spline.
|
* @param pos position point in spline.
|
||||||
* @param point point.
|
* @param point point.
|
||||||
*/
|
*/
|
||||||
void UpdatePoint(qint32 indexSpline, const SplinePoint::Position &pos, const VSplinePoint &point);
|
void UpdatePoint(qint32 indexSpline, const SplinePointPosition &pos, const VSplinePoint &point);
|
||||||
/**
|
/**
|
||||||
* @brief GetSplinePoint return spline point from list.
|
* @brief GetSplinePoint return spline point from list.
|
||||||
* @param indexSpline spline index in list.
|
* @param indexSpline spline index in list.
|
||||||
* @param pos position point in spline.
|
* @param pos position point in spline.
|
||||||
* @return spline point.
|
* @return spline point.
|
||||||
*/
|
*/
|
||||||
VSplinePoint GetSplinePoint(qint32 indexSpline, SplinePoint::Position pos) const;
|
VSplinePoint GetSplinePoint(qint32 indexSpline, SplinePointPosition pos) const;
|
||||||
/**
|
/**
|
||||||
* @brief Clear clear list of points.
|
* @brief Clear clear list of points.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -29,7 +29,6 @@
|
||||||
#ifndef VSPLINEPOINT_H
|
#ifndef VSPLINEPOINT_H
|
||||||
#define VSPLINEPOINT_H
|
#define VSPLINEPOINT_H
|
||||||
|
|
||||||
#include <QMetaType>
|
|
||||||
#include "vpointf.h"
|
#include "vpointf.h"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -36,6 +36,8 @@
|
||||||
#include "exception/vexceptionwrongid.h"
|
#include "exception/vexceptionwrongid.h"
|
||||||
#include "version.h"
|
#include "version.h"
|
||||||
#include "xml/vstandardmeasurements.h"
|
#include "xml/vstandardmeasurements.h"
|
||||||
|
#include "xml/vindividualmeasurements.h"
|
||||||
|
#include "widgets/vapplication.h"
|
||||||
|
|
||||||
#include <QInputDialog>
|
#include <QInputDialog>
|
||||||
#include <QtCore>
|
#include <QtCore>
|
||||||
|
@ -52,10 +54,10 @@
|
||||||
* @param parent parent widget.
|
* @param parent parent widget.
|
||||||
*/
|
*/
|
||||||
MainWindow::MainWindow(QWidget *parent)
|
MainWindow::MainWindow(QWidget *parent)
|
||||||
:QMainWindow(parent), ui(new Ui::MainWindow), pattern(nullptr), doc(nullptr), tool(Valentina::ArrowTool),
|
:QMainWindow(parent), ui(new Ui::MainWindow), pattern(nullptr), doc(nullptr), tool(Tool::ArrowTool),
|
||||||
currentScene(nullptr), sceneDraw(nullptr), sceneDetails(nullptr), mouseCoordinate(nullptr), helpLabel(nullptr),
|
currentScene(nullptr), sceneDraw(nullptr), sceneDetails(nullptr), mouseCoordinate(nullptr), helpLabel(nullptr),
|
||||||
view(nullptr), isInitialized(false), dialogTable(0), dialogTool(nullptr), dialogHistory(nullptr),
|
view(nullptr), isInitialized(false), dialogTable(0), dialogTool(nullptr), dialogHistory(nullptr),
|
||||||
comboBoxDraws(nullptr), curFile(QString()), mode(Valentina::Calculation), currentDrawIndex(0),
|
comboBoxDraws(nullptr), curFile(QString()), mode(Draw::Calculation), currentDrawIndex(0),
|
||||||
currentToolBoxIndex(0), drawMode(true), recentFileActs{0, 0, 0, 0, 0}, separatorAct(nullptr),
|
currentToolBoxIndex(0), drawMode(true), recentFileActs{0, 0, 0, 0, 0}, separatorAct(nullptr),
|
||||||
autoSaveTimer(nullptr)
|
autoSaveTimer(nullptr)
|
||||||
{
|
{
|
||||||
|
@ -82,6 +84,7 @@ MainWindow::MainWindow(QWidget *parent)
|
||||||
QSizePolicy policy(QSizePolicy::Expanding, QSizePolicy::Expanding);
|
QSizePolicy policy(QSizePolicy::Expanding, QSizePolicy::Expanding);
|
||||||
policy.setHorizontalStretch(12);
|
policy.setHorizontalStretch(12);
|
||||||
view->setSizePolicy(policy);
|
view->setSizePolicy(policy);
|
||||||
|
qApp->setSceneView(view);
|
||||||
helpLabel = new QLabel(QObject::tr("Create new pattern piece to start working."));
|
helpLabel = new QLabel(QObject::tr("Create new pattern piece to start working."));
|
||||||
ui->statusBar->addWidget(helpLabel);
|
ui->statusBar->addWidget(helpLabel);
|
||||||
|
|
||||||
|
@ -89,9 +92,11 @@ MainWindow::MainWindow(QWidget *parent)
|
||||||
|
|
||||||
pattern = new VContainer();
|
pattern = new VContainer();
|
||||||
|
|
||||||
doc = new VPattern(pattern, comboBoxDraws, &mode);
|
doc = new VPattern(pattern, &mode, sceneDraw, sceneDetails);
|
||||||
connect(doc, &VPattern::patternChanged, this, &MainWindow::PatternWasModified);
|
|
||||||
connect(doc, &VPattern::ClearMainWindow, this, &MainWindow::Clear);
|
connect(doc, &VPattern::ClearMainWindow, this, &MainWindow::Clear);
|
||||||
|
connect(doc, &VPattern::UndoCommand, this, &MainWindow::FullParseFile);
|
||||||
|
|
||||||
|
connect(qApp->getUndoStack(), &QUndoStack::cleanChanged, this, &MainWindow::PatternWasModified);
|
||||||
|
|
||||||
InitAutoSave();
|
InitAutoSave();
|
||||||
|
|
||||||
|
@ -104,19 +109,22 @@ MainWindow::MainWindow(QWidget *parent)
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief ActionNewDraw add to scene new pattern peace.
|
* @brief ActionNewPP add to scene new pattern piece.
|
||||||
*/
|
*/
|
||||||
void MainWindow::ActionNewDraw()
|
void MainWindow::ActionNewPP()
|
||||||
{
|
{
|
||||||
QString patternPieceName = QString(tr("Pattern piece %1")).arg(comboBoxDraws->count()+1);
|
QString patternPieceName = QString(tr("Pattern piece %1")).arg(comboBoxDraws->count()+1);
|
||||||
|
QString path;
|
||||||
if (comboBoxDraws->count() == 0)
|
if (comboBoxDraws->count() == 0)
|
||||||
{
|
{
|
||||||
QString path;
|
|
||||||
DialogMeasurements measurements(this);
|
DialogMeasurements measurements(this);
|
||||||
measurements.exec();
|
if (measurements.exec() == QDialog::Rejected)
|
||||||
if (measurements.type() == Measurements::Standard)
|
|
||||||
{
|
{
|
||||||
qApp->setPatternType(Pattern::Standard);
|
return;
|
||||||
|
}
|
||||||
|
if (measurements.type() == MeasurementsType::Standard)
|
||||||
|
{
|
||||||
|
qApp->setPatternType(MeasurementsType::Standard);
|
||||||
DialogStandardMeasurements stMeasurements(pattern, patternPieceName, this);
|
DialogStandardMeasurements stMeasurements(pattern, patternPieceName, this);
|
||||||
if (stMeasurements.exec() == QDialog::Accepted)
|
if (stMeasurements.exec() == QDialog::Accepted)
|
||||||
{
|
{
|
||||||
|
@ -135,7 +143,7 @@ void MainWindow::ActionNewDraw()
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
qApp->setPatternType(Pattern::Individual);
|
qApp->setPatternType(MeasurementsType::Individual);
|
||||||
DialogIndividualMeasurements indMeasurements(pattern, patternPieceName, this);
|
DialogIndividualMeasurements indMeasurements(pattern, patternPieceName, this);
|
||||||
if (indMeasurements.exec() == QDialog::Accepted)
|
if (indMeasurements.exec() == QDialog::Accepted)
|
||||||
{
|
{
|
||||||
|
@ -150,7 +158,6 @@ void MainWindow::ActionNewDraw()
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
doc->CreateEmptyFile(path);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -159,10 +166,11 @@ void MainWindow::ActionNewDraw()
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
path = doc->MPath();
|
||||||
}
|
}
|
||||||
if (doc->appendDraw(patternPieceName) == false)
|
if (doc->appendPP(patternPieceName) == false)
|
||||||
{
|
{
|
||||||
qDebug()<<"Error creating pattern with the name "<<patternPieceName<<".";
|
qDebug()<<"Error creating pattern piece with the name "<<patternPieceName<<".";
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
disconnect(comboBoxDraws, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged),
|
disconnect(comboBoxDraws, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged),
|
||||||
|
@ -173,14 +181,14 @@ void MainWindow::ActionNewDraw()
|
||||||
//Create single point
|
//Create single point
|
||||||
const quint32 id = pattern->AddGObject(new VPointF(qApp->toPixel((10+comboBoxDraws->count()*5)), qApp->toPixel(10),
|
const quint32 id = pattern->AddGObject(new VPointF(qApp->toPixel((10+comboBoxDraws->count()*5)), qApp->toPixel(10),
|
||||||
"А", 5, 10));
|
"А", 5, 10));
|
||||||
VToolSinglePoint *spoint = new VToolSinglePoint(doc, pattern, id, Valentina::FromGui);
|
VToolSinglePoint *spoint = new VToolSinglePoint(doc, pattern, id, Source::FromGui, patternPieceName, path);
|
||||||
sceneDraw->addItem(spoint);
|
sceneDraw->addItem(spoint);
|
||||||
connect(spoint, &VToolPoint::ChoosedTool, sceneDraw, &VMainGraphicsScene::ChoosedItem);
|
connect(spoint, &VToolPoint::ChoosedTool, sceneDraw, &VMainGraphicsScene::ChoosedItem);
|
||||||
connect(sceneDraw, &VMainGraphicsScene::NewFactor, spoint, &VToolSinglePoint::SetFactor);
|
connect(sceneDraw, &VMainGraphicsScene::NewFactor, spoint, &VToolSinglePoint::SetFactor);
|
||||||
QHash<quint32, VDataTool*>* tools = doc->getTools();
|
QHash<quint32, VDataTool*>* tools = doc->getTools();
|
||||||
SCASSERT(tools != nullptr);
|
SCASSERT(tools != nullptr);
|
||||||
tools->insert(id, spoint);
|
tools->insert(id, spoint);
|
||||||
VDrawTool::AddRecord(id, Valentina::SinglePointTool, doc);
|
VDrawTool::AddRecord(id, Tool::SinglePointTool, doc);
|
||||||
SetEnableTool(true);
|
SetEnableTool(true);
|
||||||
SetEnableWidgets(true);
|
SetEnableWidgets(true);
|
||||||
|
|
||||||
|
@ -188,7 +196,10 @@ void MainWindow::ActionNewDraw()
|
||||||
if ( index != -1 )
|
if ( index != -1 )
|
||||||
{ // -1 for not found
|
{ // -1 for not found
|
||||||
comboBoxDraws->setCurrentIndex(index);
|
comboBoxDraws->setCurrentIndex(index);
|
||||||
currentDrawChanged( index );
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
comboBoxDraws->setCurrentIndex(0);
|
||||||
}
|
}
|
||||||
connect(comboBoxDraws, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this,
|
connect(comboBoxDraws, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this,
|
||||||
&MainWindow::currentDrawChanged);
|
&MainWindow::currentDrawChanged);
|
||||||
|
@ -226,7 +237,7 @@ void MainWindow::OptionDraw()
|
||||||
* @param closeDialogSlot function what handle after close dialog.
|
* @param closeDialogSlot function what handle after close dialog.
|
||||||
*/
|
*/
|
||||||
template <typename Dialog, typename Func>
|
template <typename Dialog, typename Func>
|
||||||
void MainWindow::SetToolButton(bool checked, Valentina::Tools t, const QString &cursor, const QString &toolTip,
|
void MainWindow::SetToolButton(bool checked, Tool t, const QString &cursor, const QString &toolTip,
|
||||||
Func closeDialogSlot)
|
Func closeDialogSlot)
|
||||||
{
|
{
|
||||||
if (checked)
|
if (checked)
|
||||||
|
@ -264,7 +275,7 @@ template <typename Dialog, typename Func, typename Func2>
|
||||||
* @param closeDialogSlot function to handle close of dialog.
|
* @param closeDialogSlot function to handle close of dialog.
|
||||||
* @param applyDialogSlot function to handle apply in dialog.
|
* @param applyDialogSlot function to handle apply in dialog.
|
||||||
*/
|
*/
|
||||||
void MainWindow::SetToolButtonWithApply(bool checked, Valentina::Tools t, const QString &cursor, const QString &toolTip,
|
void MainWindow::SetToolButtonWithApply(bool checked, Tool t, const QString &cursor, const QString &toolTip,
|
||||||
Func closeDialogSlot, Func2 applyDialogSlot)
|
Func closeDialogSlot, Func2 applyDialogSlot)
|
||||||
{
|
{
|
||||||
if (checked)
|
if (checked)
|
||||||
|
@ -367,7 +378,7 @@ void MainWindow::ApplyDialog()
|
||||||
*/
|
*/
|
||||||
void MainWindow::ToolEndLine(bool checked)
|
void MainWindow::ToolEndLine(bool checked)
|
||||||
{
|
{
|
||||||
SetToolButtonWithApply<DialogEndLine>(checked, Valentina::EndLineTool, ":/cursor/endline_cursor.png", tr("Select point"),
|
SetToolButtonWithApply<DialogEndLine>(checked, Tool::EndLineTool, ":/cursor/endline_cursor.png", tr("Select point"),
|
||||||
&MainWindow::ClosedDialogEndLine,&MainWindow::ApplyDialogEndLine);
|
&MainWindow::ClosedDialogEndLine,&MainWindow::ApplyDialogEndLine);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -397,7 +408,7 @@ void MainWindow::ClosedDialogEndLine(int result)
|
||||||
*/
|
*/
|
||||||
void MainWindow::ToolLine(bool checked)
|
void MainWindow::ToolLine(bool checked)
|
||||||
{
|
{
|
||||||
SetToolButton<DialogLine>(checked, Valentina::LineTool, ":/cursor/line_cursor.png", tr("Select first point"),
|
SetToolButton<DialogLine>(checked, Tool::LineTool, ":/cursor/line_cursor.png", tr("Select first point"),
|
||||||
&MainWindow::ClosedDialogLine);
|
&MainWindow::ClosedDialogLine);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -418,7 +429,7 @@ void MainWindow::ClosedDialogLine(int result)
|
||||||
*/
|
*/
|
||||||
void MainWindow::ToolAlongLine(bool checked)
|
void MainWindow::ToolAlongLine(bool checked)
|
||||||
{
|
{
|
||||||
SetToolButtonWithApply<DialogAlongLine>(checked, Valentina::AlongLineTool, ":/cursor/alongline_cursor.png",
|
SetToolButtonWithApply<DialogAlongLine>(checked, Tool::AlongLineTool, ":/cursor/alongline_cursor.png",
|
||||||
tr("Select point"), &MainWindow::ClosedDialogAlongLine, &MainWindow::ApplyDialogAlongLine);
|
tr("Select point"), &MainWindow::ClosedDialogAlongLine, &MainWindow::ApplyDialogAlongLine);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -448,7 +459,7 @@ void MainWindow::ClosedDialogAlongLine(int result)
|
||||||
*/
|
*/
|
||||||
void MainWindow::ToolShoulderPoint(bool checked)
|
void MainWindow::ToolShoulderPoint(bool checked)
|
||||||
{
|
{
|
||||||
SetToolButtonWithApply<DialogShoulderPoint>(checked, Valentina::ShoulderPointTool, ":/cursor/shoulder_cursor.png",
|
SetToolButtonWithApply<DialogShoulderPoint>(checked, Tool::ShoulderPointTool, ":/cursor/shoulder_cursor.png",
|
||||||
tr("Select first point of line"), &MainWindow::ClosedDialogShoulderPoint,
|
tr("Select first point of line"), &MainWindow::ClosedDialogShoulderPoint,
|
||||||
&MainWindow::ApplyDialogShoulderPoint);
|
&MainWindow::ApplyDialogShoulderPoint);
|
||||||
}
|
}
|
||||||
|
@ -479,7 +490,7 @@ void MainWindow::ClosedDialogShoulderPoint(int result)
|
||||||
*/
|
*/
|
||||||
void MainWindow::ToolNormal(bool checked)
|
void MainWindow::ToolNormal(bool checked)
|
||||||
{
|
{
|
||||||
SetToolButtonWithApply<DialogNormal>(checked, Valentina::NormalTool, ":/cursor/normal_cursor.png",
|
SetToolButtonWithApply<DialogNormal>(checked, Tool::NormalTool, ":/cursor/normal_cursor.png",
|
||||||
tr("Select first point of line"), &MainWindow::ClosedDialogNormal,
|
tr("Select first point of line"), &MainWindow::ClosedDialogNormal,
|
||||||
&MainWindow::ApplyDialogNormal);
|
&MainWindow::ApplyDialogNormal);
|
||||||
}
|
}
|
||||||
|
@ -510,7 +521,7 @@ void MainWindow::ClosedDialogNormal(int result)
|
||||||
*/
|
*/
|
||||||
void MainWindow::ToolBisector(bool checked)
|
void MainWindow::ToolBisector(bool checked)
|
||||||
{
|
{
|
||||||
SetToolButtonWithApply<DialogBisector>(checked, Valentina::BisectorTool, ":/cursor/bisector_cursor.png",
|
SetToolButtonWithApply<DialogBisector>(checked, Tool::BisectorTool, ":/cursor/bisector_cursor.png",
|
||||||
tr("Select first point of angle"), &MainWindow::ClosedDialogBisector,
|
tr("Select first point of angle"), &MainWindow::ClosedDialogBisector,
|
||||||
&MainWindow::ApplyDialogBisector);
|
&MainWindow::ApplyDialogBisector);
|
||||||
}
|
}
|
||||||
|
@ -541,7 +552,7 @@ void MainWindow::ClosedDialogBisector(int result)
|
||||||
*/
|
*/
|
||||||
void MainWindow::ToolLineIntersect(bool checked)
|
void MainWindow::ToolLineIntersect(bool checked)
|
||||||
{
|
{
|
||||||
SetToolButton<DialogLineIntersect>(checked, Valentina::LineIntersectTool, ":/cursor/intersect_cursor.png",
|
SetToolButton<DialogLineIntersect>(checked, Tool::LineIntersectTool, ":/cursor/intersect_cursor.png",
|
||||||
tr("Select first point of first line"), &MainWindow::ClosedDialogLineIntersect);
|
tr("Select first point of first line"), &MainWindow::ClosedDialogLineIntersect);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -562,7 +573,7 @@ void MainWindow::ClosedDialogLineIntersect(int result)
|
||||||
*/
|
*/
|
||||||
void MainWindow::ToolSpline(bool checked)
|
void MainWindow::ToolSpline(bool checked)
|
||||||
{
|
{
|
||||||
SetToolButton<DialogSpline>(checked, Valentina::SplineTool, ":/cursor/spline_cursor.png",
|
SetToolButton<DialogSpline>(checked, Tool::SplineTool, ":/cursor/spline_cursor.png",
|
||||||
tr("Select first point curve"), &MainWindow::ClosedDialogSpline);
|
tr("Select first point curve"), &MainWindow::ClosedDialogSpline);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -583,7 +594,7 @@ void MainWindow::ClosedDialogSpline(int result)
|
||||||
*/
|
*/
|
||||||
void MainWindow::ToolCutSpline(bool checked)
|
void MainWindow::ToolCutSpline(bool checked)
|
||||||
{
|
{
|
||||||
SetToolButton<DialogCutSpline>(checked, Valentina::CutSplineTool, ":/cursor/spline_cut_point_cursor.png",
|
SetToolButton<DialogCutSpline>(checked, Tool::CutSplineTool, ":/cursor/spline_cut_point_cursor.png",
|
||||||
tr("Select simple curve"), &MainWindow::ClosedDialogCutSpline);
|
tr("Select simple curve"), &MainWindow::ClosedDialogCutSpline);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -604,7 +615,7 @@ void MainWindow::ClosedDialogCutSpline(int result)
|
||||||
*/
|
*/
|
||||||
void MainWindow::ToolArc(bool checked)
|
void MainWindow::ToolArc(bool checked)
|
||||||
{
|
{
|
||||||
SetToolButtonWithApply<DialogArc>(checked, Valentina::ArcTool, ":/cursor/arc_cursor.png",
|
SetToolButtonWithApply<DialogArc>(checked, Tool::ArcTool, ":/cursor/arc_cursor.png",
|
||||||
tr("Select point of center of arc"), &MainWindow::ClosedDialogArc,
|
tr("Select point of center of arc"), &MainWindow::ClosedDialogArc,
|
||||||
&MainWindow::ApplyDialogArc);
|
&MainWindow::ApplyDialogArc);
|
||||||
}
|
}
|
||||||
|
@ -635,7 +646,7 @@ void MainWindow::ClosedDialogArc(int result)
|
||||||
*/
|
*/
|
||||||
void MainWindow::ToolSplinePath(bool checked)
|
void MainWindow::ToolSplinePath(bool checked)
|
||||||
{
|
{
|
||||||
SetToolButton<DialogSplinePath>(checked, Valentina::SplinePathTool, ":/cursor/splinepath_cursor.png",
|
SetToolButton<DialogSplinePath>(checked, Tool::SplinePathTool, ":/cursor/splinepath_cursor.png",
|
||||||
tr("Select point of curve path"), &MainWindow::ClosedDialogSplinePath);
|
tr("Select point of curve path"), &MainWindow::ClosedDialogSplinePath);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -656,7 +667,7 @@ void MainWindow::ClosedDialogSplinePath(int result)
|
||||||
*/
|
*/
|
||||||
void MainWindow::ToolCutSplinePath(bool checked)
|
void MainWindow::ToolCutSplinePath(bool checked)
|
||||||
{
|
{
|
||||||
SetToolButton<DialogCutSplinePath>(checked, Valentina::CutSplinePathTool,
|
SetToolButton<DialogCutSplinePath>(checked, Tool::CutSplinePathTool,
|
||||||
":/cursor/splinepath_cut_point_cursor.png", tr("Select curve path"),
|
":/cursor/splinepath_cut_point_cursor.png", tr("Select curve path"),
|
||||||
&MainWindow::ClosedDialogCutSplinePath);
|
&MainWindow::ClosedDialogCutSplinePath);
|
||||||
}
|
}
|
||||||
|
@ -678,7 +689,7 @@ void MainWindow::ClosedDialogCutSplinePath(int result)
|
||||||
*/
|
*/
|
||||||
void MainWindow::ToolPointOfContact(bool checked)
|
void MainWindow::ToolPointOfContact(bool checked)
|
||||||
{
|
{
|
||||||
SetToolButtonWithApply<DialogPointOfContact>(checked, Valentina::PointOfContact, ":/cursor/pointcontact_cursor.png",
|
SetToolButtonWithApply<DialogPointOfContact>(checked, Tool::PointOfContact, ":/cursor/pointcontact_cursor.png",
|
||||||
tr("Select first point of line"), &MainWindow::ClosedDialogPointOfContact,
|
tr("Select first point of line"), &MainWindow::ClosedDialogPointOfContact,
|
||||||
&MainWindow::ApplyDialogPointOfContact);
|
&MainWindow::ApplyDialogPointOfContact);
|
||||||
}
|
}
|
||||||
|
@ -709,7 +720,7 @@ void MainWindow::ClosedDialogPointOfContact(int result)
|
||||||
*/
|
*/
|
||||||
void MainWindow::ToolDetail(bool checked)
|
void MainWindow::ToolDetail(bool checked)
|
||||||
{
|
{
|
||||||
SetToolButton<DialogDetail>(checked, Valentina::DetailTool, "://cursor/new_detail_cursor.png",
|
SetToolButton<DialogDetail>(checked, Tool::DetailTool, "://cursor/new_detail_cursor.png",
|
||||||
tr("Select points, arcs, curves clockwise."), &MainWindow::ClosedDialogDetail);
|
tr("Select points, arcs, curves clockwise."), &MainWindow::ClosedDialogDetail);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -725,7 +736,7 @@ void MainWindow::ClosedDialogDetail(int result)
|
||||||
VToolDetail::Create(dialogTool, sceneDetails, doc, pattern);
|
VToolDetail::Create(dialogTool, sceneDetails, doc, pattern);
|
||||||
}
|
}
|
||||||
ArrowTool();
|
ArrowTool();
|
||||||
doc->FullUpdateTree();
|
doc->LiteParseTree();
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
@ -735,7 +746,7 @@ void MainWindow::ClosedDialogDetail(int result)
|
||||||
*/
|
*/
|
||||||
void MainWindow::ToolHeight(bool checked)
|
void MainWindow::ToolHeight(bool checked)
|
||||||
{
|
{
|
||||||
SetToolButton<DialogHeight>(checked, Valentina::Height, ":/cursor/height_cursor.png", tr("Select base point"),
|
SetToolButton<DialogHeight>(checked, Tool::Height, ":/cursor/height_cursor.png", tr("Select base point"),
|
||||||
&MainWindow::ClosedDialogHeight);
|
&MainWindow::ClosedDialogHeight);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -756,7 +767,7 @@ void MainWindow::ClosedDialogHeight(int result)
|
||||||
*/
|
*/
|
||||||
void MainWindow::ToolTriangle(bool checked)
|
void MainWindow::ToolTriangle(bool checked)
|
||||||
{
|
{
|
||||||
SetToolButton<DialogTriangle>(checked, Valentina::Triangle, ":/cursor/triangle_cursor.png",
|
SetToolButton<DialogTriangle>(checked, Tool::Triangle, ":/cursor/triangle_cursor.png",
|
||||||
tr("Select first point of axis"), &MainWindow::ClosedDialogTriangle);
|
tr("Select first point of axis"), &MainWindow::ClosedDialogTriangle);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -777,7 +788,7 @@ void MainWindow::ClosedDialogTriangle(int result)
|
||||||
*/
|
*/
|
||||||
void MainWindow::ToolPointOfIntersection(bool checked)
|
void MainWindow::ToolPointOfIntersection(bool checked)
|
||||||
{
|
{
|
||||||
SetToolButton<DialogPointOfIntersection>(checked, Valentina::PointOfIntersection,
|
SetToolButton<DialogPointOfIntersection>(checked, Tool::PointOfIntersection,
|
||||||
":/cursor/pointofintersect_cursor.png", tr("Select point vertically"),
|
":/cursor/pointofintersect_cursor.png", tr("Select point vertically"),
|
||||||
&MainWindow::ClosedDialogPointOfIntersection);
|
&MainWindow::ClosedDialogPointOfIntersection);
|
||||||
}
|
}
|
||||||
|
@ -799,7 +810,7 @@ void MainWindow::ClosedDialogPointOfIntersection(int result)
|
||||||
*/
|
*/
|
||||||
void MainWindow::ToolUnionDetails(bool checked)
|
void MainWindow::ToolUnionDetails(bool checked)
|
||||||
{
|
{
|
||||||
SetToolButton<DialogUnionDetails>(checked, Valentina::UnionDetails, ":/cursor/union_cursor.png",
|
SetToolButton<DialogUnionDetails>(checked, Tool::UnionDetails, ":/cursor/union_cursor.png",
|
||||||
tr("Select detail"), &MainWindow::ClosedDialogUnionDetails);
|
tr("Select detail"), &MainWindow::ClosedDialogUnionDetails);
|
||||||
//Must disconnect this signal here.
|
//Must disconnect this signal here.
|
||||||
disconnect(doc, &VPattern::FullUpdateFromFile, dialogTool, &DialogTool::UpdateList);
|
disconnect(doc, &VPattern::FullUpdateFromFile, dialogTool, &DialogTool::UpdateList);
|
||||||
|
@ -813,7 +824,7 @@ void MainWindow::ToolUnionDetails(bool checked)
|
||||||
void MainWindow::ClosedDialogUnionDetails(int result)
|
void MainWindow::ClosedDialogUnionDetails(int result)
|
||||||
{
|
{
|
||||||
ClosedDialog<VToolUnionDetails>(result);
|
ClosedDialog<VToolUnionDetails>(result);
|
||||||
doc->FullUpdateTree();
|
doc->LiteParseTree();
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
@ -823,7 +834,7 @@ void MainWindow::ClosedDialogUnionDetails(int result)
|
||||||
*/
|
*/
|
||||||
void MainWindow::ToolCutArc(bool checked)
|
void MainWindow::ToolCutArc(bool checked)
|
||||||
{
|
{
|
||||||
SetToolButtonWithApply<DialogCutArc>(checked, Valentina::CutArcTool, ":/cursor/arc_cut_cursor.png",
|
SetToolButtonWithApply<DialogCutArc>(checked, Tool::CutArcTool, ":/cursor/arc_cut_cursor.png",
|
||||||
tr("Select arc"), &MainWindow::ClosedDialogCutArc, &MainWindow::ApplyDialogCutArc);
|
tr("Select arc"), &MainWindow::ClosedDialogCutArc, &MainWindow::ApplyDialogCutArc);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -946,6 +957,7 @@ void MainWindow::closeEvent(QCloseEvent *event)
|
||||||
{
|
{
|
||||||
WriteSettings();
|
WriteSettings();
|
||||||
event->accept();
|
event->accept();
|
||||||
|
qApp->closeAllWindows();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -959,7 +971,7 @@ void MainWindow::closeEvent(QCloseEvent *event)
|
||||||
*/
|
*/
|
||||||
void MainWindow::ToolBarOption()
|
void MainWindow::ToolBarOption()
|
||||||
{
|
{
|
||||||
if (qApp->patternType() == Pattern::Standard)
|
if (qApp->patternType() == MeasurementsType::Standard)
|
||||||
{
|
{
|
||||||
ui->toolBarOption->addWidget(new QLabel(tr("Height: ")));
|
ui->toolBarOption->addWidget(new QLabel(tr("Height: ")));
|
||||||
|
|
||||||
|
@ -1072,8 +1084,8 @@ void MainWindow::currentDrawChanged( int index )
|
||||||
{
|
{
|
||||||
if (index != -1)
|
if (index != -1)
|
||||||
{
|
{
|
||||||
|
doc->ChangeActivPP(comboBoxDraws->itemText(index));
|
||||||
doc->setCurrentData();
|
doc->setCurrentData();
|
||||||
doc->ChangeActivDraw(comboBoxDraws->itemText(index));
|
|
||||||
if (drawMode)
|
if (drawMode)
|
||||||
{
|
{
|
||||||
ArrowTool();
|
ArrowTool();
|
||||||
|
@ -1112,107 +1124,111 @@ void MainWindow::CancelTool()
|
||||||
dialogTool = nullptr;
|
dialogTool = nullptr;
|
||||||
switch ( tool )
|
switch ( tool )
|
||||||
{
|
{
|
||||||
case Valentina::ArrowTool:
|
case Tool::ArrowTool:
|
||||||
ui->actionArrowTool->setChecked(false);
|
ui->actionArrowTool->setChecked(false);
|
||||||
helpLabel->setText("");
|
helpLabel->setText("");
|
||||||
break;
|
break;
|
||||||
case Valentina::SinglePointTool:
|
case Tool::SinglePointTool:
|
||||||
Q_UNREACHABLE();
|
Q_UNREACHABLE();
|
||||||
//Nothing to do here because we can't create this tool from main window.
|
//Nothing to do here because we can't create this tool from main window.
|
||||||
break;
|
break;
|
||||||
case Valentina::EndLineTool:
|
case Tool::EndLineTool:
|
||||||
ui->toolButtonEndLine->setChecked(false);
|
ui->toolButtonEndLine->setChecked(false);
|
||||||
currentScene->setFocus(Qt::OtherFocusReason);
|
currentScene->setFocus(Qt::OtherFocusReason);
|
||||||
currentScene->clearSelection();
|
currentScene->clearSelection();
|
||||||
break;
|
break;
|
||||||
case Valentina::LineTool:
|
case Tool::LineTool:
|
||||||
ui->toolButtonLine->setChecked(false);
|
ui->toolButtonLine->setChecked(false);
|
||||||
currentScene->setFocus(Qt::OtherFocusReason);
|
currentScene->setFocus(Qt::OtherFocusReason);
|
||||||
currentScene->clearFocus();
|
currentScene->clearFocus();
|
||||||
break;
|
break;
|
||||||
case Valentina::AlongLineTool:
|
case Tool::AlongLineTool:
|
||||||
ui->toolButtonAlongLine->setChecked(false);
|
ui->toolButtonAlongLine->setChecked(false);
|
||||||
currentScene->setFocus(Qt::OtherFocusReason);
|
currentScene->setFocus(Qt::OtherFocusReason);
|
||||||
currentScene->clearSelection();
|
currentScene->clearSelection();
|
||||||
break;
|
break;
|
||||||
case Valentina::ShoulderPointTool:
|
case Tool::ShoulderPointTool:
|
||||||
ui->toolButtonShoulderPoint->setChecked(false);
|
ui->toolButtonShoulderPoint->setChecked(false);
|
||||||
currentScene->setFocus(Qt::OtherFocusReason);
|
currentScene->setFocus(Qt::OtherFocusReason);
|
||||||
currentScene->clearSelection();
|
currentScene->clearSelection();
|
||||||
break;
|
break;
|
||||||
case Valentina::NormalTool:
|
case Tool::NormalTool:
|
||||||
ui->toolButtonNormal->setChecked(false);
|
ui->toolButtonNormal->setChecked(false);
|
||||||
currentScene->setFocus(Qt::OtherFocusReason);
|
currentScene->setFocus(Qt::OtherFocusReason);
|
||||||
currentScene->clearSelection();
|
currentScene->clearSelection();
|
||||||
break;
|
break;
|
||||||
case Valentina::BisectorTool:
|
case Tool::BisectorTool:
|
||||||
ui->toolButtonBisector->setChecked(false);
|
ui->toolButtonBisector->setChecked(false);
|
||||||
currentScene->setFocus(Qt::OtherFocusReason);
|
currentScene->setFocus(Qt::OtherFocusReason);
|
||||||
currentScene->clearSelection();
|
currentScene->clearSelection();
|
||||||
break;
|
break;
|
||||||
case Valentina::LineIntersectTool:
|
case Tool::LineIntersectTool:
|
||||||
ui->toolButtonLineIntersect->setChecked(false);
|
ui->toolButtonLineIntersect->setChecked(false);
|
||||||
currentScene->setFocus(Qt::OtherFocusReason);
|
currentScene->setFocus(Qt::OtherFocusReason);
|
||||||
currentScene->clearSelection();
|
currentScene->clearSelection();
|
||||||
break;
|
break;
|
||||||
case Valentina::SplineTool:
|
case Tool::SplineTool:
|
||||||
ui->toolButtonSpline->setChecked(false);
|
ui->toolButtonSpline->setChecked(false);
|
||||||
currentScene->setFocus(Qt::OtherFocusReason);
|
currentScene->setFocus(Qt::OtherFocusReason);
|
||||||
currentScene->clearSelection();
|
currentScene->clearSelection();
|
||||||
break;
|
break;
|
||||||
case Valentina::ArcTool:
|
case Tool::ArcTool:
|
||||||
ui->toolButtonArc->setChecked(false);
|
ui->toolButtonArc->setChecked(false);
|
||||||
currentScene->setFocus(Qt::OtherFocusReason);
|
currentScene->setFocus(Qt::OtherFocusReason);
|
||||||
currentScene->clearSelection();
|
currentScene->clearSelection();
|
||||||
break;
|
break;
|
||||||
case Valentina::SplinePathTool:
|
case Tool::SplinePathTool:
|
||||||
ui->toolButtonSplinePath->setChecked(false);
|
ui->toolButtonSplinePath->setChecked(false);
|
||||||
currentScene->setFocus(Qt::OtherFocusReason);
|
currentScene->setFocus(Qt::OtherFocusReason);
|
||||||
currentScene->clearSelection();
|
currentScene->clearSelection();
|
||||||
break;
|
break;
|
||||||
case Valentina::PointOfContact:
|
case Tool::PointOfContact:
|
||||||
ui->toolButtonPointOfContact->setChecked(false);
|
ui->toolButtonPointOfContact->setChecked(false);
|
||||||
currentScene->setFocus(Qt::OtherFocusReason);
|
currentScene->setFocus(Qt::OtherFocusReason);
|
||||||
currentScene->clearSelection();
|
currentScene->clearSelection();
|
||||||
break;
|
break;
|
||||||
case Valentina::DetailTool:
|
case Tool::DetailTool:
|
||||||
ui->toolButtonNewDetail->setChecked(false);
|
ui->toolButtonNewDetail->setChecked(false);
|
||||||
break;
|
break;
|
||||||
case Valentina::Height:
|
case Tool::Height:
|
||||||
ui->toolButtonHeight->setChecked(false);
|
ui->toolButtonHeight->setChecked(false);
|
||||||
currentScene->setFocus(Qt::OtherFocusReason);
|
currentScene->setFocus(Qt::OtherFocusReason);
|
||||||
currentScene->clearSelection();
|
currentScene->clearSelection();
|
||||||
break;
|
break;
|
||||||
case Valentina::Triangle:
|
case Tool::Triangle:
|
||||||
ui->toolButtonTriangle->setChecked(false);
|
ui->toolButtonTriangle->setChecked(false);
|
||||||
currentScene->setFocus(Qt::OtherFocusReason);
|
currentScene->setFocus(Qt::OtherFocusReason);
|
||||||
currentScene->clearSelection();
|
currentScene->clearSelection();
|
||||||
break;
|
break;
|
||||||
case Valentina::PointOfIntersection:
|
case Tool::PointOfIntersection:
|
||||||
ui->toolButtonPointOfIntersection->setChecked(false);
|
ui->toolButtonPointOfIntersection->setChecked(false);
|
||||||
currentScene->setFocus(Qt::OtherFocusReason);
|
currentScene->setFocus(Qt::OtherFocusReason);
|
||||||
currentScene->clearSelection();
|
currentScene->clearSelection();
|
||||||
break;
|
break;
|
||||||
case Valentina::CutSplineTool:
|
case Tool::CutSplineTool:
|
||||||
ui->toolButtonSplineCutPoint->setChecked(false);
|
ui->toolButtonSplineCutPoint->setChecked(false);
|
||||||
currentScene->setFocus(Qt::OtherFocusReason);
|
currentScene->setFocus(Qt::OtherFocusReason);
|
||||||
currentScene->clearSelection();
|
currentScene->clearSelection();
|
||||||
break;
|
break;
|
||||||
case Valentina::CutSplinePathTool:
|
case Tool::CutSplinePathTool:
|
||||||
ui->toolButtonSplinePathCutPoint->setChecked(false);
|
ui->toolButtonSplinePathCutPoint->setChecked(false);
|
||||||
currentScene->setFocus(Qt::OtherFocusReason);
|
currentScene->setFocus(Qt::OtherFocusReason);
|
||||||
currentScene->clearSelection();
|
currentScene->clearSelection();
|
||||||
break;
|
break;
|
||||||
case Valentina::UnionDetails:
|
case Tool::UnionDetails:
|
||||||
ui->toolButtonUnionDetails->setChecked(false);
|
ui->toolButtonUnionDetails->setChecked(false);
|
||||||
currentScene->setFocus(Qt::OtherFocusReason);
|
currentScene->setFocus(Qt::OtherFocusReason);
|
||||||
currentScene->clearSelection();
|
currentScene->clearSelection();
|
||||||
break;
|
break;
|
||||||
case Valentina::CutArcTool:
|
case Tool::CutArcTool:
|
||||||
ui->toolButtonArcCutPoint->setChecked(false);
|
ui->toolButtonArcCutPoint->setChecked(false);
|
||||||
currentScene->setFocus(Qt::OtherFocusReason);
|
currentScene->setFocus(Qt::OtherFocusReason);
|
||||||
currentScene->clearSelection();
|
currentScene->clearSelection();
|
||||||
break;
|
break;
|
||||||
|
case Tool::NodePoint:
|
||||||
|
case Tool::NodeArc:
|
||||||
|
case Tool::NodeSpline:
|
||||||
|
case Tool::NodeSplinePath:
|
||||||
default:
|
default:
|
||||||
qDebug()<<"Got wrong tool type. Ignored.";
|
qDebug()<<"Got wrong tool type. Ignored.";
|
||||||
break;
|
break;
|
||||||
|
@ -1227,7 +1243,7 @@ void MainWindow::ArrowTool()
|
||||||
{
|
{
|
||||||
CancelTool();
|
CancelTool();
|
||||||
ui->actionArrowTool->setChecked(true);
|
ui->actionArrowTool->setChecked(true);
|
||||||
tool = Valentina::ArrowTool;
|
tool = Tool::ArrowTool;
|
||||||
QCursor cur(Qt::ArrowCursor);
|
QCursor cur(Qt::ArrowCursor);
|
||||||
view->setCursor(cur);
|
view->setCursor(cur);
|
||||||
helpLabel->setText("");
|
helpLabel->setText("");
|
||||||
|
@ -1307,7 +1323,7 @@ void MainWindow::ActionDraw(bool checked)
|
||||||
connect(view, &VMainGraphicsView::NewFactor, sceneDraw, &VMainGraphicsScene::SetFactor);
|
connect(view, &VMainGraphicsView::NewFactor, sceneDraw, &VMainGraphicsScene::SetFactor);
|
||||||
RestoreCurrentScene();
|
RestoreCurrentScene();
|
||||||
|
|
||||||
mode = Valentina::Calculation;
|
mode = Draw::Calculation;
|
||||||
comboBoxDraws->setEnabled(true);
|
comboBoxDraws->setEnabled(true);
|
||||||
comboBoxDraws->setCurrentIndex(currentDrawIndex);//restore current pattern peace
|
comboBoxDraws->setCurrentIndex(currentDrawIndex);//restore current pattern peace
|
||||||
drawMode = true;
|
drawMode = true;
|
||||||
|
@ -1350,7 +1366,7 @@ void MainWindow::ActionDetails(bool checked)
|
||||||
comboBoxDraws->setEnabled(false);
|
comboBoxDraws->setEnabled(false);
|
||||||
|
|
||||||
|
|
||||||
mode = Valentina::Modeling;
|
mode = Draw::Modeling;
|
||||||
SetEnableTool(true);
|
SetEnableTool(true);
|
||||||
currentToolBoxIndex = ui->toolBox->currentIndex();
|
currentToolBoxIndex = ui->toolBox->currentIndex();
|
||||||
ui->toolBox->setCurrentIndex(4);
|
ui->toolBox->setCurrentIndex(4);
|
||||||
|
@ -1488,7 +1504,6 @@ void MainWindow::Clear()
|
||||||
setCurrentFile("");
|
setCurrentFile("");
|
||||||
pattern->Clear();
|
pattern->Clear();
|
||||||
doc->clear();
|
doc->clear();
|
||||||
doc->setPatternModified(false);
|
|
||||||
sceneDraw->clear();
|
sceneDraw->clear();
|
||||||
sceneDetails->clear();
|
sceneDetails->clear();
|
||||||
CancelTool();
|
CancelTool();
|
||||||
|
@ -1499,21 +1514,111 @@ void MainWindow::Clear()
|
||||||
ui->actionZoomIn->setEnabled(false);
|
ui->actionZoomIn->setEnabled(false);
|
||||||
ui->actionZoomOut->setEnabled(false);
|
ui->actionZoomOut->setEnabled(false);
|
||||||
SetEnableTool(false);
|
SetEnableTool(false);
|
||||||
qApp->setPatternUnit(Valentina::Cm);
|
qApp->setPatternUnit(Unit::Cm);
|
||||||
qApp->setPatternType(Pattern::Individual);
|
qApp->setPatternType(MeasurementsType::Individual);
|
||||||
ui->toolBarOption->clear();
|
ui->toolBarOption->clear();
|
||||||
#ifndef QT_NO_CURSOR
|
#ifndef QT_NO_CURSOR
|
||||||
QApplication::restoreOverrideCursor();
|
QApplication::restoreOverrideCursor();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MainWindow::FullParseFile()
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
doc->Parse(Document::FullParse);
|
||||||
|
}
|
||||||
|
catch (const VExceptionObjectError &e)
|
||||||
|
{
|
||||||
|
e.CriticalMessageBox(tr("Error parsing file."), this);
|
||||||
|
Clear();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
catch (const VExceptionConversionError &e)
|
||||||
|
{
|
||||||
|
e.CriticalMessageBox(tr("Error can't convert value."), this);
|
||||||
|
Clear();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
catch (const VExceptionEmptyParameter &e)
|
||||||
|
{
|
||||||
|
e.CriticalMessageBox(tr("Error empty parameter."), this);
|
||||||
|
Clear();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
catch (const VExceptionWrongId &e)
|
||||||
|
{
|
||||||
|
e.CriticalMessageBox(tr("Error wrong id."), this);
|
||||||
|
Clear();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
catch (VException &e)
|
||||||
|
{
|
||||||
|
e.CriticalMessageBox(tr("Error parsing file."), this);
|
||||||
|
Clear();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
catch (const std::bad_alloc &)
|
||||||
|
{
|
||||||
|
#ifndef QT_NO_CURSOR
|
||||||
|
QApplication::restoreOverrideCursor();
|
||||||
|
#endif
|
||||||
|
QMessageBox msgBox;
|
||||||
|
msgBox.setWindowTitle(tr("Error!"));
|
||||||
|
msgBox.setText(tr("Error parsing file."));
|
||||||
|
msgBox.setInformativeText("std::bad_alloc");
|
||||||
|
msgBox.setStandardButtons(QMessageBox::Ok);
|
||||||
|
msgBox.setDefaultButton(QMessageBox::Ok);
|
||||||
|
msgBox.setIcon(QMessageBox::Warning);
|
||||||
|
msgBox.exec();
|
||||||
|
#ifndef QT_NO_CURSOR
|
||||||
|
QApplication::setOverrideCursor(Qt::WaitCursor);
|
||||||
|
#endif
|
||||||
|
Clear();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
QString patternPiece = QString();
|
||||||
|
if (comboBoxDraws->currentIndex() != -1)
|
||||||
|
{
|
||||||
|
patternPiece = comboBoxDraws->itemText(comboBoxDraws->currentIndex());
|
||||||
|
}
|
||||||
|
disconnect(comboBoxDraws, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged),
|
||||||
|
this, &MainWindow::currentDrawChanged);
|
||||||
|
comboBoxDraws->clear();
|
||||||
|
comboBoxDraws->addItems(doc->getPatternPieces());
|
||||||
|
connect(comboBoxDraws, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged),
|
||||||
|
this, &MainWindow::currentDrawChanged);
|
||||||
|
ui->actionPattern_properties->setEnabled(true);
|
||||||
|
|
||||||
|
qint32 index = comboBoxDraws->findText(patternPiece);
|
||||||
|
if ( index != -1 )
|
||||||
|
{ // -1 for not found
|
||||||
|
currentDrawChanged(index);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
currentDrawChanged(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (comboBoxDraws->count() > 0)
|
||||||
|
{
|
||||||
|
SetEnableTool(true);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
SetEnableTool(false);
|
||||||
|
}
|
||||||
|
SetEnableWidgets(true);
|
||||||
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief NewPattern create new empty pattern.
|
* @brief NewPattern create new empty pattern.
|
||||||
*/
|
*/
|
||||||
void MainWindow::NewPattern()
|
void MainWindow::NewPattern()
|
||||||
{
|
{
|
||||||
if (doc->isPatternModified() || curFile.isEmpty() == false)
|
if (this->isWindowModified() || curFile.isEmpty() == false)
|
||||||
{
|
{
|
||||||
QProcess *v = new QProcess(this);
|
QProcess *v = new QProcess(this);
|
||||||
v->startDetached(QCoreApplication::applicationFilePath ());
|
v->startDetached(QCoreApplication::applicationFilePath ());
|
||||||
|
@ -1525,10 +1630,10 @@ void MainWindow::NewPattern()
|
||||||
/**
|
/**
|
||||||
* @brief haveChange enable action save if we have unsaved change.
|
* @brief haveChange enable action save if we have unsaved change.
|
||||||
*/
|
*/
|
||||||
void MainWindow::PatternWasModified()
|
void MainWindow::PatternWasModified(bool saved)
|
||||||
{
|
{
|
||||||
setWindowModified(doc->isPatternModified());
|
setWindowModified(!saved);
|
||||||
ui->actionSave->setEnabled(true);
|
ui->actionSave->setEnabled(!saved);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
@ -1540,7 +1645,7 @@ void MainWindow::ChangedSize(const QString & text)
|
||||||
{
|
{
|
||||||
qint32 size = text.toInt();
|
qint32 size = text.toInt();
|
||||||
pattern->SetSize(size);
|
pattern->SetSize(size);
|
||||||
doc->FullUpdateTree();
|
doc->LiteParseTree();
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
@ -1552,7 +1657,7 @@ void MainWindow::ChangedHeight(const QString &text)
|
||||||
{
|
{
|
||||||
qint32 growth = text.toInt();
|
qint32 growth = text.toInt();
|
||||||
pattern->SetHeight(growth);
|
pattern->SetHeight(growth);
|
||||||
doc->FullUpdateTree();
|
doc->LiteParseTree();
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
@ -1574,7 +1679,7 @@ void MainWindow::SetEnableWidgets(bool enable)
|
||||||
ui->actionHistory->setEnabled(enable);
|
ui->actionHistory->setEnabled(enable);
|
||||||
ui->actionPattern_properties->setEnabled(enable);
|
ui->actionPattern_properties->setEnabled(enable);
|
||||||
ui->actionEdit_pattern_code->setEnabled(enable);
|
ui->actionEdit_pattern_code->setEnabled(enable);
|
||||||
ui->actionZoomIn->setEnabled(enable);
|
ui->actionZoomIn->setEnabled(enable);
|
||||||
ui->actionZoomOut->setEnabled(enable);
|
ui->actionZoomOut->setEnabled(enable);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1671,7 +1776,7 @@ void MainWindow::SetEnableTool(bool enable)
|
||||||
{
|
{
|
||||||
bool drawTools = false;
|
bool drawTools = false;
|
||||||
bool modelingTools = false;
|
bool modelingTools = false;
|
||||||
if (mode == Valentina::Calculation)
|
if (mode == Draw::Calculation)
|
||||||
{
|
{
|
||||||
drawTools = enable;
|
drawTools = enable;
|
||||||
}
|
}
|
||||||
|
@ -1731,6 +1836,7 @@ bool MainWindow::SavePattern(const QString &fileName)
|
||||||
{
|
{
|
||||||
setCurrentFile(fileName);
|
setCurrentFile(fileName);
|
||||||
helpLabel->setText(tr("File saved"));
|
helpLabel->setText(tr("File saved"));
|
||||||
|
qApp->getUndoStack()->clear();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
|
@ -1742,7 +1848,7 @@ bool MainWindow::SavePattern(const QString &fileName)
|
||||||
*/
|
*/
|
||||||
void MainWindow::AutoSavePattern()
|
void MainWindow::AutoSavePattern()
|
||||||
{
|
{
|
||||||
if (curFile.isEmpty() == false && doc->isPatternModified() == true)
|
if (curFile.isEmpty() == false && this->isWindowModified() == true)
|
||||||
{
|
{
|
||||||
QString autofile = curFile +".autosave";
|
QString autofile = curFile +".autosave";
|
||||||
if (SavePattern(autofile) == false)
|
if (SavePattern(autofile) == false)
|
||||||
|
@ -1761,7 +1867,6 @@ void MainWindow::AutoSavePattern()
|
||||||
void MainWindow::setCurrentFile(const QString &fileName)
|
void MainWindow::setCurrentFile(const QString &fileName)
|
||||||
{
|
{
|
||||||
curFile = fileName;
|
curFile = fileName;
|
||||||
doc->setPatternModified(false);
|
|
||||||
setWindowModified(false);
|
setWindowModified(false);
|
||||||
|
|
||||||
QString shownName = strippedName(curFile);
|
QString shownName = strippedName(curFile);
|
||||||
|
@ -1811,6 +1916,20 @@ void MainWindow::ReadSettings()
|
||||||
QSize size = settings.value("size", QSize(1000, 800)).toSize();
|
QSize size = settings.value("size", QSize(1000, 800)).toSize();
|
||||||
resize(size);
|
resize(size);
|
||||||
move(pos);
|
move(pos);
|
||||||
|
|
||||||
|
// Scene antialiasing
|
||||||
|
bool graphOutputValue = settings.value("pattern/graphicalOutput", 1).toBool();
|
||||||
|
view->setRenderHint(QPainter::Antialiasing, graphOutputValue);
|
||||||
|
view->setRenderHint(QPainter::SmoothPixmapTransform, graphOutputValue);
|
||||||
|
|
||||||
|
// Stack limit
|
||||||
|
bool ok = true;
|
||||||
|
qint32 count = settings.value("pattern/undo", 0).toInt(&ok);
|
||||||
|
if (ok == false)
|
||||||
|
{
|
||||||
|
count = 0;
|
||||||
|
}
|
||||||
|
qApp->getUndoStack()->setUndoLimit(count);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
@ -1832,7 +1951,7 @@ void MainWindow::WriteSettings()
|
||||||
*/
|
*/
|
||||||
bool MainWindow::MaybeSave()
|
bool MainWindow::MaybeSave()
|
||||||
{
|
{
|
||||||
if (doc->isPatternModified())
|
if (this->isWindowModified())
|
||||||
{
|
{
|
||||||
QMessageBox::StandardButton ret;
|
QMessageBox::StandardButton ret;
|
||||||
ret = QMessageBox::warning(this, tr("Unsaved change"), tr("The pattern has been modified.\n"
|
ret = QMessageBox::warning(this, tr("Unsaved change"), tr("The pattern has been modified.\n"
|
||||||
|
@ -1861,9 +1980,9 @@ void MainWindow::UpdateRecentFileActions()
|
||||||
|
|
||||||
for (int i = 0; i < numRecentFiles; ++i)
|
for (int i = 0; i < numRecentFiles; ++i)
|
||||||
{
|
{
|
||||||
QString text = QString("&%1 %2").arg(i + 1).arg(strippedName(files[i]));
|
QString text = QString("&%1 %2").arg(i + 1).arg(strippedName(files.at(i)));
|
||||||
recentFileActs[i]->setText(text);
|
recentFileActs[i]->setText(text);
|
||||||
recentFileActs[i]->setData(files[i]);
|
recentFileActs[i]->setData(files.at(i));
|
||||||
recentFileActs[i]->setVisible(true);
|
recentFileActs[i]->setVisible(true);
|
||||||
}
|
}
|
||||||
for (int j = numRecentFiles; j < MaxRecentFiles; ++j)
|
for (int j = numRecentFiles; j < MaxRecentFiles; ++j)
|
||||||
|
@ -1885,6 +2004,21 @@ void MainWindow::CreateMenus()
|
||||||
separatorAct->setSeparator(true);
|
separatorAct->setSeparator(true);
|
||||||
ui->menuFile->insertAction(ui->actionPreferences, separatorAct);
|
ui->menuFile->insertAction(ui->actionPreferences, separatorAct);
|
||||||
UpdateRecentFileActions();
|
UpdateRecentFileActions();
|
||||||
|
|
||||||
|
//Add Undo/Redo actions.
|
||||||
|
QAction *undoAction = qApp->getUndoStack()->createUndoAction(this, tr("&Undo"));
|
||||||
|
undoAction->setShortcuts(QKeySequence::Undo);
|
||||||
|
undoAction->setIcon(QIcon::fromTheme("edit-undo"));
|
||||||
|
ui->menuDrawing->insertAction(ui->actionPattern_properties, undoAction);
|
||||||
|
|
||||||
|
QAction *redoAction = qApp->getUndoStack()->createRedoAction(this, tr("&Redo"));
|
||||||
|
redoAction->setShortcuts(QKeySequence::Redo);
|
||||||
|
redoAction->setIcon(QIcon::fromTheme("edit-redo"));
|
||||||
|
ui->menuDrawing->insertAction(ui->actionPattern_properties, redoAction);
|
||||||
|
|
||||||
|
separatorAct = new QAction(this);
|
||||||
|
separatorAct->setSeparator(true);
|
||||||
|
ui->menuDrawing->insertAction(ui->actionPattern_properties, separatorAct);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
@ -1895,7 +2029,7 @@ void MainWindow::CreateActions()
|
||||||
connect(ui->actionArrowTool, &QAction::triggered, this, &MainWindow::ActionAroowTool);
|
connect(ui->actionArrowTool, &QAction::triggered, this, &MainWindow::ActionAroowTool);
|
||||||
connect(ui->actionDraw, &QAction::triggered, this, &MainWindow::ActionDraw);
|
connect(ui->actionDraw, &QAction::triggered, this, &MainWindow::ActionDraw);
|
||||||
connect(ui->actionDetails, &QAction::triggered, this, &MainWindow::ActionDetails);
|
connect(ui->actionDetails, &QAction::triggered, this, &MainWindow::ActionDetails);
|
||||||
connect(ui->actionNewDraw, &QAction::triggered, this, &MainWindow::ActionNewDraw);
|
connect(ui->actionNewDraw, &QAction::triggered, this, &MainWindow::ActionNewPP);
|
||||||
connect(ui->actionOptionDraw, &QAction::triggered, this, &MainWindow::OptionDraw);
|
connect(ui->actionOptionDraw, &QAction::triggered, this, &MainWindow::OptionDraw);
|
||||||
connect(ui->actionSaveAs, &QAction::triggered, this, &MainWindow::SaveAs);
|
connect(ui->actionSaveAs, &QAction::triggered, this, &MainWindow::SaveAs);
|
||||||
connect(ui->actionSave, &QAction::triggered, this, &MainWindow::Save);
|
connect(ui->actionSave, &QAction::triggered, this, &MainWindow::Save);
|
||||||
|
@ -1927,6 +2061,11 @@ void MainWindow::InitAutoSave()
|
||||||
delete autoSaveTimer;
|
delete autoSaveTimer;
|
||||||
autoSaveTimer = nullptr;
|
autoSaveTimer = nullptr;
|
||||||
|
|
||||||
|
autoSaveTimer = new QTimer(this);
|
||||||
|
autoSaveTimer->setTimerType(Qt::VeryCoarseTimer);
|
||||||
|
connect(autoSaveTimer, &QTimer::timeout, this, &MainWindow::AutoSavePattern);
|
||||||
|
autoSaveTimer->stop();
|
||||||
|
|
||||||
QSettings settings(QSettings::IniFormat, QSettings::UserScope, QApplication::organizationName(),
|
QSettings settings(QSettings::IniFormat, QSettings::UserScope, QApplication::organizationName(),
|
||||||
QApplication::applicationName());
|
QApplication::applicationName());
|
||||||
bool autoSave = settings.value("configuration/autosave/state", 1).toBool();
|
bool autoSave = settings.value("configuration/autosave/state", 1).toBool();
|
||||||
|
@ -1938,12 +2077,10 @@ void MainWindow::InitAutoSave()
|
||||||
{
|
{
|
||||||
autoTime = 5;
|
autoTime = 5;
|
||||||
}
|
}
|
||||||
|
|
||||||
autoSaveTimer = new QTimer(this);
|
|
||||||
autoSaveTimer->setTimerType(Qt::VeryCoarseTimer);
|
|
||||||
connect(autoSaveTimer, &QTimer::timeout, this, &MainWindow::AutoSavePattern);
|
|
||||||
autoSaveTimer->start(autoTime*60000);
|
autoSaveTimer->start(autoTime*60000);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
qApp->setAutoSaveTimer(autoSaveTimer);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
@ -2012,11 +2149,11 @@ void MainWindow::LoadPattern(const QString &fileName)
|
||||||
|
|
||||||
QString text = tr("Measurements use different units than pattern. This pattern required measurements in %1")
|
QString text = tr("Measurements use different units than pattern. This pattern required measurements in %1")
|
||||||
.arg(doc->UnitsToStr(qApp->patternUnit()));
|
.arg(doc->UnitsToStr(qApp->patternUnit()));
|
||||||
if (qApp->patternType() == Pattern::Standard)
|
if (qApp->patternType() == MeasurementsType::Standard)
|
||||||
{
|
{
|
||||||
VStandardMeasurements m(pattern);
|
VStandardMeasurements m(pattern);
|
||||||
m.setContent(path);
|
m.setContent(path);
|
||||||
Valentina::Units mUnit = m.Unit();
|
Unit mUnit = m.MUnit();
|
||||||
if (qApp->patternUnit() != mUnit)
|
if (qApp->patternUnit() != mUnit)
|
||||||
{
|
{
|
||||||
QMessageBox::critical(this, tr("Wrong units."), text);
|
QMessageBox::critical(this, tr("Wrong units."), text);
|
||||||
|
@ -2031,7 +2168,7 @@ void MainWindow::LoadPattern(const QString &fileName)
|
||||||
{
|
{
|
||||||
VIndividualMeasurements m(pattern);
|
VIndividualMeasurements m(pattern);
|
||||||
m.setContent(path);
|
m.setContent(path);
|
||||||
Valentina::Units mUnit = m.Unit();
|
Unit mUnit = m.MUnit();
|
||||||
if (qApp->patternUnit() != mUnit)
|
if (qApp->patternUnit() != mUnit)
|
||||||
{
|
{
|
||||||
QMessageBox::critical(this, tr("Wrong units."), text);
|
QMessageBox::critical(this, tr("Wrong units."), text);
|
||||||
|
@ -2047,101 +2184,20 @@ void MainWindow::LoadPattern(const QString &fileName)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
disconnect(comboBoxDraws, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged),
|
FullParseFile();
|
||||||
this, &MainWindow::currentDrawChanged);
|
|
||||||
try
|
|
||||||
{
|
|
||||||
#ifndef QT_NO_CURSOR
|
|
||||||
QApplication::setOverrideCursor(Qt::WaitCursor);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
doc->Parse(Document::FullParse, sceneDraw, sceneDetails);
|
bool patternModified = this->isWindowModified();
|
||||||
|
|
||||||
#ifndef QT_NO_CURSOR
|
|
||||||
QApplication::restoreOverrideCursor();
|
|
||||||
#endif
|
|
||||||
ui->actionPattern_properties->setEnabled(true);
|
|
||||||
}
|
|
||||||
catch (const VExceptionObjectError &e)
|
|
||||||
{
|
|
||||||
e.CriticalMessageBox(tr("Error parsing file."), this);
|
|
||||||
Clear();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
catch (const VExceptionConversionError &e)
|
|
||||||
{
|
|
||||||
e.CriticalMessageBox(tr("Error can't convert value."), this);
|
|
||||||
Clear();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
catch (const VExceptionEmptyParameter &e)
|
|
||||||
{
|
|
||||||
e.CriticalMessageBox(tr("Error empty parameter."), this);
|
|
||||||
Clear();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
catch (const VExceptionWrongId &e)
|
|
||||||
{
|
|
||||||
e.CriticalMessageBox(tr("Error wrong id."), this);
|
|
||||||
Clear();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
catch (VException &e)
|
|
||||||
{
|
|
||||||
e.CriticalMessageBox(tr("Error parsing file."), this);
|
|
||||||
Clear();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
catch (const std::bad_alloc &)
|
|
||||||
{
|
|
||||||
#ifndef QT_NO_CURSOR
|
|
||||||
QApplication::restoreOverrideCursor();
|
|
||||||
#endif
|
|
||||||
QMessageBox msgBox;
|
|
||||||
msgBox.setWindowTitle(tr("Error!"));
|
|
||||||
msgBox.setText(tr("Error parsing file."));
|
|
||||||
msgBox.setInformativeText("std::bad_alloc");
|
|
||||||
msgBox.setStandardButtons(QMessageBox::Ok);
|
|
||||||
msgBox.setDefaultButton(QMessageBox::Ok);
|
|
||||||
msgBox.setIcon(QMessageBox::Warning);
|
|
||||||
msgBox.exec();
|
|
||||||
#ifndef QT_NO_CURSOR
|
|
||||||
QApplication::setOverrideCursor(Qt::WaitCursor);
|
|
||||||
#endif
|
|
||||||
Clear();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
connect(comboBoxDraws, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged),
|
|
||||||
this, &MainWindow::currentDrawChanged);
|
|
||||||
QString nameDraw = doc->GetNameActivDraw();
|
|
||||||
qint32 index = comboBoxDraws->findText(nameDraw);
|
|
||||||
if ( index != -1 )
|
|
||||||
{ // -1 for not found
|
|
||||||
comboBoxDraws->setCurrentIndex(index);
|
|
||||||
}
|
|
||||||
if (comboBoxDraws->count() > 0)
|
|
||||||
{
|
|
||||||
SetEnableTool(true);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
SetEnableTool(false);
|
|
||||||
}
|
|
||||||
SetEnableWidgets(true);
|
|
||||||
|
|
||||||
bool patternModified = doc->isPatternModified();
|
|
||||||
setCurrentFile(fileName);
|
setCurrentFile(fileName);
|
||||||
if (patternModified)
|
if (patternModified)
|
||||||
{
|
{
|
||||||
//For situation where was fixed wrong formula need return for document status was modified.
|
//For situation where was fixed wrong formula need return for document status was modified.
|
||||||
doc->setPatternModified(patternModified);
|
PatternWasModified(patternModified);
|
||||||
PatternWasModified();
|
|
||||||
}
|
}
|
||||||
helpLabel->setText(tr("File loaded"));
|
helpLabel->setText(tr("File loaded"));
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
QString MainWindow::CheckPathToMeasurements(const QString &path, const Pattern::Measurements &patternType)
|
QString MainWindow::CheckPathToMeasurements(const QString &path, const MeasurementsType &patternType)
|
||||||
{
|
{
|
||||||
QFile table(path);
|
QFile table(path);
|
||||||
if (table.exists() == false)
|
if (table.exists() == false)
|
||||||
|
@ -2158,7 +2214,7 @@ QString MainWindow::CheckPathToMeasurements(const QString &path, const Pattern::
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
QString filter;
|
QString filter;
|
||||||
if (patternType == Pattern::Standard)
|
if (patternType == MeasurementsType::Standard)
|
||||||
{
|
{
|
||||||
filter = tr("Standard measurements (*.vst)");
|
filter = tr("Standard measurements (*.vst)");
|
||||||
}
|
}
|
||||||
|
@ -2174,7 +2230,7 @@ QString MainWindow::CheckPathToMeasurements(const QString &path, const Pattern::
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (patternType == Pattern::Standard)
|
if (patternType == MeasurementsType::Standard)
|
||||||
{
|
{
|
||||||
VDomDocument::ValidateXML("://schema/standard_measurements.xsd", mPath);
|
VDomDocument::ValidateXML("://schema/standard_measurements.xsd", mPath);
|
||||||
}
|
}
|
||||||
|
|
|
@ -60,7 +60,7 @@ public slots:
|
||||||
void ActionAroowTool();
|
void ActionAroowTool();
|
||||||
void ActionDraw(bool checked);
|
void ActionDraw(bool checked);
|
||||||
void ActionDetails(bool checked);
|
void ActionDetails(bool checked);
|
||||||
void ActionNewDraw();
|
void ActionNewPP();
|
||||||
void ActionLayout(bool checked);
|
void ActionLayout(bool checked);
|
||||||
void ActionTable(bool checked);
|
void ActionTable(bool checked);
|
||||||
void ActionHistory(bool checked);
|
void ActionHistory(bool checked);
|
||||||
|
@ -80,7 +80,7 @@ public slots:
|
||||||
void ChangedSize(const QString &text);
|
void ChangedSize(const QString &text);
|
||||||
void ChangedHeight(const QString & text);
|
void ChangedHeight(const QString & text);
|
||||||
|
|
||||||
void PatternWasModified();
|
void PatternWasModified(bool saved);
|
||||||
|
|
||||||
void ToolEndLine(bool checked);
|
void ToolEndLine(bool checked);
|
||||||
void ToolLine(bool checked);
|
void ToolLine(bool checked);
|
||||||
|
@ -137,10 +137,11 @@ public slots:
|
||||||
void ShowToolTip(const QString &toolTip);
|
void ShowToolTip(const QString &toolTip);
|
||||||
void OpenRecentFile();
|
void OpenRecentFile();
|
||||||
void Clear();
|
void Clear();
|
||||||
/**
|
/**
|
||||||
* @brief Edit XML code of pattern
|
* @brief Edit XML code of pattern
|
||||||
*/
|
*/
|
||||||
void EditPatternCode();
|
void EditPatternCode();
|
||||||
|
void FullParseFile();
|
||||||
signals:
|
signals:
|
||||||
/**
|
/**
|
||||||
* @brief ModelChosen emit after calculation all details.
|
* @brief ModelChosen emit after calculation all details.
|
||||||
|
@ -164,7 +165,7 @@ private:
|
||||||
VPattern *doc;
|
VPattern *doc;
|
||||||
|
|
||||||
/** @brief tool current tool */
|
/** @brief tool current tool */
|
||||||
Valentina::Tools tool;
|
Tool tool;
|
||||||
|
|
||||||
/** @brief currentScene pointer to current scene. */
|
/** @brief currentScene pointer to current scene. */
|
||||||
VMainGraphicsScene *currentScene;
|
VMainGraphicsScene *currentScene;
|
||||||
|
@ -198,7 +199,7 @@ private:
|
||||||
QString curFile;
|
QString curFile;
|
||||||
|
|
||||||
/** @brief mode keep current draw mode. */
|
/** @brief mode keep current draw mode. */
|
||||||
Valentina::Draws mode;
|
Draw mode;
|
||||||
|
|
||||||
/** @brief currentDrawIndex save current selected pattern peace. */
|
/** @brief currentDrawIndex save current selected pattern peace. */
|
||||||
qint32 currentDrawIndex;
|
qint32 currentDrawIndex;
|
||||||
|
@ -226,10 +227,10 @@ private:
|
||||||
void MinimumScrollBar();
|
void MinimumScrollBar();
|
||||||
|
|
||||||
template <typename Dialog, typename Func>
|
template <typename Dialog, typename Func>
|
||||||
void SetToolButton(bool checked, Valentina::Tools t, const QString &cursor, const QString &toolTip,
|
void SetToolButton(bool checked, Tool t, const QString &cursor, const QString &toolTip,
|
||||||
Func closeDialogSlot);
|
Func closeDialogSlot);
|
||||||
template <typename Dialog, typename Func, typename Func2>
|
template <typename Dialog, typename Func, typename Func2>
|
||||||
void SetToolButtonWithApply(bool checked, Valentina::Tools t, const QString &cursor, const QString &toolTip,
|
void SetToolButtonWithApply(bool checked, Tool t, const QString &cursor, const QString &toolTip,
|
||||||
Func closeDialogSlot, Func2 applyDialogSlot);
|
Func closeDialogSlot, Func2 applyDialogSlot);
|
||||||
template <typename DrawTool>
|
template <typename DrawTool>
|
||||||
void ClosedDialog(int result);
|
void ClosedDialog(int result);
|
||||||
|
@ -249,7 +250,7 @@ private:
|
||||||
void CreateActions();
|
void CreateActions();
|
||||||
void InitAutoSave();
|
void InitAutoSave();
|
||||||
QString PatternPieceName(const QString &text);
|
QString PatternPieceName(const QString &text);
|
||||||
QString CheckPathToMeasurements(const QString &path, const Pattern::Measurements &patternType);
|
QString CheckPathToMeasurements(const QString &path, const MeasurementsType &patternType);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // MAINWINDOW_H
|
#endif // MAINWINDOW_H
|
||||||
|
|
|
@ -27,6 +27,7 @@
|
||||||
*************************************************************************/
|
*************************************************************************/
|
||||||
|
|
||||||
#include "options.h"
|
#include "options.h"
|
||||||
|
#include <QString>
|
||||||
|
|
||||||
// Keep synchronize all names with initialization in VApllication class.
|
// Keep synchronize all names with initialization in VApllication class.
|
||||||
//measurements
|
//measurements
|
||||||
|
|
|
@ -29,93 +29,50 @@
|
||||||
#ifndef OPTIONS_H
|
#ifndef OPTIONS_H
|
||||||
#define OPTIONS_H
|
#define OPTIONS_H
|
||||||
|
|
||||||
#include <QFlags>
|
|
||||||
#include <QString>
|
|
||||||
#include <QMetaType>
|
|
||||||
#include <QtGlobal>
|
|
||||||
#include <csignal>
|
#include <csignal>
|
||||||
|
|
||||||
#ifdef Q_OS_WIN32
|
#ifdef Q_OS_WIN32
|
||||||
#include <Windows.h>
|
# include <Windows.h>
|
||||||
#endif /*Q_OS_WIN32*/
|
#endif /*Q_OS_WIN32*/
|
||||||
|
|
||||||
|
class QString;
|
||||||
|
|
||||||
#define SceneSize 50000
|
#define SceneSize 50000
|
||||||
|
|
||||||
namespace Valentina
|
enum class SceneObject : char { Point, Line, Spline, Arc, SplinePath, Detail };
|
||||||
|
enum class Tool : char
|
||||||
{
|
{
|
||||||
/**
|
ArrowTool,
|
||||||
* @brief The Scene enum
|
SinglePointTool,
|
||||||
*/
|
EndLineTool,
|
||||||
enum Scene { Point, Line, Spline, Arc, SplinePath, Detail };
|
LineTool,
|
||||||
Q_DECLARE_FLAGS(Scenes, Scene)
|
AlongLineTool,
|
||||||
|
ShoulderPointTool,
|
||||||
|
NormalTool,
|
||||||
|
BisectorTool,
|
||||||
|
LineIntersectTool,
|
||||||
|
SplineTool,
|
||||||
|
CutSplineTool,
|
||||||
|
CutArcTool,
|
||||||
|
ArcTool,
|
||||||
|
SplinePathTool,
|
||||||
|
CutSplinePathTool,
|
||||||
|
PointOfContact,
|
||||||
|
DetailTool,
|
||||||
|
NodePoint,
|
||||||
|
NodeArc,
|
||||||
|
NodeSpline,
|
||||||
|
NodeSplinePath,
|
||||||
|
Height,
|
||||||
|
Triangle,
|
||||||
|
PointOfIntersection,
|
||||||
|
UnionDetails
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
enum class Source : char { FromGui, FromFile, FromTool };
|
||||||
* @brief The Tool enum
|
enum class Draw : char { Calculation, Modeling };
|
||||||
*/
|
enum class Unit : char { Mm, Cm, Inch };
|
||||||
enum Tool
|
enum class MeasurementsType : char { Standard, Individual };
|
||||||
{
|
|
||||||
ArrowTool,
|
|
||||||
SinglePointTool,
|
|
||||||
EndLineTool,
|
|
||||||
LineTool,
|
|
||||||
AlongLineTool,
|
|
||||||
ShoulderPointTool,
|
|
||||||
NormalTool,
|
|
||||||
BisectorTool,
|
|
||||||
LineIntersectTool,
|
|
||||||
SplineTool,
|
|
||||||
CutSplineTool,
|
|
||||||
CutArcTool,
|
|
||||||
ArcTool,
|
|
||||||
SplinePathTool,
|
|
||||||
CutSplinePathTool,
|
|
||||||
PointOfContact,
|
|
||||||
DetailTool,
|
|
||||||
NodePoint,
|
|
||||||
NodeArc,
|
|
||||||
NodeSpline,
|
|
||||||
NodeSplinePath,
|
|
||||||
Height,
|
|
||||||
Triangle,
|
|
||||||
PointOfIntersection,
|
|
||||||
UnionDetails
|
|
||||||
};
|
|
||||||
Q_DECLARE_FLAGS(Tools, Tool)
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief The Source enum
|
|
||||||
*/
|
|
||||||
enum Source { FromGui, FromFile, FromTool };
|
|
||||||
Q_DECLARE_FLAGS(Sources, Source)
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief The Draw enum
|
|
||||||
*/
|
|
||||||
enum Draw { Calculation, Modeling };
|
|
||||||
Q_DECLARE_FLAGS(Draws, Draw)
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief The Unit enum
|
|
||||||
*/
|
|
||||||
enum Unit { Mm, Cm, Inch };
|
|
||||||
Q_DECLARE_FLAGS(Units, Unit)
|
|
||||||
}
|
|
||||||
Q_DECLARE_OPERATORS_FOR_FLAGS( Valentina::Scenes )
|
|
||||||
Q_DECLARE_OPERATORS_FOR_FLAGS( Valentina::Tools )
|
|
||||||
Q_DECLARE_OPERATORS_FOR_FLAGS( Valentina::Sources )
|
|
||||||
Q_DECLARE_OPERATORS_FOR_FLAGS( Valentina::Draws )
|
|
||||||
Q_DECLARE_OPERATORS_FOR_FLAGS( Valentina::Units )
|
|
||||||
Q_DECLARE_METATYPE(Valentina::Unit)
|
|
||||||
|
|
||||||
namespace Pattern
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* @brief The Scene enum
|
|
||||||
*/
|
|
||||||
enum Measurement { Standard, Individual };
|
|
||||||
Q_DECLARE_FLAGS(Measurements, Measurement)
|
|
||||||
}
|
|
||||||
Q_DECLARE_OPERATORS_FOR_FLAGS( Pattern::Measurements )
|
|
||||||
|
|
||||||
// measurements
|
// measurements
|
||||||
extern const QString headGirth_M;
|
extern const QString headGirth_M;
|
||||||
|
|
Binary file not shown.
After Width: | Height: | Size: 1.2 KiB |
Binary file not shown.
After Width: | Height: | Size: 1.2 KiB |
BIN
src/app/share/resources/icons/win.icon.theme/24x24/actions/edit-redo.png
Executable file
BIN
src/app/share/resources/icons/win.icon.theme/24x24/actions/edit-redo.png
Executable file
Binary file not shown.
After Width: | Height: | Size: 1.3 KiB |
BIN
src/app/share/resources/icons/win.icon.theme/24x24/actions/edit-undo.png
Executable file
BIN
src/app/share/resources/icons/win.icon.theme/24x24/actions/edit-undo.png
Executable file
Binary file not shown.
After Width: | Height: | Size: 1.3 KiB |
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user