Use C++11 strongly typed enumerations.
--HG-- branch : feature
This commit is contained in:
parent
77a160452a
commit
37d2dd667f
|
@ -151,7 +151,7 @@ qreal Calculator::EvalFormula(const QString &formula)
|
|||
void Calculator::InitVariables(const VContainer *data)
|
||||
{
|
||||
int num = 0;
|
||||
if (qApp->patternType() == Pattern::Standard)
|
||||
if (qApp->patternType() == MeasurementsType::Standard)
|
||||
{
|
||||
num +=2;
|
||||
}
|
||||
|
@ -177,7 +177,7 @@ void Calculator::InitVariables(const VContainer *data)
|
|||
vVarVal = new qreal[num];
|
||||
int j = 0;
|
||||
|
||||
if (qApp->patternType() == Pattern::Standard)
|
||||
if (qApp->patternType() == MeasurementsType::Standard)
|
||||
{
|
||||
vVarVal[j] = data->size();
|
||||
DefineVar(data->SizeName(), &vVarVal[j]);
|
||||
|
@ -236,7 +236,7 @@ void Calculator::InitVariables(const VContainer *data)
|
|||
QHash<QString, VMeasurement>::const_iterator i = measurements->constBegin();
|
||||
while (i != measurements->constEnd())
|
||||
{
|
||||
if (qApp->patternType() == Pattern::Standard)
|
||||
if (qApp->patternType() == MeasurementsType::Standard)
|
||||
{
|
||||
vVarVal[j] = i.value().GetValue(data->size(), data->height());
|
||||
}
|
||||
|
@ -254,7 +254,7 @@ void Calculator::InitVariables(const VContainer *data)
|
|||
QHash<QString, VIncrement>::const_iterator i = increments->constBegin();
|
||||
while (i != increments->constEnd())
|
||||
{
|
||||
if (qApp->patternType() == Pattern::Standard)
|
||||
if (qApp->patternType() == MeasurementsType::Standard)
|
||||
{
|
||||
vVarVal[j] = i.value().GetValue(data->size(), data->height());
|
||||
}
|
||||
|
@ -294,12 +294,12 @@ qreal Calculator::CmUnit(qreal val)
|
|||
qreal unit = val;
|
||||
switch(qApp->patternUnit())
|
||||
{
|
||||
case Valentina::Mm:
|
||||
case Unit::Mm:
|
||||
unit = val * 10.0;
|
||||
break;
|
||||
case Valentina::Cm:
|
||||
case Unit::Cm:
|
||||
break;
|
||||
case Valentina::Inch:
|
||||
case Unit::Inch:
|
||||
unit = val / 2.54;
|
||||
break;
|
||||
default:
|
||||
|
@ -315,12 +315,12 @@ qreal Calculator::MmUnit(qreal val)
|
|||
qreal unit = val;
|
||||
switch(qApp->patternUnit())
|
||||
{
|
||||
case Valentina::Mm:
|
||||
case Unit::Mm:
|
||||
break;
|
||||
case Valentina::Cm:
|
||||
case Unit::Cm:
|
||||
unit = val / 10.0;
|
||||
break;
|
||||
case Valentina::Inch:
|
||||
case Unit::Inch:
|
||||
unit = val / 25.4;
|
||||
break;
|
||||
default:
|
||||
|
@ -336,13 +336,13 @@ qreal Calculator::InchUnit(qreal val)
|
|||
qreal unit = val;
|
||||
switch(qApp->patternUnit())
|
||||
{
|
||||
case Valentina::Mm:
|
||||
case Unit::Mm:
|
||||
unit = val * 25.4;
|
||||
break;
|
||||
case Valentina::Cm:
|
||||
case Unit::Cm:
|
||||
unit = val * 2.54;
|
||||
break;
|
||||
case Valentina::Inch:
|
||||
case Unit::Inch:
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
|
|
@ -100,16 +100,16 @@ void VContainer::setData(const VContainer &data)
|
|||
i.next();
|
||||
switch (i.value()->getType())
|
||||
{
|
||||
case (GObject::Arc):
|
||||
case (GOType::Arc):
|
||||
CopyGObject<VArc>(data, i.key());
|
||||
break;
|
||||
case (GObject::Point):
|
||||
case (GOType::Point):
|
||||
CopyGObject<VPointF>(data, i.key());
|
||||
break;
|
||||
case (GObject::Spline):
|
||||
case (GOType::Spline):
|
||||
CopyGObject<VSpline>(data, i.key());
|
||||
break;
|
||||
case (GObject::SplinePath):
|
||||
case (GOType::SplinePath):
|
||||
CopyGObject<VSplinePath>(data, i.key());
|
||||
break;
|
||||
default:
|
||||
|
@ -386,7 +386,7 @@ void VContainer::AddLineAngle(const QString &name, const qreal &value)
|
|||
qreal VContainer::GetValueStandardTableRow(const QString& name) const
|
||||
{
|
||||
const VMeasurement m = GetMeasurement(name);
|
||||
if (qApp->patternType() == Pattern::Individual)
|
||||
if (qApp->patternType() == MeasurementsType::Individual)
|
||||
{
|
||||
return m.GetValue();
|
||||
}
|
||||
|
@ -405,7 +405,7 @@ qreal VContainer::GetValueStandardTableRow(const QString& name) const
|
|||
qreal VContainer::GetValueIncrementTableRow(const QString& name) const
|
||||
{
|
||||
const VIncrement icr = GetIncrement(name);
|
||||
if (qApp->patternType() == Pattern::Individual)
|
||||
if (qApp->patternType() == MeasurementsType::Individual)
|
||||
{
|
||||
return icr.GetValue();
|
||||
}
|
||||
|
@ -454,7 +454,7 @@ void VContainer::ClearCalculationGObjects()
|
|||
while (i.hasNext())
|
||||
{
|
||||
i.next();
|
||||
if (i.value()->getMode() == Valentina::Calculation)
|
||||
if (i.value()->getMode() == Draw::Calculation)
|
||||
{
|
||||
delete i.value();
|
||||
gObjects.remove(i.key());
|
||||
|
|
|
@ -213,22 +213,22 @@ QString DialogHistory::Record(const VToolRecord &tool)
|
|||
{
|
||||
switch ( tool.getTypeTool() )
|
||||
{
|
||||
case Valentina::ArrowTool:
|
||||
case Tool::ArrowTool:
|
||||
Q_UNREACHABLE();
|
||||
break;
|
||||
case Valentina::SinglePointTool:
|
||||
case Tool::SinglePointTool:
|
||||
{
|
||||
const QString name = data->GeometricObject<const VPointF *>(tool.getId())->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 QString basePointIdName = data->GeometricObject<const VPointF *>(basePointId)->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);
|
||||
}
|
||||
case Valentina::LineTool:
|
||||
case Tool::LineTool:
|
||||
{
|
||||
const quint32 firstPointId = doc->GetParametrUInt(domElement, VAbstractTool::AttrFirstPoint, "0");
|
||||
const quint32 secondPointId = doc->GetParametrUInt(domElement, VAbstractTool::AttrSecondPoint, "0");
|
||||
|
@ -236,7 +236,7 @@ QString DialogHistory::Record(const VToolRecord &tool)
|
|||
const QString secondPointIdName = data->GeometricObject<const VPointF *>(secondPointId)->name();
|
||||
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 secondPointId = doc->GetParametrUInt(domElement, VAbstractTool::AttrSecondPoint, "0");
|
||||
|
@ -245,12 +245,12 @@ QString DialogHistory::Record(const VToolRecord &tool)
|
|||
const QString toolIdName = data->GeometricObject<const VPointF *>(tool.getId())->name();
|
||||
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();
|
||||
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 secondPointId = doc->GetParametrUInt(domElement, VAbstractTool::AttrSecondPoint, "0");
|
||||
|
@ -259,7 +259,7 @@ QString DialogHistory::Record(const VToolRecord &tool)
|
|||
const QString toolIdName = data->GeometricObject<const VPointF *>(tool.getId())->name();
|
||||
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 secondPointId = doc->GetParametrUInt(domElement, VAbstractTool::AttrSecondPoint, "0");
|
||||
|
@ -271,7 +271,7 @@ QString DialogHistory::Record(const VToolRecord &tool)
|
|||
return QString(tr("%4 - bisector of angle %1_%2_%3")).arg(firstPointIdName, secondPointIdName,
|
||||
thirdPointIdName, toolIdName);
|
||||
}
|
||||
case Valentina::LineIntersectTool:
|
||||
case Tool::LineIntersectTool:
|
||||
{
|
||||
const quint32 p1Line1 = doc->GetParametrUInt(domElement, VAbstractTool::AttrP1Line1, "0");
|
||||
const quint32 p2Line1 = doc->GetParametrUInt(domElement, VAbstractTool::AttrP2Line1, "0");
|
||||
|
@ -286,7 +286,7 @@ QString DialogHistory::Record(const VToolRecord &tool)
|
|||
p1Line2Name, p2Line2Name,
|
||||
toolIdName);
|
||||
}
|
||||
case Valentina::SplineTool:
|
||||
case Tool::SplineTool:
|
||||
{
|
||||
const VSpline *spl = data->GeometricObject<const VSpline *>(tool.getId());
|
||||
SCASSERT(spl != nullptr);
|
||||
|
@ -294,14 +294,14 @@ QString DialogHistory::Record(const VToolRecord &tool)
|
|||
const QString splP4Name = data->GeometricObject<const VPointF *>(spl->GetP4().id())->name();
|
||||
return QString(tr("Curve %1_%2")).arg(splP1Name, splP4Name);
|
||||
}
|
||||
case Valentina::ArcTool:
|
||||
case Tool::ArcTool:
|
||||
{
|
||||
const VArc *arc = data->GeometricObject<const VArc *>(tool.getId());
|
||||
SCASSERT(arc != nullptr);
|
||||
const QString arcCenterName = data->GeometricObject<const VArc *>(arc->GetCenter().id())->name();
|
||||
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());
|
||||
SCASSERT(splPath != nullptr);
|
||||
|
@ -324,7 +324,7 @@ QString DialogHistory::Record(const VToolRecord &tool)
|
|||
}
|
||||
return record;
|
||||
}
|
||||
case Valentina::PointOfContact:
|
||||
case Tool::PointOfContact:
|
||||
{
|
||||
const quint32 center = doc->GetParametrUInt(domElement, VAbstractTool::AttrCenter, "0");
|
||||
const quint32 firstPointId = doc->GetParametrUInt(domElement, VAbstractTool::AttrFirstPoint, "0");
|
||||
|
@ -336,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(
|
||||
centerName, firstPointIdName, secondPointIdName, toolIdName);
|
||||
}
|
||||
case Valentina::Height:
|
||||
case Tool::Height:
|
||||
{
|
||||
const quint32 basePointId = doc->GetParametrUInt(domElement, VAbstractTool::AttrBasePoint, "0");
|
||||
const quint32 p1LineId = doc->GetParametrUInt(domElement, VAbstractTool::AttrP1Line, "0");
|
||||
|
@ -348,7 +348,7 @@ QString DialogHistory::Record(const VToolRecord &tool)
|
|||
p1LineIdName,
|
||||
p2LineIdName);
|
||||
}
|
||||
case Valentina::Triangle:
|
||||
case Tool::Triangle:
|
||||
{
|
||||
const quint32 axisP1Id = doc->GetParametrUInt(domElement, VAbstractTool::AttrAxisP1, "0");
|
||||
const quint32 axisP2Id = doc->GetParametrUInt(domElement, VAbstractTool::AttrAxisP2, "0");
|
||||
|
@ -361,7 +361,7 @@ QString DialogHistory::Record(const VToolRecord &tool)
|
|||
return QString(tr("Triangle: axis %1_%2, points %3 and %4")).arg(axisP1IdName, axisP2IdName,
|
||||
firstPointIdName, secondPointIdName);
|
||||
}
|
||||
case Valentina::PointOfIntersection:
|
||||
case Tool::PointOfIntersection:
|
||||
{
|
||||
const quint32 firstPointId = doc->GetParametrUInt(domElement, VAbstractTool::AttrFirstPoint, "0");
|
||||
const quint32 secondPointId = doc->GetParametrUInt(domElement, VAbstractTool::AttrSecondPoint, "0");
|
||||
|
@ -371,7 +371,7 @@ QString DialogHistory::Record(const VToolRecord &tool)
|
|||
return QString(tr("%1 - point of intersection %2 and %3")).arg(toolIdName, firstPointIdName,
|
||||
secondPointIdName);
|
||||
}
|
||||
case Valentina::CutArcTool:
|
||||
case Tool::CutArcTool:
|
||||
{
|
||||
const quint32 arcId = doc->GetParametrUInt(domElement, VToolCutArc::AttrArc, "0");
|
||||
const VArc *arc = data->GeometricObject<const VArc *>(arcId);
|
||||
|
@ -380,7 +380,7 @@ QString DialogHistory::Record(const VToolRecord &tool)
|
|||
const QString toolIdName = data->GeometricObject<const VPointF *>(tool.getId())->name();
|
||||
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 VSpline *spl = data->GeometricObject<const VSpline *>(splineId);
|
||||
|
@ -390,7 +390,7 @@ QString DialogHistory::Record(const VToolRecord &tool)
|
|||
const QString splP4Name = data->GeometricObject<const VPointF *>(spl->GetP4().id())->name();
|
||||
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 VSplinePath *splPath = data->GeometricObject<const VSplinePath *>(splinePathId);
|
||||
|
@ -418,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
|
||||
//piece, we need add record about details and nodes, but don't show them.
|
||||
case Valentina::DetailTool:
|
||||
case Tool::DetailTool:
|
||||
break;
|
||||
case Valentina::UnionDetails:
|
||||
case Tool::UnionDetails:
|
||||
break;
|
||||
case Valentina::NodeArc:
|
||||
case Tool::NodeArc:
|
||||
break;
|
||||
case Valentina::NodePoint:
|
||||
case Tool::NodePoint:
|
||||
break;
|
||||
case Valentina::NodeSpline:
|
||||
case Tool::NodeSpline:
|
||||
break;
|
||||
case Valentina::NodeSplinePath:
|
||||
case Tool::NodeSplinePath:
|
||||
break;
|
||||
default:
|
||||
qDebug()<<"Got wrong tool type. Ignore.";
|
||||
|
|
|
@ -50,7 +50,7 @@ DialogIncrements::DialogIncrements(VContainer *data, VPattern *doc, QWidget *par
|
|||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
if (qApp->patternType() == Pattern::Individual)
|
||||
if (qApp->patternType() == MeasurementsType::Individual)
|
||||
{
|
||||
const QString filePath = doc->MPath();
|
||||
try
|
||||
|
@ -82,7 +82,7 @@ DialogIncrements::DialogIncrements(VContainer *data, VPattern *doc, QWidget *par
|
|||
FillLengthSplines();
|
||||
FillLengthArcs();
|
||||
|
||||
if (qApp->patternType() == Pattern::Standard)
|
||||
if (qApp->patternType() == MeasurementsType::Standard)
|
||||
{
|
||||
ui->pagePersonalInformation->setVisible(false);
|
||||
}
|
||||
|
@ -106,8 +106,8 @@ DialogIncrements::DialogIncrements(VContainer *data, VPattern *doc, QWidget *par
|
|||
ui->lineEditGivenName->setText(m->GivenName());
|
||||
ui->lineEditFamilyName->setText(m->FamilyName());
|
||||
|
||||
ui->comboBoxSex->addItem(tr("male"), QVariant(m->GenderToStr(VIndividualMeasurements::Male)));
|
||||
ui->comboBoxSex->addItem(tr("female"), QVariant(m->GenderToStr(VIndividualMeasurements::Female)));
|
||||
ui->comboBoxSex->addItem(tr("male"), QVariant(m->GenderToStr(SexType::Male)));
|
||||
ui->comboBoxSex->addItem(tr("female"), QVariant(m->GenderToStr(SexType::Female)));
|
||||
qint32 index = ui->comboBoxSex->findData(m->GenderToStr(m->Sex()));
|
||||
if (index != -1)
|
||||
{
|
||||
|
@ -175,7 +175,7 @@ void DialogIncrements::FillMeasurements()
|
|||
item->setTextAlignment(Qt::AlignLeft);
|
||||
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())));
|
||||
item->setTextAlignment(Qt::AlignHCenter);
|
||||
|
@ -190,7 +190,7 @@ void DialogIncrements::FillMeasurements()
|
|||
item->setTextAlignment(Qt::AlignHCenter);
|
||||
ui->tableWidgetMeasurements->setItem(currentRow, 2, item);
|
||||
|
||||
if (qApp->patternType() == Pattern::Standard)
|
||||
if (qApp->patternType() == MeasurementsType::Standard)
|
||||
{
|
||||
QTableWidgetItem *item = new QTableWidgetItem(QString().setNum(m.GetKsize()));
|
||||
item->setTextAlignment(Qt::AlignHCenter);
|
||||
|
@ -255,7 +255,7 @@ void DialogIncrements::FillIncrements()
|
|||
item->setData(Qt::UserRole, incr.getId());
|
||||
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->setTextAlignment(Qt::AlignHCenter);
|
||||
|
@ -270,7 +270,7 @@ void DialogIncrements::FillIncrements()
|
|||
item->setTextAlignment(Qt::AlignHCenter);
|
||||
ui->tableWidgetIncrement->setItem(currentRow, 2, item);
|
||||
|
||||
if (qApp->patternType() == Pattern::Standard)
|
||||
if (qApp->patternType() == MeasurementsType::Standard)
|
||||
{
|
||||
item = new QTableWidgetItem(QString().setNum(incr.getKsize()));
|
||||
item->setTextAlignment(Qt::AlignHCenter);
|
||||
|
@ -493,7 +493,7 @@ void DialogIncrements::OpenTable()
|
|||
{
|
||||
QString text = tr("Measurements use different units than pattern. This pattern required measurements in %1")
|
||||
.arg(doc->UnitsToStr(qApp->patternUnit()));
|
||||
if (qApp->patternType() == Pattern::Individual)
|
||||
if (qApp->patternType() == MeasurementsType::Individual)
|
||||
{
|
||||
const QString filter(tr("Individual measurements (*.vit)"));
|
||||
const QString filePath = QFileDialog::getOpenFileName(this, tr("Open file"), QDir::homePath(), filter);
|
||||
|
@ -517,7 +517,7 @@ void DialogIncrements::OpenTable()
|
|||
emit DialogClosed(QDialog::Rejected);
|
||||
return;
|
||||
}
|
||||
Valentina::Units mUnit = m1->Unit();
|
||||
Unit mUnit = m1->MUnit();
|
||||
if (qApp->patternUnit() != mUnit)
|
||||
{
|
||||
QMessageBox::critical(this, tr("Wrong units."), text);
|
||||
|
@ -549,7 +549,7 @@ void DialogIncrements::OpenTable()
|
|||
|
||||
m1 = new VStandardMeasurements(data);
|
||||
m1->setContent(filePath);
|
||||
Valentina::Units mUnit = m1->Unit();
|
||||
Unit mUnit = m1->MUnit();
|
||||
if (qApp->patternUnit() != mUnit)
|
||||
{
|
||||
QMessageBox::critical(this, tr("Wrong units."), text);
|
||||
|
|
|
@ -103,9 +103,9 @@ void DialogIndividualMeasurements::DialogAccepted()
|
|||
VIndividualMeasurements m(data);
|
||||
m.setContent(_tablePath);
|
||||
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);
|
||||
qApp->setPatternUnit( m.Unit());
|
||||
qApp->setPatternUnit( m.MUnit());
|
||||
QFile iMeasur(_tablePath);
|
||||
if (iMeasur.open(QIODevice::WriteOnly| QIODevice::Truncate))
|
||||
{
|
||||
|
@ -236,6 +236,6 @@ void DialogIndividualMeasurements::NewTable()
|
|||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogIndividualMeasurements::InitUnits()
|
||||
{
|
||||
ui->comboBoxUnits->addItem(tr("centimeter"), QVariant(VDomDocument::UnitsToStr(Valentina::Cm)));
|
||||
ui->comboBoxUnits->addItem(tr("inch"), QVariant(VDomDocument::UnitsToStr(Valentina::Inch)));
|
||||
ui->comboBoxUnits->addItem(tr("centimeter"), QVariant(VDomDocument::UnitsToStr(Unit::Cm)));
|
||||
ui->comboBoxUnits->addItem(tr("inch"), QVariant(VDomDocument::UnitsToStr(Unit::Inch)));
|
||||
}
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
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);
|
||||
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;
|
||||
}
|
||||
|
@ -53,13 +53,13 @@ Measurements::Type DialogMeasurements::type() const
|
|||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogMeasurements::StandardMeasurements()
|
||||
{
|
||||
result = Measurements::Standard;
|
||||
result = MeasurementsType::Standard;
|
||||
accept();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogMeasurements::IndividualMeasurements()
|
||||
{
|
||||
result = Measurements::Individual;
|
||||
result = MeasurementsType::Individual;
|
||||
accept();
|
||||
}
|
||||
|
|
|
@ -30,33 +30,24 @@
|
|||
#define DIALOGMEASUREMENTS_H
|
||||
|
||||
#include <QDialog>
|
||||
#include "../../options.h"
|
||||
|
||||
namespace Ui
|
||||
{
|
||||
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
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit DialogMeasurements(QWidget *parent = nullptr);
|
||||
~DialogMeasurements();
|
||||
Measurements::Type type() const;
|
||||
MeasurementsType type() const;
|
||||
private:
|
||||
Q_DISABLE_COPY(DialogMeasurements)
|
||||
Ui::DialogMeasurements *ui;
|
||||
Measurements::Type result;
|
||||
MeasurementsType result;
|
||||
void StandardMeasurements();
|
||||
void IndividualMeasurements();
|
||||
};
|
||||
|
|
|
@ -89,7 +89,7 @@ void DialogStandardMeasurements::DialogAccepted()
|
|||
VDomDocument::ValidateXML("://schema/standard_measurements.xsd", _tablePath);
|
||||
VStandardMeasurements m(data);
|
||||
m.setContent(_tablePath);
|
||||
qApp->setPatternUnit(m.Unit());
|
||||
qApp->setPatternUnit(m.MUnit());
|
||||
}
|
||||
catch (VException &e)
|
||||
{
|
||||
|
|
|
@ -108,9 +108,9 @@ DialogAlongLine::~DialogAlongLine()
|
|||
* @param id id of point or detail
|
||||
* @param type type of object
|
||||
*/
|
||||
void DialogAlongLine::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
||||
void DialogAlongLine::ChoosedObject(quint32 id, const SceneObject &type)
|
||||
{
|
||||
if (type == Valentina::Point)
|
||||
if (type == SceneObject::Point)
|
||||
{
|
||||
if (number == 0)
|
||||
{
|
||||
|
|
|
@ -61,7 +61,7 @@ public:
|
|||
quint32 getSecondPointId() const;
|
||||
void setSecondPointId(const quint32 &value, const quint32 &id);
|
||||
public slots:
|
||||
virtual void ChoosedObject(quint32 id, const Valentina::Scenes &type);
|
||||
virtual void ChoosedObject(quint32 id, const SceneObject &type);
|
||||
virtual void DialogAccepted();
|
||||
/**
|
||||
* @brief DialogApply apply data and emit signal about applied dialog.
|
||||
|
|
|
@ -163,9 +163,9 @@ void DialogArc::SetRadius(const QString &value)
|
|||
* @param id id of point or detail
|
||||
* @param type type of object
|
||||
*/
|
||||
void DialogArc::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
||||
void DialogArc::ChoosedObject(quint32 id, const SceneObject &type)
|
||||
{
|
||||
if (type == Valentina::Point)
|
||||
if (type == SceneObject::Point)
|
||||
{
|
||||
const VPointF *point = data->GeometricObject<const VPointF *>(id);
|
||||
|
||||
|
|
|
@ -59,7 +59,7 @@ public:
|
|||
QString GetF2() const;
|
||||
void SetF2(const QString &value);
|
||||
public slots:
|
||||
virtual void ChoosedObject(quint32 id, const Valentina::Scenes &type);
|
||||
virtual void ChoosedObject(quint32 id, const SceneObject &type);
|
||||
virtual void DialogAccepted();
|
||||
/** TODO ISSUE 79 : create real function
|
||||
* @brief DialogApply apply data and emit signal about applied dialog.
|
||||
|
|
|
@ -110,9 +110,9 @@ DialogBisector::~DialogBisector()
|
|||
* @param id id of point or detail
|
||||
* @param type type of object
|
||||
*/
|
||||
void DialogBisector::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
||||
void DialogBisector::ChoosedObject(quint32 id, const SceneObject &type)
|
||||
{
|
||||
if (type == Valentina::Point)
|
||||
if (type == SceneObject::Point)
|
||||
{
|
||||
const VPointF *point = data->GeometricObject<const VPointF *>(id);
|
||||
if (number == 0)
|
||||
|
|
|
@ -66,7 +66,7 @@ public:
|
|||
quint32 getThirdPointId() const;
|
||||
void setThirdPointId(const quint32 &value, const quint32 &id);
|
||||
public slots:
|
||||
virtual void ChoosedObject(quint32 id, const Valentina::Scenes &type);
|
||||
virtual void ChoosedObject(quint32 id, const SceneObject &type);
|
||||
virtual void DialogAccepted();
|
||||
/**
|
||||
* @brief DialogApply apply data and emit signal about applied dialog.
|
||||
|
|
|
@ -106,9 +106,9 @@ DialogCutArc::~DialogCutArc()
|
|||
* @param id id of point or detail
|
||||
* @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);
|
||||
ChangeCurrentText(ui->comboBoxArc, arc->name());
|
||||
|
@ -150,7 +150,7 @@ void DialogCutArc::SaveData()
|
|||
*/
|
||||
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;
|
||||
void setArcId(const quint32 &value, const quint32 &id);
|
||||
public slots:
|
||||
virtual void ChoosedObject(quint32 id, const Valentina::Scenes &type);
|
||||
virtual void ChoosedObject(quint32 id, const SceneObject &type);
|
||||
virtual void DialogAccepted();
|
||||
/**
|
||||
* @brief DialogApply apply data and emit signal about applied dialog.
|
||||
|
|
|
@ -98,7 +98,7 @@ void DialogCutSpline::setFormula(const QString &value)
|
|||
*/
|
||||
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);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
|
@ -107,9 +107,9 @@ void DialogCutSpline::setSplineId(const quint32 &value, const quint32 &id)
|
|||
* @param id id of point or detail
|
||||
* @param type type of object
|
||||
*/
|
||||
void DialogCutSpline::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
||||
void DialogCutSpline::ChoosedObject(quint32 id, const SceneObject &type)
|
||||
{
|
||||
if (type == Valentina::Spline)
|
||||
if (type == SceneObject::Spline)
|
||||
{
|
||||
const VSpline *spl = data->GeometricObject<const VSpline *>(id);
|
||||
ChangeCurrentText(ui->comboBoxSpline, spl->name());
|
||||
|
|
|
@ -55,7 +55,7 @@ public:
|
|||
quint32 getSplineId() const;
|
||||
void setSplineId(const quint32 &value, const quint32 &id);
|
||||
public slots:
|
||||
virtual void ChoosedObject(quint32 id, const Valentina::Scenes &type);
|
||||
virtual void ChoosedObject(quint32 id, const SceneObject &type);
|
||||
virtual void DialogAccepted();
|
||||
/** TODO ISSUE 79 : create real function
|
||||
* @brief DialogApply apply data and emit signal about applied dialog.
|
||||
|
|
|
@ -99,7 +99,7 @@ void DialogCutSplinePath::setFormula(const QString &value)
|
|||
*/
|
||||
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);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
|
@ -108,9 +108,9 @@ void DialogCutSplinePath::setSplinePathId(const quint32 &value, const quint32 &i
|
|||
* @param id id of point or detail
|
||||
* @param type type of object
|
||||
*/
|
||||
void DialogCutSplinePath::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
||||
void DialogCutSplinePath::ChoosedObject(quint32 id, const SceneObject &type)
|
||||
{
|
||||
if (type == Valentina::SplinePath)
|
||||
if (type == SceneObject::SplinePath)
|
||||
{
|
||||
const VSplinePath *splPath = data->GeometricObject<const VSplinePath *>(id);
|
||||
ChangeCurrentText(ui->comboBoxSplinePath, splPath->name());
|
||||
|
|
|
@ -55,7 +55,7 @@ public:
|
|||
quint32 getSplinePathId() const;
|
||||
void setSplinePathId(const quint32 &value, const quint32 &id);
|
||||
public slots:
|
||||
virtual void ChoosedObject(quint32 id, const Valentina::Scenes &type);
|
||||
virtual void ChoosedObject(quint32 id, const SceneObject &type);
|
||||
virtual void DialogAccepted();
|
||||
/** TODO ISSUE 79 : create real function
|
||||
* @brief DialogApply apply data and emit signal about applied dialog.
|
||||
|
|
|
@ -78,24 +78,26 @@ DialogDetail::DialogDetail(const VContainer *data, QWidget *parent)
|
|||
* @param id id of objects (points, arcs, splines, spline paths)
|
||||
* @param type type of object
|
||||
*/
|
||||
void DialogDetail::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
||||
void DialogDetail::ChoosedObject(quint32 id, const SceneObject &type)
|
||||
{
|
||||
if (type != Valentina::Line && type != Valentina::Detail)
|
||||
if (type != SceneObject::Line && type != SceneObject::Detail)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case (Valentina::Arc):
|
||||
NewItem(id, Valentina::NodeArc, NodeDetail::Contour);
|
||||
case (SceneObject::Arc):
|
||||
NewItem(id, Tool::NodeArc, NodeDetail::Contour);
|
||||
break;
|
||||
case (Valentina::Point):
|
||||
NewItem(id, Valentina::NodePoint, NodeDetail::Contour);
|
||||
case (SceneObject::Point):
|
||||
NewItem(id, Tool::NodePoint, NodeDetail::Contour);
|
||||
break;
|
||||
case (Valentina::Spline):
|
||||
NewItem(id, Valentina::NodeSpline, NodeDetail::Contour);
|
||||
case (SceneObject::Spline):
|
||||
NewItem(id, Tool::NodeSpline, NodeDetail::Contour);
|
||||
break;
|
||||
case (Valentina::SplinePath):
|
||||
NewItem(id, Valentina::NodeSplinePath, NodeDetail::Contour);
|
||||
case (SceneObject::SplinePath):
|
||||
NewItem(id, Tool::NodeSplinePath, NodeDetail::Contour);
|
||||
break;
|
||||
case (SceneObject::Line):
|
||||
case (SceneObject::Detail):
|
||||
default:
|
||||
qDebug()<<tr("Got wrong scene object. Ignore.");
|
||||
break;
|
||||
|
@ -134,36 +136,57 @@ void DialogDetail::DialogAccepted()
|
|||
* @param mx offset respect to x
|
||||
* @param my offset respect to y
|
||||
*/
|
||||
void DialogDetail::NewItem(quint32 id, const Valentina::Tools &typeTool, const NodeDetail::NodeDetails &typeNode,
|
||||
void DialogDetail::NewItem(quint32 id, const Tool &typeTool, const NodeDetail &typeNode,
|
||||
qreal mx, qreal my)
|
||||
{
|
||||
QString name;
|
||||
switch (typeTool)
|
||||
{
|
||||
case (Valentina::NodePoint):
|
||||
case (Tool::NodePoint):
|
||||
{
|
||||
const VPointF *point = data->GeometricObject<const VPointF *>(id);
|
||||
name = point->name();
|
||||
break;
|
||||
}
|
||||
case (Valentina::NodeArc):
|
||||
case (Tool::NodeArc):
|
||||
{
|
||||
const VArc *arc = data->GeometricObject<const VArc *>(id);
|
||||
name = arc->name();
|
||||
break;
|
||||
}
|
||||
case (Valentina::NodeSpline):
|
||||
case (Tool::NodeSpline):
|
||||
{
|
||||
const VSpline *spl = data->GeometricObject<const VSpline *>(id);
|
||||
name = spl->name();
|
||||
break;
|
||||
}
|
||||
case (Valentina::NodeSplinePath):
|
||||
case (Tool::NodeSplinePath):
|
||||
{
|
||||
const VSplinePath *splPath = data->GeometricObject<const VSplinePath *>(id);
|
||||
name = splPath->name();
|
||||
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:
|
||||
qDebug()<<"Got wrong tools. Ignore.";
|
||||
break;
|
||||
|
|
|
@ -45,7 +45,7 @@ public:
|
|||
VDetail getDetails() const;
|
||||
void setDetails(const VDetail &value);
|
||||
public slots:
|
||||
virtual void ChoosedObject(quint32 id, const Valentina::Scenes &type);
|
||||
virtual void ChoosedObject(quint32 id, const SceneObject &type);
|
||||
virtual void DialogAccepted();
|
||||
/** TODO ISSUE 79 : create real function
|
||||
* @brief DialogApply apply data and emit signal about applied dialog.
|
||||
|
@ -71,7 +71,7 @@ private:
|
|||
/** @brief closed keep option about equdistant (closed or not) */
|
||||
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);
|
||||
};
|
||||
|
||||
|
|
|
@ -104,9 +104,9 @@ void DialogEndLine::DeployFormulaTextEdit()
|
|||
* @param id id of point or detail
|
||||
* @param type type of object
|
||||
*/
|
||||
void DialogEndLine::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
||||
void DialogEndLine::ChoosedObject(quint32 id, const SceneObject &type)
|
||||
{
|
||||
if (type == Valentina::Point)
|
||||
if (type == SceneObject::Point)
|
||||
{
|
||||
const VPointF *point = data->GeometricObject<const VPointF *>(id);
|
||||
ChangeCurrentText(ui->comboBoxBasePoint, point->name());
|
||||
|
|
|
@ -63,7 +63,7 @@ public:
|
|||
quint32 getBasePointId() const;
|
||||
void setBasePointId(const quint32 &value, const quint32 &id);
|
||||
public slots:
|
||||
virtual void ChoosedObject(quint32 id, const Valentina::Scenes &type);
|
||||
virtual void ChoosedObject(quint32 id, const SceneObject &type);
|
||||
virtual void DialogAccepted();
|
||||
/**
|
||||
* @brief DialogApply apply data and emit signal about applied dialog.
|
||||
|
|
|
@ -125,9 +125,9 @@ void DialogHeight::setP2LineId(const quint32 &value, const quint32 &id)
|
|||
* @param id id of point or detail
|
||||
* @param type type of object
|
||||
*/
|
||||
void DialogHeight::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
||||
void DialogHeight::ChoosedObject(quint32 id, const SceneObject &type)
|
||||
{
|
||||
if (type == Valentina::Point)
|
||||
if (type == SceneObject::Point)
|
||||
{
|
||||
const VPointF *point = data->GeometricObject<const VPointF *>(id);
|
||||
switch (number)
|
||||
|
|
|
@ -61,7 +61,7 @@ public:
|
|||
quint32 getP2LineId() const;
|
||||
void setP2LineId(const quint32 &value, const quint32 &id);
|
||||
public slots:
|
||||
virtual void ChoosedObject(quint32 id, const Valentina::Scenes &type);
|
||||
virtual void ChoosedObject(quint32 id, const SceneObject &type);
|
||||
virtual void DialogAccepted();
|
||||
/** TODO ISSUE 79 : create real function
|
||||
* @brief DialogApply apply data and emit signal about applied dialog.
|
||||
|
|
|
@ -120,9 +120,9 @@ void DialogLine::DialogAccepted()
|
|||
* @param id id of point or detail
|
||||
* @param type type of object
|
||||
*/
|
||||
void DialogLine::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
||||
void DialogLine::ChoosedObject(quint32 id, const SceneObject &type)
|
||||
{
|
||||
if (type == Valentina::Point)
|
||||
if (type == SceneObject::Point)
|
||||
{
|
||||
const VPointF *point = data->GeometricObject<const VPointF *>(id);
|
||||
if (number == 0)
|
||||
|
|
|
@ -55,7 +55,7 @@ public:
|
|||
QString getTypeLine() const;
|
||||
void setTypeLine(const QString &value);
|
||||
public slots:
|
||||
virtual void ChoosedObject(quint32 id, const Valentina::Scenes &type);
|
||||
virtual void ChoosedObject(quint32 id, const SceneObject &type);
|
||||
virtual void DialogAccepted();
|
||||
/** TODO ISSUE 79 : create real function
|
||||
* @brief DialogApply apply data and emit signal about applied dialog.
|
||||
|
|
|
@ -68,9 +68,9 @@ DialogLineIntersect::~DialogLineIntersect()
|
|||
* @param id id of point or detail
|
||||
* @param type type of object
|
||||
*/
|
||||
void DialogLineIntersect::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
||||
void DialogLineIntersect::ChoosedObject(quint32 id, const SceneObject &type)
|
||||
{
|
||||
if (type == Valentina::Point)
|
||||
if (type == SceneObject::Point)
|
||||
{
|
||||
const VPointF *point = data->GeometricObject<const VPointF *>(id);
|
||||
if (number == 0)
|
||||
|
|
|
@ -61,7 +61,7 @@ public:
|
|||
QString getPointName() const;
|
||||
void setPointName(const QString &value);
|
||||
public slots:
|
||||
virtual void ChoosedObject(quint32 id, const Valentina::Scenes &type);
|
||||
virtual void ChoosedObject(quint32 id, const SceneObject &type);
|
||||
virtual void DialogAccepted();
|
||||
/** TODO ISSUE 79 : create real function
|
||||
* @brief DialogApply apply data and emit signal about applied dialog.
|
||||
|
|
|
@ -105,9 +105,9 @@ DialogNormal::~DialogNormal()
|
|||
* @param id id of point or detail
|
||||
* @param type type of object
|
||||
*/
|
||||
void DialogNormal::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
||||
void DialogNormal::ChoosedObject(quint32 id, const SceneObject &type)
|
||||
{
|
||||
if (type == Valentina::Point)
|
||||
if (type == SceneObject::Point)
|
||||
{
|
||||
if (number == 0)
|
||||
{
|
||||
|
|
|
@ -65,7 +65,7 @@ public:
|
|||
quint32 getSecondPointId() const;
|
||||
void setSecondPointId(const quint32 &value, const quint32 &id);
|
||||
public slots:
|
||||
virtual void ChoosedObject(quint32 id, const Valentina::Scenes &type);
|
||||
virtual void ChoosedObject(quint32 id, const SceneObject &type);
|
||||
virtual void DialogAccepted();
|
||||
/**
|
||||
* @brief DialogApply apply data and emit signal about applied dialog.
|
||||
|
|
|
@ -78,7 +78,7 @@ DialogPointOfContact::DialogPointOfContact(const VContainer *data, QWidget *pare
|
|||
connect(ui->listWidget, &QListWidget::itemDoubleClicked, this, &DialogPointOfContact::PutVal);
|
||||
connect(ui->listWidget, &QListWidget::currentRowChanged, this, &DialogPointOfContact::ValChenged);
|
||||
|
||||
if (qApp->patternType() == Pattern::Standard)
|
||||
if (qApp->patternType() == MeasurementsType::Standard)
|
||||
{
|
||||
SizeHeight();
|
||||
connect(ui->radioButtonSizeGrowth, &QRadioButton::clicked, this, &DialogTool::SizeHeight);
|
||||
|
@ -133,9 +133,9 @@ void DialogPointOfContact::DeployFormulaTextEdit()
|
|||
* @param id id of point or detail
|
||||
* @param type type of object
|
||||
*/
|
||||
void DialogPointOfContact::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
||||
void DialogPointOfContact::ChoosedObject(quint32 id, const SceneObject &type)
|
||||
{
|
||||
if (type == Valentina::Point)
|
||||
if (type == SceneObject::Point)
|
||||
{
|
||||
const VPointF *point = data->GeometricObject<const VPointF *>(id);
|
||||
if (number == 0)
|
||||
|
|
|
@ -61,7 +61,7 @@ public:
|
|||
quint32 getSecondPoint() const;
|
||||
void setSecondPoint(const quint32 &value, const quint32 &id);
|
||||
public slots:
|
||||
virtual void ChoosedObject(quint32 id, const Valentina::Scenes &type);
|
||||
virtual void ChoosedObject(quint32 id, const SceneObject &type);
|
||||
virtual void DialogAccepted();
|
||||
/**
|
||||
* @brief DialogApply apply data and emit signal about applied dialog.
|
||||
|
|
|
@ -78,9 +78,9 @@ void DialogPointOfIntersection::setSecondPointId(const quint32 &value, const qui
|
|||
* @param id id of point or detail
|
||||
* @param type type of object
|
||||
*/
|
||||
void DialogPointOfIntersection::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
||||
void DialogPointOfIntersection::ChoosedObject(quint32 id, const SceneObject &type)
|
||||
{
|
||||
if (type == Valentina::Point)
|
||||
if (type == SceneObject::Point)
|
||||
{
|
||||
const VPointF *point = data->GeometricObject<const VPointF *>(id);
|
||||
if (number == 0)
|
||||
|
|
|
@ -55,7 +55,7 @@ public:
|
|||
quint32 getSecondPointId() const;
|
||||
void setSecondPointId(const quint32 &value, const quint32 &id);
|
||||
public slots:
|
||||
virtual void ChoosedObject(quint32 id, const Valentina::Scenes &type);
|
||||
virtual void ChoosedObject(quint32 id, const SceneObject &type);
|
||||
virtual void DialogAccepted();
|
||||
/** TODO ISSUE 79 : create real function
|
||||
* @brief DialogApply apply data and emit signal about applied dialog.
|
||||
|
|
|
@ -110,9 +110,9 @@ DialogShoulderPoint::~DialogShoulderPoint()
|
|||
* @param id id of point or detail
|
||||
* @param type type of object
|
||||
*/
|
||||
void DialogShoulderPoint::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
||||
void DialogShoulderPoint::ChoosedObject(quint32 id, const SceneObject &type)
|
||||
{
|
||||
if (type == Valentina::Point)
|
||||
if (type == SceneObject::Point)
|
||||
{
|
||||
const VPointF *point = data->GeometricObject<const VPointF *>(id);
|
||||
if (number == 0)
|
||||
|
|
|
@ -65,7 +65,7 @@ public:
|
|||
quint32 getPShoulder() const;
|
||||
void setPShoulder(const quint32 &value, const quint32 &id);
|
||||
public slots:
|
||||
virtual void ChoosedObject(quint32 id, const Valentina::Scenes &type);
|
||||
virtual void ChoosedObject(quint32 id, const SceneObject &type);
|
||||
virtual void DialogAccepted();
|
||||
/**
|
||||
* @brief DialogApply apply data and emit signal about applied dialog.
|
||||
|
|
|
@ -71,9 +71,9 @@ quint32 DialogSpline::getP1() const
|
|||
* @param id id of point or detail
|
||||
* @param type type of object
|
||||
*/
|
||||
void DialogSpline::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
||||
void DialogSpline::ChoosedObject(quint32 id, const SceneObject &type)
|
||||
{
|
||||
if (type == Valentina::Point)
|
||||
if (type == SceneObject::Point)
|
||||
{
|
||||
const VPointF *point = data->GeometricObject<const VPointF *>(id);
|
||||
if (number == 0)
|
||||
|
|
|
@ -67,7 +67,7 @@ public:
|
|||
qreal getKCurve() const;
|
||||
void setKCurve(const qreal &value);
|
||||
public slots:
|
||||
virtual void ChoosedObject(quint32 id, const Valentina::Scenes &type);
|
||||
virtual void ChoosedObject(quint32 id, const SceneObject &type);
|
||||
virtual void DialogAccepted();
|
||||
/** TODO ISSUE 79 : create real function
|
||||
* @brief DialogApply apply data and emit signal about applied dialog.
|
||||
|
|
|
@ -88,9 +88,9 @@ void DialogSplinePath::SetPath(const VSplinePath &value)
|
|||
* @param id id of point or detail
|
||||
* @param type don't show this id in list
|
||||
*/
|
||||
void DialogSplinePath::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
||||
void DialogSplinePath::ChoosedObject(quint32 id, const SceneObject &type)
|
||||
{
|
||||
if (type == Valentina::Point)
|
||||
if (type == SceneObject::Point)
|
||||
{
|
||||
NewItem(id, 1, 0, 1, 180);
|
||||
emit ToolTip(tr("Select point of curve path"));
|
||||
|
|
|
@ -50,7 +50,7 @@ public:
|
|||
VSplinePath GetPath() const;
|
||||
void SetPath(const VSplinePath &value);
|
||||
public slots:
|
||||
virtual void ChoosedObject(quint32 id, const Valentina::Scenes &type);
|
||||
virtual void ChoosedObject(quint32 id, const SceneObject &type);
|
||||
virtual void DialogAccepted();
|
||||
/** TODO ISSUE 79 : create real function
|
||||
* @brief DialogApply apply data and emit signal about applied dialog.
|
||||
|
|
|
@ -107,7 +107,7 @@ void DialogTool::FillComboBoxPoints(QComboBox *box, const quint32 &id) const
|
|||
if (i.key() != id)
|
||||
{
|
||||
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());
|
||||
list[point->name()] = i.key();
|
||||
|
@ -118,7 +118,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);
|
||||
const QHash<quint32, VGObject *> *objs = data->DataGObjects();
|
||||
|
@ -127,12 +127,12 @@ void DialogTool::FillComboBoxArcs(QComboBox *box, const quint32 &id, ComboMode::
|
|||
while (i.hasNext())
|
||||
{
|
||||
i.next();
|
||||
if (cut == ComboMode::CutArc)
|
||||
if (cut == ComboBoxCutArc::CutArc)
|
||||
{
|
||||
if (i.key() != id + 1 && i.key() != id + 2)
|
||||
{
|
||||
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());
|
||||
list[arc->name()] = i.key();
|
||||
|
@ -144,7 +144,7 @@ void DialogTool::FillComboBoxArcs(QComboBox *box, const quint32 &id, ComboMode::
|
|||
if (i.key() != id)
|
||||
{
|
||||
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());
|
||||
list[arc->name()] = i.key();
|
||||
|
@ -162,7 +162,7 @@ void DialogTool::FillComboBoxArcs(QComboBox *box, const quint32 &id, ComboMode::
|
|||
* @param id don't show id in list
|
||||
* @param cut if set to ComboMode::CutSpline don't show id+1 and id+2
|
||||
*/
|
||||
void DialogTool::FillComboBoxSplines(QComboBox *box, const quint32 &id, ComboMode::ComboBoxCutSpline cut) const
|
||||
void DialogTool::FillComboBoxSplines(QComboBox *box, const quint32 &id, ComboBoxCutSpline cut) const
|
||||
{
|
||||
SCASSERT(box != nullptr);
|
||||
const QHash<quint32, VGObject *> *objs = data->DataGObjects();
|
||||
|
@ -171,12 +171,12 @@ void DialogTool::FillComboBoxSplines(QComboBox *box, const quint32 &id, ComboMod
|
|||
while (i.hasNext())
|
||||
{
|
||||
i.next();
|
||||
if (cut == ComboMode::CutSpline)
|
||||
if (cut == ComboBoxCutSpline::CutSpline)
|
||||
{
|
||||
if (i.key() != id + 1 && i.key() != id + 2)
|
||||
{
|
||||
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());
|
||||
list[spl->name()] = i.key();
|
||||
|
@ -188,7 +188,7 @@ void DialogTool::FillComboBoxSplines(QComboBox *box, const quint32 &id, ComboMod
|
|||
if (i.key() != id)
|
||||
{
|
||||
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());
|
||||
list[spl->name()] = i.key();
|
||||
|
@ -206,7 +206,7 @@ void DialogTool::FillComboBoxSplines(QComboBox *box, const quint32 &id, ComboMod
|
|||
* @param id don't show id in list
|
||||
* @param cut if set to ComboMode::CutSpline don't show id+1 and id+2
|
||||
*/
|
||||
void DialogTool::FillComboBoxSplinesPath(QComboBox *box, const quint32 &id, ComboMode::ComboBoxCutSpline cut) const
|
||||
void DialogTool::FillComboBoxSplinesPath(QComboBox *box, const quint32 &id, ComboBoxCutSpline cut) const
|
||||
{
|
||||
SCASSERT(box != nullptr);
|
||||
const QHash<quint32, VGObject *> *objs = data->DataGObjects();
|
||||
|
@ -215,12 +215,12 @@ void DialogTool::FillComboBoxSplinesPath(QComboBox *box, const quint32 &id, Comb
|
|||
while (i.hasNext())
|
||||
{
|
||||
i.next();
|
||||
if (cut == ComboMode::CutSpline)
|
||||
if (cut == ComboBoxCutSpline::CutSpline)
|
||||
{
|
||||
if (i.key() != id + 1 && i.key() != id + 2)
|
||||
{
|
||||
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());
|
||||
list[splPath->name()] = i.key();
|
||||
|
@ -232,7 +232,7 @@ void DialogTool::FillComboBoxSplinesPath(QComboBox *box, const quint32 &id, Comb
|
|||
if (i.key() != id)
|
||||
{
|
||||
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());
|
||||
list[splPath->name()] = i.key();
|
||||
|
@ -563,7 +563,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
|
||||
*/
|
||||
void DialogTool::setCurrentSplineId(QComboBox *box, quint32 &splineId, const quint32 &value, const quint32 &id,
|
||||
ComboMode::ComboBoxCutSpline cut) const
|
||||
ComboBoxCutSpline cut) const
|
||||
{
|
||||
SCASSERT(box != nullptr);
|
||||
FillComboBoxSplines(box, id, cut);
|
||||
|
@ -581,7 +581,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
|
||||
*/
|
||||
void DialogTool::setCurrentArcId(QComboBox *box, quint32 &arcId, const quint32 &value, const quint32 &id,
|
||||
ComboMode::ComboBoxCutArc cut) const
|
||||
ComboBoxCutArc cut) const
|
||||
{
|
||||
SCASSERT(box != nullptr);
|
||||
FillComboBoxArcs(box, id, cut);
|
||||
|
@ -599,7 +599,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
|
||||
*/
|
||||
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);
|
||||
FillComboBoxSplinesPath(box, id, cut);
|
||||
|
@ -684,7 +684,7 @@ void DialogTool::CheckState()
|
|||
* @param id id of point or detail
|
||||
* @param type type of object
|
||||
*/
|
||||
void DialogTool::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
||||
void DialogTool::ChoosedObject(quint32 id, const SceneObject &type)
|
||||
{
|
||||
Q_UNUSED(id);
|
||||
Q_UNUSED(type);
|
||||
|
|
|
@ -44,19 +44,8 @@ class VContainer;
|
|||
class QPlainTextEdit;
|
||||
class VAbstractTool;
|
||||
|
||||
namespace ComboMode
|
||||
{
|
||||
/**
|
||||
* @brief The ComboBoxCutSpline enum
|
||||
*/
|
||||
enum ComboBoxCutSpline { CutSpline, NoCutSpline };
|
||||
Q_DECLARE_FLAGS(ComboBoxCutSplines, ComboBoxCutSpline)
|
||||
|
||||
enum ComboBoxCutArc { CutArc, NoCutArc};
|
||||
Q_DECLARE_FLAGS(ComboBoxCutArcs, ComboBoxCutArc)
|
||||
}
|
||||
Q_DECLARE_OPERATORS_FOR_FLAGS( ComboMode::ComboBoxCutSplines )
|
||||
Q_DECLARE_OPERATORS_FOR_FLAGS( ComboMode::ComboBoxCutArcs )
|
||||
enum class ComboBoxCutSpline : char { CutSpline, NoCutSpline };
|
||||
enum class ComboBoxCutArc : char { CutArc, NoCutArc};
|
||||
|
||||
/**
|
||||
* @brief The DialogTool class parent for all dialog of tools.
|
||||
|
@ -85,7 +74,7 @@ signals:
|
|||
*/
|
||||
void ToolTip(const QString &toolTip);
|
||||
public slots:
|
||||
virtual void ChoosedObject(quint32 id, const Valentina::Scenes &type);
|
||||
virtual void ChoosedObject(quint32 id, const SceneObject &type);
|
||||
void NamePointChanged();
|
||||
virtual void DialogAccepted();
|
||||
/**
|
||||
|
@ -187,11 +176,11 @@ protected:
|
|||
virtual void showEvent( QShowEvent *event );
|
||||
void FillComboBoxPoints(QComboBox *box, const quint32 &id = 0)const;
|
||||
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,
|
||||
ComboMode::ComboBoxCutSpline cut = ComboMode::NoCutSpline)const;
|
||||
ComboBoxCutSpline cut = ComboBoxCutSpline::NoCutSpline)const;
|
||||
void FillComboBoxSplinesPath(QComboBox *box, const quint32 &id = 0,
|
||||
ComboMode::ComboBoxCutSpline cut = ComboMode::NoCutSpline)const;
|
||||
ComboBoxCutSpline cut = ComboBoxCutSpline::NoCutSpline)const;
|
||||
void FillComboBoxTypeLine(QComboBox *box) const;
|
||||
virtual void CheckState();
|
||||
QString GetTypeLine(const QComboBox *box)const;
|
||||
|
@ -208,12 +197,12 @@ protected:
|
|||
void Eval(QLineEdit *edit, bool &flag, QTimer *timer, QLabel *label);
|
||||
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,
|
||||
ComboMode::ComboBoxCutSpline cut = ComboMode::NoCutSpline) const;
|
||||
ComboBoxCutSpline cut = ComboBoxCutSpline::NoCutSpline) const;
|
||||
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,
|
||||
const quint32 &id,
|
||||
ComboMode::ComboBoxCutSpline cut = ComboMode::NoCutSpline) const;
|
||||
ComboBoxCutSpline cut = ComboBoxCutSpline::NoCutSpline) const;
|
||||
quint32 getCurrentObjectId(QComboBox *box) const;
|
||||
bool ChoosedPoint(const quint32 &id, QComboBox *box, const QString &toolTip);
|
||||
template <typename T>
|
||||
|
@ -244,7 +233,7 @@ protected:
|
|||
|
||||
connect(listWidget, &QListWidget::currentRowChanged, this, &DialogTool::ValChenged);
|
||||
|
||||
if (qApp->patternType() == Pattern::Standard)
|
||||
if (qApp->patternType() == MeasurementsType::Standard)
|
||||
{
|
||||
SizeHeight();
|
||||
connect(radioButtonSizeGrowth, &QRadioButton::clicked, this, &DialogTool::SizeHeight);
|
||||
|
|
|
@ -67,9 +67,9 @@ DialogTriangle::~DialogTriangle()
|
|||
* @param id id of point or detail
|
||||
* @param type type of object
|
||||
*/
|
||||
void DialogTriangle::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
||||
void DialogTriangle::ChoosedObject(quint32 id, const SceneObject &type)
|
||||
{
|
||||
if (type == Valentina::Point)
|
||||
if (type == SceneObject::Point)
|
||||
{
|
||||
const VPointF *point = data->GeometricObject<const VPointF *>(id);
|
||||
switch (number)
|
||||
|
|
|
@ -61,7 +61,7 @@ public:
|
|||
QString getPointName() const;
|
||||
void setPointName(const QString &value);
|
||||
public slots:
|
||||
virtual void ChoosedObject(quint32 id, const Valentina::Scenes &type);
|
||||
virtual void ChoosedObject(quint32 id, const SceneObject &type);
|
||||
virtual void DialogAccepted();
|
||||
/** TODO ISSUE 79 : create real function
|
||||
* @brief DialogApply apply data and emit signal about applied dialog.
|
||||
|
|
|
@ -57,7 +57,7 @@ DialogUnionDetails::~DialogUnionDetails()
|
|||
* @param id id of point or detail
|
||||
* @param type type of object
|
||||
*/
|
||||
void DialogUnionDetails::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
||||
void DialogUnionDetails::ChoosedObject(quint32 id, const SceneObject &type)
|
||||
{
|
||||
if (numberD == 0)
|
||||
{
|
||||
|
@ -103,12 +103,12 @@ bool DialogUnionDetails::CheckObject(const quint32 &id, const quint32 &idDetail)
|
|||
* @param idDetail id detail
|
||||
* @param index index of edge
|
||||
*/
|
||||
void DialogUnionDetails::ChoosedDetail(const quint32 &id, const Valentina::Scenes &type, quint32 &idDetail,
|
||||
void DialogUnionDetails::ChoosedDetail(const quint32 &id, const SceneObject &type, quint32 &idDetail,
|
||||
ptrdiff_t &index)
|
||||
{
|
||||
if (idDetail == 0)
|
||||
{
|
||||
if (type == Valentina::Detail)
|
||||
if (type == SceneObject::Detail)
|
||||
{
|
||||
idDetail = id;
|
||||
emit ToolTip(tr("Select first point"));
|
||||
|
@ -119,7 +119,7 @@ void DialogUnionDetails::ChoosedDetail(const quint32 &id, const Valentina::Scene
|
|||
{
|
||||
return;
|
||||
}
|
||||
if (type == Valentina::Point)
|
||||
if (type == SceneObject::Point)
|
||||
{
|
||||
if (numberP == 0)
|
||||
{
|
||||
|
|
|
@ -51,7 +51,7 @@ public:
|
|||
ptrdiff_t getIndexD1() const;
|
||||
ptrdiff_t getIndexD2() const;
|
||||
public slots:
|
||||
void ChoosedObject(quint32 id, const Valentina::Scenes &type);
|
||||
void ChoosedObject(quint32 id, const SceneObject &type);
|
||||
virtual void DialogAccepted();
|
||||
/** TODO ISSUE 79 : create real function
|
||||
* @brief DialogApply apply data and emit signal about applied dialog.
|
||||
|
@ -88,7 +88,7 @@ private:
|
|||
quint32 p2;
|
||||
|
||||
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);
|
||||
};
|
||||
|
||||
|
|
|
@ -39,7 +39,7 @@
|
|||
* @brief VArc default constructor.
|
||||
*/
|
||||
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())
|
||||
{}
|
||||
|
||||
|
@ -52,8 +52,8 @@ VArc::VArc ()
|
|||
* @param f2 end angle (degree).
|
||||
*/
|
||||
VArc::VArc (VPointF center, qreal radius, QString formulaRadius, qreal f1, QString formulaF1, qreal f2,
|
||||
QString formulaF2, quint32 idObject, Valentina::Draws mode)
|
||||
: VGObject(GObject::Arc, idObject, mode), f1(f1), formulaF1(formulaF1), f2(f2), formulaF2(formulaF2),
|
||||
QString formulaF2, quint32 idObject, Draw mode)
|
||||
: VGObject(GOType::Arc, idObject, mode), f1(f1), formulaF1(formulaF1), f2(f2), formulaF2(formulaF2),
|
||||
radius(radius), formulaRadius(formulaRadius), center(center)
|
||||
{
|
||||
_name = QString (arc_+"%1").arg(this->GetCenter().name());
|
||||
|
|
|
@ -43,7 +43,7 @@ class VArc: public VGObject
|
|||
public:
|
||||
VArc ();
|
||||
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& operator= (const VArc &arc);
|
||||
QString GetFormulaF1 () const;
|
||||
|
|
|
@ -282,7 +282,7 @@ QVector<VNodeDetail> VDetail::listNodePoint() const
|
|||
QVector<VNodeDetail> list;
|
||||
for (ptrdiff_t i = 0; i < nodes.size(); ++i)
|
||||
{
|
||||
if (nodes.at(i).getTypeTool() == Valentina::NodePoint)
|
||||
if (nodes.at(i).getTypeTool() == Tool::NodePoint)
|
||||
{
|
||||
list.append(nodes.at(i));
|
||||
}
|
||||
|
|
|
@ -34,24 +34,8 @@
|
|||
|
||||
class QString;
|
||||
|
||||
namespace Detail
|
||||
{
|
||||
/**
|
||||
* @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)
|
||||
|
||||
/**
|
||||
* @brief The Equidistant enum OpenEquidistant - first and last points equidistant don't match,
|
||||
* 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)
|
||||
enum class Contour : char { OpenContour, CloseContour };
|
||||
enum class EquidistantType : char { OpenEquidistant, CloseEquidistant };
|
||||
|
||||
/**
|
||||
* @brief The VDetail class for path of object (points, arcs, splines).
|
||||
|
|
|
@ -47,7 +47,7 @@ QPainterPath VEquidistant::ContourPath(const quint32 &idDetail, const VContainer
|
|||
{
|
||||
switch (detail.at(i).getTypeTool())
|
||||
{
|
||||
case (Valentina::NodePoint):
|
||||
case (Tool::NodePoint):
|
||||
{
|
||||
const VPointF *point = data->GeometricObject<const VPointF*>(detail.at(i).getId());
|
||||
points.append(point->toQPointF());
|
||||
|
@ -60,7 +60,7 @@ QPainterPath VEquidistant::ContourPath(const quint32 &idDetail, const VContainer
|
|||
}
|
||||
}
|
||||
break;
|
||||
case (Valentina::NodeArc):
|
||||
case (Tool::NodeArc):
|
||||
{
|
||||
const VArc *arc = data->GeometricObject<const VArc *>(detail.at(i).getId());
|
||||
qreal len1 = GetLengthContour(points, arc->GetPoints());
|
||||
|
@ -84,7 +84,7 @@ QPainterPath VEquidistant::ContourPath(const quint32 &idDetail, const VContainer
|
|||
}
|
||||
}
|
||||
break;
|
||||
case (Valentina::NodeSpline):
|
||||
case (Tool::NodeSpline):
|
||||
{
|
||||
const VSpline *spline = data->GeometricObject<const VSpline *>(detail.at(i).getId());
|
||||
qreal len1 = GetLengthContour(points, spline->GetPoints());
|
||||
|
@ -108,7 +108,7 @@ QPainterPath VEquidistant::ContourPath(const quint32 &idDetail, const VContainer
|
|||
}
|
||||
}
|
||||
break;
|
||||
case (Valentina::NodeSplinePath):
|
||||
case (Tool::NodeSplinePath):
|
||||
{
|
||||
const VSplinePath *splinePath = data->GeometricObject<const VSplinePath *>(detail.at(i).getId());
|
||||
qreal len1 = GetLengthContour(points, splinePath->GetPathPoints());
|
||||
|
@ -132,8 +132,29 @@ QPainterPath VEquidistant::ContourPath(const quint32 &idDetail, const VContainer
|
|||
}
|
||||
}
|
||||
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:
|
||||
qDebug()<<"Get wrong tool type. Ignore."<<detail.at(i).getTypeTool();
|
||||
qDebug()<<"Get wrong tool type. Ignore."<< static_cast<char>(detail.at(i).getTypeTool());
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -154,11 +175,11 @@ QPainterPath VEquidistant::ContourPath(const quint32 &idDetail, const VContainer
|
|||
QPainterPath ekv;
|
||||
if (detail.getClosed() == true)
|
||||
{
|
||||
ekv = Equidistant(pointsEkv, Detail::CloseEquidistant, qApp->toPixel(detail.getWidth()));
|
||||
ekv = Equidistant(pointsEkv, EquidistantType::CloseEquidistant, qApp->toPixel(detail.getWidth()));
|
||||
}
|
||||
else
|
||||
{
|
||||
ekv = Equidistant(pointsEkv, Detail::OpenEquidistant, qApp->toPixel(detail.getWidth()));
|
||||
ekv = Equidistant(pointsEkv, EquidistantType::OpenEquidistant, qApp->toPixel(detail.getWidth()));
|
||||
}
|
||||
path.addPath(ekv);
|
||||
path.setFillRule(Qt::WindingFill);
|
||||
|
@ -241,7 +262,7 @@ QVector<QPointF> VEquidistant::CorrectEquidistantPoints(const QVector<QPointF> &
|
|||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
QPainterPath VEquidistant::Equidistant(QVector<QPointF> points, const Detail::Equidistant &eqv, const qreal &width)
|
||||
QPainterPath VEquidistant::Equidistant(QVector<QPointF> points, const EquidistantType &eqv, const qreal &width)
|
||||
{
|
||||
QPainterPath ekv;
|
||||
QVector<QPointF> ekvPoints;
|
||||
|
@ -267,29 +288,29 @@ QPainterPath VEquidistant::Equidistant(QVector<QPointF> points, const Detail::Eq
|
|||
}
|
||||
}
|
||||
}
|
||||
if (eqv == Detail::CloseEquidistant)
|
||||
if (eqv == EquidistantType::CloseEquidistant)
|
||||
{
|
||||
points.append(points.at(0));
|
||||
}
|
||||
for (qint32 i = 0; i < points.size(); ++i )
|
||||
{
|
||||
if ( i == 0 && eqv == Detail::CloseEquidistant)
|
||||
if ( i == 0 && eqv == EquidistantType::CloseEquidistant)
|
||||
{//first point, polyline closed
|
||||
ekvPoints<<EkvPoint(QLineF(points.at(points.size()-2), points.at(points.size()-1)),
|
||||
QLineF(points.at(1), points.at(0)), width);
|
||||
continue;
|
||||
}
|
||||
else if (i == 0 && eqv == Detail::OpenEquidistant)
|
||||
else if (i == 0 && eqv == EquidistantType::OpenEquidistant)
|
||||
{//first point, polyline doesn't closed
|
||||
ekvPoints.append(SingleParallelPoint(QLineF(points.at(0), points.at(1)), 90, width));
|
||||
continue;
|
||||
}
|
||||
if (i == points.size()-1 && eqv == Detail::CloseEquidistant)
|
||||
if (i == points.size()-1 && eqv == EquidistantType::CloseEquidistant)
|
||||
{//last point, polyline closed
|
||||
ekvPoints.append(ekvPoints.at(0));
|
||||
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
|
||||
ekvPoints.append(SingleParallelPoint(QLineF(points.at(points.size()-1), points.at(points.size()-2)),
|
||||
-90, width));
|
||||
|
|
|
@ -78,7 +78,7 @@ private:
|
|||
* @param width width 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.
|
||||
* @param points vector of points of equidistant.
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
* @brief VGObject default constructor.
|
||||
*/
|
||||
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 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)
|
||||
{}
|
||||
|
||||
|
@ -117,7 +117,7 @@ void VGObject::setName(const QString &name)
|
|||
* @brief getMode return mode creation.
|
||||
* @return mode.
|
||||
*/
|
||||
Valentina::Draws VGObject::getMode() const
|
||||
Draw VGObject::getMode() const
|
||||
{
|
||||
return mode;
|
||||
}
|
||||
|
@ -127,7 +127,7 @@ Valentina::Draws VGObject::getMode() const
|
|||
* @brief setMode set mode creation.
|
||||
* @param value mode.
|
||||
*/
|
||||
void VGObject::setMode(const Valentina::Draws &value)
|
||||
void VGObject::setMode(const Draw &value)
|
||||
{
|
||||
mode = value;
|
||||
}
|
||||
|
@ -137,7 +137,7 @@ void VGObject::setMode(const Valentina::Draws &value)
|
|||
* @brief getType return object type.
|
||||
* @return type.
|
||||
*/
|
||||
GObject::Type VGObject::getType() const
|
||||
GOType VGObject::getType() const
|
||||
{
|
||||
return type;
|
||||
}
|
||||
|
|
|
@ -31,15 +31,7 @@
|
|||
|
||||
#include "../options.h"
|
||||
|
||||
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)
|
||||
enum class GOType : char { Point, Arc, Spline, SplinePath };
|
||||
|
||||
/**
|
||||
* @brief The VGObject class keep information graphical objects.
|
||||
|
@ -48,8 +40,7 @@ class VGObject
|
|||
{
|
||||
public:
|
||||
VGObject();
|
||||
VGObject(const GObject::Type &type, const quint32 &idObject = 0,
|
||||
const Valentina::Draws &mode = Valentina::Calculation);
|
||||
VGObject(const GOType &type, const quint32 &idObject = 0, const Draw &mode = Draw::Calculation);
|
||||
VGObject(const VGObject &obj);
|
||||
VGObject& operator= (const VGObject &obj);
|
||||
virtual ~VGObject(){}
|
||||
|
@ -57,9 +48,9 @@ public:
|
|||
void setIdObject(const quint32 &value);
|
||||
virtual QString name() const;
|
||||
void setName(const QString &name);
|
||||
Valentina::Draws getMode() const;
|
||||
void setMode(const Valentina::Draws &value);
|
||||
GObject::Type getType() const;
|
||||
Draw getMode() const;
|
||||
void setMode(const Draw &value);
|
||||
GOType getType() const;
|
||||
quint32 id() const;
|
||||
virtual void setId(const quint32 &id);
|
||||
protected:
|
||||
|
@ -67,7 +58,7 @@ protected:
|
|||
quint32 _id;
|
||||
|
||||
/** @brief type type of graphical object */
|
||||
GObject::Type type;
|
||||
GOType type;
|
||||
|
||||
/** @brief idObject id of parent object. Only for modeling. All another return 0. */
|
||||
quint32 idObject;
|
||||
|
@ -76,7 +67,7 @@ protected:
|
|||
QString _name;
|
||||
|
||||
/** @brief mode object created in calculation or drawing mode */
|
||||
Valentina::Draws mode;
|
||||
Draw mode;
|
||||
};
|
||||
|
||||
#endif // VGOBJECT_H
|
||||
|
|
|
@ -30,11 +30,11 @@
|
|||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
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)
|
||||
{}
|
||||
|
||||
|
|
|
@ -31,15 +31,7 @@
|
|||
|
||||
#include "../options.h"
|
||||
|
||||
namespace NodeDetail
|
||||
{
|
||||
/**
|
||||
* @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)
|
||||
enum class NodeDetail : char { Contour, Modeling };
|
||||
|
||||
/**
|
||||
* @brief The VNodeDetail class keep information about detail node.
|
||||
|
@ -59,8 +51,7 @@ public:
|
|||
* @param mx object bias x axis
|
||||
* @param my object bias y axis
|
||||
*/
|
||||
VNodeDetail(quint32 id, Valentina::Tools typeTool, NodeDetail::NodeDetails typeNode, qreal mx = 0,
|
||||
qreal my = 0);
|
||||
VNodeDetail(quint32 id, Tool typeTool, NodeDetail typeNode, qreal mx = 0, qreal my = 0);
|
||||
/**
|
||||
* @brief VNodeDetail copy constructor
|
||||
* @param node node
|
||||
|
@ -86,22 +77,22 @@ public:
|
|||
* @brief getTypeTool return tool type.
|
||||
* @return tool type.
|
||||
*/
|
||||
Valentina::Tools getTypeTool() const;
|
||||
Tool getTypeTool() const;
|
||||
/**
|
||||
* @brief setTypeTool set tool type.
|
||||
* @param value tool type.
|
||||
*/
|
||||
void setTypeTool(const Valentina::Tools &value);
|
||||
void setTypeTool(const Tool &value);
|
||||
/**
|
||||
* @brief getTypeNode return node type.
|
||||
* @return node type.
|
||||
*/
|
||||
NodeDetail::NodeDetails getTypeNode() const;
|
||||
NodeDetail getTypeNode() const;
|
||||
/**
|
||||
* @brief setTypeNode set node type.
|
||||
* @param value node type.
|
||||
*/
|
||||
void setTypeNode(const NodeDetail::NodeDetails &value);
|
||||
void setTypeNode(const NodeDetail &value);
|
||||
/**
|
||||
* @brief getMx return object bias x axis.
|
||||
* @return bias x axis.
|
||||
|
@ -130,11 +121,11 @@ private:
|
|||
/**
|
||||
* @brief typeTool type of tool
|
||||
*/
|
||||
Valentina::Tools typeTool;
|
||||
Tool typeTool;
|
||||
/**
|
||||
* @brief typeNode node type.
|
||||
*/
|
||||
NodeDetail::NodeDetails typeNode;
|
||||
NodeDetail typeNode;
|
||||
/**
|
||||
* @brief mx bias x axis.
|
||||
*/
|
||||
|
@ -155,22 +146,22 @@ inline void VNodeDetail::setId(const quint32 &value)
|
|||
id = value;
|
||||
}
|
||||
|
||||
inline Valentina::Tools VNodeDetail::getTypeTool() const
|
||||
inline Tool VNodeDetail::getTypeTool() const
|
||||
{
|
||||
return typeTool;
|
||||
}
|
||||
|
||||
inline void VNodeDetail::setTypeTool(const Valentina::Tools &value)
|
||||
inline void VNodeDetail::setTypeTool(const Tool &value)
|
||||
{
|
||||
typeTool = value;
|
||||
}
|
||||
|
||||
inline NodeDetail::NodeDetails VNodeDetail::getTypeNode() const
|
||||
inline NodeDetail VNodeDetail::getTypeNode() const
|
||||
{
|
||||
return typeNode;
|
||||
}
|
||||
|
||||
inline void VNodeDetail::setTypeNode(const NodeDetail::NodeDetails &value)
|
||||
inline void VNodeDetail::setTypeNode(const NodeDetail &value)
|
||||
{
|
||||
typeNode = value;
|
||||
}
|
||||
|
|
|
@ -38,8 +38,8 @@
|
|||
* @param mx offset name respect to x
|
||||
* @param my offset name respect to y
|
||||
*/
|
||||
VPointF::VPointF(qreal x, qreal y, QString name, qreal mx, qreal my, quint32 idObject, Valentina::Draws mode)
|
||||
:VGObject(GObject::Point, idObject, mode), _mx(mx), _my(my), _x(x), _y(y)
|
||||
VPointF::VPointF(qreal x, qreal y, QString name, qreal mx, qreal my, quint32 idObject, Draw mode)
|
||||
:VGObject(GOType::Point, idObject, mode), _mx(mx), _my(my), _x(x), _y(y)
|
||||
{
|
||||
this->_name = name;
|
||||
}
|
||||
|
@ -48,7 +48,7 @@ VPointF::VPointF(qreal x, qreal y, QString name, qreal mx, qreal my, quint32 idO
|
|||
/**
|
||||
* @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)
|
||||
{}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
|
|
|
@ -44,7 +44,7 @@ public:
|
|||
VPointF (const VPointF &point );
|
||||
VPointF (const QPointF &point );
|
||||
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(){}
|
||||
VPointF &operator=(const VPointF &point);
|
||||
qreal mx() const;
|
||||
|
|
|
@ -38,7 +38,7 @@
|
|||
* @brief VSpline default constructor
|
||||
*/
|
||||
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)
|
||||
{}
|
||||
|
||||
|
@ -65,8 +65,8 @@ VSpline::VSpline ( const VSpline & spline )
|
|||
* @param kAsm2 coefficient of length second control line.
|
||||
*/
|
||||
VSpline::VSpline (VPointF p1, VPointF p4, qreal angle1, qreal angle2, qreal kAsm1, qreal kAsm2, qreal kCurve,
|
||||
quint32 idObject, Valentina::Draws mode)
|
||||
:VGObject(GObject::Spline, idObject, mode), p1(p1), p2(QPointF()), p3(QPointF()), p4(p4), angle1(angle1),
|
||||
quint32 idObject, Draw mode)
|
||||
:VGObject(GOType::Spline, idObject, mode), p1(p1), p2(QPointF()), p3(QPointF()), p4(p4), angle1(angle1),
|
||||
angle2(angle2), kAsm1(kAsm1), kAsm2(kAsm2), kCurve(kCurve)
|
||||
{
|
||||
CreateName();
|
||||
|
@ -100,8 +100,8 @@ VSpline::VSpline (VPointF p1, VPointF p4, qreal angle1, qreal angle2, qreal kAsm
|
|||
* @param p3 second control point.
|
||||
* @param p4 second point spline.
|
||||
*/
|
||||
VSpline::VSpline (VPointF p1, QPointF p2, QPointF p3, VPointF p4, qreal kCurve, quint32 idObject, Valentina::Draws mode)
|
||||
:VGObject(GObject::Spline, idObject, mode), p1(p1), p2(p2), p3(p3), p4(p4), angle1(0), angle2(0), kAsm1(1),
|
||||
VSpline::VSpline (VPointF p1, QPointF p2, QPointF p3, VPointF p4, qreal kCurve, quint32 idObject, Draw mode)
|
||||
:VGObject(GOType::Spline, idObject, mode), p1(p1), p2(p2), p3(p3), p4(p4), angle1(0), angle2(0), kAsm1(1),
|
||||
kAsm2(1), kCurve(1)
|
||||
{
|
||||
CreateName();
|
||||
|
|
|
@ -46,9 +46,9 @@ public:
|
|||
VSpline();
|
||||
VSpline (const VSpline &spline );
|
||||
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,
|
||||
Valentina::Draws mode = Valentina::Calculation);
|
||||
Draw mode = Draw::Calculation);
|
||||
VSpline &operator=(const VSpline &spl);
|
||||
VPointF GetP1 () const;
|
||||
QPointF GetP2 () const;
|
||||
|
|
|
@ -30,8 +30,8 @@
|
|||
#include "../exception/vexception.h"
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VSplinePath::VSplinePath(qreal kCurve, quint32 idObject, Valentina::Draws mode)
|
||||
: VGObject(GObject::SplinePath, idObject, mode), path(QVector<VSplinePoint>()), kCurve(kCurve), maxCountPoints(0)
|
||||
VSplinePath::VSplinePath(qreal kCurve, quint32 idObject, Draw mode)
|
||||
: VGObject(GOType::SplinePath, idObject, mode), path(QVector<VSplinePoint>()), kCurve(kCurve), maxCountPoints(0)
|
||||
{}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
|
@ -121,13 +121,13 @@ qreal VSplinePath::GetLength() const
|
|||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
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())
|
||||
{
|
||||
throw VException(tr("This spline does not exist."));
|
||||
}
|
||||
if (pos == SplinePoint::FirstPoint)
|
||||
if (pos == SplinePointPosition::FirstPoint)
|
||||
{
|
||||
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())
|
||||
{
|
||||
throw VException(tr("This spline does not exist."));
|
||||
}
|
||||
if (pos == SplinePoint::FirstPoint)
|
||||
if (pos == SplinePointPosition::FirstPoint)
|
||||
{
|
||||
return path.at(indexSpline-1);
|
||||
}
|
||||
|
|
|
@ -33,15 +33,7 @@
|
|||
#include "vspline.h"
|
||||
#include "vsplinepoint.h"
|
||||
|
||||
namespace SplinePoint
|
||||
{
|
||||
/**
|
||||
* @brief The Position enum position in spline.
|
||||
*/
|
||||
enum Position { FirstPoint, LastPoint };
|
||||
Q_DECLARE_FLAGS(Positions, Position)
|
||||
}
|
||||
Q_DECLARE_OPERATORS_FOR_FLAGS( SplinePoint::Positions )
|
||||
enum class SplinePointPosition : char { FirstPoint, LastPoint };
|
||||
|
||||
/**
|
||||
* @brief The VSplinePath class keep information about splinePath.
|
||||
|
@ -56,7 +48,7 @@ public:
|
|||
* @param idObject parent id.
|
||||
* @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.
|
||||
* @param splPath spline path.
|
||||
|
@ -109,14 +101,14 @@ public:
|
|||
* @param pos position point in spline.
|
||||
* @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.
|
||||
* @param indexSpline spline index in list.
|
||||
* @param pos position point in spline.
|
||||
* @return spline point.
|
||||
*/
|
||||
VSplinePoint GetSplinePoint(qint32 indexSpline, SplinePoint::Position pos) const;
|
||||
VSplinePoint GetSplinePoint(qint32 indexSpline, SplinePointPosition pos) const;
|
||||
/**
|
||||
* @brief Clear clear list of points.
|
||||
*/
|
||||
|
|
|
@ -54,10 +54,10 @@
|
|||
* @param parent parent widget.
|
||||
*/
|
||||
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),
|
||||
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),
|
||||
autoSaveTimer(nullptr)
|
||||
{
|
||||
|
@ -122,9 +122,9 @@ void MainWindow::ActionNewPP()
|
|||
{
|
||||
return;
|
||||
}
|
||||
if (measurements.type() == Measurements::Standard)
|
||||
if (measurements.type() == MeasurementsType::Standard)
|
||||
{
|
||||
qApp->setPatternType(Pattern::Standard);
|
||||
qApp->setPatternType(MeasurementsType::Standard);
|
||||
DialogStandardMeasurements stMeasurements(pattern, patternPieceName, this);
|
||||
if (stMeasurements.exec() == QDialog::Accepted)
|
||||
{
|
||||
|
@ -143,7 +143,7 @@ void MainWindow::ActionNewPP()
|
|||
}
|
||||
else
|
||||
{
|
||||
qApp->setPatternType(Pattern::Individual);
|
||||
qApp->setPatternType(MeasurementsType::Individual);
|
||||
DialogIndividualMeasurements indMeasurements(pattern, patternPieceName, this);
|
||||
if (indMeasurements.exec() == QDialog::Accepted)
|
||||
{
|
||||
|
@ -180,14 +180,14 @@ void MainWindow::ActionNewPP()
|
|||
//Create single point
|
||||
const quint32 id = pattern->AddGObject(new VPointF(qApp->toPixel((10+comboBoxDraws->count()*5)), qApp->toPixel(10),
|
||||
"А", 5, 10));
|
||||
VToolSinglePoint *spoint = new VToolSinglePoint(doc, pattern, id, Valentina::FromGui, patternPieceName, path);
|
||||
VToolSinglePoint *spoint = new VToolSinglePoint(doc, pattern, id, Source::FromGui, patternPieceName, path);
|
||||
sceneDraw->addItem(spoint);
|
||||
connect(spoint, &VToolPoint::ChoosedTool, sceneDraw, &VMainGraphicsScene::ChoosedItem);
|
||||
connect(sceneDraw, &VMainGraphicsScene::NewFactor, spoint, &VToolSinglePoint::SetFactor);
|
||||
QHash<quint32, VDataTool*>* tools = doc->getTools();
|
||||
SCASSERT(tools != nullptr);
|
||||
tools->insert(id, spoint);
|
||||
VDrawTool::AddRecord(id, Valentina::SinglePointTool, doc);
|
||||
VDrawTool::AddRecord(id, Tool::SinglePointTool, doc);
|
||||
SetEnableTool(true);
|
||||
SetEnableWidgets(true);
|
||||
|
||||
|
@ -233,7 +233,7 @@ void MainWindow::OptionDraw()
|
|||
* @param closeDialogSlot function what handle after close dialog.
|
||||
*/
|
||||
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)
|
||||
{
|
||||
if (checked)
|
||||
|
@ -271,7 +271,7 @@ template <typename Dialog, typename Func, typename Func2>
|
|||
* @param closeDialogSlot function to handle close of 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)
|
||||
{
|
||||
if (checked)
|
||||
|
@ -374,7 +374,7 @@ void MainWindow::ApplyDialog()
|
|||
*/
|
||||
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);
|
||||
}
|
||||
|
||||
|
@ -404,7 +404,7 @@ void MainWindow::ClosedDialogEndLine(int result)
|
|||
*/
|
||||
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);
|
||||
}
|
||||
|
||||
|
@ -425,7 +425,7 @@ void MainWindow::ClosedDialogLine(int result)
|
|||
*/
|
||||
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);
|
||||
}
|
||||
|
||||
|
@ -455,7 +455,7 @@ void MainWindow::ClosedDialogAlongLine(int result)
|
|||
*/
|
||||
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,
|
||||
&MainWindow::ApplyDialogShoulderPoint);
|
||||
}
|
||||
|
@ -486,7 +486,7 @@ void MainWindow::ClosedDialogShoulderPoint(int result)
|
|||
*/
|
||||
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,
|
||||
&MainWindow::ApplyDialogNormal);
|
||||
}
|
||||
|
@ -517,7 +517,7 @@ void MainWindow::ClosedDialogNormal(int result)
|
|||
*/
|
||||
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,
|
||||
&MainWindow::ApplyDialogBisector);
|
||||
}
|
||||
|
@ -548,7 +548,7 @@ void MainWindow::ClosedDialogBisector(int result)
|
|||
*/
|
||||
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);
|
||||
}
|
||||
|
||||
|
@ -569,7 +569,7 @@ void MainWindow::ClosedDialogLineIntersect(int result)
|
|||
*/
|
||||
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);
|
||||
}
|
||||
|
||||
|
@ -590,7 +590,7 @@ void MainWindow::ClosedDialogSpline(int result)
|
|||
*/
|
||||
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);
|
||||
}
|
||||
|
||||
|
@ -611,7 +611,7 @@ void MainWindow::ClosedDialogCutSpline(int result)
|
|||
*/
|
||||
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,
|
||||
&MainWindow::ApplyDialogArc);
|
||||
}
|
||||
|
@ -642,7 +642,7 @@ void MainWindow::ClosedDialogArc(int result)
|
|||
*/
|
||||
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);
|
||||
}
|
||||
|
||||
|
@ -663,7 +663,7 @@ void MainWindow::ClosedDialogSplinePath(int result)
|
|||
*/
|
||||
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"),
|
||||
&MainWindow::ClosedDialogCutSplinePath);
|
||||
}
|
||||
|
@ -685,7 +685,7 @@ void MainWindow::ClosedDialogCutSplinePath(int result)
|
|||
*/
|
||||
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,
|
||||
&MainWindow::ApplyDialogPointOfContact);
|
||||
}
|
||||
|
@ -716,7 +716,7 @@ void MainWindow::ClosedDialogPointOfContact(int result)
|
|||
*/
|
||||
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);
|
||||
}
|
||||
|
||||
|
@ -742,7 +742,7 @@ void MainWindow::ClosedDialogDetail(int result)
|
|||
*/
|
||||
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);
|
||||
}
|
||||
|
||||
|
@ -763,7 +763,7 @@ void MainWindow::ClosedDialogHeight(int result)
|
|||
*/
|
||||
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);
|
||||
}
|
||||
|
||||
|
@ -784,7 +784,7 @@ void MainWindow::ClosedDialogTriangle(int result)
|
|||
*/
|
||||
void MainWindow::ToolPointOfIntersection(bool checked)
|
||||
{
|
||||
SetToolButton<DialogPointOfIntersection>(checked, Valentina::PointOfIntersection,
|
||||
SetToolButton<DialogPointOfIntersection>(checked, Tool::PointOfIntersection,
|
||||
":/cursor/pointofintersect_cursor.png", tr("Select point vertically"),
|
||||
&MainWindow::ClosedDialogPointOfIntersection);
|
||||
}
|
||||
|
@ -806,7 +806,7 @@ void MainWindow::ClosedDialogPointOfIntersection(int result)
|
|||
*/
|
||||
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);
|
||||
//Must disconnect this signal here.
|
||||
disconnect(doc, &VPattern::FullUpdateFromFile, dialogTool, &DialogTool::UpdateList);
|
||||
|
@ -830,7 +830,7 @@ void MainWindow::ClosedDialogUnionDetails(int result)
|
|||
*/
|
||||
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);
|
||||
}
|
||||
|
||||
|
@ -967,7 +967,7 @@ void MainWindow::closeEvent(QCloseEvent *event)
|
|||
*/
|
||||
void MainWindow::ToolBarOption()
|
||||
{
|
||||
if (qApp->patternType() == Pattern::Standard)
|
||||
if (qApp->patternType() == MeasurementsType::Standard)
|
||||
{
|
||||
ui->toolBarOption->addWidget(new QLabel(tr("Height: ")));
|
||||
|
||||
|
@ -1120,107 +1120,111 @@ void MainWindow::CancelTool()
|
|||
dialogTool = nullptr;
|
||||
switch ( tool )
|
||||
{
|
||||
case Valentina::ArrowTool:
|
||||
case Tool::ArrowTool:
|
||||
ui->actionArrowTool->setChecked(false);
|
||||
helpLabel->setText("");
|
||||
break;
|
||||
case Valentina::SinglePointTool:
|
||||
case Tool::SinglePointTool:
|
||||
Q_UNREACHABLE();
|
||||
//Nothing to do here because we can't create this tool from main window.
|
||||
break;
|
||||
case Valentina::EndLineTool:
|
||||
case Tool::EndLineTool:
|
||||
ui->toolButtonEndLine->setChecked(false);
|
||||
currentScene->setFocus(Qt::OtherFocusReason);
|
||||
currentScene->clearSelection();
|
||||
break;
|
||||
case Valentina::LineTool:
|
||||
case Tool::LineTool:
|
||||
ui->toolButtonLine->setChecked(false);
|
||||
currentScene->setFocus(Qt::OtherFocusReason);
|
||||
currentScene->clearFocus();
|
||||
break;
|
||||
case Valentina::AlongLineTool:
|
||||
case Tool::AlongLineTool:
|
||||
ui->toolButtonAlongLine->setChecked(false);
|
||||
currentScene->setFocus(Qt::OtherFocusReason);
|
||||
currentScene->clearSelection();
|
||||
break;
|
||||
case Valentina::ShoulderPointTool:
|
||||
case Tool::ShoulderPointTool:
|
||||
ui->toolButtonShoulderPoint->setChecked(false);
|
||||
currentScene->setFocus(Qt::OtherFocusReason);
|
||||
currentScene->clearSelection();
|
||||
break;
|
||||
case Valentina::NormalTool:
|
||||
case Tool::NormalTool:
|
||||
ui->toolButtonNormal->setChecked(false);
|
||||
currentScene->setFocus(Qt::OtherFocusReason);
|
||||
currentScene->clearSelection();
|
||||
break;
|
||||
case Valentina::BisectorTool:
|
||||
case Tool::BisectorTool:
|
||||
ui->toolButtonBisector->setChecked(false);
|
||||
currentScene->setFocus(Qt::OtherFocusReason);
|
||||
currentScene->clearSelection();
|
||||
break;
|
||||
case Valentina::LineIntersectTool:
|
||||
case Tool::LineIntersectTool:
|
||||
ui->toolButtonLineIntersect->setChecked(false);
|
||||
currentScene->setFocus(Qt::OtherFocusReason);
|
||||
currentScene->clearSelection();
|
||||
break;
|
||||
case Valentina::SplineTool:
|
||||
case Tool::SplineTool:
|
||||
ui->toolButtonSpline->setChecked(false);
|
||||
currentScene->setFocus(Qt::OtherFocusReason);
|
||||
currentScene->clearSelection();
|
||||
break;
|
||||
case Valentina::ArcTool:
|
||||
case Tool::ArcTool:
|
||||
ui->toolButtonArc->setChecked(false);
|
||||
currentScene->setFocus(Qt::OtherFocusReason);
|
||||
currentScene->clearSelection();
|
||||
break;
|
||||
case Valentina::SplinePathTool:
|
||||
case Tool::SplinePathTool:
|
||||
ui->toolButtonSplinePath->setChecked(false);
|
||||
currentScene->setFocus(Qt::OtherFocusReason);
|
||||
currentScene->clearSelection();
|
||||
break;
|
||||
case Valentina::PointOfContact:
|
||||
case Tool::PointOfContact:
|
||||
ui->toolButtonPointOfContact->setChecked(false);
|
||||
currentScene->setFocus(Qt::OtherFocusReason);
|
||||
currentScene->clearSelection();
|
||||
break;
|
||||
case Valentina::DetailTool:
|
||||
case Tool::DetailTool:
|
||||
ui->toolButtonNewDetail->setChecked(false);
|
||||
break;
|
||||
case Valentina::Height:
|
||||
case Tool::Height:
|
||||
ui->toolButtonHeight->setChecked(false);
|
||||
currentScene->setFocus(Qt::OtherFocusReason);
|
||||
currentScene->clearSelection();
|
||||
break;
|
||||
case Valentina::Triangle:
|
||||
case Tool::Triangle:
|
||||
ui->toolButtonTriangle->setChecked(false);
|
||||
currentScene->setFocus(Qt::OtherFocusReason);
|
||||
currentScene->clearSelection();
|
||||
break;
|
||||
case Valentina::PointOfIntersection:
|
||||
case Tool::PointOfIntersection:
|
||||
ui->toolButtonPointOfIntersection->setChecked(false);
|
||||
currentScene->setFocus(Qt::OtherFocusReason);
|
||||
currentScene->clearSelection();
|
||||
break;
|
||||
case Valentina::CutSplineTool:
|
||||
case Tool::CutSplineTool:
|
||||
ui->toolButtonSplineCutPoint->setChecked(false);
|
||||
currentScene->setFocus(Qt::OtherFocusReason);
|
||||
currentScene->clearSelection();
|
||||
break;
|
||||
case Valentina::CutSplinePathTool:
|
||||
case Tool::CutSplinePathTool:
|
||||
ui->toolButtonSplinePathCutPoint->setChecked(false);
|
||||
currentScene->setFocus(Qt::OtherFocusReason);
|
||||
currentScene->clearSelection();
|
||||
break;
|
||||
case Valentina::UnionDetails:
|
||||
case Tool::UnionDetails:
|
||||
ui->toolButtonUnionDetails->setChecked(false);
|
||||
currentScene->setFocus(Qt::OtherFocusReason);
|
||||
currentScene->clearSelection();
|
||||
break;
|
||||
case Valentina::CutArcTool:
|
||||
case Tool::CutArcTool:
|
||||
ui->toolButtonArcCutPoint->setChecked(false);
|
||||
currentScene->setFocus(Qt::OtherFocusReason);
|
||||
currentScene->clearSelection();
|
||||
break;
|
||||
case Tool::NodePoint:
|
||||
case Tool::NodeArc:
|
||||
case Tool::NodeSpline:
|
||||
case Tool::NodeSplinePath:
|
||||
default:
|
||||
qDebug()<<"Got wrong tool type. Ignored.";
|
||||
break;
|
||||
|
@ -1235,7 +1239,7 @@ void MainWindow::ArrowTool()
|
|||
{
|
||||
CancelTool();
|
||||
ui->actionArrowTool->setChecked(true);
|
||||
tool = Valentina::ArrowTool;
|
||||
tool = Tool::ArrowTool;
|
||||
QCursor cur(Qt::ArrowCursor);
|
||||
view->setCursor(cur);
|
||||
helpLabel->setText("");
|
||||
|
@ -1315,7 +1319,7 @@ void MainWindow::ActionDraw(bool checked)
|
|||
connect(view, &VMainGraphicsView::NewFactor, sceneDraw, &VMainGraphicsScene::SetFactor);
|
||||
RestoreCurrentScene();
|
||||
|
||||
mode = Valentina::Calculation;
|
||||
mode = Draw::Calculation;
|
||||
comboBoxDraws->setEnabled(true);
|
||||
comboBoxDraws->setCurrentIndex(currentDrawIndex);//restore current pattern peace
|
||||
drawMode = true;
|
||||
|
@ -1358,7 +1362,7 @@ void MainWindow::ActionDetails(bool checked)
|
|||
comboBoxDraws->setEnabled(false);
|
||||
|
||||
|
||||
mode = Valentina::Modeling;
|
||||
mode = Draw::Modeling;
|
||||
SetEnableTool(true);
|
||||
currentToolBoxIndex = ui->toolBox->currentIndex();
|
||||
ui->toolBox->setCurrentIndex(4);
|
||||
|
@ -1506,8 +1510,8 @@ void MainWindow::Clear()
|
|||
ui->actionZoomIn->setEnabled(false);
|
||||
ui->actionZoomOut->setEnabled(false);
|
||||
SetEnableTool(false);
|
||||
qApp->setPatternUnit(Valentina::Cm);
|
||||
qApp->setPatternType(Pattern::Individual);
|
||||
qApp->setPatternUnit(Unit::Cm);
|
||||
qApp->setPatternType(MeasurementsType::Individual);
|
||||
ui->toolBarOption->clear();
|
||||
#ifndef QT_NO_CURSOR
|
||||
QApplication::restoreOverrideCursor();
|
||||
|
@ -1763,7 +1767,7 @@ void MainWindow::SetEnableTool(bool enable)
|
|||
{
|
||||
bool drawTools = false;
|
||||
bool modelingTools = false;
|
||||
if (mode == Valentina::Calculation)
|
||||
if (mode == Draw::Calculation)
|
||||
{
|
||||
drawTools = enable;
|
||||
}
|
||||
|
@ -2136,11 +2140,11 @@ void MainWindow::LoadPattern(const QString &fileName)
|
|||
|
||||
QString text = tr("Measurements use different units than pattern. This pattern required measurements in %1")
|
||||
.arg(doc->UnitsToStr(qApp->patternUnit()));
|
||||
if (qApp->patternType() == Pattern::Standard)
|
||||
if (qApp->patternType() == MeasurementsType::Standard)
|
||||
{
|
||||
VStandardMeasurements m(pattern);
|
||||
m.setContent(path);
|
||||
Valentina::Units mUnit = m.Unit();
|
||||
Unit mUnit = m.MUnit();
|
||||
if (qApp->patternUnit() != mUnit)
|
||||
{
|
||||
QMessageBox::critical(this, tr("Wrong units."), text);
|
||||
|
@ -2155,7 +2159,7 @@ void MainWindow::LoadPattern(const QString &fileName)
|
|||
{
|
||||
VIndividualMeasurements m(pattern);
|
||||
m.setContent(path);
|
||||
Valentina::Units mUnit = m.Unit();
|
||||
Unit mUnit = m.MUnit();
|
||||
if (qApp->patternUnit() != mUnit)
|
||||
{
|
||||
QMessageBox::critical(this, tr("Wrong units."), text);
|
||||
|
@ -2184,7 +2188,7 @@ void MainWindow::LoadPattern(const QString &fileName)
|
|||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
QString MainWindow::CheckPathToMeasurements(const QString &path, const Pattern::Measurements &patternType)
|
||||
QString MainWindow::CheckPathToMeasurements(const QString &path, const MeasurementsType &patternType)
|
||||
{
|
||||
QFile table(path);
|
||||
if (table.exists() == false)
|
||||
|
@ -2201,7 +2205,7 @@ QString MainWindow::CheckPathToMeasurements(const QString &path, const Pattern::
|
|||
else
|
||||
{
|
||||
QString filter;
|
||||
if (patternType == Pattern::Standard)
|
||||
if (patternType == MeasurementsType::Standard)
|
||||
{
|
||||
filter = tr("Standard measurements (*.vst)");
|
||||
}
|
||||
|
@ -2217,7 +2221,7 @@ QString MainWindow::CheckPathToMeasurements(const QString &path, const Pattern::
|
|||
}
|
||||
else
|
||||
{
|
||||
if (patternType == Pattern::Standard)
|
||||
if (patternType == MeasurementsType::Standard)
|
||||
{
|
||||
VDomDocument::ValidateXML("://schema/standard_measurements.xsd", mPath);
|
||||
}
|
||||
|
|
|
@ -165,7 +165,7 @@ private:
|
|||
VPattern *doc;
|
||||
|
||||
/** @brief tool current tool */
|
||||
Valentina::Tools tool;
|
||||
Tool tool;
|
||||
|
||||
/** @brief currentScene pointer to current scene. */
|
||||
VMainGraphicsScene *currentScene;
|
||||
|
@ -199,7 +199,7 @@ private:
|
|||
QString curFile;
|
||||
|
||||
/** @brief mode keep current draw mode. */
|
||||
Valentina::Draws mode;
|
||||
Draw mode;
|
||||
|
||||
/** @brief currentDrawIndex save current selected pattern peace. */
|
||||
qint32 currentDrawIndex;
|
||||
|
@ -227,10 +227,10 @@ private:
|
|||
void MinimumScrollBar();
|
||||
|
||||
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);
|
||||
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);
|
||||
template <typename DrawTool>
|
||||
void ClosedDialog(int result);
|
||||
|
@ -250,7 +250,7 @@ private:
|
|||
void CreateActions();
|
||||
void InitAutoSave();
|
||||
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
|
||||
|
|
|
@ -29,7 +29,6 @@
|
|||
#ifndef OPTIONS_H
|
||||
#define OPTIONS_H
|
||||
|
||||
#include <QFlags>
|
||||
#include <csignal>
|
||||
|
||||
#ifdef Q_OS_WIN32
|
||||
|
@ -40,18 +39,8 @@ class QString;
|
|||
|
||||
#define SceneSize 50000
|
||||
|
||||
namespace Valentina
|
||||
{
|
||||
/**
|
||||
* @brief The Scene enum
|
||||
*/
|
||||
enum Scene { Point, Line, Spline, Arc, SplinePath, Detail };
|
||||
Q_DECLARE_FLAGS(Scenes, Scene)
|
||||
|
||||
/**
|
||||
* @brief The Tool enum
|
||||
*/
|
||||
enum Tool
|
||||
enum class SceneObject : char { Point, Line, Spline, Arc, SplinePath, Detail };
|
||||
enum class Tool : char
|
||||
{
|
||||
ArrowTool,
|
||||
SinglePointTool,
|
||||
|
@ -79,42 +68,11 @@ namespace Valentina
|
|||
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 )
|
||||
enum class Source : char { FromGui, FromFile, FromTool };
|
||||
enum class Draw : char { Calculation, Modeling };
|
||||
enum class Unit : char { Mm, Cm, Inch };
|
||||
enum class MeasurementsType : char { Standard, Individual };
|
||||
|
||||
// measurements
|
||||
extern const QString headGirth_M;
|
||||
|
|
|
@ -52,7 +52,7 @@ signals:
|
|||
* @param controlPoint new position control point.
|
||||
* @param splinePoint new position spline point.
|
||||
*/
|
||||
void RefreshLine(const qint32 &indexSpline, SplinePoint::Position pos,
|
||||
void RefreshLine(const qint32 &indexSpline, SplinePointPosition pos,
|
||||
const QPointF &controlPoint, const QPointF &splinePoint);
|
||||
/**
|
||||
* @brief setEnabledPoint disable control points.
|
||||
|
|
|
@ -37,12 +37,12 @@ const QString VToolAlongLine::ToolType = QStringLiteral("alongLine");
|
|||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VToolAlongLine::VToolAlongLine(VPattern *doc, VContainer *data, quint32 id, const QString &formula,
|
||||
const quint32 &firstPointId, const quint32 &secondPointId,
|
||||
const QString &typeLine, const Valentina::Sources &typeCreation,
|
||||
const QString &typeLine, const Source &typeCreation,
|
||||
QGraphicsItem *parent)
|
||||
:VToolLinePoint(doc, data, id, typeLine, formula, firstPointId, 0, parent), secondPointId(secondPointId)
|
||||
{
|
||||
|
||||
if (typeCreation == Valentina::FromGui)
|
||||
if (typeCreation == Source::FromGui)
|
||||
{
|
||||
AddToFile();
|
||||
}
|
||||
|
@ -170,7 +170,7 @@ VToolAlongLine* VToolAlongLine::Create(DialogTool *dialog, VMainGraphicsScene *s
|
|||
const QString pointName = dialogTool->getPointName();
|
||||
VToolAlongLine *point=nullptr;
|
||||
point = Create(0, pointName, typeLine, formula, firstPointId, secondPointId, 5, 10, scene, doc, data,
|
||||
Document::FullParse, Valentina::FromGui);
|
||||
Document::FullParse, Source::FromGui);
|
||||
if (point != nullptr)
|
||||
{
|
||||
point->dialog=dialogTool;
|
||||
|
@ -182,7 +182,7 @@ VToolAlongLine* VToolAlongLine::Create(DialogTool *dialog, VMainGraphicsScene *s
|
|||
VToolAlongLine* VToolAlongLine::Create(const quint32 _id, const QString &pointName, const QString &typeLine, QString &formula,
|
||||
const quint32 &firstPointId, const quint32 &secondPointId, const qreal &mx, const qreal &my,
|
||||
VMainGraphicsScene *scene, VPattern *doc, VContainer *data,
|
||||
const Document::Documents &parse, const Valentina::Sources &typeCreation)
|
||||
const Document &parse, const Source &typeCreation)
|
||||
{
|
||||
const VPointF *firstPoint = data->GeometricObject<const VPointF *>(firstPointId);
|
||||
const VPointF *secondPoint = data->GeometricObject<const VPointF *>(secondPointId);
|
||||
|
@ -191,7 +191,7 @@ VToolAlongLine* VToolAlongLine::Create(const quint32 _id, const QString &pointNa
|
|||
line.setLength(qApp->toPixel(CheckFormula(formula, data)));
|
||||
|
||||
quint32 id = _id;
|
||||
if (typeCreation == Valentina::FromGui)
|
||||
if (typeCreation == Source::FromGui)
|
||||
{
|
||||
id = data->AddGObject( new VPointF(line.p2().x(), line.p2().y(), pointName, mx, my));
|
||||
data->AddLine(firstPointId, id);
|
||||
|
@ -207,7 +207,7 @@ VToolAlongLine* VToolAlongLine::Create(const quint32 _id, const QString &pointNa
|
|||
doc->UpdateToolData(id, data);
|
||||
}
|
||||
}
|
||||
VDrawTool::AddRecord(id, Valentina::AlongLineTool, doc);
|
||||
VDrawTool::AddRecord(id, Tool::AlongLineTool, doc);
|
||||
if (parse == Document::FullParse)
|
||||
{
|
||||
VToolAlongLine *point = new VToolAlongLine(doc, data, id, formula, firstPointId,
|
||||
|
|
|
@ -52,7 +52,7 @@ public:
|
|||
*/
|
||||
VToolAlongLine(VPattern *doc, VContainer *data, quint32 id, const QString &formula,
|
||||
const quint32 &firstPointId, const quint32 &secondPointId, const QString &typeLine,
|
||||
const Valentina::Sources &typeCreation, QGraphicsItem * parent = nullptr);
|
||||
const Source &typeCreation, QGraphicsItem * parent = nullptr);
|
||||
/**
|
||||
* @brief setDialog set dialog when user want change tool option.
|
||||
*/
|
||||
|
@ -84,7 +84,7 @@ public:
|
|||
static VToolAlongLine* Create(const quint32 _id, const QString &pointName, const QString &typeLine, QString &formula,
|
||||
const quint32 &firstPointId, const quint32 &secondPointId, const qreal &mx, const qreal &my,
|
||||
VMainGraphicsScene *scene, VPattern *doc, VContainer *data,
|
||||
const Document::Documents &parse, const Valentina::Sources &typeCreation);
|
||||
const Document &parse, const Source &typeCreation);
|
||||
static const QString ToolType;
|
||||
public slots:
|
||||
/**
|
||||
|
|
|
@ -36,7 +36,7 @@ const QString VToolArc::TagName = QStringLiteral("arc");
|
|||
const QString VToolArc::ToolType = QStringLiteral("simple");
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VToolArc::VToolArc(VPattern *doc, VContainer *data, quint32 id, const Valentina::Sources &typeCreation,
|
||||
VToolArc::VToolArc(VPattern *doc, VContainer *data, quint32 id, const Source &typeCreation,
|
||||
QGraphicsItem *parent)
|
||||
:VDrawTool(doc, data, id), QGraphicsPathItem(parent)
|
||||
{
|
||||
|
@ -50,7 +50,7 @@ VToolArc::VToolArc(VPattern *doc, VContainer *data, quint32 id, const Valentina:
|
|||
this->setFlag(QGraphicsItem::ItemIsFocusable, true);
|
||||
this->setAcceptHoverEvents(true);
|
||||
|
||||
if (typeCreation == Valentina::FromGui)
|
||||
if (typeCreation == Source::FromGui)
|
||||
{
|
||||
AddToFile();
|
||||
}
|
||||
|
@ -84,7 +84,7 @@ VToolArc* VToolArc::Create(DialogTool *dialog, VMainGraphicsScene *scene, VPatte
|
|||
QString f1 = dialogTool->GetF1();
|
||||
QString f2 = dialogTool->GetF2();
|
||||
VToolArc* point = nullptr;
|
||||
point=Create(0, center, radius, f1, f2, scene, doc, data, Document::FullParse, Valentina::FromGui);
|
||||
point=Create(0, center, radius, f1, f2, scene, doc, data, Document::FullParse, Source::FromGui);
|
||||
if (point != nullptr)
|
||||
{
|
||||
point->dialog=dialogTool;
|
||||
|
@ -94,8 +94,8 @@ VToolArc* VToolArc::Create(DialogTool *dialog, VMainGraphicsScene *scene, VPatte
|
|||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VToolArc* VToolArc::Create(const quint32 _id, const quint32 ¢er, QString &radius, QString &f1, QString &f2,
|
||||
VMainGraphicsScene *scene, VPattern *doc, VContainer *data, const Document::Documents &parse,
|
||||
const Valentina::Sources &typeCreation)
|
||||
VMainGraphicsScene *scene, VPattern *doc, VContainer *data, const Document &parse,
|
||||
const Source &typeCreation)
|
||||
{
|
||||
qreal calcRadius = 0, calcF1 = 0, calcF2 = 0;
|
||||
|
||||
|
@ -107,7 +107,7 @@ VToolArc* VToolArc::Create(const quint32 _id, const quint32 ¢er, QString &ra
|
|||
VPointF c = *data->GeometricObject<const VPointF *>(center);
|
||||
VArc *arc = new VArc(c, calcRadius, radius, calcF1, f1, calcF2, f2 );
|
||||
quint32 id = _id;
|
||||
if (typeCreation == Valentina::FromGui)
|
||||
if (typeCreation == Source::FromGui)
|
||||
{
|
||||
id = data->AddGObject(arc);
|
||||
}
|
||||
|
@ -120,7 +120,7 @@ VToolArc* VToolArc::Create(const quint32 _id, const quint32 ¢er, QString &ra
|
|||
}
|
||||
}
|
||||
data->AddLengthArc(id);
|
||||
VDrawTool::AddRecord(id, Valentina::ArcTool, doc);
|
||||
VDrawTool::AddRecord(id, Tool::ArcTool, doc);
|
||||
if (parse == Document::FullParse)
|
||||
{
|
||||
VToolArc *toolArc = new VToolArc(doc, data, id, typeCreation);
|
||||
|
@ -213,7 +213,7 @@ void VToolArc::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
|
|||
{
|
||||
if (event->button() == Qt::LeftButton)
|
||||
{
|
||||
emit ChoosedTool(id, Valentina::Arc);
|
||||
emit ChoosedTool(id, SceneObject::Arc);
|
||||
}
|
||||
QGraphicsItem::mouseReleaseEvent(event);
|
||||
}
|
||||
|
|
|
@ -48,7 +48,7 @@ public:
|
|||
* @param typeCreation way we create this tool.
|
||||
* @param parent parent object
|
||||
*/
|
||||
VToolArc(VPattern *doc, VContainer *data, quint32 id, const Valentina::Sources &typeCreation,
|
||||
VToolArc(VPattern *doc, VContainer *data, quint32 id, const Source &typeCreation,
|
||||
QGraphicsItem * parent = nullptr);
|
||||
/**
|
||||
* @brief setDialog set dialog when user want change tool option.
|
||||
|
@ -76,8 +76,8 @@ public:
|
|||
* @param typeCreation way we create this tool.
|
||||
*/
|
||||
static VToolArc* Create(const quint32 _id, const quint32 ¢er, QString &radius, QString &f1, QString &f2,
|
||||
VMainGraphicsScene *scene, VPattern *doc, VContainer *data, const Document::Documents &parse,
|
||||
const Valentina::Sources &typeCreation);
|
||||
VMainGraphicsScene *scene, VPattern *doc, VContainer *data, const Document &parse,
|
||||
const Source &typeCreation);
|
||||
static const QString TagName;
|
||||
static const QString ToolType;
|
||||
public slots:
|
||||
|
|
|
@ -36,13 +36,13 @@ const QString VToolBisector::ToolType = QStringLiteral("bisector");
|
|||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VToolBisector::VToolBisector(VPattern *doc, VContainer *data, const quint32 &id, const QString &typeLine,
|
||||
const QString &formula, const quint32 &firstPointId, const quint32 &secondPointId,
|
||||
const quint32 &thirdPointId, const Valentina::Sources &typeCreation, QGraphicsItem *parent)
|
||||
const quint32 &thirdPointId, const Source &typeCreation, QGraphicsItem *parent)
|
||||
:VToolLinePoint(doc, data, id, typeLine, formula, secondPointId, 0, parent), firstPointId(0), thirdPointId(0)
|
||||
{
|
||||
this->firstPointId = firstPointId;
|
||||
this->thirdPointId = thirdPointId;
|
||||
|
||||
if (typeCreation == Valentina::FromGui)
|
||||
if (typeCreation == Source::FromGui)
|
||||
{
|
||||
AddToFile();
|
||||
}
|
||||
|
@ -102,7 +102,7 @@ VToolBisector* VToolBisector::Create(DialogTool *dialog, VMainGraphicsScene *sce
|
|||
const QString pointName = dialogTool->getPointName();
|
||||
VToolBisector *point = nullptr;
|
||||
point=Create(0, formula, firstPointId, secondPointId, thirdPointId, typeLine, pointName, 5, 10, scene, doc, data,
|
||||
Document::FullParse, Valentina::FromGui);
|
||||
Document::FullParse, Source::FromGui);
|
||||
if (point != nullptr)
|
||||
{
|
||||
point->dialog=dialogTool;
|
||||
|
@ -115,7 +115,7 @@ VToolBisector* VToolBisector::Create(const quint32 _id, QString &formula, const
|
|||
const quint32 &secondPointId, const quint32 &thirdPointId, const QString &typeLine,
|
||||
const QString &pointName, const qreal &mx, const qreal &my,
|
||||
VMainGraphicsScene *scene, VPattern *doc, VContainer *data,
|
||||
const Document::Documents &parse, const Valentina::Sources &typeCreation)
|
||||
const Document &parse, const Source &typeCreation)
|
||||
{
|
||||
const VPointF *firstPoint = data->GeometricObject<const VPointF *>(firstPointId);
|
||||
const VPointF *secondPoint = data->GeometricObject<const VPointF *>(secondPointId);
|
||||
|
@ -126,7 +126,7 @@ VToolBisector* VToolBisector::Create(const quint32 _id, QString &formula, const
|
|||
QPointF fPoint = VToolBisector::FindPoint(firstPoint->toQPointF(), secondPoint->toQPointF(),
|
||||
thirdPoint->toQPointF(), qApp->toPixel(result));
|
||||
quint32 id = _id;
|
||||
if (typeCreation == Valentina::FromGui)
|
||||
if (typeCreation == Source::FromGui)
|
||||
{
|
||||
id = data->AddGObject(new VPointF(fPoint.x(), fPoint.y(), pointName, mx, my));
|
||||
data->AddLine(firstPointId, id);
|
||||
|
@ -140,7 +140,7 @@ VToolBisector* VToolBisector::Create(const quint32 _id, QString &formula, const
|
|||
doc->UpdateToolData(id, data);
|
||||
}
|
||||
}
|
||||
VDrawTool::AddRecord(id, Valentina::BisectorTool, doc);
|
||||
VDrawTool::AddRecord(id, Tool::BisectorTool, doc);
|
||||
if (parse == Document::FullParse)
|
||||
{
|
||||
VToolBisector *point = new VToolBisector(doc, data, id, typeLine, formula, firstPointId, secondPointId,
|
||||
|
|
|
@ -52,7 +52,7 @@ public:
|
|||
*/
|
||||
VToolBisector(VPattern *doc, VContainer *data, const quint32 &id, const QString &typeLine,
|
||||
const QString &formula, const quint32 &firstPointId, const quint32 &secondPointId,
|
||||
const quint32 &thirdPointId, const Valentina::Sources &typeCreation,
|
||||
const quint32 &thirdPointId, const Source &typeCreation,
|
||||
QGraphicsItem * parent = nullptr);
|
||||
/**
|
||||
* @brief FindPoint find bisector point.
|
||||
|
@ -96,8 +96,8 @@ public:
|
|||
static VToolBisector* Create(const quint32 _id, QString &formula, const quint32 &firstPointId,
|
||||
const quint32 &secondPointId, const quint32 &thirdPointId, const QString &typeLine,
|
||||
const QString &pointName, const qreal &mx, const qreal &my, VMainGraphicsScene *scene,
|
||||
VPattern *doc, VContainer *data, const Document::Documents &parse,
|
||||
const Valentina::Sources &typeCreation);
|
||||
VPattern *doc, VContainer *data, const Document &parse,
|
||||
const Source &typeCreation);
|
||||
static const QString ToolType;
|
||||
public slots:
|
||||
/**
|
||||
|
|
|
@ -38,7 +38,7 @@ const QString VToolCutArc::AttrArc = QStringLiteral("arc");
|
|||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VToolCutArc::VToolCutArc(VPattern *doc, VContainer *data, const quint32 &id, const QString &formula,
|
||||
const quint32 &arcId, const quint32 &arc1id, const quint32 &arc2id,
|
||||
const Valentina::Sources &typeCreation, QGraphicsItem * parent)
|
||||
const Source &typeCreation, QGraphicsItem * parent)
|
||||
:VToolPoint(doc, data, id, parent), formula(formula), arcId(arcId), firstArc(), secondArc(), arc1id(arc1id),
|
||||
arc2id(arc2id)
|
||||
{
|
||||
|
@ -47,16 +47,16 @@ VToolCutArc::VToolCutArc(VPattern *doc, VContainer *data, const quint32 &id, con
|
|||
Q_ASSERT_X(arc2id > 0, Q_FUNC_INFO, "arc2id <= 0");
|
||||
|
||||
firstArc = new VSimpleArc(arc1id, ¤tColor, &factor);
|
||||
RefreshArc(firstArc, arc1id, SimpleArc::ForthPoint);
|
||||
RefreshArc(firstArc, arc1id, SimpleArcPoint::ForthPoint);
|
||||
firstArc->setParentItem(this);
|
||||
connect(firstArc, &VSimpleArc::Choosed, this, &VToolCutArc::ArcChoosed);
|
||||
|
||||
secondArc = new VSimpleArc(arc2id, ¤tColor, &factor);
|
||||
RefreshArc(secondArc, arc2id, SimpleArc::FirstPoint);
|
||||
RefreshArc(secondArc, arc2id, SimpleArcPoint::FirstPoint);
|
||||
secondArc->setParentItem(this);
|
||||
connect(secondArc, &VSimpleArc::Choosed, this, &VToolCutArc::ArcChoosed);
|
||||
|
||||
if (typeCreation == Valentina::FromGui)
|
||||
if (typeCreation == Source::FromGui)
|
||||
{
|
||||
AddToFile();
|
||||
}
|
||||
|
@ -89,7 +89,7 @@ VToolCutArc* VToolCutArc::Create(DialogTool *dialog, VMainGraphicsScene *scene,
|
|||
QString formula = dialogTool->getFormula();
|
||||
const quint32 arcId = dialogTool->getArcId();
|
||||
VToolCutArc* point = nullptr;
|
||||
point=Create(0, pointName, formula, arcId, 5, 10, scene, doc, data, Document::FullParse, Valentina::FromGui);
|
||||
point=Create(0, pointName, formula, arcId, 5, 10, scene, doc, data, Document::FullParse, Source::FromGui);
|
||||
if (point != nullptr)
|
||||
{
|
||||
point->dialog=dialogTool;
|
||||
|
@ -100,7 +100,7 @@ VToolCutArc* VToolCutArc::Create(DialogTool *dialog, VMainGraphicsScene *scene,
|
|||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VToolCutArc* VToolCutArc::Create(const quint32 _id, const QString &pointName, QString &formula, const quint32 &arcId,
|
||||
const qreal &mx, const qreal &my, VMainGraphicsScene *scene, VPattern *doc,
|
||||
VContainer *data, const Document::Documents &parse, const Valentina::Sources &typeCreation)
|
||||
VContainer *data, const Document &parse, const Source &typeCreation)
|
||||
{
|
||||
const VArc *arc = data->GeometricObject<const VArc *>(arcId);
|
||||
|
||||
|
@ -113,7 +113,7 @@ VToolCutArc* VToolCutArc::Create(const quint32 _id, const QString &pointName, QS
|
|||
quint32 id = _id;
|
||||
quint32 arc1id = 0;
|
||||
quint32 arc2id = 0;
|
||||
if (typeCreation == Valentina::FromGui)
|
||||
if (typeCreation == Source::FromGui)
|
||||
{
|
||||
VPointF *p = new VPointF(point.x(), point.y(), pointName, mx, my);
|
||||
id = data->AddGObject(p);
|
||||
|
@ -146,7 +146,7 @@ VToolCutArc* VToolCutArc::Create(const quint32 _id, const QString &pointName, QS
|
|||
data->AddLengthArc(arc1id);
|
||||
data->AddLengthArc(arc2id);
|
||||
|
||||
VDrawTool::AddRecord(id, Valentina::CutArcTool, doc);
|
||||
VDrawTool::AddRecord(id, Tool::CutArcTool, doc);
|
||||
if (parse == Document::FullParse)
|
||||
{
|
||||
VToolCutArc *point = new VToolCutArc(doc, data, id, formula, arcId, arc1id, arc2id, typeCreation);
|
||||
|
@ -177,7 +177,7 @@ void VToolCutArc::FullUpdateFromFile()
|
|||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolCutArc::ArcChoosed(quint32 id)
|
||||
{
|
||||
emit ChoosedTool(id, Valentina::Arc);
|
||||
emit ChoosedTool(id, SceneObject::Arc);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
|
@ -252,8 +252,8 @@ void VToolCutArc::RefreshDataInFile()
|
|||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolCutArc::RefreshGeometry()
|
||||
{
|
||||
RefreshArc(firstArc, arc1id, SimpleArc::ForthPoint);
|
||||
RefreshArc(secondArc, arc2id, SimpleArc::FirstPoint);
|
||||
RefreshArc(firstArc, arc1id, SimpleArcPoint::ForthPoint);
|
||||
RefreshArc(secondArc, arc2id, SimpleArcPoint::FirstPoint);
|
||||
VToolPoint::RefreshPointGeometry(*VDrawTool::data.GeometricObject<const VPointF *>(id));
|
||||
}
|
||||
|
||||
|
@ -269,13 +269,13 @@ void VToolCutArc::SaveDialog(QDomElement &domElement)
|
|||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolCutArc::RefreshArc(VSimpleArc *sArc, quint32 arcid, SimpleArc::Translation tr)
|
||||
void VToolCutArc::RefreshArc(VSimpleArc *sArc, quint32 arcid, SimpleArcPoint tr)
|
||||
{
|
||||
const VArc *arc = VAbstractTool::data.GeometricObject<const VArc *>(arcid);
|
||||
QPainterPath path;
|
||||
path.addPath(arc->GetPath());
|
||||
path.setFillRule( Qt::WindingFill );
|
||||
if (tr == SimpleArc::FirstPoint)
|
||||
if (tr == SimpleArcPoint::FirstPoint)
|
||||
{
|
||||
path.translate(-arc->GetP1().x(), -arc->GetP1().y());
|
||||
}
|
||||
|
|
|
@ -53,7 +53,7 @@ public:
|
|||
*/
|
||||
VToolCutArc(VPattern *doc, VContainer *data, const quint32 &id, const QString &formula,
|
||||
const quint32 &arcId, const quint32 &arc1id, const quint32 &arc2id,
|
||||
const Valentina::Sources &typeCreation, QGraphicsItem * parent = nullptr);
|
||||
const Source &typeCreation, QGraphicsItem * parent = nullptr);
|
||||
/**
|
||||
* @brief setDialog set dialog when user want change tool option.
|
||||
*/
|
||||
|
@ -82,7 +82,7 @@ public:
|
|||
*/
|
||||
static VToolCutArc* Create(const quint32 _id, const QString &pointName, QString &formula, const quint32 &arcId,
|
||||
const qreal &mx, const qreal &my, VMainGraphicsScene *scene, VPattern *doc,
|
||||
VContainer *data, const Document::Documents &parse, const Valentina::Sources &typeCreation);
|
||||
VContainer *data, const Document &parse, const Source &typeCreation);
|
||||
static const QString ToolType;
|
||||
static const QString AttrArc;
|
||||
public slots:
|
||||
|
@ -159,7 +159,7 @@ private:
|
|||
* @param arcid arc id.
|
||||
* @param tr arc type.
|
||||
*/
|
||||
void RefreshArc(VSimpleArc *sArc, quint32 arcid, SimpleArc::Translation tr);
|
||||
void RefreshArc(VSimpleArc *sArc, quint32 arcid, SimpleArcPoint tr);
|
||||
};
|
||||
|
||||
#endif // VTOOLCUTARC_H
|
||||
|
|
|
@ -39,7 +39,7 @@ const QString VToolCutSpline::AttrSpline = QStringLiteral("spline");
|
|||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VToolCutSpline::VToolCutSpline(VPattern *doc, VContainer *data, const quint32 &id, const QString &formula,
|
||||
const quint32 &splineId, const quint32 &spl1id, const quint32 &spl2id,
|
||||
const Valentina::Sources &typeCreation, QGraphicsItem *parent)
|
||||
const Source &typeCreation, QGraphicsItem *parent)
|
||||
:VToolPoint(doc, data, id, parent), formula(formula), splineId(splineId), firstSpline(), secondSpline(),
|
||||
spl1id(spl1id), spl2id(spl2id)
|
||||
{
|
||||
|
@ -48,16 +48,16 @@ VToolCutSpline::VToolCutSpline(VPattern *doc, VContainer *data, const quint32 &i
|
|||
Q_ASSERT_X(spl2id > 0, Q_FUNC_INFO, "spl2id <= 0");
|
||||
|
||||
firstSpline = new VSimpleSpline(spl1id, ¤tColor, &factor);
|
||||
RefreshSpline(firstSpline, spl1id, SimpleSpline::ForthPoint);
|
||||
RefreshSpline(firstSpline, spl1id, SimpleSplinePoint::ForthPoint);
|
||||
firstSpline->setParentItem(this);
|
||||
connect(firstSpline, &VSimpleSpline::Choosed, this, &VToolCutSpline::SplineChoosed);
|
||||
|
||||
secondSpline = new VSimpleSpline(spl2id, ¤tColor, &factor);
|
||||
RefreshSpline(secondSpline, spl2id, SimpleSpline::FirstPoint);
|
||||
RefreshSpline(secondSpline, spl2id, SimpleSplinePoint::FirstPoint);
|
||||
secondSpline->setParentItem(this);
|
||||
connect(secondSpline, &VSimpleSpline::Choosed, this, &VToolCutSpline::SplineChoosed);
|
||||
|
||||
if (typeCreation == Valentina::FromGui)
|
||||
if (typeCreation == Source::FromGui)
|
||||
{
|
||||
AddToFile();
|
||||
}
|
||||
|
@ -89,13 +89,13 @@ void VToolCutSpline::Create(DialogTool *dialog, VMainGraphicsScene *scene,
|
|||
const QString pointName = dialogTool->getPointName();
|
||||
QString formula = dialogTool->getFormula();
|
||||
const quint32 splineId = dialogTool->getSplineId();
|
||||
Create(0, pointName, formula, splineId, 5, 10, scene, doc, data, Document::FullParse, Valentina::FromGui);
|
||||
Create(0, pointName, formula, splineId, 5, 10, scene, doc, data, Document::FullParse, Source::FromGui);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolCutSpline::Create(const quint32 _id, const QString &pointName, QString &formula, const quint32 &splineId,
|
||||
const qreal &mx, const qreal &my, VMainGraphicsScene *scene, VPattern *doc,
|
||||
VContainer *data, const Document::Documents &parse, const Valentina::Sources &typeCreation)
|
||||
VContainer *data, const Document &parse, const Source &typeCreation)
|
||||
{
|
||||
const VSpline *spl = data->GeometricObject<const VSpline *>(splineId);
|
||||
|
||||
|
@ -107,7 +107,7 @@ void VToolCutSpline::Create(const quint32 _id, const QString &pointName, QString
|
|||
quint32 id = _id;
|
||||
quint32 spl1id = 0;
|
||||
quint32 spl2id = 0;
|
||||
if (typeCreation == Valentina::FromGui)
|
||||
if (typeCreation == Source::FromGui)
|
||||
{
|
||||
VPointF *p = new VPointF(point.x(), point.y(), pointName, mx, my);
|
||||
id = data->AddGObject(p);
|
||||
|
@ -141,7 +141,7 @@ void VToolCutSpline::Create(const quint32 _id, const QString &pointName, QString
|
|||
doc->UpdateToolData(id, data);
|
||||
}
|
||||
}
|
||||
VDrawTool::AddRecord(id, Valentina::CutSplineTool, doc);
|
||||
VDrawTool::AddRecord(id, Tool::CutSplineTool, doc);
|
||||
if (parse == Document::FullParse)
|
||||
{
|
||||
VToolCutSpline *point = new VToolCutSpline(doc, data, id, formula, splineId, spl1id, spl2id, typeCreation);
|
||||
|
@ -170,7 +170,7 @@ void VToolCutSpline::FullUpdateFromFile()
|
|||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolCutSpline::SplineChoosed(quint32 id)
|
||||
{
|
||||
emit ChoosedTool(id, Valentina::Spline);
|
||||
emit ChoosedTool(id, SceneObject::Spline);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
|
@ -240,8 +240,8 @@ void VToolCutSpline::RefreshDataInFile()
|
|||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolCutSpline::RefreshGeometry()
|
||||
{
|
||||
RefreshSpline(firstSpline, spl1id, SimpleSpline::ForthPoint);
|
||||
RefreshSpline(secondSpline, spl2id, SimpleSpline::FirstPoint);
|
||||
RefreshSpline(firstSpline, spl1id, SimpleSplinePoint::ForthPoint);
|
||||
RefreshSpline(secondSpline, spl2id, SimpleSplinePoint::FirstPoint);
|
||||
VToolPoint::RefreshPointGeometry(*VDrawTool::data.GeometricObject<const VPointF *>(id));
|
||||
}
|
||||
|
||||
|
@ -263,13 +263,13 @@ void VToolCutSpline::SaveDialog(QDomElement &domElement)
|
|||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolCutSpline::RefreshSpline(VSimpleSpline *spline, quint32 splid, SimpleSpline::Translation tr)
|
||||
void VToolCutSpline::RefreshSpline(VSimpleSpline *spline, quint32 splid, SimpleSplinePoint tr)
|
||||
{
|
||||
const VSpline *spl = VAbstractTool::data.GeometricObject<const VSpline *>(splid);
|
||||
QPainterPath path;
|
||||
path.addPath(spl->GetPath());
|
||||
path.setFillRule( Qt::WindingFill );
|
||||
if (tr == SimpleSpline::FirstPoint)
|
||||
if (tr == SimpleSplinePoint::FirstPoint)
|
||||
{
|
||||
path.translate(-spl->GetP1().toQPointF().x(), -spl->GetP1().toQPointF().y());
|
||||
}
|
||||
|
|
|
@ -51,7 +51,7 @@ public:
|
|||
*/
|
||||
VToolCutSpline(VPattern *doc, VContainer *data, const quint32 &id, const QString &formula,
|
||||
const quint32 &splineId, const quint32 &spl1id, const quint32 &spl2id,
|
||||
const Valentina::Sources &typeCreation, QGraphicsItem * parent = nullptr);
|
||||
const Source &typeCreation, QGraphicsItem * parent = nullptr);
|
||||
/**
|
||||
* @brief setDialog set dialog when user want change tool option.
|
||||
*/
|
||||
|
@ -80,7 +80,7 @@ public:
|
|||
*/
|
||||
static void Create(const quint32 _id, const QString &pointName, QString &formula, const quint32 &splineId,
|
||||
const qreal &mx, const qreal &my, VMainGraphicsScene *scene, VPattern *doc, VContainer *data,
|
||||
const Document::Documents &parse, const Valentina::Sources &typeCreation);
|
||||
const Document &parse, const Source &typeCreation);
|
||||
static const QString ToolType;
|
||||
static const QString AttrSpline;
|
||||
public slots:
|
||||
|
@ -161,7 +161,7 @@ private:
|
|||
* @param splid spline id.
|
||||
* @param tr spline type.
|
||||
*/
|
||||
void RefreshSpline(VSimpleSpline *spline, quint32 splid, SimpleSpline::Translation tr);
|
||||
void RefreshSpline(VSimpleSpline *spline, quint32 splid, SimpleSplinePoint tr);
|
||||
};
|
||||
|
||||
#endif // VTOOLCUTSPLINE_H
|
||||
|
|
|
@ -40,7 +40,7 @@ const QString VToolCutSplinePath::AttrSplinePath = QStringLiteral("splinePath");
|
|||
VToolCutSplinePath::VToolCutSplinePath(VPattern *doc, VContainer *data, const quint32 &id,
|
||||
const QString &formula, const quint32 &splinePathId,
|
||||
const quint32 &splPath1id, const quint32 &splPath2id,
|
||||
const Valentina::Sources &typeCreation, QGraphicsItem *parent)
|
||||
const Source &typeCreation, QGraphicsItem *parent)
|
||||
:VToolPoint(doc, data, id, parent), formula(formula), splinePathId(splinePathId), firstSpline(), secondSpline(),
|
||||
splPath1id (splPath1id), splPath2id(splPath2id)
|
||||
{
|
||||
|
@ -49,16 +49,16 @@ VToolCutSplinePath::VToolCutSplinePath(VPattern *doc, VContainer *data, const qu
|
|||
Q_ASSERT_X(splPath2id > 0, Q_FUNC_INFO, "spl2id <= 0");
|
||||
|
||||
firstSpline = new VSimpleSpline(splPath1id, ¤tColor, &factor);
|
||||
RefreshSpline(firstSpline, splPath1id, SimpleSpline::ForthPoint);
|
||||
RefreshSpline(firstSpline, splPath1id, SimpleSplinePoint::ForthPoint);
|
||||
firstSpline->setParentItem(this);
|
||||
connect(firstSpline, &VSimpleSpline::Choosed, this, &VToolCutSplinePath::SplineChoosed);
|
||||
|
||||
secondSpline = new VSimpleSpline(splPath2id, ¤tColor, &factor);
|
||||
RefreshSpline(secondSpline, splPath2id, SimpleSpline::FirstPoint);
|
||||
RefreshSpline(secondSpline, splPath2id, SimpleSplinePoint::FirstPoint);
|
||||
secondSpline->setParentItem(this);
|
||||
connect(secondSpline, &VSimpleSpline::Choosed, this, &VToolCutSplinePath::SplineChoosed);
|
||||
|
||||
if (typeCreation == Valentina::FromGui)
|
||||
if (typeCreation == Source::FromGui)
|
||||
{
|
||||
AddToFile();
|
||||
}
|
||||
|
@ -89,14 +89,14 @@ void VToolCutSplinePath::Create(DialogTool *dialog, VMainGraphicsScene *scene, V
|
|||
const QString pointName = dialogTool->getPointName();
|
||||
QString formula = dialogTool->getFormula();
|
||||
const quint32 splinePathId = dialogTool->getSplinePathId();
|
||||
Create(0, pointName, formula, splinePathId, 5, 10, scene, doc, data, Document::FullParse, Valentina::FromGui);
|
||||
Create(0, pointName, formula, splinePathId, 5, 10, scene, doc, data, Document::FullParse, Source::FromGui);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolCutSplinePath::Create(const quint32 _id, const QString &pointName, QString &formula,
|
||||
const quint32 &splinePathId, const qreal &mx, const qreal &my,
|
||||
VMainGraphicsScene *scene, VPattern *doc, VContainer *data,
|
||||
const Document::Documents &parse, const Valentina::Sources &typeCreation)
|
||||
const Document &parse, const Source &typeCreation)
|
||||
{
|
||||
const VSplinePath *splPath = data->GeometricObject<const VSplinePath *>(splinePathId);
|
||||
SCASSERT(splPath != nullptr);
|
||||
|
@ -109,7 +109,7 @@ void VToolCutSplinePath::Create(const quint32 _id, const QString &pointName, QSt
|
|||
|
||||
const QPointF point = splPath->CutSplinePath(qApp->toPixel(result), p1, p2, spl1p2, spl1p3, spl2p2, spl2p3);
|
||||
VPointF *p = new VPointF(point.x(), point.y(), pointName, mx, my);
|
||||
if (typeCreation == Valentina::FromGui)
|
||||
if (typeCreation == Source::FromGui)
|
||||
{
|
||||
id = data->AddGObject(p);
|
||||
}
|
||||
|
@ -128,7 +128,7 @@ void VToolCutSplinePath::Create(const quint32 _id, const QString &pointName, QSt
|
|||
|
||||
VSplinePath *splPath1 = new VSplinePath();
|
||||
VSplinePath *splPath2 = new VSplinePath();
|
||||
if (typeCreation == Valentina::FromGui)
|
||||
if (typeCreation == Source::FromGui)
|
||||
{
|
||||
for (qint32 i = 0; i < splPath->CountPoint(); i++)
|
||||
{
|
||||
|
@ -215,7 +215,7 @@ void VToolCutSplinePath::Create(const quint32 _id, const QString &pointName, QSt
|
|||
doc->UpdateToolData(id, data);
|
||||
}
|
||||
}
|
||||
VDrawTool::AddRecord(id, Valentina::CutSplinePathTool, doc);
|
||||
VDrawTool::AddRecord(id, Tool::CutSplinePathTool, doc);
|
||||
if (parse == Document::FullParse)
|
||||
{
|
||||
VToolCutSplinePath *point = new VToolCutSplinePath(doc, data, id, formula, splinePathId, splPath1id,
|
||||
|
@ -245,7 +245,7 @@ void VToolCutSplinePath::FullUpdateFromFile()
|
|||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolCutSplinePath::SplineChoosed(quint32 id)
|
||||
{
|
||||
emit ChoosedTool(id, Valentina::SplinePath);
|
||||
emit ChoosedTool(id, SceneObject::SplinePath);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
|
@ -315,8 +315,8 @@ void VToolCutSplinePath::RefreshDataInFile()
|
|||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolCutSplinePath::RefreshGeometry()
|
||||
{
|
||||
RefreshSpline(firstSpline, splPath1id, SimpleSpline::ForthPoint);
|
||||
RefreshSpline(secondSpline, splPath2id, SimpleSpline::FirstPoint);
|
||||
RefreshSpline(firstSpline, splPath1id, SimpleSplinePoint::ForthPoint);
|
||||
RefreshSpline(secondSpline, splPath2id, SimpleSplinePoint::FirstPoint);
|
||||
VToolPoint::RefreshPointGeometry(*VDrawTool::data.GeometricObject<const VPointF *>(id));
|
||||
}
|
||||
|
||||
|
@ -338,13 +338,13 @@ void VToolCutSplinePath::SaveDialog(QDomElement &domElement)
|
|||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolCutSplinePath::RefreshSpline(VSimpleSpline *spline, quint32 splPathid, SimpleSpline::Translation tr)
|
||||
void VToolCutSplinePath::RefreshSpline(VSimpleSpline *spline, quint32 splPathid, SimpleSplinePoint tr)
|
||||
{
|
||||
const VSplinePath *splPath = VAbstractTool::data.GeometricObject<const VSplinePath *>(splPathid);
|
||||
QPainterPath path;
|
||||
path.addPath(splPath->GetPath());
|
||||
path.setFillRule( Qt::WindingFill );
|
||||
if (tr == SimpleSpline::FirstPoint)
|
||||
if (tr == SimpleSplinePoint::FirstPoint)
|
||||
{
|
||||
VSpline spl = splPath->GetSpline(1);
|
||||
path.translate(-spl.GetP1().toQPointF().x(), -spl.GetP1().toQPointF().y());
|
||||
|
|
|
@ -54,7 +54,7 @@ public:
|
|||
*/
|
||||
VToolCutSplinePath(VPattern *doc, VContainer *data, const quint32 &id, const QString &formula,
|
||||
const quint32 &splinePathId, const quint32 &splPath1id, const quint32 &splPath2id,
|
||||
const Valentina::Sources &typeCreation, QGraphicsItem * parent = nullptr);
|
||||
const Source &typeCreation, QGraphicsItem * parent = nullptr);
|
||||
/**
|
||||
* @brief setDialog set dialog when user want change tool option.
|
||||
*/
|
||||
|
@ -83,7 +83,7 @@ public:
|
|||
*/
|
||||
static void Create(const quint32 _id, const QString &pointName, QString &formula, const quint32 &splinePathId,
|
||||
const qreal &mx, const qreal &my, VMainGraphicsScene *scene, VPattern *doc, VContainer *data,
|
||||
const Document::Documents &parse, const Valentina::Sources &typeCreation);
|
||||
const Document &parse, const Source &typeCreation);
|
||||
static const QString ToolType;
|
||||
static const QString AttrSplinePath;
|
||||
public slots:
|
||||
|
@ -164,7 +164,7 @@ private:
|
|||
* @param splPathid splinePath id.
|
||||
* @param tr splineType type.
|
||||
*/
|
||||
void RefreshSpline(VSimpleSpline *spline, quint32 splPathid, SimpleSpline::Translation tr);
|
||||
void RefreshSpline(VSimpleSpline *spline, quint32 splPathid, SimpleSplinePoint tr);
|
||||
};
|
||||
|
||||
#endif // VTOOLCUTSPLINEPATH_H
|
||||
|
|
|
@ -38,11 +38,11 @@ const QString VToolEndLine::ToolType = QStringLiteral("endLine");
|
|||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VToolEndLine::VToolEndLine(VPattern *doc, VContainer *data, const quint32 &id, const QString &typeLine,
|
||||
const QString &formula, const qreal &angle, const quint32 &basePointId,
|
||||
const Valentina::Sources &typeCreation, QGraphicsItem *parent)
|
||||
const Source &typeCreation, QGraphicsItem *parent)
|
||||
:VToolLinePoint(doc, data, id, typeLine, formula, basePointId, angle, parent)
|
||||
{
|
||||
|
||||
if (typeCreation == Valentina::FromGui)
|
||||
if (typeCreation == Source::FromGui)
|
||||
{
|
||||
AddToFile();
|
||||
}
|
||||
|
@ -80,7 +80,7 @@ VToolEndLine* VToolEndLine::Create(DialogTool *dialog, VMainGraphicsScene *scene
|
|||
|
||||
VToolEndLine *point = nullptr;
|
||||
point=Create(0, pointName, typeLine, formula, angle, basePointId, 5, 10, scene, doc, data, Document::FullParse,
|
||||
Valentina::FromGui);
|
||||
Source::FromGui);
|
||||
if (point != nullptr)
|
||||
{
|
||||
point->dialog=dialogTool;
|
||||
|
@ -92,7 +92,7 @@ VToolEndLine* VToolEndLine::Create(DialogTool *dialog, VMainGraphicsScene *scene
|
|||
VToolEndLine* VToolEndLine::Create(const quint32 _id, const QString &pointName, const QString &typeLine,
|
||||
QString &formula, const qreal &angle, const quint32 &basePointId,
|
||||
const qreal &mx, const qreal &my, VMainGraphicsScene *scene, VPattern *doc,
|
||||
VContainer *data, const Document::Documents &parse, const Valentina::Sources &typeCreation)
|
||||
VContainer *data, const Document &parse, const Source &typeCreation)
|
||||
{
|
||||
const VPointF *basePoint = data->GeometricObject<const VPointF *>(basePointId);
|
||||
QLineF line = QLineF(basePoint->toQPointF(), QPointF(basePoint->x()+100, basePoint->y()));
|
||||
|
@ -100,7 +100,7 @@ VToolEndLine* VToolEndLine::Create(const quint32 _id, const QString &pointName,
|
|||
line.setLength(qApp->toPixel(CheckFormula(formula, data)));
|
||||
line.setAngle(angle);
|
||||
quint32 id = _id;
|
||||
if (typeCreation == Valentina::FromGui)
|
||||
if (typeCreation == Source::FromGui)
|
||||
{
|
||||
id = data->AddGObject(new VPointF(line.p2().x(), line.p2().y(), pointName, mx, my));
|
||||
data->AddLine(basePointId, id);
|
||||
|
@ -114,7 +114,7 @@ VToolEndLine* VToolEndLine::Create(const quint32 _id, const QString &pointName,
|
|||
doc->UpdateToolData(id, data);
|
||||
}
|
||||
}
|
||||
VDrawTool::AddRecord(id, Valentina::EndLineTool, doc);
|
||||
VDrawTool::AddRecord(id, Tool::EndLineTool, doc);
|
||||
if (parse == Document::FullParse)
|
||||
{
|
||||
VToolEndLine *point = new VToolEndLine(doc, data, id, typeLine, formula, angle,
|
||||
|
|
|
@ -52,7 +52,7 @@ public:
|
|||
*/
|
||||
VToolEndLine(VPattern *doc, VContainer *data, const quint32 &id, const QString &typeLine,
|
||||
const QString &formula, const qreal &angle, const quint32 &basePointId,
|
||||
const Valentina::Sources &typeCreation, QGraphicsItem * parent = nullptr);
|
||||
const Source &typeCreation, QGraphicsItem * parent = nullptr);
|
||||
/**
|
||||
* @brief setDialog set dialog when user want change tool option.
|
||||
*/
|
||||
|
@ -86,7 +86,7 @@ public:
|
|||
static VToolEndLine *Create(const quint32 _id, const QString &pointName, const QString &typeLine,
|
||||
QString &formula, const qreal &angle, const quint32 &basePointId, const qreal &mx,
|
||||
const qreal &my, VMainGraphicsScene *scene, VPattern *doc, VContainer *data,
|
||||
const Document::Documents &parse, const Valentina::Sources &typeCreation);
|
||||
const Document &parse, const Source &typeCreation);
|
||||
static const QString ToolType;
|
||||
public slots:
|
||||
/**
|
||||
|
|
|
@ -35,11 +35,11 @@ const QString VToolHeight::ToolType = QStringLiteral("height");
|
|||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VToolHeight::VToolHeight(VPattern *doc, VContainer *data, const quint32 &id, const QString &typeLine,
|
||||
const quint32 &basePointId, const quint32 &p1LineId, const quint32 &p2LineId,
|
||||
const Valentina::Sources &typeCreation, QGraphicsItem * parent)
|
||||
const Source &typeCreation, QGraphicsItem * parent)
|
||||
:VToolLinePoint(doc, data, id, typeLine, QString(), basePointId, 0, parent), p1LineId(p1LineId), p2LineId(p2LineId)
|
||||
{
|
||||
ignoreFullUpdate = true;
|
||||
if (typeCreation == Valentina::FromGui)
|
||||
if (typeCreation == Source::FromGui)
|
||||
{
|
||||
AddToFile();
|
||||
}
|
||||
|
@ -77,14 +77,14 @@ void VToolHeight::Create(DialogTool *dialog, VMainGraphicsScene *scene, VPattern
|
|||
const quint32 p1LineId = dialogTool->getP1LineId();
|
||||
const quint32 p2LineId = dialogTool->getP2LineId();
|
||||
Create(0, pointName, typeLine, basePointId, p1LineId, p2LineId, 5, 10, scene, doc, data,
|
||||
Document::FullParse, Valentina::FromGui);
|
||||
Document::FullParse, Source::FromGui);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolHeight::Create(const quint32 _id, const QString &pointName, const QString &typeLine,
|
||||
const quint32 &basePointId, const quint32 &p1LineId, const quint32 &p2LineId,
|
||||
const qreal &mx, const qreal &my, VMainGraphicsScene *scene, VPattern *doc,
|
||||
VContainer *data, const Document::Documents &parse, const Valentina::Sources &typeCreation)
|
||||
VContainer *data, const Document &parse, const Source &typeCreation)
|
||||
{
|
||||
const VPointF *basePoint = data->GeometricObject<const VPointF *>(basePointId);
|
||||
const VPointF *p1Line = data->GeometricObject<const VPointF *>(p1LineId);
|
||||
|
@ -92,7 +92,7 @@ void VToolHeight::Create(const quint32 _id, const QString &pointName, const QStr
|
|||
|
||||
QPointF pHeight = FindPoint(QLineF(p1Line->toQPointF(), p2Line->toQPointF()), basePoint->toQPointF());
|
||||
quint32 id = _id;
|
||||
if (typeCreation == Valentina::FromGui)
|
||||
if (typeCreation == Source::FromGui)
|
||||
{
|
||||
id = data->AddGObject(new VPointF(pHeight.x(), pHeight.y(), pointName, mx, my));
|
||||
data->AddLine(basePointId, id);
|
||||
|
@ -110,7 +110,7 @@ void VToolHeight::Create(const quint32 _id, const QString &pointName, const QStr
|
|||
doc->UpdateToolData(id, data);
|
||||
}
|
||||
}
|
||||
VDrawTool::AddRecord(id, Valentina::Height, doc);
|
||||
VDrawTool::AddRecord(id, Tool::Height, doc);
|
||||
if (parse == Document::FullParse)
|
||||
{
|
||||
VToolHeight *point = new VToolHeight(doc, data, id, typeLine, basePointId, p1LineId, p2LineId,
|
||||
|
|
|
@ -52,7 +52,7 @@ public:
|
|||
*/
|
||||
VToolHeight(VPattern *doc, VContainer *data, const quint32 &id, const QString &typeLine,
|
||||
const quint32 &basePointId, const quint32 &p1LineId, const quint32 &p2LineId,
|
||||
const Valentina::Sources &typeCreation, QGraphicsItem * parent = nullptr);
|
||||
const Source &typeCreation, QGraphicsItem * parent = nullptr);
|
||||
/**
|
||||
* @brief setDialog set dialog when user want change tool option.
|
||||
*/
|
||||
|
@ -84,7 +84,7 @@ public:
|
|||
static void Create(const quint32 _id, const QString &pointName, const QString &typeLine,
|
||||
const quint32 &basePointId, const quint32 &p1LineId, const quint32 &p2LineId,
|
||||
const qreal &mx, const qreal &my, VMainGraphicsScene *scene, VPattern *doc,
|
||||
VContainer *data, const Document::Documents &parse, const Valentina::Sources &typeCreation);
|
||||
VContainer *data, const Document &parse, const Source &typeCreation);
|
||||
/**
|
||||
* @brief FindPoint find projection base point onto line.
|
||||
* @param line line
|
||||
|
|
|
@ -36,7 +36,7 @@ const QString VToolLine::TagName = QStringLiteral("line");
|
|||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VToolLine::VToolLine(VPattern *doc, VContainer *data, quint32 id, quint32 firstPoint, quint32 secondPoint,
|
||||
const QString &typeLine, const Valentina::Sources &typeCreation, QGraphicsItem *parent)
|
||||
const QString &typeLine, const Source &typeCreation, QGraphicsItem *parent)
|
||||
:VDrawTool(doc, data, id), QGraphicsLineItem(parent), firstPoint(firstPoint), secondPoint(secondPoint)
|
||||
{
|
||||
this->typeLine = typeLine;
|
||||
|
@ -51,7 +51,7 @@ VToolLine::VToolLine(VPattern *doc, VContainer *data, quint32 id, quint32 firstP
|
|||
this->setAcceptHoverEvents(true);
|
||||
this->setPen(QPen(Qt::black, qApp->toPixel(qApp->widthHairLine())/factor, LineStyle()));
|
||||
|
||||
if (typeCreation == Valentina::FromGui)
|
||||
if (typeCreation == Source::FromGui)
|
||||
{
|
||||
AddToFile();
|
||||
}
|
||||
|
@ -81,19 +81,19 @@ void VToolLine::Create(DialogTool *dialog, VMainGraphicsScene *scene, VPattern *
|
|||
const quint32 firstPoint = dialogTool->getFirstPoint();
|
||||
const quint32 secondPoint = dialogTool->getSecondPoint();
|
||||
const QString typeLine = dialogTool->getTypeLine();
|
||||
Create(0, firstPoint, secondPoint, typeLine, scene, doc, data, Document::FullParse, Valentina::FromGui);
|
||||
Create(0, firstPoint, secondPoint, typeLine, scene, doc, data, Document::FullParse, Source::FromGui);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolLine::Create(const quint32 &_id, const quint32 &firstPoint, const quint32 &secondPoint,
|
||||
const QString &typeLine, VMainGraphicsScene *scene, VPattern *doc, VContainer *data,
|
||||
const Document::Documents &parse, const Valentina::Sources &typeCreation)
|
||||
const Document &parse, const Source &typeCreation)
|
||||
{
|
||||
SCASSERT(scene != nullptr);
|
||||
SCASSERT(doc != nullptr);
|
||||
SCASSERT(data != nullptr);
|
||||
quint32 id = _id;
|
||||
if (typeCreation == Valentina::FromGui)
|
||||
if (typeCreation == Source::FromGui)
|
||||
{
|
||||
id = data->getNextId();
|
||||
data->AddLine(firstPoint, secondPoint);
|
||||
|
@ -107,7 +107,7 @@ void VToolLine::Create(const quint32 &_id, const quint32 &firstPoint, const quin
|
|||
doc->UpdateToolData(id, data);
|
||||
}
|
||||
}
|
||||
VDrawTool::AddRecord(id, Valentina::LineTool, doc);
|
||||
VDrawTool::AddRecord(id, Tool::LineTool, doc);
|
||||
if (parse == Document::FullParse)
|
||||
{
|
||||
VToolLine *line = new VToolLine(doc, data, id, firstPoint, secondPoint, typeLine, typeCreation);
|
||||
|
|
|
@ -51,7 +51,7 @@ public:
|
|||
* @param parent parent object.
|
||||
*/
|
||||
VToolLine(VPattern *doc, VContainer *data, quint32 id, quint32 firstPoint,
|
||||
quint32 secondPoint, const QString &typeLine, const Valentina::Sources &typeCreation,
|
||||
quint32 secondPoint, const QString &typeLine, const Source &typeCreation,
|
||||
QGraphicsItem * parent = nullptr);
|
||||
/**
|
||||
* @brief setDialog set dialog when user want change tool option.
|
||||
|
@ -79,7 +79,7 @@ public:
|
|||
*/
|
||||
static void Create(const quint32 &_id, const quint32 &firstPoint, const quint32 &secondPoint,
|
||||
const QString &typeLine, VMainGraphicsScene *scene, VPattern *doc, VContainer *data,
|
||||
const Document::Documents &parse, const Valentina::Sources &typeCreation);
|
||||
const Document &parse, const Source &typeCreation);
|
||||
static const QString TagName;
|
||||
public slots:
|
||||
/**
|
||||
|
|
|
@ -35,13 +35,13 @@ const QString VToolLineIntersect::ToolType = QStringLiteral("lineIntersect");
|
|||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VToolLineIntersect::VToolLineIntersect(VPattern *doc, VContainer *data, const quint32 &id,
|
||||
const quint32 &p1Line1, const quint32 &p2Line1, const quint32 &p1Line2,
|
||||
const quint32 &p2Line2, const Valentina::Sources &typeCreation,
|
||||
const quint32 &p2Line2, const Source &typeCreation,
|
||||
QGraphicsItem *parent)
|
||||
:VToolPoint(doc, data, id, parent), p1Line1(p1Line1), p2Line1(p2Line1), p1Line2(p1Line2),
|
||||
p2Line2(p2Line2)
|
||||
{
|
||||
ignoreFullUpdate = true;
|
||||
if (typeCreation == Valentina::FromGui)
|
||||
if (typeCreation == Source::FromGui)
|
||||
{
|
||||
AddToFile();
|
||||
}
|
||||
|
@ -77,15 +77,15 @@ void VToolLineIntersect::Create(DialogTool *dialog, VMainGraphicsScene *scene, V
|
|||
const quint32 p2Line2Id = dialogTool->getP2Line2();
|
||||
const QString pointName = dialogTool->getPointName();
|
||||
Create(0, p1Line1Id, p2Line1Id, p1Line2Id, p2Line2Id, pointName, 5, 10, scene, doc, data,
|
||||
Document::FullParse, Valentina::FromGui);
|
||||
Document::FullParse, Source::FromGui);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolLineIntersect::Create(const quint32 _id, const quint32 &p1Line1Id, const quint32 &p2Line1Id,
|
||||
const quint32 &p1Line2Id, const quint32 &p2Line2Id, const QString &pointName,
|
||||
const qreal &mx, const qreal &my, VMainGraphicsScene *scene,
|
||||
VPattern *doc, VContainer *data, const Document::Documents &parse,
|
||||
const Valentina::Sources &typeCreation)
|
||||
VPattern *doc, VContainer *data, const Document &parse,
|
||||
const Source &typeCreation)
|
||||
{
|
||||
const VPointF *p1Line1 = data->GeometricObject<const VPointF *>(p1Line1Id);
|
||||
const VPointF *p2Line1 = data->GeometricObject<const VPointF *>(p2Line1Id);
|
||||
|
@ -99,7 +99,7 @@ void VToolLineIntersect::Create(const quint32 _id, const quint32 &p1Line1Id, con
|
|||
if (intersect == QLineF::UnboundedIntersection || intersect == QLineF::BoundedIntersection)
|
||||
{
|
||||
quint32 id = _id;
|
||||
if (typeCreation == Valentina::FromGui)
|
||||
if (typeCreation == Source::FromGui)
|
||||
{
|
||||
id = data->AddGObject(new VPointF(fPoint.x(), fPoint.y(), pointName, mx, my));
|
||||
data->AddLine(p1Line1Id, id);
|
||||
|
@ -119,7 +119,7 @@ void VToolLineIntersect::Create(const quint32 _id, const quint32 &p1Line1Id, con
|
|||
doc->UpdateToolData(id, data);
|
||||
}
|
||||
}
|
||||
VDrawTool::AddRecord(id, Valentina::LineIntersectTool, doc);
|
||||
VDrawTool::AddRecord(id, Tool::LineIntersectTool, doc);
|
||||
if (parse == Document::FullParse)
|
||||
{
|
||||
VToolLineIntersect *point = new VToolLineIntersect(doc, data, id, p1Line1Id, p2Line1Id, p1Line2Id,
|
||||
|
|
|
@ -52,7 +52,7 @@ public:
|
|||
*/
|
||||
VToolLineIntersect(VPattern *doc, VContainer *data, const quint32 &id, const quint32 &p1Line1,
|
||||
const quint32 &p2Line1, const quint32 &p1Line2, const quint32 &p2Line2,
|
||||
const Valentina::Sources &typeCreation, QGraphicsItem * parent = nullptr);
|
||||
const Source &typeCreation, QGraphicsItem * parent = nullptr);
|
||||
/**
|
||||
* @brief setDialog set dialog when user want change tool option.
|
||||
*/
|
||||
|
@ -84,7 +84,7 @@ public:
|
|||
static void Create(const quint32 _id, const quint32 &p1Line1Id, const quint32 &p2Line1Id, const quint32 &p1Line2Id,
|
||||
const quint32 &p2Line2Id, const QString &pointName, const qreal &mx, const qreal &my,
|
||||
VMainGraphicsScene *scene, VPattern *doc, VContainer *data,
|
||||
const Document::Documents &parse, const Valentina::Sources &typeCreation);
|
||||
const Document &parse, const Source &typeCreation);
|
||||
static const QString ToolType;
|
||||
public slots:
|
||||
/**
|
||||
|
|
|
@ -36,12 +36,12 @@ const QString VToolNormal::ToolType = QStringLiteral("normal");
|
|||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VToolNormal::VToolNormal(VPattern *doc, VContainer *data, const quint32 &id, const QString &typeLine,
|
||||
const QString &formula, const qreal &angle, const quint32 &firstPointId,
|
||||
const quint32 &secondPointId, const Valentina::Sources &typeCreation, QGraphicsItem *parent)
|
||||
const quint32 &secondPointId, const Source &typeCreation, QGraphicsItem *parent)
|
||||
:VToolLinePoint(doc, data, id, typeLine, formula, firstPointId, angle, parent),
|
||||
secondPointId(secondPointId)
|
||||
{
|
||||
|
||||
if (typeCreation == Valentina::FromGui)
|
||||
if (typeCreation == Source::FromGui)
|
||||
{
|
||||
AddToFile();
|
||||
}
|
||||
|
@ -80,7 +80,7 @@ VToolNormal* VToolNormal::Create(DialogTool *dialog, VMainGraphicsScene *scene,
|
|||
const qreal angle = dialogTool->getAngle();
|
||||
VToolNormal *point = nullptr;
|
||||
point=Create(0, formula, firstPointId, secondPointId, typeLine, pointName, angle, 5, 10, scene, doc, data,
|
||||
Document::FullParse, Valentina::FromGui);
|
||||
Document::FullParse, Source::FromGui);
|
||||
if (point != nullptr)
|
||||
{
|
||||
point->dialog=dialogTool;
|
||||
|
@ -92,8 +92,8 @@ VToolNormal* VToolNormal::Create(DialogTool *dialog, VMainGraphicsScene *scene,
|
|||
VToolNormal* VToolNormal::Create(const quint32 _id, QString &formula, const quint32 &firstPointId,
|
||||
const quint32 &secondPointId, const QString &typeLine, const QString &pointName,
|
||||
const qreal angle, const qreal &mx, const qreal &my, VMainGraphicsScene *scene,
|
||||
VPattern *doc, VContainer *data, const Document::Documents &parse,
|
||||
const Valentina::Sources &typeCreation)
|
||||
VPattern *doc, VContainer *data, const Document &parse,
|
||||
const Source &typeCreation)
|
||||
{
|
||||
const VPointF *firstPoint = data->GeometricObject<const VPointF *>(firstPointId);
|
||||
const VPointF *secondPoint = data->GeometricObject<const VPointF *>(secondPointId);
|
||||
|
@ -103,7 +103,7 @@ VToolNormal* VToolNormal::Create(const quint32 _id, QString &formula, const quin
|
|||
QPointF fPoint = VToolNormal::FindPoint(firstPoint->toQPointF(), secondPoint->toQPointF(),
|
||||
qApp->toPixel(result), angle);
|
||||
quint32 id = _id;
|
||||
if (typeCreation == Valentina::FromGui)
|
||||
if (typeCreation == Source::FromGui)
|
||||
{
|
||||
id = data->AddGObject(new VPointF(fPoint.x(), fPoint.y(), pointName, mx, my));
|
||||
data->AddLine(firstPointId, id);
|
||||
|
@ -117,7 +117,7 @@ VToolNormal* VToolNormal::Create(const quint32 _id, QString &formula, const quin
|
|||
doc->UpdateToolData(id, data);
|
||||
}
|
||||
}
|
||||
VDrawTool::AddRecord(id, Valentina::NormalTool, doc);
|
||||
VDrawTool::AddRecord(id, Tool::NormalTool, doc);
|
||||
if (parse == Document::FullParse)
|
||||
{
|
||||
VToolNormal *point = new VToolNormal(doc, data, id, typeLine, formula, angle,
|
||||
|
|
|
@ -53,7 +53,7 @@ public:
|
|||
*/
|
||||
VToolNormal(VPattern *doc, VContainer *data, const quint32 &id, const QString &typeLine,
|
||||
const QString &formula, const qreal &angle, const quint32 &firstPointId,
|
||||
const quint32 &secondPointId, const Valentina::Sources &typeCreation,
|
||||
const quint32 &secondPointId, const Source &typeCreation,
|
||||
QGraphicsItem * parent = nullptr);
|
||||
/**
|
||||
* @brief setDialog set dialog when user want change tool option.
|
||||
|
@ -87,8 +87,8 @@ public:
|
|||
static VToolNormal* Create(const quint32 _id, QString &formula, const quint32 &firstPointId,
|
||||
const quint32 &secondPointId, const QString &typeLine, const QString &pointName,
|
||||
const qreal angle, const qreal &mx, const qreal &my, VMainGraphicsScene *scene,
|
||||
VPattern *doc, VContainer *data, const Document::Documents &parse,
|
||||
const Valentina::Sources &typeCreation);
|
||||
VPattern *doc, VContainer *data, const Document &parse,
|
||||
const Source &typeCreation);
|
||||
/**
|
||||
* @brief FindPoint return normal point.
|
||||
* @param firstPoint first line point.
|
||||
|
|
|
@ -127,7 +127,7 @@ void VToolPoint::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
|
|||
{
|
||||
if (event->button() == Qt::LeftButton)
|
||||
{
|
||||
emit ChoosedTool(id, Valentina::Point);
|
||||
emit ChoosedTool(id, SceneObject::Point);
|
||||
}
|
||||
QGraphicsItem::mouseReleaseEvent(event);
|
||||
}
|
||||
|
|
|
@ -37,11 +37,11 @@ const QString VToolPointOfContact::ToolType = QStringLiteral("pointOfContact");
|
|||
VToolPointOfContact::VToolPointOfContact(VPattern *doc, VContainer *data, const quint32 &id,
|
||||
const QString &radius, const quint32 ¢er,
|
||||
const quint32 &firstPointId, const quint32 &secondPointId,
|
||||
const Valentina::Sources &typeCreation, QGraphicsItem *parent)
|
||||
const Source &typeCreation, QGraphicsItem *parent)
|
||||
: VToolPoint(doc, data, id, parent), arcRadius(radius), center(center), firstPointId(firstPointId),
|
||||
secondPointId(secondPointId)
|
||||
{
|
||||
if (typeCreation == Valentina::FromGui)
|
||||
if (typeCreation == Source::FromGui)
|
||||
{
|
||||
AddToFile();
|
||||
}
|
||||
|
@ -105,7 +105,7 @@ VToolPointOfContact* VToolPointOfContact::Create(DialogTool *dialog, VMainGraphi
|
|||
const QString pointName = dialogTool->getPointName();
|
||||
VToolPointOfContact *point = nullptr;
|
||||
point=Create(0, radius, center, firstPointId, secondPointId, pointName, 5, 10, scene, doc, data,
|
||||
Document::FullParse, Valentina::FromGui);
|
||||
Document::FullParse, Source::FromGui);
|
||||
if (point != nullptr)
|
||||
{
|
||||
point->dialog=dialogTool;
|
||||
|
@ -117,7 +117,7 @@ VToolPointOfContact* VToolPointOfContact::Create(DialogTool *dialog, VMainGraphi
|
|||
VToolPointOfContact* VToolPointOfContact::Create(const quint32 _id, QString &radius, const quint32 ¢er, const quint32 &firstPointId,
|
||||
const quint32 &secondPointId, const QString &pointName, const qreal &mx,
|
||||
const qreal &my, VMainGraphicsScene *scene, VPattern *doc, VContainer *data,
|
||||
const Document::Documents &parse, const Valentina::Sources &typeCreation)
|
||||
const Document &parse, const Source &typeCreation)
|
||||
{
|
||||
const VPointF *centerP = data->GeometricObject<const VPointF *>(center);
|
||||
const VPointF *firstP = data->GeometricObject<const VPointF *>(firstPointId);
|
||||
|
@ -128,7 +128,7 @@ VToolPointOfContact* VToolPointOfContact::Create(const quint32 _id, QString &rad
|
|||
QPointF fPoint = VToolPointOfContact::FindPoint(qApp->toPixel(result), centerP->toQPointF(),
|
||||
firstP->toQPointF(), secondP->toQPointF());
|
||||
quint32 id = _id;
|
||||
if (typeCreation == Valentina::FromGui)
|
||||
if (typeCreation == Source::FromGui)
|
||||
{
|
||||
id = data->AddGObject(new VPointF(fPoint.x(), fPoint.y(), pointName, mx, my));
|
||||
data->AddLine(firstPointId, id);
|
||||
|
@ -146,7 +146,7 @@ VToolPointOfContact* VToolPointOfContact::Create(const quint32 _id, QString &rad
|
|||
doc->UpdateToolData(id, data);
|
||||
}
|
||||
}
|
||||
VDrawTool::AddRecord(id, Valentina::PointOfContact, doc);
|
||||
VDrawTool::AddRecord(id, Tool::PointOfContact, doc);
|
||||
if (parse == Document::FullParse)
|
||||
{
|
||||
VToolPointOfContact *point = new VToolPointOfContact(doc, data, id, radius, center,
|
||||
|
|
|
@ -52,7 +52,7 @@ public:
|
|||
VToolPointOfContact(VPattern *doc, VContainer *data, const quint32 &id,
|
||||
const QString &arcRadius, const quint32 ¢er,
|
||||
const quint32 &firstPointId, const quint32 &secondPointId,
|
||||
const Valentina::Sources &typeCreation, QGraphicsItem * parent = nullptr);
|
||||
const Source &typeCreation, QGraphicsItem * parent = nullptr);
|
||||
/**
|
||||
* @brief setDialog set dialog when user want change tool option.
|
||||
*/
|
||||
|
@ -94,7 +94,7 @@ public:
|
|||
static VToolPointOfContact* Create(const quint32 _id, QString &arcRadius, const quint32 ¢er,
|
||||
const quint32 &firstPointId, const quint32 &secondPointId, const QString &pointName,
|
||||
const qreal &mx, const qreal &my, VMainGraphicsScene *scene, VPattern *doc,
|
||||
VContainer *data, const Document::Documents &parse, const Valentina::Sources &typeCreation);
|
||||
VContainer *data, const Document &parse, const Source &typeCreation);
|
||||
static const QString ToolType;
|
||||
public slots:
|
||||
/**
|
||||
|
|
|
@ -35,11 +35,11 @@ const QString VToolPointOfIntersection::ToolType = QStringLiteral("pointOfInters
|
|||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VToolPointOfIntersection::VToolPointOfIntersection(VPattern *doc, VContainer *data, const quint32 &id,
|
||||
const quint32 &firstPointId, const quint32 &secondPointId,
|
||||
const Valentina::Sources &typeCreation, QGraphicsItem *parent)
|
||||
const Source &typeCreation, QGraphicsItem *parent)
|
||||
:VToolPoint(doc, data, id, parent), firstPointId(firstPointId), secondPointId(secondPointId)
|
||||
{
|
||||
ignoreFullUpdate = true;
|
||||
if (typeCreation == Valentina::FromGui)
|
||||
if (typeCreation == Source::FromGui)
|
||||
{
|
||||
AddToFile();
|
||||
}
|
||||
|
@ -71,21 +71,21 @@ void VToolPointOfIntersection::Create(DialogTool *dialog, VMainGraphicsScene *sc
|
|||
const quint32 firstPointId = dialogTool->getFirstPointId();
|
||||
const quint32 secondPointId = dialogTool->getSecondPointId();
|
||||
const QString pointName = dialogTool->getPointName();
|
||||
Create(0, pointName, firstPointId, secondPointId, 5, 10, scene, doc, data, Document::FullParse, Valentina::FromGui);
|
||||
Create(0, pointName, firstPointId, secondPointId, 5, 10, scene, doc, data, Document::FullParse, Source::FromGui);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolPointOfIntersection::Create(const quint32 _id, const QString &pointName, const quint32 &firstPointId,
|
||||
const quint32 &secondPointId, const qreal &mx, const qreal &my,
|
||||
VMainGraphicsScene *scene, VPattern *doc, VContainer *data,
|
||||
const Document::Documents &parse, const Valentina::Sources &typeCreation)
|
||||
const Document &parse, const Source &typeCreation)
|
||||
{
|
||||
const VPointF *firstPoint = data->GeometricObject<const VPointF *>(firstPointId);
|
||||
const VPointF *secondPoint = data->GeometricObject<const VPointF *>(secondPointId);
|
||||
|
||||
QPointF point(firstPoint->x(), secondPoint->y());
|
||||
quint32 id = _id;
|
||||
if (typeCreation == Valentina::FromGui)
|
||||
if (typeCreation == Source::FromGui)
|
||||
{
|
||||
id = data->AddGObject(new VPointF(point.x(), point.y(), pointName, mx, my));
|
||||
}
|
||||
|
@ -97,7 +97,7 @@ void VToolPointOfIntersection::Create(const quint32 _id, const QString &pointNam
|
|||
doc->UpdateToolData(id, data);
|
||||
}
|
||||
}
|
||||
VDrawTool::AddRecord(id, Valentina::PointOfIntersection, doc);
|
||||
VDrawTool::AddRecord(id, Tool::PointOfIntersection, doc);
|
||||
if (parse == Document::FullParse)
|
||||
{
|
||||
VToolPointOfIntersection *point = new VToolPointOfIntersection(doc, data, id, firstPointId,
|
||||
|
|
|
@ -50,7 +50,7 @@ public:
|
|||
*/
|
||||
VToolPointOfIntersection(VPattern *doc, VContainer *data, const quint32 &id,
|
||||
const quint32 &firstPointId, const quint32 &secondPointId,
|
||||
const Valentina::Sources &typeCreation, QGraphicsItem * parent = nullptr);
|
||||
const Source &typeCreation, QGraphicsItem * parent = nullptr);
|
||||
/**
|
||||
* @brief setDialog set dialog when user want change tool option.
|
||||
*/
|
||||
|
@ -79,8 +79,8 @@ public:
|
|||
*/
|
||||
static void Create(const quint32 _id, const QString &pointName, const quint32 &firstPointId,
|
||||
const quint32 &secondPointId, const qreal &mx, const qreal &my, VMainGraphicsScene *scene,
|
||||
VPattern *doc, VContainer *data, const Document::Documents &parse,
|
||||
const Valentina::Sources &typeCreation);
|
||||
VPattern *doc, VContainer *data, const Document &parse,
|
||||
const Source &typeCreation);
|
||||
static const QString ToolType;
|
||||
public slots:
|
||||
/**
|
||||
|
|
|
@ -36,11 +36,11 @@ const QString VToolShoulderPoint::ToolType = QStringLiteral("shoulder");
|
|||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VToolShoulderPoint::VToolShoulderPoint(VPattern *doc, VContainer *data, const quint32 &id, const QString &typeLine,
|
||||
const QString &formula, const quint32 &p1Line, const quint32 &p2Line,
|
||||
const quint32 &pShoulder, const Valentina::Sources &typeCreation,
|
||||
const quint32 &pShoulder, const Source &typeCreation,
|
||||
QGraphicsItem * parent)
|
||||
:VToolLinePoint(doc, data, id, typeLine, formula, p1Line, 0, parent), p2Line(p2Line), pShoulder(pShoulder)
|
||||
{
|
||||
if (typeCreation == Valentina::FromGui)
|
||||
if (typeCreation == Source::FromGui)
|
||||
{
|
||||
AddToFile();
|
||||
}
|
||||
|
@ -108,7 +108,7 @@ VToolShoulderPoint* VToolShoulderPoint::Create(DialogTool *dialog, VMainGraphics
|
|||
const QString pointName = dialogTool->getPointName();
|
||||
VToolShoulderPoint * point = nullptr;
|
||||
point=Create(0, formula, p1Line, p2Line, pShoulder, typeLine, pointName, 5, 10, scene, doc, data,
|
||||
Document::FullParse, Valentina::FromGui);
|
||||
Document::FullParse, Source::FromGui);
|
||||
if (point != nullptr)
|
||||
{
|
||||
point->dialog=dialogTool;
|
||||
|
@ -121,7 +121,7 @@ VToolShoulderPoint* VToolShoulderPoint::Create(const quint32 _id, QString &formu
|
|||
const quint32 &p2Line, const quint32 &pShoulder, const QString &typeLine,
|
||||
const QString &pointName, const qreal &mx, const qreal &my,
|
||||
VMainGraphicsScene *scene, VPattern *doc, VContainer *data,
|
||||
const Document::Documents &parse, const Valentina::Sources &typeCreation)
|
||||
const Document &parse, const Source &typeCreation)
|
||||
{
|
||||
const VPointF *firstPoint = data->GeometricObject<const VPointF *>(p1Line);
|
||||
const VPointF *secondPoint = data->GeometricObject<const VPointF *>(p2Line);
|
||||
|
@ -132,7 +132,7 @@ VToolShoulderPoint* VToolShoulderPoint::Create(const quint32 _id, QString &formu
|
|||
QPointF fPoint = VToolShoulderPoint::FindPoint(firstPoint->toQPointF(), secondPoint->toQPointF(),
|
||||
shoulderPoint->toQPointF(), qApp->toPixel(result));
|
||||
quint32 id = _id;
|
||||
if (typeCreation == Valentina::FromGui)
|
||||
if (typeCreation == Source::FromGui)
|
||||
{
|
||||
id = data->AddGObject(new VPointF(fPoint.x(), fPoint.y(), pointName, mx, my));
|
||||
data->AddLine(p1Line, id);
|
||||
|
@ -148,7 +148,7 @@ VToolShoulderPoint* VToolShoulderPoint::Create(const quint32 _id, QString &formu
|
|||
doc->UpdateToolData(id, data);
|
||||
}
|
||||
}
|
||||
VDrawTool::AddRecord(id, Valentina::ShoulderPointTool, doc);
|
||||
VDrawTool::AddRecord(id, Tool::ShoulderPointTool, doc);
|
||||
if (parse == Document::FullParse)
|
||||
{
|
||||
VToolShoulderPoint *point = new VToolShoulderPoint(doc, data, id, typeLine, formula,
|
||||
|
|
|
@ -53,7 +53,7 @@ public:
|
|||
*/
|
||||
VToolShoulderPoint(VPattern *doc, VContainer *data, const quint32 &id, const QString &typeLine,
|
||||
const QString &formula, const quint32 &p1Line, const quint32 &p2Line,
|
||||
const quint32 &pShoulder, const Valentina::Sources &typeCreation,
|
||||
const quint32 &pShoulder, const Source &typeCreation,
|
||||
QGraphicsItem * parent = nullptr);
|
||||
/**
|
||||
* @brief setDialog set dialog when user want change tool option.
|
||||
|
@ -97,7 +97,7 @@ public:
|
|||
static VToolShoulderPoint* Create(const quint32 _id, QString &formula, const quint32 &p1Line, const quint32 &p2Line,
|
||||
const quint32 &pShoulder, const QString &typeLine, const QString &pointName, const qreal &mx,
|
||||
const qreal &my, VMainGraphicsScene *scene, VPattern *doc, VContainer *data,
|
||||
const Document::Documents &parse, const Valentina::Sources &typeCreation);
|
||||
const Document &parse, const Source &typeCreation);
|
||||
static const QString ToolType;
|
||||
public slots:
|
||||
/**
|
||||
|
|
|
@ -36,7 +36,7 @@
|
|||
const QString VToolSinglePoint::ToolType = QStringLiteral("single");
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VToolSinglePoint::VToolSinglePoint (VPattern *doc, VContainer *data, quint32 id, const Valentina::Sources &typeCreation,
|
||||
VToolSinglePoint::VToolSinglePoint (VPattern *doc, VContainer *data, quint32 id, const Source &typeCreation,
|
||||
const QString &namePP, const QString &mPath, QGraphicsItem * parent )
|
||||
:VToolPoint(doc, data, id, parent), namePP(namePP), mPath(mPath)
|
||||
{
|
||||
|
@ -48,7 +48,7 @@ VToolSinglePoint::VToolSinglePoint (VPattern *doc, VContainer *data, quint32 id,
|
|||
this->setFlag(QGraphicsItem::ItemSendsGeometryChanges, true);
|
||||
this->setFlag(QGraphicsItem::ItemIsFocusable, false);
|
||||
setColorLabel(Qt::black);
|
||||
if (typeCreation == Valentina::FromGui)
|
||||
if (typeCreation == Source::FromGui)
|
||||
{
|
||||
AddToFile();
|
||||
}
|
||||
|
|
|
@ -47,7 +47,7 @@ public:
|
|||
* @param typeCreation way we create this tool.
|
||||
* @param parent parent object.
|
||||
*/
|
||||
VToolSinglePoint (VPattern *doc, VContainer *data, quint32 id, const Valentina::Sources &typeCreation,
|
||||
VToolSinglePoint (VPattern *doc, VContainer *data, quint32 id, const Source &typeCreation,
|
||||
const QString &namePP = QString(), const QString &mPath = QString(),
|
||||
QGraphicsItem * parent = nullptr );
|
||||
/**
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
const QString VToolSpline::ToolType = QStringLiteral("simple");
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VToolSpline::VToolSpline(VPattern *doc, VContainer *data, quint32 id, const Valentina::Sources &typeCreation,
|
||||
VToolSpline::VToolSpline(VPattern *doc, VContainer *data, quint32 id, const Source &typeCreation,
|
||||
QGraphicsItem *parent) :VAbstractSpline(doc, data, id, parent)
|
||||
{
|
||||
const VSpline *spl = data->GeometricObject<const VSpline *>(id);
|
||||
|
@ -47,7 +47,7 @@ VToolSpline::VToolSpline(VPattern *doc, VContainer *data, quint32 id, const Vale
|
|||
this->setFlag(QGraphicsItem::ItemIsFocusable, true);
|
||||
this->setAcceptHoverEvents(true);
|
||||
|
||||
VControlPointSpline *controlPoint1 = new VControlPointSpline(1, SplinePoint::FirstPoint, spl->GetP2(),
|
||||
VControlPointSpline *controlPoint1 = new VControlPointSpline(1, SplinePointPosition::FirstPoint, spl->GetP2(),
|
||||
spl->GetP1().toQPointF(), this);
|
||||
connect(controlPoint1, &VControlPointSpline::ControlPointChangePosition, this,
|
||||
&VToolSpline::ControlPointChangePosition);
|
||||
|
@ -55,7 +55,7 @@ VToolSpline::VToolSpline(VPattern *doc, VContainer *data, quint32 id, const Vale
|
|||
connect(this, &VToolSpline::setEnabledPoint, controlPoint1, &VControlPointSpline::setEnabledPoint);
|
||||
controlPoints.append(controlPoint1);
|
||||
|
||||
VControlPointSpline *controlPoint2 = new VControlPointSpline(1, SplinePoint::LastPoint, spl->GetP3(),
|
||||
VControlPointSpline *controlPoint2 = new VControlPointSpline(1, SplinePointPosition::LastPoint, spl->GetP3(),
|
||||
spl->GetP4().toQPointF(), this);
|
||||
connect(controlPoint2, &VControlPointSpline::ControlPointChangePosition, this,
|
||||
&VToolSpline::ControlPointChangePosition);
|
||||
|
@ -63,7 +63,7 @@ VToolSpline::VToolSpline(VPattern *doc, VContainer *data, quint32 id, const Vale
|
|||
connect(this, &VToolSpline::setEnabledPoint, controlPoint2, &VControlPointSpline::setEnabledPoint);
|
||||
controlPoints.append(controlPoint2);
|
||||
|
||||
if (typeCreation == Valentina::FromGui)
|
||||
if (typeCreation == Source::FromGui)
|
||||
{
|
||||
AddToFile();
|
||||
}
|
||||
|
@ -104,20 +104,20 @@ void VToolSpline::Create(DialogTool *dialog, VMainGraphicsScene *scene, VPattern
|
|||
const qreal angle2 = dialogTool->getAngle2();
|
||||
const qreal kCurve = dialogTool->getKCurve();
|
||||
Create(0, p1, p4, kAsm1, kAsm2, angle1, angle2, kCurve, scene, doc, data, Document::FullParse,
|
||||
Valentina::FromGui);
|
||||
Source::FromGui);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolSpline::Create(const quint32 _id, const quint32 &p1, const quint32 &p4, const qreal &kAsm1,
|
||||
const qreal kAsm2, const qreal &angle1, const qreal &angle2, const qreal &kCurve,
|
||||
VMainGraphicsScene *scene, VPattern *doc, VContainer *data,
|
||||
const Document::Documents &parse, const Valentina::Sources &typeCreation)
|
||||
const Document &parse, const Source &typeCreation)
|
||||
{
|
||||
VPointF point1 = *data->GeometricObject<const VPointF *>(p1);
|
||||
VPointF point4 = *data->GeometricObject<const VPointF *>(p4);
|
||||
VSpline *spline = new VSpline(point1, point4, angle1, angle2, kAsm1, kAsm2, kCurve);
|
||||
quint32 id = _id;
|
||||
if (typeCreation == Valentina::FromGui)
|
||||
if (typeCreation == Source::FromGui)
|
||||
{
|
||||
id = data->AddGObject(spline);
|
||||
data->AddLengthSpline(spline->name(), qApp->fromPixel(spline->GetLength()));
|
||||
|
@ -131,7 +131,7 @@ void VToolSpline::Create(const quint32 _id, const quint32 &p1, const quint32 &p4
|
|||
doc->UpdateToolData(id, data);
|
||||
}
|
||||
}
|
||||
VDrawTool::AddRecord(id, Valentina::SplineTool, doc);
|
||||
VDrawTool::AddRecord(id, Tool::SplineTool, doc);
|
||||
if (parse == Document::FullParse)
|
||||
{
|
||||
VToolSpline *spl = new VToolSpline(doc, data, id, typeCreation);
|
||||
|
@ -145,13 +145,13 @@ void VToolSpline::Create(const quint32 _id, const quint32 &p1, const quint32 &p4
|
|||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolSpline::ControlPointChangePosition(const qint32 &indexSpline, const SplinePoint::Position &position,
|
||||
void VToolSpline::ControlPointChangePosition(const qint32 &indexSpline, const SplinePointPosition &position,
|
||||
const QPointF &pos)
|
||||
{
|
||||
Q_UNUSED(indexSpline);
|
||||
const VSpline *spline = VAbstractTool::data.GeometricObject<const VSpline *>(id);
|
||||
VSpline spl;
|
||||
if (position == SplinePoint::FirstPoint)
|
||||
if (position == SplinePointPosition::FirstPoint)
|
||||
{
|
||||
spl = VSpline(spline->GetP1(), pos, spline->GetP3(), spline->GetP4(), spline->GetKcurve());
|
||||
}
|
||||
|
@ -211,7 +211,7 @@ void VToolSpline::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
|
|||
{
|
||||
if (event->button() == Qt::LeftButton)
|
||||
{
|
||||
emit ChoosedTool(id, Valentina::Spline);
|
||||
emit ChoosedTool(id, SceneObject::Spline);
|
||||
}
|
||||
QGraphicsItem::mouseReleaseEvent(event);
|
||||
}
|
||||
|
@ -269,10 +269,10 @@ void VToolSpline::RefreshGeometry()
|
|||
this->setPath(path);
|
||||
QPointF splinePoint = VAbstractTool::data.GeometricObject<const VPointF *>(spl->GetP1().id())->toQPointF();
|
||||
QPointF controlPoint = spl->GetP2();
|
||||
emit RefreshLine(1, SplinePoint::FirstPoint, controlPoint, splinePoint);
|
||||
emit RefreshLine(1, SplinePointPosition::FirstPoint, controlPoint, splinePoint);
|
||||
splinePoint = VAbstractTool::data.GeometricObject<const VPointF *>(spl->GetP4().id())->toQPointF();
|
||||
controlPoint = spl->GetP3();
|
||||
emit RefreshLine(1, SplinePoint::LastPoint, controlPoint, splinePoint);
|
||||
emit RefreshLine(1, SplinePointPosition::LastPoint, controlPoint, splinePoint);
|
||||
|
||||
disconnect(controlPoints[0], &VControlPointSpline::ControlPointChangePosition, this,
|
||||
&VToolSpline::ControlPointChangePosition);
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user