Enum Units.
--HG-- branch : feature
This commit is contained in:
parent
db2a3e9ca9
commit
8f5e01fbb2
|
@ -296,7 +296,7 @@ void VContainer::ClearCalculationGObjects()
|
||||||
while (i.hasNext())
|
while (i.hasNext())
|
||||||
{
|
{
|
||||||
i.next();
|
i.next();
|
||||||
if (i.value()->getMode() == Draw::Calculation)
|
if (i.value()->getMode() == Valentina::Calculation)
|
||||||
{
|
{
|
||||||
delete i.value();
|
delete i.value();
|
||||||
gObjects.remove(i.key());
|
gObjects.remove(i.key());
|
||||||
|
|
|
@ -177,22 +177,22 @@ QString DialogHistory::Record(const VToolRecord &tool)
|
||||||
{
|
{
|
||||||
switch ( tool.getTypeTool() )
|
switch ( tool.getTypeTool() )
|
||||||
{
|
{
|
||||||
case Tool::ArrowTool:
|
case Valentina::ArrowTool:
|
||||||
Q_UNREACHABLE();
|
Q_UNREACHABLE();
|
||||||
break;
|
break;
|
||||||
case Tool::SinglePointTool:
|
case Valentina::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 Tool::EndLineTool:
|
case Valentina::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 Tool::LineTool:
|
case Valentina::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");
|
||||||
|
@ -200,7 +200,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 Tool::AlongLineTool:
|
case Valentina::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");
|
||||||
|
@ -209,12 +209,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 Tool::ShoulderPointTool:
|
case Valentina::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 Tool::NormalTool:
|
case Valentina::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");
|
||||||
|
@ -223,7 +223,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 Tool::BisectorTool:
|
case Valentina::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");
|
||||||
|
@ -235,7 +235,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 Tool::LineIntersectTool:
|
case Valentina::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");
|
||||||
|
@ -250,7 +250,7 @@ QString DialogHistory::Record(const VToolRecord &tool)
|
||||||
p1Line2Name, p2Line2Name,
|
p1Line2Name, p2Line2Name,
|
||||||
toolIdName);
|
toolIdName);
|
||||||
}
|
}
|
||||||
case Tool::SplineTool:
|
case Valentina::SplineTool:
|
||||||
{
|
{
|
||||||
const VSpline *spl = data->GeometricObject<const VSpline *>(tool.getId());
|
const VSpline *spl = data->GeometricObject<const VSpline *>(tool.getId());
|
||||||
Q_CHECK_PTR(spl);
|
Q_CHECK_PTR(spl);
|
||||||
|
@ -258,14 +258,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 Tool::ArcTool:
|
case Valentina::ArcTool:
|
||||||
{
|
{
|
||||||
const VArc *arc = data->GeometricObject<const VArc *>(tool.getId());
|
const VArc *arc = data->GeometricObject<const VArc *>(tool.getId());
|
||||||
Q_CHECK_PTR(arc);
|
Q_CHECK_PTR(arc);
|
||||||
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 Tool::SplinePathTool:
|
case Valentina::SplinePathTool:
|
||||||
{
|
{
|
||||||
const VSplinePath *splPath = data->GeometricObject<const VSplinePath *>(tool.getId());
|
const VSplinePath *splPath = data->GeometricObject<const VSplinePath *>(tool.getId());
|
||||||
Q_CHECK_PTR(splPath);
|
Q_CHECK_PTR(splPath);
|
||||||
|
@ -288,7 +288,7 @@ QString DialogHistory::Record(const VToolRecord &tool)
|
||||||
}
|
}
|
||||||
return record;
|
return record;
|
||||||
}
|
}
|
||||||
case Tool::PointOfContact:
|
case Valentina::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");
|
||||||
|
@ -300,7 +300,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 Tool::Height:
|
case Valentina::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");
|
||||||
|
@ -312,7 +312,7 @@ QString DialogHistory::Record(const VToolRecord &tool)
|
||||||
p1LineIdName,
|
p1LineIdName,
|
||||||
p2LineIdName);
|
p2LineIdName);
|
||||||
}
|
}
|
||||||
case Tool::Triangle:
|
case Valentina::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");
|
||||||
|
@ -325,7 +325,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 Tool::PointOfIntersection:
|
case Valentina::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");
|
||||||
|
@ -335,7 +335,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 Tool::CutArcTool:
|
case Valentina::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);
|
||||||
|
@ -344,7 +344,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 Tool::CutSplineTool:
|
case Valentina::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);
|
||||||
|
@ -354,7 +354,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 Tool::CutSplinePathTool:
|
case Valentina::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);
|
||||||
|
@ -382,17 +382,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 Tool::Detail:
|
case Valentina::DetailTool:
|
||||||
break;
|
break;
|
||||||
case Tool::UnionDetails:
|
case Valentina::UnionDetails:
|
||||||
break;
|
break;
|
||||||
case Tool::NodeArc:
|
case Valentina::NodeArc:
|
||||||
break;
|
break;
|
||||||
case Tool::NodePoint:
|
case Valentina::NodePoint:
|
||||||
break;
|
break;
|
||||||
case Tool::NodeSpline:
|
case Valentina::NodeSpline:
|
||||||
break;
|
break;
|
||||||
case Tool::NodeSplinePath:
|
case Valentina::NodeSplinePath:
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
qWarning()<<tr("Got wrong tool type. Ignore.");
|
qWarning()<<tr("Got wrong tool type. Ignore.");
|
||||||
|
|
|
@ -64,9 +64,9 @@ DialogAlongLine::~DialogAlongLine()
|
||||||
delete ui;
|
delete ui;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DialogAlongLine::ChoosedObject(quint32 id, const Scene::Scenes &type)
|
void DialogAlongLine::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
||||||
{
|
{
|
||||||
if (type == Scene::Point)
|
if (type == Valentina::Point)
|
||||||
{
|
{
|
||||||
if (number == 0)
|
if (number == 0)
|
||||||
{
|
{
|
||||||
|
|
|
@ -108,7 +108,7 @@ public slots:
|
||||||
* @param id id of point or detail
|
* @param id id of point or detail
|
||||||
* @param type type of object
|
* @param type type of object
|
||||||
*/
|
*/
|
||||||
virtual void ChoosedObject(quint32 id, const Scene::Scenes &type);
|
virtual void ChoosedObject(quint32 id, const Valentina::Scenes &type);
|
||||||
/**
|
/**
|
||||||
* @brief DialogAccepted save data and emit signal about closed dialog.
|
* @brief DialogAccepted save data and emit signal about closed dialog.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -97,9 +97,9 @@ void DialogArc::SetRadius(const QString &value)
|
||||||
ui->lineEditRadius->setText(radius);
|
ui->lineEditRadius->setText(radius);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DialogArc::ChoosedObject(quint32 id, const Scene::Scenes &type)
|
void DialogArc::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
||||||
{
|
{
|
||||||
if (type == Scene::Point)
|
if (type == Valentina::Point)
|
||||||
{
|
{
|
||||||
const VPointF *point = data->GeometricObject<const VPointF *>(id);
|
const VPointF *point = data->GeometricObject<const VPointF *>(id);
|
||||||
|
|
||||||
|
|
|
@ -96,7 +96,7 @@ public slots:
|
||||||
* @param id id of point or detail
|
* @param id id of point or detail
|
||||||
* @param type type of object
|
* @param type type of object
|
||||||
*/
|
*/
|
||||||
virtual void ChoosedObject(quint32 id, const Scene::Scenes &type);
|
virtual void ChoosedObject(quint32 id, const Valentina::Scenes &type);
|
||||||
/**
|
/**
|
||||||
* @brief DialogAccepted save data and emit signal about closed dialog.
|
* @brief DialogAccepted save data and emit signal about closed dialog.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -64,9 +64,9 @@ DialogBisector::~DialogBisector()
|
||||||
delete ui;
|
delete ui;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DialogBisector::ChoosedObject(quint32 id, const Scene::Scenes &type)
|
void DialogBisector::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
||||||
{
|
{
|
||||||
if (type == Scene::Point)
|
if (type == Valentina::Point)
|
||||||
{
|
{
|
||||||
const VPointF *point = data->GeometricObject<const VPointF *>(id);
|
const VPointF *point = data->GeometricObject<const VPointF *>(id);
|
||||||
if (number == 0)
|
if (number == 0)
|
||||||
|
|
|
@ -119,7 +119,7 @@ public slots:
|
||||||
* @param id id of point or detail
|
* @param id id of point or detail
|
||||||
* @param type type of object
|
* @param type type of object
|
||||||
*/
|
*/
|
||||||
virtual void ChoosedObject(quint32 id, const Scene::Scenes &type);
|
virtual void ChoosedObject(quint32 id, const Valentina::Scenes &type);
|
||||||
/**
|
/**
|
||||||
* @brief DialogAccepted save data and emit signal about closed dialog.
|
* @brief DialogAccepted save data and emit signal about closed dialog.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -59,9 +59,9 @@ DialogCutArc::~DialogCutArc()
|
||||||
delete ui;
|
delete ui;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DialogCutArc::ChoosedObject(quint32 id, const Scene::Scenes &type)
|
void DialogCutArc::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
||||||
{
|
{
|
||||||
if (type == Scene::Arc)
|
if (type == Valentina::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());
|
||||||
|
|
|
@ -87,7 +87,7 @@ public slots:
|
||||||
* @param id id of point or detail
|
* @param id id of point or detail
|
||||||
* @param type type of object
|
* @param type type of object
|
||||||
*/
|
*/
|
||||||
virtual void ChoosedObject(quint32 id, const Scene::Scenes &type);
|
virtual void ChoosedObject(quint32 id, const Valentina::Scenes &type);
|
||||||
/**
|
/**
|
||||||
* @brief DialogAccepted save data and emit signal about closed dialog.
|
* @brief DialogAccepted save data and emit signal about closed dialog.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -75,9 +75,9 @@ void DialogCutSpline::setSplineId(const quint32 &value, const quint32 &id)
|
||||||
setCurrentSplineId(ui->comboBoxSpline, splineId, value, id, ComboMode::CutSpline);
|
setCurrentSplineId(ui->comboBoxSpline, splineId, value, id, ComboMode::CutSpline);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DialogCutSpline::ChoosedObject(quint32 id, const Scene::Scenes &type)
|
void DialogCutSpline::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
||||||
{
|
{
|
||||||
if (type == Scene::Spline)
|
if (type == Valentina::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());
|
||||||
|
|
|
@ -87,7 +87,7 @@ public slots:
|
||||||
* @param id id of point or detail
|
* @param id id of point or detail
|
||||||
* @param type type of object
|
* @param type type of object
|
||||||
*/
|
*/
|
||||||
virtual void ChoosedObject(quint32 id, const Scene::Scenes &type);
|
virtual void ChoosedObject(quint32 id, const Valentina::Scenes &type);
|
||||||
/**
|
/**
|
||||||
* @brief DialogAccepted save data and emit signal about closed dialog.
|
* @brief DialogAccepted save data and emit signal about closed dialog.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -76,9 +76,9 @@ void DialogCutSplinePath::setSplinePathId(const quint32 &value, const quint32 &i
|
||||||
setCurrentSplinePathId(ui->comboBoxSplinePath, splinePathId, value, id, ComboMode::CutSpline);
|
setCurrentSplinePathId(ui->comboBoxSplinePath, splinePathId, value, id, ComboMode::CutSpline);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DialogCutSplinePath::ChoosedObject(quint32 id, const Scene::Scenes &type)
|
void DialogCutSplinePath::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
||||||
{
|
{
|
||||||
if (type == Scene::SplinePath)
|
if (type == Valentina::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());
|
||||||
|
|
|
@ -87,7 +87,7 @@ public slots:
|
||||||
* @param id id of point or detail
|
* @param id id of point or detail
|
||||||
* @param type type of object
|
* @param type type of object
|
||||||
*/
|
*/
|
||||||
virtual void ChoosedObject(quint32 id, const Scene::Scenes &type);
|
virtual void ChoosedObject(quint32 id, const Valentina::Scenes &type);
|
||||||
/**
|
/**
|
||||||
* @brief DialogAccepted save data and emit signal about closed dialog.
|
* @brief DialogAccepted save data and emit signal about closed dialog.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -62,23 +62,23 @@ DialogDetail::DialogDetail(const VContainer *data, QWidget *parent)
|
||||||
connect(ui.toolButtonDelete, &QToolButton::clicked, this, &DialogDetail::DeleteItem);
|
connect(ui.toolButtonDelete, &QToolButton::clicked, this, &DialogDetail::DeleteItem);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DialogDetail::ChoosedObject(quint32 id, const Scene::Scenes &type)
|
void DialogDetail::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
||||||
{
|
{
|
||||||
if (type != Scene::Line && type != Scene::Detail)
|
if (type != Valentina::Line && type != Valentina::Detail)
|
||||||
{
|
{
|
||||||
switch (type)
|
switch (type)
|
||||||
{
|
{
|
||||||
case (Scene::Arc):
|
case (Valentina::Arc):
|
||||||
NewItem(id, Tool::NodeArc, NodeDetail::Contour);
|
NewItem(id, Valentina::NodeArc, NodeDetail::Contour);
|
||||||
break;
|
break;
|
||||||
case (Scene::Point):
|
case (Valentina::Point):
|
||||||
NewItem(id, Tool::NodePoint, NodeDetail::Contour);
|
NewItem(id, Valentina::NodePoint, NodeDetail::Contour);
|
||||||
break;
|
break;
|
||||||
case (Scene::Spline):
|
case (Valentina::Spline):
|
||||||
NewItem(id, Tool::NodeSpline, NodeDetail::Contour);
|
NewItem(id, Valentina::NodeSpline, NodeDetail::Contour);
|
||||||
break;
|
break;
|
||||||
case (Scene::SplinePath):
|
case (Valentina::SplinePath):
|
||||||
NewItem(id, Tool::NodeSplinePath, NodeDetail::Contour);
|
NewItem(id, Valentina::NodeSplinePath, NodeDetail::Contour);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
qWarning()<<tr("Got wrong scene object. Ignore.");
|
qWarning()<<tr("Got wrong scene object. Ignore.");
|
||||||
|
@ -105,31 +105,31 @@ void DialogDetail::DialogAccepted()
|
||||||
emit DialogClosed(QDialog::Accepted);
|
emit DialogClosed(QDialog::Accepted);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DialogDetail::NewItem(quint32 id, const Tool::Tools &typeTool, const NodeDetail::NodeDetails &typeNode, qreal mx,
|
void DialogDetail::NewItem(quint32 id, const Valentina::Tools &typeTool, const NodeDetail::NodeDetails &typeNode, qreal mx,
|
||||||
qreal my)
|
qreal my)
|
||||||
{
|
{
|
||||||
QString name;
|
QString name;
|
||||||
switch (typeTool)
|
switch (typeTool)
|
||||||
{
|
{
|
||||||
case (Tool::NodePoint):
|
case (Valentina::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 (Tool::NodeArc):
|
case (Valentina::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 (Tool::NodeSpline):
|
case (Valentina::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 (Tool::NodeSplinePath):
|
case (Valentina::NodeSplinePath):
|
||||||
{
|
{
|
||||||
const VSplinePath *splPath = data->GeometricObject<const VSplinePath *>(id);
|
const VSplinePath *splPath = data->GeometricObject<const VSplinePath *>(id);
|
||||||
name = splPath->name();
|
name = splPath->name();
|
||||||
|
|
|
@ -61,7 +61,7 @@ public slots:
|
||||||
* @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
|
||||||
*/
|
*/
|
||||||
virtual void ChoosedObject(quint32 id, const Scene::Scenes &type);
|
virtual void ChoosedObject(quint32 id, const Valentina::Scenes &type);
|
||||||
/**
|
/**
|
||||||
* @brief DialogAccepted save data and emit signal about closed dialog.
|
* @brief DialogAccepted save data and emit signal about closed dialog.
|
||||||
*/
|
*/
|
||||||
|
@ -121,7 +121,7 @@ private:
|
||||||
* @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 NewItem(quint32 id, const Tool::Tools &typeTool, const NodeDetail::NodeDetails &typeNode,
|
void NewItem(quint32 id, const Valentina::Tools &typeTool, const NodeDetail::NodeDetails &typeNode,
|
||||||
qreal mx = 0, qreal my = 0);
|
qreal mx = 0, qreal my = 0);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -59,9 +59,9 @@ DialogEndLine::DialogEndLine(const VContainer *data, QWidget *parent)
|
||||||
connect(ui->lineEditFormula, &QLineEdit::textChanged, this, &DialogEndLine::FormulaChanged);
|
connect(ui->lineEditFormula, &QLineEdit::textChanged, this, &DialogEndLine::FormulaChanged);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DialogEndLine::ChoosedObject(quint32 id, const Scene::Scenes &type)
|
void DialogEndLine::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
||||||
{
|
{
|
||||||
if (type == Scene::Point)
|
if (type == Valentina::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());
|
||||||
|
|
|
@ -107,7 +107,7 @@ public slots:
|
||||||
* @param id id of point or detail
|
* @param id id of point or detail
|
||||||
* @param type type of object
|
* @param type type of object
|
||||||
*/
|
*/
|
||||||
virtual void ChoosedObject(quint32 id, const Scene::Scenes &type);
|
virtual void ChoosedObject(quint32 id, const Valentina::Scenes &type);
|
||||||
/**
|
/**
|
||||||
* @brief DialogAccepted save data and emit signal about closed dialog.
|
* @brief DialogAccepted save data and emit signal about closed dialog.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -83,9 +83,9 @@ void DialogHeight::setP2LineId(const quint32 &value, const quint32 &id)
|
||||||
setCurrentPointId(ui->comboBoxP2Line, p2LineId, value, id);
|
setCurrentPointId(ui->comboBoxP2Line, p2LineId, value, id);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DialogHeight::ChoosedObject(quint32 id, const Scene::Scenes &type)
|
void DialogHeight::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
||||||
{
|
{
|
||||||
if (type == Scene::Point)
|
if (type == Valentina::Point)
|
||||||
{
|
{
|
||||||
const VPointF *point = data->GeometricObject<const VPointF *>(id);
|
const VPointF *point = data->GeometricObject<const VPointF *>(id);
|
||||||
switch (number)
|
switch (number)
|
||||||
|
|
|
@ -109,7 +109,7 @@ public slots:
|
||||||
* @param id id of point or detail
|
* @param id id of point or detail
|
||||||
* @param type type of object
|
* @param type type of object
|
||||||
*/
|
*/
|
||||||
virtual void ChoosedObject(quint32 id, const Scene::Scenes &type);
|
virtual void ChoosedObject(quint32 id, const Valentina::Scenes &type);
|
||||||
/**
|
/**
|
||||||
* @brief DialogAccepted save data and emit signal about closed dialog.
|
* @brief DialogAccepted save data and emit signal about closed dialog.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -88,9 +88,9 @@ void DialogLine::DialogAccepted()
|
||||||
DialogClosed(QDialog::Accepted);
|
DialogClosed(QDialog::Accepted);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DialogLine::ChoosedObject(quint32 id, const Scene::Scenes &type)
|
void DialogLine::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
||||||
{
|
{
|
||||||
if (type == Scene::Point)
|
if (type == Valentina::Point)
|
||||||
{
|
{
|
||||||
const VPointF *point = data->GeometricObject<const VPointF *>(id);
|
const VPointF *point = data->GeometricObject<const VPointF *>(id);
|
||||||
if (number == 0)
|
if (number == 0)
|
||||||
|
|
|
@ -86,7 +86,7 @@ public slots:
|
||||||
* @param id id of point or detail
|
* @param id id of point or detail
|
||||||
* @param type type of object
|
* @param type type of object
|
||||||
*/
|
*/
|
||||||
virtual void ChoosedObject(quint32 id, const Scene::Scenes &type);
|
virtual void ChoosedObject(quint32 id, const Valentina::Scenes &type);
|
||||||
/**
|
/**
|
||||||
* @brief DialogAccepted save data and emit signal about closed dialog.
|
* @brief DialogAccepted save data and emit signal about closed dialog.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -54,9 +54,9 @@ DialogLineIntersect::~DialogLineIntersect()
|
||||||
delete ui;
|
delete ui;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DialogLineIntersect::ChoosedObject(quint32 id, const Scene::Scenes &type)
|
void DialogLineIntersect::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
||||||
{
|
{
|
||||||
if (type == Scene::Point)
|
if (type == Valentina::Point)
|
||||||
{
|
{
|
||||||
const VPointF *point = data->GeometricObject<const VPointF *>(id);
|
const VPointF *point = data->GeometricObject<const VPointF *>(id);
|
||||||
if (number == 0)
|
if (number == 0)
|
||||||
|
|
|
@ -106,7 +106,7 @@ public slots:
|
||||||
* @param id id of point or detail
|
* @param id id of point or detail
|
||||||
* @param type type of object
|
* @param type type of object
|
||||||
*/
|
*/
|
||||||
virtual void ChoosedObject(quint32 id, const Scene::Scenes &type);
|
virtual void ChoosedObject(quint32 id, const Valentina::Scenes &type);
|
||||||
/**
|
/**
|
||||||
* @brief DialogAccepted save data and emit signal about closed dialog.
|
* @brief DialogAccepted save data and emit signal about closed dialog.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -65,9 +65,9 @@ DialogNormal::~DialogNormal()
|
||||||
delete ui;
|
delete ui;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DialogNormal::ChoosedObject(quint32 id, const Scene::Scenes &type)
|
void DialogNormal::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
||||||
{
|
{
|
||||||
if (type == Scene::Point)
|
if (type == Valentina::Point)
|
||||||
{
|
{
|
||||||
if (number == 0)
|
if (number == 0)
|
||||||
{
|
{
|
||||||
|
|
|
@ -118,7 +118,7 @@ public slots:
|
||||||
* @param id id of point or detail
|
* @param id id of point or detail
|
||||||
* @param type type of object
|
* @param type type of object
|
||||||
*/
|
*/
|
||||||
virtual void ChoosedObject(quint32 id, const Scene::Scenes &type);
|
virtual void ChoosedObject(quint32 id, const Valentina::Scenes &type);
|
||||||
/**
|
/**
|
||||||
* @brief DialogAccepted save data and emit signal about closed dialog.
|
* @brief DialogAccepted save data and emit signal about closed dialog.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -79,9 +79,9 @@ DialogPointOfContact::DialogPointOfContact(const VContainer *data, QWidget *pare
|
||||||
connect(ui.lineEditFormula, &QLineEdit::textChanged, this, &DialogPointOfContact::FormulaChanged);
|
connect(ui.lineEditFormula, &QLineEdit::textChanged, this, &DialogPointOfContact::FormulaChanged);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DialogPointOfContact::ChoosedObject(quint32 id, const Scene::Scenes &type)
|
void DialogPointOfContact::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
||||||
{
|
{
|
||||||
if (type == Scene::Point)
|
if (type == Valentina::Point)
|
||||||
{
|
{
|
||||||
const VPointF *point = data->GeometricObject<const VPointF *>(id);
|
const VPointF *point = data->GeometricObject<const VPointF *>(id);
|
||||||
if (number == 0)
|
if (number == 0)
|
||||||
|
|
|
@ -104,7 +104,7 @@ public slots:
|
||||||
* @param id id of point or detail
|
* @param id id of point or detail
|
||||||
* @param type type of object
|
* @param type type of object
|
||||||
*/
|
*/
|
||||||
virtual void ChoosedObject(quint32 id, const Scene::Scenes &type);
|
virtual void ChoosedObject(quint32 id, const Valentina::Scenes &type);
|
||||||
/**
|
/**
|
||||||
* @brief DialogAccepted save data and emit signal about closed dialog.
|
* @brief DialogAccepted save data and emit signal about closed dialog.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -58,9 +58,9 @@ void DialogPointOfIntersection::setSecondPointId(const quint32 &value, const qui
|
||||||
setCurrentPointId(ui->comboBoxSecondPoint, secondPointId, value, id);
|
setCurrentPointId(ui->comboBoxSecondPoint, secondPointId, value, id);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DialogPointOfIntersection::ChoosedObject(quint32 id, const Scene::Scenes &type)
|
void DialogPointOfIntersection::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
||||||
{
|
{
|
||||||
if (type == Scene::Point)
|
if (type == Valentina::Point)
|
||||||
{
|
{
|
||||||
const VPointF *point = data->GeometricObject<const VPointF *>(id);
|
const VPointF *point = data->GeometricObject<const VPointF *>(id);
|
||||||
if (number == 0)
|
if (number == 0)
|
||||||
|
|
|
@ -88,7 +88,7 @@ public slots:
|
||||||
* @param id id of point or detail
|
* @param id id of point or detail
|
||||||
* @param type type of object
|
* @param type type of object
|
||||||
*/
|
*/
|
||||||
virtual void ChoosedObject(quint32 id, const Scene::Scenes &type);
|
virtual void ChoosedObject(quint32 id, const Valentina::Scenes &type);
|
||||||
/**
|
/**
|
||||||
* @brief DialogAccepted save data and emit signal about closed dialog.
|
* @brief DialogAccepted save data and emit signal about closed dialog.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -65,9 +65,9 @@ DialogShoulderPoint::~DialogShoulderPoint()
|
||||||
delete ui;
|
delete ui;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DialogShoulderPoint::ChoosedObject(quint32 id, const Scene::Scenes &type)
|
void DialogShoulderPoint::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
||||||
{
|
{
|
||||||
if (type == Scene::Point)
|
if (type == Valentina::Point)
|
||||||
{
|
{
|
||||||
const VPointF *point = data->GeometricObject<const VPointF *>(id);
|
const VPointF *point = data->GeometricObject<const VPointF *>(id);
|
||||||
if (number == 0)
|
if (number == 0)
|
||||||
|
|
|
@ -119,7 +119,7 @@ public slots:
|
||||||
* @param id id of point or detail
|
* @param id id of point or detail
|
||||||
* @param type type of object
|
* @param type type of object
|
||||||
*/
|
*/
|
||||||
virtual void ChoosedObject(quint32 id, const Scene::Scenes &type);
|
virtual void ChoosedObject(quint32 id, const Valentina::Scenes &type);
|
||||||
/**
|
/**
|
||||||
* @brief DialogAccepted save data and emit signal about closed dialog.
|
* @brief DialogAccepted save data and emit signal about closed dialog.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -52,9 +52,9 @@ quint32 DialogSpline::getP1() const
|
||||||
return p1;
|
return p1;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DialogSpline::ChoosedObject(quint32 id, const Scene::Scenes &type)
|
void DialogSpline::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
||||||
{
|
{
|
||||||
if (type == Scene::Point)
|
if (type == Valentina::Point)
|
||||||
{
|
{
|
||||||
const VPointF *point = data->GeometricObject<const VPointF *>(id);
|
const VPointF *point = data->GeometricObject<const VPointF *>(id);
|
||||||
if (number == 0)
|
if (number == 0)
|
||||||
|
|
|
@ -126,7 +126,7 @@ public slots:
|
||||||
* @param id id of point or detail
|
* @param id id of point or detail
|
||||||
* @param type type of object
|
* @param type type of object
|
||||||
*/
|
*/
|
||||||
virtual void ChoosedObject(quint32 id, const Scene::Scenes &type);
|
virtual void ChoosedObject(quint32 id, const Valentina::Scenes &type);
|
||||||
/**
|
/**
|
||||||
* @brief DialogAccepted save data and emit signal about closed dialog.
|
* @brief DialogAccepted save data and emit signal about closed dialog.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -72,9 +72,9 @@ void DialogSplinePath::SetPath(const VSplinePath &value)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void DialogSplinePath::ChoosedObject(quint32 id, const Scene::Scenes &type)
|
void DialogSplinePath::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
||||||
{
|
{
|
||||||
if (type == Scene::Point)
|
if (type == Valentina::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"));
|
||||||
|
|
|
@ -67,7 +67,7 @@ public slots:
|
||||||
* @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
|
||||||
*/
|
*/
|
||||||
virtual void ChoosedObject(quint32 id, const Scene::Scenes &type);
|
virtual void ChoosedObject(quint32 id, const Valentina::Scenes &type);
|
||||||
/**
|
/**
|
||||||
* @brief DialogAccepted save data and emit signal about closed dialog.
|
* @brief DialogAccepted save data and emit signal about closed dialog.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -83,7 +83,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() == Draw::Calculation)
|
if (obj->getType() == GObject::Point && obj->getMode() == Valentina::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();
|
||||||
|
@ -107,7 +107,7 @@ void DialogTool::FillComboBoxArcs(QComboBox *box, const quint32 &id, ComboMode::
|
||||||
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() == Draw::Calculation)
|
if (obj->getType() == GObject::Arc && obj->getMode() == Valentina::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();
|
||||||
|
@ -119,7 +119,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() == Draw::Calculation)
|
if (obj->getType() == GObject::Arc && obj->getMode() == Valentina::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::FillComboBoxSplines(QComboBox *box, const quint32 &id, ComboMod
|
||||||
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() == Draw::Calculation)
|
if (obj->getType() == GObject::Spline && obj->getMode() == Valentina::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();
|
||||||
|
@ -156,7 +156,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() == Draw::Calculation)
|
if (obj->getType() == GObject::Spline && obj->getMode() == Valentina::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();
|
||||||
|
@ -181,7 +181,7 @@ void DialogTool::FillComboBoxSplinesPath(QComboBox *box, const quint32 &id, Comb
|
||||||
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() == Draw::Calculation)
|
if (obj->getType() == GObject::SplinePath && obj->getMode() == Valentina::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();
|
||||||
|
@ -193,7 +193,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() == Draw::Calculation)
|
if (obj->getType() == GObject::SplinePath && obj->getMode() == Valentina::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();
|
||||||
|
@ -419,7 +419,7 @@ void DialogTool::CheckState()
|
||||||
bOk->setEnabled(flagFormula && flagName);
|
bOk->setEnabled(flagFormula && flagName);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DialogTool::ChoosedObject(quint32 id, const Scene::Scenes &type)
|
void DialogTool::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
||||||
{
|
{
|
||||||
Q_UNUSED(id);
|
Q_UNUSED(id);
|
||||||
Q_UNUSED(type);
|
Q_UNUSED(type);
|
||||||
|
|
|
@ -83,7 +83,7 @@ public slots:
|
||||||
* @param id id of point or detail
|
* @param id id of point or detail
|
||||||
* @param type type of object
|
* @param type type of object
|
||||||
*/
|
*/
|
||||||
virtual void ChoosedObject(quint32 id, const Scene::Scenes &type);
|
virtual void ChoosedObject(quint32 id, const Valentina::Scenes &type);
|
||||||
/**
|
/**
|
||||||
* @brief NamePointChanged check name of point
|
* @brief NamePointChanged check name of point
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -54,9 +54,9 @@ DialogTriangle::~DialogTriangle()
|
||||||
delete ui;
|
delete ui;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DialogTriangle::ChoosedObject(quint32 id, const Scene::Scenes &type)
|
void DialogTriangle::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
||||||
{
|
{
|
||||||
if (type == Scene::Point)
|
if (type == Valentina::Point)
|
||||||
{
|
{
|
||||||
const VPointF *point = data->GeometricObject<const VPointF *>(id);
|
const VPointF *point = data->GeometricObject<const VPointF *>(id);
|
||||||
switch (number)
|
switch (number)
|
||||||
|
|
|
@ -110,7 +110,7 @@ public slots:
|
||||||
* @param id id of point or detail
|
* @param id id of point or detail
|
||||||
* @param type type of object
|
* @param type type of object
|
||||||
*/
|
*/
|
||||||
virtual void ChoosedObject(quint32 id, const Scene::Scenes &type);
|
virtual void ChoosedObject(quint32 id, const Valentina::Scenes &type);
|
||||||
/**
|
/**
|
||||||
* @brief DialogAccepted save data and emit signal about closed dialog.
|
* @brief DialogAccepted save data and emit signal about closed dialog.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -42,7 +42,7 @@ DialogUnionDetails::~DialogUnionDetails()
|
||||||
delete ui;
|
delete ui;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DialogUnionDetails::ChoosedObject(quint32 id, const Scene::Scenes &type)
|
void DialogUnionDetails::ChoosedObject(quint32 id, const Valentina::Scenes &type)
|
||||||
{
|
{
|
||||||
if (numberD == 0)
|
if (numberD == 0)
|
||||||
{
|
{
|
||||||
|
@ -69,12 +69,12 @@ bool DialogUnionDetails::CheckObject(const quint32 &id, const quint32 &idDetail)
|
||||||
return det.Containes(id);
|
return det.Containes(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DialogUnionDetails::ChoosedDetail(const quint32 &id, const Scene::Scenes &type, quint32 &idDetail,
|
void DialogUnionDetails::ChoosedDetail(const quint32 &id, const Valentina::Scenes &type, quint32 &idDetail,
|
||||||
ptrdiff_t &index)
|
ptrdiff_t &index)
|
||||||
{
|
{
|
||||||
if (idDetail == 0)
|
if (idDetail == 0)
|
||||||
{
|
{
|
||||||
if (type == Scene::Detail)
|
if (type == Valentina::Detail)
|
||||||
{
|
{
|
||||||
idDetail = id;
|
idDetail = id;
|
||||||
emit ToolTip(tr("Select first point"));
|
emit ToolTip(tr("Select first point"));
|
||||||
|
@ -85,7 +85,7 @@ void DialogUnionDetails::ChoosedDetail(const quint32 &id, const Scene::Scenes &t
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (type == Scene::Point)
|
if (type == Valentina::Point)
|
||||||
{
|
{
|
||||||
if (numberP == 0)
|
if (numberP == 0)
|
||||||
{
|
{
|
||||||
|
|
|
@ -76,7 +76,7 @@ public slots:
|
||||||
* @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 ChoosedObject(quint32 id, const Scene::Scenes &type);
|
void ChoosedObject(quint32 id, const Valentina::Scenes &type);
|
||||||
/**
|
/**
|
||||||
* @brief DialogAccepted save data and emit signal about closed dialog.
|
* @brief DialogAccepted save data and emit signal about closed dialog.
|
||||||
*/
|
*/
|
||||||
|
@ -133,7 +133,7 @@ private:
|
||||||
* @param idDetail id detail
|
* @param idDetail id detail
|
||||||
* @param index index of edge
|
* @param index index of edge
|
||||||
*/
|
*/
|
||||||
void ChoosedDetail(const quint32 &id, const Scene::Scenes &type, quint32 &idDetail, ptrdiff_t &index);
|
void ChoosedDetail(const quint32 &id, const Valentina::Scenes &type, quint32 &idDetail, ptrdiff_t &index);
|
||||||
};
|
};
|
||||||
|
|
||||||
inline quint32 DialogUnionDetails::getD1() const
|
inline quint32 DialogUnionDetails::getD1() const
|
||||||
|
|
|
@ -39,7 +39,7 @@ VArc::VArc ()
|
||||||
}
|
}
|
||||||
|
|
||||||
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, Draw::Draws mode)
|
QString formulaF2, quint32 idObject, Valentina::Draws mode)
|
||||||
: VGObject(GObject::Arc, idObject, mode), f1(f1), formulaF1(formulaF1), f2(f2), formulaF2(formulaF2),
|
: VGObject(GObject::Arc, idObject, mode), f1(f1), formulaF1(formulaF1), f2(f2), formulaF2(formulaF2),
|
||||||
radius(radius), formulaRadius(formulaRadius), center(center)
|
radius(radius), formulaRadius(formulaRadius), center(center)
|
||||||
{
|
{
|
||||||
|
|
|
@ -56,7 +56,7 @@ public:
|
||||||
* @param f2 end angle (degree).
|
* @param f2 end angle (degree).
|
||||||
*/
|
*/
|
||||||
VArc (VPointF center, qreal radius, QString formulaRadius, qreal f1, QString formulaF1, qreal f2,
|
VArc (VPointF center, qreal radius, QString formulaRadius, qreal f1, QString formulaF1, qreal f2,
|
||||||
QString formulaF2, quint32 idObject = 0, Draw::Draws mode = Draw::Calculation);
|
QString formulaF2, quint32 idObject = 0, Valentina::Draws mode = Valentina::Calculation);
|
||||||
/**
|
/**
|
||||||
* @brief VArc copy constructor
|
* @brief VArc copy constructor
|
||||||
* @param arc arc
|
* @param arc arc
|
||||||
|
|
|
@ -260,7 +260,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[i].getTypeTool() == Tool::NodePoint)
|
if (nodes[i].getTypeTool() == Valentina::NodePoint)
|
||||||
{
|
{
|
||||||
list.append(nodes[i]);
|
list.append(nodes[i]);
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,7 +38,7 @@ QPainterPath VEquidistant::ContourPath(const quint32 &idDetail, const VContainer
|
||||||
{
|
{
|
||||||
switch (detail.at(i).getTypeTool())
|
switch (detail.at(i).getTypeTool())
|
||||||
{
|
{
|
||||||
case (Tool::NodePoint):
|
case (Valentina::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());
|
||||||
|
@ -51,7 +51,7 @@ QPainterPath VEquidistant::ContourPath(const quint32 &idDetail, const VContainer
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case (Tool::NodeArc):
|
case (Valentina::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());
|
||||||
|
@ -75,7 +75,7 @@ QPainterPath VEquidistant::ContourPath(const quint32 &idDetail, const VContainer
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case (Tool::NodeSpline):
|
case (Valentina::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());
|
||||||
|
@ -99,7 +99,7 @@ QPainterPath VEquidistant::ContourPath(const quint32 &idDetail, const VContainer
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case (Tool::NodeSplinePath):
|
case (Valentina::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());
|
||||||
|
|
|
@ -29,11 +29,11 @@
|
||||||
#include "vgobject.h"
|
#include "vgobject.h"
|
||||||
|
|
||||||
VGObject::VGObject()
|
VGObject::VGObject()
|
||||||
:_id(0), type(GObject::Point), idObject(0), _name(QString()), mode(Draw::Calculation)
|
:_id(0), type(GObject::Point), idObject(0), _name(QString()), mode(Valentina::Calculation)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
VGObject::VGObject(const GObject::Type &type, const quint32 &idObject, const Draw::Draws &mode)
|
VGObject::VGObject(const GObject::Type &type, const quint32 &idObject, const Valentina::Draws &mode)
|
||||||
:_id(0), type(type), idObject(idObject), _name(QString()), mode(mode)
|
:_id(0), type(type), idObject(idObject), _name(QString()), mode(mode)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
@ -73,12 +73,12 @@ void VGObject::setName(const QString &name)
|
||||||
_name = name;
|
_name = name;
|
||||||
}
|
}
|
||||||
|
|
||||||
Draw::Draws VGObject::getMode() const
|
Valentina::Draws VGObject::getMode() const
|
||||||
{
|
{
|
||||||
return mode;
|
return mode;
|
||||||
}
|
}
|
||||||
|
|
||||||
void VGObject::setMode(const Draw::Draws &value)
|
void VGObject::setMode(const Valentina::Draws &value)
|
||||||
{
|
{
|
||||||
mode = value;
|
mode = value;
|
||||||
}
|
}
|
||||||
|
|
|
@ -61,7 +61,8 @@ public:
|
||||||
* @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(const GObject::Type &type, const quint32 &idObject = 0, const Draw::Draws &mode = Draw::Calculation);
|
VGObject(const GObject::Type &type, const quint32 &idObject = 0,
|
||||||
|
const Valentina::Draws &mode = Valentina::Calculation);
|
||||||
/**
|
/**
|
||||||
* @brief VGObject copy constructor.
|
* @brief VGObject copy constructor.
|
||||||
* @param obj object.
|
* @param obj object.
|
||||||
|
@ -98,12 +99,12 @@ public:
|
||||||
* @brief getMode return mode creation.
|
* @brief getMode return mode creation.
|
||||||
* @return mode.
|
* @return mode.
|
||||||
*/
|
*/
|
||||||
Draw::Draws getMode() const;
|
Valentina::Draws getMode() const;
|
||||||
/**
|
/**
|
||||||
* @brief setMode set mode creation.
|
* @brief setMode set mode creation.
|
||||||
* @param value mode.
|
* @param value mode.
|
||||||
*/
|
*/
|
||||||
void setMode(const Draw::Draws &value);
|
void setMode(const Valentina::Draws &value);
|
||||||
/**
|
/**
|
||||||
* @brief getType return object type.
|
* @brief getType return object type.
|
||||||
* @return type.
|
* @return type.
|
||||||
|
@ -139,7 +140,7 @@ protected:
|
||||||
/**
|
/**
|
||||||
* @brief mode object created in calculation or drawing mode
|
* @brief mode object created in calculation or drawing mode
|
||||||
*/
|
*/
|
||||||
Draw::Draws mode;
|
Valentina::Draws mode;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // VGOBJECT_H
|
#endif // VGOBJECT_H
|
||||||
|
|
|
@ -29,9 +29,9 @@
|
||||||
#include "vnodedetail.h"
|
#include "vnodedetail.h"
|
||||||
|
|
||||||
VNodeDetail::VNodeDetail()
|
VNodeDetail::VNodeDetail()
|
||||||
:id(0), typeTool(Tool::NodePoint), typeNode(NodeDetail::Contour), mx(0), my(0){}
|
:id(0), typeTool(Valentina::NodePoint), typeNode(NodeDetail::Contour), mx(0), my(0){}
|
||||||
|
|
||||||
VNodeDetail::VNodeDetail(quint32 id, Tool::Tools typeTool, NodeDetail::NodeDetails typeNode, qreal mx, qreal my)
|
VNodeDetail::VNodeDetail(quint32 id, Valentina::Tools typeTool, NodeDetail::NodeDetails typeNode, qreal mx, qreal my)
|
||||||
:id(id), typeTool(typeTool), typeNode(typeNode), mx(mx), my(my){}
|
:id(id), typeTool(typeTool), typeNode(typeNode), mx(mx), my(my){}
|
||||||
|
|
||||||
VNodeDetail::VNodeDetail(const VNodeDetail &node)
|
VNodeDetail::VNodeDetail(const VNodeDetail &node)
|
||||||
|
|
|
@ -60,7 +60,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, Tool::Tools typeTool, NodeDetail::NodeDetails typeNode, qreal mx = 0,
|
VNodeDetail(quint32 id, Valentina::Tools typeTool, NodeDetail::NodeDetails typeNode, qreal mx = 0,
|
||||||
qreal my = 0);
|
qreal my = 0);
|
||||||
/**
|
/**
|
||||||
* @brief VNodeDetail copy constructor
|
* @brief VNodeDetail copy constructor
|
||||||
|
@ -87,12 +87,12 @@ public:
|
||||||
* @brief getTypeTool return tool type.
|
* @brief getTypeTool return tool type.
|
||||||
* @return tool type.
|
* @return tool type.
|
||||||
*/
|
*/
|
||||||
Tool::Tools getTypeTool() const;
|
Valentina::Tools getTypeTool() const;
|
||||||
/**
|
/**
|
||||||
* @brief setTypeTool set tool type.
|
* @brief setTypeTool set tool type.
|
||||||
* @param value tool type.
|
* @param value tool type.
|
||||||
*/
|
*/
|
||||||
void setTypeTool(const Tool::Tools &value);
|
void setTypeTool(const Valentina::Tools &value);
|
||||||
/**
|
/**
|
||||||
* @brief getTypeNode return node type.
|
* @brief getTypeNode return node type.
|
||||||
* @return node type.
|
* @return node type.
|
||||||
|
@ -131,7 +131,7 @@ private:
|
||||||
/**
|
/**
|
||||||
* @brief typeTool type of tool
|
* @brief typeTool type of tool
|
||||||
*/
|
*/
|
||||||
Tool::Tools typeTool;
|
Valentina::Tools typeTool;
|
||||||
/**
|
/**
|
||||||
* @brief typeNode node type.
|
* @brief typeNode node type.
|
||||||
*/
|
*/
|
||||||
|
@ -156,12 +156,12 @@ inline void VNodeDetail::setId(const quint32 &value)
|
||||||
id = value;
|
id = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline Tool::Tools VNodeDetail::getTypeTool() const
|
inline Valentina::Tools VNodeDetail::getTypeTool() const
|
||||||
{
|
{
|
||||||
return typeTool;
|
return typeTool;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void VNodeDetail::setTypeTool(const Tool::Tools &value)
|
inline void VNodeDetail::setTypeTool(const Valentina::Tools &value)
|
||||||
{
|
{
|
||||||
typeTool = value;
|
typeTool = value;
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,13 +28,13 @@
|
||||||
|
|
||||||
#include "vpointf.h"
|
#include "vpointf.h"
|
||||||
|
|
||||||
VPointF::VPointF(qreal x, qreal y, QString name, qreal mx, qreal my, quint32 idObject, Draw::Draws mode)
|
VPointF::VPointF(qreal x, qreal y, QString name, qreal mx, qreal my, quint32 idObject, Valentina::Draws mode)
|
||||||
:VGObject(GObject::Point, idObject, mode), _mx(mx), _my(my), _x(x), _y(y)
|
:VGObject(GObject::Point, idObject, mode), _mx(mx), _my(my), _x(x), _y(y)
|
||||||
{
|
{
|
||||||
this->_name = name;
|
this->_name = name;
|
||||||
}
|
}
|
||||||
|
|
||||||
VPointF::VPointF() :VGObject(GObject::Point, 0, Draw::Calculation), _mx(0), _my(0), _x(0), _y(0)
|
VPointF::VPointF() :VGObject(GObject::Point, 0, Valentina::Calculation), _mx(0), _my(0), _x(0), _y(0)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -58,7 +58,7 @@ public:
|
||||||
* @param my offset name respect to y
|
* @param my offset name respect to y
|
||||||
*/
|
*/
|
||||||
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,
|
||||||
Draw::Draws mode = Draw::Calculation);
|
Valentina::Draws mode = Valentina::Calculation);
|
||||||
~VPointF(){}
|
~VPointF(){}
|
||||||
/**
|
/**
|
||||||
* @brief operator = assignment operator
|
* @brief operator = assignment operator
|
||||||
|
|
|
@ -40,7 +40,7 @@ VSpline::VSpline ( const VSpline & spline )
|
||||||
kCurve(spline.GetKcurve()){}
|
kCurve(spline.GetKcurve()){}
|
||||||
|
|
||||||
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, Draw::Draws mode)
|
quint32 idObject, Valentina::Draws mode)
|
||||||
:VGObject(GObject::Spline, idObject, mode), p1(p1), p2(QPointF()), p3(QPointF()), p4(p4), angle1(angle1),
|
:VGObject(GObject::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)
|
||||||
{
|
{
|
||||||
|
@ -67,7 +67,7 @@ VSpline::VSpline (VPointF p1, VPointF p4, qreal angle1, qreal angle2, qreal kAsm
|
||||||
this->p3 = p4p3.p2();
|
this->p3 = p4p3.p2();
|
||||||
}
|
}
|
||||||
|
|
||||||
VSpline::VSpline (VPointF p1, QPointF p2, QPointF p3, VPointF p4, qreal kCurve, quint32 idObject, Draw::Draws mode)
|
VSpline::VSpline (VPointF p1, QPointF p2, QPointF p3, VPointF p4, qreal kCurve, quint32 idObject, Valentina::Draws mode)
|
||||||
:VGObject(GObject::Spline, idObject, mode), p1(p1), p2(p2), p3(p3), p4(p4), angle1(0), angle2(0), kAsm1(1),
|
:VGObject(GObject::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)
|
||||||
{
|
{
|
||||||
|
|
|
@ -66,7 +66,7 @@ public:
|
||||||
* @param kAsm2 coefficient of length second control line.
|
* @param kAsm2 coefficient of length second control line.
|
||||||
*/
|
*/
|
||||||
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, Draw::Draws mode = Draw::Calculation);
|
quint32 idObject = 0, Valentina::Draws mode = Valentina::Calculation);
|
||||||
/**
|
/**
|
||||||
* @brief VSpline constructor.
|
* @brief VSpline constructor.
|
||||||
* @param p1 first point spline.
|
* @param p1 first point spline.
|
||||||
|
@ -75,7 +75,7 @@ public:
|
||||||
* @param p4 second point spline.
|
* @param p4 second point spline.
|
||||||
*/
|
*/
|
||||||
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,
|
||||||
Draw::Draws mode = Draw::Calculation);
|
Valentina::Draws mode = Valentina::Calculation);
|
||||||
/**
|
/**
|
||||||
* @brief GetP1 return first spline point.
|
* @brief GetP1 return first spline point.
|
||||||
* @return first point.
|
* @return first point.
|
||||||
|
|
|
@ -29,7 +29,7 @@
|
||||||
#include "vsplinepath.h"
|
#include "vsplinepath.h"
|
||||||
#include "../exception/vexception.h"
|
#include "../exception/vexception.h"
|
||||||
|
|
||||||
VSplinePath::VSplinePath(qreal kCurve, quint32 idObject, Draw::Draws mode)
|
VSplinePath::VSplinePath(qreal kCurve, quint32 idObject, Valentina::Draws mode)
|
||||||
: VGObject(GObject::SplinePath, idObject, mode), path(QVector<VSplinePoint>()), kCurve(kCurve), maxCountPoints(0)
|
: VGObject(GObject::SplinePath, idObject, mode), path(QVector<VSplinePoint>()), kCurve(kCurve), maxCountPoints(0)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
|
@ -59,7 +59,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, Draw::Draws mode = Draw::Calculation);
|
VSplinePath(qreal kCurve = 1, quint32 idObject = 0, Valentina::Draws mode = Valentina::Calculation);
|
||||||
/**
|
/**
|
||||||
* @brief VSplinePath copy constructor.
|
* @brief VSplinePath copy constructor.
|
||||||
* @param splPath spline path.
|
* @param splPath spline path.
|
||||||
|
|
|
@ -33,6 +33,8 @@
|
||||||
#include "tablewindow.h"
|
#include "tablewindow.h"
|
||||||
#include "options.h"
|
#include "options.h"
|
||||||
|
|
||||||
|
Valentina::Units patternUnit = Valentina::Cm;
|
||||||
|
|
||||||
#ifdef Q_OS_WIN
|
#ifdef Q_OS_WIN
|
||||||
const QString translationsPath = QString("/translations");
|
const QString translationsPath = QString("/translations");
|
||||||
#else
|
#else
|
||||||
|
|
|
@ -45,12 +45,11 @@
|
||||||
#include <QFileDialog>
|
#include <QFileDialog>
|
||||||
#include <QSourceLocation>
|
#include <QSourceLocation>
|
||||||
|
|
||||||
|
|
||||||
MainWindow::MainWindow(QWidget *parent)
|
MainWindow::MainWindow(QWidget *parent)
|
||||||
:QMainWindow(parent), ui(new Ui::MainWindow), pattern(nullptr), doc(nullptr), tool(Tool::ArrowTool),
|
:QMainWindow(parent), ui(new Ui::MainWindow), pattern(nullptr), doc(nullptr), tool(Valentina::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(Draw::Calculation), currentDrawIndex(0), currentToolBoxIndex(0),
|
comboBoxDraws(nullptr), curFile(QString()), mode(Valentina::Calculation), currentDrawIndex(0), currentToolBoxIndex(0),
|
||||||
drawMode(true), recentFileActs{0, 0, 0, 0, 0}, separatorAct(nullptr), autoSaveTimer(nullptr)
|
drawMode(true), recentFileActs{0, 0, 0, 0, 0}, separatorAct(nullptr), autoSaveTimer(nullptr)
|
||||||
{
|
{
|
||||||
CreateActions();
|
CreateActions();
|
||||||
|
@ -165,14 +164,14 @@ void MainWindow::ActionNewDraw()
|
||||||
//Create single point
|
//Create single point
|
||||||
const quint32 id = pattern->AddGObject(new VPointF(toPixel((10+comboBoxDraws->count()*5)), toPixel(10), "А", 5,
|
const quint32 id = pattern->AddGObject(new VPointF(toPixel((10+comboBoxDraws->count()*5)), toPixel(10), "А", 5,
|
||||||
10));
|
10));
|
||||||
VToolSinglePoint *spoint = new VToolSinglePoint(doc, pattern, id, Tool::FromGui);
|
VToolSinglePoint *spoint = new VToolSinglePoint(doc, pattern, id, Valentina::FromGui);
|
||||||
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();
|
||||||
Q_CHECK_PTR(tools);
|
Q_CHECK_PTR(tools);
|
||||||
tools->insert(id, spoint);
|
tools->insert(id, spoint);
|
||||||
VDrawTool::AddRecord(id, Tool::SinglePointTool, doc);
|
VDrawTool::AddRecord(id, Valentina::SinglePointTool, doc);
|
||||||
SetEnableTool(true);
|
SetEnableTool(true);
|
||||||
SetEnableWidgets(true);
|
SetEnableWidgets(true);
|
||||||
|
|
||||||
|
@ -205,7 +204,7 @@ void MainWindow::OptionDraw()
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename Dialog, typename Func>
|
template <typename Dialog, typename Func>
|
||||||
void MainWindow::SetToolButton(bool checked, Tool::Tools t, const QString &cursor, const QString &toolTip,
|
void MainWindow::SetToolButton(bool checked, Valentina::Tools t, const QString &cursor, const QString &toolTip,
|
||||||
Func closeDialogSlot)
|
Func closeDialogSlot)
|
||||||
{
|
{
|
||||||
if (checked)
|
if (checked)
|
||||||
|
@ -245,7 +244,7 @@ void MainWindow::ClosedDialog(int result)
|
||||||
|
|
||||||
void MainWindow::ToolEndLine(bool checked)
|
void MainWindow::ToolEndLine(bool checked)
|
||||||
{
|
{
|
||||||
SetToolButton<DialogEndLine>(checked, Tool::EndLineTool, ":/cursor/endline_cursor.png", tr("Select point"),
|
SetToolButton<DialogEndLine>(checked, Valentina::EndLineTool, ":/cursor/endline_cursor.png", tr("Select point"),
|
||||||
&MainWindow::ClosedDialogEndLine);
|
&MainWindow::ClosedDialogEndLine);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -256,7 +255,7 @@ void MainWindow::ClosedDialogEndLine(int result)
|
||||||
|
|
||||||
void MainWindow::ToolLine(bool checked)
|
void MainWindow::ToolLine(bool checked)
|
||||||
{
|
{
|
||||||
SetToolButton<DialogLine>(checked, Tool::LineTool, ":/cursor/line_cursor.png", tr("Select first point"),
|
SetToolButton<DialogLine>(checked, Valentina::LineTool, ":/cursor/line_cursor.png", tr("Select first point"),
|
||||||
&MainWindow::ClosedDialogLine);
|
&MainWindow::ClosedDialogLine);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -267,7 +266,7 @@ void MainWindow::ClosedDialogLine(int result)
|
||||||
|
|
||||||
void MainWindow::ToolAlongLine(bool checked)
|
void MainWindow::ToolAlongLine(bool checked)
|
||||||
{
|
{
|
||||||
SetToolButton<DialogAlongLine>(checked, Tool::AlongLineTool, ":/cursor/alongline_cursor.png", tr("Select point"),
|
SetToolButton<DialogAlongLine>(checked, Valentina::AlongLineTool, ":/cursor/alongline_cursor.png", tr("Select point"),
|
||||||
&MainWindow::ClosedDialogAlongLine);
|
&MainWindow::ClosedDialogAlongLine);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -278,7 +277,7 @@ void MainWindow::ClosedDialogAlongLine(int result)
|
||||||
|
|
||||||
void MainWindow::ToolShoulderPoint(bool checked)
|
void MainWindow::ToolShoulderPoint(bool checked)
|
||||||
{
|
{
|
||||||
SetToolButton<DialogShoulderPoint>(checked, Tool::ShoulderPointTool, ":/cursor/shoulder_cursor.png",
|
SetToolButton<DialogShoulderPoint>(checked, Valentina::ShoulderPointTool, ":/cursor/shoulder_cursor.png",
|
||||||
tr("Select first point of line"), &MainWindow::ClosedDialogShoulderPoint);
|
tr("Select first point of line"), &MainWindow::ClosedDialogShoulderPoint);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -289,7 +288,7 @@ void MainWindow::ClosedDialogShoulderPoint(int result)
|
||||||
|
|
||||||
void MainWindow::ToolNormal(bool checked)
|
void MainWindow::ToolNormal(bool checked)
|
||||||
{
|
{
|
||||||
SetToolButton<DialogNormal>(checked, Tool::NormalTool, ":/cursor/normal_cursor.png",
|
SetToolButton<DialogNormal>(checked, Valentina::NormalTool, ":/cursor/normal_cursor.png",
|
||||||
tr("Select first point of line"), &MainWindow::ClosedDialogNormal);
|
tr("Select first point of line"), &MainWindow::ClosedDialogNormal);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -300,7 +299,7 @@ void MainWindow::ClosedDialogNormal(int result)
|
||||||
|
|
||||||
void MainWindow::ToolBisector(bool checked)
|
void MainWindow::ToolBisector(bool checked)
|
||||||
{
|
{
|
||||||
SetToolButton<DialogBisector>(checked, Tool::BisectorTool, ":/cursor/bisector_cursor.png",
|
SetToolButton<DialogBisector>(checked, Valentina::BisectorTool, ":/cursor/bisector_cursor.png",
|
||||||
tr("Select first point of angle"), &MainWindow::ClosedDialogBisector);
|
tr("Select first point of angle"), &MainWindow::ClosedDialogBisector);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -311,7 +310,7 @@ void MainWindow::ClosedDialogBisector(int result)
|
||||||
|
|
||||||
void MainWindow::ToolLineIntersect(bool checked)
|
void MainWindow::ToolLineIntersect(bool checked)
|
||||||
{
|
{
|
||||||
SetToolButton<DialogLineIntersect>(checked, Tool::LineIntersectTool, ":/cursor/intersect_cursor.png",
|
SetToolButton<DialogLineIntersect>(checked, Valentina::LineIntersectTool, ":/cursor/intersect_cursor.png",
|
||||||
tr("Select first point of first line"), &MainWindow::ClosedDialogLineIntersect);
|
tr("Select first point of first line"), &MainWindow::ClosedDialogLineIntersect);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -322,7 +321,7 @@ void MainWindow::ClosedDialogLineIntersect(int result)
|
||||||
|
|
||||||
void MainWindow::ToolSpline(bool checked)
|
void MainWindow::ToolSpline(bool checked)
|
||||||
{
|
{
|
||||||
SetToolButton<DialogSpline>(checked, Tool::SplineTool, ":/cursor/spline_cursor.png",
|
SetToolButton<DialogSpline>(checked, Valentina::SplineTool, ":/cursor/spline_cursor.png",
|
||||||
tr("Select first point curve"), &MainWindow::ClosedDialogSpline);
|
tr("Select first point curve"), &MainWindow::ClosedDialogSpline);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -333,7 +332,7 @@ void MainWindow::ClosedDialogSpline(int result)
|
||||||
|
|
||||||
void MainWindow::ToolCutSpline(bool checked)
|
void MainWindow::ToolCutSpline(bool checked)
|
||||||
{
|
{
|
||||||
SetToolButton<DialogCutSpline>(checked, Tool::CutSplineTool, ":/cursor/spline_cut_point_cursor.png",
|
SetToolButton<DialogCutSpline>(checked, Valentina::CutSplineTool, ":/cursor/spline_cut_point_cursor.png",
|
||||||
tr("Select simple curve"), &MainWindow::ClosedDialogCutSpline);
|
tr("Select simple curve"), &MainWindow::ClosedDialogCutSpline);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -344,7 +343,7 @@ void MainWindow::ClosedDialogCutSpline(int result)
|
||||||
|
|
||||||
void MainWindow::ToolArc(bool checked)
|
void MainWindow::ToolArc(bool checked)
|
||||||
{
|
{
|
||||||
SetToolButton<DialogArc>(checked, Tool::ArcTool, ":/cursor/arc_cursor.png",
|
SetToolButton<DialogArc>(checked, Valentina::ArcTool, ":/cursor/arc_cursor.png",
|
||||||
tr("Select point of center of arc"), &MainWindow::ClosedDialogArc);
|
tr("Select point of center of arc"), &MainWindow::ClosedDialogArc);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -355,7 +354,7 @@ void MainWindow::ClosedDialogArc(int result)
|
||||||
|
|
||||||
void MainWindow::ToolSplinePath(bool checked)
|
void MainWindow::ToolSplinePath(bool checked)
|
||||||
{
|
{
|
||||||
SetToolButton<DialogSplinePath>(checked, Tool::SplinePathTool, ":/cursor/splinepath_cursor.png",
|
SetToolButton<DialogSplinePath>(checked, Valentina::SplinePathTool, ":/cursor/splinepath_cursor.png",
|
||||||
tr("Select point of curve path"), &MainWindow::ClosedDialogSplinePath);
|
tr("Select point of curve path"), &MainWindow::ClosedDialogSplinePath);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -366,7 +365,7 @@ void MainWindow::ClosedDialogSplinePath(int result)
|
||||||
|
|
||||||
void MainWindow::ToolCutSplinePath(bool checked)
|
void MainWindow::ToolCutSplinePath(bool checked)
|
||||||
{
|
{
|
||||||
SetToolButton<DialogCutSplinePath>(checked, Tool::CutSplinePathTool, ":/cursor/splinepath_cut_point_cursor.png",
|
SetToolButton<DialogCutSplinePath>(checked, Valentina::CutSplinePathTool, ":/cursor/splinepath_cut_point_cursor.png",
|
||||||
tr("Select curve path"), &MainWindow::ClosedDialogCutSplinePath);
|
tr("Select curve path"), &MainWindow::ClosedDialogCutSplinePath);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -377,7 +376,7 @@ void MainWindow::ClosedDialogCutSplinePath(int result)
|
||||||
|
|
||||||
void MainWindow::ToolPointOfContact(bool checked)
|
void MainWindow::ToolPointOfContact(bool checked)
|
||||||
{
|
{
|
||||||
SetToolButton<DialogPointOfContact>(checked, Tool::PointOfContact, ":/cursor/pointcontact_cursor.png",
|
SetToolButton<DialogPointOfContact>(checked, Valentina::PointOfContact, ":/cursor/pointcontact_cursor.png",
|
||||||
tr("Select first point of line"), &MainWindow::ClosedDialogPointOfContact);
|
tr("Select first point of line"), &MainWindow::ClosedDialogPointOfContact);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -388,7 +387,7 @@ void MainWindow::ClosedDialogPointOfContact(int result)
|
||||||
|
|
||||||
void MainWindow::ToolDetail(bool checked)
|
void MainWindow::ToolDetail(bool checked)
|
||||||
{
|
{
|
||||||
SetToolButton<DialogDetail>(checked, Tool::Detail, "://cursor/new_detail_cursor.png",
|
SetToolButton<DialogDetail>(checked, Valentina::DetailTool, "://cursor/new_detail_cursor.png",
|
||||||
tr("Select points, arcs, curves clockwise."), &MainWindow::ClosedDialogDetail);
|
tr("Select points, arcs, curves clockwise."), &MainWindow::ClosedDialogDetail);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -404,7 +403,7 @@ void MainWindow::ClosedDialogDetail(int result)
|
||||||
|
|
||||||
void MainWindow::ToolHeight(bool checked)
|
void MainWindow::ToolHeight(bool checked)
|
||||||
{
|
{
|
||||||
SetToolButton<DialogHeight>(checked, Tool::Height, ":/cursor/height_cursor.png", tr("Select base point"),
|
SetToolButton<DialogHeight>(checked, Valentina::Height, ":/cursor/height_cursor.png", tr("Select base point"),
|
||||||
&MainWindow::ClosedDialogHeight);
|
&MainWindow::ClosedDialogHeight);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -415,7 +414,7 @@ void MainWindow::ClosedDialogHeight(int result)
|
||||||
|
|
||||||
void MainWindow::ToolTriangle(bool checked)
|
void MainWindow::ToolTriangle(bool checked)
|
||||||
{
|
{
|
||||||
SetToolButton<DialogTriangle>(checked, Tool::Triangle, ":/cursor/triangle_cursor.png",
|
SetToolButton<DialogTriangle>(checked, Valentina::Triangle, ":/cursor/triangle_cursor.png",
|
||||||
tr("Select first point of axis"), &MainWindow::ClosedDialogTriangle);
|
tr("Select first point of axis"), &MainWindow::ClosedDialogTriangle);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -426,7 +425,7 @@ void MainWindow::ClosedDialogTriangle(int result)
|
||||||
|
|
||||||
void MainWindow::ToolPointOfIntersection(bool checked)
|
void MainWindow::ToolPointOfIntersection(bool checked)
|
||||||
{
|
{
|
||||||
SetToolButton<DialogPointOfIntersection>(checked, Tool::PointOfIntersection, ":/cursor/pointofintersect_cursor.png",
|
SetToolButton<DialogPointOfIntersection>(checked, Valentina::PointOfIntersection, ":/cursor/pointofintersect_cursor.png",
|
||||||
tr("Select point vertically"), &MainWindow::ClosedDialogPointOfIntersection);
|
tr("Select point vertically"), &MainWindow::ClosedDialogPointOfIntersection);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -437,7 +436,7 @@ void MainWindow::ClosedDialogPointOfIntersection(int result)
|
||||||
|
|
||||||
void MainWindow::ToolUnionDetails(bool checked)
|
void MainWindow::ToolUnionDetails(bool checked)
|
||||||
{
|
{
|
||||||
SetToolButton<DialogUnionDetails>(checked, Tool::UnionDetails, ":/cursor/union_cursor.png", tr("Select detail"),
|
SetToolButton<DialogUnionDetails>(checked, Valentina::UnionDetails, ":/cursor/union_cursor.png", tr("Select detail"),
|
||||||
&MainWindow::ClosedDialogUnionDetails);
|
&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);
|
||||||
|
@ -451,7 +450,7 @@ void MainWindow::ClosedDialogUnionDetails(int result)
|
||||||
|
|
||||||
void MainWindow::ToolCutArc(bool checked)
|
void MainWindow::ToolCutArc(bool checked)
|
||||||
{
|
{
|
||||||
SetToolButton<DialogCutArc>(checked, Tool::CutArcTool, ":/cursor/arc_cut_cursor.png", tr("Select arc"),
|
SetToolButton<DialogCutArc>(checked, Valentina::CutArcTool, ":/cursor/arc_cut_cursor.png", tr("Select arc"),
|
||||||
&MainWindow::ClosedDialogCutArc);
|
&MainWindow::ClosedDialogCutArc);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -633,103 +632,103 @@ void MainWindow::CancelTool()
|
||||||
dialogTool = nullptr;
|
dialogTool = nullptr;
|
||||||
switch ( tool )
|
switch ( tool )
|
||||||
{
|
{
|
||||||
case Tool::ArrowTool:
|
case Valentina::ArrowTool:
|
||||||
ui->actionArrowTool->setChecked(false);
|
ui->actionArrowTool->setChecked(false);
|
||||||
helpLabel->setText("");
|
helpLabel->setText("");
|
||||||
break;
|
break;
|
||||||
case Tool::SinglePointTool:
|
case Valentina::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 Tool::EndLineTool:
|
case Valentina::EndLineTool:
|
||||||
ui->toolButtonEndLine->setChecked(false);
|
ui->toolButtonEndLine->setChecked(false);
|
||||||
currentScene->setFocus(Qt::OtherFocusReason);
|
currentScene->setFocus(Qt::OtherFocusReason);
|
||||||
currentScene->clearSelection();
|
currentScene->clearSelection();
|
||||||
break;
|
break;
|
||||||
case Tool::LineTool:
|
case Valentina::LineTool:
|
||||||
ui->toolButtonLine->setChecked(false);
|
ui->toolButtonLine->setChecked(false);
|
||||||
currentScene->setFocus(Qt::OtherFocusReason);
|
currentScene->setFocus(Qt::OtherFocusReason);
|
||||||
currentScene->clearFocus();
|
currentScene->clearFocus();
|
||||||
break;
|
break;
|
||||||
case Tool::AlongLineTool:
|
case Valentina::AlongLineTool:
|
||||||
ui->toolButtonAlongLine->setChecked(false);
|
ui->toolButtonAlongLine->setChecked(false);
|
||||||
currentScene->setFocus(Qt::OtherFocusReason);
|
currentScene->setFocus(Qt::OtherFocusReason);
|
||||||
currentScene->clearSelection();
|
currentScene->clearSelection();
|
||||||
break;
|
break;
|
||||||
case Tool::ShoulderPointTool:
|
case Valentina::ShoulderPointTool:
|
||||||
ui->toolButtonShoulderPoint->setChecked(false);
|
ui->toolButtonShoulderPoint->setChecked(false);
|
||||||
currentScene->setFocus(Qt::OtherFocusReason);
|
currentScene->setFocus(Qt::OtherFocusReason);
|
||||||
currentScene->clearSelection();
|
currentScene->clearSelection();
|
||||||
break;
|
break;
|
||||||
case Tool::NormalTool:
|
case Valentina::NormalTool:
|
||||||
ui->toolButtonNormal->setChecked(false);
|
ui->toolButtonNormal->setChecked(false);
|
||||||
currentScene->setFocus(Qt::OtherFocusReason);
|
currentScene->setFocus(Qt::OtherFocusReason);
|
||||||
currentScene->clearSelection();
|
currentScene->clearSelection();
|
||||||
break;
|
break;
|
||||||
case Tool::BisectorTool:
|
case Valentina::BisectorTool:
|
||||||
ui->toolButtonBisector->setChecked(false);
|
ui->toolButtonBisector->setChecked(false);
|
||||||
currentScene->setFocus(Qt::OtherFocusReason);
|
currentScene->setFocus(Qt::OtherFocusReason);
|
||||||
currentScene->clearSelection();
|
currentScene->clearSelection();
|
||||||
break;
|
break;
|
||||||
case Tool::LineIntersectTool:
|
case Valentina::LineIntersectTool:
|
||||||
ui->toolButtonLineIntersect->setChecked(false);
|
ui->toolButtonLineIntersect->setChecked(false);
|
||||||
currentScene->setFocus(Qt::OtherFocusReason);
|
currentScene->setFocus(Qt::OtherFocusReason);
|
||||||
currentScene->clearSelection();
|
currentScene->clearSelection();
|
||||||
break;
|
break;
|
||||||
case Tool::SplineTool:
|
case Valentina::SplineTool:
|
||||||
ui->toolButtonSpline->setChecked(false);
|
ui->toolButtonSpline->setChecked(false);
|
||||||
currentScene->setFocus(Qt::OtherFocusReason);
|
currentScene->setFocus(Qt::OtherFocusReason);
|
||||||
currentScene->clearSelection();
|
currentScene->clearSelection();
|
||||||
break;
|
break;
|
||||||
case Tool::ArcTool:
|
case Valentina::ArcTool:
|
||||||
ui->toolButtonArc->setChecked(false);
|
ui->toolButtonArc->setChecked(false);
|
||||||
currentScene->setFocus(Qt::OtherFocusReason);
|
currentScene->setFocus(Qt::OtherFocusReason);
|
||||||
currentScene->clearSelection();
|
currentScene->clearSelection();
|
||||||
break;
|
break;
|
||||||
case Tool::SplinePathTool:
|
case Valentina::SplinePathTool:
|
||||||
ui->toolButtonSplinePath->setChecked(false);
|
ui->toolButtonSplinePath->setChecked(false);
|
||||||
currentScene->setFocus(Qt::OtherFocusReason);
|
currentScene->setFocus(Qt::OtherFocusReason);
|
||||||
currentScene->clearSelection();
|
currentScene->clearSelection();
|
||||||
break;
|
break;
|
||||||
case Tool::PointOfContact:
|
case Valentina::PointOfContact:
|
||||||
ui->toolButtonPointOfContact->setChecked(false);
|
ui->toolButtonPointOfContact->setChecked(false);
|
||||||
currentScene->setFocus(Qt::OtherFocusReason);
|
currentScene->setFocus(Qt::OtherFocusReason);
|
||||||
currentScene->clearSelection();
|
currentScene->clearSelection();
|
||||||
break;
|
break;
|
||||||
case Tool::Detail:
|
case Valentina::DetailTool:
|
||||||
ui->toolButtonNewDetail->setChecked(false);
|
ui->toolButtonNewDetail->setChecked(false);
|
||||||
break;
|
break;
|
||||||
case Tool::Height:
|
case Valentina::Height:
|
||||||
ui->toolButtonHeight->setChecked(false);
|
ui->toolButtonHeight->setChecked(false);
|
||||||
currentScene->setFocus(Qt::OtherFocusReason);
|
currentScene->setFocus(Qt::OtherFocusReason);
|
||||||
currentScene->clearSelection();
|
currentScene->clearSelection();
|
||||||
break;
|
break;
|
||||||
case Tool::Triangle:
|
case Valentina::Triangle:
|
||||||
ui->toolButtonTriangle->setChecked(false);
|
ui->toolButtonTriangle->setChecked(false);
|
||||||
currentScene->setFocus(Qt::OtherFocusReason);
|
currentScene->setFocus(Qt::OtherFocusReason);
|
||||||
currentScene->clearSelection();
|
currentScene->clearSelection();
|
||||||
break;
|
break;
|
||||||
case Tool::PointOfIntersection:
|
case Valentina::PointOfIntersection:
|
||||||
ui->toolButtonPointOfIntersection->setChecked(false);
|
ui->toolButtonPointOfIntersection->setChecked(false);
|
||||||
currentScene->setFocus(Qt::OtherFocusReason);
|
currentScene->setFocus(Qt::OtherFocusReason);
|
||||||
currentScene->clearSelection();
|
currentScene->clearSelection();
|
||||||
break;
|
break;
|
||||||
case Tool::CutSplineTool:
|
case Valentina::CutSplineTool:
|
||||||
ui->toolButtonSplineCutPoint->setChecked(false);
|
ui->toolButtonSplineCutPoint->setChecked(false);
|
||||||
currentScene->setFocus(Qt::OtherFocusReason);
|
currentScene->setFocus(Qt::OtherFocusReason);
|
||||||
currentScene->clearSelection();
|
currentScene->clearSelection();
|
||||||
break;
|
break;
|
||||||
case Tool::CutSplinePathTool:
|
case Valentina::CutSplinePathTool:
|
||||||
ui->toolButtonSplinePathCutPoint->setChecked(false);
|
ui->toolButtonSplinePathCutPoint->setChecked(false);
|
||||||
currentScene->setFocus(Qt::OtherFocusReason);
|
currentScene->setFocus(Qt::OtherFocusReason);
|
||||||
currentScene->clearSelection();
|
currentScene->clearSelection();
|
||||||
break;
|
break;
|
||||||
case Tool::UnionDetails:
|
case Valentina::UnionDetails:
|
||||||
ui->toolButtonUnionDetails->setChecked(false);
|
ui->toolButtonUnionDetails->setChecked(false);
|
||||||
currentScene->setFocus(Qt::OtherFocusReason);
|
currentScene->setFocus(Qt::OtherFocusReason);
|
||||||
currentScene->clearSelection();
|
currentScene->clearSelection();
|
||||||
break;
|
break;
|
||||||
case Tool::CutArcTool:
|
case Valentina::CutArcTool:
|
||||||
ui->toolButtonArcCutPoint->setChecked(false);
|
ui->toolButtonArcCutPoint->setChecked(false);
|
||||||
currentScene->setFocus(Qt::OtherFocusReason);
|
currentScene->setFocus(Qt::OtherFocusReason);
|
||||||
currentScene->clearSelection();
|
currentScene->clearSelection();
|
||||||
|
@ -744,7 +743,7 @@ void MainWindow::ArrowTool()
|
||||||
{
|
{
|
||||||
CancelTool();
|
CancelTool();
|
||||||
ui->actionArrowTool->setChecked(true);
|
ui->actionArrowTool->setChecked(true);
|
||||||
tool = Tool::ArrowTool;
|
tool = Valentina::ArrowTool;
|
||||||
QCursor cur(Qt::ArrowCursor);
|
QCursor cur(Qt::ArrowCursor);
|
||||||
view->setCursor(cur);
|
view->setCursor(cur);
|
||||||
helpLabel->setText("");
|
helpLabel->setText("");
|
||||||
|
@ -802,7 +801,7 @@ void MainWindow::ActionDraw(bool checked)
|
||||||
connect(view, &VMainGraphicsView::NewFactor, sceneDraw, &VMainGraphicsScene::SetFactor);
|
connect(view, &VMainGraphicsView::NewFactor, sceneDraw, &VMainGraphicsScene::SetFactor);
|
||||||
RestoreCurrentScene();
|
RestoreCurrentScene();
|
||||||
|
|
||||||
mode = Draw::Calculation;
|
mode = Valentina::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;
|
||||||
|
@ -840,7 +839,7 @@ void MainWindow::ActionDetails(bool checked)
|
||||||
comboBoxDraws->setEnabled(false);
|
comboBoxDraws->setEnabled(false);
|
||||||
|
|
||||||
|
|
||||||
mode = Draw::Modeling;
|
mode = Valentina::Modeling;
|
||||||
SetEnableTool(true);
|
SetEnableTool(true);
|
||||||
currentToolBoxIndex = ui->toolBox->currentIndex();
|
currentToolBoxIndex = ui->toolBox->currentIndex();
|
||||||
ui->toolBox->setCurrentIndex(4);
|
ui->toolBox->setCurrentIndex(4);
|
||||||
|
@ -1059,7 +1058,7 @@ void MainWindow::SetEnableTool(bool enable)
|
||||||
{
|
{
|
||||||
bool drawTools = false;
|
bool drawTools = false;
|
||||||
bool modelingTools = false;
|
bool modelingTools = false;
|
||||||
if (mode == Draw::Calculation)
|
if (mode == Valentina::Calculation)
|
||||||
{
|
{
|
||||||
drawTools = enable;
|
drawTools = enable;
|
||||||
}
|
}
|
||||||
|
|
|
@ -407,7 +407,7 @@ private:
|
||||||
/**
|
/**
|
||||||
* @brief tool current tool
|
* @brief tool current tool
|
||||||
*/
|
*/
|
||||||
Tool::Tools tool;
|
Valentina::Tools tool;
|
||||||
/**
|
/**
|
||||||
* @brief currentScene pointer to current scene.
|
* @brief currentScene pointer to current scene.
|
||||||
*/
|
*/
|
||||||
|
@ -450,7 +450,7 @@ private:
|
||||||
/**
|
/**
|
||||||
* @brief mode keep current draw mode.
|
* @brief mode keep current draw mode.
|
||||||
*/
|
*/
|
||||||
Draw::Draws mode;
|
Valentina::Draws mode;
|
||||||
/**
|
/**
|
||||||
* @brief currentDrawIndex save current selected pattern peace.
|
* @brief currentDrawIndex save current selected pattern peace.
|
||||||
*/
|
*/
|
||||||
|
@ -510,7 +510,7 @@ private:
|
||||||
* @param toolTip first tooltipe.
|
* @param toolTip first tooltipe.
|
||||||
* @param closeDialogSlot function what handle after close dialog.
|
* @param closeDialogSlot function what handle after close dialog.
|
||||||
*/
|
*/
|
||||||
void SetToolButton(bool checked, Tool::Tools t, const QString &cursor, const QString &toolTip,
|
void SetToolButton(bool checked, Valentina::Tools t, const QString &cursor, const QString &toolTip,
|
||||||
Func closeDialogSlot);
|
Func closeDialogSlot);
|
||||||
/**
|
/**
|
||||||
* @brief MinimumScrollBar set scroll bar to minimum.
|
* @brief MinimumScrollBar set scroll bar to minimum.
|
||||||
|
|
|
@ -51,18 +51,14 @@ inline double toMM(double pix)
|
||||||
|
|
||||||
extern const QString translationsPath;
|
extern const QString translationsPath;
|
||||||
|
|
||||||
namespace Scene
|
namespace Valentina
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @brief The Scene enum
|
* @brief The Scene enum
|
||||||
*/
|
*/
|
||||||
enum Scene { Point, Line, Spline, Arc, SplinePath, Detail };
|
enum Scene { Point, Line, Spline, Arc, SplinePath, Detail };
|
||||||
Q_DECLARE_FLAGS(Scenes, Scene)
|
Q_DECLARE_FLAGS(Scenes, Scene)
|
||||||
}
|
|
||||||
Q_DECLARE_OPERATORS_FOR_FLAGS( Scene::Scenes )
|
|
||||||
|
|
||||||
namespace Tool
|
|
||||||
{
|
|
||||||
/**
|
/**
|
||||||
* @brief The Tool enum
|
* @brief The Tool enum
|
||||||
*/
|
*/
|
||||||
|
@ -84,7 +80,7 @@ namespace Tool
|
||||||
SplinePathTool,
|
SplinePathTool,
|
||||||
CutSplinePathTool,
|
CutSplinePathTool,
|
||||||
PointOfContact,
|
PointOfContact,
|
||||||
Detail,
|
DetailTool,
|
||||||
NodePoint,
|
NodePoint,
|
||||||
NodeArc,
|
NodeArc,
|
||||||
NodeSpline,
|
NodeSpline,
|
||||||
|
@ -101,18 +97,25 @@ namespace Tool
|
||||||
*/
|
*/
|
||||||
enum Source { FromGui, FromFile, FromTool };
|
enum Source { FromGui, FromFile, FromTool };
|
||||||
Q_DECLARE_FLAGS(Sources, Source)
|
Q_DECLARE_FLAGS(Sources, Source)
|
||||||
}
|
|
||||||
Q_DECLARE_OPERATORS_FOR_FLAGS( Tool::Tools )
|
|
||||||
Q_DECLARE_OPERATORS_FOR_FLAGS( Tool::Sources )
|
|
||||||
|
|
||||||
namespace Draw
|
|
||||||
{
|
|
||||||
/**
|
/**
|
||||||
* @brief The Draw enum
|
* @brief The Draw enum
|
||||||
*/
|
*/
|
||||||
enum Draw { Calculation, Modeling };
|
enum Draw { Calculation, Modeling };
|
||||||
Q_DECLARE_FLAGS(Draws, Draw)
|
Q_DECLARE_FLAGS(Draws, Draw)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief The Unit enum
|
||||||
|
*/
|
||||||
|
enum Unit { Mm, Cm, In };
|
||||||
|
Q_DECLARE_FLAGS(Units, Unit)
|
||||||
}
|
}
|
||||||
Q_DECLARE_OPERATORS_FOR_FLAGS(Draw::Draws)
|
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 )
|
||||||
|
|
||||||
|
extern Valentina::Units patternUnit;
|
||||||
|
|
||||||
#endif // OPTIONS_H
|
#endif // OPTIONS_H
|
||||||
|
|
|
@ -34,12 +34,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 Tool::Sources &typeCreation,
|
const QString &typeLine, const Valentina::Sources &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 == Tool::FromGui)
|
if (typeCreation == Valentina::FromGui)
|
||||||
{
|
{
|
||||||
AddToFile();
|
AddToFile();
|
||||||
}
|
}
|
||||||
|
@ -156,13 +156,13 @@ void VToolAlongLine::Create(DialogTool *dialog, VMainGraphicsScene *scene, VPatt
|
||||||
QString typeLine = dialogTool->getTypeLine();
|
QString typeLine = dialogTool->getTypeLine();
|
||||||
QString pointName = dialogTool->getPointName();
|
QString pointName = dialogTool->getPointName();
|
||||||
Create(0, pointName, typeLine, formula, firstPointId, secondPointId, 5, 10, scene, doc, data,
|
Create(0, pointName, typeLine, formula, firstPointId, secondPointId, 5, 10, scene, doc, data,
|
||||||
Document::FullParse, Tool::FromGui);
|
Document::FullParse, Valentina::FromGui);
|
||||||
}
|
}
|
||||||
|
|
||||||
void VToolAlongLine::Create(const quint32 _id, const QString &pointName, const QString &typeLine,
|
void VToolAlongLine::Create(const quint32 _id, const QString &pointName, const QString &typeLine,
|
||||||
const QString &formula, const quint32 &firstPointId, const quint32 &secondPointId,
|
const QString &formula, const quint32 &firstPointId, const quint32 &secondPointId,
|
||||||
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 Tool::Sources &typeCreation)
|
VContainer *data, const Document::Documents &parse, const Valentina::Sources &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);
|
||||||
|
@ -174,7 +174,7 @@ void VToolAlongLine::Create(const quint32 _id, const QString &pointName, const Q
|
||||||
{
|
{
|
||||||
line.setLength(toPixel(result));
|
line.setLength(toPixel(result));
|
||||||
quint32 id = _id;
|
quint32 id = _id;
|
||||||
if (typeCreation == Tool::FromGui)
|
if (typeCreation == Valentina::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);
|
||||||
|
@ -190,7 +190,7 @@ void VToolAlongLine::Create(const quint32 _id, const QString &pointName, const Q
|
||||||
doc->UpdateToolData(id, data);
|
doc->UpdateToolData(id, data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
VDrawTool::AddRecord(id, Tool::AlongLineTool, doc);
|
VDrawTool::AddRecord(id, Valentina::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 Tool::Sources &typeCreation, QGraphicsItem * parent = nullptr);
|
const Valentina::Sources &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, const QString &formula,
|
static void Create(const quint32 _id, const QString &pointName, const QString &typeLine, const QString &formula,
|
||||||
const quint32 &firstPointId, const quint32 &secondPointId, const qreal &mx, const qreal &my,
|
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 Tool::Sources &typeCreation);
|
const Document::Documents &parse, const Valentina::Sources &typeCreation);
|
||||||
static const QString ToolType;
|
static const QString ToolType;
|
||||||
public slots:
|
public slots:
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -33,7 +33,7 @@
|
||||||
const QString VToolArc::TagName = QStringLiteral("arc");
|
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 Tool::Sources &typeCreation,
|
VToolArc::VToolArc(VPattern *doc, VContainer *data, quint32 id, const Valentina::Sources &typeCreation,
|
||||||
QGraphicsItem *parent)
|
QGraphicsItem *parent)
|
||||||
:VDrawTool(doc, data, id), QGraphicsPathItem(parent)
|
:VDrawTool(doc, data, id), QGraphicsPathItem(parent)
|
||||||
{
|
{
|
||||||
|
@ -47,7 +47,7 @@ VToolArc::VToolArc(VPattern *doc, VContainer *data, quint32 id, const Tool::Sour
|
||||||
this->setFlag(QGraphicsItem::ItemIsFocusable, true);
|
this->setFlag(QGraphicsItem::ItemIsFocusable, true);
|
||||||
this->setAcceptHoverEvents(true);
|
this->setAcceptHoverEvents(true);
|
||||||
|
|
||||||
if (typeCreation == Tool::FromGui)
|
if (typeCreation == Valentina::FromGui)
|
||||||
{
|
{
|
||||||
AddToFile();
|
AddToFile();
|
||||||
}
|
}
|
||||||
|
@ -79,12 +79,12 @@ void VToolArc::Create(DialogTool *dialog, VMainGraphicsScene *scene, VPattern *d
|
||||||
QString radius = dialogTool->GetRadius();
|
QString radius = dialogTool->GetRadius();
|
||||||
QString f1 = dialogTool->GetF1();
|
QString f1 = dialogTool->GetF1();
|
||||||
QString f2 = dialogTool->GetF2();
|
QString f2 = dialogTool->GetF2();
|
||||||
Create(0, center, radius, f1, f2, scene, doc, data, Document::FullParse, Tool::FromGui);
|
Create(0, center, radius, f1, f2, scene, doc, data, Document::FullParse, Valentina::FromGui);
|
||||||
}
|
}
|
||||||
|
|
||||||
void VToolArc::Create(const quint32 _id, const quint32 ¢er, const QString &radius, const QString &f1,
|
void VToolArc::Create(const quint32 _id, const quint32 ¢er, const QString &radius, const QString &f1,
|
||||||
const QString &f2, VMainGraphicsScene *scene, VPattern *doc, VContainer *data,
|
const QString &f2, VMainGraphicsScene *scene, VPattern *doc, VContainer *data,
|
||||||
const Document::Documents &parse, const Tool::Sources &typeCreation)
|
const Document::Documents &parse, const Valentina::Sources &typeCreation)
|
||||||
{
|
{
|
||||||
qreal calcRadius = 0, calcF1 = 0, calcF2 = 0;
|
qreal calcRadius = 0, calcF1 = 0, calcF2 = 0;
|
||||||
|
|
||||||
|
@ -113,7 +113,7 @@ void VToolArc::Create(const quint32 _id, const quint32 ¢er, const QString &r
|
||||||
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 == Tool::FromGui)
|
if (typeCreation == Valentina::FromGui)
|
||||||
{
|
{
|
||||||
id = data->AddGObject(arc);
|
id = data->AddGObject(arc);
|
||||||
}
|
}
|
||||||
|
@ -126,7 +126,7 @@ void VToolArc::Create(const quint32 _id, const quint32 ¢er, const QString &r
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
data->AddLengthArc(id);
|
data->AddLengthArc(id);
|
||||||
VDrawTool::AddRecord(id, Tool::ArcTool, doc);
|
VDrawTool::AddRecord(id, Valentina::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);
|
||||||
|
@ -209,7 +209,7 @@ void VToolArc::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
|
||||||
{
|
{
|
||||||
if (event->button() == Qt::LeftButton)
|
if (event->button() == Qt::LeftButton)
|
||||||
{
|
{
|
||||||
emit ChoosedTool(id, Scene::Arc);
|
emit ChoosedTool(id, Valentina::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 Tool::Sources &typeCreation,
|
VToolArc(VPattern *doc, VContainer *data, quint32 id, const Valentina::Sources &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.
|
||||||
|
@ -77,7 +77,7 @@ public:
|
||||||
*/
|
*/
|
||||||
static void Create(const quint32 _id, const quint32 ¢er, const QString &radius, const QString &f1,
|
static void Create(const quint32 _id, const quint32 ¢er, const QString &radius, const QString &f1,
|
||||||
const QString &f2, VMainGraphicsScene *scene, VPattern *doc, VContainer *data,
|
const QString &f2, VMainGraphicsScene *scene, VPattern *doc, VContainer *data,
|
||||||
const Document::Documents &parse, const Tool::Sources &typeCreation);
|
const Document::Documents &parse, const Valentina::Sources &typeCreation);
|
||||||
static const QString TagName;
|
static const QString TagName;
|
||||||
static const QString ToolType;
|
static const QString ToolType;
|
||||||
public slots:
|
public slots:
|
||||||
|
|
|
@ -34,13 +34,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 Tool::Sources &typeCreation, QGraphicsItem *parent)
|
const quint32 &thirdPointId, const Valentina::Sources &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 == Tool::FromGui)
|
if (typeCreation == Valentina::FromGui)
|
||||||
{
|
{
|
||||||
AddToFile();
|
AddToFile();
|
||||||
}
|
}
|
||||||
|
@ -96,14 +96,14 @@ void VToolBisector::Create(DialogTool *dialog, VMainGraphicsScene *scene, VPatte
|
||||||
QString typeLine = dialogTool->getTypeLine();
|
QString typeLine = dialogTool->getTypeLine();
|
||||||
QString pointName = dialogTool->getPointName();
|
QString pointName = dialogTool->getPointName();
|
||||||
Create(0, formula, firstPointId, secondPointId, thirdPointId, typeLine, pointName, 5, 10, scene, doc, data,
|
Create(0, formula, firstPointId, secondPointId, thirdPointId, typeLine, pointName, 5, 10, scene, doc, data,
|
||||||
Document::FullParse, Tool::FromGui);
|
Document::FullParse, Valentina::FromGui);
|
||||||
}
|
}
|
||||||
|
|
||||||
void VToolBisector::Create(const quint32 _id, const QString &formula, const quint32 &firstPointId,
|
void VToolBisector::Create(const quint32 _id, const 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,
|
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 Tool::Sources &typeCreation)
|
const Document::Documents &parse, const Valentina::Sources &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);
|
||||||
|
@ -117,7 +117,7 @@ void VToolBisector::Create(const quint32 _id, const QString &formula, const quin
|
||||||
QPointF fPoint = VToolBisector::FindPoint(firstPoint->toQPointF(), secondPoint->toQPointF(),
|
QPointF fPoint = VToolBisector::FindPoint(firstPoint->toQPointF(), secondPoint->toQPointF(),
|
||||||
thirdPoint->toQPointF(), toPixel(result));
|
thirdPoint->toQPointF(), toPixel(result));
|
||||||
quint32 id = _id;
|
quint32 id = _id;
|
||||||
if (typeCreation == Tool::FromGui)
|
if (typeCreation == Valentina::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);
|
||||||
|
@ -131,7 +131,7 @@ void VToolBisector::Create(const quint32 _id, const QString &formula, const quin
|
||||||
doc->UpdateToolData(id, data);
|
doc->UpdateToolData(id, data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
VDrawTool::AddRecord(id, Tool::BisectorTool, doc);
|
VDrawTool::AddRecord(id, Valentina::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 Tool::Sources &typeCreation,
|
const quint32 &thirdPointId, const Valentina::Sources &typeCreation,
|
||||||
QGraphicsItem * parent = nullptr);
|
QGraphicsItem * parent = nullptr);
|
||||||
/**
|
/**
|
||||||
* @brief FindPoint find bisector point.
|
* @brief FindPoint find bisector point.
|
||||||
|
@ -97,7 +97,7 @@ public:
|
||||||
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::Documents &parse,
|
||||||
const Tool::Sources &typeCreation);
|
const Valentina::Sources &typeCreation);
|
||||||
static const QString ToolType;
|
static const QString ToolType;
|
||||||
public slots:
|
public slots:
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -35,7 +35,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 Tool::Sources &typeCreation, QGraphicsItem * parent)
|
const Valentina::Sources &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)
|
||||||
{
|
{
|
||||||
|
@ -53,7 +53,7 @@ VToolCutArc::VToolCutArc(VPattern *doc, VContainer *data, const quint32 &id, con
|
||||||
secondArc->setParentItem(this);
|
secondArc->setParentItem(this);
|
||||||
connect(secondArc, &VSimpleArc::Choosed, this, &VToolCutArc::ArcChoosed);
|
connect(secondArc, &VSimpleArc::Choosed, this, &VToolCutArc::ArcChoosed);
|
||||||
|
|
||||||
if (typeCreation == Tool::FromGui)
|
if (typeCreation == Valentina::FromGui)
|
||||||
{
|
{
|
||||||
AddToFile();
|
AddToFile();
|
||||||
}
|
}
|
||||||
|
@ -83,12 +83,12 @@ void VToolCutArc::Create(DialogTool *dialog, VMainGraphicsScene *scene, VPattern
|
||||||
QString pointName = dialogTool->getPointName();
|
QString pointName = dialogTool->getPointName();
|
||||||
QString formula = dialogTool->getFormula();
|
QString formula = dialogTool->getFormula();
|
||||||
quint32 arcId = dialogTool->getArcId();
|
quint32 arcId = dialogTool->getArcId();
|
||||||
Create(0, pointName, formula, arcId, 5, 10, scene, doc, data, Document::FullParse, Tool::FromGui);
|
Create(0, pointName, formula, arcId, 5, 10, scene, doc, data, Document::FullParse, Valentina::FromGui);
|
||||||
}
|
}
|
||||||
|
|
||||||
void VToolCutArc::Create(const quint32 _id, const QString &pointName, const QString &formula, const quint32 &arcId,
|
void VToolCutArc::Create(const quint32 _id, const QString &pointName, const QString &formula, const quint32 &arcId,
|
||||||
const qreal &mx, const qreal &my, VMainGraphicsScene *scene, VPattern *doc,
|
const qreal &mx, const qreal &my, VMainGraphicsScene *scene, VPattern *doc,
|
||||||
VContainer *data, const Document::Documents &parse, const Tool::Sources &typeCreation)
|
VContainer *data, const Document::Documents &parse, const Valentina::Sources &typeCreation)
|
||||||
{
|
{
|
||||||
const VArc *arc = data->GeometricObject<const VArc *>(arcId);
|
const VArc *arc = data->GeometricObject<const VArc *>(arcId);
|
||||||
Calculator cal(data);
|
Calculator cal(data);
|
||||||
|
@ -103,7 +103,7 @@ void VToolCutArc::Create(const quint32 _id, const QString &pointName, const QStr
|
||||||
quint32 id = _id;
|
quint32 id = _id;
|
||||||
quint32 arc1id = 0;
|
quint32 arc1id = 0;
|
||||||
quint32 arc2id = 0;
|
quint32 arc2id = 0;
|
||||||
if (typeCreation == Tool::FromGui)
|
if (typeCreation == Valentina::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);
|
||||||
|
@ -136,7 +136,7 @@ void VToolCutArc::Create(const quint32 _id, const QString &pointName, const QStr
|
||||||
data->AddLengthArc(arc1id);
|
data->AddLengthArc(arc1id);
|
||||||
data->AddLengthArc(arc2id);
|
data->AddLengthArc(arc2id);
|
||||||
|
|
||||||
VDrawTool::AddRecord(id, Tool::CutArcTool, doc);
|
VDrawTool::AddRecord(id, Valentina::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);
|
||||||
|
@ -164,7 +164,7 @@ void VToolCutArc::FullUpdateFromFile()
|
||||||
|
|
||||||
void VToolCutArc::ArcChoosed(quint32 id)
|
void VToolCutArc::ArcChoosed(quint32 id)
|
||||||
{
|
{
|
||||||
emit ChoosedTool(id, Scene::Arc);
|
emit ChoosedTool(id, Valentina::Arc);
|
||||||
}
|
}
|
||||||
|
|
||||||
void VToolCutArc::ChangedActivDraw(const QString &newName)
|
void VToolCutArc::ChangedActivDraw(const QString &newName)
|
||||||
|
|
|
@ -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 Tool::Sources &typeCreation, QGraphicsItem * parent = nullptr);
|
const Valentina::Sources &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 void Create(const quint32 _id, const QString &pointName, const QString &formula, const quint32 &arcId,
|
static void Create(const quint32 _id, const QString &pointName, const 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 Tool::Sources &typeCreation);
|
VContainer *data, const Document::Documents &parse, const Valentina::Sources &typeCreation);
|
||||||
static const QString ToolType;
|
static const QString ToolType;
|
||||||
static const QString AttrArc;
|
static const QString AttrArc;
|
||||||
public slots:
|
public slots:
|
||||||
|
|
|
@ -35,7 +35,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 Tool::Sources &typeCreation, QGraphicsItem *parent)
|
const Valentina::Sources &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)
|
||||||
{
|
{
|
||||||
|
@ -53,7 +53,7 @@ VToolCutSpline::VToolCutSpline(VPattern *doc, VContainer *data, const quint32 &i
|
||||||
secondSpline->setParentItem(this);
|
secondSpline->setParentItem(this);
|
||||||
connect(secondSpline, &VSimpleSpline::Choosed, this, &VToolCutSpline::SplineChoosed);
|
connect(secondSpline, &VSimpleSpline::Choosed, this, &VToolCutSpline::SplineChoosed);
|
||||||
|
|
||||||
if (typeCreation == Tool::FromGui)
|
if (typeCreation == Valentina::FromGui)
|
||||||
{
|
{
|
||||||
AddToFile();
|
AddToFile();
|
||||||
}
|
}
|
||||||
|
@ -83,13 +83,13 @@ void VToolCutSpline::Create(DialogTool *dialog, VMainGraphicsScene *scene,
|
||||||
QString pointName = dialogTool->getPointName();
|
QString pointName = dialogTool->getPointName();
|
||||||
QString formula = dialogTool->getFormula();
|
QString formula = dialogTool->getFormula();
|
||||||
quint32 splineId = dialogTool->getSplineId();
|
quint32 splineId = dialogTool->getSplineId();
|
||||||
Create(0, pointName, formula, splineId, 5, 10, scene, doc, data, Document::FullParse, Tool::FromGui);
|
Create(0, pointName, formula, splineId, 5, 10, scene, doc, data, Document::FullParse, Valentina::FromGui);
|
||||||
}
|
}
|
||||||
|
|
||||||
void VToolCutSpline::Create(const quint32 _id, const QString &pointName,
|
void VToolCutSpline::Create(const quint32 _id, const QString &pointName,
|
||||||
const QString &formula, const quint32 &splineId, const qreal &mx, const qreal &my,
|
const QString &formula, const quint32 &splineId, const qreal &mx, const qreal &my,
|
||||||
VMainGraphicsScene *scene, VPattern *doc, VContainer *data,
|
VMainGraphicsScene *scene, VPattern *doc, VContainer *data,
|
||||||
const Document::Documents &parse, const Tool::Sources &typeCreation)
|
const Document::Documents &parse, const Valentina::Sources &typeCreation)
|
||||||
{
|
{
|
||||||
const VSpline *spl = data->GeometricObject<const VSpline *>(splineId);
|
const VSpline *spl = data->GeometricObject<const VSpline *>(splineId);
|
||||||
Calculator cal(data);
|
Calculator cal(data);
|
||||||
|
@ -103,7 +103,7 @@ void VToolCutSpline::Create(const quint32 _id, const QString &pointName,
|
||||||
quint32 id = _id;
|
quint32 id = _id;
|
||||||
quint32 spl1id = 0;
|
quint32 spl1id = 0;
|
||||||
quint32 spl2id = 0;
|
quint32 spl2id = 0;
|
||||||
if (typeCreation == Tool::FromGui)
|
if (typeCreation == Valentina::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);
|
||||||
|
@ -137,7 +137,7 @@ void VToolCutSpline::Create(const quint32 _id, const QString &pointName,
|
||||||
doc->UpdateToolData(id, data);
|
doc->UpdateToolData(id, data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
VDrawTool::AddRecord(id, Tool::CutSplineTool, doc);
|
VDrawTool::AddRecord(id, Valentina::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);
|
||||||
|
@ -165,7 +165,7 @@ void VToolCutSpline::FullUpdateFromFile()
|
||||||
|
|
||||||
void VToolCutSpline::SplineChoosed(quint32 id)
|
void VToolCutSpline::SplineChoosed(quint32 id)
|
||||||
{
|
{
|
||||||
emit ChoosedTool(id, Scene::Spline);
|
emit ChoosedTool(id, Valentina::Spline);
|
||||||
}
|
}
|
||||||
|
|
||||||
void VToolCutSpline::ChangedActivDraw(const QString &newName)
|
void VToolCutSpline::ChangedActivDraw(const QString &newName)
|
||||||
|
|
|
@ -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 Tool::Sources &typeCreation, QGraphicsItem * parent = nullptr);
|
const Valentina::Sources &typeCreation, QGraphicsItem * parent = nullptr);
|
||||||
/**
|
/**
|
||||||
* @brief setDialog set dialog when user want change tool option.
|
* @brief setDialog set dialog when user want change tool option.
|
||||||
*/
|
*/
|
||||||
|
@ -81,7 +81,7 @@ public:
|
||||||
static void Create(const quint32 _id, const QString &pointName,
|
static void Create(const quint32 _id, const QString &pointName,
|
||||||
const QString &formula, const quint32 &splineId, const qreal &mx, const qreal &my,
|
const QString &formula, const quint32 &splineId, const qreal &mx, const qreal &my,
|
||||||
VMainGraphicsScene *scene, VPattern *doc, VContainer *data,
|
VMainGraphicsScene *scene, VPattern *doc, VContainer *data,
|
||||||
const Document::Documents &parse, const Tool::Sources &typeCreation);
|
const Document::Documents &parse, const Valentina::Sources &typeCreation);
|
||||||
static const QString ToolType;
|
static const QString ToolType;
|
||||||
static const QString AttrSpline;
|
static const QString AttrSpline;
|
||||||
public slots:
|
public slots:
|
||||||
|
|
|
@ -36,7 +36,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 Tool::Sources &typeCreation, QGraphicsItem *parent)
|
const Valentina::Sources &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)
|
||||||
{
|
{
|
||||||
|
@ -54,7 +54,7 @@ VToolCutSplinePath::VToolCutSplinePath(VPattern *doc, VContainer *data, const qu
|
||||||
secondSpline->setParentItem(this);
|
secondSpline->setParentItem(this);
|
||||||
connect(secondSpline, &VSimpleSpline::Choosed, this, &VToolCutSplinePath::SplineChoosed);
|
connect(secondSpline, &VSimpleSpline::Choosed, this, &VToolCutSplinePath::SplineChoosed);
|
||||||
|
|
||||||
if (typeCreation == Tool::FromGui)
|
if (typeCreation == Valentina::FromGui)
|
||||||
{
|
{
|
||||||
AddToFile();
|
AddToFile();
|
||||||
}
|
}
|
||||||
|
@ -83,13 +83,13 @@ void VToolCutSplinePath::Create(DialogTool *dialog, VMainGraphicsScene *scene, V
|
||||||
QString pointName = dialogTool->getPointName();
|
QString pointName = dialogTool->getPointName();
|
||||||
QString formula = dialogTool->getFormula();
|
QString formula = dialogTool->getFormula();
|
||||||
quint32 splinePathId = dialogTool->getSplinePathId();
|
quint32 splinePathId = dialogTool->getSplinePathId();
|
||||||
Create(0, pointName, formula, splinePathId, 5, 10, scene, doc, data, Document::FullParse, Tool::FromGui);
|
Create(0, pointName, formula, splinePathId, 5, 10, scene, doc, data, Document::FullParse, Valentina::FromGui);
|
||||||
}
|
}
|
||||||
|
|
||||||
void VToolCutSplinePath::Create(const quint32 _id, const QString &pointName, const QString &formula,
|
void VToolCutSplinePath::Create(const quint32 _id, const QString &pointName, const 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 Tool::Sources &typeCreation)
|
const Document::Documents &parse, const Valentina::Sources &typeCreation)
|
||||||
{
|
{
|
||||||
const VSplinePath *splPath = data->GeometricObject<const VSplinePath *>(splinePathId);
|
const VSplinePath *splPath = data->GeometricObject<const VSplinePath *>(splinePathId);
|
||||||
Q_CHECK_PTR(splPath);
|
Q_CHECK_PTR(splPath);
|
||||||
|
@ -104,7 +104,7 @@ void VToolCutSplinePath::Create(const quint32 _id, const QString &pointName, con
|
||||||
|
|
||||||
const QPointF point = splPath->CutSplinePath(toPixel(result), p1, p2, spl1p2, spl1p3, spl2p2, spl2p3);
|
const QPointF point = splPath->CutSplinePath(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 == Tool::FromGui)
|
if (typeCreation == Valentina::FromGui)
|
||||||
{
|
{
|
||||||
id = data->AddGObject(p);
|
id = data->AddGObject(p);
|
||||||
}
|
}
|
||||||
|
@ -123,7 +123,7 @@ void VToolCutSplinePath::Create(const quint32 _id, const QString &pointName, con
|
||||||
|
|
||||||
VSplinePath *splPath1 = new VSplinePath();
|
VSplinePath *splPath1 = new VSplinePath();
|
||||||
VSplinePath *splPath2 = new VSplinePath();
|
VSplinePath *splPath2 = new VSplinePath();
|
||||||
if (typeCreation == Tool::FromGui)
|
if (typeCreation == Valentina::FromGui)
|
||||||
{
|
{
|
||||||
for (qint32 i = 0; i < splPath->CountPoint(); i++)
|
for (qint32 i = 0; i < splPath->CountPoint(); i++)
|
||||||
{
|
{
|
||||||
|
@ -210,7 +210,7 @@ void VToolCutSplinePath::Create(const quint32 _id, const QString &pointName, con
|
||||||
doc->UpdateToolData(id, data);
|
doc->UpdateToolData(id, data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
VDrawTool::AddRecord(id, Tool::CutSplinePathTool, doc);
|
VDrawTool::AddRecord(id, Valentina::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,
|
||||||
|
@ -239,7 +239,7 @@ void VToolCutSplinePath::FullUpdateFromFile()
|
||||||
|
|
||||||
void VToolCutSplinePath::SplineChoosed(quint32 id)
|
void VToolCutSplinePath::SplineChoosed(quint32 id)
|
||||||
{
|
{
|
||||||
emit ChoosedTool(id, Scene::SplinePath);
|
emit ChoosedTool(id, Valentina::SplinePath);
|
||||||
}
|
}
|
||||||
|
|
||||||
void VToolCutSplinePath::ChangedActivDraw(const QString &newName)
|
void VToolCutSplinePath::ChangedActivDraw(const QString &newName)
|
||||||
|
|
|
@ -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 Tool::Sources &typeCreation, QGraphicsItem * parent = nullptr);
|
const Valentina::Sources &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 &formula,
|
static void Create(const quint32 _id, const QString &pointName, const QString &formula,
|
||||||
const quint32 &splinePathId, const qreal &mx, const qreal &my, VMainGraphicsScene *scene,
|
const quint32 &splinePathId, const qreal &mx, const qreal &my, VMainGraphicsScene *scene,
|
||||||
VPattern *doc, VContainer *data, const Document::Documents &parse,
|
VPattern *doc, VContainer *data, const Document::Documents &parse,
|
||||||
const Tool::Sources &typeCreation);
|
const Valentina::Sources &typeCreation);
|
||||||
static const QString ToolType;
|
static const QString ToolType;
|
||||||
static const QString AttrSplinePath;
|
static const QString AttrSplinePath;
|
||||||
public slots:
|
public slots:
|
||||||
|
|
|
@ -35,11 +35,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 Tool::Sources &typeCreation, QGraphicsItem *parent)
|
const Valentina::Sources &typeCreation, QGraphicsItem *parent)
|
||||||
:VToolLinePoint(doc, data, id, typeLine, formula, basePointId, angle, parent)
|
:VToolLinePoint(doc, data, id, typeLine, formula, basePointId, angle, parent)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (typeCreation == Tool::FromGui)
|
if (typeCreation == Valentina::FromGui)
|
||||||
{
|
{
|
||||||
AddToFile();
|
AddToFile();
|
||||||
}
|
}
|
||||||
|
@ -74,13 +74,13 @@ void VToolEndLine::Create(DialogTool *dialog, VMainGraphicsScene *scene, VPatter
|
||||||
qreal angle = dialogTool->getAngle();
|
qreal angle = dialogTool->getAngle();
|
||||||
quint32 basePointId = dialogTool->getBasePointId();
|
quint32 basePointId = dialogTool->getBasePointId();
|
||||||
Create(0, pointName, typeLine, formula, angle, basePointId, 5, 10, scene, doc, data, Document::FullParse,
|
Create(0, pointName, typeLine, formula, angle, basePointId, 5, 10, scene, doc, data, Document::FullParse,
|
||||||
Tool::FromGui);
|
Valentina::FromGui);
|
||||||
}
|
}
|
||||||
|
|
||||||
void VToolEndLine::Create(const quint32 _id, const QString &pointName, const QString &typeLine,
|
void VToolEndLine::Create(const quint32 _id, const QString &pointName, const QString &typeLine,
|
||||||
const QString &formula, const qreal &angle, const quint32 &basePointId,
|
const 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 Tool::Sources &typeCreation)
|
VContainer *data, const Document::Documents &parse, const Valentina::Sources &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()));
|
||||||
|
@ -92,7 +92,7 @@ void VToolEndLine::Create(const quint32 _id, const QString &pointName, const QSt
|
||||||
line.setLength(toPixel(result));
|
line.setLength(toPixel(result));
|
||||||
line.setAngle(angle);
|
line.setAngle(angle);
|
||||||
quint32 id = _id;
|
quint32 id = _id;
|
||||||
if (typeCreation == Tool::FromGui)
|
if (typeCreation == Valentina::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);
|
||||||
|
@ -106,7 +106,7 @@ void VToolEndLine::Create(const quint32 _id, const QString &pointName, const QSt
|
||||||
doc->UpdateToolData(id, data);
|
doc->UpdateToolData(id, data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
VDrawTool::AddRecord(id, Tool::EndLineTool, doc);
|
VDrawTool::AddRecord(id, Valentina::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 Tool::Sources &typeCreation, QGraphicsItem * parent = nullptr);
|
const Valentina::Sources &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 QString &formula, const qreal &angle, const quint32 &basePointId, const qreal &mx,
|
const 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 Tool::Sources &typeCreation);
|
const Document::Documents &parse, const Valentina::Sources &typeCreation);
|
||||||
static const QString ToolType;
|
static const QString ToolType;
|
||||||
public slots:
|
public slots:
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -33,11 +33,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 Tool::Sources &typeCreation, QGraphicsItem * parent)
|
const Valentina::Sources &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 == Tool::FromGui)
|
if (typeCreation == Valentina::FromGui)
|
||||||
{
|
{
|
||||||
AddToFile();
|
AddToFile();
|
||||||
}
|
}
|
||||||
|
@ -73,13 +73,13 @@ void VToolHeight::Create(DialogTool *dialog, VMainGraphicsScene *scene, VPattern
|
||||||
quint32 p1LineId = dialogTool->getP1LineId();
|
quint32 p1LineId = dialogTool->getP1LineId();
|
||||||
quint32 p2LineId = dialogTool->getP2LineId();
|
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, Tool::FromGui);
|
Document::FullParse, Valentina::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 Tool::Sources &typeCreation)
|
VContainer *data, const Document::Documents &parse, const Valentina::Sources &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);
|
||||||
|
@ -87,7 +87,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 == Tool::FromGui)
|
if (typeCreation == Valentina::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);
|
||||||
|
@ -105,7 +105,7 @@ void VToolHeight::Create(const quint32 _id, const QString &pointName, const QStr
|
||||||
doc->UpdateToolData(id, data);
|
doc->UpdateToolData(id, data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
VDrawTool::AddRecord(id, Tool::Height, doc);
|
VDrawTool::AddRecord(id, Valentina::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 Tool::Sources &typeCreation, QGraphicsItem * parent = nullptr);
|
const Valentina::Sources &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 Tool::Sources &typeCreation);
|
VContainer *data, const Document::Documents &parse, const Valentina::Sources &typeCreation);
|
||||||
/**
|
/**
|
||||||
* @brief FindPoint find projection base point onto line.
|
* @brief FindPoint find projection base point onto line.
|
||||||
* @param line line
|
* @param line line
|
||||||
|
|
|
@ -32,7 +32,7 @@
|
||||||
const QString VToolLine::TagName = QStringLiteral("line");
|
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 Tool::Sources &typeCreation, QGraphicsItem *parent)
|
const QString &typeLine, const Valentina::Sources &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;
|
||||||
|
@ -47,7 +47,7 @@ VToolLine::VToolLine(VPattern *doc, VContainer *data, quint32 id, quint32 firstP
|
||||||
this->setAcceptHoverEvents(true);
|
this->setAcceptHoverEvents(true);
|
||||||
this->setPen(QPen(Qt::black, toPixel(widthHairLine)/factor, LineStyle()));
|
this->setPen(QPen(Qt::black, toPixel(widthHairLine)/factor, LineStyle()));
|
||||||
|
|
||||||
if (typeCreation == Tool::FromGui)
|
if (typeCreation == Valentina::FromGui)
|
||||||
{
|
{
|
||||||
AddToFile();
|
AddToFile();
|
||||||
}
|
}
|
||||||
|
@ -75,18 +75,18 @@ void VToolLine::Create(DialogTool *dialog, VMainGraphicsScene *scene, VPattern *
|
||||||
quint32 firstPoint = dialogTool->getFirstPoint();
|
quint32 firstPoint = dialogTool->getFirstPoint();
|
||||||
quint32 secondPoint = dialogTool->getSecondPoint();
|
quint32 secondPoint = dialogTool->getSecondPoint();
|
||||||
QString typeLine = dialogTool->getTypeLine();
|
QString typeLine = dialogTool->getTypeLine();
|
||||||
Create(0, firstPoint, secondPoint, typeLine, scene, doc, data, Document::FullParse, Tool::FromGui);
|
Create(0, firstPoint, secondPoint, typeLine, scene, doc, data, Document::FullParse, Valentina::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 Tool::Sources &typeCreation)
|
const Document::Documents &parse, const Valentina::Sources &typeCreation)
|
||||||
{
|
{
|
||||||
Q_CHECK_PTR(scene);
|
Q_CHECK_PTR(scene);
|
||||||
Q_CHECK_PTR(doc);
|
Q_CHECK_PTR(doc);
|
||||||
Q_CHECK_PTR(data);
|
Q_CHECK_PTR(data);
|
||||||
quint32 id = _id;
|
quint32 id = _id;
|
||||||
if (typeCreation == Tool::FromGui)
|
if (typeCreation == Valentina::FromGui)
|
||||||
{
|
{
|
||||||
id = data->getNextId();
|
id = data->getNextId();
|
||||||
data->AddLine(firstPoint, secondPoint);
|
data->AddLine(firstPoint, secondPoint);
|
||||||
|
@ -100,7 +100,7 @@ void VToolLine::Create(const quint32 &_id, const quint32 &firstPoint, const quin
|
||||||
doc->UpdateToolData(id, data);
|
doc->UpdateToolData(id, data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
VDrawTool::AddRecord(id, Tool::LineTool, doc);
|
VDrawTool::AddRecord(id, Valentina::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);
|
||||||
|
|
|
@ -52,7 +52,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 Tool::Sources &typeCreation,
|
quint32 secondPoint, const QString &typeLine, const Valentina::Sources &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.
|
||||||
|
@ -80,7 +80,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 Tool::Sources &typeCreation);
|
const Document::Documents &parse, const Valentina::Sources &typeCreation);
|
||||||
static const QString TagName;
|
static const QString TagName;
|
||||||
public slots:
|
public slots:
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -33,13 +33,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 Tool::Sources &typeCreation,
|
const quint32 &p2Line2, const Valentina::Sources &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 == Tool::FromGui)
|
if (typeCreation == Valentina::FromGui)
|
||||||
{
|
{
|
||||||
AddToFile();
|
AddToFile();
|
||||||
}
|
}
|
||||||
|
@ -73,14 +73,14 @@ void VToolLineIntersect::Create(DialogTool *dialog, VMainGraphicsScene *scene, V
|
||||||
quint32 p2Line2Id = dialogTool->getP2Line2();
|
quint32 p2Line2Id = dialogTool->getP2Line2();
|
||||||
QString pointName = dialogTool->getPointName();
|
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, Tool::FromGui);
|
Document::FullParse, Valentina::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::Documents &parse,
|
||||||
const Tool::Sources &typeCreation)
|
const Valentina::Sources &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);
|
||||||
|
@ -94,7 +94,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 == Tool::FromGui)
|
if (typeCreation == Valentina::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);
|
||||||
|
@ -114,7 +114,7 @@ void VToolLineIntersect::Create(const quint32 _id, const quint32 &p1Line1Id, con
|
||||||
doc->UpdateToolData(id, data);
|
doc->UpdateToolData(id, data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
VDrawTool::AddRecord(id, Tool::LineIntersectTool, doc);
|
VDrawTool::AddRecord(id, Valentina::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 Tool::Sources &typeCreation, QGraphicsItem * parent = nullptr);
|
const Valentina::Sources &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 Tool::Sources &typeCreation);
|
const Document::Documents &parse, const Valentina::Sources &typeCreation);
|
||||||
static const QString ToolType;
|
static const QString ToolType;
|
||||||
public slots:
|
public slots:
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -34,12 +34,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 Tool::Sources &typeCreation, QGraphicsItem *parent)
|
const quint32 &secondPointId, const Valentina::Sources &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 == Tool::FromGui)
|
if (typeCreation == Valentina::FromGui)
|
||||||
{
|
{
|
||||||
AddToFile();
|
AddToFile();
|
||||||
}
|
}
|
||||||
|
@ -75,14 +75,14 @@ void VToolNormal::Create(DialogTool *dialog, VMainGraphicsScene *scene, VPattern
|
||||||
QString pointName = dialogTool->getPointName();
|
QString pointName = dialogTool->getPointName();
|
||||||
qreal angle = dialogTool->getAngle();
|
qreal angle = dialogTool->getAngle();
|
||||||
Create(0, formula, firstPointId, secondPointId, typeLine, pointName, angle, 5, 10, scene, doc, data,
|
Create(0, formula, firstPointId, secondPointId, typeLine, pointName, angle, 5, 10, scene, doc, data,
|
||||||
Document::FullParse, Tool::FromGui);
|
Document::FullParse, Valentina::FromGui);
|
||||||
}
|
}
|
||||||
|
|
||||||
void VToolNormal::Create(const quint32 _id, const QString &formula, const quint32 &firstPointId,
|
void VToolNormal::Create(const quint32 _id, const 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::Documents &parse,
|
||||||
const Tool::Sources &typeCreation)
|
const Valentina::Sources &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);
|
||||||
|
@ -94,7 +94,7 @@ void VToolNormal::Create(const quint32 _id, const QString &formula, const quint3
|
||||||
QPointF fPoint = VToolNormal::FindPoint(firstPoint->toQPointF(), secondPoint->toQPointF(),
|
QPointF fPoint = VToolNormal::FindPoint(firstPoint->toQPointF(), secondPoint->toQPointF(),
|
||||||
toPixel(result), angle);
|
toPixel(result), angle);
|
||||||
quint32 id = _id;
|
quint32 id = _id;
|
||||||
if (typeCreation == Tool::FromGui)
|
if (typeCreation == Valentina::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);
|
||||||
|
@ -108,7 +108,7 @@ void VToolNormal::Create(const quint32 _id, const QString &formula, const quint3
|
||||||
doc->UpdateToolData(id, data);
|
doc->UpdateToolData(id, data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
VDrawTool::AddRecord(id, Tool::NormalTool, doc);
|
VDrawTool::AddRecord(id, Valentina::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 Tool::Sources &typeCreation,
|
const quint32 &secondPointId, const Valentina::Sources &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.
|
||||||
|
@ -88,7 +88,7 @@ public:
|
||||||
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::Documents &parse,
|
||||||
const Tool::Sources &typeCreation);
|
const Valentina::Sources &typeCreation);
|
||||||
/**
|
/**
|
||||||
* @brief FindPoint return normal point.
|
* @brief FindPoint return normal point.
|
||||||
* @param firstPoint first line point.
|
* @param firstPoint first line point.
|
||||||
|
|
|
@ -113,7 +113,7 @@ void VToolPoint::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
|
||||||
{
|
{
|
||||||
if (event->button() == Qt::LeftButton)
|
if (event->button() == Qt::LeftButton)
|
||||||
{
|
{
|
||||||
emit ChoosedTool(id, Scene::Point);
|
emit ChoosedTool(id, Valentina::Point);
|
||||||
}
|
}
|
||||||
QGraphicsItem::mouseReleaseEvent(event);
|
QGraphicsItem::mouseReleaseEvent(event);
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,11 +35,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 Tool::Sources &typeCreation, QGraphicsItem *parent)
|
const Valentina::Sources &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 == Tool::FromGui)
|
if (typeCreation == Valentina::FromGui)
|
||||||
{
|
{
|
||||||
AddToFile();
|
AddToFile();
|
||||||
}
|
}
|
||||||
|
@ -99,14 +99,14 @@ void VToolPointOfContact::Create(DialogTool *dialog, VMainGraphicsScene *scene,
|
||||||
quint32 secondPointId = dialogTool->getSecondPoint();
|
quint32 secondPointId = dialogTool->getSecondPoint();
|
||||||
QString pointName = dialogTool->getPointName();
|
QString pointName = dialogTool->getPointName();
|
||||||
Create(0, radius, center, firstPointId, secondPointId, pointName, 5, 10, scene, doc, data,
|
Create(0, radius, center, firstPointId, secondPointId, pointName, 5, 10, scene, doc, data,
|
||||||
Document::FullParse, Tool::FromGui);
|
Document::FullParse, Valentina::FromGui);
|
||||||
}
|
}
|
||||||
|
|
||||||
void VToolPointOfContact::Create(const quint32 _id, const QString &radius, const quint32 ¢er,
|
void VToolPointOfContact::Create(const quint32 _id, const QString &radius, const quint32 ¢er,
|
||||||
const quint32 &firstPointId, const quint32 &secondPointId,
|
const quint32 &firstPointId, const quint32 &secondPointId,
|
||||||
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 Tool::Sources &typeCreation)
|
const Document::Documents &parse, const Valentina::Sources &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);
|
||||||
|
@ -120,7 +120,7 @@ void VToolPointOfContact::Create(const quint32 _id, const QString &radius, const
|
||||||
QPointF fPoint = VToolPointOfContact::FindPoint(toPixel(result), centerP->toQPointF(),
|
QPointF fPoint = VToolPointOfContact::FindPoint(toPixel(result), centerP->toQPointF(),
|
||||||
firstP->toQPointF(), secondP->toQPointF());
|
firstP->toQPointF(), secondP->toQPointF());
|
||||||
quint32 id = _id;
|
quint32 id = _id;
|
||||||
if (typeCreation == Tool::FromGui)
|
if (typeCreation == Valentina::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);
|
||||||
|
@ -138,7 +138,7 @@ void VToolPointOfContact::Create(const quint32 _id, const QString &radius, const
|
||||||
doc->UpdateToolData(id, data);
|
doc->UpdateToolData(id, data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
VDrawTool::AddRecord(id, Tool::PointOfContact, doc);
|
VDrawTool::AddRecord(id, Valentina::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 Tool::Sources &typeCreation, QGraphicsItem * parent = nullptr);
|
const Valentina::Sources &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 void Create(const quint32 _id, const QString &arcRadius, const quint32 ¢er,
|
static void Create(const quint32 _id, const 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 Tool::Sources &typeCreation);
|
VContainer *data, const Document::Documents &parse, const Valentina::Sources &typeCreation);
|
||||||
static const QString ToolType;
|
static const QString ToolType;
|
||||||
public slots:
|
public slots:
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -33,11 +33,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 Tool::Sources &typeCreation, QGraphicsItem *parent)
|
const Valentina::Sources &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 == Tool::FromGui)
|
if (typeCreation == Valentina::FromGui)
|
||||||
{
|
{
|
||||||
AddToFile();
|
AddToFile();
|
||||||
}
|
}
|
||||||
|
@ -67,20 +67,20 @@ void VToolPointOfIntersection::Create(DialogTool *dialog, VMainGraphicsScene *sc
|
||||||
quint32 firstPointId = dialogTool->getFirstPointId();
|
quint32 firstPointId = dialogTool->getFirstPointId();
|
||||||
quint32 secondPointId = dialogTool->getSecondPointId();
|
quint32 secondPointId = dialogTool->getSecondPointId();
|
||||||
QString pointName = dialogTool->getPointName();
|
QString pointName = dialogTool->getPointName();
|
||||||
Create(0, pointName, firstPointId, secondPointId, 5, 10, scene, doc, data, Document::FullParse, Tool::FromGui);
|
Create(0, pointName, firstPointId, secondPointId, 5, 10, scene, doc, data, Document::FullParse, Valentina::FromGui);
|
||||||
}
|
}
|
||||||
|
|
||||||
void VToolPointOfIntersection::Create(const quint32 _id, const QString &pointName, const quint32 &firstPointId,
|
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 Tool::Sources &typeCreation)
|
const Document::Documents &parse, const Valentina::Sources &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 == Tool::FromGui)
|
if (typeCreation == Valentina::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));
|
||||||
}
|
}
|
||||||
|
@ -92,7 +92,7 @@ void VToolPointOfIntersection::Create(const quint32 _id, const QString &pointNam
|
||||||
doc->UpdateToolData(id, data);
|
doc->UpdateToolData(id, data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
VDrawTool::AddRecord(id, Tool::PointOfIntersection, doc);
|
VDrawTool::AddRecord(id, Valentina::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 Tool::Sources &typeCreation, QGraphicsItem * parent = nullptr);
|
const Valentina::Sources &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, 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::Documents &parse,
|
||||||
const Tool::Sources &typeCreation);
|
const Valentina::Sources &typeCreation);
|
||||||
static const QString ToolType;
|
static const QString ToolType;
|
||||||
public slots:
|
public slots:
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -34,11 +34,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 Tool::Sources &typeCreation,
|
const quint32 &pShoulder, const Valentina::Sources &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 == Tool::FromGui)
|
if (typeCreation == Valentina::FromGui)
|
||||||
{
|
{
|
||||||
AddToFile();
|
AddToFile();
|
||||||
}
|
}
|
||||||
|
@ -101,14 +101,14 @@ void VToolShoulderPoint::Create(DialogTool *dialog, VMainGraphicsScene *scene, V
|
||||||
QString typeLine = dialogTool->getTypeLine();
|
QString typeLine = dialogTool->getTypeLine();
|
||||||
QString pointName = dialogTool->getPointName();
|
QString pointName = dialogTool->getPointName();
|
||||||
Create(0, formula, p1Line, p2Line, pShoulder, typeLine, pointName, 5, 10, scene, doc, data,
|
Create(0, formula, p1Line, p2Line, pShoulder, typeLine, pointName, 5, 10, scene, doc, data,
|
||||||
Document::FullParse, Tool::FromGui);
|
Document::FullParse, Valentina::FromGui);
|
||||||
}
|
}
|
||||||
|
|
||||||
void VToolShoulderPoint::Create(const quint32 _id, const QString &formula, const quint32 &p1Line,
|
void VToolShoulderPoint::Create(const quint32 _id, const QString &formula, const quint32 &p1Line,
|
||||||
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 Tool::Sources &typeCreation)
|
const Document::Documents &parse, const Valentina::Sources &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);
|
||||||
|
@ -122,7 +122,7 @@ void VToolShoulderPoint::Create(const quint32 _id, const QString &formula, const
|
||||||
QPointF fPoint = VToolShoulderPoint::FindPoint(firstPoint->toQPointF(), secondPoint->toQPointF(),
|
QPointF fPoint = VToolShoulderPoint::FindPoint(firstPoint->toQPointF(), secondPoint->toQPointF(),
|
||||||
shoulderPoint->toQPointF(), toPixel(result));
|
shoulderPoint->toQPointF(), toPixel(result));
|
||||||
quint32 id = _id;
|
quint32 id = _id;
|
||||||
if (typeCreation == Tool::FromGui)
|
if (typeCreation == Valentina::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);
|
||||||
|
@ -138,7 +138,7 @@ void VToolShoulderPoint::Create(const quint32 _id, const QString &formula, const
|
||||||
doc->UpdateToolData(id, data);
|
doc->UpdateToolData(id, data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
VDrawTool::AddRecord(id, Tool::ShoulderPointTool, doc);
|
VDrawTool::AddRecord(id, Valentina::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 Tool::Sources &typeCreation,
|
const quint32 &pShoulder, const Valentina::Sources &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 void Create(const quint32 _id, const QString &formula, const quint32 &p1Line, const quint32 &p2Line,
|
static void Create(const quint32 _id, const QString &formula, const quint32 &p1Line, const quint32 &p2Line,
|
||||||
const quint32 &pShoulder, const QString &typeLine, const QString &pointName, const qreal &mx,
|
const 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 Tool::Sources &typeCreation);
|
const Document::Documents &parse, const Valentina::Sources &typeCreation);
|
||||||
static const QString ToolType;
|
static const QString ToolType;
|
||||||
public slots:
|
public slots:
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -31,7 +31,7 @@
|
||||||
|
|
||||||
const QString VToolSinglePoint::ToolType = QStringLiteral("single");
|
const QString VToolSinglePoint::ToolType = QStringLiteral("single");
|
||||||
|
|
||||||
VToolSinglePoint::VToolSinglePoint (VPattern *doc, VContainer *data, quint32 id, const Tool::Sources &typeCreation,
|
VToolSinglePoint::VToolSinglePoint (VPattern *doc, VContainer *data, quint32 id, const Valentina::Sources &typeCreation,
|
||||||
QGraphicsItem * parent )
|
QGraphicsItem * parent )
|
||||||
:VToolPoint(doc, data, id, parent)
|
:VToolPoint(doc, data, id, parent)
|
||||||
{
|
{
|
||||||
|
@ -42,7 +42,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 == Tool::FromGui)
|
if (typeCreation == Valentina::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 Tool::Sources &typeCreation,
|
VToolSinglePoint (VPattern *doc, VContainer *data, quint32 id, const Valentina::Sources &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.
|
||||||
|
|
|
@ -32,7 +32,7 @@
|
||||||
|
|
||||||
const QString VToolSpline::ToolType = QStringLiteral("simple");
|
const QString VToolSpline::ToolType = QStringLiteral("simple");
|
||||||
|
|
||||||
VToolSpline::VToolSpline(VPattern *doc, VContainer *data, quint32 id, const Tool::Sources &typeCreation,
|
VToolSpline::VToolSpline(VPattern *doc, VContainer *data, quint32 id, const Valentina::Sources &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);
|
||||||
|
@ -61,7 +61,7 @@ VToolSpline::VToolSpline(VPattern *doc, VContainer *data, quint32 id, const Tool
|
||||||
connect(this, &VToolSpline::setEnabledPoint, controlPoint2, &VControlPointSpline::setEnabledPoint);
|
connect(this, &VToolSpline::setEnabledPoint, controlPoint2, &VControlPointSpline::setEnabledPoint);
|
||||||
controlPoints.append(controlPoint2);
|
controlPoints.append(controlPoint2);
|
||||||
|
|
||||||
if (typeCreation == Tool::FromGui)
|
if (typeCreation == Valentina::FromGui)
|
||||||
{
|
{
|
||||||
AddToFile();
|
AddToFile();
|
||||||
}
|
}
|
||||||
|
@ -100,19 +100,19 @@ void VToolSpline::Create(DialogTool *dialog, VMainGraphicsScene *scene, VPattern
|
||||||
qreal angle2 = dialogTool->getAngle2();
|
qreal angle2 = dialogTool->getAngle2();
|
||||||
qreal kCurve = dialogTool->getKCurve();
|
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,
|
||||||
Tool::FromGui);
|
Valentina::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 Tool::Sources &typeCreation)
|
const Document::Documents &parse, const Valentina::Sources &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 == Tool::FromGui)
|
if (typeCreation == Valentina::FromGui)
|
||||||
{
|
{
|
||||||
id = data->AddGObject(spline);
|
id = data->AddGObject(spline);
|
||||||
data->AddLengthSpline(spline->name(), toMM(spline->GetLength()));
|
data->AddLengthSpline(spline->name(), toMM(spline->GetLength()));
|
||||||
|
@ -126,7 +126,7 @@ void VToolSpline::Create(const quint32 _id, const quint32 &p1, const quint32 &p4
|
||||||
doc->UpdateToolData(id, data);
|
doc->UpdateToolData(id, data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
VDrawTool::AddRecord(id, Tool::SplineTool, doc);
|
VDrawTool::AddRecord(id, Valentina::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);
|
||||||
|
@ -209,7 +209,7 @@ void VToolSpline::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
|
||||||
{
|
{
|
||||||
if (event->button() == Qt::LeftButton)
|
if (event->button() == Qt::LeftButton)
|
||||||
{
|
{
|
||||||
emit ChoosedTool(id, Scene::Spline);
|
emit ChoosedTool(id, Valentina::Spline);
|
||||||
}
|
}
|
||||||
QGraphicsItem::mouseReleaseEvent(event);
|
QGraphicsItem::mouseReleaseEvent(event);
|
||||||
}
|
}
|
||||||
|
|
|
@ -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.
|
||||||
*/
|
*/
|
||||||
VToolSpline (VPattern *doc, VContainer *data, quint32 id, const Tool::Sources &typeCreation,
|
VToolSpline (VPattern *doc, VContainer *data, quint32 id, const Valentina::Sources &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.
|
||||||
|
@ -80,7 +80,7 @@ public:
|
||||||
static void Create(const quint32 _id, const quint32 &p1, const quint32 &p4, const qreal &kAsm1,
|
static void 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 Tool::Sources &typeCreation);
|
const Document::Documents &parse, const Valentina::Sources &typeCreation);
|
||||||
static const QString ToolType;
|
static const QString ToolType;
|
||||||
public slots:
|
public slots:
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -31,7 +31,7 @@
|
||||||
|
|
||||||
const QString VToolSplinePath::ToolType = QStringLiteral("path");
|
const QString VToolSplinePath::ToolType = QStringLiteral("path");
|
||||||
|
|
||||||
VToolSplinePath::VToolSplinePath(VPattern *doc, VContainer *data, quint32 id, const Tool::Sources &typeCreation,
|
VToolSplinePath::VToolSplinePath(VPattern *doc, VContainer *data, quint32 id, const Valentina::Sources &typeCreation,
|
||||||
QGraphicsItem *parent) :VAbstractSpline(doc, data, id, parent)
|
QGraphicsItem *parent) :VAbstractSpline(doc, data, id, parent)
|
||||||
{
|
{
|
||||||
const VSplinePath *splPath = data->GeometricObject<const VSplinePath *>(id);
|
const VSplinePath *splPath = data->GeometricObject<const VSplinePath *>(id);
|
||||||
|
@ -62,7 +62,7 @@ VToolSplinePath::VToolSplinePath(VPattern *doc, VContainer *data, quint32 id, co
|
||||||
connect(this, &VToolSplinePath::setEnabledPoint, controlPoint, &VControlPointSpline::setEnabledPoint);
|
connect(this, &VToolSplinePath::setEnabledPoint, controlPoint, &VControlPointSpline::setEnabledPoint);
|
||||||
controlPoints.append(controlPoint);
|
controlPoints.append(controlPoint);
|
||||||
}
|
}
|
||||||
if (typeCreation == Tool::FromGui)
|
if (typeCreation == Valentina::FromGui)
|
||||||
{
|
{
|
||||||
AddToFile();
|
AddToFile();
|
||||||
}
|
}
|
||||||
|
@ -91,15 +91,15 @@ void VToolSplinePath::Create(DialogTool *dialog, VMainGraphicsScene *scene, VPat
|
||||||
{
|
{
|
||||||
doc->IncrementReferens((*path)[i].P().id());
|
doc->IncrementReferens((*path)[i].P().id());
|
||||||
}
|
}
|
||||||
Create(0, path, scene, doc, data, Document::FullParse, Tool::FromGui);
|
Create(0, path, scene, doc, data, Document::FullParse, Valentina::FromGui);
|
||||||
}
|
}
|
||||||
|
|
||||||
void VToolSplinePath::Create(const quint32 _id, VSplinePath *path, VMainGraphicsScene *scene,
|
void VToolSplinePath::Create(const quint32 _id, VSplinePath *path, VMainGraphicsScene *scene,
|
||||||
VPattern *doc, VContainer *data, const Document::Documents &parse,
|
VPattern *doc, VContainer *data, const Document::Documents &parse,
|
||||||
const Tool::Sources &typeCreation)
|
const Valentina::Sources &typeCreation)
|
||||||
{
|
{
|
||||||
quint32 id = _id;
|
quint32 id = _id;
|
||||||
if (typeCreation == Tool::FromGui)
|
if (typeCreation == Valentina::FromGui)
|
||||||
{
|
{
|
||||||
id = data->AddGObject(path);
|
id = data->AddGObject(path);
|
||||||
data->AddLengthSpline(path->name(), toMM(path->GetLength()));
|
data->AddLengthSpline(path->name(), toMM(path->GetLength()));
|
||||||
|
@ -113,7 +113,7 @@ void VToolSplinePath::Create(const quint32 _id, VSplinePath *path, VMainGraphics
|
||||||
doc->UpdateToolData(id, data);
|
doc->UpdateToolData(id, data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
VDrawTool::AddRecord(id, Tool::SplinePathTool, doc);
|
VDrawTool::AddRecord(id, Valentina::SplinePathTool, doc);
|
||||||
if (parse == Document::FullParse)
|
if (parse == Document::FullParse)
|
||||||
{
|
{
|
||||||
VToolSplinePath *spl = new VToolSplinePath(doc, data, id, typeCreation);
|
VToolSplinePath *spl = new VToolSplinePath(doc, data, id, typeCreation);
|
||||||
|
@ -256,7 +256,7 @@ void VToolSplinePath::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
|
||||||
{
|
{
|
||||||
if (event->button() == Qt::LeftButton)
|
if (event->button() == Qt::LeftButton)
|
||||||
{
|
{
|
||||||
emit ChoosedTool(id, Scene::SplinePath);
|
emit ChoosedTool(id, Valentina::SplinePath);
|
||||||
}
|
}
|
||||||
QGraphicsItem::mouseReleaseEvent(event);
|
QGraphicsItem::mouseReleaseEvent(event);
|
||||||
}
|
}
|
||||||
|
|
|
@ -46,7 +46,7 @@ public:
|
||||||
* @param typeCreation way we create this tool.
|
* @param typeCreation way we create this tool.
|
||||||
* @param parent parent object.
|
* @param parent parent object.
|
||||||
*/
|
*/
|
||||||
VToolSplinePath(VPattern *doc, VContainer *data, quint32 id, const Tool::Sources &typeCreation,
|
VToolSplinePath(VPattern *doc, VContainer *data, quint32 id, const Valentina::Sources &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.
|
||||||
|
@ -72,7 +72,7 @@ public:
|
||||||
*/
|
*/
|
||||||
static void Create(const quint32 _id, VSplinePath *path, VMainGraphicsScene *scene,
|
static void Create(const quint32 _id, VSplinePath *path, VMainGraphicsScene *scene,
|
||||||
VPattern *doc, VContainer *data, const Document::Documents &parse,
|
VPattern *doc, VContainer *data, const Document::Documents &parse,
|
||||||
const Tool::Sources &typeCreation);
|
const Valentina::Sources &typeCreation);
|
||||||
static const QString ToolType;
|
static const QString ToolType;
|
||||||
signals:
|
signals:
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -33,12 +33,12 @@ const QString VToolTriangle::ToolType = QStringLiteral("triangle");
|
||||||
|
|
||||||
VToolTriangle::VToolTriangle(VPattern *doc, VContainer *data, const quint32 &id,
|
VToolTriangle::VToolTriangle(VPattern *doc, VContainer *data, const quint32 &id,
|
||||||
const quint32 &axisP1Id, const quint32 &axisP2Id, const quint32 &firstPointId,
|
const quint32 &axisP1Id, const quint32 &axisP2Id, const quint32 &firstPointId,
|
||||||
const quint32 &secondPointId, const Tool::Sources &typeCreation, QGraphicsItem *parent)
|
const quint32 &secondPointId, const Valentina::Sources &typeCreation, QGraphicsItem *parent)
|
||||||
:VToolPoint(doc, data, id, parent), axisP1Id(axisP1Id), axisP2Id(axisP2Id), firstPointId(firstPointId),
|
:VToolPoint(doc, data, id, parent), axisP1Id(axisP1Id), axisP2Id(axisP2Id), firstPointId(firstPointId),
|
||||||
secondPointId(secondPointId)
|
secondPointId(secondPointId)
|
||||||
{
|
{
|
||||||
ignoreFullUpdate = true;
|
ignoreFullUpdate = true;
|
||||||
if (typeCreation == Tool::FromGui)
|
if (typeCreation == Valentina::FromGui)
|
||||||
{
|
{
|
||||||
AddToFile();
|
AddToFile();
|
||||||
}
|
}
|
||||||
|
@ -73,13 +73,13 @@ void VToolTriangle::Create(DialogTool *dialog, VMainGraphicsScene *scene,
|
||||||
quint32 secondPointId = dialogTool->getSecondPointId();
|
quint32 secondPointId = dialogTool->getSecondPointId();
|
||||||
QString pointName = dialogTool->getPointName();
|
QString pointName = dialogTool->getPointName();
|
||||||
Create(0, pointName, axisP1Id, axisP2Id, firstPointId, secondPointId, 5, 10, scene, doc, data,
|
Create(0, pointName, axisP1Id, axisP2Id, firstPointId, secondPointId, 5, 10, scene, doc, data,
|
||||||
Document::FullParse, Tool::FromGui);
|
Document::FullParse, Valentina::FromGui);
|
||||||
}
|
}
|
||||||
|
|
||||||
void VToolTriangle::Create(const quint32 _id, const QString &pointName, const quint32 &axisP1Id,
|
void VToolTriangle::Create(const quint32 _id, const QString &pointName, const quint32 &axisP1Id,
|
||||||
const quint32 &axisP2Id, const quint32 &firstPointId, const quint32 &secondPointId,
|
const quint32 &axisP2Id, const quint32 &firstPointId, const quint32 &secondPointId,
|
||||||
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 Tool::Sources &typeCreation)
|
VContainer *data, const Document::Documents &parse, const Valentina::Sources &typeCreation)
|
||||||
{
|
{
|
||||||
const VPointF *axisP1 = data->GeometricObject<const VPointF *>(axisP1Id);
|
const VPointF *axisP1 = data->GeometricObject<const VPointF *>(axisP1Id);
|
||||||
const VPointF *axisP2 = data->GeometricObject<const VPointF *>(axisP2Id);
|
const VPointF *axisP2 = data->GeometricObject<const VPointF *>(axisP2Id);
|
||||||
|
@ -89,7 +89,7 @@ void VToolTriangle::Create(const quint32 _id, const QString &pointName, const qu
|
||||||
QPointF point = FindPoint(axisP1->toQPointF(), axisP2->toQPointF(), firstPoint->toQPointF(),
|
QPointF point = FindPoint(axisP1->toQPointF(), axisP2->toQPointF(), firstPoint->toQPointF(),
|
||||||
secondPoint->toQPointF());
|
secondPoint->toQPointF());
|
||||||
quint32 id = _id;
|
quint32 id = _id;
|
||||||
if (typeCreation == Tool::FromGui)
|
if (typeCreation == Valentina::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));
|
||||||
}
|
}
|
||||||
|
@ -101,7 +101,7 @@ void VToolTriangle::Create(const quint32 _id, const QString &pointName, const qu
|
||||||
doc->UpdateToolData(id, data);
|
doc->UpdateToolData(id, data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
VDrawTool::AddRecord(id, Tool::Triangle, doc);
|
VDrawTool::AddRecord(id, Valentina::Triangle, doc);
|
||||||
if (parse == Document::FullParse)
|
if (parse == Document::FullParse)
|
||||||
{
|
{
|
||||||
VToolTriangle *point = new VToolTriangle(doc, data, id, axisP1Id, axisP2Id, firstPointId,
|
VToolTriangle *point = new VToolTriangle(doc, data, id, axisP1Id, axisP2Id, firstPointId,
|
||||||
|
|
|
@ -52,7 +52,7 @@ public:
|
||||||
*/
|
*/
|
||||||
VToolTriangle(VPattern *doc, VContainer *data, const quint32 &id, const quint32 &axisP1Id,
|
VToolTriangle(VPattern *doc, VContainer *data, const quint32 &id, const quint32 &axisP1Id,
|
||||||
const quint32 &axisP2Id, const quint32 &firstPointId, const quint32 &secondPointId,
|
const quint32 &axisP2Id, const quint32 &firstPointId, const quint32 &secondPointId,
|
||||||
const Tool::Sources &typeCreation, QGraphicsItem * parent = nullptr);
|
const Valentina::Sources &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 quint32 &axisP1Id, const quint32 &axisP2Id,
|
static void Create(const quint32 _id, const QString &pointName, const quint32 &axisP1Id, const quint32 &axisP2Id,
|
||||||
const quint32 &firstPointId, const quint32 &secondPointId, const qreal &mx, const qreal &my,
|
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 Tool::Sources &typeCreation);
|
const Document::Documents &parse, const Valentina::Sources &typeCreation);
|
||||||
/**
|
/**
|
||||||
* @brief FindPoint find point intersection two foots right triangle.
|
* @brief FindPoint find point intersection two foots right triangle.
|
||||||
* @param axisP1 first axis point.
|
* @param axisP1 first axis point.
|
||||||
|
|
|
@ -33,14 +33,14 @@
|
||||||
const QString VNodeArc::TagName = QStringLiteral("arc");
|
const QString VNodeArc::TagName = QStringLiteral("arc");
|
||||||
const QString VNodeArc::ToolType = QStringLiteral("modeling");
|
const QString VNodeArc::ToolType = QStringLiteral("modeling");
|
||||||
|
|
||||||
VNodeArc::VNodeArc(VPattern *doc, VContainer *data, quint32 id, quint32 idArc, const Tool::Sources &typeCreation,
|
VNodeArc::VNodeArc(VPattern *doc, VContainer *data, quint32 id, quint32 idArc, const Valentina::Sources &typeCreation,
|
||||||
const quint32 &idTool, QObject *qoParent, QGraphicsItem *parent)
|
const quint32 &idTool, QObject *qoParent, QGraphicsItem *parent)
|
||||||
:VAbstractNode(doc, data, id, idArc, idTool, qoParent), QGraphicsPathItem(parent)
|
:VAbstractNode(doc, data, id, idArc, idTool, qoParent), QGraphicsPathItem(parent)
|
||||||
{
|
{
|
||||||
RefreshGeometry();
|
RefreshGeometry();
|
||||||
this->setPen(QPen(baseColor, toPixel(widthHairLine)));
|
this->setPen(QPen(baseColor, toPixel(widthHairLine)));
|
||||||
|
|
||||||
if (typeCreation == Tool::FromGui)
|
if (typeCreation == Valentina::FromGui)
|
||||||
{
|
{
|
||||||
AddToFile();
|
AddToFile();
|
||||||
}
|
}
|
||||||
|
@ -51,9 +51,9 @@ VNodeArc::VNodeArc(VPattern *doc, VContainer *data, quint32 id, quint32 idArc, c
|
||||||
}
|
}
|
||||||
|
|
||||||
void VNodeArc::Create(VPattern *doc, VContainer *data, quint32 id, quint32 idArc, const Document::Documents &parse,
|
void VNodeArc::Create(VPattern *doc, VContainer *data, quint32 id, quint32 idArc, const Document::Documents &parse,
|
||||||
const Tool::Sources &typeCreation, const quint32 &idTool, QObject *parent)
|
const Valentina::Sources &typeCreation, const quint32 &idTool, QObject *parent)
|
||||||
{
|
{
|
||||||
VAbstractTool::AddRecord(id, Tool::NodeArc, doc);
|
VAbstractTool::AddRecord(id, Valentina::NodeArc, doc);
|
||||||
if (parse == Document::FullParse)
|
if (parse == Document::FullParse)
|
||||||
{
|
{
|
||||||
VNodeArc *arc = new VNodeArc(doc, data, id, idArc, typeCreation, idTool, parent);
|
VNodeArc *arc = new VNodeArc(doc, data, id, idArc, typeCreation, idTool, parent);
|
||||||
|
@ -120,7 +120,7 @@ void VNodeArc::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
|
||||||
{
|
{
|
||||||
if (event->button() == Qt::LeftButton)
|
if (event->button() == Qt::LeftButton)
|
||||||
{
|
{
|
||||||
emit ChoosedTool(id, Scene::Arc);
|
emit ChoosedTool(id, Valentina::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.
|
||||||
*/
|
*/
|
||||||
VNodeArc(VPattern *doc, VContainer *data, quint32 id, quint32 idArc, const Tool::Sources &typeCreation,
|
VNodeArc(VPattern *doc, VContainer *data, quint32 id, quint32 idArc, const Valentina::Sources &typeCreation,
|
||||||
const quint32 &idTool = 0, QObject *qoParent = nullptr, QGraphicsItem * parent = nullptr);
|
const quint32 &idTool = 0, QObject *qoParent = nullptr, QGraphicsItem * parent = nullptr);
|
||||||
/**
|
/**
|
||||||
* @brief Create help create tool.
|
* @brief Create help create tool.
|
||||||
|
@ -60,7 +60,7 @@ public:
|
||||||
* @param typeCreation way we create this tool.
|
* @param typeCreation way we create this tool.
|
||||||
*/
|
*/
|
||||||
static void Create(VPattern *doc, VContainer *data, quint32 id, quint32 idArc, const Document::Documents &parse,
|
static void Create(VPattern *doc, VContainer *data, quint32 id, quint32 idArc, const Document::Documents &parse,
|
||||||
const Tool::Sources &typeCreation, const quint32 &idTool = 0, QObject *parent = nullptr);
|
const Valentina::Sources &typeCreation, const quint32 &idTool = 0, QObject *parent = nullptr);
|
||||||
static const QString TagName;
|
static const QString TagName;
|
||||||
static const QString ToolType;
|
static const QString ToolType;
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -34,7 +34,7 @@ const QString VNodePoint::TagName = QStringLiteral("point");
|
||||||
const QString VNodePoint::ToolType = QStringLiteral("modeling");
|
const QString VNodePoint::ToolType = QStringLiteral("modeling");
|
||||||
|
|
||||||
VNodePoint::VNodePoint(VPattern *doc, VContainer *data, quint32 id, quint32 idPoint,
|
VNodePoint::VNodePoint(VPattern *doc, VContainer *data, quint32 id, quint32 idPoint,
|
||||||
const Tool::Sources &typeCreation, const quint32 &idTool, QObject *qoParent,
|
const Valentina::Sources &typeCreation, const quint32 &idTool, QObject *qoParent,
|
||||||
QGraphicsItem *parent)
|
QGraphicsItem *parent)
|
||||||
:VAbstractNode(doc, data, id, idPoint, idTool, qoParent), QGraphicsEllipseItem(parent), radius(toPixel(1.5)),
|
:VAbstractNode(doc, data, id, idPoint, idTool, qoParent), QGraphicsEllipseItem(parent), radius(toPixel(1.5)),
|
||||||
namePoint(nullptr), lineName(nullptr)
|
namePoint(nullptr), lineName(nullptr)
|
||||||
|
@ -48,7 +48,7 @@ VNodePoint::VNodePoint(VPattern *doc, VContainer *data, quint32 id, quint32 idPo
|
||||||
this->setFlag(QGraphicsItem::ItemIsSelectable, true);
|
this->setFlag(QGraphicsItem::ItemIsSelectable, true);
|
||||||
this->setAcceptHoverEvents(true);
|
this->setAcceptHoverEvents(true);
|
||||||
RefreshPointGeometry(*VAbstractTool::data.GeometricObject<const VPointF *>(id));
|
RefreshPointGeometry(*VAbstractTool::data.GeometricObject<const VPointF *>(id));
|
||||||
if (typeCreation == Tool::FromGui)
|
if (typeCreation == Valentina::FromGui)
|
||||||
{
|
{
|
||||||
AddToFile();
|
AddToFile();
|
||||||
}
|
}
|
||||||
|
@ -59,10 +59,10 @@ VNodePoint::VNodePoint(VPattern *doc, VContainer *data, quint32 id, quint32 idPo
|
||||||
}
|
}
|
||||||
|
|
||||||
void VNodePoint::Create(VPattern *doc, VContainer *data, quint32 id, quint32 idPoint,
|
void VNodePoint::Create(VPattern *doc, VContainer *data, quint32 id, quint32 idPoint,
|
||||||
const Document::Documents &parse, const Tool::Sources &typeCreation, const quint32 &idTool,
|
const Document::Documents &parse, const Valentina::Sources &typeCreation, const quint32 &idTool,
|
||||||
QObject *parent)
|
QObject *parent)
|
||||||
{
|
{
|
||||||
VAbstractTool::AddRecord(id, Tool::NodePoint, doc);
|
VAbstractTool::AddRecord(id, Valentina::NodePoint, doc);
|
||||||
if (parse == Document::FullParse)
|
if (parse == Document::FullParse)
|
||||||
{
|
{
|
||||||
//TODO Need create garbage collector and remove all nodes, what we don't use.
|
//TODO Need create garbage collector and remove all nodes, what we don't use.
|
||||||
|
@ -137,7 +137,7 @@ void VNodePoint::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
|
||||||
{
|
{
|
||||||
if (event->button() == Qt::LeftButton)
|
if (event->button() == Qt::LeftButton)
|
||||||
{
|
{
|
||||||
emit ChoosedTool(id, Scene::Point);
|
emit ChoosedTool(id, Valentina::Point);
|
||||||
}
|
}
|
||||||
QGraphicsItem::mouseReleaseEvent(event);
|
QGraphicsItem::mouseReleaseEvent(event);
|
||||||
}
|
}
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user