Refactoring.

This commit is contained in:
Roman Telezhynskyi 2022-08-22 09:15:09 +03:00
parent 097b08af6f
commit cf4145dd94
29 changed files with 78 additions and 20 deletions

View File

@ -197,12 +197,12 @@ void DialogAlongLine::ChosenObject(quint32 id, const SceneObject &type)
SCASSERT(line != nullptr) SCASSERT(line != nullptr)
const QString toolTip = tr("Select second point of line"); const QString toolTip = tr("Select second point of line");
switch (number) switch (m_number)
{ {
case 0: case 0:
if (SetObject(id, ui->comboBoxFirstPoint, toolTip)) if (SetObject(id, ui->comboBoxFirstPoint, toolTip))
{ {
number++; m_number++;
line->VisualMode(id); line->VisualMode(id);
} }
break; break;

View File

@ -118,6 +118,9 @@ private:
bool m_firstRelease{false}; bool m_firstRelease{false};
/** @brief number number of handled objects */
qint32 m_number{0};
void SetCurrentLength(); void SetCurrentLength();
void ChosenSecondPoint(quint32 id, const QString &toolTip); void ChosenSecondPoint(quint32 id, const QString &toolTip);

View File

@ -203,12 +203,12 @@ void DialogBisector::ChosenObject(quint32 id, const SceneObject &type)
auto *line = qobject_cast<VisToolBisector *>(vis); auto *line = qobject_cast<VisToolBisector *>(vis);
SCASSERT(line != nullptr) SCASSERT(line != nullptr)
switch (number) switch (m_number)
{ {
case 0: case 0:
if (SetObject(id, ui->comboBoxFirstPoint, tr("Select second point of angle"))) if (SetObject(id, ui->comboBoxFirstPoint, tr("Select second point of angle")))
{ {
number++; m_number++;
line->VisualMode(id); line->VisualMode(id);
} }
break; break;
@ -217,7 +217,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")))
{ {
number++; m_number++;
line->setObject2Id(id); line->setObject2Id(id);
line->RefreshGeometry(); line->RefreshGeometry();
} }

View File

@ -118,6 +118,9 @@ private:
bool m_firstRelease{false}; bool m_firstRelease{false};
/** @brief number number of handled objects */
qint32 m_number{0};
void ChosenThirdPoint(quint32 id); void ChosenThirdPoint(quint32 id);
}; };

View File

@ -85,6 +85,9 @@ private:
QString originAliasSuffix{}; QString originAliasSuffix{};
/** @brief number number of handled objects */
qint32 number{0};
const QSharedPointer<VPointF> GetP1() const; const QSharedPointer<VPointF> GetP1() const;
const QSharedPointer<VPointF> GetP2() const; const QSharedPointer<VPointF> GetP2() const;
const QSharedPointer<VPointF> GetP3() const; const QSharedPointer<VPointF> GetP3() const;

View File

@ -114,6 +114,9 @@ private:
QString originAliasSuffix1{}; QString originAliasSuffix1{};
QString originAliasSuffix2{}; QString originAliasSuffix2{};
/** @brief number number of handled objects */
qint32 number{0};
}; };
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------

View File

@ -123,6 +123,9 @@ private:
QStringList m_groupTags{}; QStringList m_groupTags{};
/** @brief number number of handled objects */
qint32 number{0};
void FillSourceList(); void FillSourceList();
void ValidateSourceAliases(); void ValidateSourceAliases();

View File

@ -198,12 +198,12 @@ void DialogHeight::ChosenObject(quint32 id, const SceneObject &type)
auto *line = qobject_cast<VisToolHeight *>(vis); auto *line = qobject_cast<VisToolHeight *>(vis);
SCASSERT(line != nullptr) SCASSERT(line != nullptr)
switch (number) switch (m_number)
{ {
case (0): case (0):
if (SetObject(id, ui->comboBoxBasePoint, tr("Select first point of line"))) if (SetObject(id, ui->comboBoxBasePoint, tr("Select first point of line")))
{ {
number++; m_number++;
line->VisualMode(id); line->VisualMode(id);
} }
break; break;
@ -212,7 +212,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")))
{ {
number++; m_number++;
line->setLineP1Id(id); line->setLineP1Id(id);
line->RefreshGeometry(); line->RefreshGeometry();
} }

View File

@ -93,6 +93,9 @@ private:
bool m_flagError{true}; bool m_flagError{true};
bool m_flagName{true}; bool m_flagName{true};
/** @brief number number of handled objects */
qint32 m_number{0};
}; };
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------

