Refactoring.

This commit is contained in:
Roman Telezhynskyi 2022-08-23 16:37:58 +03:00
parent b9a2a6715b
commit c10279c7e1
151 changed files with 2917 additions and 2507 deletions

View File

@ -225,10 +225,10 @@ void DialogAlongLine::SaveData()
auto *line = qobject_cast<VisToolAlongLine *>(vis); auto *line = qobject_cast<VisToolAlongLine *>(vis);
SCASSERT(line != nullptr) SCASSERT(line != nullptr)
line->setObject1Id(GetFirstPointId()); line->SetPoint1Id(GetFirstPointId());
line->setObject2Id(GetSecondPointId()); line->SetPoint2Id(GetSecondPointId());
line->setLength(m_formula); line->SetLength(m_formula);
line->setLineStyle(LineStyleToPenStyle(GetTypeLine())); line->SetLineStyle(LineStyleToPenStyle(GetTypeLine()));
line->RefreshGeometry(); line->RefreshGeometry();
} }
@ -274,7 +274,7 @@ void DialogAlongLine::ChosenSecondPoint(quint32 id, const QString &toolTip)
if (m_flagError) if (m_flagError)
{ {
line->setObject2Id(id); line->SetPoint2Id(id);
if (m_buildMidpoint) if (m_buildMidpoint)
{ {
SetFormula(currentLength + QStringLiteral("/2")); SetFormula(currentLength + QStringLiteral("/2"));
@ -316,7 +316,7 @@ void DialogAlongLine::SetSecondPointId(quint32 value)
auto *line = qobject_cast<VisToolAlongLine *>(vis); auto *line = qobject_cast<VisToolAlongLine *>(vis);
SCASSERT(line != nullptr) SCASSERT(line != nullptr)
line->setObject2Id(value); line->SetPoint2Id(value);
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
@ -339,7 +339,7 @@ void DialogAlongLine::Build(const Tool &type)
m_buildMidpoint = true; m_buildMidpoint = true;
auto *line = qobject_cast<VisToolAlongLine *>(vis); auto *line = qobject_cast<VisToolAlongLine *>(vis);
SCASSERT(line != nullptr) SCASSERT(line != nullptr)
line->setMidPointMode(m_buildMidpoint); line->SetMidPointMode(m_buildMidpoint);
} }
} }
@ -407,7 +407,7 @@ void DialogAlongLine::SetFirstPointId(quint32 value)
auto *line = qobject_cast<VisToolAlongLine *>(vis); auto *line = qobject_cast<VisToolAlongLine *>(vis);
SCASSERT(line != nullptr) SCASSERT(line != nullptr)
line->setObject1Id(value); line->SetPoint1Id(value);
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
@ -428,7 +428,7 @@ void DialogAlongLine::SetFormula(const QString &value)
auto *line = qobject_cast<VisToolAlongLine *>(vis); auto *line = qobject_cast<VisToolAlongLine *>(vis);
SCASSERT(line != nullptr) SCASSERT(line != nullptr)
line->setLength(m_formula); line->SetLength(m_formula);
MoveCursorToEnd(ui->plainTextEditFormula); MoveCursorToEnd(ui->plainTextEditFormula);
} }
@ -441,7 +441,7 @@ void DialogAlongLine::SetFormula(const QString &value)
void DialogAlongLine::SetTypeLine(const QString &value) void DialogAlongLine::SetTypeLine(const QString &value)
{ {
ChangeCurrentData(ui->comboBoxLineType, value); ChangeCurrentData(ui->comboBoxLineType, value);
vis->setLineStyle(LineStyleToPenStyle(value)); vis->SetLineStyle(LineStyleToPenStyle(value));
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------

View File

@ -154,7 +154,10 @@ DialogArc::~DialogArc()
void DialogArc::SetCenter(const quint32 &value) void DialogArc::SetCenter(const quint32 &value)
{ {
ChangeCurrentData(ui->comboBoxBasePoint, value); ChangeCurrentData(ui->comboBoxBasePoint, value);
vis->setObject1Id(value);
auto *path = qobject_cast<VisToolArc *>(vis);
SCASSERT(path != nullptr)
path->SetCenterId(value);
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
@ -175,7 +178,7 @@ void DialogArc::SetF2(const QString &value)
auto *path = qobject_cast<VisToolArc *>(vis); auto *path = qobject_cast<VisToolArc *>(vis);
SCASSERT(path != nullptr) SCASSERT(path != nullptr)
path->setF2(m_f2); path->SetF2(m_f2);
MoveCursorToEnd(ui->plainTextEditF2); MoveCursorToEnd(ui->plainTextEditF2);
} }
@ -217,7 +220,7 @@ void DialogArc::SetApproximationScale(qreal value)
auto *path = qobject_cast<VisToolArc *>(vis); auto *path = qobject_cast<VisToolArc *>(vis);
SCASSERT(path != nullptr) SCASSERT(path != nullptr)
path->setApproximationScale(value); path->SetApproximationScale(value);
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
@ -343,7 +346,7 @@ void DialogArc::SetF1(const QString &value)
auto *path = qobject_cast<VisToolArc *>(vis); auto *path = qobject_cast<VisToolArc *>(vis);
SCASSERT(path != nullptr) SCASSERT(path != nullptr)
path->setF1(m_f1); path->SetF1(m_f1);
MoveCursorToEnd(ui->plainTextEditF1); MoveCursorToEnd(ui->plainTextEditF1);
} }
@ -366,7 +369,7 @@ void DialogArc::SetRadius(const QString &value)
auto *path = qobject_cast<VisToolArc *>(vis); auto *path = qobject_cast<VisToolArc *>(vis);
SCASSERT(path != nullptr) SCASSERT(path != nullptr)
path->setRadius(m_radius); path->SetRadius(m_radius);
MoveCursorToEnd(ui->plainTextEditFormula); MoveCursorToEnd(ui->plainTextEditFormula);
} }
@ -418,11 +421,11 @@ void DialogArc::SaveData()
auto *path = qobject_cast<VisToolArc *>(vis); auto *path = qobject_cast<VisToolArc *>(vis);
SCASSERT(path != nullptr) SCASSERT(path != nullptr)
path->setObject1Id(GetCenter()); path->SetCenterId(GetCenter());
path->setRadius(m_radius); path->SetRadius(m_radius);
path->setF1(m_f1); path->SetF1(m_f1);
path->setF2(m_f2); path->SetF2(m_f2);
path->setApproximationScale(ui->doubleSpinBoxApproximationScale->value()); path->SetApproximationScale(ui->doubleSpinBoxApproximationScale->value());
path->RefreshGeometry(); path->RefreshGeometry();
} }

View File

@ -133,7 +133,9 @@ auto DialogArcWithLength::GetCenter() const -> quint32
void DialogArcWithLength::SetCenter(const quint32 &value) void DialogArcWithLength::SetCenter(const quint32 &value)
{ {
ChangeCurrentData(ui->comboBoxCenter, value); ChangeCurrentData(ui->comboBoxCenter, value);
vis->setObject1Id(value); auto *path = qobject_cast<VisToolArcWithLength *>(vis);
SCASSERT(path != nullptr)
path->SetCenterId(value);
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
@ -156,7 +158,7 @@ void DialogArcWithLength::SetRadius(const QString &value)
auto *path = qobject_cast<VisToolArcWithLength *>(vis); auto *path = qobject_cast<VisToolArcWithLength *>(vis);
SCASSERT(path != nullptr) SCASSERT(path != nullptr)
path->setRadius(radius); path->SetRadius(radius);
MoveCursorToEnd(ui->plainTextEditRadius); MoveCursorToEnd(ui->plainTextEditRadius);
} }
@ -181,7 +183,7 @@ void DialogArcWithLength::SetF1(const QString &value)
auto *path = qobject_cast<VisToolArcWithLength *>(vis); auto *path = qobject_cast<VisToolArcWithLength *>(vis);
SCASSERT(path != nullptr) SCASSERT(path != nullptr)
path->setF1(f1); path->SetF1(f1);
MoveCursorToEnd(ui->plainTextEditF1); MoveCursorToEnd(ui->plainTextEditF1);
} }
@ -206,7 +208,7 @@ void DialogArcWithLength::SetLength(const QString &value)
auto *path = qobject_cast<VisToolArcWithLength *>(vis); auto *path = qobject_cast<VisToolArcWithLength *>(vis);
SCASSERT(path != nullptr) SCASSERT(path != nullptr)
path->setLength(length); path->SetLength(length);
MoveCursorToEnd(ui->plainTextEditLength); MoveCursorToEnd(ui->plainTextEditLength);
} }
@ -248,7 +250,7 @@ void DialogArcWithLength::SetApproximationScale(qreal value)
auto *path = qobject_cast<VisToolArcWithLength *>(vis); auto *path = qobject_cast<VisToolArcWithLength *>(vis);
SCASSERT(path != nullptr) SCASSERT(path != nullptr)
path->setApproximationScale(value); path->SetApproximationScale(value);
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
@ -462,11 +464,11 @@ void DialogArcWithLength::SaveData()
auto *path = qobject_cast<VisToolArcWithLength *>(vis); auto *path = qobject_cast<VisToolArcWithLength *>(vis);
SCASSERT(path != nullptr) SCASSERT(path != nullptr)
path->setObject1Id(GetCenter()); path->SetCenterId(GetCenter());
path->setRadius(radius); path->SetRadius(radius);
path->setF1(f1); path->SetF1(f1);
path->setLength(length); path->SetLength(length);
path->setApproximationScale(ui->doubleSpinBoxApproximationScale->value()); path->SetApproximationScale(ui->doubleSpinBoxApproximationScale->value());
path->RefreshGeometry(); path->RefreshGeometry();
} }

View File

@ -218,7 +218,7 @@ void DialogBisector::ChosenObject(quint32 id, const SceneObject &type)
if (SetObject(id, ui->comboBoxSecondPoint, tr("Select third point of angle"))) if (SetObject(id, ui->comboBoxSecondPoint, tr("Select third point of angle")))
{ {
m_number++; m_number++;
line->setObject2Id(id); line->SetPoint2Id(id);
line->RefreshGeometry(); line->RefreshGeometry();
} }
} }
@ -251,7 +251,7 @@ void DialogBisector::SetPointName(const QString &value)
void DialogBisector::SetTypeLine(const QString &value) void DialogBisector::SetTypeLine(const QString &value)
{ {
ChangeCurrentData(ui->comboBoxLineType, value); ChangeCurrentData(ui->comboBoxLineType, value);
vis->setLineStyle(LineStyleToPenStyle(value)); vis->SetLineStyle(LineStyleToPenStyle(value));
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
@ -272,7 +272,7 @@ void DialogBisector::SetFormula(const QString &value)
auto *line = qobject_cast<VisToolBisector *>(vis); auto *line = qobject_cast<VisToolBisector *>(vis);
SCASSERT(line != nullptr) SCASSERT(line != nullptr)
line->setLength(m_formula); line->SetLength(m_formula);
MoveCursorToEnd(ui->plainTextEditFormula); MoveCursorToEnd(ui->plainTextEditFormula);
} }
@ -288,7 +288,7 @@ void DialogBisector::SetFirstPointId(const quint32 &value)
auto *line = qobject_cast<VisToolBisector *>(vis); auto *line = qobject_cast<VisToolBisector *>(vis);
SCASSERT(line != nullptr) SCASSERT(line != nullptr)
line->setObject1Id(value); line->SetPoint1Id(value);
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
@ -302,7 +302,7 @@ void DialogBisector::SetSecondPointId(const quint32 &value)
auto *line = qobject_cast<VisToolBisector *>(vis); auto *line = qobject_cast<VisToolBisector *>(vis);
SCASSERT(line != nullptr) SCASSERT(line != nullptr)
line->setObject2Id(value); line->SetPoint2Id(value);
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
@ -316,7 +316,7 @@ void DialogBisector::SetThirdPointId(const quint32 &value)
auto *line = qobject_cast<VisToolBisector *>(vis); auto *line = qobject_cast<VisToolBisector *>(vis);
SCASSERT(line != nullptr) SCASSERT(line != nullptr)
line->setObject3Id(value); line->SetPoint3Id(value);
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
@ -412,11 +412,11 @@ void DialogBisector::SaveData()
auto *line = qobject_cast<VisToolBisector *>(vis); auto *line = qobject_cast<VisToolBisector *>(vis);
SCASSERT(line != nullptr) SCASSERT(line != nullptr)
line->setObject1Id(GetFirstPointId()); line->SetPoint1Id(GetFirstPointId());
line->setObject2Id(GetSecondPointId()); line->SetPoint2Id(GetSecondPointId());
line->setObject3Id(GetThirdPointId()); line->SetPoint3Id(GetThirdPointId());
line->setLength(m_formula); line->SetLength(m_formula);
line->setLineStyle(LineStyleToPenStyle(GetTypeLine())); line->SetLineStyle(LineStyleToPenStyle(GetTypeLine()));
line->RefreshGeometry(); line->RefreshGeometry();
} }
@ -447,7 +447,7 @@ void DialogBisector::ChosenThirdPoint(quint32 id)
SCASSERT(line != nullptr) SCASSERT(line != nullptr)
connect(line, &Visualization::ToolTip, window, &VAbstractMainWindow::ShowToolTip); connect(line, &Visualization::ToolTip, window, &VAbstractMainWindow::ShowToolTip);
line->setObject3Id(id); line->SetPoint3Id(id);
line->RefreshGeometry(); line->RefreshGeometry();
prepare = true; prepare = true;
} }

View File

@ -35,7 +35,6 @@
#include <QPointer> #include <QPointer>
#include <new> #include <new>
#include "../../tools/vabstracttool.h"
#include "../../visualization/path/vistoolcubicbezier.h" #include "../../visualization/path/vistoolcubicbezier.h"
#include "../../visualization/visualization.h" #include "../../visualization/visualization.h"
#include "../vgeometry/vpointf.h" #include "../vgeometry/vpointf.h"
@ -115,11 +114,11 @@ void DialogCubicBezier::SetSpline(const VCubicBezier &spline)
auto path = qobject_cast<VisToolCubicBezier *>(vis); auto path = qobject_cast<VisToolCubicBezier *>(vis);
SCASSERT(path != nullptr) SCASSERT(path != nullptr)
path->setApproximationScale(spl.GetApproximationScale()); path->SetApproximationScale(spl.GetApproximationScale());
path->setObject1Id(spl.GetP1().id()); path->SetPoint1Id(spl.GetP1().id());
path->setObject2Id(spl.GetP2().id()); path->SetPoint2Id(spl.GetP2().id());
path->setObject3Id(spl.GetP3().id()); path->SetPoint3Id(spl.GetP3().id());
path->setObject4Id(spl.GetP4().id()); path->SetPoint4Id(spl.GetP4().id());
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
@ -146,7 +145,7 @@ void DialogCubicBezier::ChosenObject(quint32 id, const SceneObject &type)
{ {
++number; ++number;
path->setObject2Id(id); path->SetPoint2Id(id);
path->RefreshGeometry(); path->RefreshGeometry();
} }
break; break;
@ -155,7 +154,7 @@ void DialogCubicBezier::ChosenObject(quint32 id, const SceneObject &type)
{ {
++number; ++number;
path->setObject3Id(id); path->SetPoint3Id(id);
path->RefreshGeometry(); path->RefreshGeometry();
} }
break; break;
@ -166,7 +165,7 @@ void DialogCubicBezier::ChosenObject(quint32 id, const SceneObject &type)
{ {
++number; ++number;
path->setObject4Id(id); path->SetPoint4Id(id);
path->RefreshGeometry(); path->RefreshGeometry();
prepare = true; prepare = true;
DialogAccepted(); DialogAccepted();
@ -255,11 +254,11 @@ void DialogCubicBezier::SaveData()
auto path = qobject_cast<VisToolCubicBezier *>(vis); auto path = qobject_cast<VisToolCubicBezier *>(vis);
SCASSERT(path != nullptr) SCASSERT(path != nullptr)
path->setApproximationScale(ui->doubleSpinBoxApproximationScale->value()); path->SetApproximationScale(ui->doubleSpinBoxApproximationScale->value());
path->setObject1Id(p1->id()); path->SetPoint1Id(p1->id());
path->setObject2Id(p2->id()); path->SetPoint2Id(p2->id());
path->setObject3Id(p3->id()); path->SetPoint3Id(p3->id());
path->setObject4Id(p4->id()); path->SetPoint4Id(p4->id());
path->SetMode(Mode::Show); path->SetMode(Mode::Show);
path->RefreshGeometry(); path->RefreshGeometry();
} }

View File

@ -44,12 +44,10 @@
#include <Qt> #include <Qt>
#include <new> #include <new>
#include "../../tools/vabstracttool.h"
#include "../../visualization/path/vistoolcubicbezierpath.h" #include "../../visualization/path/vistoolcubicbezierpath.h"
#include "../../visualization/visualization.h" #include "../../visualization/visualization.h"
#include "../ifc/ifcdef.h" #include "../ifc/ifcdef.h"
#include "../vmisc/vabstractapplication.h" #include "../vmisc/vabstractapplication.h"
#include "../vmisc/vmath.h"
#if QT_VERSION < QT_VERSION_CHECK(5, 7, 0) #if QT_VERSION < QT_VERSION_CHECK(5, 7, 0)
#include "../vmisc/backport/qoverload.h" #include "../vmisc/backport/qoverload.h"
#endif // QT_VERSION < QT_VERSION_CHECK(5, 7, 0) #endif // QT_VERSION < QT_VERSION_CHECK(5, 7, 0)
@ -127,7 +125,7 @@ void DialogCubicBezierPath::SetPath(const VCubicBezierPath &value)
auto visPath = qobject_cast<VisToolCubicBezierPath *>(vis); auto visPath = qobject_cast<VisToolCubicBezierPath *>(vis);
SCASSERT(visPath != nullptr) SCASSERT(visPath != nullptr)
visPath->setPath(path); visPath->SetPath(path);
ui->listWidget->blockSignals(false); ui->listWidget->blockSignals(false);
if (ui->listWidget->count() > 0) if (ui->listWidget->count() > 0)
@ -155,7 +153,7 @@ void DialogCubicBezierPath::ChosenObject(quint32 id, const SceneObject &type)
auto visPath = qobject_cast<VisToolCubicBezierPath *>(vis); auto visPath = qobject_cast<VisToolCubicBezierPath *>(vis);
SCASSERT(visPath != nullptr) SCASSERT(visPath != nullptr)
visPath->setPath(path); visPath->SetPath(path);
if (path.CountPoints() == 1) if (path.CountPoints() == 1)
{ {
@ -215,7 +213,7 @@ void DialogCubicBezierPath::SaveData()
auto visPath = qobject_cast<VisToolCubicBezierPath *>(vis); auto visPath = qobject_cast<VisToolCubicBezierPath *>(vis);
SCASSERT(visPath != nullptr) SCASSERT(visPath != nullptr)
visPath->setPath(path); visPath->SetPath(path);
visPath->SetMode(Mode::Show); visPath->SetMode(Mode::Show);
visPath->RefreshGeometry(); visPath->RefreshGeometry();
} }

View File

@ -136,7 +136,7 @@ QString DialogCurveIntersectAxis::GetTypeLine() const
void DialogCurveIntersectAxis::SetTypeLine(const QString &value) void DialogCurveIntersectAxis::SetTypeLine(const QString &value)
{ {
ChangeCurrentData(ui->comboBoxLineType, value); ChangeCurrentData(ui->comboBoxLineType, value);
vis->setLineStyle(LineStyleToPenStyle(value)); vis->SetLineStyle(LineStyleToPenStyle(value));
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
@ -194,7 +194,7 @@ void DialogCurveIntersectAxis::setCurveId(quint32 value)
VisToolCurveIntersectAxis *line = qobject_cast<VisToolCurveIntersectAxis *>(vis); VisToolCurveIntersectAxis *line = qobject_cast<VisToolCurveIntersectAxis *>(vis);
SCASSERT(line != nullptr) SCASSERT(line != nullptr)
line->setObject1Id(value); line->SetCurveId(value);
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
@ -342,10 +342,10 @@ void DialogCurveIntersectAxis::SaveData()
VisToolCurveIntersectAxis *line = qobject_cast<VisToolCurveIntersectAxis *>(vis); VisToolCurveIntersectAxis *line = qobject_cast<VisToolCurveIntersectAxis *>(vis);
SCASSERT(line != nullptr) SCASSERT(line != nullptr)
line->setObject1Id(getCurveId()); line->SetCurveId(getCurveId());
line->setAxisPointId(GetBasePointId()); line->setAxisPointId(GetBasePointId());
line->SetAngle(formulaAngle); line->SetAngle(formulaAngle);
line->setLineStyle(LineStyleToPenStyle(GetTypeLine())); line->SetLineStyle(LineStyleToPenStyle(GetTypeLine()));
line->RefreshGeometry(); line->RefreshGeometry();
} }

View File

@ -190,8 +190,8 @@ void DialogCutArc::SaveData()
auto *path = qobject_cast<VisToolCutArc *>(vis); auto *path = qobject_cast<VisToolCutArc *>(vis);
SCASSERT(path != nullptr) SCASSERT(path != nullptr)
path->setObject1Id(getArcId()); path->SetArcId(getArcId());
path->setLength(m_formula); path->SetLength(m_formula);
path->RefreshGeometry(); path->RefreshGeometry();
} }
@ -261,7 +261,7 @@ void DialogCutArc::setArcId(quint32 value)
auto *path = qobject_cast<VisToolCutArc *>(vis); auto *path = qobject_cast<VisToolCutArc *>(vis);
SCASSERT(path != nullptr) SCASSERT(path != nullptr)
path->setObject1Id(value); path->SetArcId(value);
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
@ -282,7 +282,7 @@ void DialogCutArc::SetFormula(const QString &value)
auto *path = qobject_cast<VisToolCutArc *>(vis); auto *path = qobject_cast<VisToolCutArc *>(vis);
SCASSERT(path != nullptr) SCASSERT(path != nullptr)
path->setLength(m_formula); path->SetLength(m_formula);
MoveCursorToEnd(ui->plainTextEditFormula); MoveCursorToEnd(ui->plainTextEditFormula);
} }

View File

@ -140,7 +140,7 @@ void DialogCutSpline::SetFormula(const QString &value)
auto *path = qobject_cast<VisToolCutSpline *>(vis); auto *path = qobject_cast<VisToolCutSpline *>(vis);
SCASSERT(path != nullptr) SCASSERT(path != nullptr)
path->setLength(m_formula); path->SetLength(m_formula);
MoveCursorToEnd(ui->plainTextEditFormula); MoveCursorToEnd(ui->plainTextEditFormula);
} }
@ -156,7 +156,7 @@ void DialogCutSpline::setSplineId(quint32 value)
auto *path = qobject_cast<VisToolCutSpline *>(vis); auto *path = qobject_cast<VisToolCutSpline *>(vis);
SCASSERT(path != nullptr) SCASSERT(path != nullptr)
path->setObject1Id(value); path->SetSplineId(value);
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
@ -198,8 +198,8 @@ void DialogCutSpline::SaveData()
auto *path = qobject_cast<VisToolCutSpline *>(vis); auto *path = qobject_cast<VisToolCutSpline *>(vis);
SCASSERT(path != nullptr) SCASSERT(path != nullptr)
path->setObject1Id(getSplineId()); path->SetSplineId(getSplineId());
path->setLength(m_formula); path->SetLength(m_formula);
path->RefreshGeometry(); path->RefreshGeometry();
} }

View File

@ -140,7 +140,7 @@ void DialogCutSplinePath::SetFormula(const QString &value)
auto *path = qobject_cast<VisToolCutSplinePath *>(vis); auto *path = qobject_cast<VisToolCutSplinePath *>(vis);
SCASSERT(path != nullptr) SCASSERT(path != nullptr)
path->setLength(m_formula); path->SetLength(m_formula);
MoveCursorToEnd(ui->plainTextEditFormula); MoveCursorToEnd(ui->plainTextEditFormula);
} }
@ -156,7 +156,7 @@ void DialogCutSplinePath::setSplinePathId(quint32 value)
auto *path = qobject_cast<VisToolCutSplinePath *>(vis); auto *path = qobject_cast<VisToolCutSplinePath *>(vis);
SCASSERT(path != nullptr) SCASSERT(path != nullptr)
path->setObject1Id(value); path->SetSplinePathId(value);
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
@ -198,8 +198,8 @@ void DialogCutSplinePath::SaveData()
auto *path = qobject_cast<VisToolCutSplinePath *>(vis); auto *path = qobject_cast<VisToolCutSplinePath *>(vis);
SCASSERT(path != nullptr) SCASSERT(path != nullptr)
path->setObject1Id(getSplinePathId()); path->SetSplinePathId(getSplinePathId());
path->setLength(m_formula); path->SetLength(m_formula);
path->RefreshGeometry(); path->RefreshGeometry();
} }

View File

