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