View File

@ -84,6 +84,9 @@ private:
Ui::DialogLine *ui; Ui::DialogLine *ui;
bool flagError; bool flagError;
/** @brief number number of handled objects */
qint32 number{0};
}; };
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------

View File

@ -96,6 +96,9 @@ private:
bool flagName; bool flagName;
/** @brief number number of handled objects */
qint32 number{0};
bool CheckIntersecion(); bool CheckIntersecion();
}; };

View File

@ -106,6 +106,9 @@ private:
bool flagFormula; bool flagFormula;
bool flagError; bool flagError;
bool flagName; bool flagName;
/** @brief number number of handled objects */
qint32 number{0};
}; };
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------

View File

@ -203,12 +203,12 @@ void DialogNormal::ChosenObject(quint32 id, const SceneObject &type)
auto *line = qobject_cast<VisToolNormal *>(vis); auto *line = qobject_cast<VisToolNormal *>(vis);
SCASSERT(line != nullptr) SCASSERT(line != nullptr)
switch (number) switch (m_number)
{ {
case 0: case 0:
if (SetObject(id, ui->comboBoxFirstPoint, tr("Select second point of line"))) if (SetObject(id, ui->comboBoxFirstPoint, tr("Select second point of line")))
{ {
number++; m_number++;
line->VisualMode(id); line->VisualMode(id);
} }
break; break;

View File

@ -119,6 +119,9 @@ private:
bool m_flagError{true}; bool m_flagError{true};
bool m_firstRelease{false}; bool m_firstRelease{false};
/** @brief number number of handled objects */
qint32 m_number{0};
}; };
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------

View File

@ -86,6 +86,9 @@ private:
QString pointName; QString pointName;
bool flagName; bool flagName;
/** @brief number number of handled objects */
qint32 number{0};
}; };
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------

View File

@ -99,6 +99,8 @@ private:
bool flagCircleRadius; bool flagCircleRadius;
bool flagName; bool flagName;
bool flagError; bool flagError;
/** @brief number number of handled objects */
qint32 number{0};
}; };
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------

View File

@ -107,6 +107,9 @@ private:
bool flagFormula; bool flagFormula;
bool flagName; bool flagName;
bool flagError; bool flagError;
/** @brief number number of handled objects */
qint32 number{0};
}; };
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------

View File

@ -84,6 +84,9 @@ private:
bool flagName; bool flagName;
bool flagError; bool flagError;
/** @brief number number of handled objects */
qint32 number{0};
}; };
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------

View File

@ -88,6 +88,9 @@ private:
bool flagName; bool flagName;
bool flagError; bool flagError;
/** @brief number number of handled objects */
qint32 number{0};
}; };
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------

View File