@ -38,8 +38,6 @@
#include <QToolButton> #include <QToolButton>
#include <Qt> #include <Qt>
#include "../../tools/vabstracttool.h"
#include "../ifc/xml/vdomdocument.h"
#include "../vpatterndb/vtranslatevars.h" #include "../vpatterndb/vtranslatevars.h"
#include "../../visualization/path/vistoolellipticalarc.h" #include "../../visualization/path/vistoolellipticalarc.h"
#include "../../visualization/visualization.h" #include "../../visualization/visualization.h"
@ -49,6 +47,7 @@
#include "ui_dialogellipticalarc.h" #include "ui_dialogellipticalarc.h"
#include "../vgeometry/vellipticalarc.h" #include "../vgeometry/vellipticalarc.h"
#include "../qmuparser/qmudef.h" #include "../qmuparser/qmudef.h"
#include "../vpatterndb/vcontainer.h"
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
/** /**
@ -188,7 +187,10 @@ quint32 DialogEllipticalArc::GetCenter() const
void DialogEllipticalArc::SetCenter(const quint32 &value) void DialogEllipticalArc::SetCenter(const quint32 &value)
{ {
ChangeCurrentData(ui->comboBoxBasePoint, value); ChangeCurrentData(ui->comboBoxBasePoint, value);
vis->setObject1Id(value);
auto *path = qobject_cast<VisToolEllipticalArc *>(vis);
SCASSERT(path != nullptr)
path->SetCenterId(value);
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
@ -219,7 +221,7 @@ void DialogEllipticalArc::SetRadius1(const QString &value)
VisToolEllipticalArc *path = qobject_cast<VisToolEllipticalArc *>(vis); VisToolEllipticalArc *path = qobject_cast<VisToolEllipticalArc *>(vis);
SCASSERT(path != nullptr) SCASSERT(path != nullptr)
path->setRadius1(radius1); path->SetRadius1(radius1);
MoveCursorToEnd(ui->plainTextEditRadius1); MoveCursorToEnd(ui->plainTextEditRadius1);
} }
@ -252,7 +254,7 @@ void DialogEllipticalArc::SetRadius2(const QString &value)
VisToolEllipticalArc *path = qobject_cast<VisToolEllipticalArc *>(vis); VisToolEllipticalArc *path = qobject_cast<VisToolEllipticalArc *>(vis);
SCASSERT(path != nullptr) SCASSERT(path != nullptr)
path->setRadius2(radius2); path->SetRadius2(radius2);
MoveCursorToEnd(ui->plainTextEditRadius2); MoveCursorToEnd(ui->plainTextEditRadius2);
} }
@ -285,7 +287,7 @@ void DialogEllipticalArc::SetF1(const QString &value)
VisToolEllipticalArc *path = qobject_cast<VisToolEllipticalArc *>(vis); VisToolEllipticalArc *path = qobject_cast<VisToolEllipticalArc *>(vis);
SCASSERT(path != nullptr) SCASSERT(path != nullptr)
path->setF1(f1); path->SetF1(f1);
MoveCursorToEnd(ui->plainTextEditF1); MoveCursorToEnd(ui->plainTextEditF1);
} }
@ -318,7 +320,7 @@ void DialogEllipticalArc::SetF2(const QString &value)
VisToolEllipticalArc *path = qobject_cast<VisToolEllipticalArc *>(vis); VisToolEllipticalArc *path = qobject_cast<VisToolEllipticalArc *>(vis);
SCASSERT(path != nullptr) SCASSERT(path != nullptr)
path->setF2(f2); path->SetF2(f2);
MoveCursorToEnd(ui->plainTextEditF2); MoveCursorToEnd(ui->plainTextEditF2);
} }
@ -351,7 +353,7 @@ void DialogEllipticalArc::SetRotationAngle(const QString &value)
VisToolEllipticalArc *path = qobject_cast<VisToolEllipticalArc *>(vis); VisToolEllipticalArc *path = qobject_cast<VisToolEllipticalArc *>(vis);
SCASSERT(path != nullptr) SCASSERT(path != nullptr)
path->setRotationAngle(rotationAngle); path->SetRotationAngle(rotationAngle);
MoveCursorToEnd(ui->plainTextEditRotationAngle); MoveCursorToEnd(ui->plainTextEditRotationAngle);
} }
@ -584,12 +586,12 @@ void DialogEllipticalArc::SaveData()
VisToolEllipticalArc *path = qobject_cast<VisToolEllipticalArc *>(vis); VisToolEllipticalArc *path = qobject_cast<VisToolEllipticalArc *>(vis);
SCASSERT(path != nullptr) SCASSERT(path != nullptr)
path->setObject1Id(GetCenter()); path->SetCenterId(GetCenter());
path->setRadius1(radius1); path->SetRadius1(radius1);
path->setRadius2(radius2); path->SetRadius2(radius2);
path->setF1(f1); path->SetF1(f1);
path->setF2(f2); path->SetF2(f2);
path->setRotationAngle(rotationAngle); path->SetRotationAngle(rotationAngle);
path->RefreshGeometry(); path->RefreshGeometry();
} }

View File

@ -245,7 +245,7 @@ void DialogEndLine::SetPointName(const QString &value)
void DialogEndLine::SetTypeLine(const QString &value) void DialogEndLine::SetTypeLine(const QString &value)
{ {
ChangeCurrentData(ui->comboBoxLineType, value); ChangeCurrentData(ui->comboBoxLineType, value);
vis->setLineStyle(LineStyleToPenStyle(value)); vis->SetLineStyle(LineStyleToPenStyle(value));
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
@ -267,7 +267,7 @@ void DialogEndLine::SetFormula(const QString &value)
auto *line = qobject_cast<VisToolEndLine *>(vis); auto *line = qobject_cast<VisToolEndLine *>(vis);
SCASSERT(line != nullptr) SCASSERT(line != nullptr)
line->setLength(formulaLength); line->SetLength(formulaLength);
MoveCursorToEnd(ui->plainTextEditFormula); MoveCursorToEnd(ui->plainTextEditFormula);
} }
@ -307,7 +307,7 @@ void DialogEndLine::SetBasePointId(const quint32 &value)
auto *line = qobject_cast<VisToolEndLine *>(vis); auto *line = qobject_cast<VisToolEndLine *>(vis);
SCASSERT(line != nullptr) SCASSERT(line != nullptr)
line->setObject1Id(value); line->SetBasePointId(value);
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
@ -382,10 +382,10 @@ void DialogEndLine::SaveData()
VisToolEndLine *line = qobject_cast<VisToolEndLine *>(vis); VisToolEndLine *line = qobject_cast<VisToolEndLine *>(vis);
SCASSERT(line != nullptr) SCASSERT(line != nullptr)
line->setObject1Id(GetBasePointId()); line->SetBasePointId(GetBasePointId());
line->setLength(formulaLength); line->SetLength(formulaLength);
line->SetAngle(formulaAngle); line->SetAngle(formulaAngle);
line->setLineStyle(LineStyleToPenStyle(GetTypeLine())); line->SetLineStyle(LineStyleToPenStyle(GetTypeLine()));
line->RefreshGeometry(); line->RefreshGeometry();
} }

View File

@ -50,15 +50,10 @@
#include "../ifc/xml/vabstractpattern.h" #include "../ifc/xml/vabstractpattern.h"
#include "../ifc/xml/vdomdocument.h" #include "../ifc/xml/vdomdocument.h"
#include "../qmuparser/qmudef.h" #include "../qmuparser/qmudef.h"
#include "../vgeometry/vpointf.h"
#include "../vmisc/vabstractapplication.h"
#include "../vmisc/vcommonsettings.h"
#include "../vmisc/compatibility.h"
#if QT_VERSION < QT_VERSION_CHECK(5, 7, 0) #if QT_VERSION < QT_VERSION_CHECK(5, 7, 0)
#include "../vmisc/backport/qoverload.h" #include "../vmisc/backport/qoverload.h"
#endif // QT_VERSION < QT_VERSION_CHECK(5, 7, 0) #endif // QT_VERSION < QT_VERSION_CHECK(5, 7, 0)
#include "../vpatterndb/vcontainer.h" #include "../vpatterndb/vcontainer.h"
#include "../vwidgets/vabstractmainwindow.h"
#include "../vwidgets/vmaingraphicsscene.h" #include "../vwidgets/vmaingraphicsscene.h"
#include "../vwidgets/vmaingraphicsview.h" #include "../vwidgets/vmaingraphicsview.h"
#include "ui_dialogflippingbyaxis.h" #include "ui_dialogflippingbyaxis.h"

View File

@ -123,7 +123,7 @@ void DialogHeight::SetPointName(const QString &value)
void DialogHeight::SetTypeLine(const QString &value) void DialogHeight::SetTypeLine(const QString &value)
{ {
ChangeCurrentData(ui->comboBoxLineType, value); ChangeCurrentData(ui->comboBoxLineType, value);
vis->setLineStyle(LineStyleToPenStyle(value)); vis->SetLineStyle(LineStyleToPenStyle(value));
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
@ -137,7 +137,7 @@ void DialogHeight::SetBasePointId(const quint32 &value)
auto *line = qobject_cast<VisToolHeight *>(vis); auto *line = qobject_cast<VisToolHeight *>(vis);
SCASSERT(line != nullptr) SCASSERT(line != nullptr)
line->setObject1Id(value); line->SetBasePointId(value);
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
@ -151,7 +151,7 @@ void DialogHeight::SetP1LineId(const quint32 &value)
auto *line = qobject_cast<VisToolHeight *>(vis); auto *line = qobject_cast<VisToolHeight *>(vis);
SCASSERT(line != nullptr) SCASSERT(line != nullptr)
line->setLineP1Id(value); line->SetLineP1Id(value);
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
@ -165,7 +165,7 @@ void DialogHeight::SetP2LineId(const quint32 &value)
auto *line = qobject_cast<VisToolHeight *>(vis); auto *line = qobject_cast<VisToolHeight *>(vis);
SCASSERT(line != nullptr) SCASSERT(line != nullptr)
line->setLineP2Id(value); line->SetLineP2Id(value);
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
@ -213,7 +213,7 @@ void DialogHeight::ChosenObject(quint32 id, const SceneObject &type)
if (SetObject(id, ui->comboBoxP1Line, tr("Select second point of line"))) if (SetObject(id, ui->comboBoxP1Line, tr("Select second point of line")))
{ {
m_number++; m_number++;
line->setLineP1Id(id); line->SetLineP1Id(id);
line->RefreshGeometry(); line->RefreshGeometry();
} }
} }
@ -229,7 +229,7 @@ void DialogHeight::ChosenObject(quint32 id, const SceneObject &type)
{ {
if (SetObject(id, ui->comboBoxP2Line, QString())) if (SetObject(id, ui->comboBoxP2Line, QString()))
{ {
line->setLineP2Id(id); line->SetLineP2Id(id);
line->RefreshGeometry(); line->RefreshGeometry();
prepare = true; prepare = true;
DialogAccepted(); DialogAccepted();
@ -251,10 +251,10 @@ void DialogHeight::SaveData()
auto *line = qobject_cast<VisToolHeight *>(vis); auto *line = qobject_cast<VisToolHeight *>(vis);
SCASSERT(line != nullptr) SCASSERT(line != nullptr)
line->setObject1Id(GetBasePointId()); line->SetBasePointId(GetBasePointId());
line->setLineP1Id(GetP1LineId()); line->SetLineP1Id(GetP1LineId());
line->setLineP2Id(GetP2LineId()); line->SetLineP2Id(GetP2LineId());
line->setLineStyle(LineStyleToPenStyle(GetTypeLine())); line->SetLineStyle(LineStyleToPenStyle(GetTypeLine()));
line->RefreshGeometry(); line->RefreshGeometry();
} }

View File

@ -94,7 +94,7 @@ void DialogLine::SetSecondPoint(quint32 value)
VisToolLine *line = qobject_cast<VisToolLine *>(vis); VisToolLine *line = qobject_cast<VisToolLine *>(vis);
SCASSERT(line != nullptr) SCASSERT(line != nullptr)
line->setPoint2Id(value); line->SetPoint2Id(value);
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
@ -105,7 +105,7 @@ void DialogLine::SetSecondPoint(quint32 value)
void DialogLine::SetTypeLine(const QString &value) void DialogLine::SetTypeLine(const QString &value)
{ {
ChangeCurrentData(ui->comboBoxLineType, value); ChangeCurrentData(ui->comboBoxLineType, value);
vis->setLineStyle(LineStyleToPenStyle(value)); vis->SetLineStyle(LineStyleToPenStyle(value));
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
@ -131,7 +131,7 @@ void DialogLine::SetFirstPoint(quint32 value)
VisToolLine *line = qobject_cast<VisToolLine *>(vis); VisToolLine *line = qobject_cast<VisToolLine *>(vis);
SCASSERT(line != nullptr) SCASSERT(line != nullptr)
line->setObject1Id(value); line->SetPoint1Id(value);
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
@ -165,9 +165,9 @@ void DialogLine::SaveData()
VisToolLine *line = qobject_cast<VisToolLine *>(vis); VisToolLine *line = qobject_cast<VisToolLine *>(vis);
SCASSERT(line != nullptr) SCASSERT(line != nullptr)
line->setObject1Id(GetFirstPoint()); line->SetPoint1Id(GetFirstPoint());
line->setPoint2Id(GetSecondPoint()); line->SetPoint2Id(GetSecondPoint());
line->setLineStyle(LineStyleToPenStyle(GetTypeLine())); line->SetLineStyle(LineStyleToPenStyle(GetTypeLine()));
line->RefreshGeometry(); line->RefreshGeometry();
} }

View File

@ -137,7 +137,7 @@ void DialogLineIntersect::ChosenObject(quint32 id, const SceneObject &type)
if (SetObject(id, ui->comboBoxP2Line1, tr("Select first point of second line"))) if (SetObject(id, ui->comboBoxP2Line1, tr("Select first point of second line")))
{ {
number++; number++;
line->setLine1P2Id(id); line->SetLine1P2Id(id);
line->RefreshGeometry(); line->RefreshGeometry();
} }
} }
@ -146,7 +146,7 @@ void DialogLineIntersect::ChosenObject(quint32 id, const SceneObject &type)
if (SetObject(id, ui->comboBoxP1Line2, tr("Select second point of second line"))) if (SetObject(id, ui->comboBoxP1Line2, tr("Select second point of second line")))
{ {
number++; number++;
line->setLine2P1Id(id); line->SetLine2P1Id(id);
line->RefreshGeometry(); line->RefreshGeometry();
} }
break; break;
@ -162,7 +162,7 @@ void DialogLineIntersect::ChosenObject(quint32 id, const SceneObject &type)
{ {
if (SetObject(id, ui->comboBoxP2Line2, QString())) if (SetObject(id, ui->comboBoxP2Line2, QString()))
{ {
line->setLine2P2Id(id); line->SetLine2P2Id(id);
line->RefreshGeometry(); line->RefreshGeometry();
prepare = true; prepare = true;
flagPoint = CheckIntersecion(); flagPoint = CheckIntersecion();
@ -203,10 +203,10 @@ void DialogLineIntersect::SaveData()
VisToolLineIntersect *line = qobject_cast<VisToolLineIntersect *>(vis); VisToolLineIntersect *line = qobject_cast<VisToolLineIntersect *>(vis);
SCASSERT(line != nullptr) SCASSERT(line != nullptr)
line->setObject1Id(GetP1Line1()); line->SetLine1P1Id(GetP1Line1());
line->setLine1P2Id(GetP2Line1()); line->SetLine1P2Id(GetP2Line1());
line->setLine2P1Id(GetP1Line2()); line->SetLine2P1Id(GetP1Line2());
line->setLine2P2Id(GetP2Line2()); line->SetLine2P2Id(GetP2Line2());
line->RefreshGeometry(); line->RefreshGeometry();
} }
@ -308,7 +308,7 @@ void DialogLineIntersect::SetP2Line2(quint32 value)
VisToolLineIntersect *line = qobject_cast<VisToolLineIntersect *>(vis); VisToolLineIntersect *line = qobject_cast<VisToolLineIntersect *>(vis);
SCASSERT(line != nullptr) SCASSERT(line != nullptr)
line->setLine2P2Id(value); line->SetLine2P2Id(value);
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
@ -328,7 +328,7 @@ void DialogLineIntersect::SetP1Line2(quint32 value)
VisToolLineIntersect *line = qobject_cast<VisToolLineIntersect *>(vis); VisToolLineIntersect *line = qobject_cast<VisToolLineIntersect *>(vis);
SCASSERT(line != nullptr) SCASSERT(line != nullptr)
line->setLine2P1Id(value); line->SetLine2P1Id(value);
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
@ -342,7 +342,7 @@ void DialogLineIntersect::SetP2Line1(quint32 value)
VisToolLineIntersect *line = qobject_cast<VisToolLineIntersect *>(vis); VisToolLineIntersect *line = qobject_cast<VisToolLineIntersect *>(vis);
SCASSERT(line != nullptr) SCASSERT(line != nullptr)
line->setLine1P2Id(value); line->SetLine1P2Id(value);
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
@ -356,7 +356,7 @@ void DialogLineIntersect::SetP1Line1(quint32 value)
VisToolLineIntersect *line = qobject_cast<VisToolLineIntersect *>(vis); VisToolLineIntersect *line = qobject_cast<VisToolLineIntersect *>(vis);
SCASSERT(line != nullptr) SCASSERT(line != nullptr)
line->setObject1Id(value); line->SetLine1P1Id(value);
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------

View File

@ -144,7 +144,7 @@ QString DialogLineIntersectAxis::GetTypeLine() const
void DialogLineIntersectAxis::SetTypeLine(const QString &value) void DialogLineIntersectAxis::SetTypeLine(const QString &value)
{ {
ChangeCurrentData(ui->comboBoxLineType, value); ChangeCurrentData(ui->comboBoxLineType, value);
vis->setLineStyle(LineStyleToPenStyle(value)); vis->SetLineStyle(LineStyleToPenStyle(value));
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
@ -186,7 +186,7 @@ void DialogLineIntersectAxis::SetBasePointId(quint32 value)
VisToolLineIntersectAxis *line = qobject_cast<VisToolLineIntersectAxis *>(vis); VisToolLineIntersectAxis *line = qobject_cast<VisToolLineIntersectAxis *>(vis);
SCASSERT(line != nullptr) SCASSERT(line != nullptr)
line->setAxisPointId(value); line->SetAxisPointId(value);
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
@ -202,7 +202,7 @@ void DialogLineIntersectAxis::SetFirstPointId(quint32 value)
VisToolLineIntersectAxis *line = qobject_cast<VisToolLineIntersectAxis *>(vis); VisToolLineIntersectAxis *line = qobject_cast<VisToolLineIntersectAxis *>(vis);
SCASSERT(line != nullptr) SCASSERT(line != nullptr)
line->setObject1Id(value); line->SetPoint1Id(value);
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
@ -218,7 +218,7 @@ void DialogLineIntersectAxis::SetSecondPointId(quint32 value)
VisToolLineIntersectAxis *line = qobject_cast<VisToolLineIntersectAxis *>(vis); VisToolLineIntersectAxis *line = qobject_cast<VisToolLineIntersectAxis *>(vis);
SCASSERT(line != nullptr) SCASSERT(line != nullptr)
line->setPoint2Id(value); line->SetPoint2Id(value);
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
@ -301,7 +301,7 @@ void DialogLineIntersectAxis::ChosenObject(quint32 id, const SceneObject &type)
if (SetObject(id, ui->comboBoxSecondLinePoint, tr("Select axis point"))) if (SetObject(id, ui->comboBoxSecondLinePoint, tr("Select axis point")))
{ {
number++; number++;
line->setPoint2Id(id); line->SetPoint2Id(id);
line->RefreshGeometry(); line->RefreshGeometry();
} }
} }
@ -317,7 +317,7 @@ void DialogLineIntersectAxis::ChosenObject(quint32 id, const SceneObject &type)
{ {
if (SetObject(id, ui->comboBoxAxisPoint, QString())) if (SetObject(id, ui->comboBoxAxisPoint, QString()))
{ {
line->setAxisPointId(id); line->SetAxisPointId(id);
line->RefreshGeometry(); line->RefreshGeometry();
prepare = true; prepare = true;
} }
@ -405,11 +405,11 @@ void DialogLineIntersectAxis::SaveData()
VisToolLineIntersectAxis *line = qobject_cast<VisToolLineIntersectAxis *>(vis); VisToolLineIntersectAxis *line = qobject_cast<VisToolLineIntersectAxis *>(vis);
SCASSERT(line != nullptr) SCASSERT(line != nullptr)
line->setObject1Id(GetFirstPointId()); line->SetPoint1Id(GetFirstPointId());
line->setPoint2Id(GetSecondPointId()); line->SetPoint2Id(GetSecondPointId());
line->setAxisPointId(GetBasePointId()); line->SetAxisPointId(GetBasePointId());
line->SetAngle(formulaAngle); line->SetAngle(formulaAngle);
line->setLineStyle(LineStyleToPenStyle(GetTypeLine())); line->SetLineStyle(LineStyleToPenStyle(GetTypeLine()));
line->RefreshGeometry(); line->RefreshGeometry();
} }

View File

@ -217,7 +217,7 @@ void DialogNormal::ChosenObject(quint32 id, const SceneObject &type)
{ {
if (SetObject(id, ui->comboBoxSecondPoint, QString())) if (SetObject(id, ui->comboBoxSecondPoint, QString()))
{ {
line->setObject2Id(id); line->SetPoint2Id(id);
line->RefreshGeometry(); line->RefreshGeometry();
prepare = true; prepare = true;
@ -244,11 +244,11 @@ void DialogNormal::SaveData()
auto *line = qobject_cast<VisToolNormal *>(vis); auto *line = qobject_cast<VisToolNormal *>(vis);
SCASSERT(line != nullptr) SCASSERT(line != nullptr)
line->setObject1Id(GetFirstPointId()); line->SetPoint1Id(GetFirstPointId());
line->setObject2Id(GetSecondPointId()); line->SetPoint2Id(GetSecondPointId());
line->setLength(m_formula); line->SetLength(m_formula);
line->SetAngle(m_angle); line->SetAngle(m_angle);
line->setLineStyle(LineStyleToPenStyle(GetTypeLine())); line->SetLineStyle(LineStyleToPenStyle(GetTypeLine()));
line->RefreshGeometry(); line->RefreshGeometry();
} }
@ -270,7 +270,7 @@ void DialogNormal::SetSecondPointId(quint32 value)
auto *line = qobject_cast<VisToolNormal *>(vis); auto *line = qobject_cast<VisToolNormal *>(vis);
SCASSERT(line != nullptr) SCASSERT(line != nullptr)
line->setObject2Id(value); line->SetPoint2Id(value);
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
@ -296,7 +296,7 @@ void DialogNormal::SetFirstPointId(quint32 value)
auto *line = qobject_cast<VisToolNormal *>(vis); auto *line = qobject_cast<VisToolNormal *>(vis);
SCASSERT(line != nullptr) SCASSERT(line != nullptr)
line->setObject1Id(value); line->SetPoint1Id(value);
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
@ -332,7 +332,7 @@ void DialogNormal::SetFormula(const QString &value)
auto *line = qobject_cast<VisToolNormal *>(vis); auto *line = qobject_cast<VisToolNormal *>(vis);
SCASSERT(line != nullptr) SCASSERT(line != nullptr)
line->setLength(m_formula); line->SetLength(m_formula);
MoveCursorToEnd(ui->plainTextEditFormula); MoveCursorToEnd(ui->plainTextEditFormula);
} }
@ -345,7 +345,7 @@ void DialogNormal::SetFormula(const QString &value)
void DialogNormal::SetTypeLine(const QString &value) void DialogNormal::SetTypeLine(const QString &value)
{ {
ChangeCurrentData(ui->comboBoxLineType, value); ChangeCurrentData(ui->comboBoxLineType, value);
vis->setLineStyle(LineStyleToPenStyle(value)); vis->SetLineStyle(LineStyleToPenStyle(value));
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------

View File

@ -34,7 +34,6 @@
#include "../../visualization/visualization.h" #include "../../visualization/visualization.h"
#include "../../visualization/line/vistoolpointfromarcandtangent.h" #include "../../visualization/line/vistoolpointfromarcandtangent.h"
#include "../vmisc/vabstractapplication.h"
#include "dialogs/tools/dialogtool.h" #include "dialogs/tools/dialogtool.h"
#include "ui_dialogpointfromarcandtangent.h" #include "ui_dialogpointfromarcandtangent.h"
@ -102,7 +101,7 @@ void DialogPointFromArcAndTangent::SetArcId(quint32 value)
VisToolPointFromArcAndTangent *point = qobject_cast<VisToolPointFromArcAndTangent *>(vis); VisToolPointFromArcAndTangent *point = qobject_cast<VisToolPointFromArcAndTangent *>(vis);
SCASSERT(point != nullptr) SCASSERT(point != nullptr)
point->setArcId(value); point->SetArcId(value);
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
@ -116,9 +115,9 @@ void DialogPointFromArcAndTangent::SetTangentPointId(quint32 value)
{ {
setCurrentPointId(ui->comboBoxTangentPoint, value); setCurrentPointId(ui->comboBoxTangentPoint, value);
VisToolPointFromArcAndTangent *point = qobject_cast<VisToolPointFromArcAndTangent *>(vis); auto *point = qobject_cast<VisToolPointFromArcAndTangent *>(vis);
SCASSERT(point != nullptr) SCASSERT(point != nullptr)
point->setObject1Id(value); point->SetPointId(value);
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
@ -137,7 +136,7 @@ void DialogPointFromArcAndTangent::SetCrossCirclesPoint(CrossCirclesPoint p)
VisToolPointFromArcAndTangent *point = qobject_cast<VisToolPointFromArcAndTangent *>(vis); VisToolPointFromArcAndTangent *point = qobject_cast<VisToolPointFromArcAndTangent *>(vis);
SCASSERT(point != nullptr) SCASSERT(point != nullptr)
point->setCrossPoint(p); point->SetCrossPoint(p);
} }
} }
@ -169,7 +168,7 @@ void DialogPointFromArcAndTangent::ChosenObject(quint32 id, const SceneObject &t
if (SetObject(id, ui->comboBoxArc, QString())) if (SetObject(id, ui->comboBoxArc, QString()))
{ {
number = 0; number = 0;
point->setArcId(id); point->SetArcId(id);
point->RefreshGeometry(); point->RefreshGeometry();
prepare = true; prepare = true;
DialogAccepted(); DialogAccepted();
@ -194,12 +193,12 @@ void DialogPointFromArcAndTangent::SaveData()
{ {
pointName = ui->lineEditNamePoint->text(); pointName = ui->lineEditNamePoint->text();
VisToolPointFromArcAndTangent *point = qobject_cast<VisToolPointFromArcAndTangent *>(vis); auto *point = qobject_cast<VisToolPointFromArcAndTangent *>(vis);
SCASSERT(point != nullptr) SCASSERT(point != nullptr)
point->setObject1Id(GetTangentPointId()); point->SetPointId(GetTangentPointId());
point->setArcId(GetArcId()); point->SetArcId(GetArcId());
point->setCrossPoint(GetCrossCirclesPoint()); point->SetCrossPoint(GetCrossCirclesPoint());
point->RefreshGeometry(); point->RefreshGeometry();
} }

View File

@ -45,7 +45,6 @@
#include "../vpatterndb/vcontainer.h" #include "../vpatterndb/vcontainer.h"
#include "../../visualization/visualization.h" #include "../../visualization/visualization.h"
#include "../../visualization/line/vistoolpointfromcircleandtangent.h" #include "../../visualization/line/vistoolpointfromcircleandtangent.h"
#include "../ifc/xml/vdomdocument.h"
#include "../support/dialogeditwrongformula.h" #include "../support/dialogeditwrongformula.h"
#include "../vmisc/vabstractapplication.h" #include "../vmisc/vabstractapplication.h"
#include "../vmisc/vcommonsettings.h" #include "../vmisc/vcommonsettings.h"
@ -141,7 +140,7 @@ void DialogPointFromCircleAndTangent::SetCircleCenterId(const quint32 &value)
VisToolPointFromCircleAndTangent *point = qobject_cast<VisToolPointFromCircleAndTangent *>(vis); VisToolPointFromCircleAndTangent *point = qobject_cast<VisToolPointFromCircleAndTangent *>(vis);
SCASSERT(point != nullptr) SCASSERT(point != nullptr)
point->setObject2Id(value); point->SetCenterId(value);
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
@ -165,7 +164,7 @@ void DialogPointFromCircleAndTangent::SetCircleRadius(const QString &value)
VisToolPointFromCircleAndTangent *point = qobject_cast<VisToolPointFromCircleAndTangent *>(vis); VisToolPointFromCircleAndTangent *point = qobject_cast<VisToolPointFromCircleAndTangent *>(vis);
SCASSERT(point != nullptr) SCASSERT(point != nullptr)
point->setCRadius(formula); point->SetCRadius(formula);
MoveCursorToEnd(ui->plainTextEditRadius); MoveCursorToEnd(ui->plainTextEditRadius);
} }
@ -183,7 +182,7 @@ void DialogPointFromCircleAndTangent::SetTangentPointId(const quint32 &value)
VisToolPointFromCircleAndTangent *point = qobject_cast<VisToolPointFromCircleAndTangent *>(vis); VisToolPointFromCircleAndTangent *point = qobject_cast<VisToolPointFromCircleAndTangent *>(vis);
SCASSERT(point != nullptr) SCASSERT(point != nullptr)
point->setObject1Id(value); point->SetPointId(value);
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
@ -202,7 +201,7 @@ void DialogPointFromCircleAndTangent::SetCrossCirclesPoint(const CrossCirclesPoi
VisToolPointFromCircleAndTangent *point = qobject_cast<VisToolPointFromCircleAndTangent *>(vis); VisToolPointFromCircleAndTangent *point = qobject_cast<VisToolPointFromCircleAndTangent *>(vis);
SCASSERT(point != nullptr) SCASSERT(point != nullptr)
point->setCrossPoint(p); point->SetCrossPoint(p);
} }
} }
@ -231,7 +230,7 @@ void DialogPointFromCircleAndTangent::ChosenObject(quint32 id, const SceneObject
if (SetObject(id, ui->comboBoxCircleCenter, QString())) if (SetObject(id, ui->comboBoxCircleCenter, QString()))
{ {
number = 0; number = 0;
point->setObject2Id(id); point->SetCenterId(id);
point->RefreshGeometry(); point->RefreshGeometry();
prepare = true; prepare = true;
this->setModal(true); this->setModal(true);
@ -322,10 +321,10 @@ void DialogPointFromCircleAndTangent::SaveData()
VisToolPointFromCircleAndTangent *point = qobject_cast<VisToolPointFromCircleAndTangent *>(vis); VisToolPointFromCircleAndTangent *point = qobject_cast<VisToolPointFromCircleAndTangent *>(vis);
SCASSERT(point != nullptr) SCASSERT(point != nullptr)
point->setObject1Id(GetTangentPointId()); point->SetPointId(GetTangentPointId());
point->setObject2Id(GetCircleCenterId()); point->SetCenterId(GetCircleCenterId());
point->setCRadius(ui->plainTextEditRadius->toPlainText()); point->SetCRadius(ui->plainTextEditRadius->toPlainText());
point->setCrossPoint(GetCrossCirclesPoint()); point->SetCrossPoint(GetCrossCirclesPoint());
point->RefreshGeometry(); point->RefreshGeometry();
} }

View File

@ -216,7 +216,7 @@ void DialogPointOfContact::ChosenObject(quint32 id, const SceneObject &type)
if (SetObject(id, ui->comboBoxSecondPoint, tr("Select point of center of arc"))) if (SetObject(id, ui->comboBoxSecondPoint, tr("Select point of center of arc")))
{ {
number++; number++;
line->setLineP2Id(id); line->SetLineP2Id(id);
line->RefreshGeometry(); line->RefreshGeometry();
} }
} }
@ -232,7 +232,7 @@ void DialogPointOfContact::ChosenObject(quint32 id, const SceneObject &type)
{ {
if (SetObject(id, ui->comboBoxCenter, QString())) if (SetObject(id, ui->comboBoxCenter, QString()))
{ {
line->setRadiusId(id); line->SetRadiusId(id);
line->RefreshGeometry(); line->RefreshGeometry();
prepare = true; prepare = true;
this->setModal(true); this->setModal(true);
@ -257,10 +257,10 @@ void DialogPointOfContact::SaveData()
VisToolPointOfContact *line = qobject_cast<VisToolPointOfContact *>(vis); VisToolPointOfContact *line = qobject_cast<VisToolPointOfContact *>(vis);
SCASSERT(line != nullptr) SCASSERT(line != nullptr)
line->setObject1Id(GetFirstPoint()); line->SetLineP1Id(GetFirstPoint());
line->setLineP2Id(GetSecondPoint()); line->SetLineP2Id(GetSecondPoint());
line->setRadiusId(getCenter()); line->SetRadiusId(getCenter());
line->setRadius(radius); line->SetRadius(radius);
line->RefreshGeometry(); line->RefreshGeometry();
} }
@ -282,7 +282,7 @@ void DialogPointOfContact::SetSecondPoint(quint32 value)
VisToolPointOfContact *line = qobject_cast<VisToolPointOfContact *>(vis); VisToolPointOfContact *line = qobject_cast<VisToolPointOfContact *>(vis);
SCASSERT(line != nullptr) SCASSERT(line != nullptr)
line->setLineP2Id(value); line->SetLineP2Id(value);
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
@ -296,7 +296,7 @@ void DialogPointOfContact::SetFirstPoint(quint32 value)
VisToolPointOfContact *line = qobject_cast<VisToolPointOfContact *>(vis); VisToolPointOfContact *line = qobject_cast<VisToolPointOfContact *>(vis);
SCASSERT(line != nullptr) SCASSERT(line != nullptr)
line->setObject1Id(value); line->SetLineP1Id(value);
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
@ -310,7 +310,7 @@ void DialogPointOfContact::setCenter(quint32 value)
VisToolPointOfContact *line = qobject_cast<VisToolPointOfContact *>(vis); VisToolPointOfContact *line = qobject_cast<VisToolPointOfContact *>(vis);
SCASSERT(line != nullptr) SCASSERT(line != nullptr)
line->setRadiusId(value); line->SetRadiusId(value);
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
@ -331,7 +331,7 @@ void DialogPointOfContact::setRadius(const QString &value)
VisToolPointOfContact *line = qobject_cast<VisToolPointOfContact *>(vis); VisToolPointOfContact *line = qobject_cast<VisToolPointOfContact *>(vis);
SCASSERT(line != nullptr) SCASSERT(line != nullptr)
line->setRadius(radius); line->SetRadius(radius);
MoveCursorToEnd(ui->plainTextEditFormula); MoveCursorToEnd(ui->plainTextEditFormula);
} }

View File

@ -37,8 +37,6 @@
#include "../../visualization/visualization.h" #include "../../visualization/visualization.h"
#include "../../visualization/line/vistoolpointofintersection.h" #include "../../visualization/line/vistoolpointofintersection.h"
#include "../ifc/xml/vabstractpattern.h" #include "../ifc/xml/vabstractpattern.h"
#include "../ifc/ifcdef.h"
#include "../vmisc/vabstractapplication.h"
#include "dialogtool.h" #include "dialogtool.h"
#include "ui_dialogpointofintersection.h" #include "ui_dialogpointofintersection.h"
@ -107,7 +105,7 @@ void DialogPointOfIntersection::SetSecondPointId(quint32 value)
VisToolPointOfIntersection *line = qobject_cast<VisToolPointOfIntersection *>(vis); VisToolPointOfIntersection *line = qobject_cast<VisToolPointOfIntersection *>(vis);
SCASSERT(line != nullptr) SCASSERT(line != nullptr)
line->setPoint2Id(value); line->SetPoint2Id(value);
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
@ -131,7 +129,7 @@ void DialogPointOfIntersection::ChosenObject(quint32 id, const SceneObject &type
if (SetObject(id, ui->comboBoxFirstPoint, tr("Select point for Y value (horizontal)"))) if (SetObject(id, ui->comboBoxFirstPoint, tr("Select point for Y value (horizontal)")))
{ {
number++; number++;
line->setObject1Id(id); line->SetPoint1Id(id);
line->RefreshGeometry(); line->RefreshGeometry();
} }
break; break;
@ -140,7 +138,7 @@ void DialogPointOfIntersection::ChosenObject(quint32 id, const SceneObject &type
{ {
if (SetObject(id, ui->comboBoxSecondPoint, QString())) if (SetObject(id, ui->comboBoxSecondPoint, QString()))
{ {
line->setPoint2Id(id); line->SetPoint2Id(id);
line->RefreshGeometry(); line->RefreshGeometry();
prepare = true; prepare = true;
DialogAccepted(); DialogAccepted();
@ -162,8 +160,8 @@ void DialogPointOfIntersection::SaveData()
VisToolPointOfIntersection *line = qobject_cast<VisToolPointOfIntersection *>(vis); VisToolPointOfIntersection *line = qobject_cast<VisToolPointOfIntersection *>(vis);
SCASSERT(line != nullptr) SCASSERT(line != nullptr)
line->setObject1Id(GetFirstPointId()); line->SetPoint1Id(GetFirstPointId());
line->setPoint2Id(GetSecondPointId()); line->SetPoint2Id(GetSecondPointId());
line->RefreshGeometry(); line->RefreshGeometry();
} }
@ -203,7 +201,7 @@ void DialogPointOfIntersection::SetFirstPointId(quint32 value)
VisToolPointOfIntersection *line = qobject_cast<VisToolPointOfIntersection *>(vis); VisToolPointOfIntersection *line = qobject_cast<VisToolPointOfIntersection *>(vis);
SCASSERT(line != nullptr) SCASSERT(line != nullptr)
line->setObject1Id(value); line->SetPoint1Id(value);
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------

View File

@ -109,7 +109,7 @@ void DialogPointOfIntersectionArcs::SetFirstArcId(quint32 value)
VisToolPointOfIntersectionArcs *point = qobject_cast<VisToolPointOfIntersectionArcs *>(vis); VisToolPointOfIntersectionArcs *point = qobject_cast<VisToolPointOfIntersectionArcs *>(vis);
SCASSERT(point != nullptr) SCASSERT(point != nullptr)
point->setArc1Id(value); point->SetArc1Id(value);
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
@ -125,7 +125,7 @@ void DialogPointOfIntersectionArcs::SetSecondArcId(quint32 value)
VisToolPointOfIntersectionArcs *point = qobject_cast<VisToolPointOfIntersectionArcs *>(vis); VisToolPointOfIntersectionArcs *point = qobject_cast<VisToolPointOfIntersectionArcs *>(vis);
SCASSERT(point != nullptr) SCASSERT(point != nullptr)
point->setArc2Id(value); point->SetArc2Id(value);
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
@ -144,7 +144,7 @@ void DialogPointOfIntersectionArcs::SetCrossArcPoint(CrossCirclesPoint p)
VisToolPointOfIntersectionArcs *point = qobject_cast<VisToolPointOfIntersectionArcs *>(vis); VisToolPointOfIntersectionArcs *point = qobject_cast<VisToolPointOfIntersectionArcs *>(vis);
SCASSERT(point != nullptr) SCASSERT(point != nullptr)
point->setCrossPoint(p); point->SetCrossPoint(p);
} }
} }
@ -173,7 +173,7 @@ void DialogPointOfIntersectionArcs::ChosenObject(quint32 id, const SceneObject &
if (SetObject(id, ui->comboBoxArc2, QString())) if (SetObject(id, ui->comboBoxArc2, QString()))
{ {
number = 0; number = 0;
point->setArc2Id(id); point->SetArc2Id(id);
point->RefreshGeometry(); point->RefreshGeometry();
prepare = true; prepare = true;
DialogAccepted(); DialogAccepted();
@ -220,9 +220,9 @@ void DialogPointOfIntersectionArcs::SaveData()
VisToolPointOfIntersectionArcs *point = qobject_cast<VisToolPointOfIntersectionArcs *>(vis); VisToolPointOfIntersectionArcs *point = qobject_cast<VisToolPointOfIntersectionArcs *>(vis);
SCASSERT(point != nullptr) SCASSERT(point != nullptr)
point->setArc1Id(GetFirstArcId()); point->SetArc1Id(GetFirstArcId());
point->setArc2Id(GetSecondArcId()); point->SetArc2Id(GetSecondArcId());
point->setCrossPoint(GetCrossArcPoint()); point->SetCrossPoint(GetCrossArcPoint());
point->RefreshGeometry(); point->RefreshGeometry();
} }

View File

@ -153,7 +153,7 @@ void DialogPointOfIntersectionCircles::SetFirstCircleCenterId(const quint32 &val
auto *point = qobject_cast<VisToolPointOfIntersectionCircles *>(vis); auto *point = qobject_cast<VisToolPointOfIntersectionCircles *>(vis);
SCASSERT(point != nullptr) SCASSERT(point != nullptr)
point->setObject1Id(value); point->SetCircle1Id(value);
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
@ -169,7 +169,7 @@ void DialogPointOfIntersectionCircles::SetSecondCircleCenterId(const quint32 &va
auto *point = qobject_cast<VisToolPointOfIntersectionCircles *>(vis); auto *point = qobject_cast<VisToolPointOfIntersectionCircles *>(vis);
SCASSERT(point != nullptr) SCASSERT(point != nullptr)
point->setObject2Id(value); point->SetCircle2Id(value);
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
@ -193,7 +193,7 @@ void DialogPointOfIntersectionCircles::SetFirstCircleRadius(const QString &value
auto *point = qobject_cast<VisToolPointOfIntersectionCircles *>(vis); auto *point = qobject_cast<VisToolPointOfIntersectionCircles *>(vis);
SCASSERT(point != nullptr) SCASSERT(point != nullptr)
point->setC1Radius(formula); point->SetC1Radius(formula);
MoveCursorToEnd(ui->plainTextEditCircle1Radius); MoveCursorToEnd(ui->plainTextEditCircle1Radius);
} }
@ -219,7 +219,7 @@ void DialogPointOfIntersectionCircles::SetSecondCircleRadius(const QString &valu
auto *point = qobject_cast<VisToolPointOfIntersectionCircles *>(vis); auto *point = qobject_cast<VisToolPointOfIntersectionCircles *>(vis);
SCASSERT(point != nullptr) SCASSERT(point != nullptr)
point->setC2Radius(formula); point->SetC2Radius(formula);
MoveCursorToEnd(ui->plainTextEditCircle2Radius); MoveCursorToEnd(ui->plainTextEditCircle2Radius);
} }
@ -240,7 +240,7 @@ void DialogPointOfIntersectionCircles::SetCrossCirclesPoint(const CrossCirclesPo
auto *point = qobject_cast<VisToolPointOfIntersectionCircles *>(vis); auto *point = qobject_cast<VisToolPointOfIntersectionCircles *>(vis);
SCASSERT(point != nullptr) SCASSERT(point != nullptr)
point->setCrossPoint(p); point->SetCrossPoint(p);
} }
} }
@ -337,7 +337,7 @@ void DialogPointOfIntersectionCircles::ChosenObject(quint32 id, const SceneObjec
{ {
if (SetObject(id, ui->comboBoxCircle2Center, QString())) if (SetObject(id, ui->comboBoxCircle2Center, QString()))
{ {
point->setObject2Id(id); point->SetCircle2Id(id);
point->RefreshGeometry(); point->RefreshGeometry();
++m_stage; ++m_stage;
prepare = true; prepare = true;
@ -469,11 +469,11 @@ void DialogPointOfIntersectionCircles::SaveData()
auto *point = qobject_cast<VisToolPointOfIntersectionCircles *>(vis); auto *point = qobject_cast<VisToolPointOfIntersectionCircles *>(vis);
SCASSERT(point != nullptr) SCASSERT(point != nullptr)
point->setObject1Id(GetFirstCircleCenterId()); point->SetCircle1Id(GetFirstCircleCenterId());
point->setObject2Id(GetSecondCircleCenterId()); point->SetCircle2Id(GetSecondCircleCenterId());
point->setC1Radius(ui->plainTextEditCircle1Radius->toPlainText()); point->SetC1Radius(ui->plainTextEditCircle1Radius->toPlainText());
point->setC2Radius(ui->plainTextEditCircle2Radius->toPlainText()); point->SetC2Radius(ui->plainTextEditCircle2Radius->toPlainText());
point->setCrossPoint(GetCrossCirclesPoint()); point->SetCrossPoint(GetCrossCirclesPoint());
point->RefreshGeometry(); point->RefreshGeometry();
} }

View File

@ -117,7 +117,7 @@ void DialogPointOfIntersectionCurves::SetFirstCurveId(quint32 value)
auto point = qobject_cast<VisToolPointOfIntersectionCurves *>(vis); auto point = qobject_cast<VisToolPointOfIntersectionCurves *>(vis);
SCASSERT(point != nullptr) SCASSERT(point != nullptr)
point->setObject1Id(value); point->SetCurve1Id(value);
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
@ -133,7 +133,7 @@ void DialogPointOfIntersectionCurves::SetSecondCurveId(quint32 value)
auto point = qobject_cast<VisToolPointOfIntersectionCurves *>(vis); auto point = qobject_cast<VisToolPointOfIntersectionCurves *>(vis);
SCASSERT(point != nullptr) SCASSERT(point != nullptr)
point->setObject2Id(value); point->SetCurve2Id(value);
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
@ -152,7 +152,7 @@ void DialogPointOfIntersectionCurves::SetVCrossPoint(VCrossCurvesPoint vP)
auto point = qobject_cast<VisToolPointOfIntersectionCurves *>(vis); auto point = qobject_cast<VisToolPointOfIntersectionCurves *>(vis);
SCASSERT(point != nullptr) SCASSERT(point != nullptr)
point->setVCrossPoint(vP); point->SetVCrossPoint(vP);
} }
} }
@ -172,7 +172,7 @@ void DialogPointOfIntersectionCurves::SetHCrossPoint(HCrossCurvesPoint hP)
auto point = qobject_cast<VisToolPointOfIntersectionCurves *>(vis); auto point = qobject_cast<VisToolPointOfIntersectionCurves *>(vis);
SCASSERT(point != nullptr) SCASSERT(point != nullptr)
point->setHCrossPoint(hP); point->SetHCrossPoint(hP);
} }
} }
@ -204,7 +204,7 @@ void DialogPointOfIntersectionCurves::ChosenObject(quint32 id, const SceneObject
if (SetObject(id, ui->comboBoxCurve2, QString())) if (SetObject(id, ui->comboBoxCurve2, QString()))
{ {
number = 0; number = 0;
point->setObject2Id(id); point->SetCurve2Id(id);
point->RefreshGeometry(); point->RefreshGeometry();
prepare = true; prepare = true;
DialogAccepted(); DialogAccepted();
@ -232,10 +232,10 @@ void DialogPointOfIntersectionCurves::SaveData()
auto point = qobject_cast<VisToolPointOfIntersectionCurves *>(vis); auto point = qobject_cast<VisToolPointOfIntersectionCurves *>(vis);
SCASSERT(point != nullptr) SCASSERT(point != nullptr)
point->setObject1Id(GetFirstCurveId()); point->SetCurve1Id(GetFirstCurveId());
point->setObject2Id(GetSecondCurveId()); point->SetCurve2Id(GetSecondCurveId());
point->setVCrossPoint(GetVCrossPoint()); point->SetVCrossPoint(GetVCrossPoint());
point->setHCrossPoint(GetHCrossPoint()); point->SetHCrossPoint(GetHCrossPoint());
point->RefreshGeometry(); point->RefreshGeometry();
} }

View File

@ -216,7 +216,7 @@ void DialogShoulderPoint::ChosenObject(quint32 id, const SceneObject &type)
if (SetObject(id, ui->comboBoxP1Line, tr("Select second point of line"))) if (SetObject(id, ui->comboBoxP1Line, tr("Select second point of line")))
{ {
m_number++; m_number++;
line->setLineP1Id(id); line->SetLineP1Id(id);
line->RefreshGeometry(); line->RefreshGeometry();
} }
} }
@ -239,11 +239,11 @@ void DialogShoulderPoint::SaveData()
auto *line = qobject_cast<VisToolShoulderPoint *>(vis); auto *line = qobject_cast<VisToolShoulderPoint *>(vis);
SCASSERT(line != nullptr) SCASSERT(line != nullptr)
line->setObject1Id(GetP3()); line->SetPoint3Id(GetP3());
line->setLineP1Id(GetP1Line()); line->SetLineP1Id(GetP1Line());
line->setLineP2Id(GetP2Line()); line->SetLineP2Id(GetP2Line());
line->setLength(m_formula); line->SetLength(m_formula);
line->setLineStyle(LineStyleToPenStyle(GetTypeLine())); line->SetLineStyle(LineStyleToPenStyle(GetTypeLine()));
line->RefreshGeometry(); line->RefreshGeometry();
} }
@ -274,7 +274,7 @@ void DialogShoulderPoint::ChosenThirdPoint(quint32 id)
SCASSERT(line != nullptr) SCASSERT(line != nullptr)
connect(line, &Visualization::ToolTip, window, &VAbstractMainWindow::ShowToolTip); connect(line, &Visualization::ToolTip, window, &VAbstractMainWindow::ShowToolTip);
line->setLineP2Id(id); line->SetLineP2Id(id);
line->RefreshGeometry(); line->RefreshGeometry();
prepare = true; prepare = true;
} }
@ -292,7 +292,7 @@ void DialogShoulderPoint::SetP3(const quint32 &value)
auto *line = qobject_cast<VisToolShoulderPoint *>(vis); auto *line = qobject_cast<VisToolShoulderPoint *>(vis);
SCASSERT(line != nullptr) SCASSERT(line != nullptr)
line->setObject1Id(value); line->SetPoint3Id(value);
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
@ -318,7 +318,7 @@ void DialogShoulderPoint::SetP2Line(const quint32 &value)
auto *line = qobject_cast<VisToolShoulderPoint *>(vis); auto *line = qobject_cast<VisToolShoulderPoint *>(vis);
SCASSERT(line != nullptr) SCASSERT(line != nullptr)
line->setLineP2Id(value); line->SetLineP2Id(value);
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
@ -332,7 +332,7 @@ void DialogShoulderPoint::SetP1Line(const quint32 &value)
auto *line = qobject_cast<VisToolShoulderPoint *>(vis); auto *line = qobject_cast<VisToolShoulderPoint *>(vis);
SCASSERT(line != nullptr) SCASSERT(line != nullptr)
line->setLineP1Id(value); line->SetLineP1Id(value);
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
@ -353,7 +353,7 @@ void DialogShoulderPoint::SetFormula(const QString &value)
auto *line = qobject_cast<VisToolShoulderPoint *>(vis); auto *line = qobject_cast<VisToolShoulderPoint *>(vis);
SCASSERT(line != nullptr) SCASSERT(line != nullptr)
line->setLength(m_formula); line->SetLength(m_formula);
MoveCursorToEnd(ui->plainTextEditFormula); MoveCursorToEnd(ui->plainTextEditFormula);
} }
@ -365,7 +365,7 @@ void DialogShoulderPoint::SetFormula(const QString &value)
void DialogShoulderPoint::SetTypeLine(const QString &value) void DialogShoulderPoint::SetTypeLine(const QString &value)
{ {
ChangeCurrentData(ui->comboBoxLineType, value); ChangeCurrentData(ui->comboBoxLineType, value);
vis->setLineStyle(LineStyleToPenStyle(value)); vis->SetLineStyle(LineStyleToPenStyle(value));
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------

View File

@ -202,7 +202,7 @@ void DialogSpline::ChosenObject(quint32 id, const SceneObject &type)
{ {
++number; ++number;
path->SetObject4Id(id); path->SetPoint4Id(id);
path->RefreshGeometry(); path->RefreshGeometry();
prepare = true; prepare = true;
} }
@ -227,14 +227,14 @@ void DialogSpline::SaveData()
auto path = qobject_cast<VisToolSpline *>(vis); auto path = qobject_cast<VisToolSpline *>(vis);
SCASSERT(path != nullptr) SCASSERT(path != nullptr)
path->setObject1Id(GetP1()->id()); path->SetPoint1Id(GetP1()->id());
path->SetObject4Id(GetP4()->id()); path->SetPoint4Id(GetP4()->id());
path->SetAngle1(spl.GetStartAngle()); path->SetAngle1(spl.GetStartAngle());
path->SetAngle2(spl.GetEndAngle()); path->SetAngle2(spl.GetEndAngle());
path->SetKAsm1(spl.GetKasm1()); path->SetKAsm1(spl.GetKasm1());
path->SetKAsm2(spl.GetKasm2()); path->SetKAsm2(spl.GetKasm2());
path->SetKCurve(spl.GetKcurve()); path->SetKCurve(spl.GetKcurve());
path->setApproximationScale(spl.GetApproximationScale()); path->SetApproximationScale(spl.GetApproximationScale());
path->SetMode(Mode::Show); path->SetMode(Mode::Show);
path->RefreshGeometry(); path->RefreshGeometry();
} }
@ -631,14 +631,14 @@ void DialogSpline::SetSpline(const VSpline &spline)
auto path = qobject_cast<VisToolSpline *>(vis); auto path = qobject_cast<VisToolSpline *>(vis);
SCASSERT(path != nullptr) SCASSERT(path != nullptr)
path->setObject1Id(spl.GetP1().id()); path->SetPoint1Id(spl.GetP1().id());
path->SetObject4Id(spl.GetP4().id()); path->SetPoint4Id(spl.GetP4().id());
path->SetAngle1(spl.GetStartAngle()); path->SetAngle1(spl.GetStartAngle());
path->SetAngle2(spl.GetEndAngle()); path->SetAngle2(spl.GetEndAngle());
path->SetKAsm1(spl.GetKasm1()); path->SetKAsm1(spl.GetKasm1());
path->SetKAsm2(spl.GetKasm2()); path->SetKAsm2(spl.GetKasm2());
path->SetKCurve(spl.GetKcurve()); path->SetKCurve(spl.GetKcurve());
path->setApproximationScale(spl.GetApproximationScale()); path->SetApproximationScale(spl.GetApproximationScale());
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------

View File

@ -47,11 +47,9 @@
#include <Qt> #include <Qt>
#include <new> #include <new>
#include "../../tools/vabstracttool.h"
#include "../../visualization/visualization.h" #include "../../visualization/visualization.h"
#include "../../visualization/path/vistoolsplinepath.h" #include "../../visualization/path/vistoolsplinepath.h"
#include "../ifc/xml/vdomdocument.h" #include "../ifc/xml/vdomdocument.h"
#include "../qmuparser/qmuparsererror.h"
#include "../support/dialogeditwrongformula.h" #include "../support/dialogeditwrongformula.h"
#include "../vgeometry/../ifc/ifcdef.h" #include "../vgeometry/../ifc/ifcdef.h"
#include "../vgeometry/vpointf.h" #include "../vgeometry/vpointf.h"

View File

@ -38,7 +38,6 @@
#include "../../visualization/visualization.h" #include "../../visualization/visualization.h"
#include "../../visualization/line/vistooltriangle.h" #include "../../visualization/line/vistooltriangle.h"
#include "../ifc/xml/vabstractpattern.h" #include "../ifc/xml/vabstractpattern.h"
#include "../vmisc/vabstractapplication.h"
#include "dialogtool.h" #include "dialogtool.h"
#include "ui_dialogtriangle.h" #include "ui_dialogtriangle.h"
@ -125,7 +124,7 @@ void DialogTriangle::ChosenObject(quint32 id, const SceneObject &type)
if (SetObject(id, ui->comboBoxAxisP2, tr("Select first point"))) if (SetObject(id, ui->comboBoxAxisP2, tr("Select first point")))
{ {
number++; number++;
line->setObject2Id(id); line->SetObject2Id(id);
line->RefreshGeometry(); line->RefreshGeometry();
} }
} }
@ -142,7 +141,7 @@ void DialogTriangle::ChosenObject(quint32 id, const SceneObject &type)
if (SetObject(id, ui->comboBoxFirstPoint, tr("Select second point"))) if (SetObject(id, ui->comboBoxFirstPoint, tr("Select second point")))
{ {
number++; number++;
line->setHypotenuseP1Id(id); line->SetHypotenuseP1Id(id);
line->RefreshGeometry(); line->RefreshGeometry();
} }
} }
@ -160,7 +159,7 @@ void DialogTriangle::ChosenObject(quint32 id, const SceneObject &type)
{ {
if (SetObject(id, ui->comboBoxSecondPoint, QString())) if (SetObject(id, ui->comboBoxSecondPoint, QString()))
{ {
line->setHypotenuseP2Id(id); line->SetHypotenuseP2Id(id);
line->RefreshGeometry(); line->RefreshGeometry();
prepare = true; prepare = true;
DialogAccepted(); DialogAccepted();
@ -183,10 +182,10 @@ void DialogTriangle::SaveData()
VisToolTriangle *line = qobject_cast<VisToolTriangle *>(vis); VisToolTriangle *line = qobject_cast<VisToolTriangle *>(vis);
SCASSERT(line != nullptr) SCASSERT(line != nullptr)
line->setObject1Id(GetAxisP1Id()); line->SetObject1Id(GetAxisP1Id());
line->setObject2Id(GetAxisP2Id()); line->SetObject2Id(GetAxisP2Id());
line->setHypotenuseP1Id(GetFirstPointId()); line->SetHypotenuseP1Id(GetFirstPointId());
line->setHypotenuseP2Id(GetSecondPointId()); line->SetHypotenuseP2Id(GetSecondPointId());
line->RefreshGeometry(); line->RefreshGeometry();
} }
@ -245,7 +244,7 @@ void DialogTriangle::SetSecondPointId(const quint32 &value)
VisToolTriangle *line = qobject_cast<VisToolTriangle *>(vis); VisToolTriangle *line = qobject_cast<VisToolTriangle *>(vis);
SCASSERT(line != nullptr) SCASSERT(line != nullptr)
line->setHypotenuseP2Id(value); line->SetHypotenuseP2Id(value);
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
@ -265,7 +264,7 @@ void DialogTriangle::SetFirstPointId(const quint32 &value)
VisToolTriangle *line = qobject_cast<VisToolTriangle *>(vis); VisToolTriangle *line = qobject_cast<VisToolTriangle *>(vis);
SCASSERT(line != nullptr) SCASSERT(line != nullptr)
line->setHypotenuseP1Id(value); line->SetHypotenuseP1Id(value);
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
@ -279,7 +278,7 @@ void DialogTriangle::SetAxisP2Id(const quint32 &value)
VisToolTriangle *line = qobject_cast<VisToolTriangle *>(vis); VisToolTriangle *line = qobject_cast<VisToolTriangle *>(vis);
SCASSERT(line != nullptr) SCASSERT(line != nullptr)
line->setObject2Id(value); line->SetObject2Id(value);
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
@ -293,7 +292,7 @@ void DialogTriangle::SetAxisP1Id(const quint32 &value)
VisToolTriangle *line = qobject_cast<VisToolTriangle *>(vis); VisToolTriangle *line = qobject_cast<VisToolTriangle *>(vis);
SCASSERT(line != nullptr) SCASSERT(line != nullptr)
line->setObject1Id(value); line->SetObject1Id(value);
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------

View File

@ -43,8 +43,6 @@
#include "../../visualization/line/vistooltruedarts.h" #include "../../visualization/line/vistooltruedarts.h"
#include "../ifc/xml/vabstractpattern.h" #include "../ifc/xml/vabstractpattern.h"
#include "../qmuparser/qmudef.h" #include "../qmuparser/qmudef.h"
#include "../vgeometry/../ifc/ifcdef.h"
#include "../vmisc/vabstractapplication.h"
#include "../vpatterndb/vcontainer.h" #include "../vpatterndb/vcontainer.h"
#include "dialogtool.h" #include "dialogtool.h"
#include "ui_dialogtruedarts.h" #include "ui_dialogtruedarts.h"
@ -147,7 +145,7 @@ void DialogTrueDarts::SetFirstBasePointId(const quint32 &value)
VisToolTrueDarts *points = qobject_cast<VisToolTrueDarts *>(vis); VisToolTrueDarts *points = qobject_cast<VisToolTrueDarts *>(vis);
SCASSERT(points != nullptr) SCASSERT(points != nullptr)
points->setObject1Id(value); points->SetBaseLineP1Id(value);
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
@ -163,7 +161,7 @@ void DialogTrueDarts::SetSecondBasePointId(const quint32 &value)
VisToolTrueDarts *points = qobject_cast<VisToolTrueDarts *>(vis); VisToolTrueDarts *points = qobject_cast<VisToolTrueDarts *>(vis);
SCASSERT(points != nullptr) SCASSERT(points != nullptr)
points->setObject2Id(value); points->SetBaseLineP2Id(value);
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
@ -179,7 +177,7 @@ void DialogTrueDarts::SetFirstDartPointId(const quint32 &value)
VisToolTrueDarts *points = qobject_cast<VisToolTrueDarts *>(vis); VisToolTrueDarts *points = qobject_cast<VisToolTrueDarts *>(vis);
SCASSERT(points != nullptr) SCASSERT(points != nullptr)
points->setD1PointId(value); points->SetD1PointId(value);
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
@ -195,7 +193,7 @@ void DialogTrueDarts::SetSecondDartPointId(const quint32 &value)
VisToolTrueDarts *points = qobject_cast<VisToolTrueDarts *>(vis); VisToolTrueDarts *points = qobject_cast<VisToolTrueDarts *>(vis);
SCASSERT(points != nullptr) SCASSERT(points != nullptr)
points->setD2PointId(value); points->SetD2PointId(value);
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
@ -211,7 +209,7 @@ void DialogTrueDarts::SetThirdDartPointId(const quint32 &value)
VisToolTrueDarts *points = qobject_cast<VisToolTrueDarts *>(vis); VisToolTrueDarts *points = qobject_cast<VisToolTrueDarts *>(vis);
SCASSERT(points != nullptr) SCASSERT(points != nullptr)
points->setD3PointId(value); points->SetD3PointId(value);
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
@ -247,7 +245,7 @@ void DialogTrueDarts::ChosenObject(quint32 id, const SceneObject &type)
if (SetObject(id, ui->comboBoxSecondBasePoint, tr("Select the first dart point"))) if (SetObject(id, ui->comboBoxSecondBasePoint, tr("Select the first dart point")))
{ {
number++; number++;
points->setObject2Id(id); points->SetBaseLineP2Id(id);
points->RefreshGeometry(); points->RefreshGeometry();
} }
} }
@ -264,7 +262,7 @@ void DialogTrueDarts::ChosenObject(quint32 id, const SceneObject &type)
if (SetObject(id, ui->comboBoxFirstDartPoint, tr("Select the second dart point"))) if (SetObject(id, ui->comboBoxFirstDartPoint, tr("Select the second dart point")))
{ {
number++; number++;
points->setD1PointId(id); points->SetD1PointId(id);
points->RefreshGeometry(); points->RefreshGeometry();
} }
} }
@ -283,7 +281,7 @@ void DialogTrueDarts::ChosenObject(quint32 id, const SceneObject &type)
if (SetObject(id, ui->comboBoxSecondDartPoint, tr("Select the third dart point"))) if (SetObject(id, ui->comboBoxSecondDartPoint, tr("Select the third dart point")))
{ {
number++; number++;
points->setD2PointId(id); points->SetD2PointId(id);
points->RefreshGeometry(); points->RefreshGeometry();
} }
} }
@ -302,7 +300,7 @@ void DialogTrueDarts::ChosenObject(quint32 id, const SceneObject &type)
{ {
if (SetObject(id, ui->comboBoxThirdDartPoint, QString())) if (SetObject(id, ui->comboBoxThirdDartPoint, QString()))
{ {
points->setD3PointId(id); points->SetD3PointId(id);
points->RefreshGeometry(); points->RefreshGeometry();
prepare = true; prepare = true;
DialogAccepted(); DialogAccepted();
@ -373,11 +371,11 @@ void DialogTrueDarts::SaveData()
VisToolTrueDarts *points = qobject_cast<VisToolTrueDarts *>(vis); VisToolTrueDarts *points = qobject_cast<VisToolTrueDarts *>(vis);
SCASSERT(points != nullptr) SCASSERT(points != nullptr)
points->setObject1Id(GetFirstBasePointId()); points->SetBaseLineP1Id(GetFirstBasePointId());
points->setObject2Id(GetSecondBasePointId()); points->SetBaseLineP2Id(GetSecondBasePointId());
points->setD1PointId(GetFirstDartPointId()); points->SetD1PointId(GetFirstDartPointId());
points->setD2PointId(GetSecondDartPointId()); points->SetD2PointId(GetSecondDartPointId());
points->setD3PointId(GetThirdDartPointId()); points->SetD3PointId(GetThirdDartPointId());
points->RefreshGeometry(); points->RefreshGeometry();
} }

View File

@ -27,7 +27,6 @@
*************************************************************************/ *************************************************************************/
#include "dialogduplicatedetail.h" #include "dialogduplicatedetail.h"
#include "ui_dialogduplicatedetail.h" #include "ui_dialogduplicatedetail.h"
#include "../vwidgets/vabstractmainwindow.h"
#include "../../../visualization/path/vistoolduplicatedetail.h" #include "../../../visualization/path/vistoolduplicatedetail.h"
#include "../../../tools/vabstracttool.h" #include "../../../tools/vabstracttool.h"

View File

@ -30,7 +30,6 @@
#include "ui_dialogpiecepath.h" #include "ui_dialogpiecepath.h"
#include "../vpatterndb/vpiecenode.h" #include "../vpatterndb/vpiecenode.h"
#include "visualization/path/vistoolpiecepath.h" #include "visualization/path/vistoolpiecepath.h"
#include "../../../tools/vabstracttool.h"
#include "../../../tools/vtoolseamallowance.h" #include "../../../tools/vtoolseamallowance.h"
#include "../../support/dialogeditwrongformula.h" #include "../../support/dialogeditwrongformula.h"
#include "../vmisc/vmodifierkey.h" #include "../vmisc/vmodifierkey.h"
@ -1394,7 +1393,7 @@ Qt::PenStyle DialogPiecePath::GetPenType() const
void DialogPiecePath::SetPenType(const Qt::PenStyle &type) void DialogPiecePath::SetPenType(const Qt::PenStyle &type)
{ {
ChangeCurrentData(ui->comboBoxPenType, PenStyleToLineStyle(type)); ChangeCurrentData(ui->comboBoxPenType, PenStyleToLineStyle(type));
vis->setLineStyle(type); vis->SetLineStyle(type);
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------

View File

@ -29,10 +29,10 @@
#include "dialogpin.h" #include "dialogpin.h"
#include "ui_dialogpin.h" #include "ui_dialogpin.h"
#include "visualization/line/vistoolspecialpoint.h" #include "visualization/line/vistoolspecialpoint.h"
#include "../../../tools/vabstracttool.h"
#if QT_VERSION < QT_VERSION_CHECK(5, 7, 0) #if QT_VERSION < QT_VERSION_CHECK(5, 7, 0)
#include "../vmisc/backport/qoverload.h" #include "../vmisc/backport/qoverload.h"
#endif // QT_VERSION < QT_VERSION_CHECK(5, 7, 0) #endif // QT_VERSION < QT_VERSION_CHECK(5, 7, 0)
#include "../vpatterndb/vcontainer.h"
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
DialogPin::DialogPin(const VContainer *data, quint32 toolId, QWidget *parent) DialogPin::DialogPin(const VContainer *data, quint32 toolId, QWidget *parent)
@ -108,7 +108,7 @@ void DialogPin::SetPointId(quint32 id)
VisToolSpecialPoint *point = qobject_cast<VisToolSpecialPoint *>(vis); VisToolSpecialPoint *point = qobject_cast<VisToolSpecialPoint *>(vis);
SCASSERT(point != nullptr) SCASSERT(point != nullptr)
point->setObject1Id(id); point->SetPointId(id);
CheckPoint(); CheckPoint();
} }

View File

@ -29,13 +29,11 @@
#include "ui_dialogplacelabel.h" #include "ui_dialogplacelabel.h"
#include "visualization/line/vistoolspecialpoint.h" #include "visualization/line/vistoolspecialpoint.h"
#include "../../../tools/vabstracttool.h"
#include "../../../tools/vtoolseamallowance.h"
#include "../../support/dialogeditwrongformula.h" #include "../../support/dialogeditwrongformula.h"
#include "../vgeometry/vplacelabelitem.h"
#if QT_VERSION < QT_VERSION_CHECK(5, 7, 0) #if QT_VERSION < QT_VERSION_CHECK(5, 7, 0)
#include "../vmisc/backport/qoverload.h" #include "../vmisc/backport/qoverload.h"
#endif // QT_VERSION < QT_VERSION_CHECK(5, 7, 0) #endif // QT_VERSION < QT_VERSION_CHECK(5, 7, 0)
#include "../vpatterndb/vcontainer.h"
#include <QTimer> #include <QTimer>
@ -104,7 +102,7 @@ void DialogPlaceLabel::SetCenterPoint(quint32 id)
{ {
VisToolSpecialPoint *point = qobject_cast<VisToolSpecialPoint *>(vis); VisToolSpecialPoint *point = qobject_cast<VisToolSpecialPoint *>(vis);
SCASSERT(point != nullptr) SCASSERT(point != nullptr)
point->setObject1Id(id); point->SetPointId(id);
} }
CheckPoint(); CheckPoint();
@ -148,7 +146,7 @@ void DialogPlaceLabel::SetWidth(const QString &value)
// VisToolPlaceLabel *point = qobject_cast<VisToolPlaceLabel *>(vis); // VisToolPlaceLabel *point = qobject_cast<VisToolPlaceLabel *>(vis);
// SCASSERT(point != nullptr) // SCASSERT(point != nullptr)
// point->setObject1Id(id); // point->SetPointId(id);
MoveCursorToEnd(ui->plainTextEditFormulaWidth); MoveCursorToEnd(ui->plainTextEditFormulaWidth);
} }
@ -175,7 +173,7 @@ void DialogPlaceLabel::SetHeight(const QString &value)
// VisToolPlaceLabel *point = qobject_cast<VisToolPlaceLabel *>(vis); // VisToolPlaceLabel *point = qobject_cast<VisToolPlaceLabel *>(vis);
// SCASSERT(point != nullptr) // SCASSERT(point != nullptr)
// point->setObject1Id(id); // point->SetPointId(id);
MoveCursorToEnd(ui->plainTextEditFormulaHeight); MoveCursorToEnd(ui->plainTextEditFormulaHeight);
} }
@ -202,7 +200,7 @@ void DialogPlaceLabel::SetAngle(const QString &value)
// VisToolPlaceLabel *point = qobject_cast<VisToolPlaceLabel *>(vis); // VisToolPlaceLabel *point = qobject_cast<VisToolPlaceLabel *>(vis);
// SCASSERT(point != nullptr) // SCASSERT(point != nullptr)
// point->setObject1Id(id); // point->SetPointId(id);
MoveCursorToEnd(ui->plainTextEditFormulaAngle); MoveCursorToEnd(ui->plainTextEditFormulaAngle);
} }

View File

@ -3750,7 +3750,7 @@ void DialogSeamAllowance::ShowPieceSpecialPointsWithRect(const QListWidget *list
if (not VAbstractValApplication::VApp()->getCurrentScene()->items().contains(m_visSpecialPoints)) if (not VAbstractValApplication::VApp()->getCurrentScene()->items().contains(m_visSpecialPoints))
{ {
m_visSpecialPoints->VisualMode(NULL_ID); m_visSpecialPoints->VisualMode();
m_visSpecialPoints->setZValue(10); // pins should be on top m_visSpecialPoints->setZValue(10); // pins should be on top
VToolSeamAllowance *tool = qobject_cast<VToolSeamAllowance*>(VAbstractPattern::getTool(toolId)); VToolSeamAllowance *tool = qobject_cast<VToolSeamAllowance*>(VAbstractPattern::getTool(toolId));
SCASSERT(tool != nullptr); SCASSERT(tool != nullptr);

View File

@ -374,12 +374,12 @@ void VToolArc::SetVisualization()
const bool osSeparator = VAbstractApplication::VApp()->Settings()->GetOsSeparator(); const bool osSeparator = VAbstractApplication::VApp()->Settings()->GetOsSeparator();
const VTranslateVars *trVars = VAbstractApplication::VApp()->TrVars(); const VTranslateVars *trVars = VAbstractApplication::VApp()->TrVars();
visual->setObject1Id(arc->GetCenter().id()); visual->SetCenterId(arc->GetCenter().id());
visual->setRadius(trVars->FormulaToUser(arc->GetFormulaRadius(), osSeparator)); visual->SetRadius(trVars->FormulaToUser(arc->GetFormulaRadius(), osSeparator));
visual->setF1(trVars->FormulaToUser(arc->GetFormulaF1(), osSeparator)); visual->SetF1(trVars->FormulaToUser(arc->GetFormulaF1(), osSeparator));
visual->setF2(trVars->FormulaToUser(arc->GetFormulaF2(), osSeparator)); visual->SetF2(trVars->FormulaToUser(arc->GetFormulaF2(), osSeparator));
visual->setLineStyle(LineStyleToPenStyle(arc->GetPenStyle())); visual->SetLineStyle(LineStyleToPenStyle(arc->GetPenStyle()));
visual->setApproximationScale(arc->GetApproximationScale()); visual->SetApproximationScale(arc->GetApproximationScale());
visual->SetMode(Mode::Show); visual->SetMode(Mode::Show);
visual->RefreshGeometry(); visual->RefreshGeometry();
} }

View File

@ -353,12 +353,12 @@ void VToolArcWithLength::SetVisualization()
const bool osSeparator = VAbstractApplication::VApp()->Settings()->GetOsSeparator(); const bool osSeparator = VAbstractApplication::VApp()->Settings()->GetOsSeparator();
const VTranslateVars *trVars = VAbstractApplication::VApp()->TrVars(); const VTranslateVars *trVars = VAbstractApplication::VApp()->TrVars();
visual->setObject1Id(arc->GetCenter().id()); visual->SetCenterId(arc->GetCenter().id());
visual->setRadius(trVars->FormulaToUser(arc->GetFormulaRadius(), osSeparator)); visual->SetRadius(trVars->FormulaToUser(arc->GetFormulaRadius(), osSeparator));
visual->setF1(trVars->FormulaToUser(arc->GetFormulaF1(), osSeparator)); visual->SetF1(trVars->FormulaToUser(arc->GetFormulaF1(), osSeparator));
visual->setLength(trVars->FormulaToUser(arc->GetFormulaLength(), osSeparator)); visual->SetLength(trVars->FormulaToUser(arc->GetFormulaLength(), osSeparator));
visual->setLineStyle(LineStyleToPenStyle(arc->GetPenStyle())); visual->SetLineStyle(LineStyleToPenStyle(arc->GetPenStyle()));
visual->setApproximationScale(arc->GetApproximationScale()); visual->SetApproximationScale(arc->GetApproximationScale());
visual->SetMode(Mode::Show); visual->SetMode(Mode::Show);
visual->RefreshGeometry(); visual->RefreshGeometry();
} }

View File

@ -47,7 +47,6 @@
#include "../vgeometry/vcubicbezier.h" #include "../vgeometry/vcubicbezier.h"
#include "../vgeometry/vgobject.h" #include "../vgeometry/vgobject.h"
#include "../vgeometry/vpointf.h" #include "../vgeometry/vpointf.h"
#include "../vmisc/vabstractapplication.h"
#include "../vpatterndb/vcontainer.h" #include "../vpatterndb/vcontainer.h"
#include "../vwidgets/vmaingraphicsscene.h" #include "../vwidgets/vmaingraphicsscene.h"
#include "../../vabstracttool.h" #include "../../vabstracttool.h"
@ -257,12 +256,12 @@ void VToolCubicBezier::SetVisualization()
SCASSERT(visual != nullptr) SCASSERT(visual != nullptr)
const QSharedPointer<VCubicBezier> spl = VAbstractTool::data.GeometricObject<VCubicBezier>(m_id); const QSharedPointer<VCubicBezier> spl = VAbstractTool::data.GeometricObject<VCubicBezier>(m_id);
visual->setObject1Id(spl->GetP1().id()); visual->SetPoint1Id(spl->GetP1().id());
visual->setObject2Id(spl->GetP2().id()); visual->SetPoint2Id(spl->GetP2().id());
visual->setObject3Id(spl->GetP3().id()); visual->SetPoint3Id(spl->GetP3().id());
visual->setObject4Id(spl->GetP4().id()); visual->SetPoint4Id(spl->GetP4().id());
visual->setLineStyle(LineStyleToPenStyle(spl->GetPenStyle())); visual->SetLineStyle(LineStyleToPenStyle(spl->GetPenStyle()));
visual->setApproximationScale(spl->GetApproximationScale()); visual->SetApproximationScale(spl->GetApproximationScale());
visual->SetMode(Mode::Show); visual->SetMode(Mode::Show);
visual->RefreshGeometry(); visual->RefreshGeometry();
} }

View File

@ -245,8 +245,8 @@ void VToolCubicBezierPath::SetVisualization()
SCASSERT(visual != nullptr) SCASSERT(visual != nullptr)
QSharedPointer<VCubicBezierPath> splPath = VAbstractTool::data.GeometricObject<VCubicBezierPath>(m_id); QSharedPointer<VCubicBezierPath> splPath = VAbstractTool::data.GeometricObject<VCubicBezierPath>(m_id);
visual->setPath(*splPath.data()); visual->SetPath(*splPath.data());
visual->setLineStyle(LineStyleToPenStyle(splPath->GetPenStyle())); visual->SetLineStyle(LineStyleToPenStyle(splPath->GetPenStyle()));
visual->SetMode(Mode::Show); visual->SetMode(Mode::Show);
visual->RefreshGeometry(); visual->RefreshGeometry();
} }

View File

@ -423,13 +423,13 @@ void VToolEllipticalArc::SetVisualization()
const bool osSeparator = VAbstractApplication::VApp()->Settings()->GetOsSeparator(); const bool osSeparator = VAbstractApplication::VApp()->Settings()->GetOsSeparator();
const VTranslateVars *trVars = VAbstractApplication::VApp()->TrVars(); const VTranslateVars *trVars = VAbstractApplication::VApp()->TrVars();
visual->setObject1Id(elArc->GetCenter().id()); visual->SetCenterId(elArc->GetCenter().id());
visual->setRadius1(trVars->FormulaToUser(elArc->GetFormulaRadius1(), osSeparator)); visual->SetRadius1(trVars->FormulaToUser(elArc->GetFormulaRadius1(), osSeparator));
visual->setRadius2(trVars->FormulaToUser(elArc->GetFormulaRadius2(), osSeparator)); visual->SetRadius2(trVars->FormulaToUser(elArc->GetFormulaRadius2(), osSeparator));
visual->setF1(trVars->FormulaToUser(elArc->GetFormulaF1(), osSeparator)); visual->SetF1(trVars->FormulaToUser(elArc->GetFormulaF1(), osSeparator));
visual->setF2(trVars->FormulaToUser(elArc->GetFormulaF2(), osSeparator)); visual->SetF2(trVars->FormulaToUser(elArc->GetFormulaF2(), osSeparator));
visual->setRotationAngle(trVars->FormulaToUser(elArc->GetFormulaRotationAngle(), osSeparator)); visual->SetRotationAngle(trVars->FormulaToUser(elArc->GetFormulaRotationAngle(), osSeparator));
visual->setLineStyle(LineStyleToPenStyle(elArc->GetPenStyle())); visual->SetLineStyle(LineStyleToPenStyle(elArc->GetPenStyle()));
visual->RefreshGeometry(); visual->RefreshGeometry();
} }
} }

View File

@ -544,15 +544,15 @@ void VToolSpline::SetVisualization()
SCASSERT(visual != nullptr) SCASSERT(visual != nullptr)
const QSharedPointer<VSpline> spl = VAbstractTool::data.GeometricObject<VSpline>(m_id); const QSharedPointer<VSpline> spl = VAbstractTool::data.GeometricObject<VSpline>(m_id);
visual->setObject1Id(spl->GetP1().id()); visual->SetPoint1Id(spl->GetP1().id());
visual->SetObject4Id(spl->GetP4().id()); visual->SetPoint4Id(spl->GetP4().id());
visual->SetAngle1(spl->GetStartAngle()); visual->SetAngle1(spl->GetStartAngle());
visual->SetAngle2(spl->GetEndAngle()); visual->SetAngle2(spl->GetEndAngle());
visual->SetKAsm1(spl->GetKasm1()); visual->SetKAsm1(spl->GetKasm1());
visual->SetKAsm2(spl->GetKasm2()); visual->SetKAsm2(spl->GetKasm2());
visual->SetKCurve(spl->GetKcurve()); visual->SetKCurve(spl->GetKcurve());
visual->setLineStyle(LineStyleToPenStyle(spl->GetPenStyle())); visual->SetLineStyle(LineStyleToPenStyle(spl->GetPenStyle()));
visual->setApproximationScale(spl->GetApproximationScale()); visual->SetApproximationScale(spl->GetApproximationScale());
visual->SetMode(Mode::Show); visual->SetMode(Mode::Show);
visual->RefreshGeometry(); visual->RefreshGeometry();
} }