@ -255,12 +255,12 @@ void DialogPointOfIntersectionCircles::ChosenObject(quint32 id, const SceneObjec
auto *point = qobject_cast<VisToolPointOfIntersectionCircles *>(vis); auto *point = qobject_cast<VisToolPointOfIntersectionCircles *>(vis);
SCASSERT(point != nullptr) SCASSERT(point != nullptr)
switch (number) switch (m_number)
{ {
case 0: case 0:
if (SetObject(id, ui->comboBoxCircle1Center, tr("Select second circle center"))) if (SetObject(id, ui->comboBoxCircle1Center, tr("Select second circle center")))
{ {
number++; m_number++;
point->VisualMode(id); point->VisualMode(id);
} }
break; break;
@ -269,7 +269,7 @@ void DialogPointOfIntersectionCircles::ChosenObject(quint32 id, const SceneObjec
{ {
if (SetObject(id, ui->comboBoxCircle2Center, QString())) if (SetObject(id, ui->comboBoxCircle2Center, QString()))
{ {
number = 0; m_number = 0;
point->setObject2Id(id); point->setObject2Id(id);
point->RefreshGeometry(); point->RefreshGeometry();
prepare = true; prepare = true;

View File

@ -115,6 +115,9 @@ private:
bool m_flagCircle2Radius{false}; bool m_flagCircle2Radius{false};
bool m_flagName{true}; bool m_flagName{true};
bool m_flagError{true}; bool m_flagError{true};
/** @brief number number of handled objects */
qint32 m_number{0};
}; };
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------

View File

@ -115,6 +115,9 @@ private:
QString originCurve1AliasSuffix2{}; QString originCurve1AliasSuffix2{};
QString originCurve2AliasSuffix1{}; QString originCurve2AliasSuffix1{};
QString originCurve2AliasSuffix2{}; QString originCurve2AliasSuffix2{};
/** @brief number number of handled objects */
qint32 number{0};
}; };
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------

View File

@ -201,12 +201,12 @@ void DialogShoulderPoint::ChosenObject(quint32 id, const SceneObject &type)
auto *line = qobject_cast<VisToolShoulderPoint *>(vis); auto *line = qobject_cast<VisToolShoulderPoint *>(vis);
SCASSERT(line != nullptr) SCASSERT(line != nullptr)
switch (number) switch (m_number)
{ {
case 0: case 0:
if (SetObject(id, ui->comboBoxP3, tr("Select first point of line"))) if (SetObject(id, ui->comboBoxP3, tr("Select first point of line")))
{ {
number++; m_number++;
line->VisualMode(id); line->VisualMode(id);
} }
break; break;
@ -215,7 +215,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")))
{ {
number++; m_number++;
line->setLineP1Id(id); line->setLineP1Id(id);
line->RefreshGeometry(); line->RefreshGeometry();
} }

View File

@ -117,6 +117,9 @@ private:
bool m_firstRelease{false}; bool m_firstRelease{false};
/** @brief number number of handled objects */
qint32 m_number{0};
void ChosenThirdPoint(quint32 id); void ChosenThirdPoint(quint32 id);
}; };

View File

@ -123,6 +123,9 @@ private:
QString originAliasSuffix{}; QString originAliasSuffix{};
/** @brief number number of handled objects */
qint32 number{0};
const QSharedPointer<VPointF> GetP1() const; const QSharedPointer<VPointF> GetP1() const;
const QSharedPointer<VPointF> GetP4() const; const QSharedPointer<VPointF> GetP4() const;

View File

@ -94,7 +94,6 @@ DialogTool::DialogTool(const VContainer *data, quint32 toolId, QWidget *parent)
associatedTool(nullptr), associatedTool(nullptr),
toolId(toolId), toolId(toolId),
prepare(false), prepare(false),
number(0),
vis(nullptr) vis(nullptr)
{ {
SCASSERT(data != nullptr) SCASSERT(data != nullptr)

View File

@ -148,9 +148,6 @@ protected:
/** @brief prepare show if we prepare. Show dialog after finish working with visual part of tool*/ /** @brief prepare show if we prepare. Show dialog after finish working with visual part of tool*/
bool prepare; bool prepare;
/** @brief number number of handled objects */
qint32 number;
QPointer<Visualization> vis; QPointer<Visualization> vis;
virtual void closeEvent ( QCloseEvent * event ) override; virtual void closeEvent ( QCloseEvent * event ) override;

View File

@ -90,6 +90,9 @@ private:
bool flagName; bool flagName;
bool flagError; bool flagError;
/** @brief number number of handled objects */
qint32 number{0};
}; };
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------

View File

@ -101,6 +101,9 @@ private:
bool flagName2; bool flagName2;
bool flagError; bool flagError;
/** @brief number number of handled objects */
qint32 number{0};
void NameChanged(QLabel *labelEditNamePoint, const QString &pointD1Name, const QString &pointD2Name, void NameChanged(QLabel *labelEditNamePoint, const QString &pointD1Name, const QString &pointD2Name,
QLineEdit *secondPointName, bool &flagName); QLineEdit *secondPointName, bool &flagName);