View File

@ -754,7 +754,7 @@ void VToolSplinePath::SetVisualization()
QSharedPointer<VSplinePath> splPath = VAbstractTool::data.GeometricObject<VSplinePath>(m_id); QSharedPointer<VSplinePath> splPath = VAbstractTool::data.GeometricObject<VSplinePath>(m_id);
visual->SetPath(*splPath.data()); visual->SetPath(*splPath.data());
visual->setLineStyle(LineStyleToPenStyle(splPath->GetPenStyle())); visual->SetLineStyle(LineStyleToPenStyle(splPath->GetPenStyle()));
visual->SetMode(Mode::Show); visual->SetMode(Mode::Show);
visual->RefreshGeometry(); visual->RefreshGeometry();
} }

View File

@ -327,11 +327,11 @@ void VToolTrueDarts::SetVisualization()
auto *visual = qobject_cast<VisToolTrueDarts *>(vis); auto *visual = qobject_cast<VisToolTrueDarts *>(vis);
SCASSERT(visual != nullptr) SCASSERT(visual != nullptr)
visual->setObject1Id(baseLineP1Id); visual->SetBaseLineP1Id(baseLineP1Id);
visual->setObject2Id(baseLineP2Id); visual->SetBaseLineP2Id(baseLineP2Id);
visual->setD1PointId(dartP1Id); visual->SetD1PointId(dartP1Id);
visual->setD2PointId(dartP2Id); visual->SetD2PointId(dartP2Id);
visual->setD3PointId(dartP3Id); visual->SetD3PointId(dartP3Id);
visual->RefreshGeometry(); visual->RefreshGeometry();
} }
} }

View File

@ -270,12 +270,12 @@ void VToolCutArc::SetVisualization()
auto *visual = qobject_cast<VisToolCutArc *>(vis); auto *visual = qobject_cast<VisToolCutArc *>(vis);
SCASSERT(visual != nullptr) SCASSERT(visual != nullptr)
visual->setObject1Id(baseCurveId); visual->SetArcId(baseCurveId);
visual->setLength(VAbstractApplication::VApp()->TrVars() visual->SetLength(VAbstractApplication::VApp()->TrVars()
->FormulaToUser(formula, VAbstractApplication::VApp()->Settings()->GetOsSeparator())); ->FormulaToUser(formula, VAbstractApplication::VApp()->Settings()->GetOsSeparator()));
const QSharedPointer<VAbstractCurve> curve = VAbstractTool::data.GeometricObject<VAbstractCurve>(baseCurveId); const QSharedPointer<VAbstractCurve> curve = VAbstractTool::data.GeometricObject<VAbstractCurve>(baseCurveId);
visual->setLineStyle(LineStyleToPenStyle(curve->GetPenStyle())); visual->SetLineStyle(LineStyleToPenStyle(curve->GetPenStyle()));
visual->RefreshGeometry(); visual->RefreshGeometry();
} }

View File

@ -269,12 +269,12 @@ void VToolCutSpline::SetVisualization()
auto *visual = qobject_cast<VisToolCutSpline *>(vis); auto *visual = qobject_cast<VisToolCutSpline *>(vis);
SCASSERT(visual != nullptr) SCASSERT(visual != nullptr)
visual->setObject1Id(baseCurveId); visual->SetSplineId(baseCurveId);
visual->setLength(VAbstractApplication::VApp()->TrVars() visual->SetLength(VAbstractApplication::VApp()->TrVars()
->FormulaToUser(formula, VAbstractApplication::VApp()->Settings()->GetOsSeparator())); ->FormulaToUser(formula, VAbstractApplication::VApp()->Settings()->GetOsSeparator()));
const QSharedPointer<VAbstractCurve> curve = VAbstractTool::data.GeometricObject<VAbstractCurve>(baseCurveId); const QSharedPointer<VAbstractCurve> curve = VAbstractTool::data.GeometricObject<VAbstractCurve>(baseCurveId);
visual->setLineStyle(LineStyleToPenStyle(curve->GetPenStyle())); visual->SetLineStyle(LineStyleToPenStyle(curve->GetPenStyle()));
visual->RefreshGeometry(); visual->RefreshGeometry();
} }

View File

@ -363,12 +363,12 @@ void VToolCutSplinePath::SetVisualization()
auto *visual = qobject_cast<VisToolCutSplinePath *>(vis); auto *visual = qobject_cast<VisToolCutSplinePath *>(vis);
SCASSERT(visual != nullptr) SCASSERT(visual != nullptr)
visual->setObject1Id(baseCurveId); visual->SetSplinePathId(baseCurveId);
visual->setLength(VAbstractApplication::VApp()->TrVars() visual->SetLength(VAbstractApplication::VApp()->TrVars()
->FormulaToUser(formula, VAbstractApplication::VApp()->Settings()->GetOsSeparator())); ->FormulaToUser(formula, VAbstractApplication::VApp()->Settings()->GetOsSeparator()));
const QSharedPointer<VAbstractCurve> curve = VAbstractTool::data.GeometricObject<VAbstractCurve>(baseCurveId); const QSharedPointer<VAbstractCurve> curve = VAbstractTool::data.GeometricObject<VAbstractCurve>(baseCurveId);
visual->setLineStyle(LineStyleToPenStyle(curve->GetPenStyle())); visual->SetLineStyle(LineStyleToPenStyle(curve->GetPenStyle()));
visual->RefreshGeometry(); visual->RefreshGeometry();
} }

View File

@ -141,11 +141,11 @@ void VToolAlongLine::SetVisualization()
{ {
auto *visual = qobject_cast<VisToolAlongLine *>(vis); auto *visual = qobject_cast<VisToolAlongLine *>(vis);
SCASSERT(visual != nullptr) SCASSERT(visual != nullptr)
visual->setObject1Id(basePointId); visual->SetPoint1Id(basePointId);
visual->setObject2Id(m_secondPointId); visual->SetPoint2Id(m_secondPointId);
visual->setLength(VAbstractApplication::VApp()->TrVars() visual->SetLength(VAbstractApplication::VApp()->TrVars()
->FormulaToUser(formulaLength, VAbstractApplication::VApp()->Settings()->GetOsSeparator())); ->FormulaToUser(formulaLength, VAbstractApplication::VApp()->Settings()->GetOsSeparator()));
visual->setLineStyle(LineStyleToPenStyle(m_lineType)); visual->SetLineStyle(LineStyleToPenStyle(m_lineType));
visual->RefreshGeometry(); visual->RefreshGeometry();
} }
} }

View File

@ -301,12 +301,12 @@ void VToolBisector::SetVisualization()
auto *visual = qobject_cast<VisToolBisector *>(vis); auto *visual = qobject_cast<VisToolBisector *>(vis);
SCASSERT(visual != nullptr) SCASSERT(visual != nullptr)
visual->setObject1Id(firstPointId); visual->SetPoint1Id(firstPointId);
visual->setObject2Id(basePointId); visual->SetPoint2Id(basePointId);
visual->setObject3Id(thirdPointId); visual->SetPoint3Id(thirdPointId);
visual->setLength(VAbstractApplication::VApp()->TrVars() visual->SetLength(VAbstractApplication::VApp()->TrVars()
->FormulaToUser(formulaLength, VAbstractApplication::VApp()->Settings()->GetOsSeparator())); ->FormulaToUser(formulaLength, VAbstractApplication::VApp()->Settings()->GetOsSeparator()));
visual->setLineStyle(LineStyleToPenStyle(m_lineType)); visual->SetLineStyle(LineStyleToPenStyle(m_lineType));
visual->RefreshGeometry(); visual->RefreshGeometry();
} }
} }

View File

@ -322,11 +322,11 @@ void VToolCurveIntersectAxis::SetVisualization()
auto *visual = qobject_cast<VisToolCurveIntersectAxis *>(vis); auto *visual = qobject_cast<VisToolCurveIntersectAxis *>(vis);
SCASSERT(visual != nullptr) SCASSERT(visual != nullptr)
visual->setObject1Id(curveId); visual->SetCurveId(curveId);
visual->setAxisPointId(basePointId); visual->setAxisPointId(basePointId);
visual->SetAngle(VAbstractApplication::VApp()->TrVars() visual->SetAngle(VAbstractApplication::VApp()->TrVars()
->FormulaToUser(formulaAngle, VAbstractApplication::VApp()->Settings()->GetOsSeparator())); ->FormulaToUser(formulaAngle, VAbstractApplication::VApp()->Settings()->GetOsSeparator()));
visual->setLineStyle(LineStyleToPenStyle(m_lineType)); visual->SetLineStyle(LineStyleToPenStyle(m_lineType));
visual->RefreshGeometry(); visual->RefreshGeometry();
} }
} }

View File

@ -231,10 +231,10 @@ void VToolEndLine::SetVisualization()
const bool osSeparator = VAbstractApplication::VApp()->Settings()->GetOsSeparator(); const bool osSeparator = VAbstractApplication::VApp()->Settings()->GetOsSeparator();
const VTranslateVars *trVars = VAbstractApplication::VApp()->TrVars(); const VTranslateVars *trVars = VAbstractApplication::VApp()->TrVars();
visual->setObject1Id(basePointId); visual->SetBasePointId(basePointId);
visual->setLength(trVars->FormulaToUser(formulaLength, osSeparator)); visual->SetLength(trVars->FormulaToUser(formulaLength, osSeparator));
visual->SetAngle(trVars->FormulaToUser(formulaAngle, osSeparator)); visual->SetAngle(trVars->FormulaToUser(formulaAngle, osSeparator));
visual->setLineStyle(LineStyleToPenStyle(m_lineType)); visual->SetLineStyle(LineStyleToPenStyle(m_lineType));
visual->SetMode(Mode::Show); visual->SetMode(Mode::Show);
visual->RefreshGeometry(); visual->RefreshGeometry();
} }

View File

@ -260,10 +260,10 @@ void VToolHeight::SetVisualization()
auto *visual = qobject_cast<VisToolHeight *>(vis); auto *visual = qobject_cast<VisToolHeight *>(vis);
SCASSERT(visual != nullptr) SCASSERT(visual != nullptr)
visual->setObject1Id(basePointId); visual->SetBasePointId(basePointId);
visual->setLineP1Id(p1LineId); visual->SetLineP1Id(p1LineId);
visual->setLineP2Id(p2LineId); visual->SetLineP2Id(p2LineId);
visual->setLineStyle(LineStyleToPenStyle(m_lineType)); visual->SetLineStyle(LineStyleToPenStyle(m_lineType));
visual->RefreshGeometry(); visual->RefreshGeometry();
} }
} }

View File

@ -318,12 +318,12 @@ void VToolLineIntersectAxis::SetVisualization()
auto *visual = qobject_cast<VisToolLineIntersectAxis *>(vis); auto *visual = qobject_cast<VisToolLineIntersectAxis *>(vis);
SCASSERT(visual != nullptr) SCASSERT(visual != nullptr)
visual->setObject1Id(firstPointId); visual->SetPoint1Id(firstPointId);
visual->setPoint2Id(secondPointId); visual->SetPoint2Id(secondPointId);
visual->setAxisPointId(basePointId); visual->SetAxisPointId(basePointId);
visual->SetAngle(VAbstractApplication::VApp()->TrVars() visual->SetAngle(VAbstractApplication::VApp()->TrVars()
->FormulaToUser(formulaAngle, VAbstractApplication::VApp()->Settings()->GetOsSeparator())); ->FormulaToUser(formulaAngle, VAbstractApplication::VApp()->Settings()->GetOsSeparator()));
visual->setLineStyle(LineStyleToPenStyle(m_lineType)); visual->SetLineStyle(LineStyleToPenStyle(m_lineType));
visual->RefreshGeometry(); visual->RefreshGeometry();
} }
} }

View File

@ -45,13 +45,11 @@ template <class T> class QSharedPointer;
struct VToolLinePointInitData : VToolSinglePointInitData struct VToolLinePointInitData : VToolSinglePointInitData
{ {
VToolLinePointInitData() VToolLinePointInitData()
: VToolSinglePointInitData(), : VToolSinglePointInitData()
typeLine(TypeLineLine),
lineColor(ColorBlack)
{} {}
QString typeLine; QString typeLine{TypeLineLine};
QString lineColor; QString lineColor{ColorBlack};
}; };
/** /**
@ -68,8 +66,8 @@ public:
virtual int type() const override {return Type;} virtual int type() const override {return Type;}
enum { Type = UserType + static_cast<int>(Tool::LinePoint)}; enum { Type = UserType + static_cast<int>(Tool::LinePoint)};
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
QWidget *widget = nullptr) override; QWidget *widget = nullptr) override;
VFormula GetFormulaLength() const; VFormula GetFormulaLength() const;
void SetFormulaLength(const VFormula &value); void SetFormulaLength(const VFormula &value);

View File

@ -271,12 +271,12 @@ void VToolNormal::SetVisualization()
auto *visual = qobject_cast<VisToolNormal *>(vis); auto *visual = qobject_cast<VisToolNormal *>(vis);
SCASSERT(visual != nullptr) SCASSERT(visual != nullptr)
visual->setObject1Id(basePointId); visual->SetPoint1Id(basePointId);
visual->setObject2Id(secondPointId); visual->SetPoint2Id(secondPointId);
visual->setLength(VAbstractApplication::VApp()->TrVars() visual->SetLength(VAbstractApplication::VApp()->TrVars()
->FormulaToUser(formulaLength, VAbstractApplication::VApp()->Settings()->GetOsSeparator())); ->FormulaToUser(formulaLength, VAbstractApplication::VApp()->Settings()->GetOsSeparator()));
visual->SetAngle(angle); visual->SetAngle(angle);
visual->setLineStyle(LineStyleToPenStyle(m_lineType)); visual->SetLineStyle(LineStyleToPenStyle(m_lineType));
visual->RefreshGeometry(); visual->RefreshGeometry();
} }
} }

View File

@ -321,12 +321,12 @@ void VToolShoulderPoint::SetVisualization()
auto *visual = qobject_cast<VisToolShoulderPoint *>(vis); auto *visual = qobject_cast<VisToolShoulderPoint *>(vis);
SCASSERT(visual != nullptr) SCASSERT(visual != nullptr)
visual->setObject1Id(pShoulder); visual->SetLineP1Id(pShoulder);
visual->setLineP1Id(basePointId); visual->SetLineP1Id(basePointId);
visual->setLineP2Id(p2Line); visual->SetLineP2Id(p2Line);
visual->setLength(VAbstractApplication::VApp()->TrVars() visual->SetLength(VAbstractApplication::VApp()->TrVars()
->FormulaToUser(formulaLength, VAbstractApplication::VApp()->Settings()->GetOsSeparator())); ->FormulaToUser(formulaLength, VAbstractApplication::VApp()->Settings()->GetOsSeparator()));
visual->setLineStyle(LineStyleToPenStyle(m_lineType)); visual->SetLineStyle(LineStyleToPenStyle(m_lineType));
visual->RefreshGeometry(); visual->RefreshGeometry();
} }
} }

View File

@ -296,10 +296,10 @@ void VToolLineIntersect::SetVisualization()
auto *visual = qobject_cast<VisToolLineIntersect *>(vis); auto *visual = qobject_cast<VisToolLineIntersect *>(vis);
SCASSERT(visual != nullptr) SCASSERT(visual != nullptr)
visual->setObject1Id(p1Line1); visual->SetLine1P1Id(p1Line1);
visual->setLine1P2Id(p2Line1); visual->SetLine1P2Id(p2Line1);
visual->setLine2P1Id(p1Line2); visual->SetLine2P1Id(p1Line2);
visual->setLine2P2Id(p2Line2); visual->SetLine2P2Id(p2Line2);
visual->RefreshGeometry(); visual->RefreshGeometry();
} }
} }

View File

@ -334,9 +334,9 @@ void VToolPointFromArcAndTangent::SetVisualization()
auto *visual = qobject_cast<VisToolPointFromArcAndTangent *>(vis); auto *visual = qobject_cast<VisToolPointFromArcAndTangent *>(vis);
SCASSERT(visual != nullptr) SCASSERT(visual != nullptr)
visual->setObject1Id(tangentPointId); visual->SetPointId(tangentPointId);
visual->setArcId(arcId); visual->SetArcId(arcId);
visual->setCrossPoint(crossPoint); visual->SetCrossPoint(crossPoint);
visual->RefreshGeometry(); visual->RefreshGeometry();
} }
} }

View File

@ -328,10 +328,10 @@ void VToolPointFromCircleAndTangent::SetVisualization()
auto *visual = qobject_cast<VisToolPointFromCircleAndTangent *>(vis); auto *visual = qobject_cast<VisToolPointFromCircleAndTangent *>(vis);
SCASSERT(visual != nullptr) SCASSERT(visual != nullptr)
visual->setObject1Id(tangentPointId); visual->SetPointId(tangentPointId);
visual->setObject2Id(circleCenterId); visual->SetCenterId(circleCenterId);
visual->setCRadius(circleRadius); visual->SetCRadius(circleRadius);
visual->setCrossPoint(crossPoint); visual->SetCrossPoint(crossPoint);
visual->RefreshGeometry(); visual->RefreshGeometry();
} }
} }

View File

@ -351,10 +351,10 @@ void VToolPointOfContact::SetVisualization()
auto *visual = qobject_cast<VisToolPointOfContact *>(vis); auto *visual = qobject_cast<VisToolPointOfContact *>(vis);
SCASSERT(visual != nullptr) SCASSERT(visual != nullptr)
visual->setObject1Id(firstPointId); visual->SetLineP1Id(firstPointId);
visual->setLineP2Id(secondPointId); visual->SetLineP2Id(secondPointId);
visual->setRadiusId(center); visual->SetRadiusId(center);
visual->setRadius(VAbstractApplication::VApp()->TrVars() visual->SetRadius(VAbstractApplication::VApp()->TrVars()
->FormulaToUser(arcRadius, VAbstractApplication::VApp()->Settings()->GetOsSeparator())); ->FormulaToUser(arcRadius, VAbstractApplication::VApp()->Settings()->GetOsSeparator()));
visual->RefreshGeometry(); visual->RefreshGeometry();
} }

View File

@ -240,8 +240,8 @@ void VToolPointOfIntersection::SetVisualization()
auto *visual = qobject_cast<VisToolPointOfIntersection *>(vis); auto *visual = qobject_cast<VisToolPointOfIntersection *>(vis);
SCASSERT(visual != nullptr) SCASSERT(visual != nullptr)
visual->setObject1Id(firstPointId); visual->SetPoint1Id(firstPointId);
visual->setPoint2Id(secondPointId); visual->SetPoint2Id(secondPointId);
visual->RefreshGeometry(); visual->RefreshGeometry();
} }
} }

View File

@ -354,9 +354,9 @@ void VToolPointOfIntersectionArcs::SetVisualization()
auto *visual = qobject_cast<VisToolPointOfIntersectionArcs *>(vis); auto *visual = qobject_cast<VisToolPointOfIntersectionArcs *>(vis);
SCASSERT(visual != nullptr) SCASSERT(visual != nullptr)
visual->setArc1Id(firstArcId); visual->SetArc1Id(firstArcId);
visual->setArc2Id(secondArcId); visual->SetArc2Id(secondArcId);
visual->setCrossPoint(crossPoint); visual->SetCrossPoint(crossPoint);
visual->RefreshGeometry(); visual->RefreshGeometry();
} }
} }

View File

@ -370,15 +370,15 @@ void VToolPointOfIntersectionCircles::SetVisualization()
auto *visual = qobject_cast<VisToolPointOfIntersectionCircles *>(vis); auto *visual = qobject_cast<VisToolPointOfIntersectionCircles *>(vis);
SCASSERT(visual != nullptr) SCASSERT(visual != nullptr)
visual->setObject1Id(firstCircleCenterId); visual->SetCircle1Id(firstCircleCenterId);
visual->setObject2Id(secondCircleCenterId); visual->SetCircle2Id(secondCircleCenterId);
const bool osSeparator = VAbstractApplication::VApp()->Settings()->GetOsSeparator(); const bool osSeparator = VAbstractApplication::VApp()->Settings()->GetOsSeparator();
const VTranslateVars *trVars = VAbstractApplication::VApp()->TrVars(); const VTranslateVars *trVars = VAbstractApplication::VApp()->TrVars();
visual->setC1Radius(trVars->FormulaToUser(firstCircleRadius, osSeparator)); visual->SetC1Radius(trVars->FormulaToUser(firstCircleRadius, osSeparator));
visual->setC2Radius(trVars->FormulaToUser(secondCircleRadius, osSeparator)); visual->SetC2Radius(trVars->FormulaToUser(secondCircleRadius, osSeparator));
visual->setCrossPoint(crossPoint); visual->SetCrossPoint(crossPoint);
visual->RefreshGeometry(); visual->RefreshGeometry();
} }
} }

View File

@ -469,10 +469,10 @@ void VToolPointOfIntersectionCurves::SetVisualization()
auto visual = qobject_cast<VisToolPointOfIntersectionCurves *>(vis); auto visual = qobject_cast<VisToolPointOfIntersectionCurves *>(vis);
SCASSERT(visual != nullptr) SCASSERT(visual != nullptr)
visual->setObject1Id(firstCurveId); visual->SetCurve1Id(firstCurveId);
visual->setObject2Id(secondCurveId); visual->SetCurve2Id(secondCurveId);
visual->setVCrossPoint(vCrossPoint); visual->SetVCrossPoint(vCrossPoint);
visual->setHCrossPoint(hCrossPoint); visual->SetHCrossPoint(hCrossPoint);
visual->RefreshGeometry(); visual->RefreshGeometry();
} }
} }

View File

@ -35,6 +35,7 @@
#include <QStringData> #include <QStringData>
#include <QStringDataPtr> #include <QStringDataPtr>
#include <new> #include <new>
#include <QtMath>
#include "../../../../dialogs/tools/dialogtriangle.h" #include "../../../../dialogs/tools/dialogtriangle.h"
#include "../../../../dialogs/tools/dialogtool.h" #include "../../../../dialogs/tools/dialogtool.h"
@ -50,7 +51,6 @@
#include "../../../vabstracttool.h" #include "../../../vabstracttool.h"
#include "../../vdrawtool.h" #include "../../vdrawtool.h"
#include "vtoolsinglepoint.h" #include "vtoolsinglepoint.h"
#include "../vmisc/vmath.h"
#include "../vmisc/compatibility.h" #include "../vmisc/compatibility.h"
template <class T> class QSharedPointer; template <class T> class QSharedPointer;
@ -341,10 +341,10 @@ void VToolTriangle::SetVisualization()
auto * visual = qobject_cast<VisToolTriangle *>(vis); auto * visual = qobject_cast<VisToolTriangle *>(vis);
SCASSERT(visual != nullptr) SCASSERT(visual != nullptr)
visual->setObject1Id(axisP1Id); visual->SetObject1Id(axisP1Id);
visual->setObject2Id(axisP2Id); visual->SetObject2Id(axisP2Id);
visual->setHypotenuseP1Id(firstPointId); visual->SetHypotenuseP1Id(firstPointId);
visual->setHypotenuseP2Id(secondPointId); visual->SetHypotenuseP2Id(secondPointId);
visual->RefreshGeometry(); visual->RefreshGeometry();
} }
} }

View File

@ -426,9 +426,9 @@ void VToolLine::SetVisualization()
auto *visual = qobject_cast<VisToolLine *>(vis); auto *visual = qobject_cast<VisToolLine *>(vis);
SCASSERT(visual != nullptr) SCASSERT(visual != nullptr)
visual->setObject1Id(firstPoint); visual->SetPoint1Id(firstPoint);
visual->setPoint2Id(secondPoint); visual->SetPoint2Id(secondPoint);
visual->setLineStyle(LineStyleToPenStyle(m_lineType)); visual->SetLineStyle(LineStyleToPenStyle(m_lineType));
visual->RefreshGeometry(); visual->RefreshGeometry();
} }
} }

View File

@ -27,7 +27,6 @@
*************************************************************************/ *************************************************************************/
#include "visoperation.h" #include "visoperation.h"
#include "../vgeometry/vabstractcurve.h"
#include "../vgeometry/varc.h" #include "../vgeometry/varc.h"
#include "../vgeometry/vcubicbezier.h" #include "../vgeometry/vcubicbezier.h"
#include "../vgeometry/vcubicbezierpath.h" #include "../vgeometry/vcubicbezierpath.h"
@ -40,73 +39,61 @@
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
VisOperation::VisOperation(const VContainer *data, QGraphicsItem *parent) VisOperation::VisOperation(const VContainer *data, QGraphicsItem *parent)
: VisLine(data, parent), : VisLine(data, parent)
objects(),
supportColor2(Qt::darkGreen),
supportColor3(Qt::darkBlue),
points(),
curves()
{ {
SetColor(VColor::SupportColor2, Qt::darkGreen);
SetColor(VColor::SupportColor3, Qt::darkBlue);
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
VisOperation::~VisOperation() VisOperation::~VisOperation()
{ {
qDeleteAll(points); qDeleteAll(m_points);
qDeleteAll(curves); qDeleteAll(m_curves);
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void VisOperation::SetObjects(const QVector<quint32> &objects) void VisOperation::SetObjects(const QVector<quint32> &objects)
{ {
this->objects = objects; m_objects = objects;
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void VisOperation::VisualMode(const quint32 &pointId) void VisOperation::VisualMode(quint32 id)
{ {
Q_UNUSED(pointId) Q_UNUSED(id)
VMainGraphicsScene *scene = qobject_cast<VMainGraphicsScene *>(VAbstractValApplication::VApp()->getCurrentScene()); StartVisualMode();
SCASSERT(scene != nullptr)
Visualization::scenePos = scene->getScenePos();
RefreshGeometry();
AddOnScene();
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
VScaledEllipse *VisOperation::GetPoint(quint32 i, const QColor &color) auto VisOperation::GetPoint(quint32 i, const QColor &color) -> VScaledEllipse *
{ {
return GetPointItem(points, i, color, this); return GetPointItem(m_points, i, color, this);
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
VCurvePathItem *VisOperation::GetCurve(quint32 i, const QColor &color) auto VisOperation::GetCurve(quint32 i, const QColor &color) -> VCurvePathItem *
{ {
if (not curves.isEmpty() && static_cast<quint32>(curves.size() - 1) >= i) if (!m_curves.isEmpty() && static_cast<quint32>(m_curves.size() - 1) >= i)
{ {
return curves.at(static_cast<int>(i)); return m_curves.at(static_cast<int>(i));
} }
else
{ auto *curve = InitItem<VCurvePathItem>(color, this);
auto curve = InitItem<VCurvePathItem>(color, this); m_curves.append(curve);
curves.append(curve); return curve;
return curve;
}
return nullptr;
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
QT_WARNING_PUSH QT_WARNING_PUSH
QT_WARNING_DISABLE_GCC("-Wswitch-default") QT_WARNING_DISABLE_GCC("-Wswitch-default")
void VisOperation::RefreshFlippedObjects(const QPointF &firstPoint, const QPointF &secondPoint) void VisOperation::RefreshFlippedObjects(quint32 originPointId, const QPointF &firstPoint, const QPointF &secondPoint)
{ {
int iPoint = -1; int iPoint = -1;
int iCurve = -1; int iCurve = -1;
for (auto id : qAsConst(objects)) for (auto id : qAsConst(m_objects))
{ {
const QSharedPointer<VGObject> obj = Visualization::data->GetGObject(id); const QSharedPointer<VGObject> obj = GetData()->GetGObject(id);
// This check helps to find missed objects in the switch // This check helps to find missed objects in the switch
Q_STATIC_ASSERT_X(static_cast<int>(GOType::Unknown) == 8, "Not all objects were handled."); Q_STATIC_ASSERT_X(static_cast<int>(GOType::Unknown) == 8, "Not all objects were handled.");
@ -115,49 +102,50 @@ void VisOperation::RefreshFlippedObjects(const QPointF &firstPoint, const QPoint
{ {
case GOType::Point: case GOType::Point:
{ {
const QSharedPointer<VPointF> p = Visualization::data->GeometricObject<VPointF>(id); const QSharedPointer<VPointF> p = GetData()->GeometricObject<VPointF>(id);
++iPoint; ++iPoint;
VScaledEllipse *point = GetPoint(static_cast<quint32>(iPoint), supportColor2); VScaledEllipse *point = GetPoint(static_cast<quint32>(iPoint), Color(VColor::SupportColor2));
DrawPoint(point, static_cast<QPointF>(*p), supportColor2); DrawPoint(point, static_cast<QPointF>(*p), Color(VColor::SupportColor2));
++iPoint; ++iPoint;
point = GetPoint(static_cast<quint32>(iPoint), supportColor); point = GetPoint(static_cast<quint32>(iPoint), Color(VColor::SupportColor));
if (object1Id != NULL_ID) if (originPointId != NULL_ID)
{ {
DrawPoint(point, static_cast<QPointF>(p->Flip(QLineF(firstPoint, secondPoint))), supportColor); DrawPoint(point, static_cast<QPointF>(p->Flip(QLineF(firstPoint, secondPoint))),
Color(VColor::SupportColor));
} }
break; break;
} }
case GOType::Arc: case GOType::Arc:
{ {
iCurve = AddFlippedCurve<VArc>(firstPoint, secondPoint, id, iCurve); iCurve = AddFlippedCurve<VArc>(originPointId, firstPoint, secondPoint, id, iCurve);
break; break;
} }
case GOType::EllipticalArc: case GOType::EllipticalArc:
{ {
iCurve = AddFlippedCurve<VEllipticalArc>(firstPoint, secondPoint, id, iCurve); iCurve = AddFlippedCurve<VEllipticalArc>(originPointId, firstPoint, secondPoint, id, iCurve);
break; break;
} }
case GOType::Spline: case GOType::Spline:
{ {
iCurve = AddFlippedCurve<VSpline>(firstPoint, secondPoint, id, iCurve); iCurve = AddFlippedCurve<VSpline>(originPointId, firstPoint, secondPoint, id, iCurve);
break; break;
} }
case GOType::SplinePath: case GOType::SplinePath:
{ {
iCurve = AddFlippedCurve<VSplinePath>(firstPoint, secondPoint, id, iCurve); iCurve = AddFlippedCurve<VSplinePath>(originPointId, firstPoint, secondPoint, id, iCurve);
break; break;
} }
case GOType::CubicBezier: case GOType::CubicBezier:
{ {
iCurve = AddFlippedCurve<VCubicBezier>(firstPoint, secondPoint, id, iCurve); iCurve = AddFlippedCurve<VCubicBezier>(originPointId, firstPoint, secondPoint, id, iCurve);
break; break;
} }
case GOType::CubicBezierPath: case GOType::CubicBezierPath:
{ {
iCurve = AddFlippedCurve<VCubicBezierPath>(firstPoint, secondPoint, id, iCurve); iCurve = AddFlippedCurve<VCubicBezierPath>(originPointId, firstPoint, secondPoint, id, iCurve);
break; break;
} }
case GOType::Unknown: case GOType::Unknown:

View File

@ -39,52 +39,62 @@ class VisOperation : public VisLine
Q_OBJECT // NOLINT Q_OBJECT // NOLINT
public: public:
explicit VisOperation(const VContainer *data, QGraphicsItem *parent = nullptr); explicit VisOperation(const VContainer *data, QGraphicsItem *parent = nullptr);
virtual ~VisOperation(); ~VisOperation() override;
void SetObjects(const QVector<quint32> &objects); void SetObjects(const QVector<quint32> &objects);
void VisualMode(quint32 id = NULL_ID) override;
virtual void VisualMode(const quint32 &pointId = NULL_ID) override; auto type() const -> int override {return Type;}
enum {Type = UserType + static_cast<int>(Vis::ToolRotation)};
virtual int type() const override {return Type;}
enum { Type = UserType + static_cast<int>(Vis::ToolRotation)};
protected: protected:
QVector<quint32> objects; auto GetPoint(quint32 i, const QColor &color) -> VScaledEllipse *;
QColor supportColor2; auto GetCurve(quint32 i, const QColor &color) -> VCurvePathItem *;
QColor supportColor3;
QVector<VScaledEllipse *> points;
QVector<VCurvePathItem *> curves;
VScaledEllipse *GetPoint(quint32 i, const QColor &color);
VCurvePathItem *GetCurve(quint32 i, const QColor &color);
template <class Item> template <class Item>
int AddFlippedCurve(const QPointF &firstPoint, const QPointF &secondPoint, quint32 id, int i); auto AddFlippedCurve(quint32 originPointId, const QPointF &firstPoint, const QPointF &secondPoint, quint32 id,
int i) -> int;
void RefreshFlippedObjects(const QPointF &firstPoint, const QPointF &secondPoint); void RefreshFlippedObjects(quint32 originPointId, const QPointF &firstPoint, const QPointF &secondPoint);
auto Objects() const -> const QVector<quint32> &;
private: private:
Q_DISABLE_COPY_MOVE(VisOperation) // NOLINT Q_DISABLE_COPY_MOVE(VisOperation) // NOLINT
QVector<quint32> m_objects{};
QVector<VScaledEllipse *> m_points{};
QVector<VCurvePathItem *> m_curves{};
}; };
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
template <class Item> template <class Item>
int VisOperation::AddFlippedCurve(const QPointF &firstPoint, const QPointF &secondPoint, quint32 id, int i) auto VisOperation::AddFlippedCurve(quint32 originPointId, const QPointF &firstPoint, const QPointF &secondPoint,
quint32 id, int i) -> int
{ {
const QSharedPointer<Item> curve = Visualization::data->template GeometricObject<Item>(id); const QSharedPointer<Item> curve = GetData()->template GeometricObject<Item>(id);
++i; ++i;
VCurvePathItem *path = GetCurve(static_cast<quint32>(i), supportColor2); VCurvePathItem *path = GetCurve(static_cast<quint32>(i), Color(VColor::SupportColor2));
DrawPath(path, curve->GetPath(), curve->DirectionArrows(), supportColor2, Qt::SolidLine, Qt::RoundCap); DrawPath(path, curve->GetPath(), curve->DirectionArrows(), Color(VColor::SupportColor2), Qt::SolidLine,
Qt::RoundCap);
++i; ++i;
path = GetCurve(static_cast<quint32>(i), supportColor); path = GetCurve(static_cast<quint32>(i), Color(VColor::SupportColor));
if (object1Id != NULL_ID) if (originPointId != NULL_ID)
{ {
const Item flipped = curve->Flip(QLineF(firstPoint, secondPoint)); const Item flipped = curve->Flip(QLineF(firstPoint, secondPoint));
DrawPath(path, flipped.GetPath(), flipped.DirectionArrows(), supportColor, Qt::SolidLine, Qt::RoundCap); DrawPath(path, flipped.GetPath(), flipped.DirectionArrows(), Color(VColor::SupportColor), Qt::SolidLine,
Qt::RoundCap);
} }
return i; return i;
} }
//---------------------------------------------------------------------------------------------------------------------
inline auto VisOperation::Objects() const -> const QVector<quint32> &
{
return m_objects;
}
#endif // VISOPERATION_H #endif // VISOPERATION_H

View File

@ -31,17 +31,15 @@
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
VisToolFlippingByAxis::VisToolFlippingByAxis(const VContainer *data, QGraphicsItem *parent) VisToolFlippingByAxis::VisToolFlippingByAxis(const VContainer *data, QGraphicsItem *parent)
: VisOperation(data, parent), : VisOperation(data, parent)
m_axisType(AxisType::VerticalAxis),
point1(nullptr)
{ {
point1 = InitPoint(supportColor2, this); m_point1 = InitPoint(Color(VColor::SupportColor2), this);
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void VisToolFlippingByAxis::RefreshGeometry() void VisToolFlippingByAxis::RefreshGeometry()
{ {
if (objects.isEmpty()) if (Objects().isEmpty())
{ {
return; return;
} }
@ -49,10 +47,10 @@ void VisToolFlippingByAxis::RefreshGeometry()
QPointF firstPoint; QPointF firstPoint;
QPointF secondPoint; QPointF secondPoint;
if (object1Id != NULL_ID) if (m_originPointId != NULL_ID)
{ {
firstPoint = static_cast<QPointF>(*Visualization::data->GeometricObject<VPointF>(object1Id)); firstPoint = static_cast<QPointF>(*GetData()->GeometricObject<VPointF>(m_originPointId));
DrawPoint(point1, firstPoint, supportColor2); DrawPoint(m_point1, firstPoint, Color(VColor::SupportColor2));
if (m_axisType == AxisType::VerticalAxis) if (m_axisType == AxisType::VerticalAxis)
{ {
@ -63,20 +61,8 @@ void VisToolFlippingByAxis::RefreshGeometry()
secondPoint = QPointF(firstPoint.x() + 100, firstPoint.y()); secondPoint = QPointF(firstPoint.x() + 100, firstPoint.y());
} }
DrawLine(this, Axis(firstPoint, secondPoint), supportColor2, Qt::DashLine); DrawLine(this, Axis(firstPoint, secondPoint), Color(VColor::SupportColor2), Qt::DashLine);
} }
RefreshFlippedObjects(firstPoint, secondPoint); RefreshFlippedObjects(m_originPointId, firstPoint, secondPoint);
}
//---------------------------------------------------------------------------------------------------------------------
void VisToolFlippingByAxis::SetOriginPointId(quint32 value)
{
object1Id = value;
}
//---------------------------------------------------------------------------------------------------------------------
void VisToolFlippingByAxis::SetAxisType(AxisType value)
{
m_axisType = value;
} }

View File

@ -39,22 +39,36 @@ class VisToolFlippingByAxis : public VisOperation
Q_OBJECT // NOLINT Q_OBJECT // NOLINT
public: public:
explicit VisToolFlippingByAxis(const VContainer *data, QGraphicsItem *parent = nullptr); explicit VisToolFlippingByAxis(const VContainer *data, QGraphicsItem *parent = nullptr);
virtual ~VisToolFlippingByAxis() = default; ~VisToolFlippingByAxis() override = default;
virtual void RefreshGeometry() override; void RefreshGeometry() override;
void SetOriginPointId(quint32 value); void SetOriginPointId(quint32 value);
void SetAxisType(AxisType value); void SetAxisType(AxisType value);
virtual int type() const override {return Type;} auto type() const -> int override {return Type;}
enum { Type = UserType + static_cast<int>(Vis::ToolFlippingByAxis)}; enum {Type = UserType + static_cast<int>(Vis::ToolFlippingByAxis)};
private: private:
// cppcheck-suppress unknownMacro // cppcheck-suppress unknownMacro
Q_DISABLE_COPY_MOVE(VisToolFlippingByAxis) // NOLINT Q_DISABLE_COPY_MOVE(VisToolFlippingByAxis) // NOLINT
AxisType m_axisType; AxisType m_axisType{AxisType::VerticalAxis};
VScaledEllipse *point1; VScaledEllipse *m_point1{nullptr};
quint32 m_originPointId{NULL_ID};
}; };
//---------------------------------------------------------------------------------------------------------------------
inline void VisToolFlippingByAxis::SetOriginPointId(quint32 value)
{
m_originPointId = value;
}
//---------------------------------------------------------------------------------------------------------------------
inline void VisToolFlippingByAxis::SetAxisType(AxisType value)
{
m_axisType = value;
}
#endif // VISTOOLFLIPPINGBYAXIS_H #endif // VISTOOLFLIPPINGBYAXIS_H

View File

@ -31,19 +31,16 @@
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
VisToolFlippingByLine::VisToolFlippingByLine(const VContainer *data, QGraphicsItem *parent) VisToolFlippingByLine::VisToolFlippingByLine(const VContainer *data, QGraphicsItem *parent)
: VisOperation(data, parent), : VisOperation(data, parent)
object2Id(NULL_ID),
point1(nullptr),
point2(nullptr)
{ {
point1 = InitPoint(supportColor2, this); m_point1 = InitPoint(Color(VColor::SupportColor2), this);
point2 = InitPoint(supportColor2, this); m_point2 = InitPoint(Color(VColor::SupportColor2), this);
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void VisToolFlippingByLine::RefreshGeometry() void VisToolFlippingByLine::RefreshGeometry()
{ {
if (objects.isEmpty()) if (Objects().isEmpty())
{ {
return; return;
} }
@ -51,35 +48,23 @@ void VisToolFlippingByLine::RefreshGeometry()
QPointF firstPoint; QPointF firstPoint;
QPointF secondPoint; QPointF secondPoint;
if (object1Id != NULL_ID) if (m_lineP1Id != NULL_ID)
{ {
firstPoint = static_cast<QPointF>(*Visualization::data->GeometricObject<VPointF>(object1Id)); firstPoint = static_cast<QPointF>(*GetData()->GeometricObject<VPointF>(m_lineP1Id));
DrawPoint(point1, firstPoint, supportColor2); DrawPoint(m_point1, firstPoint, Color(VColor::SupportColor2));
if (object2Id == NULL_ID) if (m_lineP2Id == NULL_ID)
{ {
secondPoint = Visualization::scenePos; secondPoint = ScenePos();
} }
else else
{ {
secondPoint = static_cast<QPointF>(*Visualization::data->GeometricObject<VPointF>(object2Id)); secondPoint = static_cast<QPointF>(*GetData()->GeometricObject<VPointF>(m_lineP2Id));
DrawPoint(point2, secondPoint, supportColor2); DrawPoint(m_point2, secondPoint, Color(VColor::SupportColor2));
} }
DrawLine(this, QLineF(firstPoint, secondPoint), supportColor2, Qt::DashLine); DrawLine(this, QLineF(firstPoint, secondPoint), Color(VColor::SupportColor2), Qt::DashLine);
} }
RefreshFlippedObjects(firstPoint, secondPoint); RefreshFlippedObjects(m_lineP1Id, firstPoint, secondPoint);
}
//---------------------------------------------------------------------------------------------------------------------
void VisToolFlippingByLine::SetFirstLinePointId(quint32 value)
{
object1Id = value;
}
//---------------------------------------------------------------------------------------------------------------------
void VisToolFlippingByLine::SetSecondLinePointId(quint32 value)
{
object2Id = value;
} }

View File

@ -38,21 +38,34 @@ class VisToolFlippingByLine : public VisOperation
Q_OBJECT // NOLINT Q_OBJECT // NOLINT
public: public:
explicit VisToolFlippingByLine(const VContainer *data, QGraphicsItem *parent = nullptr); explicit VisToolFlippingByLine(const VContainer *data, QGraphicsItem *parent = nullptr);
virtual ~VisToolFlippingByLine() = default; ~VisToolFlippingByLine() override = default;
virtual void RefreshGeometry() override; void RefreshGeometry() override;
void SetFirstLinePointId(quint32 value); void SetFirstLinePointId(quint32 value);
void SetSecondLinePointId(quint32 value); void SetSecondLinePointId(quint32 value);
virtual int type() const override {return Type;} auto type() const -> int override {return Type;}
enum { Type = UserType + static_cast<int>(Vis::ToolFlippingByLine)}; enum { Type = UserType + static_cast<int>(Vis::ToolFlippingByLine)};
private: private:
// cppcheck-suppress unknownMacro // cppcheck-suppress unknownMacro
Q_DISABLE_COPY_MOVE(VisToolFlippingByLine) // NOLINT Q_DISABLE_COPY_MOVE(VisToolFlippingByLine) // NOLINT
quint32 object2Id; quint32 m_lineP1Id{NULL_ID};
VScaledEllipse *point1; quint32 m_lineP2Id{NULL_ID};
VScaledEllipse *point2; VScaledEllipse *m_point1{nullptr};
VScaledEllipse *m_point2{nullptr};
}; };
//---------------------------------------------------------------------------------------------------------------------
inline void VisToolFlippingByLine::SetFirstLinePointId(quint32 value)
{
m_lineP1Id = value;
}
//---------------------------------------------------------------------------------------------------------------------
inline void VisToolFlippingByLine::SetSecondLinePointId(quint32 value)
{
m_lineP2Id = value;
}
#endif // VISTOOLFLIPPINGBYLINE_H #endif // VISTOOLFLIPPINGBYLINE_H

View File

@ -62,29 +62,20 @@
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
VisToolMove::VisToolMove(const VContainer *data, QGraphicsItem *parent) VisToolMove::VisToolMove(const VContainer *data, QGraphicsItem *parent)
: VisOperation(data, parent), : VisOperation(data, parent)
angle(0),
rotationAngle(INT_MIN),
length(0),
pointOrigin(nullptr),
pointRotationOrigin(nullptr),
pointFinish(nullptr),
angleArc(nullptr),
rotationLine(nullptr),
xAxis(nullptr)
{ {
pointOrigin = InitPoint(supportColor2, this); m_pointOrigin = InitPoint(Color(VColor::SupportColor2), this);
pointRotationOrigin = InitPoint(supportColor2, this); m_pointRotationOrigin = InitPoint(Color(VColor::SupportColor2), this);
pointFinish = InitPoint(supportColor, this); m_pointFinish = InitPoint(Color(VColor::SupportColor), this);
angleArc = InitItem<VCurvePathItem>(supportColor3, this); m_angleArc = InitItem<VCurvePathItem>(Color(VColor::SupportColor3), this);
rotationLine = InitItem<VScaledLine>(supportColor3, this); m_rotationLine = InitItem<VScaledLine>(Color(VColor::SupportColor3), this);
xAxis = InitItem<VScaledLine>(supportColor3, this); m_xAxis = InitItem<VScaledLine>(Color(VColor::SupportColor3), this);
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void VisToolMove::RefreshGeometry() void VisToolMove::RefreshGeometry()
{ {
if (objects.isEmpty()) if (Objects().isEmpty())
{ {
return; return;
} }
@ -95,23 +86,23 @@ void VisToolMove::RefreshGeometry()
const QVector<QGraphicsItem *> originObjects = CreateOriginObjects(iPoint, iCurve); const QVector<QGraphicsItem *> originObjects = CreateOriginObjects(iPoint, iCurve);
QPointF origin = GetOriginPoint(originObjects); QPointF origin = GetOriginPoint(originObjects);
DrawPoint(pointOrigin, origin, supportColor2); DrawPoint(m_pointOrigin, origin, Color(VColor::SupportColor2));
qreal tempAngle = 0; qreal tempAngle = 0;
qreal tempLength = 0; qreal tempLength = 0;
qreal tempRoationAngle = 0; qreal tempRoationAngle = 0;
QLineF line; QLineF line;
if (qFuzzyIsNull(length)) if (qFuzzyIsNull(m_length))
{ {
if (QGuiApplication::keyboardModifiers() == Qt::ShiftModifier) if (QGuiApplication::keyboardModifiers() == Qt::ShiftModifier)
{ {
line = QLineF(origin, Visualization::scenePos); line = QLineF(origin, ScenePos());
line.setAngle(CorrectAngle(line.angle())); line.setAngle(CorrectAngle(line.angle()));
} }
else else
{ {
line = QLineF(origin, Visualization::scenePos); line = QLineF(origin, ScenePos());
} }
tempAngle = line.angle(); tempAngle = line.angle();
@ -119,25 +110,25 @@ void VisToolMove::RefreshGeometry()
} }
else else
{ {
line = VGObject::BuildLine(origin, length, angle); line = VGObject::BuildLine(origin, m_length, m_angle);
tempAngle = angle; tempAngle = m_angle;
tempLength = length; tempLength = m_length;
if (object1Id != NULL_ID) if (m_rotationOriginId != NULL_ID)
{ {
origin = Visualization::data->GeometricObject<VPointF>(object1Id)->toQPointF(); origin = GetData()->GeometricObject<VPointF>(m_rotationOriginId)->toQPointF();
DrawPoint(pointRotationOrigin, origin, supportColor2); DrawPoint(m_pointRotationOrigin, origin, Color(VColor::SupportColor2));
} }
else else
{ {
origin = line.p2(); origin = line.p2();
pointRotationOrigin->setVisible(false); m_pointRotationOrigin->setVisible(false);
} }
QLineF rLine; QLineF rLine;
if (VFuzzyComparePossibleNulls(rotationAngle, INT_MIN)) if (VFuzzyComparePossibleNulls(m_rotationAngle, INT_MIN))
{ {
rLine = QLineF(origin, Visualization::scenePos); rLine = QLineF(origin, ScenePos());
if (QGuiApplication::keyboardModifiers() == Qt::ShiftModifier) if (QGuiApplication::keyboardModifiers() == Qt::ShiftModifier)
{ {
@ -159,48 +150,48 @@ void VisToolMove::RefreshGeometry()
} }
else else
{ {
rLine = QLineF(origin, Ray(origin, rotationAngle)); rLine = QLineF(origin, Ray(origin, m_rotationAngle));
tempRoationAngle = rotationAngle; tempRoationAngle = m_rotationAngle;
} }
DrawLine(rotationLine, rLine, supportColor3, Qt::DashLine); DrawLine(m_rotationLine, rLine, Color(VColor::SupportColor3), Qt::DashLine);
DrawLine(xAxis, QLineF(origin, Ray(origin, 0)), supportColor3, Qt::DashLine); DrawLine(m_xAxis, QLineF(origin, Ray(origin, 0)), Color(VColor::SupportColor3), Qt::DashLine);
VArc arc(VPointF(origin), VArc arc(VPointF(origin),
ScaledRadius(SceneScale(VAbstractValApplication::VApp()->getCurrentScene()))*2, 0, tempRoationAngle); ScaledRadius(SceneScale(VAbstractValApplication::VApp()->getCurrentScene()))*2, 0, tempRoationAngle);
DrawPath(angleArc, arc.GetPath(), supportColor3, Qt::SolidLine, Qt::RoundCap); DrawPath(m_angleArc, arc.GetPath(), Color(VColor::SupportColor3), Qt::SolidLine, Qt::RoundCap);
} }
DrawLine(this, line, supportColor2, Qt::DashLine); DrawLine(this, line, Color(VColor::SupportColor2), Qt::DashLine);
DrawPoint(pointFinish, line.p2(), supportColor); DrawPoint(m_pointFinish, line.p2(), Color(VColor::SupportColor));
static const QString prefix = UnitsToStr(VAbstractValApplication::VApp()->patternUnits(), true); static const QString prefix = UnitsToStr(VAbstractValApplication::VApp()->patternUnits(), true);
if (qFuzzyIsNull(length)) if (qFuzzyIsNull(m_length))
{ {
Visualization::toolTip = tr("Length = %1%2, angle = %3°, <b>%4</b> - sticking angle, " SetToolTip(tr("Length = %1%2, angle = %3°, <b>%4</b> - sticking angle, "
"<b>Mouse click</b> - finish selecting a position") "<b>Mouse click</b> - finish selecting a position")
.arg(VAbstractApplication::VApp()->TrVars()->FormulaToUser( .arg(VAbstractApplication::VApp()->TrVars()->FormulaToUser(
QString::number(VAbstractValApplication::VApp()->fromPixel(tempLength)), QString::number(VAbstractValApplication::VApp()->fromPixel(tempLength)),
VAbstractApplication::VApp()->Settings()->GetOsSeparator()), prefix) VAbstractApplication::VApp()->Settings()->GetOsSeparator()), prefix)
.arg(tempAngle) .arg(tempAngle)
.arg(VModifierKey::Shift()); .arg(VModifierKey::Shift()));
} }
else else
{ {
Visualization::toolTip = tr("Length = %1%2, angle = %3°, rotation angle = %4°, <b>%5</b> - sticking angle, " SetToolTip(tr("Length = %1%2, angle = %3°, rotation angle = %4°, <b>%5</b> - sticking angle, "
"<b>%6</b> - change rotation origin point, <b>Mouse click</b> - finish creating") "<b>%6</b> - change rotation origin point, <b>Mouse click</b> - finish creating")
.arg(VAbstractApplication::VApp()->TrVars()->FormulaToUser( .arg(VAbstractApplication::VApp()->TrVars()->FormulaToUser(
QString::number(VAbstractValApplication::VApp()->fromPixel(tempLength)), QString::number(VAbstractValApplication::VApp()->fromPixel(tempLength)),
VAbstractApplication::VApp()->Settings()->GetOsSeparator()), prefix) VAbstractApplication::VApp()->Settings()->GetOsSeparator()), prefix)
.arg(tempAngle) .arg(tempAngle)
.arg(tempRoationAngle) .arg(tempRoationAngle)
.arg(VModifierKey::Shift(), VModifierKey::Control()); .arg(VModifierKey::Shift(), VModifierKey::Control()));
} }
CreateMovedRotatedObjects(iPoint, iCurve, tempLength, tempAngle, tempRoationAngle, origin); CreateMovedRotatedObjects(iPoint, iCurve, tempLength, tempAngle, tempRoationAngle, origin);
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
QString VisToolMove::Angle() const auto VisToolMove::Angle() const -> QString
{ {
return QString::number(line().angle()); return QString::number(line().angle());
} }
@ -208,29 +199,29 @@ QString VisToolMove::Angle() const
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void VisToolMove::SetAngle(const QString &expression) void VisToolMove::SetAngle(const QString &expression)
{ {
angle = FindValFromUser(expression, Visualization::data->DataVariables()); m_angle = FindValFromUser(expression, GetData()->DataVariables());
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
QString VisToolMove::RotationAngle() const auto VisToolMove::RotationAngle() const -> QString
{ {
return QString::number(rotationLine->line().angle()); return QString::number(m_rotationLine->line().angle());
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void VisToolMove::SetRotationAngle(const QString &expression) void VisToolMove::SetRotationAngle(const QString &expression)
{ {
rotationAngle = FindValFromUser(expression, Visualization::data->DataVariables()); m_rotationAngle = FindValFromUser(expression, GetData()->DataVariables());
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
QString VisToolMove::Length() const auto VisToolMove::Length() const -> QString
{ {
return QString::number(LengthValue()); return QString::number(LengthValue());
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
qreal VisToolMove::LengthValue() const auto VisToolMove::LengthValue() const -> qreal
{ {
return VAbstractValApplication::VApp()->fromPixel(line().length()); return VAbstractValApplication::VApp()->fromPixel(line().length());
} }
@ -238,48 +229,43 @@ qreal VisToolMove::LengthValue() const
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void VisToolMove::SetLength(const QString &expression) void VisToolMove::SetLength(const QString &expression)
{ {
length = FindLengthFromUser(expression, Visualization::data->DataVariables()); m_length = FindLengthFromUser(expression, GetData()->DataVariables());
}
//---------------------------------------------------------------------------------------------------------------------
void VisToolMove::SetRotationOriginPointId(quint32 value)
{
object1Id = value;
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
template <class Item> template <class Item>
QGraphicsPathItem *VisToolMove::AddOriginCurve(quint32 id, int &i) auto VisToolMove::AddOriginCurve(quint32 id, int &i) -> QGraphicsPathItem *
{ {
const QSharedPointer<Item> curve = Visualization::data->template GeometricObject<Item>(id); const QSharedPointer<Item> curve = GetData()->template GeometricObject<Item>(id);
++i; ++i;
VCurvePathItem *path = GetCurve(static_cast<quint32>(i), supportColor2); VCurvePathItem *path = GetCurve(static_cast<quint32>(i), Color(VColor::SupportColor2));
DrawPath(path, curve->GetPath(), curve->DirectionArrows(), supportColor2, Qt::SolidLine, Qt::RoundCap); DrawPath(path, curve->GetPath(), curve->DirectionArrows(), Color(VColor::SupportColor2), Qt::SolidLine,
Qt::RoundCap);
return path; return path;
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
template <class Item> template <class Item>
int VisToolMove::AddMovedRotatedCurve(qreal angle, qreal length, quint32 id, int i, qreal rotationAngle, auto VisToolMove::AddMovedRotatedCurve(qreal angle, qreal length, quint32 id, int i, qreal rotationAngle,
const QPointF &rotationOrigin) const QPointF &rotationOrigin) -> int
{ {
const QSharedPointer<Item> curve = Visualization::data->template GeometricObject<Item>(id); const QSharedPointer<Item> curve = GetData()->template GeometricObject<Item>(id);
++i; ++i;
VCurvePathItem *path = GetCurve(static_cast<quint32>(i), supportColor); VCurvePathItem *path = GetCurve(static_cast<quint32>(i), Color(VColor::SupportColor));
const Item moved = curve->Move(length, angle).Rotate(rotationOrigin, rotationAngle); const Item moved = curve->Move(length, angle).Rotate(rotationOrigin, rotationAngle);
DrawPath(path, moved.GetPath(), moved.DirectionArrows(), supportColor, Qt::SolidLine, Qt::RoundCap); DrawPath(path, moved.GetPath(), moved.DirectionArrows(), Color(VColor::SupportColor), Qt::SolidLine, Qt::RoundCap);
return i; return i;
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
QPointF VisToolMove::GetOriginPoint(const QVector<QGraphicsItem *> &objects) auto VisToolMove::GetOriginPoint(const QVector<QGraphicsItem *> &objects) -> QPointF
{ {
QRectF boundingRect; QRectF boundingRect;
for (auto object : qAsConst(objects)) for (auto *object : qAsConst(objects))
{ {
if (object) if (object)
{ {
@ -303,13 +289,14 @@ QPointF VisToolMove::GetOriginPoint(const QVector<QGraphicsItem *> &objects)
QT_WARNING_PUSH QT_WARNING_PUSH
QT_WARNING_DISABLE_GCC("-Wswitch-default") QT_WARNING_DISABLE_GCC("-Wswitch-default")
QVector<QGraphicsItem *> VisToolMove::CreateOriginObjects(int &iPoint, int &iCurve) auto VisToolMove::CreateOriginObjects(int &iPoint, int &iCurve) -> QVector<QGraphicsItem *>
{ {
QVector<QGraphicsItem *> originObjects; QVector<QGraphicsItem *> originObjects;
originObjects.reserve(Objects().size());
for (auto id : qAsConst(objects)) for (auto id : Objects())
{ {
const QSharedPointer<VGObject> obj = Visualization::data->GetGObject(id); const QSharedPointer<VGObject> obj = GetData()->GetGObject(id);
// This check helps to find missed objects in the switch // This check helps to find missed objects in the switch
Q_STATIC_ASSERT_X(static_cast<int>(GOType::Unknown) == 8, "Not all objects were handled."); Q_STATIC_ASSERT_X(static_cast<int>(GOType::Unknown) == 8, "Not all objects were handled.");
@ -318,11 +305,11 @@ QVector<QGraphicsItem *> VisToolMove::CreateOriginObjects(int &iPoint, int &iCur
{ {
case GOType::Point: case GOType::Point:
{ {
const QSharedPointer<VPointF> p = Visualization::data->GeometricObject<VPointF>(id); const QSharedPointer<VPointF> p = GetData()->GeometricObject<VPointF>(id);
++iPoint; ++iPoint;
VScaledEllipse *point = GetPoint(static_cast<quint32>(iPoint), supportColor2); VScaledEllipse *point = GetPoint(static_cast<quint32>(iPoint), Color(VColor::SupportColor2));
DrawPoint(point, static_cast<QPointF>(*p), supportColor2); DrawPoint(point, static_cast<QPointF>(*p), Color(VColor::SupportColor2));
originObjects.append(point); originObjects.append(point);
break; break;
@ -364,9 +351,9 @@ QT_WARNING_DISABLE_GCC("-Wswitch-default")
void VisToolMove::CreateMovedRotatedObjects(int &iPoint, int &iCurve, qreal length, qreal angle, qreal rotationAngle, void VisToolMove::CreateMovedRotatedObjects(int &iPoint, int &iCurve, qreal length, qreal angle, qreal rotationAngle,
const QPointF &rotationOrigin) const QPointF &rotationOrigin)
{ {
for (auto id : qAsConst(objects)) for (auto id : Objects())
{ {
const QSharedPointer<VGObject> obj = Visualization::data->GetGObject(id); const QSharedPointer<VGObject> obj = GetData()->GetGObject(id);
// This check helps to find missed objects in the switch // This check helps to find missed objects in the switch
Q_STATIC_ASSERT_X(static_cast<int>(GOType::Unknown) == 8, "Not all objects was handled."); Q_STATIC_ASSERT_X(static_cast<int>(GOType::Unknown) == 8, "Not all objects was handled.");
@ -375,12 +362,12 @@ void VisToolMove::CreateMovedRotatedObjects(int &iPoint, int &iCurve, qreal leng
{ {
case GOType::Point: case GOType::Point:
{ {
const QSharedPointer<VPointF> p = Visualization::data->GeometricObject<VPointF>(id); const QSharedPointer<VPointF> p = GetData()->GeometricObject<VPointF>(id);
++iPoint; ++iPoint;
VScaledEllipse *point = GetPoint(static_cast<quint32>(iPoint), supportColor); VScaledEllipse *point = GetPoint(static_cast<quint32>(iPoint), Color(VColor::SupportColor));
DrawPoint(point, static_cast<QPointF>(p->Move(length, angle).Rotate(rotationOrigin, rotationAngle)), DrawPoint(point, static_cast<QPointF>(p->Move(length, angle).Rotate(rotationOrigin, rotationAngle)),
supportColor); Color(VColor::SupportColor));
break; break;
} }
case GOType::Arc: case GOType::Arc:

View File

@ -39,7 +39,6 @@
#include <QVector> #include <QVector>
#include <QtGlobal> #include <QtGlobal>
#include "../ifc/ifcdef.h"
#include "../vmisc/def.h" #include "../vmisc/def.h"
#include "visoperation.h" #include "visoperation.h"
@ -48,49 +47,56 @@ class VisToolMove : public VisOperation
Q_OBJECT // NOLINT Q_OBJECT // NOLINT
public: public:
explicit VisToolMove(const VContainer *data, QGraphicsItem *parent = nullptr); explicit VisToolMove(const VContainer *data, QGraphicsItem *parent = nullptr);
virtual ~VisToolMove() = default; ~VisToolMove() override = default;
virtual void RefreshGeometry() override; void RefreshGeometry() override;
QString Angle() const; auto Angle() const -> QString;
void SetAngle(const QString &expression); void SetAngle(const QString &expression);
QString RotationAngle() const; auto RotationAngle() const -> QString;
void SetRotationAngle(const QString &expression); void SetRotationAngle(const QString &expression);
QString Length() const; auto Length() const -> QString;
qreal LengthValue() const; auto LengthValue() const -> qreal;
void SetLength(const QString &expression); void SetLength(const QString &expression);
void SetRotationOriginPointId(quint32 value); void SetRotationOriginPointId(quint32 value);
virtual int type() const override {return Type;} auto type() const -> int override {return Type;}
enum { Type = UserType + static_cast<int>(Vis::ToolMove)}; enum {Type = UserType + static_cast<int>(Vis::ToolMove)};
private: private:
// cppcheck-suppress unknownMacro // cppcheck-suppress unknownMacro
Q_DISABLE_COPY_MOVE(VisToolMove) // NOLINT Q_DISABLE_COPY_MOVE(VisToolMove) // NOLINT
qreal angle; qreal m_angle{0};
qreal rotationAngle; qreal m_rotationAngle{INT_MIN};
qreal length; qreal m_length{0};
VScaledEllipse *pointOrigin; VScaledEllipse *m_pointOrigin{nullptr};
VScaledEllipse *pointRotationOrigin; VScaledEllipse *m_pointRotationOrigin{nullptr};
VScaledEllipse *pointFinish; VScaledEllipse *m_pointFinish{nullptr};
VCurvePathItem *angleArc; VCurvePathItem *m_angleArc{nullptr};
VScaledLine *rotationLine; VScaledLine *m_rotationLine{nullptr};
VScaledLine *xAxis; VScaledLine *m_xAxis{nullptr};
quint32 m_rotationOriginId{NULL_ID};
template <class Item> template <class Item>
QGraphicsPathItem *AddOriginCurve(quint32 id, int &i); auto AddOriginCurve(quint32 id, int &i) -> QGraphicsPathItem *;
template <class Item> template <class Item>
int AddMovedRotatedCurve(qreal angle, qreal length, quint32 id, int i, qreal rotationAngle, auto AddMovedRotatedCurve(qreal angle, qreal length, quint32 id, int i, qreal rotationAngle,
const QPointF &rotationOrigin); const QPointF &rotationOrigin) -> int;
static QPointF GetOriginPoint(const QVector<QGraphicsItem *> &objects); static auto GetOriginPoint(const QVector<QGraphicsItem *> &objects) -> QPointF;
QVector<QGraphicsItem *> CreateOriginObjects(int &iPoint, int &iCurve); auto CreateOriginObjects(int &iPoint, int &iCurve) -> QVector<QGraphicsItem *>;
void CreateMovedRotatedObjects(int &iPoint, int &iCurve, qreal length, qreal angle, qreal rotationAngle, void CreateMovedRotatedObjects(int &iPoint, int &iCurve, qreal length, qreal angle, qreal rotationAngle,
const QPointF &rotationOrigin); const QPointF &rotationOrigin);
}; };
//---------------------------------------------------------------------------------------------------------------------
inline void VisToolMove::SetRotationOriginPointId(quint32 value)
{
m_rotationOriginId = value;
}
#endif // VISTOOLMOVE_H #endif // VISTOOLMOVE_H

View File

@ -59,20 +59,11 @@
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
VisToolRotation::VisToolRotation(const VContainer *data, QGraphicsItem *parent) VisToolRotation::VisToolRotation(const VContainer *data, QGraphicsItem *parent)
: VisOperation(data, parent), : VisOperation(data, parent)
angle(INT_MIN),
point(nullptr),
angleArc(nullptr),
xAxis(nullptr)
{
point = InitPoint(supportColor2, this);
angleArc = InitItem<VCurvePathItem>(supportColor2, this);
xAxis = InitItem<VScaledLine>(supportColor2, this);
}
//---------------------------------------------------------------------------------------------------------------------
VisToolRotation::~VisToolRotation()
{ {
m_point = InitPoint(Color(VColor::SupportColor2), this);
m_angleArc = InitItem<VCurvePathItem>(Color(VColor::SupportColor2), this);
m_xAxis = InitItem<VScaledLine>(Color(VColor::SupportColor2), this);
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
@ -81,7 +72,7 @@ QT_WARNING_DISABLE_GCC("-Wswitch-default")
void VisToolRotation::RefreshGeometry() void VisToolRotation::RefreshGeometry()
{ {
if (objects.isEmpty()) if (Objects().isEmpty())
{ {
return; return;
} }
@ -90,15 +81,15 @@ void VisToolRotation::RefreshGeometry()
qreal tempAngle = 0; qreal tempAngle = 0;
if (object1Id != NULL_ID) if (m_originPointId != NULL_ID)
{ {
origin = Visualization::data->GeometricObject<VPointF>(object1Id); origin = GetData()->GeometricObject<VPointF>(m_originPointId);
DrawPoint(point, static_cast<QPointF>(*origin), supportColor2); DrawPoint(m_point, static_cast<QPointF>(*origin), Color(VColor::SupportColor2));
QLineF rLine; QLineF rLine;
if (VFuzzyComparePossibleNulls(angle, INT_MIN)) if (VFuzzyComparePossibleNulls(m_angle, INT_MIN))
{ {
rLine = QLineF(static_cast<QPointF>(*origin), Visualization::scenePos); rLine = QLineF(static_cast<QPointF>(*origin), ScenePos());
if (QGuiApplication::keyboardModifiers() == Qt::ShiftModifier) if (QGuiApplication::keyboardModifiers() == Qt::ShiftModifier)
{ {
@ -110,28 +101,28 @@ void VisToolRotation::RefreshGeometry()
} }
else else
{ {
rLine = QLineF(static_cast<QPointF>(*origin), Ray(static_cast<QPointF>(*origin), angle)); rLine = QLineF(static_cast<QPointF>(*origin), Ray(static_cast<QPointF>(*origin), m_angle));
tempAngle = angle; tempAngle = m_angle;
} }
DrawLine(this, rLine, supportColor2, Qt::DashLine); DrawLine(this, rLine, Color(VColor::SupportColor2), Qt::DashLine);
DrawLine(xAxis, QLineF(static_cast<QPointF>(*origin), Ray(static_cast<QPointF>(*origin), 0)), supportColor2, DrawLine(m_xAxis, QLineF(static_cast<QPointF>(*origin), Ray(static_cast<QPointF>(*origin), 0)),
Qt::DashLine); Color(VColor::SupportColor2), Qt::DashLine);
VArc arc(*origin, ScaledRadius(SceneScale(VAbstractValApplication::VApp()->getCurrentScene()))*2, 0, tempAngle); VArc arc(*origin, ScaledRadius(SceneScale(VAbstractValApplication::VApp()->getCurrentScene()))*2, 0, tempAngle);
DrawPath(angleArc, arc.GetPath(), supportColor2, Qt::SolidLine, Qt::RoundCap); DrawPath(m_angleArc, arc.GetPath(), Color(VColor::SupportColor2), Qt::SolidLine, Qt::RoundCap);
Visualization::toolTip = tr("Rotating angle = %1°, <b>%2</b> - sticking angle, " SetToolTip(tr("Rotating angle = %1°, <b>%2</b> - sticking angle, "
"<b>Mouse click</b> - finish creation") "<b>Mouse click</b> - finish creation")
.arg(tempAngle) .arg(tempAngle)
.arg(VModifierKey::Shift()); .arg(VModifierKey::Shift()));
} }
int iPoint = -1; int iPoint = -1;
int iCurve = -1; int iCurve = -1;
for (auto id : qAsConst(objects)) for (auto id : Objects())
{ {
const QSharedPointer<VGObject> obj = Visualization::data->GetGObject(id); const QSharedPointer<VGObject> obj = GetData()->GetGObject(id);
// This check helps to find missed objects in the switch // This check helps to find missed objects in the switch
Q_STATIC_ASSERT_X(static_cast<int>(GOType::Unknown) == 8, "Not all objects was handled."); Q_STATIC_ASSERT_X(static_cast<int>(GOType::Unknown) == 8, "Not all objects was handled.");
@ -140,19 +131,19 @@ void VisToolRotation::RefreshGeometry()
{ {
case GOType::Point: case GOType::Point:
{ {
const QSharedPointer<VPointF> p = Visualization::data->GeometricObject<VPointF>(id); const QSharedPointer<VPointF> p = GetData()->GeometricObject<VPointF>(id);
++iPoint; ++iPoint;
VScaledEllipse *point = GetPoint(static_cast<quint32>(iPoint), supportColor2); VScaledEllipse *point = GetPoint(static_cast<quint32>(iPoint), Color(VColor::SupportColor2));
DrawPoint(point, static_cast<QPointF>(*p), supportColor2); DrawPoint(point, static_cast<QPointF>(*p), Color(VColor::SupportColor2));
++iPoint; ++iPoint;
point = GetPoint(static_cast<quint32>(iPoint), supportColor); point = GetPoint(static_cast<quint32>(iPoint), Color(VColor::SupportColor));
if (object1Id != NULL_ID) if (m_originPointId != NULL_ID)
{ {
DrawPoint(point, static_cast<QPointF>(p->Rotate(static_cast<QPointF>(*origin), tempAngle)), DrawPoint(point, static_cast<QPointF>(p->Rotate(static_cast<QPointF>(*origin), tempAngle)),
supportColor); Color(VColor::SupportColor));
} }
break; break;
} }
@ -193,16 +184,11 @@ void VisToolRotation::RefreshGeometry()
} }
} }
} }
QT_WARNING_POP QT_WARNING_POP
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void VisToolRotation::SetOriginPointId(quint32 value) auto VisToolRotation::Angle() const -> QString
{
object1Id = value;
}
//---------------------------------------------------------------------------------------------------------------------
QString VisToolRotation::Angle() const
{ {
return QString::number(line().angle()); return QString::number(line().angle());
} }
@ -210,25 +196,27 @@ QString VisToolRotation::Angle() const
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void VisToolRotation::SetAngle(const QString &expression) void VisToolRotation::SetAngle(const QString &expression)
{ {
angle = FindValFromUser(expression, Visualization::data->DataVariables()); m_angle = FindValFromUser(expression, GetData()->DataVariables());
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
template <class Item> template <class Item>
int VisToolRotation::AddCurve(qreal angle, const QPointF &origin, quint32 id, int i) auto VisToolRotation::AddCurve(qreal angle, const QPointF &origin, quint32 id, int i) -> int
{ {
const QSharedPointer<Item> curve = Visualization::data->template GeometricObject<Item>(id); const QSharedPointer<Item> curve = GetData()->template GeometricObject<Item>(id);
++i; ++i;
VCurvePathItem *path = GetCurve(static_cast<quint32>(i), supportColor2); VCurvePathItem *path = GetCurve(static_cast<quint32>(i), Color(VColor::SupportColor2));
DrawPath(path, curve->GetPath(), curve->DirectionArrows(), supportColor2, Qt::SolidLine, Qt::RoundCap); DrawPath(path, curve->GetPath(), curve->DirectionArrows(), Color(VColor::SupportColor2), Qt::SolidLine,
Qt::RoundCap);
++i; ++i;
path = GetCurve(static_cast<quint32>(i), supportColor); path = GetCurve(static_cast<quint32>(i), Color(VColor::SupportColor));
if (object1Id != NULL_ID) if (m_originPointId != NULL_ID)
{ {
const Item rotated = curve->Rotate(origin, angle); const Item rotated = curve->Rotate(origin, angle);
DrawPath(path, rotated.GetPath(), rotated.DirectionArrows(), supportColor, Qt::SolidLine, Qt::RoundCap); DrawPath(path, rotated.GetPath(), rotated.DirectionArrows(), Color(VColor::SupportColor), Qt::SolidLine,
Qt::RoundCap);
} }
return i; return i;

View File

@ -39,7 +39,6 @@
#include <QVector> #include <QVector>
#include <QtGlobal> #include <QtGlobal>
#include "../ifc/ifcdef.h"
#include "../vmisc/def.h" #include "../vmisc/def.h"
#include "visoperation.h" #include "visoperation.h"
@ -48,27 +47,34 @@ class VisToolRotation : public VisOperation
Q_OBJECT // NOLINT Q_OBJECT // NOLINT
public: public:
explicit VisToolRotation(const VContainer *data, QGraphicsItem *parent = nullptr); explicit VisToolRotation(const VContainer *data, QGraphicsItem *parent = nullptr);
virtual ~VisToolRotation(); ~VisToolRotation() override = default;
virtual void RefreshGeometry() override; void RefreshGeometry() override;
void SetOriginPointId(quint32 value); void SetOriginPointId(quint32 value);
QString Angle() const; auto Angle() const -> QString;
void SetAngle(const QString &expression); void SetAngle(const QString &expression);
virtual int type() const override {return Type;} auto type() const -> int override {return Type;}
enum { Type = UserType + static_cast<int>(Vis::ToolRotation)}; enum {Type = UserType + static_cast<int>(Vis::ToolRotation)};
private: private:
// cppcheck-suppress unknownMacro // cppcheck-suppress unknownMacro
Q_DISABLE_COPY_MOVE(VisToolRotation) // NOLINT Q_DISABLE_COPY_MOVE(VisToolRotation) // NOLINT
qreal angle; qreal m_angle{INT_MIN};
VScaledEllipse *point; VScaledEllipse *m_point{nullptr};
VCurvePathItem *angleArc; VCurvePathItem *m_angleArc{nullptr};
VScaledLine *xAxis; VScaledLine *m_xAxis{nullptr};
quint32 m_originPointId{NULL_ID};
template <class Item> template <class Item>
int AddCurve(qreal angle, const QPointF &origin, quint32 id, int i); auto AddCurve(qreal angle, const QPointF &origin, quint32 id, int i) -> int;
}; };
//---------------------------------------------------------------------------------------------------------------------
inline void VisToolRotation::SetOriginPointId(quint32 value)
{
m_originPointId = value;
}
#endif // VISTOOLROTATION_H #endif // VISTOOLROTATION_H

View File

@ -32,11 +32,9 @@
#include <QGuiApplication> #include <QGuiApplication>
#include <QPen> #include <QPen>
#include <QRectF> #include <QRectF>
#include <QtMath>
#include "../ifc/ifcdef.h"
#include "../vgeometry/vgobject.h" #include "../vgeometry/vgobject.h"
#include "../vmisc/vabstractapplication.h"
#include "../vmisc/vmath.h"
#include "../vpatterndb/vcontainer.h" #include "../vpatterndb/vcontainer.h"
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
@ -48,7 +46,7 @@ VisLine::VisLine(const VContainer *data, QGraphicsItem *parent)
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
qreal VisLine::CorrectAngle(const qreal &angle) auto VisLine::CorrectAngle(const qreal &angle) -> qreal
{ {
qreal ang = angle; qreal ang = angle;
if (angle > 360) if (angle > 360)
@ -79,11 +77,11 @@ qreal VisLine::CorrectAngle(const qreal &angle)
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
QPointF VisLine::Ray(const QPointF &firstPoint, const qreal &angle) const auto VisLine::Ray(const QPointF &firstPoint, const qreal &angle) const -> QPointF
{ {
if (this->scene() == nullptr) if (this->scene() == nullptr)
{ {
QLineF line = QLineF(firstPoint, Visualization::scenePos); QLineF line = QLineF(firstPoint, ScenePos());
line.setAngle(angle); line.setAngle(angle);
return line.p2();// We can't find ray because item doesn't have scene. We will return cursor position on scene. return line.p2();// We can't find ray because item doesn't have scene. We will return cursor position on scene.
} }
@ -103,29 +101,25 @@ QPointF VisLine::Ray(const QPointF &firstPoint, const qreal &angle) const
{ {
return VGObject::BuildRay(firstPoint, CorrectAngle(angle), scRect); return VGObject::BuildRay(firstPoint, CorrectAngle(angle), scRect);
} }
else
{ return VGObject::BuildRay(firstPoint, angle, scRect);
return VGObject::BuildRay(firstPoint, angle, scRect);
}
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
QPointF VisLine::Ray(const QPointF &firstPoint) const auto VisLine::Ray(const QPointF &firstPoint) const -> QPointF
{ {
QLineF line = QLineF(firstPoint, Visualization::scenePos); QLineF line = QLineF(firstPoint, ScenePos());
return Ray(firstPoint, line.angle()); return Ray(firstPoint, line.angle());
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
QLineF VisLine::Axis(const QPointF &p, const qreal &angle) const auto VisLine::Axis(const QPointF &p, const qreal &angle) const -> QLineF
{ {
QPointF endP1 = Ray(p, angle+180); return {Ray(p, angle+180), Ray(p, angle)};
QPointF endP2 = Ray(p, angle);
return QLineF(endP1, endP2);
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
QLineF VisLine::Axis(const QPointF &p1, const QPointF &p2) const auto VisLine::Axis(const QPointF &p1, const QPointF &p2) const -> QLineF
{ {
QLineF line(p1, p2); QLineF line(p1, p2);
return Axis(p1, line.angle()); return Axis(p1, line.angle());
@ -135,8 +129,8 @@ QLineF VisLine::Axis(const QPointF &p1, const QPointF &p2) const
void VisLine::InitPen() void VisLine::InitPen()
{ {
QPen visPen = pen(); QPen visPen = pen();
visPen.setColor(mainColor); visPen.setColor(Color(VColor::MainColor));
visPen.setStyle(lineStyle); visPen.setStyle(LineStyle());
setPen(visPen); setPen(visPen);
} }

View File

@ -50,21 +50,23 @@ class VisLine: public Visualization, public VScaledLine
Q_OBJECT // NOLINT Q_OBJECT // NOLINT
public: public:
explicit VisLine(const VContainer *data, QGraphicsItem *parent = nullptr); explicit VisLine(const VContainer *data, QGraphicsItem *parent = nullptr);
virtual ~VisLine() = default; ~VisLine() override = default;
virtual int type() const override {return Type;} auto type() const -> int override {return Type;}
enum { Type = UserType + static_cast<int>(Vis::Line)}; enum {Type = UserType + static_cast<int>(Vis::Line)};
static qreal CorrectAngle(const qreal &angle);
static auto CorrectAngle(const qreal &angle) -> qreal;
protected: protected:
QPointF Ray(const QPointF &firstPoint, const qreal &angle) const; auto Ray(const QPointF &firstPoint, const qreal &angle) const -> QPointF;
QPointF Ray(const QPointF &firstPoint) const; auto Ray(const QPointF &firstPoint) const -> QPointF;
QLineF Axis(const QPointF &p, const qreal &angle) const; auto Axis(const QPointF &p, const qreal &angle) const -> QLineF;
QLineF Axis(const QPointF &p1, const QPointF &p2) const; auto Axis(const QPointF &p1, const QPointF &p2) const -> QLineF;
virtual void InitPen() override;
virtual void AddOnScene() override;
void DrawRay(VScaledLine *lineItem, const QPointF &p, const QPointF &pTangent, void InitPen() override;
const QColor &color, Qt::PenStyle style); void AddOnScene() override;
void DrawRay(VScaledLine *lineItem, const QPointF &p, const QPointF &pTangent, const QColor &color,
Qt::PenStyle style);
private: private:
Q_DISABLE_COPY_MOVE(VisLine) // NOLINT Q_DISABLE_COPY_MOVE(VisLine) // NOLINT
}; };

View File

@ -47,70 +47,58 @@
VisToolAlongLine::VisToolAlongLine(const VContainer *data, QGraphicsItem *parent) VisToolAlongLine::VisToolAlongLine(const VContainer *data, QGraphicsItem *parent)
: VisLine(data, parent) : VisLine(data, parent)
{ {
this->mainColor = Qt::red; SetMainColor(Qt::red);
this->setZValue(2);// Show on top real tool this->setZValue(2);// Show on top real tool
m_lineP1 = InitPoint(supportColor, this); m_lineP1 = InitPoint(Color(VColor::SupportColor), this);
m_lineP2 = InitPoint(supportColor, this); //-V656 m_lineP2 = InitPoint(Color(VColor::SupportColor), this); //-V656
m_line = InitItem<VScaledLine>(supportColor, this); m_line = InitItem<VScaledLine>(Color(VColor::SupportColor), this);
m_point = InitPoint(mainColor, this); m_point = InitPoint(Color(VColor::MainColor), this);
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void VisToolAlongLine::setObject2Id(const quint32 &value) void VisToolAlongLine::SetLength(const QString &expression)
{ {
m_object2Id = value; m_length = FindLengthFromUser(expression, GetData()->DataVariables());
}
//---------------------------------------------------------------------------------------------------------------------
void VisToolAlongLine::setLength(const QString &expression)
{
m_length = FindLengthFromUser(expression, Visualization::data->DataVariables());
}
//---------------------------------------------------------------------------------------------------------------------
void VisToolAlongLine::setMidPointMode(bool midPointMode)
{
m_midPointMode = midPointMode;
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void VisToolAlongLine::RefreshGeometry() void VisToolAlongLine::RefreshGeometry()
{ {
if (object1Id > NULL_ID) if (m_point1Id > NULL_ID)
{ {
const QSharedPointer<VPointF> first = Visualization::data->GeometricObject<VPointF>(object1Id); const QSharedPointer<VPointF> first = GetData()->GeometricObject<VPointF>(m_point1Id);
DrawPoint(m_lineP1, static_cast<QPointF>(*first), supportColor); DrawPoint(m_lineP1, static_cast<QPointF>(*first), Color(VColor::SupportColor));
if (m_object2Id <= NULL_ID) if (m_point2Id <= NULL_ID)
{ {
QLineF cursorLine (static_cast<QPointF>(*first), Visualization::scenePos); QLineF cursorLine (static_cast<QPointF>(*first), ScenePos());
DrawLine(m_line, cursorLine, supportColor); DrawLine(m_line, cursorLine, Color(VColor::SupportColor));
if (m_midPointMode) if (m_midPointMode)
{ {
cursorLine.setLength(cursorLine.length()/2.0); cursorLine.setLength(cursorLine.length()/2.0);
DrawPoint(m_point, cursorLine.p2(), mainColor); DrawPoint(m_point, cursorLine.p2(), Color(VColor::MainColor));
} }
} }
else else
{ {
const QSharedPointer<VPointF> second = Visualization::data->GeometricObject<VPointF>(m_object2Id); const QSharedPointer<VPointF> second = GetData()->GeometricObject<VPointF>(m_point2Id);
DrawPoint(m_lineP2, static_cast<QPointF>(*second), supportColor); DrawPoint(m_lineP2, static_cast<QPointF>(*second), Color(VColor::SupportColor));
QLineF baseLine(static_cast<QPointF>(*first), static_cast<QPointF>(*second)); QLineF baseLine(static_cast<QPointF>(*first), static_cast<QPointF>(*second));
DrawLine(m_line, baseLine, supportColor); DrawLine(m_line, baseLine, Color(VColor::SupportColor));
if (not qFuzzyIsNull(m_length)) if (not qFuzzyIsNull(m_length))
{ {
QLineF mainLine = VGObject::BuildLine(static_cast<QPointF>(*first), m_length, m_line->line().angle()); QLineF mainLine = VGObject::BuildLine(static_cast<QPointF>(*first), m_length, m_line->line().angle());
DrawLine(this, mainLine, mainColor, lineStyle); DrawLine(this, mainLine, Color(VColor::MainColor), LineStyle());
DrawPoint(m_point, mainLine.p2(), mainColor); DrawPoint(m_point, mainLine.p2(), Color(VColor::MainColor));
} }
else if (mode == Mode::Creation) else if (GetMode() == Mode::Creation)
{ {
QLineF cursorLine (static_cast<QPointF>(*first), Visualization::scenePos); QLineF cursorLine (static_cast<QPointF>(*first), ScenePos());
qreal len = cursorLine.length(); qreal len = cursorLine.length();
qreal angleTo = baseLine.angleTo(cursorLine); qreal angleTo = baseLine.angleTo(cursorLine);
@ -120,16 +108,23 @@ void VisToolAlongLine::RefreshGeometry()
} }
QLineF mainLine = VGObject::BuildLine(static_cast<QPointF>(*first), len, m_line->line().angle()); QLineF mainLine = VGObject::BuildLine(static_cast<QPointF>(*first), len, m_line->line().angle());
DrawLine(this, mainLine, mainColor, lineStyle); DrawLine(this, mainLine, Color(VColor::MainColor), LineStyle());
DrawPoint(m_point, mainLine.p2(), mainColor); DrawPoint(m_point, mainLine.p2(), Color(VColor::MainColor));
const QString prefix = UnitsToStr(VAbstractValApplication::VApp()->patternUnits(), true); const QString prefix = UnitsToStr(VAbstractValApplication::VApp()->patternUnits(), true);
Visualization::toolTip = tr("Length = %1%2; " SetToolTip(tr("Length = %1%2; "
"<b>Mouse click</b> - finish selecting the length, " "<b>Mouse click</b> - finish selecting the length, "
"<b>%3</b> - skip") "<b>%3</b> - skip")
.arg(NumberToUser(len), prefix, VModifierKey::EnterKey()); .arg(NumberToUser(len), prefix, VModifierKey::EnterKey()));
} }
} }
} }
} }
//---------------------------------------------------------------------------------------------------------------------
void VisToolAlongLine::VisualMode(quint32 id)
{
m_point1Id = id;
StartVisualMode();
}

View File

@ -47,16 +47,20 @@ public:
~VisToolAlongLine() override = default; ~VisToolAlongLine() override = default;
void RefreshGeometry() override; void RefreshGeometry() override;
void setObject2Id(const quint32 &value); void VisualMode(quint32 id) override;
void setLength(const QString &expression);
void setMidPointMode(bool midPointMode); void SetPoint1Id(quint32 value);
void SetPoint2Id(quint32 value);
void SetLength(const QString &expression);
void SetMidPointMode(bool midPointMode);
auto type() const -> int override {return Type;} auto type() const -> int override {return Type;}
enum {Type = UserType + static_cast<int>(Vis::ToolAlongLine)}; enum {Type = UserType + static_cast<int>(Vis::ToolAlongLine)};
private: private:
// cppcheck-suppress unknownMacro // cppcheck-suppress unknownMacro
Q_DISABLE_COPY_MOVE(VisToolAlongLine) // NOLINT Q_DISABLE_COPY_MOVE(VisToolAlongLine) // NOLINT
quint32 m_object2Id{NULL_ID}; quint32 m_point1Id{NULL_ID};
quint32 m_point2Id{NULL_ID};
VScaledEllipse *m_point{nullptr}; VScaledEllipse *m_point{nullptr};
VScaledEllipse *m_lineP1{nullptr}; VScaledEllipse *m_lineP1{nullptr};
VScaledEllipse *m_lineP2{nullptr}; VScaledEllipse *m_lineP2{nullptr};
@ -65,4 +69,22 @@ private:
bool m_midPointMode{false}; bool m_midPointMode{false};
}; };
//---------------------------------------------------------------------------------------------------------------------
inline void VisToolAlongLine::SetPoint1Id(quint32 value)
{
m_point1Id = value;
}
//---------------------------------------------------------------------------------------------------------------------
inline void VisToolAlongLine::SetPoint2Id(quint32 value)
{
m_point2Id = value;
}
//---------------------------------------------------------------------------------------------------------------------
inline void VisToolAlongLine::SetMidPointMode(bool midPointMode)
{
m_midPointMode = midPointMode;
}
#endif // VISTOOLALONGLINE_H #endif // VISTOOLALONGLINE_H

View File

@ -46,63 +46,53 @@
VisToolBisector::VisToolBisector(const VContainer *data, QGraphicsItem *parent) VisToolBisector::VisToolBisector(const VContainer *data, QGraphicsItem *parent)
:VisLine(data, parent) :VisLine(data, parent)
{ {
m_line1P1 = InitPoint(supportColor, this); m_line1P1 = InitPoint(Color(VColor::SupportColor), this);
m_line1P2 = InitPoint(supportColor, this); //-V656 m_line1P2 = InitPoint(Color(VColor::SupportColor), this); //-V656
m_line1 = InitItem<VScaledLine>(supportColor, this); m_line1 = InitItem<VScaledLine>(Color(VColor::SupportColor), this);
m_line2P2 = InitPoint(supportColor, this); m_line2P2 = InitPoint(Color(VColor::SupportColor), this);
m_line2 = InitItem<VScaledLine>(supportColor, this); m_line2 = InitItem<VScaledLine>(Color(VColor::SupportColor), this);
m_point = InitPoint(mainColor, this); m_point = InitPoint(Color(VColor::MainColor), this);
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void VisToolBisector::setObject2Id(const quint32 &value) void VisToolBisector::SetLength(const QString &expression)
{ {
m_object2Id = value; m_length = FindLengthFromUser(expression, GetData()->DataVariables());
}
//---------------------------------------------------------------------------------------------------------------------
void VisToolBisector::setObject3Id(const quint32 &value)
{
m_object3Id = value;
}
//---------------------------------------------------------------------------------------------------------------------
void VisToolBisector::setLength(const QString &expression)
{
m_length = FindLengthFromUser(expression, Visualization::data->DataVariables());
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void VisToolBisector::RefreshGeometry() void VisToolBisector::RefreshGeometry()
{ {
if (object1Id > NULL_ID) if (m_point1Id > NULL_ID)
{ {
const QSharedPointer<VPointF> first = Visualization::data->GeometricObject<VPointF>(object1Id); const QSharedPointer<VPointF> first = GetData()->GeometricObject<VPointF>(m_point1Id);
DrawPoint(m_line1P1, static_cast<QPointF>(*first), supportColor); DrawPoint(m_line1P1, static_cast<QPointF>(*first), Color(VColor::SupportColor));
if (m_object2Id <= NULL_ID) if (m_point2Id <= NULL_ID)
{ {
DrawLine(m_line1, QLineF(static_cast<QPointF>(*first), Visualization::scenePos), supportColor); DrawLine(m_line1, QLineF(static_cast<QPointF>(*first), ScenePos()), Color(VColor::SupportColor));
} }
else else
{ {
const QSharedPointer<VPointF> second = Visualization::data->GeometricObject<VPointF>(m_object2Id); const QSharedPointer<VPointF> second = GetData()->GeometricObject<VPointF>(m_point2Id);
DrawPoint(m_line1P2, static_cast<QPointF>(*second), supportColor); DrawPoint(m_line1P2, static_cast<QPointF>(*second), Color(VColor::SupportColor));
DrawLine(m_line1, QLineF(static_cast<QPointF>(*first), static_cast<QPointF>(*second)), supportColor); DrawLine(m_line1, QLineF(static_cast<QPointF>(*first), static_cast<QPointF>(*second)),
Color(VColor::SupportColor));
if (m_object3Id <= NULL_ID) if (m_point3Id <= NULL_ID)
{ {
DrawLine(m_line2, QLineF(static_cast<QPointF>(*second), Visualization::scenePos), supportColor); DrawLine(m_line2, QLineF(static_cast<QPointF>(*second), ScenePos()), Color(VColor::SupportColor));
} }
else else
{ {
const QSharedPointer<VPointF> third = Visualization::data->GeometricObject<VPointF>(m_object3Id); const QSharedPointer<VPointF> third = GetData()->GeometricObject<VPointF>(m_point3Id);
DrawPoint(m_line2P2, static_cast<QPointF>(*third), supportColor); DrawPoint(m_line2P2, static_cast<QPointF>(*third), Color(VColor::SupportColor));
DrawLine(m_line2, QLineF(static_cast<QPointF>(*second), static_cast<QPointF>(*third)), supportColor); DrawLine(m_line2, QLineF(static_cast<QPointF>(*second), static_cast<QPointF>(*third)),
Color(VColor::SupportColor));
if (not qFuzzyIsNull(m_length)) if (not qFuzzyIsNull(m_length))
{ {
@ -110,13 +100,13 @@ void VisToolBisector::RefreshGeometry()
static_cast<QPointF>(*second), static_cast<QPointF>(*second),
static_cast<QPointF>(*third)); static_cast<QPointF>(*third));
QLineF mainLine = VGObject::BuildLine(static_cast<QPointF>(*second), m_length, angle); QLineF mainLine = VGObject::BuildLine(static_cast<QPointF>(*second), m_length, angle);
DrawLine(this, mainLine, mainColor, lineStyle); DrawLine(this, mainLine, Color(VColor::MainColor), LineStyle());
DrawPoint(m_point, mainLine.p2(), mainColor); DrawPoint(m_point, mainLine.p2(), Color(VColor::MainColor));
} }
else if (mode == Mode::Creation) else if (GetMode() == Mode::Creation)
{ {
QLineF cursorLine (static_cast<QPointF>(*second), Visualization::scenePos); QLineF cursorLine (static_cast<QPointF>(*second), ScenePos());
QLineF baseLine(static_cast<QPointF>(*second), static_cast<QPointF>(*third)); QLineF baseLine(static_cast<QPointF>(*second), static_cast<QPointF>(*third));
qreal angle = VToolBisector::BisectorAngle(static_cast<QPointF>(*first), qreal angle = VToolBisector::BisectorAngle(static_cast<QPointF>(*first),
@ -134,15 +124,15 @@ void VisToolBisector::RefreshGeometry()
QLineF mainLine = VGObject::BuildLine(static_cast<QPointF>(*second), len, angle); QLineF mainLine = VGObject::BuildLine(static_cast<QPointF>(*second), len, angle);
DrawLine(this, mainLine, mainColor, lineStyle); DrawLine(this, mainLine, Color(VColor::MainColor), LineStyle());
DrawPoint(m_point, mainLine.p2(), mainColor); DrawPoint(m_point, mainLine.p2(), Color(VColor::MainColor));
const QString prefix = UnitsToStr(VAbstractValApplication::VApp()->patternUnits(), true); const QString prefix = UnitsToStr(VAbstractValApplication::VApp()->patternUnits(), true);
Visualization::toolTip = tr("Length = %1%2; " SetToolTip(tr("Length = %1%2; "
"<b>Mouse click</b> - finish selecting the length, " "<b>Mouse click</b> - finish selecting the length, "
"<b>%3</b> - skip") "<b>%3</b> - skip")
.arg(NumberToUser(len), prefix, VModifierKey::EnterKey()); .arg(NumberToUser(len), prefix, VModifierKey::EnterKey()));
} }
else else
{ {
@ -153,9 +143,16 @@ void VisToolBisector::RefreshGeometry()
QLineF mainLine = VGObject::BuildLine(static_cast<QPointF>(*second), QLineF mainLine = VGObject::BuildLine(static_cast<QPointF>(*second),
QLineF(static_cast<QPointF>(*second), endRay).length(), QLineF(static_cast<QPointF>(*second), endRay).length(),
angle); angle);
DrawLine(this, mainLine, mainColor, lineStyle); DrawLine(this, mainLine, Color(VColor::MainColor), LineStyle());
} }
} }
} }
} }
} }
//---------------------------------------------------------------------------------------------------------------------
void VisToolBisector::VisualMode(quint32 id)
{
m_point1Id = id;
StartVisualMode();
}

View File

@ -47,16 +47,21 @@ public:
~VisToolBisector() override = default; ~VisToolBisector() override = default;
void RefreshGeometry() override; void RefreshGeometry() override;
void setObject2Id(const quint32 &value); void VisualMode(quint32 id) override;
void setObject3Id(const quint32 &value);
void setLength(const QString &expression); void SetPoint1Id(quint32 value);
void SetPoint2Id(quint32 value);
void SetPoint3Id(quint32 value);
void SetLength(const QString &expression);
auto type() const -> int override {return Type;} auto type() const -> int override {return Type;}
enum {Type = UserType + static_cast<int>(Vis::ToolBisector)}; enum {Type = UserType + static_cast<int>(Vis::ToolBisector)};
private: private:
// cppcheck-suppress unknownMacro // cppcheck-suppress unknownMacro
Q_DISABLE_COPY_MOVE(VisToolBisector) // NOLINT Q_DISABLE_COPY_MOVE(VisToolBisector) // NOLINT
quint32 m_object2Id{NULL_ID}; quint32 m_point1Id{NULL_ID};
quint32 m_object3Id{NULL_ID}; quint32 m_point2Id{NULL_ID};
quint32 m_point3Id{NULL_ID};
VScaledEllipse *m_point{nullptr}; VScaledEllipse *m_point{nullptr};
VScaledEllipse *m_line1P1{nullptr}; VScaledEllipse *m_line1P1{nullptr};
VScaledEllipse *m_line1P2{nullptr}; VScaledEllipse *m_line1P2{nullptr};
@ -66,4 +71,22 @@ private:
qreal m_length{0}; qreal m_length{0};
}; };
//---------------------------------------------------------------------------------------------------------------------
inline void VisToolBisector::SetPoint1Id(quint32 value)
{
m_point1Id = value;
}
//---------------------------------------------------------------------------------------------------------------------
inline void VisToolBisector::SetPoint2Id(quint32 value)
{
m_point2Id = value;
}
//---------------------------------------------------------------------------------------------------------------------
inline void VisToolBisector::SetPoint3Id(quint32 value)
{
m_point3Id = value;
}
#endif // VISTOOLBISECTOR_H #endif // VISTOOLBISECTOR_H

View File

@ -39,7 +39,6 @@
#include <new> #include <new>
#include "../../tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolcurveintersectaxis.h" #include "../../tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolcurveintersectaxis.h"
#include "../ifc/ifcdef.h"
#include "../vgeometry/vabstractcurve.h" #include "../vgeometry/vabstractcurve.h"
#include "../vgeometry/vpointf.h" #include "../vgeometry/vpointf.h"
#include "../vpatterndb/vcontainer.h" #include "../vpatterndb/vcontainer.h"
@ -49,70 +48,71 @@
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
VisToolCurveIntersectAxis::VisToolCurveIntersectAxis(const VContainer *data, QGraphicsItem *parent) VisToolCurveIntersectAxis::VisToolCurveIntersectAxis(const VContainer *data, QGraphicsItem *parent)
: VisLine(data, parent), axisPointId(NULL_ID), angle(-1), point(nullptr), basePoint(nullptr), baseLine(nullptr), : VisLine(data, parent)
axisLine(nullptr), visCurve(nullptr)
{ {
this->mainColor = Qt::red; SetMainColor(Qt::red);
visCurve = InitItem<VCurvePathItem>(Qt::darkGreen, this); m_visCurve = InitItem<VCurvePathItem>(Qt::darkGreen, this);
basePoint = InitPoint(supportColor, this); m_basePoint = InitPoint(Color(VColor::SupportColor), this);
baseLine = InitItem<VScaledLine>(supportColor, this); m_baseLine = InitItem<VScaledLine>(Color(VColor::SupportColor), this);
axisLine = InitItem<VScaledLine>(supportColor, this); //-V656 m_axisLine = InitItem<VScaledLine>(Color(VColor::SupportColor), this); //-V656
point = InitPoint(mainColor, this); m_point = InitPoint(Color(VColor::MainColor), this);
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void VisToolCurveIntersectAxis::RefreshGeometry() void VisToolCurveIntersectAxis::RefreshGeometry()
{ {
if (object1Id > NULL_ID) if (m_curveId > NULL_ID)
{ {
const QSharedPointer<VAbstractCurve> curve = Visualization::data->GeometricObject<VAbstractCurve>(object1Id); const QSharedPointer<VAbstractCurve> curve = GetData()->GeometricObject<VAbstractCurve>(m_curveId);
DrawPath(visCurve, curve->GetPath(), curve->DirectionArrows(), supportColor, Qt::SolidLine, Qt::RoundCap); DrawPath(m_visCurve, curve->GetPath(), curve->DirectionArrows(), Color(VColor::SupportColor), Qt::SolidLine,
Qt::RoundCap);
if (axisPointId > NULL_ID) if (m_axisPointId > NULL_ID)
{ {
QLineF axis; QLineF axis;
const QSharedPointer<VPointF> first = Visualization::data->GeometricObject<VPointF>(axisPointId); const QSharedPointer<VPointF> first = GetData()->GeometricObject<VPointF>(m_axisPointId);
if (VFuzzyComparePossibleNulls(angle, -1)) if (VFuzzyComparePossibleNulls(m_angle, -1))
{ {
axis = Axis(static_cast<QPointF>(*first), Visualization::scenePos); axis = Axis(static_cast<QPointF>(*first), ScenePos());
} }
else else
{ {
axis = Axis(static_cast<QPointF>(*first), angle); axis = Axis(static_cast<QPointF>(*first), m_angle);
} }
DrawPoint(basePoint, static_cast<QPointF>(*first), mainColor); DrawPoint(m_basePoint, static_cast<QPointF>(*first), Color(VColor::MainColor));
DrawLine(axisLine, axis, supportColor, Qt::DashLine); DrawLine(m_axisLine, axis, Color(VColor::SupportColor), Qt::DashLine);
QPointF p; QPointF p;
VToolCurveIntersectAxis::FindPoint(static_cast<QPointF>(*first), axis.angle(), curve->GetPoints(), &p); VToolCurveIntersectAxis::FindPoint(static_cast<QPointF>(*first), axis.angle(), curve->GetPoints(), &p);
QLineF axis_line(static_cast<QPointF>(*first), p); QLineF axis_line(static_cast<QPointF>(*first), p);
DrawLine(this, axis_line, mainColor, lineStyle); DrawLine(this, axis_line, Color(VColor::MainColor), LineStyle());
DrawPoint(point, p, mainColor); DrawPoint(m_point, p, Color(VColor::MainColor));
Visualization::toolTip = tr("<b>Intersection curve and axis</b>: angle = %1°; <b>%2</b> - " SetToolTip(tr("<b>Intersection curve and axis</b>: angle = %1°; <b>%2</b> - "
"sticking angle, <b>%3</b> - finish creation") "sticking angle, <b>%3</b> - finish creation")
.arg(this->line().angle()) .arg(this->line().angle())
.arg(VModifierKey::Shift(), VModifierKey::EnterKey()); .arg(VModifierKey::Shift(), VModifierKey::EnterKey()));
} }
} }
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
QString VisToolCurveIntersectAxis::Angle() const void VisToolCurveIntersectAxis::VisualMode(quint32 id)
{ {
return QString("%1").arg(this->line().angle()); m_curveId = id;
StartVisualMode();
}
//---------------------------------------------------------------------------------------------------------------------
auto VisToolCurveIntersectAxis::Angle() const -> QString
{
return QString::number(this->line().angle());
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void VisToolCurveIntersectAxis::SetAngle(const QString &expression) void VisToolCurveIntersectAxis::SetAngle(const QString &expression)
{ {
angle = FindValFromUser(expression, Visualization::data->DataVariables()); m_angle = FindValFromUser(expression, GetData()->DataVariables());
}
//---------------------------------------------------------------------------------------------------------------------
void VisToolCurveIntersectAxis::setAxisPointId(const quint32 &value)
{
axisPointId = value;
} }

View File

@ -44,26 +44,43 @@ class VisToolCurveIntersectAxis final : public VisLine
Q_OBJECT // NOLINT Q_OBJECT // NOLINT
public: public:
explicit VisToolCurveIntersectAxis(const VContainer *data, QGraphicsItem *parent = nullptr); explicit VisToolCurveIntersectAxis(const VContainer *data, QGraphicsItem *parent = nullptr);
virtual ~VisToolCurveIntersectAxis() = default; ~VisToolCurveIntersectAxis() override = default;
virtual void RefreshGeometry() override; void RefreshGeometry() override;
void VisualMode(quint32 id) override;
QString Angle() const; auto Angle() const -> QString;
void SetAngle(const QString &expression); void SetAngle(const QString &expression);
void setAxisPointId(const quint32 &value);
void SetCurveId(quint32 newCurveId);
void setAxisPointId(const quint32 &value);
auto type() const -> int override {return Type;}
enum {Type = UserType + static_cast<int>(Vis::ToolLineIntersectAxis)};
virtual int type() const override {return Type;}
enum { Type = UserType + static_cast<int>(Vis::ToolLineIntersectAxis)};
private: private:
// cppcheck-suppress unknownMacro // cppcheck-suppress unknownMacro
Q_DISABLE_COPY_MOVE(VisToolCurveIntersectAxis) // NOLINT Q_DISABLE_COPY_MOVE(VisToolCurveIntersectAxis) // NOLINT
quint32 axisPointId; quint32 m_axisPointId{NULL_ID};
qreal angle; qreal m_angle{-1};
VScaledEllipse *point; VScaledEllipse *m_point{nullptr};
VScaledEllipse *basePoint; VScaledEllipse *m_basePoint{nullptr};
VScaledLine *baseLine; VScaledLine *m_baseLine{nullptr};
VScaledLine *axisLine; VScaledLine *m_axisLine{nullptr};
VCurvePathItem *visCurve; VCurvePathItem *m_visCurve{nullptr};
quint32 m_curveId{NULL_ID};
}; };
//---------------------------------------------------------------------------------------------------------------------
inline void VisToolCurveIntersectAxis::SetCurveId(quint32 newCurveId)
{
m_curveId = newCurveId;
}
//---------------------------------------------------------------------------------------------------------------------
inline void VisToolCurveIntersectAxis::setAxisPointId(const quint32 &value)
{
m_axisPointId = value;
}
#endif // VISTOOLCURVEINTERSECTAXIS_H #endif // VISTOOLCURVEINTERSECTAXIS_H

View File

@ -36,7 +36,6 @@
#include <Qt> #include <Qt>
#include <new> #include <new>
#include "../ifc/xml/vdomdocument.h"
#include "../vgeometry/vgobject.h" #include "../vgeometry/vgobject.h"
#include "../vgeometry/vpointf.h" #include "../vgeometry/vpointf.h"
#include "../vmisc/vabstractapplication.h" #include "../vmisc/vabstractapplication.h"
@ -49,55 +48,63 @@
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
VisToolEndLine::VisToolEndLine(const VContainer *data, QGraphicsItem *parent) VisToolEndLine::VisToolEndLine(const VContainer *data, QGraphicsItem *parent)
: VisLine(data, parent), length(0), angle(0), point(nullptr) : VisLine(data, parent)
{ {
this->mainColor = Qt::red; SetMainColor(Qt::red);
point = InitPoint(mainColor, this); m_point = InitPoint(Color(VColor::MainColor), this);
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void VisToolEndLine::RefreshGeometry() void VisToolEndLine::RefreshGeometry()
{ {
const QSharedPointer<VPointF> first = Visualization::data->GeometricObject<VPointF>(object1Id); const QSharedPointer<VPointF> first = GetData()->GeometricObject<VPointF>(m_basePointId);
QLineF line; QLineF line;
if (qFuzzyIsNull(length)) if (qFuzzyIsNull(m_length))
{ {
if (mode == Mode::Creation) if (GetMode() == Mode::Creation)
{ {
if (QGuiApplication::keyboardModifiers() == Qt::ShiftModifier) if (QGuiApplication::keyboardModifiers() == Qt::ShiftModifier)
{ {
line = QLineF(static_cast<QPointF>(*first), Visualization::scenePos); line = QLineF(static_cast<QPointF>(*first), ScenePos());
line.setAngle(CorrectAngle(line.angle())); line.setAngle(CorrectAngle(line.angle()));
} }
else else
{ {
line = QLineF(static_cast<QPointF>(*first), Visualization::scenePos); line = QLineF(static_cast<QPointF>(*first), ScenePos());
} }
} }
else else
{ {
DrawPoint(point, static_cast<QPointF>(*first), mainColor); DrawPoint(m_point, static_cast<QPointF>(*first), Color(VColor::MainColor));
} }
} }
else else
{ {
line = VGObject::BuildLine(static_cast<QPointF>(*first), length, angle); line = VGObject::BuildLine(static_cast<QPointF>(*first), m_length, m_angle);
DrawPoint(point, line.p2(), mainColor); DrawPoint(m_point, line.p2(), Color(VColor::MainColor));
} }
DrawLine(this, line, mainColor, lineStyle); DrawLine(this, line, Color(VColor::MainColor), LineStyle());
static const QString prefix = UnitsToStr(VAbstractValApplication::VApp()->patternUnits(), true); static const QString prefix = UnitsToStr(VAbstractValApplication::VApp()->patternUnits(), true);
Visualization::toolTip = tr("<b>Point at distance and angle</b>: angle = %1°, length = %2%3; " SetToolTip(tr("<b>Point at distance and angle</b>: angle = %1°, length = %2%3; "
"<b>%4</b> - sticking angle, <b>%5</b> - finish creation") "<b>%4</b> - sticking angle, <b>%5</b> - finish creation")
.arg(this->line().angle()) .arg(this->line().angle())
.arg(VAbstractApplication::VApp()->TrVars() .arg(VAbstractApplication::VApp()->TrVars()
->FormulaToUser(QString::number(VAbstractValApplication::VApp()->fromPixel(this->line().length())), ->FormulaToUser(
VAbstractApplication::VApp()->Settings()->GetOsSeparator()), QString::number(VAbstractValApplication::VApp()->fromPixel(this->line().length())),
prefix, VModifierKey::Shift(), VModifierKey::EnterKey()); VAbstractApplication::VApp()->Settings()->GetOsSeparator()),
prefix, VModifierKey::Shift(), VModifierKey::EnterKey()));
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
QString VisToolEndLine::Angle() const void VisToolEndLine::VisualMode(quint32 id)
{
m_basePointId = id;
StartVisualMode();
}
//---------------------------------------------------------------------------------------------------------------------
auto VisToolEndLine::Angle() const -> QString
{ {
return QString::number(this->line().angle()); return QString::number(this->line().angle());
} }
@ -105,17 +112,17 @@ QString VisToolEndLine::Angle() const
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void VisToolEndLine::SetAngle(const QString &expression) void VisToolEndLine::SetAngle(const QString &expression)
{ {
angle = FindValFromUser(expression, Visualization::data->DataVariables()); m_angle = FindValFromUser(expression, GetData()->DataVariables());
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
QString VisToolEndLine::Length() const auto VisToolEndLine::Length() const -> QString
{ {
return QString::number(VAbstractValApplication::VApp()->fromPixel(this->line().length())); return QString::number(VAbstractValApplication::VApp()->fromPixel(this->line().length()));
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void VisToolEndLine::setLength(const QString &expression) void VisToolEndLine::SetLength(const QString &expression)
{ {
length = FindLengthFromUser(expression, Visualization::data->DataVariables()); m_length = FindLengthFromUser(expression, GetData()->DataVariables());
} }

View File

@ -44,24 +44,34 @@ class VisToolEndLine final : public VisLine
Q_OBJECT // NOLINT Q_OBJECT // NOLINT
public: public:
explicit VisToolEndLine(const VContainer *data, QGraphicsItem *parent = nullptr); explicit VisToolEndLine(const VContainer *data, QGraphicsItem *parent = nullptr);
virtual ~VisToolEndLine() = default; ~VisToolEndLine() override = default;
virtual void RefreshGeometry() override; void RefreshGeometry() override;
void VisualMode(quint32 id) override;
QString Angle() const; auto Angle() const -> QString;
void SetAngle(const QString &expression); void SetAngle(const QString &expression);
QString Length() const; auto Length() const -> QString;
void setLength(const QString &expression); void SetLength(const QString &expression);
virtual int type() const override {return Type;} void SetBasePointId(quint32 id);
enum { Type = UserType + static_cast<int>(Vis::ToolEndLine)};
auto type() const -> int override {return Type;}
enum {Type = UserType + static_cast<int>(Vis::ToolEndLine)};
private: private:
// cppcheck-suppress unknownMacro // cppcheck-suppress unknownMacro
Q_DISABLE_COPY_MOVE(VisToolEndLine) // NOLINT Q_DISABLE_COPY_MOVE(VisToolEndLine) // NOLINT
qreal length; qreal m_length{0};
qreal angle; qreal m_angle{0};
VScaledEllipse *point; VScaledEllipse *m_point{nullptr};
quint32 m_basePointId{NULL_ID};
}; };
//---------------------------------------------------------------------------------------------------------------------
inline void VisToolEndLine::SetBasePointId(quint32 id)
{
m_basePointId = id;
}
#endif // VISTOOLENDLINE_H #endif // VISTOOLENDLINE_H

View File

@ -36,7 +36,6 @@
#include <new> #include <new>
#include "../../tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolheight.h" #include "../../tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolheight.h"
#include "../ifc/ifcdef.h"
#include "../vgeometry/vpointf.h" #include "../vgeometry/vpointf.h"
#include "../vpatterndb/vcontainer.h" #include "../vpatterndb/vcontainer.h"
#include "../visualization.h" #include "../visualization.h"
@ -47,53 +46,53 @@
VisToolHeight::VisToolHeight(const VContainer *data, QGraphicsItem *parent) VisToolHeight::VisToolHeight(const VContainer *data, QGraphicsItem *parent)
: VisLine(data, parent) : VisLine(data, parent)
{ {
base_point = InitPoint(supportColor, this); m_basePoint = InitPoint(Color(VColor::SupportColor), this);
lineP1 = InitPoint(supportColor, this); m_lineP1 = InitPoint(Color(VColor::SupportColor), this);
lineP2 = InitPoint(supportColor, this); m_lineP2 = InitPoint(Color(VColor::SupportColor), this);
line = InitItem<VScaledLine>(supportColor, this); m_line = InitItem<VScaledLine>(Color(VColor::SupportColor), this);
line_intersection = InitItem<VScaledLine>(supportColor, this); //-V656 m_lineIntersection = InitItem<VScaledLine>(Color(VColor::SupportColor), this); //-V656
point = InitPoint(mainColor, this); m_point = InitPoint(Color(VColor::MainColor), this);
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void VisToolHeight::RefreshGeometry() void VisToolHeight::RefreshGeometry()
{ {
if (object1Id > NULL_ID) if (m_basePointId > NULL_ID)
{ {
const QSharedPointer<VPointF> first = Visualization::data->GeometricObject<VPointF>(object1Id); const QSharedPointer<VPointF> first = GetData()->GeometricObject<VPointF>(m_basePointId);
DrawPoint(base_point, static_cast<QPointF>(*first), supportColor); DrawPoint(m_basePoint, static_cast<QPointF>(*first), Color(VColor::SupportColor));
if (lineP1Id <= NULL_ID) if (m_lineP1Id <= NULL_ID)
{ {
DrawLine(this, QLineF(static_cast<QPointF>(*first), Visualization::scenePos), mainColor); DrawLine(this, QLineF(static_cast<QPointF>(*first), ScenePos()), Color(VColor::MainColor));
} }
else else
{ {
const QSharedPointer<VPointF> second = Visualization::data->GeometricObject<VPointF>(lineP1Id); const QSharedPointer<VPointF> second = GetData()->GeometricObject<VPointF>(m_lineP1Id);
DrawPoint(lineP1, static_cast<QPointF>(*second), supportColor); DrawPoint(m_lineP1, static_cast<QPointF>(*second), Color(VColor::SupportColor));
QLineF base_line; QLineF base_line;
if (lineP2Id <= NULL_ID) if (m_lineP2Id <= NULL_ID)
{ {
base_line = QLineF(static_cast<QPointF>(*second), Visualization::scenePos); base_line = QLineF(static_cast<QPointF>(*second), ScenePos());
DrawLine(line, base_line, supportColor); DrawLine(m_line, base_line, Color(VColor::SupportColor));
} }
else else
{ {
const QSharedPointer<VPointF> third = Visualization::data->GeometricObject<VPointF>(lineP2Id); const QSharedPointer<VPointF> third = GetData()->GeometricObject<VPointF>(m_lineP2Id);
DrawPoint(lineP2, static_cast<QPointF>(*third), supportColor); DrawPoint(m_lineP2, static_cast<QPointF>(*third), Color(VColor::SupportColor));
base_line = QLineF(static_cast<QPointF>(*second), static_cast<QPointF>(*third)); base_line = QLineF(static_cast<QPointF>(*second), static_cast<QPointF>(*third));
} }
DrawLine(line, base_line, supportColor); DrawLine(m_line, base_line, Color(VColor::SupportColor));
QPointF height = VToolHeight::FindPoint(base_line, static_cast<QPointF>(*first)); QPointF height = VToolHeight::FindPoint(base_line, static_cast<QPointF>(*first));
DrawPoint(point, height, mainColor); DrawPoint(m_point, height, Color(VColor::MainColor));
QLineF height_line(static_cast<QPointF>(*first), height); QLineF height_line(static_cast<QPointF>(*first), height);
DrawLine(this, height_line, mainColor, lineStyle); DrawLine(this, height_line, Color(VColor::MainColor), LineStyle());
ShowIntersection(height_line, base_line); ShowIntersection(height_line, base_line);
} }
@ -101,15 +100,10 @@ void VisToolHeight::RefreshGeometry()
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void VisToolHeight::setLineP1Id(const quint32 &value) void VisToolHeight::VisualMode(quint32 id)
{ {
lineP1Id = value; m_basePointId = id;
} StartVisualMode();
//---------------------------------------------------------------------------------------------------------------------
void VisToolHeight::setLineP2Id(const quint32 &value)
{
lineP2Id = value;
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
@ -120,11 +114,12 @@ void VisToolHeight::ShowIntersection(const QLineF &height_line, const QLineF &ba
if (intersect == QLineF::UnboundedIntersection) if (intersect == QLineF::UnboundedIntersection)
{ {
line_intersection->setVisible(true); m_lineIntersection->setVisible(true);
DrawLine(line_intersection, QLineF(base_line.p1(), height_line.p2()), supportColor, Qt::DashLine); DrawLine(m_lineIntersection, QLineF(base_line.p1(), height_line.p2()), Color(VColor::SupportColor),
Qt::DashLine);
} }
else if (intersect == QLineF::BoundedIntersection) else if (intersect == QLineF::BoundedIntersection)
{ {
line_intersection->setVisible(false); m_lineIntersection->setVisible(false);
} }
} }

View File

@ -45,27 +45,49 @@ class VisToolHeight final : public VisLine
Q_OBJECT // NOLINT Q_OBJECT // NOLINT
public: public:
explicit VisToolHeight(const VContainer *data, QGraphicsItem *parent = nullptr); explicit VisToolHeight(const VContainer *data, QGraphicsItem *parent = nullptr);
virtual ~VisToolHeight() = default; ~VisToolHeight() override = default;
virtual void RefreshGeometry() override; void RefreshGeometry() override;
void VisualMode(quint32 id) override;
void setLineP1Id(const quint32 &value); void SetBasePointId(quint32 value);
void setLineP2Id(const quint32 &value); void SetLineP1Id(quint32 value);
virtual int type() const override {return Type;} void SetLineP2Id(quint32 value);
enum { Type = UserType + static_cast<int>(Vis::ToolHeight)};
auto type() const -> int override {return Type;}
enum {Type = UserType + static_cast<int>(Vis::ToolHeight)};
private: private:
// cppcheck-suppress unknownMacro // cppcheck-suppress unknownMacro
Q_DISABLE_COPY_MOVE(VisToolHeight) // NOLINT Q_DISABLE_COPY_MOVE(VisToolHeight) // NOLINT
//base point in parent class quint32 m_basePointId{NULL_ID};
quint32 lineP1Id{NULL_ID};//first point of line quint32 m_lineP1Id{NULL_ID};//first point of line
quint32 lineP2Id{NULL_ID};//second point of line quint32 m_lineP2Id{NULL_ID};//second point of line
VScaledEllipse *point{nullptr}; VScaledEllipse *m_point{nullptr};
VScaledEllipse *base_point{nullptr}; VScaledEllipse *m_basePoint{nullptr};
VScaledEllipse *lineP1{nullptr}; VScaledEllipse *m_lineP1{nullptr};
VScaledEllipse *lineP2{nullptr}; VScaledEllipse *m_lineP2{nullptr};
VScaledLine *line{nullptr}; VScaledLine *m_line{nullptr};
VScaledLine *line_intersection{nullptr}; VScaledLine *m_lineIntersection{nullptr};
void ShowIntersection(const QLineF &height_line, const QLineF &base_line);
void ShowIntersection(const QLineF &height_line, const QLineF &base_line);
}; };
//---------------------------------------------------------------------------------------------------------------------
inline void VisToolHeight::SetBasePointId(quint32 value)
{
m_basePointId = value;
}
//---------------------------------------------------------------------------------------------------------------------
inline void VisToolHeight::SetLineP1Id(quint32 value)
{
m_lineP1Id = value;
}
//---------------------------------------------------------------------------------------------------------------------
inline void VisToolHeight::SetLineP2Id(quint32 value)
{
m_lineP2Id = value;
}
#endif // VISTOOLHEIGHT_H #endif // VISTOOLHEIGHT_H

View File

@ -34,41 +34,40 @@
#include <QSharedPointer> #include <QSharedPointer>
#include <new> #include <new>
#include "../ifc/ifcdef.h"
#include "../vgeometry/vpointf.h" #include "../vgeometry/vpointf.h"
#include "../vmisc/vabstractapplication.h"
#include "../vpatterndb/vcontainer.h" #include "../vpatterndb/vcontainer.h"
#include "../visualization.h" #include "../visualization.h"
#include "visualization/line/visline.h" #include "visualization/line/visline.h"
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
VisToolLine::VisToolLine(const VContainer *data, QGraphicsItem *parent) VisToolLine::VisToolLine(const VContainer *data, QGraphicsItem *parent)
:VisLine(data, parent), point2Id(NULL_ID) :VisLine(data, parent)
{ {
this->mainColor = Qt::red; SetMainColor(Qt::red);
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void VisToolLine::RefreshGeometry() void VisToolLine::RefreshGeometry()
{ {
QLineF line; QLineF line;
const QSharedPointer<VPointF> first = Visualization::data->GeometricObject<VPointF>(object1Id); const QSharedPointer<VPointF> first = GetData()->GeometricObject<VPointF>(m_point1Id);
if (point2Id == NULL_ID) if (m_point2Id == NULL_ID)
{ {
line = QLineF(static_cast<QPointF>(*first), Visualization::scenePos); line = QLineF(static_cast<QPointF>(*first), ScenePos());
} }
else else
{ {
const QSharedPointer<VPointF> second = Visualization::data->GeometricObject<VPointF>(point2Id); const QSharedPointer<VPointF> second = GetData()->GeometricObject<VPointF>(m_point2Id);
line = QLineF(static_cast<QPointF>(*first), static_cast<QPointF>(*second)); line = QLineF(static_cast<QPointF>(*first), static_cast<QPointF>(*second));
} }
DrawLine(this, line, mainColor, lineStyle); DrawLine(this, line, Color(VColor::MainColor), LineStyle());
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void VisToolLine::setPoint2Id(const quint32 &value) void VisToolLine::VisualMode(quint32 id)
{ {
point2Id = value; m_point1Id = id;
StartVisualMode();
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------

View File

@ -47,19 +47,36 @@ class VisToolLine : public VisLine
Q_OBJECT // NOLINT Q_OBJECT // NOLINT
public: public:
explicit VisToolLine(const VContainer *data, QGraphicsItem *parent = nullptr); explicit VisToolLine(const VContainer *data, QGraphicsItem *parent = nullptr);
virtual ~VisToolLine() = default; ~VisToolLine() override = default;
virtual void RefreshGeometry() override; void RefreshGeometry() override;
void setPoint2Id(const quint32 &value); void VisualMode(quint32 id) override;
virtual int type() const override {return Type;}
enum { Type = UserType + static_cast<int>(Vis::ToolLine)}; void SetPoint1Id(quint32 value);
void SetPoint2Id(quint32 value);
auto type() const -> int override {return Type;}
enum {Type = UserType + static_cast<int>(Vis::ToolLine)};
protected: protected:
virtual void DrawLine(VScaledLine *lineItem, const QLineF &line, const QColor &color, void DrawLine(VScaledLine *lineItem, const QLineF &line, const QColor &color,
Qt::PenStyle style = Qt::SolidLine) override; Qt::PenStyle style = Qt::SolidLine) override;
private: private:
// cppcheck-suppress unknownMacro // cppcheck-suppress unknownMacro
Q_DISABLE_COPY_MOVE(VisToolLine) // NOLINT Q_DISABLE_COPY_MOVE(VisToolLine) // NOLINT
quint32 point2Id; quint32 m_point1Id{NULL_ID};
quint32 m_point2Id{NULL_ID};
}; };
//---------------------------------------------------------------------------------------------------------------------
inline void VisToolLine::SetPoint1Id(quint32 value)
{
m_point1Id = value;
}
//---------------------------------------------------------------------------------------------------------------------
inline void VisToolLine::SetPoint2Id(quint32 value)
{
m_point2Id = value;
}
#endif // VGRAPHICSLINEITEM_H #endif // VGRAPHICSLINEITEM_H

View File

@ -35,7 +35,6 @@
#include <QSharedPointer> #include <QSharedPointer>
#include <new> #include <new>
#include "../ifc/ifcdef.h"
#include "../vgeometry/vpointf.h" #include "../vgeometry/vpointf.h"
#include "../vpatterndb/vcontainer.h" #include "../vpatterndb/vcontainer.h"
#include "../visualization.h" #include "../visualization.h"
@ -44,63 +43,65 @@
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
VisToolLineIntersect::VisToolLineIntersect(const VContainer *data, QGraphicsItem *parent) VisToolLineIntersect::VisToolLineIntersect(const VContainer *data, QGraphicsItem *parent)
:VisLine(data, parent), line1P2Id(NULL_ID), line2P1Id(NULL_ID), line2P2Id(NULL_ID), point(nullptr), :VisLine(data, parent)
line1P1(nullptr), line1P2(nullptr), line1(nullptr), line2P1(nullptr), line2P2(nullptr)
{ {
line1P1 = InitPoint(supportColor, this); m_line1P1 = InitPoint(Color(VColor::SupportColor), this);
line1P2 = InitPoint(supportColor, this); m_line1P2 = InitPoint(Color(VColor::SupportColor), this);
line1 = InitItem<VScaledLine>(supportColor, this); m_line1 = InitItem<VScaledLine>(Color(VColor::SupportColor), this);
line2P1 = InitPoint(supportColor, this); m_line2P1 = InitPoint(Color(VColor::SupportColor), this);
line2P2 = InitPoint(supportColor, this); m_line2P2 = InitPoint(Color(VColor::SupportColor), this);
point = InitPoint(mainColor, this); m_point = InitPoint(Color(VColor::MainColor), this);
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void VisToolLineIntersect::RefreshGeometry() void VisToolLineIntersect::RefreshGeometry()
{ {
if (object1Id > NULL_ID) if (m_line1P1Id > NULL_ID)
{ {
const QSharedPointer<VPointF> first = Visualization::data->GeometricObject<VPointF>(object1Id); const QSharedPointer<VPointF> first = GetData()->GeometricObject<VPointF>(m_line1P1Id);
DrawPoint(line1P1, static_cast<QPointF>(*first), supportColor); DrawPoint(m_line1P1, static_cast<QPointF>(*first), Color(VColor::SupportColor));
if (line1P2Id <= NULL_ID) if (m_line1P2Id <= NULL_ID)
{ {
DrawLine(line1, QLineF(static_cast<QPointF>(*first), Visualization::scenePos), supportColor); DrawLine(m_line1, QLineF(static_cast<QPointF>(*first), ScenePos()), Color(VColor::SupportColor));
} }
else else
{ {
const QSharedPointer<VPointF> second = Visualization::data->GeometricObject<VPointF>(line1P2Id); const QSharedPointer<VPointF> second = GetData()->GeometricObject<VPointF>(m_line1P2Id);
DrawPoint(line1P2, static_cast<QPointF>(*second), supportColor); DrawPoint(m_line1P2, static_cast<QPointF>(*second), Color(VColor::SupportColor));
DrawLine(line1, QLineF(static_cast<QPointF>(*first), static_cast<QPointF>(*second)), supportColor); DrawLine(m_line1, QLineF(static_cast<QPointF>(*first), static_cast<QPointF>(*second)),
Color(VColor::SupportColor));
if (line2P1Id > NULL_ID) if (m_line2P1Id > NULL_ID)
{ {
const QSharedPointer<VPointF> third = Visualization::data->GeometricObject<VPointF>(line2P1Id); const QSharedPointer<VPointF> third = GetData()->GeometricObject<VPointF>(m_line2P1Id);
DrawPoint(line2P1, static_cast<QPointF>(*third), supportColor); DrawPoint(m_line2P1, static_cast<QPointF>(*third), Color(VColor::SupportColor));
if (line2P2Id <= NULL_ID) if (m_line2P2Id <= NULL_ID)
{ {
DrawLine(this, QLineF(static_cast<QPointF>(*third), Visualization::scenePos), supportColor); DrawLine(this, QLineF(static_cast<QPointF>(*third), ScenePos()),
Color(VColor::SupportColor));
QLineF l1(static_cast<QPointF>(*first), static_cast<QPointF>(*second)); QLineF l1(static_cast<QPointF>(*first), static_cast<QPointF>(*second));
QLineF l2(static_cast<QPointF>(*third), Visualization::scenePos); QLineF l2(static_cast<QPointF>(*third), ScenePos());
QPointF fPoint; QPointF fPoint;
QLineF::IntersectType intersect = Intersects(l1, l2, &fPoint); QLineF::IntersectType intersect = Intersects(l1, l2, &fPoint);
if (intersect == QLineF::UnboundedIntersection || intersect == QLineF::BoundedIntersection) if (intersect == QLineF::UnboundedIntersection || intersect == QLineF::BoundedIntersection)
{ {
DrawPoint(point, fPoint, mainColor); DrawPoint(m_point, fPoint, Color(VColor::MainColor));
} }
} }
else else
{ {
const QSharedPointer<VPointF> forth = Visualization::data->GeometricObject<VPointF>(line2P2Id); const QSharedPointer<VPointF> forth = GetData()->GeometricObject<VPointF>(m_line2P2Id);
DrawPoint(line2P2, static_cast<QPointF>(*forth), supportColor); DrawPoint(m_line2P2, static_cast<QPointF>(*forth), Color(VColor::SupportColor));
DrawLine(this, QLineF(static_cast<QPointF>(*third), static_cast<QPointF>(*forth)), supportColor); DrawLine(this, QLineF(static_cast<QPointF>(*third), static_cast<QPointF>(*forth)),
Color(VColor::SupportColor));
QLineF l1(static_cast<QPointF>(*first), static_cast<QPointF>(*second)); QLineF l1(static_cast<QPointF>(*first), static_cast<QPointF>(*second));
QLineF l2(static_cast<QPointF>(*third), static_cast<QPointF>(*forth)); QLineF l2(static_cast<QPointF>(*third), static_cast<QPointF>(*forth));
@ -109,7 +110,7 @@ void VisToolLineIntersect::RefreshGeometry()
if (intersect == QLineF::UnboundedIntersection || intersect == QLineF::BoundedIntersection) if (intersect == QLineF::UnboundedIntersection || intersect == QLineF::BoundedIntersection)
{ {
DrawPoint(point, fPoint, mainColor); DrawPoint(m_point, fPoint, Color(VColor::MainColor));
} }
} }
} }
@ -118,19 +119,8 @@ void VisToolLineIntersect::RefreshGeometry()
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void VisToolLineIntersect::setLine1P2Id(const quint32 &value) void VisToolLineIntersect::VisualMode(quint32 id)
{ {
line1P2Id = value; m_line1P1Id = id;
} StartVisualMode();
//---------------------------------------------------------------------------------------------------------------------
void VisToolLineIntersect::setLine2P1Id(const quint32 &value)
{
line2P1Id = value;
}
//---------------------------------------------------------------------------------------------------------------------
void VisToolLineIntersect::setLine2P2Id(const quint32 &value)
{
line2P2Id = value;
} }

View File

@ -44,27 +44,55 @@ class VisToolLineIntersect :public VisLine
Q_OBJECT // NOLINT Q_OBJECT // NOLINT
public: public:
explicit VisToolLineIntersect(const VContainer *data, QGraphicsItem *parent = nullptr); explicit VisToolLineIntersect(const VContainer *data, QGraphicsItem *parent = nullptr);
virtual ~VisToolLineIntersect() = default; ~VisToolLineIntersect() override = default;
virtual void RefreshGeometry() override; void RefreshGeometry() override;
void VisualMode(quint32 id) override;
void setLine1P2Id(const quint32 &value); void SetLine1P1Id(quint32 value);
void setLine2P1Id(const quint32 &value); void SetLine1P2Id(quint32 value);
void setLine2P2Id(const quint32 &value); void SetLine2P1Id(quint32 value);
virtual int type() const override {return Type;} void SetLine2P2Id(quint32 value);
enum { Type = UserType + static_cast<int>(Vis::ToolLineIntersect)};
auto type() const -> int override {return Type;}
enum {Type = UserType + static_cast<int>(Vis::ToolLineIntersect)};
private: private:
// cppcheck-suppress unknownMacro // cppcheck-suppress unknownMacro
Q_DISABLE_COPY_MOVE(VisToolLineIntersect) // NOLINT Q_DISABLE_COPY_MOVE(VisToolLineIntersect) // NOLINT
quint32 line1P2Id; quint32 m_line1P1Id{NULL_ID};
quint32 line2P1Id; quint32 m_line1P2Id{NULL_ID};
quint32 line2P2Id; quint32 m_line2P1Id{NULL_ID};
VScaledEllipse *point; quint32 m_line2P2Id{NULL_ID};
VScaledEllipse *line1P1; VScaledEllipse *m_point{nullptr};
VScaledEllipse *line1P2; VScaledEllipse *m_line1P1{nullptr};
VScaledLine *line1; VScaledEllipse *m_line1P2{nullptr};
VScaledEllipse *line2P1; VScaledLine *m_line1{nullptr};
VScaledEllipse *line2P2; VScaledEllipse *m_line2P1{nullptr};
VScaledEllipse *m_line2P2{nullptr};
}; };
//---------------------------------------------------------------------------------------------------------------------
inline void VisToolLineIntersect::SetLine1P1Id(quint32 value)
{
m_line1P1Id = value;
}
//---------------------------------------------------------------------------------------------------------------------
inline void VisToolLineIntersect::SetLine1P2Id(quint32 value)
{
m_line1P2Id = value;
}
//---------------------------------------------------------------------------------------------------------------------
inline void VisToolLineIntersect::SetLine2P1Id(quint32 value)
{
m_line2P1Id = value;
}
//---------------------------------------------------------------------------------------------------------------------
inline void VisToolLineIntersect::SetLine2P2Id(quint32 value)
{
m_line2P2Id = value;
}
#endif // VISTOOLLINEINTERSECT_H #endif // VISTOOLLINEINTERSECT_H

View File

@ -37,7 +37,6 @@
#include <new> #include <new>
#include "../../tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoollineintersectaxis.h" #include "../../tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoollineintersectaxis.h"
#include "../ifc/ifcdef.h"
#include "../vgeometry/vpointf.h" #include "../vgeometry/vpointf.h"
#include "../vpatterndb/vcontainer.h" #include "../vpatterndb/vcontainer.h"
#include "../visualization.h" #include "../visualization.h"
@ -47,97 +46,91 @@
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
VisToolLineIntersectAxis::VisToolLineIntersectAxis(const VContainer *data, QGraphicsItem *parent) VisToolLineIntersectAxis::VisToolLineIntersectAxis(const VContainer *data, QGraphicsItem *parent)
: VisLine(data, parent), point2Id(NULL_ID), axisPointId(NULL_ID), angle(-1), point(nullptr), lineP1(nullptr), : VisLine(data, parent)
lineP2(nullptr), basePoint(nullptr), baseLine(nullptr), axisLine(nullptr), line_intersection(nullptr)
{ {
this->mainColor = Qt::red; SetMainColor(Qt::red);
lineP1 = InitPoint(supportColor, this); m_lineP1 = InitPoint(Color(VColor::SupportColor), this);
lineP2 = InitPoint(supportColor, this); m_lineP2 = InitPoint(Color(VColor::SupportColor), this);
basePoint = InitPoint(supportColor, this); m_basePoint = InitPoint(Color(VColor::SupportColor), this);
baseLine = InitItem<VScaledLine>(supportColor, this); m_baseLine = InitItem<VScaledLine>(Color(VColor::SupportColor), this);
axisLine = InitItem<VScaledLine>(supportColor, this); m_axisLine = InitItem<VScaledLine>(Color(VColor::SupportColor), this);
line_intersection = InitItem<VScaledLine>(supportColor, this); m_lineIntersection = InitItem<VScaledLine>(Color(VColor::SupportColor), this);
point = InitPoint(mainColor, this); m_point = InitPoint(Color(VColor::MainColor), this);
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void VisToolLineIntersectAxis::RefreshGeometry() void VisToolLineIntersectAxis::RefreshGeometry()
{ {
if (object1Id > NULL_ID) if (m_point1Id > NULL_ID)
{ {
const QSharedPointer<VPointF> first = Visualization::data->GeometricObject<VPointF>(object1Id); const QSharedPointer<VPointF> first = GetData()->GeometricObject<VPointF>(m_point1Id);
DrawPoint(lineP1, static_cast<QPointF>(*first), supportColor); DrawPoint(m_lineP1, static_cast<QPointF>(*first), Color(VColor::SupportColor));
if (point2Id <= NULL_ID) if (m_point2Id <= NULL_ID)
{ {
DrawLine(baseLine, QLineF(static_cast<QPointF>(*first), Visualization::scenePos), supportColor); DrawLine(m_baseLine, QLineF(static_cast<QPointF>(*first), ScenePos()), Color(VColor::SupportColor));
} }
else else
{ {
const QSharedPointer<VPointF> second = Visualization::data->GeometricObject<VPointF>(point2Id); const QSharedPointer<VPointF> second = GetData()->GeometricObject<VPointF>(m_point2Id);
DrawPoint(lineP2, static_cast<QPointF>(*second), supportColor); DrawPoint(m_lineP2, static_cast<QPointF>(*second), Color(VColor::SupportColor));
const QLineF base_line(static_cast<QPointF>(*first), static_cast<QPointF>(*second)); const QLineF base_line(static_cast<QPointF>(*first), static_cast<QPointF>(*second));
DrawLine(baseLine, base_line, supportColor); DrawLine(m_baseLine, base_line, Color(VColor::SupportColor));
if (axisPointId > NULL_ID) if (m_axisPointId > NULL_ID)
{ {
QLineF axis; QLineF axis;
const QSharedPointer<VPointF> third = Visualization::data->GeometricObject<VPointF>(axisPointId); const QSharedPointer<VPointF> third = GetData()->GeometricObject<VPointF>(m_axisPointId);
if (VFuzzyComparePossibleNulls(angle, -1)) if (VFuzzyComparePossibleNulls(m_angle, -1))
{ {
axis = Axis(static_cast<QPointF>(*third), Visualization::scenePos); axis = Axis(static_cast<QPointF>(*third), ScenePos());
} }
else else
{ {
axis = Axis(static_cast<QPointF>(*third), angle); axis = Axis(static_cast<QPointF>(*third), m_angle);
} }
DrawPoint(basePoint, static_cast<QPointF>(*third), mainColor); DrawPoint(m_basePoint, static_cast<QPointF>(*third), Color(VColor::MainColor));
DrawLine(axisLine, axis, supportColor, Qt::DashLine); DrawLine(m_axisLine, axis, Color(VColor::SupportColor), Qt::DashLine);
QPointF p; QPointF p;
VToolLineIntersectAxis::FindPoint(axis, base_line, &p); VToolLineIntersectAxis::FindPoint(axis, base_line, &p);
QLineF axis_line(static_cast<QPointF>(*third), p); QLineF axis_line(static_cast<QPointF>(*third), p);
if (not axis_line.isNull()) if (not axis_line.isNull())
{ {
DrawLine(this, axis_line, mainColor, lineStyle); DrawLine(this, axis_line, Color(VColor::MainColor), LineStyle());
} }
DrawPoint(point, p, mainColor); DrawPoint(m_point, p, Color(VColor::MainColor));
ShowIntersection(axis_line, base_line); ShowIntersection(axis_line, base_line);
Visualization::toolTip = tr("<b>Intersection line and axis</b>: angle = %1°; <b>%2</b> - " SetToolTip(tr("<b>Intersection line and axis</b>: angle = %1°; <b>%2</b> - "
"sticking angle, <b>%3</b> - finish creation") "sticking angle, <b>%3</b> - finish creation")
.arg(this->line().angle()) .arg(this->line().angle())
.arg(VModifierKey::Shift(), VModifierKey::EnterKey()); .arg(VModifierKey::Shift(), VModifierKey::EnterKey()));
} }
} }
} }
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
QString VisToolLineIntersectAxis::Angle() const void VisToolLineIntersectAxis::VisualMode(quint32 id)
{ {
return QString("%1").arg(this->line().angle()); m_point1Id = id;
StartVisualMode();
}
//---------------------------------------------------------------------------------------------------------------------
auto VisToolLineIntersectAxis::Angle() const -> QString
{
return QString::number(this->line().angle());
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void VisToolLineIntersectAxis::SetAngle(const QString &expression) void VisToolLineIntersectAxis::SetAngle(const QString &expression)
{ {
angle = FindValFromUser(expression, Visualization::data->DataVariables()); m_angle = FindValFromUser(expression, GetData()->DataVariables());
}
//---------------------------------------------------------------------------------------------------------------------
void VisToolLineIntersectAxis::setPoint2Id(const quint32 &value)
{
point2Id = value;
}
//---------------------------------------------------------------------------------------------------------------------
void VisToolLineIntersectAxis::setAxisPointId(const quint32 &value)
{
axisPointId = value;
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
@ -148,11 +141,11 @@ void VisToolLineIntersectAxis::ShowIntersection(const QLineF &axis_line, const Q
if (intersect == QLineF::UnboundedIntersection) if (intersect == QLineF::UnboundedIntersection)
{ {
line_intersection->setVisible(true); m_lineIntersection->setVisible(true);
DrawLine(line_intersection, QLineF(base_line.p1(), axis_line.p2()), supportColor, Qt::DashLine); DrawLine(m_lineIntersection, QLineF(base_line.p1(), axis_line.p2()), Color(VColor::SupportColor), Qt::DashLine);
} }
else if (intersect == QLineF::BoundedIntersection || intersect == QLineF::NoIntersection) else if (intersect == QLineF::BoundedIntersection || intersect == QLineF::NoIntersection)
{ {
line_intersection->setVisible(false); m_lineIntersection->setVisible(false);
} }
} }

View File

@ -45,31 +45,53 @@ class VisToolLineIntersectAxis : public VisLine
Q_OBJECT // NOLINT Q_OBJECT // NOLINT
public: public:
explicit VisToolLineIntersectAxis(const VContainer *data, QGraphicsItem *parent = nullptr); explicit VisToolLineIntersectAxis(const VContainer *data, QGraphicsItem *parent = nullptr);
virtual ~VisToolLineIntersectAxis() = default; ~VisToolLineIntersectAxis() override = default;
virtual void RefreshGeometry() override; void RefreshGeometry() override;
void VisualMode(quint32 id) override;
QString Angle() const; auto Angle() const -> QString;
void SetAngle(const QString &expression); void SetAngle(const QString &expression);
void setPoint2Id(const quint32 &value); void SetPoint1Id(quint32 value);
void setAxisPointId(const quint32 &value); void SetPoint2Id(quint32 value);
void SetAxisPointId(quint32 value);
virtual int type() const override {return Type;} auto type() const -> int override {return Type;}
enum { Type = UserType + static_cast<int>(Vis::ToolLineIntersectAxis)}; enum {Type = UserType + static_cast<int>(Vis::ToolLineIntersectAxis)};
private: private:
// cppcheck-suppress unknownMacro // cppcheck-suppress unknownMacro
Q_DISABLE_COPY_MOVE(VisToolLineIntersectAxis) // NOLINT Q_DISABLE_COPY_MOVE(VisToolLineIntersectAxis) // NOLINT
quint32 point2Id; quint32 m_point1Id{NULL_ID};
quint32 axisPointId; quint32 m_point2Id{NULL_ID};
qreal angle; quint32 m_axisPointId{NULL_ID};
VScaledEllipse *point; qreal m_angle{-1};
VScaledEllipse *lineP1; VScaledEllipse *m_point{nullptr};
VScaledEllipse *lineP2; VScaledEllipse *m_lineP1{nullptr};
VScaledEllipse *basePoint; VScaledEllipse *m_lineP2{nullptr};
VScaledLine *baseLine; VScaledEllipse *m_basePoint{nullptr};
VScaledLine *axisLine; VScaledLine *m_baseLine{nullptr};
VScaledLine *line_intersection; VScaledLine *m_axisLine{nullptr};
void ShowIntersection(const QLineF &axis_line, const QLineF &base_line); VScaledLine *m_lineIntersection{nullptr};
void ShowIntersection(const QLineF &axis_line, const QLineF &base_line);
}; };
//---------------------------------------------------------------------------------------------------------------------
inline void VisToolLineIntersectAxis::SetPoint1Id(quint32 value)
{
m_point1Id = value;
}
//---------------------------------------------------------------------------------------------------------------------
inline void VisToolLineIntersectAxis::SetPoint2Id(quint32 value)
{
m_point2Id = value;
}
//---------------------------------------------------------------------------------------------------------------------
inline void VisToolLineIntersectAxis::SetAxisPointId(quint32 value)
{
m_axisPointId = value;
}
#endif // VISTOOLLINEINTERSECTAXIS_H #endif // VISTOOLLINEINTERSECTAXIS_H

View File

@ -47,52 +47,52 @@
VisToolNormal::VisToolNormal(const VContainer *data, QGraphicsItem *parent) VisToolNormal::VisToolNormal(const VContainer *data, QGraphicsItem *parent)
: VisLine(data, parent) : VisLine(data, parent)
{ {
this->mainColor = Qt::red; SetMainColor(Qt::red);
m_lineP1 = InitPoint(supportColor, this); m_lineP1 = InitPoint(Color(VColor::SupportColor), this);
m_lineP2 = InitPoint(supportColor, this); //-V656 m_lineP2 = InitPoint(Color(VColor::SupportColor), this); //-V656
m_line = InitItem<VScaledLine>(supportColor, this); m_line = InitItem<VScaledLine>(Color(VColor::SupportColor), this);
m_point = InitPoint(mainColor, this); m_point = InitPoint(Color(VColor::MainColor), this);
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void VisToolNormal::RefreshGeometry() void VisToolNormal::RefreshGeometry()
{ {
if (object1Id > NULL_ID) if (m_object1Id > NULL_ID)
{ {
const QSharedPointer<VPointF> first = Visualization::data->GeometricObject<VPointF>(object1Id); const QSharedPointer<VPointF> first = GetData()->GeometricObject<VPointF>(m_object1Id);
DrawPoint(m_lineP1, static_cast<QPointF>(*first), supportColor); DrawPoint(m_lineP1, static_cast<QPointF>(*first), Color(VColor::SupportColor));
if (m_object2Id <= NULL_ID) if (m_object2Id <= NULL_ID)
{ {
QLineF line_mouse(static_cast<QPointF>(*first), Visualization::scenePos); QLineF line_mouse(static_cast<QPointF>(*first), ScenePos());
DrawLine(m_line, line_mouse, supportColor); DrawLine(m_line, line_mouse, Color(VColor::SupportColor));
QLineF normal = line_mouse.normalVector(); QLineF normal = line_mouse.normalVector();
QPointF endRay = Ray(normal.p1(), normal.angle()); QPointF endRay = Ray(normal.p1(), normal.angle());
DrawLine(this, QLineF(normal.p1(), endRay), mainColor); DrawLine(this, QLineF(normal.p1(), endRay), Color(VColor::MainColor));
} }
else else
{ {
const QSharedPointer<VPointF> second = Visualization::data->GeometricObject<VPointF>(m_object2Id); const QSharedPointer<VPointF> second = GetData()->GeometricObject<VPointF>(m_object2Id);
DrawPoint(m_lineP2, static_cast<QPointF>(*second), supportColor); DrawPoint(m_lineP2, static_cast<QPointF>(*second), Color(VColor::SupportColor));
QLineF line_mouse(static_cast<QPointF>(*first), static_cast<QPointF>(*second)); QLineF line_mouse(static_cast<QPointF>(*first), static_cast<QPointF>(*second));
DrawLine(m_line, line_mouse, supportColor); DrawLine(m_line, line_mouse, Color(VColor::SupportColor));
if (not qFuzzyIsNull(m_length)) if (not qFuzzyIsNull(m_length))
{ {
QPointF fPoint = VToolNormal::FindPoint(static_cast<QPointF>(*first), static_cast<QPointF>(*second), QPointF fPoint = VToolNormal::FindPoint(static_cast<QPointF>(*first), static_cast<QPointF>(*second),
m_length, m_angle); m_length, m_angle);
QLineF mainLine = QLineF(static_cast<QPointF>(*first), fPoint); QLineF mainLine = QLineF(static_cast<QPointF>(*first), fPoint);
DrawLine(this, mainLine, mainColor, lineStyle); DrawLine(this, mainLine, Color(VColor::MainColor), LineStyle());
DrawPoint(m_point, mainLine.p2(), mainColor); DrawPoint(m_point, mainLine.p2(), Color(VColor::MainColor));
} }
else if (mode == Mode::Creation) else if (GetMode() == Mode::Creation)
{ {
QLineF cursorLine (static_cast<QPointF>(*first), Visualization::scenePos); QLineF cursorLine (static_cast<QPointF>(*first), ScenePos());
QLineF normal = line_mouse.normalVector(); QLineF normal = line_mouse.normalVector();
qreal len = cursorLine.length(); qreal len = cursorLine.length();
@ -105,36 +105,37 @@ void VisToolNormal::RefreshGeometry()
QPointF fPoint = VToolNormal::FindPoint(static_cast<QPointF>(*first), static_cast<QPointF>(*second), QPointF fPoint = VToolNormal::FindPoint(static_cast<QPointF>(*first), static_cast<QPointF>(*second),
len, m_angle); len, m_angle);
QLineF mainLine = QLineF(static_cast<QPointF>(*first), fPoint); QLineF mainLine = QLineF(static_cast<QPointF>(*first), fPoint);
DrawLine(this, mainLine, mainColor, lineStyle); DrawLine(this, mainLine, Color(VColor::MainColor), LineStyle());
DrawPoint(m_point, mainLine.p2(), mainColor); DrawPoint(m_point, mainLine.p2(), Color(VColor::MainColor));
const QString prefix = UnitsToStr(VAbstractValApplication::VApp()->patternUnits(), true); const QString prefix = UnitsToStr(VAbstractValApplication::VApp()->patternUnits(), true);
Visualization::toolTip = tr("Length = %1%2; " SetToolTip(tr("Length = %1%2; "
"<b>Mouse click</b> - finish selecting the length, " "<b>Mouse click</b> - finish selecting the length, "
"<b>%3</b> - skip") "<b>%3</b> - skip")
.arg(NumberToUser(len), prefix, VModifierKey::EnterKey()); .arg(NumberToUser(len), prefix, VModifierKey::EnterKey()));
} }
else else
{ {
QLineF normal = line_mouse.normalVector(); QLineF normal = line_mouse.normalVector();
QPointF endRay = Ray(normal.p1(), normal.angle()); QPointF endRay = Ray(normal.p1(), normal.angle());
DrawLine(this, QLineF(normal.p1(), endRay), mainColor); DrawLine(this, QLineF(normal.p1(), endRay), Color(VColor::MainColor));
} }
} }
} }
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void VisToolNormal::setObject2Id(const quint32 &value) void VisToolNormal::VisualMode(quint32 id)
{ {
m_object2Id = value; m_object1Id = id;
StartVisualMode();
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void VisToolNormal::setLength(const QString &expression) void VisToolNormal::SetLength(const QString &expression)
{ {
m_length = FindLengthFromUser(expression, Visualization::data->DataVariables()); m_length = FindLengthFromUser(expression, GetData()->DataVariables());
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------

View File

@ -47,17 +47,21 @@ public:
~VisToolNormal() override = default; ~VisToolNormal() override = default;
void RefreshGeometry() override; void RefreshGeometry() override;
void VisualMode(quint32 id) override;
void setObject2Id(const quint32 &value); void SetPoint1Id(quint32 value);
void setLength(const QString &expression); void SetPoint2Id(quint32 value);
void SetLength(const QString &expression);
auto GetAngle() const -> qreal; auto GetAngle() const -> qreal;
void SetAngle(const qreal &value); void SetAngle(const qreal &value);
auto type() const -> int override {return Type;} auto type() const -> int override {return Type;}
enum {Type = UserType + static_cast<int>(Vis::ToolNormal)}; enum {Type = UserType + static_cast<int>(Vis::ToolNormal)};
private: private:
// cppcheck-suppress unknownMacro // cppcheck-suppress unknownMacro
Q_DISABLE_COPY_MOVE(VisToolNormal) // NOLINT Q_DISABLE_COPY_MOVE(VisToolNormal) // NOLINT
quint32 m_object1Id{NULL_ID};
quint32 m_object2Id{NULL_ID}; quint32 m_object2Id{NULL_ID};
VScaledEllipse *m_point{nullptr}; VScaledEllipse *m_point{nullptr};
VScaledEllipse *m_lineP1{nullptr}; VScaledEllipse *m_lineP1{nullptr};
@ -65,7 +69,18 @@ private:
VScaledLine *m_line{nullptr}; VScaledLine *m_line{nullptr};
qreal m_length{0}; qreal m_length{0};
qreal m_angle{0}; qreal m_angle{0};
}; };
//---------------------------------------------------------------------------------------------------------------------
inline void VisToolNormal::SetPoint1Id(quint32 value)
{
m_object1Id = value;
}
//---------------------------------------------------------------------------------------------------------------------
inline void VisToolNormal::SetPoint2Id(quint32 value)
{
m_object2Id = value;
}
#endif // VISTOOLNORMAL_H #endif // VISTOOLNORMAL_H

View File

@ -37,7 +37,6 @@
#include <new> #include <new>
#include "../../tools/drawTools/toolpoint/toolsinglepoint/vtoolpointfromarcandtangent.h" #include "../../tools/drawTools/toolpoint/toolsinglepoint/vtoolpointfromarcandtangent.h"
#include "../ifc/ifcdef.h"
#include "../vgeometry/vabstractcurve.h" #include "../vgeometry/vabstractcurve.h"
#include "../vgeometry/varc.h" #include "../vgeometry/varc.h"
#include "../vgeometry/vgobject.h" #include "../vgeometry/vgobject.h"
@ -48,46 +47,40 @@
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
VisToolPointFromArcAndTangent::VisToolPointFromArcAndTangent(const VContainer *data, QGraphicsItem *parent) VisToolPointFromArcAndTangent::VisToolPointFromArcAndTangent(const VContainer *data, QGraphicsItem *parent)
: VisLine(data, parent), arcId(NULL_ID), crossPoint(CrossCirclesPoint::FirstPoint), : VisLine(data, parent)
point(nullptr), tangent(nullptr), arcPath(nullptr)
{ {
arcPath = InitItem<VCurvePathItem>(Qt::darkGreen, this); m_arcPath = InitItem<VCurvePathItem>(Qt::darkGreen, this);
point = InitPoint(mainColor, this); m_point = InitPoint(Color(VColor::MainColor), this);
tangent = InitPoint(supportColor, this); m_tangent = InitPoint(Color(VColor::SupportColor), this);
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void VisToolPointFromArcAndTangent::RefreshGeometry() void VisToolPointFromArcAndTangent::RefreshGeometry()
{ {
if (object1Id > NULL_ID)// tangent point if (m_pointId > NULL_ID)// tangent point
{ {
const QSharedPointer<VPointF> tan = Visualization::data->GeometricObject<VPointF>(object1Id); const QSharedPointer<VPointF> tan = GetData()->GeometricObject<VPointF>(m_pointId);
DrawPoint(tangent, static_cast<QPointF>(*tan), supportColor); DrawPoint(m_tangent, static_cast<QPointF>(*tan), Color(VColor::SupportColor));
if (arcId > NULL_ID)// circle center if (m_arcId > NULL_ID)// circle center
{ {
const QSharedPointer<VArc> arc = Visualization::data->GeometricObject<VArc>(arcId); const QSharedPointer<VArc> arc = GetData()->GeometricObject<VArc>(m_arcId);
DrawPath(arcPath, arc->GetPath(), arc->DirectionArrows(), Qt::darkGreen, Qt::SolidLine, Qt::RoundCap); DrawPath(m_arcPath, arc->GetPath(), arc->DirectionArrows(), Qt::darkGreen, Qt::SolidLine, Qt::RoundCap);
FindRays(static_cast<QPointF>(*tan), arc.data()); FindRays(static_cast<QPointF>(*tan), arc.data());
QPointF fPoint; QPointF fPoint;
VToolPointFromArcAndTangent::FindPoint(static_cast<QPointF>(*tan), arc.data(), crossPoint, &fPoint); VToolPointFromArcAndTangent::FindPoint(static_cast<QPointF>(*tan), arc.data(), m_crossPoint, &fPoint);
DrawPoint(point, fPoint, mainColor); DrawPoint(m_point, fPoint, Color(VColor::MainColor));
} }
} }
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void VisToolPointFromArcAndTangent::setArcId(const quint32 &value) void VisToolPointFromArcAndTangent::VisualMode(quint32 id)
{ {
arcId = value; m_pointId = id;
} StartVisualMode();
//---------------------------------------------------------------------------------------------------------------------
void VisToolPointFromArcAndTangent::setCrossPoint(const CrossCirclesPoint &value)
{
crossPoint = value;
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
@ -125,10 +118,11 @@ void VisToolPointFromArcAndTangent::FindRays(const QPointF &p, const VArc *arc)
switch(localRes) switch(localRes)
{ {
case 2: case 2:
DrawRay(this, p, crossPoint == CrossCirclesPoint::FirstPoint ? p1 : p2, supportColor, Qt::DashLine); DrawRay(this, p, m_crossPoint == CrossCirclesPoint::FirstPoint ? p1 : p2,
Color(VColor::SupportColor), Qt::DashLine);
break; break;
case 1: case 1:
DrawRay(this, p, flagP1 ? p1 : p2, supportColor, Qt::DashLine); DrawRay(this, p, flagP1 ? p1 : p2, Color(VColor::SupportColor), Qt::DashLine);
break; break;
case 0: case 0:
default: default:
@ -139,7 +133,7 @@ void VisToolPointFromArcAndTangent::FindRays(const QPointF &p, const VArc *arc)
break; break;
} }
case 1: case 1:
DrawRay(this, p, p1, supportColor, Qt::DashLine); DrawRay(this, p, p1, Color(VColor::SupportColor), Qt::DashLine);
break; break;
case 3: case 3:
case 0: case 0:

View File

@ -48,25 +48,47 @@ class VisToolPointFromArcAndTangent : public VisLine
Q_OBJECT // NOLINT Q_OBJECT // NOLINT
public: public:
explicit VisToolPointFromArcAndTangent(const VContainer *data, QGraphicsItem *parent = nullptr); explicit VisToolPointFromArcAndTangent(const VContainer *data, QGraphicsItem *parent = nullptr);
virtual ~VisToolPointFromArcAndTangent() = default; ~VisToolPointFromArcAndTangent() override = default;
virtual void RefreshGeometry() override; void RefreshGeometry() override;
void VisualMode(quint32 id) override;
void setArcId(const quint32 &value); void SetPointId(quint32 newPointId);
void setCrossPoint(const CrossCirclesPoint &value); void SetArcId(const quint32 &value);
void SetCrossPoint(const CrossCirclesPoint &value);
auto type() const -> int override {return Type;}
enum {Type = UserType + static_cast<int>(Vis::ToolPointFromArcAndTangent)};
virtual int type() const override {return Type;}
enum { Type = UserType + static_cast<int>(Vis::ToolPointFromArcAndTangent)};
private: private:
// cppcheck-suppress unknownMacro // cppcheck-suppress unknownMacro
Q_DISABLE_COPY_MOVE(VisToolPointFromArcAndTangent) // NOLINT Q_DISABLE_COPY_MOVE(VisToolPointFromArcAndTangent) // NOLINT
quint32 arcId; quint32 m_arcId{NULL_ID};
CrossCirclesPoint crossPoint; CrossCirclesPoint m_crossPoint{CrossCirclesPoint::FirstPoint};
VScaledEllipse *point; VScaledEllipse *m_point{nullptr};
VScaledEllipse *tangent; VScaledEllipse *m_tangent{nullptr};
VCurvePathItem *arcPath; VCurvePathItem *m_arcPath{nullptr};
quint32 m_pointId{NULL_ID};
void FindRays(const QPointF &p, const VArc *arc); void FindRays(const QPointF &p, const VArc *arc);
}; };
//---------------------------------------------------------------------------------------------------------------------
inline void VisToolPointFromArcAndTangent::SetPointId(quint32 newPointId)
{
m_pointId = newPointId;
}
//---------------------------------------------------------------------------------------------------------------------
inline void VisToolPointFromArcAndTangent::SetArcId(const quint32 &value)
{
m_arcId = value;
}
//---------------------------------------------------------------------------------------------------------------------
inline void VisToolPointFromArcAndTangent::SetCrossPoint(const CrossCirclesPoint &value)
{
m_crossPoint = value;
}
#endif // VISTOOLPOINTFROMARCANDTANGENT_H #endif // VISTOOLPOINTFROMARCANDTANGENT_H

View File

@ -44,61 +44,55 @@
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
VisToolPointFromCircleAndTangent::VisToolPointFromCircleAndTangent(const VContainer *data, QGraphicsItem *parent) VisToolPointFromCircleAndTangent::VisToolPointFromCircleAndTangent(const VContainer *data, QGraphicsItem *parent)
: VisLine(data, parent), object2Id(NULL_ID), cRadius(0), crossPoint(CrossCirclesPoint::FirstPoint), : VisLine(data, parent)
point(nullptr), tangent(nullptr), cCenter(nullptr), cPath(nullptr), tangent2(nullptr)
{ {
cPath = InitItem<QGraphicsEllipseItem>(Qt::darkGreen, this); m_cPath = InitItem<QGraphicsEllipseItem>(Qt::darkGreen, this);
point = InitPoint(mainColor, this); m_point = InitPoint(Color(VColor::MainColor), this);
tangent = InitPoint(supportColor, this); m_tangent = InitPoint(Color(VColor::SupportColor), this);
cCenter = InitPoint(supportColor, this); //-V656 m_cCenter = InitPoint(Color(VColor::SupportColor), this); //-V656
tangent2 = InitItem<VScaledLine>(supportColor, this); m_tangent2 = InitItem<VScaledLine>(Color(VColor::SupportColor), this);
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void VisToolPointFromCircleAndTangent::RefreshGeometry() void VisToolPointFromCircleAndTangent::RefreshGeometry()
{ {
if (object1Id > NULL_ID)// tangent point if (m_pointId > NULL_ID)// tangent point
{ {
const QSharedPointer<VPointF> tan = Visualization::data->GeometricObject<VPointF>(object1Id); const QSharedPointer<VPointF> tan = GetData()->GeometricObject<VPointF>(m_pointId);
DrawPoint(tangent, static_cast<QPointF>(*tan), supportColor); DrawPoint(m_tangent, static_cast<QPointF>(*tan), Color(VColor::SupportColor));
if (object2Id > NULL_ID)// circle center if (m_centerId > NULL_ID)// circle center
{ {
const QSharedPointer<VPointF> center = Visualization::data->GeometricObject<VPointF>(object2Id); const QSharedPointer<VPointF> center = GetData()->GeometricObject<VPointF>(m_centerId);
DrawPoint(cCenter, static_cast<QPointF>(*center), supportColor); DrawPoint(m_cCenter, static_cast<QPointF>(*center), Color(VColor::SupportColor));
if (cRadius > 0) if (m_cRadius > 0)
{ {
cPath->setRect(PointRect(cRadius)); m_cPath->setRect(PointRect(m_cRadius));
DrawPoint(cPath, static_cast<QPointF>(*center), Qt::darkGreen, Qt::DashLine); DrawPoint(m_cPath, static_cast<QPointF>(*center), Qt::darkGreen, Qt::DashLine);
FindRays(static_cast<QPointF>(*tan), static_cast<QPointF>(*center), cRadius); FindRays(static_cast<QPointF>(*tan), static_cast<QPointF>(*center), m_cRadius);
QPointF fPoint; QPointF fPoint;
VToolPointFromCircleAndTangent::FindPoint(static_cast<QPointF>(*tan), static_cast<QPointF>(*center), VToolPointFromCircleAndTangent::FindPoint(static_cast<QPointF>(*tan), static_cast<QPointF>(*center),
cRadius, crossPoint, &fPoint); m_cRadius, m_crossPoint, &fPoint);
DrawPoint(point, fPoint, mainColor); DrawPoint(m_point, fPoint, Color(VColor::MainColor));
} }
} }
} }
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void VisToolPointFromCircleAndTangent::setObject2Id(const quint32 &value) void VisToolPointFromCircleAndTangent::VisualMode(quint32 id)
{ {
object2Id = value; m_pointId = id;
StartVisualMode();
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void VisToolPointFromCircleAndTangent::setCRadius(const QString &value) void VisToolPointFromCircleAndTangent::SetCRadius(const QString &value)
{ {
cRadius = FindLengthFromUser(value, Visualization::data->DataVariables()); m_cRadius = FindLengthFromUser(value, GetData()->DataVariables());
}
//---------------------------------------------------------------------------------------------------------------------
void VisToolPointFromCircleAndTangent::setCrossPoint(const CrossCirclesPoint &value)
{
crossPoint = value;
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
@ -110,16 +104,16 @@ void VisToolPointFromCircleAndTangent::FindRays(const QPointF &p, const QPointF
switch(res) switch(res)
{ {
case 2: case 2:
DrawRay(this, p, p1, supportColor, Qt::DashLine); DrawRay(this, p, p1, Color(VColor::SupportColor), Qt::DashLine);
DrawRay(tangent2, p, p2, supportColor, Qt::DashLine); DrawRay(m_tangent2, p, p2, Color(VColor::SupportColor), Qt::DashLine);
break; break;
case 1: case 1:
DrawRay(this, p, p1, supportColor, Qt::DashLine); DrawRay(this, p, p1, Color(VColor::SupportColor), Qt::DashLine);
tangent2->setVisible(false); m_tangent2->setVisible(false);
break; break;
default: default:
this->setVisible(false); this->setVisible(false);
tangent2->setVisible(false); m_tangent2->setVisible(false);
break; break;
} }
} }

View File

@ -46,29 +46,50 @@ class VisToolPointFromCircleAndTangent : public VisLine
Q_OBJECT // NOLINT Q_OBJECT // NOLINT
public: public:
explicit VisToolPointFromCircleAndTangent(const VContainer *data, QGraphicsItem *parent = nullptr); explicit VisToolPointFromCircleAndTangent(const VContainer *data, QGraphicsItem *parent = nullptr);
virtual ~VisToolPointFromCircleAndTangent() = default; ~VisToolPointFromCircleAndTangent() override = default;
virtual void RefreshGeometry() override; void RefreshGeometry() override;
void VisualMode(quint32 id) override;
void setObject2Id(const quint32 &value); void SetPointId(quint32 value);
void setCRadius(const QString &value); void SetCenterId(quint32 value);
void setCrossPoint(const CrossCirclesPoint &value); void SetCRadius(const QString &value);
void SetCrossPoint(CrossCirclesPoint value);
virtual int type() const override {return Type;} auto type() const -> int override {return Type;}
enum { Type = UserType + static_cast<int>(Vis::ToolPointFromCircleAndTangent)}; enum {Type = UserType + static_cast<int>(Vis::ToolPointFromCircleAndTangent)};
private: private:
// cppcheck-suppress unknownMacro // cppcheck-suppress unknownMacro
Q_DISABLE_COPY_MOVE(VisToolPointFromCircleAndTangent) // NOLINT Q_DISABLE_COPY_MOVE(VisToolPointFromCircleAndTangent) // NOLINT
quint32 object2Id; quint32 m_centerId{NULL_ID};
qreal cRadius; qreal m_cRadius{0};
CrossCirclesPoint crossPoint; CrossCirclesPoint m_crossPoint{CrossCirclesPoint::FirstPoint};
VScaledEllipse *point; VScaledEllipse *m_point{nullptr};
VScaledEllipse *tangent; VScaledEllipse *m_tangent{nullptr};
VScaledEllipse *cCenter; VScaledEllipse *m_cCenter{nullptr};
QGraphicsEllipseItem *cPath; QGraphicsEllipseItem *m_cPath{nullptr};
VScaledLine *tangent2; VScaledLine *m_tangent2{nullptr};
quint32 m_pointId{NULL_ID};
void FindRays(const QPointF &p, const QPointF &center, qreal radius); void FindRays(const QPointF &p, const QPointF &center, qreal radius);
}; };
//---------------------------------------------------------------------------------------------------------------------
inline void VisToolPointFromCircleAndTangent::SetPointId(quint32 value)
{
m_pointId = value;
}
//---------------------------------------------------------------------------------------------------------------------
inline void VisToolPointFromCircleAndTangent::SetCenterId(quint32 value)
{
m_centerId = value;
}
//---------------------------------------------------------------------------------------------------------------------
inline void VisToolPointFromCircleAndTangent::SetCrossPoint(CrossCirclesPoint value)
{
m_crossPoint = value;
}
#endif // VISTOOLPOINTFROMCIRCLEANDTANGENT_H #endif // VISTOOLPOINTFROMCIRCLEANDTANGENT_H

View File

@ -44,49 +44,49 @@
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
VisToolPointOfContact::VisToolPointOfContact(const VContainer *data, QGraphicsItem *parent) VisToolPointOfContact::VisToolPointOfContact(const VContainer *data, QGraphicsItem *parent)
:VisLine(data, parent), lineP2Id(NULL_ID), radiusId(NULL_ID), point(nullptr), lineP1(nullptr), lineP2(nullptr), :VisLine(data, parent)
arc_point(nullptr), circle(nullptr), radius(0)
{ {
arc_point = InitPoint(supportColor, this); m_arcPoint = InitPoint(Color(VColor::SupportColor), this);
lineP1 = InitPoint(supportColor, this); m_lineP1 = InitPoint(Color(VColor::SupportColor), this);
lineP2 = InitPoint(supportColor, this); m_lineP2 = InitPoint(Color(VColor::SupportColor), this);
circle = InitItem<QGraphicsEllipseItem>(supportColor, this); m_circle = InitItem<QGraphicsEllipseItem>(Color(VColor::SupportColor), this);
point = InitPoint(mainColor, this); m_point = InitPoint(Color(VColor::MainColor), this);
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void VisToolPointOfContact::RefreshGeometry() void VisToolPointOfContact::RefreshGeometry()
{ {
if (object1Id > NULL_ID) if (m_lineP1Id > NULL_ID)
{ {
const QSharedPointer<VPointF> first = Visualization::data->GeometricObject<VPointF>(object1Id); const QSharedPointer<VPointF> first = GetData()->GeometricObject<VPointF>(m_lineP1Id);
DrawPoint(lineP1, static_cast<QPointF>(*first), supportColor); DrawPoint(m_lineP1, static_cast<QPointF>(*first), Color(VColor::SupportColor));
if (lineP2Id <= NULL_ID) if (m_lineP2Id <= NULL_ID)
{ {
DrawLine(this, QLineF(static_cast<QPointF>(*first), Visualization::scenePos), supportColor); DrawLine(this, QLineF(static_cast<QPointF>(*first), ScenePos()), Color(VColor::SupportColor));
} }
else else
{ {
const QSharedPointer<VPointF> second = Visualization::data->GeometricObject<VPointF>(lineP2Id); const QSharedPointer<VPointF> second = GetData()->GeometricObject<VPointF>(m_lineP2Id);
DrawPoint(lineP2, static_cast<QPointF>(*second), supportColor); DrawPoint(m_lineP2, static_cast<QPointF>(*second), Color(VColor::SupportColor));
DrawLine(this, QLineF(static_cast<QPointF>(*first), static_cast<QPointF>(*second)), supportColor); DrawLine(this, QLineF(static_cast<QPointF>(*first), static_cast<QPointF>(*second)),
Color(VColor::SupportColor));
if (radiusId > NULL_ID) if (m_radiusId > NULL_ID)
{ {
const QSharedPointer<VPointF> third = Visualization::data->GeometricObject<VPointF>(radiusId); const QSharedPointer<VPointF> third = GetData()->GeometricObject<VPointF>(m_radiusId);
DrawPoint(arc_point, static_cast<QPointF>(*third), supportColor); DrawPoint(m_arcPoint, static_cast<QPointF>(*third), Color(VColor::SupportColor));
if (not qFuzzyIsNull(radius)) if (not qFuzzyIsNull(m_radius))
{ {
QPointF fPoint; QPointF fPoint;
VToolPointOfContact::FindPoint(radius, static_cast<QPointF>(*third), static_cast<QPointF>(*first), VToolPointOfContact::FindPoint(m_radius, static_cast<QPointF>(*third), static_cast<QPointF>(*first),
static_cast<QPointF>(*second), &fPoint); static_cast<QPointF>(*second), &fPoint);
DrawPoint(point, fPoint, mainColor); DrawPoint(m_point, fPoint, Color(VColor::MainColor));
circle->setRect(PointRect(radius)); m_circle->setRect(PointRect(m_radius));
DrawPoint(circle, static_cast<QPointF>(*third), supportColor, Qt::DashLine); DrawPoint(m_circle, static_cast<QPointF>(*third), Color(VColor::SupportColor), Qt::DashLine);
} }
} }
} }
@ -94,19 +94,14 @@ void VisToolPointOfContact::RefreshGeometry()
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void VisToolPointOfContact::setLineP2Id(const quint32 &value) void VisToolPointOfContact::VisualMode(quint32 id)
{ {
lineP2Id = value; m_lineP1Id = id;
StartVisualMode();
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void VisToolPointOfContact::setRadiusId(const quint32 &value) void VisToolPointOfContact::SetRadius(const QString &expression)
{ {
radiusId = value; m_radius = FindLengthFromUser(expression, GetData()->DataVariables());
}
//---------------------------------------------------------------------------------------------------------------------
void VisToolPointOfContact::setRadius(const QString &expression)
{
radius = FindLengthFromUser(expression, Visualization::data->DataVariables());
} }

Some files were not shown because too many files have changed in this diff Show More