Refactoring. New parent class VInteractiveTool.
Helps to share info about tool dialog. --HG-- branch : release
This commit is contained in:
parent
e8917bd10d
commit
c5957846b6
|
@ -107,7 +107,7 @@ MainWindow::MainWindow(QWidget *parent)
|
||||||
mouseCoordinate(nullptr), helpLabel(nullptr), isInitialized(false), mChanges(false), mChangesAsked(true),
|
mouseCoordinate(nullptr), helpLabel(nullptr), isInitialized(false), mChanges(false), mChangesAsked(true),
|
||||||
patternReadOnly(false),
|
patternReadOnly(false),
|
||||||
dialogTable(nullptr),
|
dialogTable(nullptr),
|
||||||
dialogTool(nullptr),
|
dialogTool(),
|
||||||
dialogHistory(nullptr), comboBoxDraws(nullptr), patternPieceLabel(nullptr), mode(Draw::Calculation),
|
dialogHistory(nullptr), comboBoxDraws(nullptr), patternPieceLabel(nullptr), mode(Draw::Calculation),
|
||||||
currentDrawIndex(0), currentToolBoxIndex(0),
|
currentDrawIndex(0), currentToolBoxIndex(0),
|
||||||
isDockToolOptionsVisible(true),
|
isDockToolOptionsVisible(true),
|
||||||
|
@ -566,7 +566,7 @@ void MainWindow::SetToolButton(bool checked, Tool t, const QString &cursor, cons
|
||||||
ui->view->setCursor(cur);
|
ui->view->setCursor(cur);
|
||||||
helpLabel->setText(toolTip);
|
helpLabel->setText(toolTip);
|
||||||
ui->view->setShowToolOptions(false);
|
ui->view->setShowToolOptions(false);
|
||||||
dialogTool = new Dialog(pattern, 0, this);
|
dialogTool = QSharedPointer<Dialog>(new Dialog(pattern, 0, this));
|
||||||
|
|
||||||
switch(t)
|
switch(t)
|
||||||
{
|
{
|
||||||
|
@ -1134,7 +1134,7 @@ void MainWindow::ClosedDialogGroup(int result)
|
||||||
SCASSERT(dialogTool != nullptr)
|
SCASSERT(dialogTool != nullptr)
|
||||||
if (result == QDialog::Accepted)
|
if (result == QDialog::Accepted)
|
||||||
{
|
{
|
||||||
DialogGroup *dialog = qobject_cast<DialogGroup*>(dialogTool);
|
QSharedPointer<DialogGroup> dialog = dialogTool.objectCast<DialogGroup>();
|
||||||
SCASSERT(dialog != nullptr)
|
SCASSERT(dialog != nullptr)
|
||||||
const QDomElement group = doc->CreateGroup(VContainer::getNextId(), dialog->GetName(), dialog->GetGroup());
|
const QDomElement group = doc->CreateGroup(VContainer::getNextId(), dialog->GetName(), dialog->GetGroup());
|
||||||
if (not group.isNull())
|
if (not group.isNull())
|
||||||
|
@ -1177,8 +1177,8 @@ void MainWindow::ClosedDialogInsertNode(int result)
|
||||||
SCASSERT(dialogTool != nullptr);
|
SCASSERT(dialogTool != nullptr);
|
||||||
if (result == QDialog::Accepted)
|
if (result == QDialog::Accepted)
|
||||||
{
|
{
|
||||||
DialogInsertNode *dTool = qobject_cast<DialogInsertNode*>(dialogTool);
|
QSharedPointer<DialogInsertNode> dTool = dialogTool.objectCast<DialogInsertNode>();
|
||||||
SCASSERT(dTool != nullptr);
|
SCASSERT(dTool != nullptr)
|
||||||
VToolSeamAllowance::InsertNode(dTool->GetNode(), dTool->GetPieceId(), sceneDetails, pattern, doc);
|
VToolSeamAllowance::InsertNode(dTool->GetNode(), dTool->GetPieceId(), sceneDetails, pattern, doc);
|
||||||
}
|
}
|
||||||
ArrowTool();
|
ArrowTool();
|
||||||
|
@ -1910,7 +1910,7 @@ void MainWindow::CancelTool()
|
||||||
Q_STATIC_ASSERT_X(static_cast<int>(Tool::LAST_ONE_DO_NOT_USE) == 53, "Not all tools were handled.");
|
Q_STATIC_ASSERT_X(static_cast<int>(Tool::LAST_ONE_DO_NOT_USE) == 53, "Not all tools were handled.");
|
||||||
|
|
||||||
qCDebug(vMainWindow, "Canceling tool.");
|
qCDebug(vMainWindow, "Canceling tool.");
|
||||||
delete dialogTool;
|
dialogTool.clear();
|
||||||
qCDebug(vMainWindow, "Dialog closed.");
|
qCDebug(vMainWindow, "Dialog closed.");
|
||||||
|
|
||||||
currentScene->setFocus(Qt::OtherFocusReason);
|
currentScene->setFocus(Qt::OtherFocusReason);
|
||||||
|
|
|
@ -224,7 +224,7 @@ private:
|
||||||
bool patternReadOnly;
|
bool patternReadOnly;
|
||||||
|
|
||||||
QPointer<DialogIncrements> dialogTable;
|
QPointer<DialogIncrements> dialogTable;
|
||||||
QPointer<DialogTool> dialogTool;
|
QSharedPointer<DialogTool> dialogTool;
|
||||||
QPointer<DialogHistory> dialogHistory;
|
QPointer<DialogHistory> dialogHistory;
|
||||||
|
|
||||||
/** @brief comboBoxDraws comboc who show name of pattern peaces. */
|
/** @brief comboBoxDraws comboc who show name of pattern peaces. */
|
||||||
|
|
|
@ -69,21 +69,21 @@ const QString VToolFlippingByAxis::ToolType = QStringLiteral("flippingByAxis");
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VToolFlippingByAxis::setDialog()
|
void VToolFlippingByAxis::setDialog()
|
||||||
{
|
{
|
||||||
SCASSERT(dialog != nullptr)
|
SCASSERT(not m_dialog.isNull())
|
||||||
DialogFlippingByAxis *dialogTool = qobject_cast<DialogFlippingByAxis*>(dialog);
|
QSharedPointer<DialogFlippingByAxis> dialogTool = m_dialog.objectCast<DialogFlippingByAxis>();
|
||||||
SCASSERT(dialogTool != nullptr)
|
SCASSERT(not dialogTool.isNull())
|
||||||
dialogTool->SetOriginPointId(m_originPointId);
|
dialogTool->SetOriginPointId(m_originPointId);
|
||||||
dialogTool->SetAxisType(m_axisType);
|
dialogTool->SetAxisType(m_axisType);
|
||||||
dialogTool->SetSuffix(suffix);
|
dialogTool->SetSuffix(suffix);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
VToolFlippingByAxis *VToolFlippingByAxis::Create(DialogTool *dialog, VMainGraphicsScene *scene, VAbstractPattern *doc,
|
VToolFlippingByAxis *VToolFlippingByAxis::Create(QSharedPointer<DialogTool> dialog, VMainGraphicsScene *scene,
|
||||||
VContainer *data)
|
VAbstractPattern *doc, VContainer *data)
|
||||||
{
|
{
|
||||||
SCASSERT(dialog != nullptr)
|
SCASSERT(not dialog.isNull())
|
||||||
DialogFlippingByAxis *dialogTool = qobject_cast<DialogFlippingByAxis*>(dialog);
|
QSharedPointer<DialogFlippingByAxis> dialogTool = dialog.objectCast<DialogFlippingByAxis>();
|
||||||
SCASSERT(dialogTool != nullptr)
|
SCASSERT(not dialogTool.isNull())
|
||||||
const quint32 originPointId = dialogTool->GetOriginPointId();
|
const quint32 originPointId = dialogTool->GetOriginPointId();
|
||||||
const AxisType axisType = dialogTool->GetAxisType();
|
const AxisType axisType = dialogTool->GetAxisType();
|
||||||
const QString suffix = dialogTool->GetSuffix();
|
const QString suffix = dialogTool->GetSuffix();
|
||||||
|
@ -92,7 +92,7 @@ VToolFlippingByAxis *VToolFlippingByAxis::Create(DialogTool *dialog, VMainGraphi
|
||||||
scene, doc, data, Document::FullParse, Source::FromGui);
|
scene, doc, data, Document::FullParse, Source::FromGui);
|
||||||
if (operation != nullptr)
|
if (operation != nullptr)
|
||||||
{
|
{
|
||||||
operation->dialog = dialogTool;
|
operation->m_dialog = dialogTool;
|
||||||
}
|
}
|
||||||
return operation;
|
return operation;
|
||||||
}
|
}
|
||||||
|
@ -185,9 +185,9 @@ void VToolFlippingByAxis::SetVisualization()
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VToolFlippingByAxis::SaveDialog(QDomElement &domElement)
|
void VToolFlippingByAxis::SaveDialog(QDomElement &domElement)
|
||||||
{
|
{
|
||||||
SCASSERT(dialog != nullptr)
|
SCASSERT(not m_dialog.isNull())
|
||||||
DialogFlippingByAxis *dialogTool = qobject_cast<DialogFlippingByAxis*>(dialog);
|
QSharedPointer<DialogFlippingByAxis> dialogTool = m_dialog.objectCast<DialogFlippingByAxis>();
|
||||||
SCASSERT(dialogTool != nullptr)
|
SCASSERT(not dialogTool.isNull())
|
||||||
|
|
||||||
doc->SetAttribute(domElement, AttrCenter, QString().setNum(dialogTool->GetOriginPointId()));
|
doc->SetAttribute(domElement, AttrCenter, QString().setNum(dialogTool->GetOriginPointId()));
|
||||||
doc->SetAttribute(domElement, AttrAxisType, QString().setNum(static_cast<int>(dialogTool->GetAxisType())));
|
doc->SetAttribute(domElement, AttrAxisType, QString().setNum(static_cast<int>(dialogTool->GetAxisType())));
|
||||||
|
|
|
@ -39,8 +39,8 @@ class VToolFlippingByAxis : public VAbstractFlipping
|
||||||
public:
|
public:
|
||||||
virtual ~VToolFlippingByAxis() Q_DECL_EQ_DEFAULT;
|
virtual ~VToolFlippingByAxis() Q_DECL_EQ_DEFAULT;
|
||||||
virtual void setDialog() Q_DECL_OVERRIDE;
|
virtual void setDialog() Q_DECL_OVERRIDE;
|
||||||
static VToolFlippingByAxis* Create(DialogTool *dialog, VMainGraphicsScene *scene, VAbstractPattern *doc,
|
static VToolFlippingByAxis* Create(QSharedPointer<DialogTool> dialog, VMainGraphicsScene *scene,
|
||||||
VContainer *data);
|
VAbstractPattern *doc, VContainer *data);
|
||||||
static VToolFlippingByAxis* Create(const quint32 _id, quint32 originPointId, AxisType axisType,
|
static VToolFlippingByAxis* Create(const quint32 _id, quint32 originPointId, AxisType axisType,
|
||||||
const QString &suffix, const QVector<quint32> &source,
|
const QString &suffix, const QVector<quint32> &source,
|
||||||
const QVector<DestinationItem> &destination, VMainGraphicsScene *scene,
|
const QVector<DestinationItem> &destination, VMainGraphicsScene *scene,
|
||||||
|
|
|
@ -69,21 +69,21 @@ const QString VToolFlippingByLine::ToolType = QStringLiteral("flippingByLine");
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VToolFlippingByLine::setDialog()
|
void VToolFlippingByLine::setDialog()
|
||||||
{
|
{
|
||||||
SCASSERT(dialog != nullptr)
|
SCASSERT(not m_dialog.isNull())
|
||||||
DialogFlippingByLine *dialogTool = qobject_cast<DialogFlippingByLine*>(dialog);
|
QSharedPointer<DialogFlippingByLine> dialogTool = m_dialog.objectCast<DialogFlippingByLine>();
|
||||||
SCASSERT(dialogTool != nullptr)
|
SCASSERT(not dialogTool.isNull())
|
||||||
dialogTool->SetFirstLinePointId(m_firstLinePointId);
|
dialogTool->SetFirstLinePointId(m_firstLinePointId);
|
||||||
dialogTool->SetSecondLinePointId(m_secondLinePointId);
|
dialogTool->SetSecondLinePointId(m_secondLinePointId);
|
||||||
dialogTool->SetSuffix(suffix);
|
dialogTool->SetSuffix(suffix);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
VToolFlippingByLine *VToolFlippingByLine::Create(DialogTool *dialog, VMainGraphicsScene *scene, VAbstractPattern *doc,
|
VToolFlippingByLine *VToolFlippingByLine::Create(QSharedPointer<DialogTool> dialog, VMainGraphicsScene *scene,
|
||||||
VContainer *data)
|
VAbstractPattern *doc, VContainer *data)
|
||||||
{
|
{
|
||||||
SCASSERT(dialog != nullptr)
|
SCASSERT(not dialog.isNull())
|
||||||
DialogFlippingByLine *dialogTool = qobject_cast<DialogFlippingByLine*>(dialog);
|
QSharedPointer<DialogFlippingByLine> dialogTool = dialog.objectCast<DialogFlippingByLine>();
|
||||||
SCASSERT(dialogTool != nullptr)
|
SCASSERT(not dialogTool.isNull())
|
||||||
const quint32 firstLinePointId = dialogTool->GetFirstLinePointId();
|
const quint32 firstLinePointId = dialogTool->GetFirstLinePointId();
|
||||||
const quint32 secondLinePointId = dialogTool->GetSecondLinePointId();
|
const quint32 secondLinePointId = dialogTool->GetSecondLinePointId();
|
||||||
const QString suffix = dialogTool->GetSuffix();
|
const QString suffix = dialogTool->GetSuffix();
|
||||||
|
@ -93,7 +93,7 @@ VToolFlippingByLine *VToolFlippingByLine::Create(DialogTool *dialog, VMainGraphi
|
||||||
Source::FromGui);
|
Source::FromGui);
|
||||||
if (operation != nullptr)
|
if (operation != nullptr)
|
||||||
{
|
{
|
||||||
operation->dialog = dialogTool;
|
operation->m_dialog = dialogTool;
|
||||||
}
|
}
|
||||||
return operation;
|
return operation;
|
||||||
}
|
}
|
||||||
|
@ -171,9 +171,9 @@ void VToolFlippingByLine::SetVisualization()
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VToolFlippingByLine::SaveDialog(QDomElement &domElement)
|
void VToolFlippingByLine::SaveDialog(QDomElement &domElement)
|
||||||
{
|
{
|
||||||
SCASSERT(dialog != nullptr)
|
SCASSERT(not m_dialog.isNull())
|
||||||
DialogFlippingByLine *dialogTool = qobject_cast<DialogFlippingByLine*>(dialog);
|
QSharedPointer<DialogFlippingByLine> dialogTool = m_dialog.objectCast<DialogFlippingByLine>();
|
||||||
SCASSERT(dialogTool != nullptr)
|
SCASSERT(not dialogTool.isNull())
|
||||||
|
|
||||||
doc->SetAttribute(domElement, AttrP1Line, QString().setNum(dialogTool->GetFirstLinePointId()));
|
doc->SetAttribute(domElement, AttrP1Line, QString().setNum(dialogTool->GetFirstLinePointId()));
|
||||||
doc->SetAttribute(domElement, AttrP2Line, QString().setNum(dialogTool->GetSecondLinePointId()));
|
doc->SetAttribute(domElement, AttrP2Line, QString().setNum(dialogTool->GetSecondLinePointId()));
|
||||||
|
|
|
@ -39,8 +39,8 @@ class VToolFlippingByLine : public VAbstractFlipping
|
||||||
public:
|
public:
|
||||||
virtual ~VToolFlippingByLine() Q_DECL_EQ_DEFAULT;
|
virtual ~VToolFlippingByLine() Q_DECL_EQ_DEFAULT;
|
||||||
virtual void setDialog() Q_DECL_OVERRIDE;
|
virtual void setDialog() Q_DECL_OVERRIDE;
|
||||||
static VToolFlippingByLine* Create(DialogTool *dialog, VMainGraphicsScene *scene, VAbstractPattern *doc,
|
static VToolFlippingByLine* Create(QSharedPointer<DialogTool> dialog, VMainGraphicsScene *scene,
|
||||||
VContainer *data);
|
VAbstractPattern *doc, VContainer *data);
|
||||||
static VToolFlippingByLine* Create(const quint32 _id, quint32 firstLinePointId, quint32 secondLinePointId,
|
static VToolFlippingByLine* Create(const quint32 _id, quint32 firstLinePointId, quint32 secondLinePointId,
|
||||||
const QString &suffix, const QVector<quint32> &source,
|
const QString &suffix, const QVector<quint32> &source,
|
||||||
const QVector<DestinationItem> &destination, VMainGraphicsScene *scene,
|
const QVector<DestinationItem> &destination, VMainGraphicsScene *scene,
|
||||||
|
|
|
@ -77,21 +77,21 @@ const QString VToolMove::ToolType = QStringLiteral("moving");
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VToolMove::setDialog()
|
void VToolMove::setDialog()
|
||||||
{
|
{
|
||||||
SCASSERT(dialog != nullptr)
|
SCASSERT(not m_dialog.isNull())
|
||||||
DialogMove *dialogTool = qobject_cast<DialogMove*>(dialog);
|
QSharedPointer<DialogMove> dialogTool = m_dialog.objectCast<DialogMove>();
|
||||||
SCASSERT(dialogTool != nullptr)
|
SCASSERT(not dialogTool.isNull())
|
||||||
dialogTool->SetAngle(formulaAngle);
|
dialogTool->SetAngle(formulaAngle);
|
||||||
dialogTool->SetLength(formulaLength);
|
dialogTool->SetLength(formulaLength);
|
||||||
dialogTool->SetSuffix(suffix);
|
dialogTool->SetSuffix(suffix);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
VToolMove *VToolMove::Create(DialogTool *dialog, VMainGraphicsScene *scene, VAbstractPattern *doc,
|
VToolMove *VToolMove::Create(QSharedPointer<DialogTool> dialog, VMainGraphicsScene *scene, VAbstractPattern *doc,
|
||||||
VContainer *data)
|
VContainer *data)
|
||||||
{
|
{
|
||||||
SCASSERT(dialog != nullptr)
|
SCASSERT(not dialog.isNull())
|
||||||
DialogMove *dialogTool = qobject_cast<DialogMove*>(dialog);
|
QSharedPointer<DialogMove> dialogTool = dialog.objectCast<DialogMove>();
|
||||||
SCASSERT(dialogTool != nullptr)
|
SCASSERT(not dialogTool.isNull())
|
||||||
QString angle = dialogTool->GetAngle();
|
QString angle = dialogTool->GetAngle();
|
||||||
QString length = dialogTool->GetLength();
|
QString length = dialogTool->GetLength();
|
||||||
const QString suffix = dialogTool->GetSuffix();
|
const QString suffix = dialogTool->GetSuffix();
|
||||||
|
@ -100,7 +100,7 @@ VToolMove *VToolMove::Create(DialogTool *dialog, VMainGraphicsScene *scene, VAbs
|
||||||
Document::FullParse, Source::FromGui);
|
Document::FullParse, Source::FromGui);
|
||||||
if (operation != nullptr)
|
if (operation != nullptr)
|
||||||
{
|
{
|
||||||
operation->dialog = dialogTool;
|
operation->m_dialog = dialogTool;
|
||||||
}
|
}
|
||||||
return operation;
|
return operation;
|
||||||
}
|
}
|
||||||
|
@ -302,9 +302,9 @@ void VToolMove::SetVisualization()
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VToolMove::SaveDialog(QDomElement &domElement)
|
void VToolMove::SaveDialog(QDomElement &domElement)
|
||||||
{
|
{
|
||||||
SCASSERT(dialog != nullptr)
|
SCASSERT(not m_dialog.isNull())
|
||||||
DialogMove *dialogTool = qobject_cast<DialogMove*>(dialog);
|
QSharedPointer<DialogMove> dialogTool = m_dialog.objectCast<DialogMove>();
|
||||||
SCASSERT(dialogTool != nullptr)
|
SCASSERT(not dialogTool.isNull())
|
||||||
|
|
||||||
doc->SetAttribute(domElement, AttrAngle, dialogTool->GetAngle());
|
doc->SetAttribute(domElement, AttrAngle, dialogTool->GetAngle());
|
||||||
QString length = dialogTool->GetLength();
|
QString length = dialogTool->GetLength();
|
||||||
|
|
|
@ -51,8 +51,8 @@ class VToolMove : public VAbstractOperation
|
||||||
public:
|
public:
|
||||||
virtual ~VToolMove() Q_DECL_EQ_DEFAULT;
|
virtual ~VToolMove() Q_DECL_EQ_DEFAULT;
|
||||||
virtual void setDialog() Q_DECL_OVERRIDE;
|
virtual void setDialog() Q_DECL_OVERRIDE;
|
||||||
static VToolMove* Create(DialogTool *dialog, VMainGraphicsScene *scene, VAbstractPattern *doc,
|
static VToolMove* Create(QSharedPointer<DialogTool> dialog, VMainGraphicsScene *scene, VAbstractPattern *doc,
|
||||||
VContainer *data);
|
VContainer *data);
|
||||||
static VToolMove* Create(quint32 _id, QString &formulaAngle, QString &formulaLength, const QString &suffix,
|
static VToolMove* Create(quint32 _id, QString &formulaAngle, QString &formulaLength, const QString &suffix,
|
||||||
const QVector<quint32> &source, const QVector<DestinationItem> &destination,
|
const QVector<quint32> &source, const QVector<DestinationItem> &destination,
|
||||||
VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data,
|
VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data,
|
||||||
|
|
|
@ -95,21 +95,21 @@ VToolRotation::VToolRotation(VAbstractPattern *doc, VContainer *data, quint32 id
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VToolRotation::setDialog()
|
void VToolRotation::setDialog()
|
||||||
{
|
{
|
||||||
SCASSERT(dialog != nullptr)
|
SCASSERT(not m_dialog.isNull())
|
||||||
DialogRotation *dialogTool = qobject_cast<DialogRotation*>(dialog);
|
QSharedPointer<DialogRotation> dialogTool = m_dialog.objectCast<DialogRotation>();
|
||||||
SCASSERT(dialogTool != nullptr)
|
SCASSERT(not dialogTool.isNull())
|
||||||
dialogTool->SetOrigPointId(origPointId);
|
dialogTool->SetOrigPointId(origPointId);
|
||||||
dialogTool->SetAngle(formulaAngle);
|
dialogTool->SetAngle(formulaAngle);
|
||||||
dialogTool->SetSuffix(suffix);
|
dialogTool->SetSuffix(suffix);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
VToolRotation *VToolRotation::Create(DialogTool *dialog, VMainGraphicsScene *scene, VAbstractPattern *doc,
|
VToolRotation *VToolRotation::Create(QSharedPointer<DialogTool> dialog, VMainGraphicsScene *scene,
|
||||||
VContainer *data)
|
VAbstractPattern *doc, VContainer *data)
|
||||||
{
|
{
|
||||||
SCASSERT(dialog != nullptr)
|
SCASSERT(not dialog.isNull())
|
||||||
DialogRotation *dialogTool = qobject_cast<DialogRotation*>(dialog);
|
QSharedPointer<DialogRotation> dialogTool = dialog.objectCast<DialogRotation>();
|
||||||
SCASSERT(dialogTool != nullptr)
|
SCASSERT(not dialogTool.isNull())
|
||||||
const quint32 originPointId = dialogTool->GetOrigPointId();
|
const quint32 originPointId = dialogTool->GetOrigPointId();
|
||||||
QString angle = dialogTool->GetAngle();
|
QString angle = dialogTool->GetAngle();
|
||||||
const QString suffix = dialogTool->GetSuffix();
|
const QString suffix = dialogTool->GetSuffix();
|
||||||
|
@ -118,7 +118,7 @@ VToolRotation *VToolRotation::Create(DialogTool *dialog, VMainGraphicsScene *sce
|
||||||
scene, doc, data, Document::FullParse, Source::FromGui);
|
scene, doc, data, Document::FullParse, Source::FromGui);
|
||||||
if (operation != nullptr)
|
if (operation != nullptr)
|
||||||
{
|
{
|
||||||
operation->dialog = dialogTool;
|
operation->m_dialog = dialogTool;
|
||||||
}
|
}
|
||||||
return operation;
|
return operation;
|
||||||
}
|
}
|
||||||
|
@ -303,9 +303,9 @@ void VToolRotation::SetVisualization()
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VToolRotation::SaveDialog(QDomElement &domElement)
|
void VToolRotation::SaveDialog(QDomElement &domElement)
|
||||||
{
|
{
|
||||||
SCASSERT(dialog != nullptr)
|
SCASSERT(not m_dialog.isNull())
|
||||||
DialogRotation *dialogTool = qobject_cast<DialogRotation*>(dialog);
|
QSharedPointer<DialogRotation> dialogTool = m_dialog.objectCast<DialogRotation>();
|
||||||
SCASSERT(dialogTool != nullptr)
|
SCASSERT(not dialogTool.isNull())
|
||||||
|
|
||||||
doc->SetAttribute(domElement, AttrCenter, QString().setNum(dialogTool->GetOrigPointId()));
|
doc->SetAttribute(domElement, AttrCenter, QString().setNum(dialogTool->GetOrigPointId()));
|
||||||
doc->SetAttribute(domElement, AttrAngle, dialogTool->GetAngle());
|
doc->SetAttribute(domElement, AttrAngle, dialogTool->GetAngle());
|
||||||
|
|
|
@ -51,7 +51,7 @@ class VToolRotation : public VAbstractOperation
|
||||||
public:
|
public:
|
||||||
virtual ~VToolRotation() Q_DECL_EQ_DEFAULT;
|
virtual ~VToolRotation() Q_DECL_EQ_DEFAULT;
|
||||||
virtual void setDialog() Q_DECL_OVERRIDE;
|
virtual void setDialog() Q_DECL_OVERRIDE;
|
||||||
static VToolRotation* Create(DialogTool *dialog, VMainGraphicsScene *scene, VAbstractPattern *doc,
|
static VToolRotation* Create(QSharedPointer<DialogTool> dialog, VMainGraphicsScene *scene, VAbstractPattern *doc,
|
||||||
VContainer *data);
|
VContainer *data);
|
||||||
static VToolRotation* Create(const quint32 _id, const quint32 &origin, QString &angle, const QString &suffix,
|
static VToolRotation* Create(const quint32 _id, const quint32 &origin, QString &angle, const QString &suffix,
|
||||||
const QVector<quint32> &source, const QVector<DestinationItem> &destination,
|
const QVector<quint32> &source, const QVector<DestinationItem> &destination,
|
||||||
|
|
|
@ -86,9 +86,9 @@ VToolArc::VToolArc(VAbstractPattern *doc, VContainer *data, quint32 id, const So
|
||||||
*/
|
*/
|
||||||
void VToolArc::setDialog()
|
void VToolArc::setDialog()
|
||||||
{
|
{
|
||||||
SCASSERT(dialog != nullptr)
|
SCASSERT(not m_dialog.isNull())
|
||||||
DialogArc *dialogTool = qobject_cast<DialogArc*>(dialog);
|
QSharedPointer<DialogArc> dialogTool = m_dialog.objectCast<DialogArc>();
|
||||||
SCASSERT(dialogTool != nullptr)
|
SCASSERT(not dialogTool.isNull())
|
||||||
const QSharedPointer<VArc> arc = VAbstractTool::data.GeometricObject<VArc>(id);
|
const QSharedPointer<VArc> arc = VAbstractTool::data.GeometricObject<VArc>(id);
|
||||||
dialogTool->SetCenter(arc->GetCenter().id());
|
dialogTool->SetCenter(arc->GetCenter().id());
|
||||||
dialogTool->SetF1(arc->GetFormulaF1());
|
dialogTool->SetF1(arc->GetFormulaF1());
|
||||||
|
@ -105,11 +105,12 @@ void VToolArc::setDialog()
|
||||||
* @param doc dom document container
|
* @param doc dom document container
|
||||||
* @param data container with variables
|
* @param data container with variables
|
||||||
*/
|
*/
|
||||||
VToolArc* VToolArc::Create(DialogTool *dialog, VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data)
|
VToolArc* VToolArc::Create(QSharedPointer<DialogTool> dialog, VMainGraphicsScene *scene, VAbstractPattern *doc,
|
||||||
|
VContainer *data)
|
||||||
{
|
{
|
||||||
SCASSERT(dialog != nullptr)
|
SCASSERT(not dialog.isNull())
|
||||||
DialogArc *dialogTool = qobject_cast<DialogArc*>(dialog);
|
QSharedPointer<DialogArc> dialogTool = dialog.objectCast<DialogArc>();
|
||||||
SCASSERT(dialogTool != nullptr)
|
SCASSERT(not dialogTool.isNull())
|
||||||
const quint32 center = dialogTool->GetCenter();
|
const quint32 center = dialogTool->GetCenter();
|
||||||
QString radius = dialogTool->GetRadius();
|
QString radius = dialogTool->GetRadius();
|
||||||
QString f1 = dialogTool->GetF1();
|
QString f1 = dialogTool->GetF1();
|
||||||
|
@ -119,7 +120,7 @@ VToolArc* VToolArc::Create(DialogTool *dialog, VMainGraphicsScene *scene, VAbstr
|
||||||
Source::FromGui);
|
Source::FromGui);
|
||||||
if (point != nullptr)
|
if (point != nullptr)
|
||||||
{
|
{
|
||||||
point->dialog=dialogTool;
|
point->m_dialog = dialogTool;
|
||||||
}
|
}
|
||||||
return point;
|
return point;
|
||||||
}
|
}
|
||||||
|
@ -341,9 +342,9 @@ void VToolArc::RemoveReferens()
|
||||||
*/
|
*/
|
||||||
void VToolArc::SaveDialog(QDomElement &domElement)
|
void VToolArc::SaveDialog(QDomElement &domElement)
|
||||||
{
|
{
|
||||||
SCASSERT(dialog != nullptr)
|
SCASSERT(not m_dialog.isNull())
|
||||||
DialogArc *dialogTool = qobject_cast<DialogArc*>(dialog);
|
QSharedPointer<DialogArc> dialogTool = m_dialog.objectCast<DialogArc>();
|
||||||
SCASSERT(dialogTool != nullptr)
|
SCASSERT(not dialogTool.isNull())
|
||||||
doc->SetAttribute(domElement, AttrCenter, QString().setNum(dialogTool->GetCenter()));
|
doc->SetAttribute(domElement, AttrCenter, QString().setNum(dialogTool->GetCenter()));
|
||||||
doc->SetAttribute(domElement, AttrRadius, dialogTool->GetRadius());
|
doc->SetAttribute(domElement, AttrRadius, dialogTool->GetRadius());
|
||||||
doc->SetAttribute(domElement, AttrAngle1, dialogTool->GetF1());
|
doc->SetAttribute(domElement, AttrAngle1, dialogTool->GetF1());
|
||||||
|
|
|
@ -51,7 +51,8 @@ class VToolArc :public VAbstractSpline
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
virtual void setDialog() Q_DECL_OVERRIDE;
|
virtual void setDialog() Q_DECL_OVERRIDE;
|
||||||
static VToolArc* Create(DialogTool *dialog, VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data);
|
static VToolArc* Create(QSharedPointer<DialogTool> dialog, VMainGraphicsScene *scene, VAbstractPattern *doc,
|
||||||
|
VContainer *data);
|
||||||
static VToolArc* Create(const quint32 _id, const quint32 ¢er, QString &radius, QString &f1, QString &f2,
|
static VToolArc* Create(const quint32 _id, const quint32 ¢er, QString &radius, QString &f1, QString &f2,
|
||||||
const QString &color, VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data,
|
const QString &color, VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data,
|
||||||
const Document &parse, const Source &typeCreation);
|
const Document &parse, const Source &typeCreation);
|
||||||
|
|
|
@ -75,9 +75,9 @@ VToolArcWithLength::VToolArcWithLength(VAbstractPattern *doc, VContainer *data,
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VToolArcWithLength::setDialog()
|
void VToolArcWithLength::setDialog()
|
||||||
{
|
{
|
||||||
SCASSERT(dialog != nullptr)
|
SCASSERT(not m_dialog.isNull())
|
||||||
DialogArcWithLength *dialogTool = qobject_cast<DialogArcWithLength*>(dialog);
|
QSharedPointer<DialogArcWithLength> dialogTool = m_dialog.objectCast<DialogArcWithLength>();
|
||||||
SCASSERT(dialogTool != nullptr)
|
SCASSERT(not dialogTool.isNull())
|
||||||
const QSharedPointer<VArc> arc = VAbstractTool::data.GeometricObject<VArc>(id);
|
const QSharedPointer<VArc> arc = VAbstractTool::data.GeometricObject<VArc>(id);
|
||||||
dialogTool->SetCenter(arc->GetCenter().id());
|
dialogTool->SetCenter(arc->GetCenter().id());
|
||||||
dialogTool->SetF1(arc->GetFormulaF1());
|
dialogTool->SetF1(arc->GetFormulaF1());
|
||||||
|
@ -87,12 +87,12 @@ void VToolArcWithLength::setDialog()
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
VToolArcWithLength *VToolArcWithLength::Create(DialogTool *dialog, VMainGraphicsScene *scene, VAbstractPattern *doc,
|
VToolArcWithLength *VToolArcWithLength::Create(QSharedPointer<DialogTool> dialog, VMainGraphicsScene *scene,
|
||||||
VContainer *data)
|
VAbstractPattern *doc, VContainer *data)
|
||||||
{
|
{
|
||||||
SCASSERT(dialog != nullptr)
|
SCASSERT(not dialog.isNull())
|
||||||
DialogArcWithLength *dialogTool = qobject_cast<DialogArcWithLength*>(dialog);
|
QSharedPointer<DialogArcWithLength> dialogTool = dialog.objectCast<DialogArcWithLength>();
|
||||||
SCASSERT(dialogTool != nullptr)
|
SCASSERT(not dialogTool.isNull())
|
||||||
const quint32 center = dialogTool->GetCenter();
|
const quint32 center = dialogTool->GetCenter();
|
||||||
QString radius = dialogTool->GetRadius();
|
QString radius = dialogTool->GetRadius();
|
||||||
QString f1 = dialogTool->GetF1();
|
QString f1 = dialogTool->GetF1();
|
||||||
|
@ -102,7 +102,7 @@ VToolArcWithLength *VToolArcWithLength::Create(DialogTool *dialog, VMainGraphics
|
||||||
Source::FromGui);
|
Source::FromGui);
|
||||||
if (point != nullptr)
|
if (point != nullptr)
|
||||||
{
|
{
|
||||||
point->dialog=dialogTool;
|
point->m_dialog = dialogTool;
|
||||||
}
|
}
|
||||||
return point;
|
return point;
|
||||||
}
|
}
|
||||||
|
@ -298,9 +298,9 @@ void VToolArcWithLength::RemoveReferens()
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VToolArcWithLength::SaveDialog(QDomElement &domElement)
|
void VToolArcWithLength::SaveDialog(QDomElement &domElement)
|
||||||
{
|
{
|
||||||
SCASSERT(dialog != nullptr)
|
SCASSERT(not m_dialog.isNull())
|
||||||
DialogArcWithLength *dialogTool = qobject_cast<DialogArcWithLength*>(dialog);
|
QSharedPointer<DialogArcWithLength> dialogTool = m_dialog.objectCast<DialogArcWithLength>();
|
||||||
SCASSERT(dialogTool != nullptr)
|
SCASSERT(not dialogTool.isNull())
|
||||||
doc->SetAttribute(domElement, AttrCenter, QString().setNum(dialogTool->GetCenter()));
|
doc->SetAttribute(domElement, AttrCenter, QString().setNum(dialogTool->GetCenter()));
|
||||||
doc->SetAttribute(domElement, AttrRadius, dialogTool->GetRadius());
|
doc->SetAttribute(domElement, AttrRadius, dialogTool->GetRadius());
|
||||||
doc->SetAttribute(domElement, AttrAngle1, dialogTool->GetF1());
|
doc->SetAttribute(domElement, AttrAngle1, dialogTool->GetF1());
|
||||||
|
|
|
@ -48,8 +48,8 @@ class VToolArcWithLength : public VAbstractSpline
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
virtual void setDialog() Q_DECL_OVERRIDE;
|
virtual void setDialog() Q_DECL_OVERRIDE;
|
||||||
static VToolArcWithLength* Create(DialogTool *dialog, VMainGraphicsScene *scene, VAbstractPattern *doc,
|
static VToolArcWithLength* Create(QSharedPointer<DialogTool> dialog, VMainGraphicsScene *scene,
|
||||||
VContainer *data);
|
VAbstractPattern *doc, VContainer *data);
|
||||||
static VToolArcWithLength* Create(const quint32 _id, const quint32 ¢er, QString &radius, QString &f1,
|
static VToolArcWithLength* Create(const quint32 _id, const quint32 ¢er, QString &radius, QString &f1,
|
||||||
QString &length, const QString &color, VMainGraphicsScene *scene,
|
QString &length, const QString &color, VMainGraphicsScene *scene,
|
||||||
VAbstractPattern *doc, VContainer *data, const Document &parse,
|
VAbstractPattern *doc, VContainer *data, const Document &parse,
|
||||||
|
|
|
@ -73,8 +73,8 @@ VToolCubicBezier::VToolCubicBezier(VAbstractPattern *doc, VContainer *data, quin
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VToolCubicBezier::setDialog()
|
void VToolCubicBezier::setDialog()
|
||||||
{
|
{
|
||||||
SCASSERT(dialog != nullptr)
|
SCASSERT(not m_dialog.isNull())
|
||||||
auto dialogTool = qobject_cast<DialogCubicBezier*>(dialog);
|
auto dialogTool = qobject_cast<DialogCubicBezier*>(m_dialog);
|
||||||
SCASSERT(dialogTool != nullptr)
|
SCASSERT(dialogTool != nullptr)
|
||||||
const auto spl = VAbstractTool::data.GeometricObject<VCubicBezier>(id);
|
const auto spl = VAbstractTool::data.GeometricObject<VCubicBezier>(id);
|
||||||
dialogTool->SetSpline(*spl);
|
dialogTool->SetSpline(*spl);
|
||||||
|
@ -82,19 +82,19 @@ void VToolCubicBezier::setDialog()
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
VToolCubicBezier *VToolCubicBezier::Create(DialogTool *dialog, VMainGraphicsScene *scene, VAbstractPattern *doc,
|
VToolCubicBezier *VToolCubicBezier::Create(QSharedPointer<DialogTool> dialog, VMainGraphicsScene *scene,
|
||||||
VContainer *data)
|
VAbstractPattern *doc, VContainer *data)
|
||||||
{
|
{
|
||||||
SCASSERT(dialog != nullptr)
|
SCASSERT(not dialog.isNull())
|
||||||
auto dialogTool = qobject_cast<DialogCubicBezier*>(dialog);
|
QSharedPointer<DialogCubicBezier> dialogTool = dialog.objectCast<DialogCubicBezier>();
|
||||||
SCASSERT(dialogTool != nullptr)
|
SCASSERT(not dialogTool.isNull())
|
||||||
|
|
||||||
auto spl = Create(0, new VCubicBezier(dialogTool->GetSpline()), dialogTool->GetColor(), scene, doc, data,
|
auto spl = Create(0, new VCubicBezier(dialogTool->GetSpline()), dialogTool->GetColor(), scene, doc, data,
|
||||||
Document::FullParse, Source::FromGui);
|
Document::FullParse, Source::FromGui);
|
||||||
|
|
||||||
if (spl != nullptr)
|
if (spl != nullptr)
|
||||||
{
|
{
|
||||||
spl->dialog=dialogTool;
|
spl->m_dialog = dialogTool;
|
||||||
}
|
}
|
||||||
return spl;
|
return spl;
|
||||||
}
|
}
|
||||||
|
@ -214,8 +214,8 @@ void VToolCubicBezier::RemoveReferens()
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VToolCubicBezier::SaveDialog(QDomElement &domElement)
|
void VToolCubicBezier::SaveDialog(QDomElement &domElement)
|
||||||
{
|
{
|
||||||
SCASSERT(dialog != nullptr)
|
SCASSERT(not m_dialog.isNull())
|
||||||
auto dialogTool = qobject_cast<DialogCubicBezier*>(dialog);
|
auto dialogTool = qobject_cast<DialogCubicBezier*>(m_dialog);
|
||||||
SCASSERT(dialogTool != nullptr)
|
SCASSERT(dialogTool != nullptr)
|
||||||
|
|
||||||
const VCubicBezier spl = dialogTool->GetSpline();
|
const VCubicBezier spl = dialogTool->GetSpline();
|
||||||
|
|
|
@ -49,8 +49,8 @@ class VToolCubicBezier : public VAbstractSpline
|
||||||
public:
|
public:
|
||||||
virtual ~VToolCubicBezier() Q_DECL_EQ_DEFAULT;
|
virtual ~VToolCubicBezier() Q_DECL_EQ_DEFAULT;
|
||||||
virtual void setDialog() Q_DECL_OVERRIDE;
|
virtual void setDialog() Q_DECL_OVERRIDE;
|
||||||
static VToolCubicBezier *Create(DialogTool *dialog, VMainGraphicsScene *scene, VAbstractPattern *doc,
|
static VToolCubicBezier *Create(QSharedPointer<DialogTool> dialog, VMainGraphicsScene *scene,
|
||||||
VContainer *data);
|
VAbstractPattern *doc, VContainer *data);
|
||||||
static VToolCubicBezier *Create(const quint32 _id, VCubicBezier *spline, const QString &color,
|
static VToolCubicBezier *Create(const quint32 _id, VCubicBezier *spline, const QString &color,
|
||||||
VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data,
|
VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data,
|
||||||
const Document &parse, const Source &typeCreation);
|
const Document &parse, const Source &typeCreation);
|
||||||
|
|
|
@ -75,8 +75,8 @@ VToolCubicBezierPath::VToolCubicBezierPath(VAbstractPattern *doc, VContainer *da
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VToolCubicBezierPath::setDialog()
|
void VToolCubicBezierPath::setDialog()
|
||||||
{
|
{
|
||||||
SCASSERT(dialog != nullptr)
|
SCASSERT(not m_dialog.isNull())
|
||||||
auto dialogTool = qobject_cast<DialogCubicBezierPath*>(dialog);
|
auto dialogTool = qobject_cast<DialogCubicBezierPath*>(m_dialog);
|
||||||
SCASSERT(dialogTool != nullptr)
|
SCASSERT(dialogTool != nullptr)
|
||||||
const QSharedPointer<VCubicBezierPath> splPath = VAbstractTool::data.GeometricObject<VCubicBezierPath>(id);
|
const QSharedPointer<VCubicBezierPath> splPath = VAbstractTool::data.GeometricObject<VCubicBezierPath>(id);
|
||||||
dialogTool->SetPath(*splPath);
|
dialogTool->SetPath(*splPath);
|
||||||
|
@ -84,12 +84,12 @@ void VToolCubicBezierPath::setDialog()
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
VToolCubicBezierPath *VToolCubicBezierPath::Create(DialogTool *dialog, VMainGraphicsScene *scene, VAbstractPattern *doc,
|
VToolCubicBezierPath *VToolCubicBezierPath::Create(QSharedPointer<DialogTool> dialog, VMainGraphicsScene *scene,
|
||||||
VContainer *data)
|
VAbstractPattern *doc, VContainer *data)
|
||||||
{
|
{
|
||||||
SCASSERT(dialog != nullptr)
|
SCASSERT(not dialog.isNull())
|
||||||
auto dialogTool = qobject_cast<DialogCubicBezierPath*>(dialog);
|
QSharedPointer<DialogCubicBezierPath> dialogTool = dialog.objectCast<DialogCubicBezierPath>();
|
||||||
SCASSERT(dialogTool != nullptr)
|
SCASSERT(not dialogTool.isNull())
|
||||||
auto path = new VCubicBezierPath(dialogTool->GetPath());
|
auto path = new VCubicBezierPath(dialogTool->GetPath());
|
||||||
const QString color = dialogTool->GetColor();
|
const QString color = dialogTool->GetColor();
|
||||||
for (qint32 i = 0; i < path->CountPoints(); ++i)
|
for (qint32 i = 0; i < path->CountPoints(); ++i)
|
||||||
|
@ -99,7 +99,7 @@ VToolCubicBezierPath *VToolCubicBezierPath::Create(DialogTool *dialog, VMainGrap
|
||||||
VToolCubicBezierPath* spl = Create(0, path, color, scene, doc, data, Document::FullParse, Source::FromGui);
|
VToolCubicBezierPath* spl = Create(0, path, color, scene, doc, data, Document::FullParse, Source::FromGui);
|
||||||
if (spl != nullptr)
|
if (spl != nullptr)
|
||||||
{
|
{
|
||||||
spl->dialog=dialogTool;
|
spl->m_dialog = dialogTool;
|
||||||
}
|
}
|
||||||
return spl;
|
return spl;
|
||||||
}
|
}
|
||||||
|
@ -197,8 +197,8 @@ void VToolCubicBezierPath::RemoveReferens()
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VToolCubicBezierPath::SaveDialog(QDomElement &domElement)
|
void VToolCubicBezierPath::SaveDialog(QDomElement &domElement)
|
||||||
{
|
{
|
||||||
SCASSERT(dialog != nullptr)
|
SCASSERT(not m_dialog.isNull())
|
||||||
const auto dialogTool = qobject_cast<DialogCubicBezierPath*>(dialog);
|
const auto dialogTool = qobject_cast<DialogCubicBezierPath*>(m_dialog);
|
||||||
SCASSERT(dialogTool != nullptr)
|
SCASSERT(dialogTool != nullptr)
|
||||||
|
|
||||||
doc->SetAttribute(domElement, AttrColor, dialogTool->GetColor());
|
doc->SetAttribute(domElement, AttrColor, dialogTool->GetColor());
|
||||||
|
|
|
@ -49,8 +49,8 @@ class VToolCubicBezierPath:public VAbstractSpline
|
||||||
public:
|
public:
|
||||||
virtual ~VToolCubicBezierPath() Q_DECL_EQ_DEFAULT;
|
virtual ~VToolCubicBezierPath() Q_DECL_EQ_DEFAULT;
|
||||||
virtual void setDialog() Q_DECL_OVERRIDE;
|
virtual void setDialog() Q_DECL_OVERRIDE;
|
||||||
static VToolCubicBezierPath *Create(DialogTool *dialog, VMainGraphicsScene *scene, VAbstractPattern *doc,
|
static VToolCubicBezierPath *Create(QSharedPointer<DialogTool> dialog, VMainGraphicsScene *scene,
|
||||||
VContainer *data);
|
VAbstractPattern *doc, VContainer *data);
|
||||||
static VToolCubicBezierPath *Create(const quint32 _id, VCubicBezierPath *path, const QString &color,
|
static VToolCubicBezierPath *Create(const quint32 _id, VCubicBezierPath *path, const QString &color,
|
||||||
VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data,
|
VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data,
|
||||||
const Document &parse, const Source &typeCreation);
|
const Document &parse, const Source &typeCreation);
|
||||||
|
|
|
@ -86,9 +86,9 @@ VToolEllipticalArc::VToolEllipticalArc(VAbstractPattern *doc, VContainer *data,
|
||||||
*/
|
*/
|
||||||
void VToolEllipticalArc::setDialog()
|
void VToolEllipticalArc::setDialog()
|
||||||
{
|
{
|
||||||
SCASSERT(dialog != nullptr)
|
SCASSERT(not m_dialog.isNull())
|
||||||
DialogEllipticalArc *dialogTool = qobject_cast<DialogEllipticalArc*>(dialog);
|
QSharedPointer<DialogEllipticalArc> dialogTool = m_dialog.objectCast<DialogEllipticalArc>();
|
||||||
SCASSERT(dialogTool != nullptr)
|
SCASSERT(not dialogTool.isNull())
|
||||||
const QSharedPointer<VEllipticalArc> elArc = VAbstractTool::data.GeometricObject<VEllipticalArc>(id);
|
const QSharedPointer<VEllipticalArc> elArc = VAbstractTool::data.GeometricObject<VEllipticalArc>(id);
|
||||||
dialogTool->SetCenter(elArc->GetCenter().id());
|
dialogTool->SetCenter(elArc->GetCenter().id());
|
||||||
dialogTool->SetF1(elArc->GetFormulaF1());
|
dialogTool->SetF1(elArc->GetFormulaF1());
|
||||||
|
@ -108,12 +108,12 @@ void VToolEllipticalArc::setDialog()
|
||||||
* @param doc dom document container
|
* @param doc dom document container
|
||||||
* @param data container with variables
|
* @param data container with variables
|
||||||
*/
|
*/
|
||||||
VToolEllipticalArc* VToolEllipticalArc::Create(DialogTool *dialog, VMainGraphicsScene *scene, VAbstractPattern *doc,
|
VToolEllipticalArc* VToolEllipticalArc::Create(QSharedPointer<DialogTool> dialog, VMainGraphicsScene *scene,
|
||||||
VContainer *data)
|
VAbstractPattern *doc, VContainer *data)
|
||||||
{
|
{
|
||||||
SCASSERT(dialog != nullptr)
|
SCASSERT(not dialog.isNull())
|
||||||
DialogEllipticalArc *dialogTool = qobject_cast<DialogEllipticalArc*>(dialog);
|
QSharedPointer<DialogEllipticalArc> dialogTool = dialog.objectCast<DialogEllipticalArc>();
|
||||||
SCASSERT(dialogTool != nullptr)
|
SCASSERT(not dialogTool.isNull())
|
||||||
|
|
||||||
const quint32 center = dialogTool->GetCenter();
|
const quint32 center = dialogTool->GetCenter();
|
||||||
QString radius1 = dialogTool->GetRadius1();
|
QString radius1 = dialogTool->GetRadius1();
|
||||||
|
@ -126,7 +126,7 @@ VToolEllipticalArc* VToolEllipticalArc::Create(DialogTool *dialog, VMainGraphics
|
||||||
Document::FullParse, Source::FromGui);
|
Document::FullParse, Source::FromGui);
|
||||||
if (point != nullptr)
|
if (point != nullptr)
|
||||||
{
|
{
|
||||||
point->dialog=dialogTool;
|
point->m_dialog = dialogTool;
|
||||||
}
|
}
|
||||||
return point;
|
return point;
|
||||||
}
|
}
|
||||||
|
@ -408,9 +408,9 @@ void VToolEllipticalArc::RemoveReferens()
|
||||||
*/
|
*/
|
||||||
void VToolEllipticalArc::SaveDialog(QDomElement &domElement)
|
void VToolEllipticalArc::SaveDialog(QDomElement &domElement)
|
||||||
{
|
{
|
||||||
SCASSERT(dialog != nullptr)
|
SCASSERT(not m_dialog.isNull())
|
||||||
DialogEllipticalArc *dialogTool = qobject_cast<DialogEllipticalArc*>(dialog);
|
QSharedPointer<DialogEllipticalArc> dialogTool = m_dialog.objectCast<DialogEllipticalArc>();
|
||||||
SCASSERT(dialogTool != nullptr)
|
SCASSERT(not dialogTool.isNull())
|
||||||
doc->SetAttribute(domElement, AttrCenter, QString().setNum(dialogTool->GetCenter()));
|
doc->SetAttribute(domElement, AttrCenter, QString().setNum(dialogTool->GetCenter()));
|
||||||
doc->SetAttribute(domElement, AttrRadius1, dialogTool->GetRadius1());
|
doc->SetAttribute(domElement, AttrRadius1, dialogTool->GetRadius1());
|
||||||
doc->SetAttribute(domElement, AttrRadius2, dialogTool->GetRadius2());
|
doc->SetAttribute(domElement, AttrRadius2, dialogTool->GetRadius2());
|
||||||
|
|
|
@ -51,8 +51,8 @@ class VToolEllipticalArc : public VAbstractSpline
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
virtual void setDialog() Q_DECL_OVERRIDE;
|
virtual void setDialog() Q_DECL_OVERRIDE;
|
||||||
static VToolEllipticalArc* Create(DialogTool *dialog, VMainGraphicsScene *scene, VAbstractPattern *doc,
|
static VToolEllipticalArc* Create(QSharedPointer<DialogTool> dialog, VMainGraphicsScene *scene,
|
||||||
VContainer *data);
|
VAbstractPattern *doc, VContainer *data);
|
||||||
static VToolEllipticalArc* Create(const quint32 _id, const quint32 ¢er, QString &radius1, QString &radius2,
|
static VToolEllipticalArc* Create(const quint32 _id, const quint32 ¢er, QString &radius1, QString &radius2,
|
||||||
QString &f1, QString &f2, QString &rotationAngle, const QString &color,
|
QString &f1, QString &f2, QString &rotationAngle, const QString &color,
|
||||||
VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data,
|
VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data,
|
||||||
|
|
|
@ -138,9 +138,9 @@ VToolSpline::~VToolSpline()
|
||||||
*/
|
*/
|
||||||
void VToolSpline::setDialog()
|
void VToolSpline::setDialog()
|
||||||
{
|
{
|
||||||
SCASSERT(dialog != nullptr)
|
SCASSERT(not m_dialog.isNull())
|
||||||
DialogSpline *dialogTool = qobject_cast<DialogSpline*>(dialog);
|
QSharedPointer<DialogSpline> dialogTool = m_dialog.objectCast<DialogSpline>();
|
||||||
SCASSERT(dialogTool != nullptr)
|
SCASSERT(not dialogTool.isNull())
|
||||||
const auto spl = VAbstractTool::data.GeometricObject<VSpline>(id);
|
const auto spl = VAbstractTool::data.GeometricObject<VSpline>(id);
|
||||||
dialogTool->SetSpline(*spl);
|
dialogTool->SetSpline(*spl);
|
||||||
dialogTool->SetColor(spl->GetColor());
|
dialogTool->SetColor(spl->GetColor());
|
||||||
|
@ -155,11 +155,12 @@ void VToolSpline::setDialog()
|
||||||
* @param data container with variables.
|
* @param data container with variables.
|
||||||
* @return the created tool
|
* @return the created tool
|
||||||
*/
|
*/
|
||||||
VToolSpline* VToolSpline::Create(DialogTool *dialog, VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data)
|
VToolSpline* VToolSpline::Create(QSharedPointer<DialogTool> dialog, VMainGraphicsScene *scene, VAbstractPattern *doc,
|
||||||
|
VContainer *data)
|
||||||
{
|
{
|
||||||
SCASSERT(dialog != nullptr)
|
SCASSERT(not dialog.isNull())
|
||||||
auto dialogTool = qobject_cast<DialogSpline*>(dialog);
|
QSharedPointer<DialogSpline> dialogTool = dialog.objectCast<DialogSpline>();
|
||||||
SCASSERT(dialogTool != nullptr)
|
SCASSERT(not dialogTool.isNull())
|
||||||
|
|
||||||
VSpline *spline = new VSpline(dialogTool->GetSpline());
|
VSpline *spline = new VSpline(dialogTool->GetSpline());
|
||||||
|
|
||||||
|
@ -167,7 +168,7 @@ VToolSpline* VToolSpline::Create(DialogTool *dialog, VMainGraphicsScene *scene,
|
||||||
|
|
||||||
if (spl != nullptr)
|
if (spl != nullptr)
|
||||||
{
|
{
|
||||||
spl->dialog=dialogTool;
|
spl->m_dialog = dialogTool;
|
||||||
}
|
}
|
||||||
return spl;
|
return spl;
|
||||||
}
|
}
|
||||||
|
@ -325,8 +326,8 @@ void VToolSpline::RemoveReferens()
|
||||||
*/
|
*/
|
||||||
void VToolSpline::SaveDialog(QDomElement &domElement)
|
void VToolSpline::SaveDialog(QDomElement &domElement)
|
||||||
{
|
{
|
||||||
SCASSERT(dialog != nullptr)
|
SCASSERT(not m_dialog.isNull())
|
||||||
auto dialogTool = qobject_cast<DialogSpline*>(dialog);
|
auto dialogTool = qobject_cast<DialogSpline*>(m_dialog);
|
||||||
SCASSERT(dialogTool != nullptr)
|
SCASSERT(dialogTool != nullptr)
|
||||||
|
|
||||||
const VSpline spl = dialogTool->GetSpline();
|
const VSpline spl = dialogTool->GetSpline();
|
||||||
|
|
|
@ -53,7 +53,8 @@ class VToolSpline:public VAbstractSpline
|
||||||
public:
|
public:
|
||||||
virtual ~VToolSpline() Q_DECL_OVERRIDE;
|
virtual ~VToolSpline() Q_DECL_OVERRIDE;
|
||||||
virtual void setDialog() Q_DECL_OVERRIDE;
|
virtual void setDialog() Q_DECL_OVERRIDE;
|
||||||
static VToolSpline *Create(DialogTool *dialog, VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data);
|
static VToolSpline *Create(QSharedPointer<DialogTool> dialog, VMainGraphicsScene *scene, VAbstractPattern *doc,
|
||||||
|
VContainer *data);
|
||||||
static VToolSpline *Create(const quint32 _id, VSpline *spline, const QString &color, VMainGraphicsScene *scene,
|
static VToolSpline *Create(const quint32 _id, VSpline *spline, const QString &color, VMainGraphicsScene *scene,
|
||||||
VAbstractPattern *doc, VContainer *data, const Document &parse,
|
VAbstractPattern *doc, VContainer *data, const Document &parse,
|
||||||
const Source &typeCreation);
|
const Source &typeCreation);
|
||||||
|
|
|
@ -148,9 +148,9 @@ VToolSplinePath::~VToolSplinePath()
|
||||||
*/
|
*/
|
||||||
void VToolSplinePath::setDialog()
|
void VToolSplinePath::setDialog()
|
||||||
{
|
{
|
||||||
SCASSERT(dialog != nullptr)
|
SCASSERT(not m_dialog.isNull())
|
||||||
DialogSplinePath *dialogTool = qobject_cast<DialogSplinePath*>(dialog);
|
QSharedPointer<DialogSplinePath> dialogTool = m_dialog.objectCast<DialogSplinePath>();
|
||||||
SCASSERT(dialogTool != nullptr)
|
SCASSERT(not dialogTool.isNull())
|
||||||
const QSharedPointer<VSplinePath> splPath = VAbstractTool::data.GeometricObject<VSplinePath>(id);
|
const QSharedPointer<VSplinePath> splPath = VAbstractTool::data.GeometricObject<VSplinePath>(id);
|
||||||
dialogTool->SetPath(*splPath);
|
dialogTool->SetPath(*splPath);
|
||||||
dialogTool->SetColor(splPath->GetColor());
|
dialogTool->SetColor(splPath->GetColor());
|
||||||
|
@ -164,12 +164,12 @@ void VToolSplinePath::setDialog()
|
||||||
* @param doc dom document container.
|
* @param doc dom document container.
|
||||||
* @param data container with variables.
|
* @param data container with variables.
|
||||||
*/
|
*/
|
||||||
VToolSplinePath* VToolSplinePath::Create(DialogTool *dialog, VMainGraphicsScene *scene, VAbstractPattern *doc,
|
VToolSplinePath* VToolSplinePath::Create(QSharedPointer<DialogTool> dialog, VMainGraphicsScene *scene,
|
||||||
VContainer *data)
|
VAbstractPattern *doc, VContainer *data)
|
||||||
{
|
{
|
||||||
SCASSERT(dialog != nullptr)
|
SCASSERT(not dialog.isNull())
|
||||||
DialogSplinePath *dialogTool = qobject_cast<DialogSplinePath*>(dialog);
|
QSharedPointer<DialogSplinePath> dialogTool = dialog.objectCast<DialogSplinePath>();
|
||||||
SCASSERT(dialogTool != nullptr)
|
SCASSERT(not dialogTool.isNull())
|
||||||
VSplinePath *path = new VSplinePath(dialogTool->GetPath());
|
VSplinePath *path = new VSplinePath(dialogTool->GetPath());
|
||||||
for (qint32 i = 0; i < path->CountPoints(); ++i)
|
for (qint32 i = 0; i < path->CountPoints(); ++i)
|
||||||
{
|
{
|
||||||
|
@ -179,7 +179,7 @@ VToolSplinePath* VToolSplinePath::Create(DialogTool *dialog, VMainGraphicsScene
|
||||||
Source::FromGui);
|
Source::FromGui);
|
||||||
if (spl != nullptr)
|
if (spl != nullptr)
|
||||||
{
|
{
|
||||||
spl->dialog=dialogTool;
|
spl->m_dialog = dialogTool;
|
||||||
}
|
}
|
||||||
return spl;
|
return spl;
|
||||||
}
|
}
|
||||||
|
@ -440,9 +440,9 @@ void VToolSplinePath::RemoveReferens()
|
||||||
*/
|
*/
|
||||||
void VToolSplinePath::SaveDialog(QDomElement &domElement)
|
void VToolSplinePath::SaveDialog(QDomElement &domElement)
|
||||||
{
|
{
|
||||||
SCASSERT(dialog != nullptr)
|
SCASSERT(not m_dialog.isNull())
|
||||||
DialogSplinePath *dialogTool = qobject_cast<DialogSplinePath*>(dialog);
|
QSharedPointer<DialogSplinePath> dialogTool = m_dialog.objectCast<DialogSplinePath>();
|
||||||
SCASSERT(dialogTool != nullptr)
|
SCASSERT(not dialogTool.isNull())
|
||||||
|
|
||||||
const VSplinePath splPath = dialogTool->GetPath();
|
const VSplinePath splPath = dialogTool->GetPath();
|
||||||
for (qint32 i = 1; i <= splPath.CountSubSpl(); ++i)
|
for (qint32 i = 1; i <= splPath.CountSubSpl(); ++i)
|
||||||
|
|
|
@ -55,8 +55,8 @@ class VToolSplinePath:public VAbstractSpline
|
||||||
public:
|
public:
|
||||||
virtual ~VToolSplinePath() Q_DECL_OVERRIDE;
|
virtual ~VToolSplinePath() Q_DECL_OVERRIDE;
|
||||||
virtual void setDialog() Q_DECL_OVERRIDE;
|
virtual void setDialog() Q_DECL_OVERRIDE;
|
||||||
static VToolSplinePath *Create(DialogTool *dialog, VMainGraphicsScene *scene, VAbstractPattern *doc,
|
static VToolSplinePath *Create(QSharedPointer<DialogTool> dialog, VMainGraphicsScene *scene,
|
||||||
VContainer *data);
|
VAbstractPattern *doc, VContainer *data);
|
||||||
static VToolSplinePath *Create(const quint32 _id, VSplinePath *path, const QString &color,
|
static VToolSplinePath *Create(const quint32 _id, VSplinePath *path, const QString &color,
|
||||||
VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data,
|
VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data,
|
||||||
const Document &parse, const Source &typeCreation);
|
const Document &parse, const Source &typeCreation);
|
||||||
|
|
|
@ -104,9 +104,9 @@ void VToolTrueDarts::FindPoint(const QPointF &baseLineP1, const QPointF &baseLin
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VToolTrueDarts::setDialog()
|
void VToolTrueDarts::setDialog()
|
||||||
{
|
{
|
||||||
SCASSERT(dialog != nullptr)
|
SCASSERT(not m_dialog.isNull())
|
||||||
DialogTrueDarts *dialogTool = qobject_cast<DialogTrueDarts*>(dialog);
|
QSharedPointer<DialogTrueDarts> dialogTool = m_dialog.objectCast<DialogTrueDarts>();
|
||||||
SCASSERT(dialogTool != nullptr)
|
SCASSERT(not dialogTool.isNull())
|
||||||
|
|
||||||
const QSharedPointer<VPointF> p1 = VAbstractTool::data.GeometricObject<VPointF>(p1id);
|
const QSharedPointer<VPointF> p1 = VAbstractTool::data.GeometricObject<VPointF>(p1id);
|
||||||
const QSharedPointer<VPointF> p2 = VAbstractTool::data.GeometricObject<VPointF>(p2id);
|
const QSharedPointer<VPointF> p2 = VAbstractTool::data.GeometricObject<VPointF>(p2id);
|
||||||
|
@ -121,12 +121,12 @@ void VToolTrueDarts::setDialog()
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
VToolTrueDarts *VToolTrueDarts::Create(DialogTool *dialog, VMainGraphicsScene *scene, VAbstractPattern *doc,
|
VToolTrueDarts *VToolTrueDarts::Create(QSharedPointer<DialogTool> dialog, VMainGraphicsScene *scene,
|
||||||
VContainer *data)
|
VAbstractPattern *doc, VContainer *data)
|
||||||
{
|
{
|
||||||
SCASSERT(dialog != nullptr)
|
SCASSERT(not dialog.isNull())
|
||||||
DialogTrueDarts *dialogTool = qobject_cast<DialogTrueDarts*>(dialog);
|
QSharedPointer<DialogTrueDarts> dialogTool = dialog.objectCast<DialogTrueDarts>();
|
||||||
SCASSERT(dialogTool != nullptr)
|
SCASSERT(not dialogTool.isNull())
|
||||||
|
|
||||||
const QString point1Name = dialogTool->GetFirstNewDartPointName();
|
const QString point1Name = dialogTool->GetFirstNewDartPointName();
|
||||||
const QString point2Name = dialogTool->GetSecondNewDartPointName();
|
const QString point2Name = dialogTool->GetSecondNewDartPointName();
|
||||||
|
@ -141,7 +141,7 @@ VToolTrueDarts *VToolTrueDarts::Create(DialogTool *dialog, VMainGraphicsScene *s
|
||||||
Source::FromGui);
|
Source::FromGui);
|
||||||
if (point != nullptr)
|
if (point != nullptr)
|
||||||
{
|
{
|
||||||
point->dialog = dialogTool;
|
point->m_dialog = dialogTool;
|
||||||
}
|
}
|
||||||
return point;
|
return point;
|
||||||
}
|
}
|
||||||
|
@ -367,9 +367,9 @@ void VToolTrueDarts::RemoveReferens()
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VToolTrueDarts::SaveDialog(QDomElement &domElement)
|
void VToolTrueDarts::SaveDialog(QDomElement &domElement)
|
||||||
{
|
{
|
||||||
SCASSERT(dialog != nullptr)
|
SCASSERT(not m_dialog.isNull())
|
||||||
DialogTrueDarts *dialogTool = qobject_cast<DialogTrueDarts*>(dialog);
|
QSharedPointer<DialogTrueDarts> dialogTool = m_dialog.objectCast<DialogTrueDarts>();
|
||||||
SCASSERT(dialogTool != nullptr)
|
SCASSERT(not dialogTool.isNull())
|
||||||
|
|
||||||
doc->SetAttribute(domElement, AttrName1, dialogTool->GetFirstNewDartPointName());
|
doc->SetAttribute(domElement, AttrName1, dialogTool->GetFirstNewDartPointName());
|
||||||
doc->SetAttribute(domElement, AttrName2, dialogTool->GetSecondNewDartPointName());
|
doc->SetAttribute(domElement, AttrName2, dialogTool->GetSecondNewDartPointName());
|
||||||
|
|
|
@ -51,7 +51,7 @@ public:
|
||||||
static void FindPoint(const QPointF &baseLineP1, const QPointF &baseLineP2, const QPointF &dartP1,
|
static void FindPoint(const QPointF &baseLineP1, const QPointF &baseLineP2, const QPointF &dartP1,
|
||||||
const QPointF &dartP2, const QPointF &dartP3, QPointF &p1, QPointF &p2);
|
const QPointF &dartP2, const QPointF &dartP3, QPointF &p1, QPointF &p2);
|
||||||
virtual void setDialog() Q_DECL_OVERRIDE;
|
virtual void setDialog() Q_DECL_OVERRIDE;
|
||||||
static VToolTrueDarts* Create(DialogTool *dialog, VMainGraphicsScene *scene, VAbstractPattern *doc,
|
static VToolTrueDarts* Create(QSharedPointer<DialogTool> dialog, VMainGraphicsScene *scene, VAbstractPattern *doc,
|
||||||
VContainer *data);
|
VContainer *data);
|
||||||
static VToolTrueDarts* Create(quint32 _id,
|
static VToolTrueDarts* Create(quint32 _id,
|
||||||
const quint32 &_p1id, const quint32 &_p2id,
|
const quint32 &_p1id, const quint32 &_p2id,
|
||||||
|
|
|
@ -80,9 +80,9 @@ VToolCutArc::VToolCutArc(VAbstractPattern *doc, VContainer *data, const quint32
|
||||||
*/
|
*/
|
||||||
void VToolCutArc::setDialog()
|
void VToolCutArc::setDialog()
|
||||||
{
|
{
|
||||||
SCASSERT(dialog != nullptr)
|
SCASSERT(not m_dialog.isNull())
|
||||||
DialogCutArc *dialogTool = qobject_cast<DialogCutArc*>(dialog);
|
QSharedPointer<DialogCutArc> dialogTool = m_dialog.objectCast<DialogCutArc>();
|
||||||
SCASSERT(dialogTool != nullptr)
|
SCASSERT(not dialogTool.isNull())
|
||||||
const QSharedPointer<VPointF> point = VAbstractTool::data.GeometricObject<VPointF>(id);
|
const QSharedPointer<VPointF> point = VAbstractTool::data.GeometricObject<VPointF>(id);
|
||||||
dialogTool->SetFormula(formula);
|
dialogTool->SetFormula(formula);
|
||||||
dialogTool->setArcId(curveCutId);
|
dialogTool->setArcId(curveCutId);
|
||||||
|
@ -97,11 +97,12 @@ void VToolCutArc::setDialog()
|
||||||
* @param doc dom document container.
|
* @param doc dom document container.
|
||||||
* @param data container with variables.
|
* @param data container with variables.
|
||||||
*/
|
*/
|
||||||
VToolCutArc* VToolCutArc::Create(DialogTool *dialog, VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data)
|
VToolCutArc* VToolCutArc::Create(QSharedPointer<DialogTool> dialog, VMainGraphicsScene *scene, VAbstractPattern *doc,
|
||||||
|
VContainer *data)
|
||||||
{
|
{
|
||||||
SCASSERT(dialog != nullptr)
|
SCASSERT(not dialog.isNull())
|
||||||
DialogCutArc *dialogTool = qobject_cast<DialogCutArc*>(dialog);
|
QSharedPointer<DialogCutArc> dialogTool = dialog.objectCast<DialogCutArc>();
|
||||||
SCASSERT(dialogTool != nullptr)
|
SCASSERT(not dialogTool.isNull())
|
||||||
const QString pointName = dialogTool->getPointName();
|
const QString pointName = dialogTool->getPointName();
|
||||||
QString formula = dialogTool->GetFormula();
|
QString formula = dialogTool->GetFormula();
|
||||||
const quint32 arcId = dialogTool->getArcId();
|
const quint32 arcId = dialogTool->getArcId();
|
||||||
|
@ -109,7 +110,7 @@ VToolCutArc* VToolCutArc::Create(DialogTool *dialog, VMainGraphicsScene *scene,
|
||||||
Source::FromGui);
|
Source::FromGui);
|
||||||
if (point != nullptr)
|
if (point != nullptr)
|
||||||
{
|
{
|
||||||
point->dialog=dialogTool;
|
point->m_dialog = dialogTool;
|
||||||
}
|
}
|
||||||
return point;
|
return point;
|
||||||
}
|
}
|
||||||
|
@ -210,9 +211,9 @@ void VToolCutArc::contextMenuEvent(QGraphicsSceneContextMenuEvent *event)
|
||||||
*/
|
*/
|
||||||
void VToolCutArc::SaveDialog(QDomElement &domElement)
|
void VToolCutArc::SaveDialog(QDomElement &domElement)
|
||||||
{
|
{
|
||||||
SCASSERT(dialog != nullptr)
|
SCASSERT(not m_dialog.isNull())
|
||||||
DialogCutArc *dialogTool = qobject_cast<DialogCutArc*>(dialog);
|
QSharedPointer<DialogCutArc> dialogTool = m_dialog.objectCast<DialogCutArc>();
|
||||||
SCASSERT(dialogTool != nullptr)
|
SCASSERT(not dialogTool.isNull())
|
||||||
doc->SetAttribute(domElement, AttrName, dialogTool->getPointName());
|
doc->SetAttribute(domElement, AttrName, dialogTool->getPointName());
|
||||||
doc->SetAttribute(domElement, AttrLength, dialogTool->GetFormula());
|
doc->SetAttribute(domElement, AttrLength, dialogTool->GetFormula());
|
||||||
doc->SetAttribute(domElement, AttrArc, QString().setNum(dialogTool->getArcId()));
|
doc->SetAttribute(domElement, AttrArc, QString().setNum(dialogTool->getArcId()));
|
||||||
|
|
|
@ -51,7 +51,8 @@ class VToolCutArc : public VToolCut
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
virtual void setDialog() Q_DECL_OVERRIDE;
|
virtual void setDialog() Q_DECL_OVERRIDE;
|
||||||
static VToolCutArc* Create(DialogTool *dialog, VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data);
|
static VToolCutArc* Create(QSharedPointer<DialogTool> dialog, VMainGraphicsScene *scene, VAbstractPattern *doc,
|
||||||
|
VContainer *data);
|
||||||
static VToolCutArc* Create(const quint32 _id, const QString &pointName, QString &formula, const quint32 &arcId,
|
static VToolCutArc* Create(const quint32 _id, const QString &pointName, QString &formula, const quint32 &arcId,
|
||||||
const qreal &mx, const qreal &my, VMainGraphicsScene *scene,
|
const qreal &mx, const qreal &my, VMainGraphicsScene *scene,
|
||||||
VAbstractPattern *doc, VContainer *data, const Document &parse,
|
VAbstractPattern *doc, VContainer *data, const Document &parse,
|
||||||
|
|
|
@ -83,9 +83,9 @@ VToolCutSpline::VToolCutSpline(VAbstractPattern *doc, VContainer *data, const qu
|
||||||
*/
|
*/
|
||||||
void VToolCutSpline::setDialog()
|
void VToolCutSpline::setDialog()
|
||||||
{
|
{
|
||||||
SCASSERT(dialog != nullptr)
|
SCASSERT(not m_dialog.isNull())
|
||||||
DialogCutSpline *dialogTool = qobject_cast<DialogCutSpline*>(dialog);
|
QSharedPointer<DialogCutSpline> dialogTool = m_dialog.objectCast<DialogCutSpline>();
|
||||||
SCASSERT(dialogTool != nullptr)
|
SCASSERT(not dialogTool.isNull())
|
||||||
const QSharedPointer<VPointF> point = VAbstractTool::data.GeometricObject<VPointF>(id);
|
const QSharedPointer<VPointF> point = VAbstractTool::data.GeometricObject<VPointF>(id);
|
||||||
dialogTool->SetFormula(formula);
|
dialogTool->SetFormula(formula);
|
||||||
dialogTool->setSplineId(curveCutId);
|
dialogTool->setSplineId(curveCutId);
|
||||||
|
@ -100,12 +100,12 @@ void VToolCutSpline::setDialog()
|
||||||
* @param doc dom document container.
|
* @param doc dom document container.
|
||||||
* @param data container with variables.
|
* @param data container with variables.
|
||||||
*/
|
*/
|
||||||
VToolCutSpline* VToolCutSpline::Create(DialogTool *dialog, VMainGraphicsScene *scene,
|
VToolCutSpline* VToolCutSpline::Create(QSharedPointer<DialogTool> dialog, VMainGraphicsScene *scene,
|
||||||
VAbstractPattern *doc, VContainer *data)
|
VAbstractPattern *doc, VContainer *data)
|
||||||
{
|
{
|
||||||
SCASSERT(dialog != nullptr)
|
SCASSERT(not dialog.isNull())
|
||||||
DialogCutSpline *dialogTool = qobject_cast<DialogCutSpline*>(dialog);
|
QSharedPointer<DialogCutSpline> dialogTool = dialog.objectCast<DialogCutSpline>();
|
||||||
SCASSERT(dialogTool != nullptr)
|
SCASSERT(not dialogTool.isNull())
|
||||||
const QString pointName = dialogTool->getPointName();
|
const QString pointName = dialogTool->getPointName();
|
||||||
QString formula = dialogTool->GetFormula();
|
QString formula = dialogTool->GetFormula();
|
||||||
const quint32 splineId = dialogTool->getSplineId();
|
const quint32 splineId = dialogTool->getSplineId();
|
||||||
|
@ -113,7 +113,7 @@ VToolCutSpline* VToolCutSpline::Create(DialogTool *dialog, VMainGraphicsScene *s
|
||||||
Source::FromGui);
|
Source::FromGui);
|
||||||
if (point != nullptr)
|
if (point != nullptr)
|
||||||
{
|
{
|
||||||
point->dialog=dialogTool;
|
point->m_dialog = dialogTool;
|
||||||
}
|
}
|
||||||
return point;
|
return point;
|
||||||
}
|
}
|
||||||
|
@ -211,9 +211,9 @@ void VToolCutSpline::contextMenuEvent(QGraphicsSceneContextMenuEvent *event)
|
||||||
*/
|
*/
|
||||||
void VToolCutSpline::SaveDialog(QDomElement &domElement)
|
void VToolCutSpline::SaveDialog(QDomElement &domElement)
|
||||||
{
|
{
|
||||||
SCASSERT(dialog != nullptr)
|
SCASSERT(not m_dialog.isNull())
|
||||||
DialogCutSpline *dialogTool = qobject_cast<DialogCutSpline*>(dialog);
|
QSharedPointer<DialogCutSpline> dialogTool = m_dialog.objectCast<DialogCutSpline>();
|
||||||
SCASSERT(dialogTool != nullptr)
|
SCASSERT(not dialogTool.isNull())
|
||||||
doc->SetAttribute(domElement, AttrName, dialogTool->getPointName());
|
doc->SetAttribute(domElement, AttrName, dialogTool->getPointName());
|
||||||
doc->SetAttribute(domElement, AttrLength, dialogTool->GetFormula());
|
doc->SetAttribute(domElement, AttrLength, dialogTool->GetFormula());
|
||||||
doc->SetAttribute(domElement, AttrSpline, QString().setNum(dialogTool->getSplineId()));
|
doc->SetAttribute(domElement, AttrSpline, QString().setNum(dialogTool->getSplineId()));
|
||||||
|
|
|
@ -51,7 +51,7 @@ class VToolCutSpline : public VToolCut
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
virtual void setDialog() Q_DECL_OVERRIDE;
|
virtual void setDialog() Q_DECL_OVERRIDE;
|
||||||
static VToolCutSpline *Create(DialogTool *dialog, VMainGraphicsScene *scene, VAbstractPattern *doc,
|
static VToolCutSpline *Create(QSharedPointer<DialogTool> dialog, VMainGraphicsScene *scene, VAbstractPattern *doc,
|
||||||
VContainer *data);
|
VContainer *data);
|
||||||
static VToolCutSpline *Create(const quint32 _id, const QString &pointName, QString &formula,
|
static VToolCutSpline *Create(const quint32 _id, const QString &pointName, QString &formula,
|
||||||
const quint32 &splineId, const qreal &mx, const qreal &my,
|
const quint32 &splineId, const qreal &mx, const qreal &my,
|
||||||
|
|
|
@ -87,9 +87,9 @@ VToolCutSplinePath::VToolCutSplinePath(VAbstractPattern *doc, VContainer *data,
|
||||||
*/
|
*/
|
||||||
void VToolCutSplinePath::setDialog()
|
void VToolCutSplinePath::setDialog()
|
||||||
{
|
{
|
||||||
SCASSERT(dialog != nullptr)
|
SCASSERT(not m_dialog.isNull())
|
||||||
DialogCutSplinePath *dialogTool = qobject_cast<DialogCutSplinePath*>(dialog);
|
QSharedPointer<DialogCutSplinePath> dialogTool = m_dialog.objectCast<DialogCutSplinePath>();
|
||||||
SCASSERT(dialogTool != nullptr)
|
SCASSERT(not dialogTool.isNull())
|
||||||
const QSharedPointer<VPointF> point = VAbstractTool::data.GeometricObject<VPointF>(id);
|
const QSharedPointer<VPointF> point = VAbstractTool::data.GeometricObject<VPointF>(id);
|
||||||
dialogTool->SetFormula(formula);
|
dialogTool->SetFormula(formula);
|
||||||
dialogTool->setSplinePathId(curveCutId);
|
dialogTool->setSplinePathId(curveCutId);
|
||||||
|
@ -104,12 +104,12 @@ void VToolCutSplinePath::setDialog()
|
||||||
* @param doc dom document container.
|
* @param doc dom document container.
|
||||||
* @param data container with variables.
|
* @param data container with variables.
|
||||||
*/
|
*/
|
||||||
VToolCutSplinePath* VToolCutSplinePath::Create(DialogTool *dialog, VMainGraphicsScene *scene, VAbstractPattern *doc,
|
VToolCutSplinePath* VToolCutSplinePath::Create(QSharedPointer<DialogTool> dialog, VMainGraphicsScene *scene,
|
||||||
VContainer *data)
|
VAbstractPattern *doc, VContainer *data)
|
||||||
{
|
{
|
||||||
SCASSERT(dialog != nullptr)
|
SCASSERT(not dialog.isNull())
|
||||||
DialogCutSplinePath *dialogTool = qobject_cast<DialogCutSplinePath*>(dialog);
|
QSharedPointer<DialogCutSplinePath> dialogTool = dialog.objectCast<DialogCutSplinePath>();
|
||||||
SCASSERT(dialogTool != nullptr)
|
SCASSERT(not dialogTool.isNull())
|
||||||
const QString pointName = dialogTool->getPointName();
|
const QString pointName = dialogTool->getPointName();
|
||||||
QString formula = dialogTool->GetFormula();
|
QString formula = dialogTool->GetFormula();
|
||||||
const quint32 splinePathId = dialogTool->getSplinePathId();
|
const quint32 splinePathId = dialogTool->getSplinePathId();
|
||||||
|
@ -117,7 +117,7 @@ VToolCutSplinePath* VToolCutSplinePath::Create(DialogTool *dialog, VMainGraphics
|
||||||
Document::FullParse, Source::FromGui);
|
Document::FullParse, Source::FromGui);
|
||||||
if (point != nullptr)
|
if (point != nullptr)
|
||||||
{
|
{
|
||||||
point->dialog=dialogTool;
|
point->m_dialog = dialogTool;
|
||||||
}
|
}
|
||||||
return point;
|
return point;
|
||||||
}
|
}
|
||||||
|
@ -298,9 +298,9 @@ void VToolCutSplinePath::contextMenuEvent(QGraphicsSceneContextMenuEvent *event)
|
||||||
*/
|
*/
|
||||||
void VToolCutSplinePath::SaveDialog(QDomElement &domElement)
|
void VToolCutSplinePath::SaveDialog(QDomElement &domElement)
|
||||||
{
|
{
|
||||||
SCASSERT(dialog != nullptr)
|
SCASSERT(not m_dialog.isNull())
|
||||||
DialogCutSplinePath *dialogTool = qobject_cast<DialogCutSplinePath*>(dialog);
|
QSharedPointer<DialogCutSplinePath> dialogTool = m_dialog.objectCast<DialogCutSplinePath>();
|
||||||
SCASSERT(dialogTool != nullptr)
|
SCASSERT(not dialogTool.isNull())
|
||||||
doc->SetAttribute(domElement, AttrName, dialogTool->getPointName());
|
doc->SetAttribute(domElement, AttrName, dialogTool->getPointName());
|
||||||
doc->SetAttribute(domElement, AttrLength, dialogTool->GetFormula());
|
doc->SetAttribute(domElement, AttrLength, dialogTool->GetFormula());
|
||||||
doc->SetAttribute(domElement, AttrSplinePath, QString().setNum(dialogTool->getSplinePathId()));
|
doc->SetAttribute(domElement, AttrSplinePath, QString().setNum(dialogTool->getSplinePathId()));
|
||||||
|
|
|
@ -53,8 +53,8 @@ class VToolCutSplinePath : public VToolCut
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
virtual void setDialog() Q_DECL_OVERRIDE;
|
virtual void setDialog() Q_DECL_OVERRIDE;
|
||||||
static VToolCutSplinePath *Create(DialogTool *dialog, VMainGraphicsScene *scene, VAbstractPattern *doc,
|
static VToolCutSplinePath *Create(QSharedPointer<DialogTool> dialog, VMainGraphicsScene *scene,
|
||||||
VContainer *data);
|
VAbstractPattern *doc, VContainer *data);
|
||||||
static VToolCutSplinePath *Create(const quint32 _id, const QString &pointName, QString &formula,
|
static VToolCutSplinePath *Create(const quint32 _id, const QString &pointName, QString &formula,
|
||||||
const quint32 &splinePathId, const qreal &mx, const qreal &my,
|
const quint32 &splinePathId, const qreal &mx, const qreal &my,
|
||||||
VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data,
|
VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data,
|
||||||
|
|
|
@ -127,9 +127,9 @@ void VToolAlongLine::RemoveReferens()
|
||||||
*/
|
*/
|
||||||
void VToolAlongLine::SaveDialog(QDomElement &domElement)
|
void VToolAlongLine::SaveDialog(QDomElement &domElement)
|
||||||
{
|
{
|
||||||
SCASSERT(dialog != nullptr)
|
SCASSERT(not m_dialog.isNull())
|
||||||
DialogAlongLine *dialogTool = qobject_cast<DialogAlongLine*>(dialog);
|
QSharedPointer<DialogAlongLine> dialogTool = m_dialog.objectCast<DialogAlongLine>();
|
||||||
SCASSERT(dialogTool != nullptr)
|
SCASSERT(not dialogTool.isNull())
|
||||||
doc->SetAttribute(domElement, AttrName, dialogTool->getPointName());
|
doc->SetAttribute(domElement, AttrName, dialogTool->getPointName());
|
||||||
doc->SetAttribute(domElement, AttrTypeLine, dialogTool->GetTypeLine());
|
doc->SetAttribute(domElement, AttrTypeLine, dialogTool->GetTypeLine());
|
||||||
doc->SetAttribute(domElement, AttrLineColor, dialogTool->GetLineColor());
|
doc->SetAttribute(domElement, AttrLineColor, dialogTool->GetLineColor());
|
||||||
|
@ -204,9 +204,9 @@ void VToolAlongLine::ShowVisualization(bool show)
|
||||||
*/
|
*/
|
||||||
void VToolAlongLine::setDialog()
|
void VToolAlongLine::setDialog()
|
||||||
{
|
{
|
||||||
SCASSERT(dialog != nullptr)
|
SCASSERT(not m_dialog.isNull())
|
||||||
DialogAlongLine *dialogTool = qobject_cast<DialogAlongLine*>(dialog);
|
QSharedPointer<DialogAlongLine> dialogTool = m_dialog.objectCast<DialogAlongLine>();
|
||||||
SCASSERT(dialogTool != nullptr)
|
SCASSERT(not dialogTool.isNull())
|
||||||
const QSharedPointer<VPointF> p = VAbstractTool::data.GeometricObject<VPointF>(id);
|
const QSharedPointer<VPointF> p = VAbstractTool::data.GeometricObject<VPointF>(id);
|
||||||
dialogTool->SetTypeLine(typeLine);
|
dialogTool->SetTypeLine(typeLine);
|
||||||
dialogTool->SetLineColor(lineColor);
|
dialogTool->SetLineColor(lineColor);
|
||||||
|
@ -224,12 +224,12 @@ void VToolAlongLine::setDialog()
|
||||||
* @param doc dom document container.
|
* @param doc dom document container.
|
||||||
* @param data container with variables.
|
* @param data container with variables.
|
||||||
*/
|
*/
|
||||||
VToolAlongLine* VToolAlongLine::Create(DialogTool *dialog, VMainGraphicsScene *scene, VAbstractPattern *doc,
|
VToolAlongLine* VToolAlongLine::Create(QSharedPointer<DialogTool> dialog, VMainGraphicsScene *scene,
|
||||||
VContainer *data)
|
VAbstractPattern *doc, VContainer *data)
|
||||||
{
|
{
|
||||||
SCASSERT(dialog != nullptr)
|
SCASSERT(not dialog.isNull())
|
||||||
DialogAlongLine *dialogTool = qobject_cast<DialogAlongLine*>(dialog);
|
QSharedPointer<DialogAlongLine> dialogTool = dialog.objectCast<DialogAlongLine>();
|
||||||
SCASSERT(dialogTool != nullptr)
|
SCASSERT(not dialogTool.isNull())
|
||||||
QString formula = dialogTool->GetFormula();
|
QString formula = dialogTool->GetFormula();
|
||||||
const quint32 firstPointId = dialogTool->GetFirstPointId();
|
const quint32 firstPointId = dialogTool->GetFirstPointId();
|
||||||
const quint32 secondPointId = dialogTool->GetSecondPointId();
|
const quint32 secondPointId = dialogTool->GetSecondPointId();
|
||||||
|
@ -240,7 +240,7 @@ VToolAlongLine* VToolAlongLine::Create(DialogTool *dialog, VMainGraphicsScene *s
|
||||||
5, 10, scene, doc, data, Document::FullParse, Source::FromGui);
|
5, 10, scene, doc, data, Document::FullParse, Source::FromGui);
|
||||||
if (point != nullptr)
|
if (point != nullptr)
|
||||||
{
|
{
|
||||||
point->dialog=dialogTool;
|
point->m_dialog = dialogTool;
|
||||||
}
|
}
|
||||||
return point;
|
return point;
|
||||||
}
|
}
|
||||||
|
|
|
@ -51,8 +51,8 @@ class VToolAlongLine : public VToolLinePoint
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
virtual void setDialog() Q_DECL_OVERRIDE;
|
virtual void setDialog() Q_DECL_OVERRIDE;
|
||||||
static VToolAlongLine* Create(DialogTool *dialog, VMainGraphicsScene *scene, VAbstractPattern *doc,
|
static VToolAlongLine* Create(QSharedPointer<DialogTool> dialog, VMainGraphicsScene *scene,
|
||||||
VContainer *data);
|
VAbstractPattern *doc, VContainer *data);
|
||||||
static VToolAlongLine* Create(const quint32 _id, const QString &pointName, const QString &typeLine,
|
static VToolAlongLine* Create(const quint32 _id, const QString &pointName, const QString &typeLine,
|
||||||
const QString &lineColor, QString &formula, const quint32 &firstPointId,
|
const QString &lineColor, QString &formula, const quint32 &firstPointId,
|
||||||
const quint32 &secondPointId, const qreal &mx, const qreal &my,
|
const quint32 &secondPointId, const qreal &mx, const qreal &my,
|
||||||
|
|
|
@ -121,9 +121,9 @@ QPointF VToolBisector::FindPoint(const QPointF &firstPoint, const QPointF &secon
|
||||||
*/
|
*/
|
||||||
void VToolBisector::setDialog()
|
void VToolBisector::setDialog()
|
||||||
{
|
{
|
||||||
SCASSERT(dialog != nullptr)
|
SCASSERT(not m_dialog.isNull())
|
||||||
DialogBisector *dialogTool = qobject_cast<DialogBisector*>(dialog);
|
QSharedPointer<DialogBisector> dialogTool = m_dialog.objectCast<DialogBisector>();
|
||||||
SCASSERT(dialogTool != nullptr)
|
SCASSERT(not dialogTool.isNull())
|
||||||
const QSharedPointer<VPointF> p = VAbstractTool::data.GeometricObject<VPointF>(id);
|
const QSharedPointer<VPointF> p = VAbstractTool::data.GeometricObject<VPointF>(id);
|
||||||
dialogTool->SetTypeLine(typeLine);
|
dialogTool->SetTypeLine(typeLine);
|
||||||
dialogTool->SetLineColor(lineColor);
|
dialogTool->SetLineColor(lineColor);
|
||||||
|
@ -142,12 +142,12 @@ void VToolBisector::setDialog()
|
||||||
* @param doc dom document container.
|
* @param doc dom document container.
|
||||||
* @param data container with variables.
|
* @param data container with variables.
|
||||||
*/
|
*/
|
||||||
VToolBisector* VToolBisector::Create(DialogTool *dialog, VMainGraphicsScene *scene, VAbstractPattern *doc,
|
VToolBisector* VToolBisector::Create(QSharedPointer<DialogTool> dialog, VMainGraphicsScene *scene,
|
||||||
VContainer *data)
|
VAbstractPattern *doc, VContainer *data)
|
||||||
{
|
{
|
||||||
SCASSERT(dialog != nullptr)
|
SCASSERT(not dialog.isNull())
|
||||||
DialogBisector *dialogTool = qobject_cast<DialogBisector*>(dialog);
|
QSharedPointer<DialogBisector> dialogTool = dialog.objectCast<DialogBisector>();
|
||||||
SCASSERT(dialogTool != nullptr)
|
SCASSERT(not dialogTool.isNull())
|
||||||
QString formula = dialogTool->GetFormula();
|
QString formula = dialogTool->GetFormula();
|
||||||
const quint32 firstPointId = dialogTool->GetFirstPointId();
|
const quint32 firstPointId = dialogTool->GetFirstPointId();
|
||||||
const quint32 secondPointId = dialogTool->GetSecondPointId();
|
const quint32 secondPointId = dialogTool->GetSecondPointId();
|
||||||
|
@ -159,7 +159,7 @@ VToolBisector* VToolBisector::Create(DialogTool *dialog, VMainGraphicsScene *sce
|
||||||
pointName, 5, 10, scene, doc, data, Document::FullParse, Source::FromGui);
|
pointName, 5, 10, scene, doc, data, Document::FullParse, Source::FromGui);
|
||||||
if (point != nullptr)
|
if (point != nullptr)
|
||||||
{
|
{
|
||||||
point->dialog=dialogTool;
|
point->m_dialog = dialogTool;
|
||||||
}
|
}
|
||||||
return point;
|
return point;
|
||||||
}
|
}
|
||||||
|
@ -290,9 +290,9 @@ void VToolBisector::RemoveReferens()
|
||||||
*/
|
*/
|
||||||
void VToolBisector::SaveDialog(QDomElement &domElement)
|
void VToolBisector::SaveDialog(QDomElement &domElement)
|
||||||
{
|
{
|
||||||
SCASSERT(dialog != nullptr)
|
SCASSERT(not m_dialog.isNull())
|
||||||
DialogBisector *dialogTool = qobject_cast<DialogBisector*>(dialog);
|
QSharedPointer<DialogBisector> dialogTool = m_dialog.objectCast<DialogBisector>();
|
||||||
SCASSERT(dialogTool != nullptr)
|
SCASSERT(not dialogTool.isNull())
|
||||||
doc->SetAttribute(domElement, AttrName, dialogTool->getPointName());
|
doc->SetAttribute(domElement, AttrName, dialogTool->getPointName());
|
||||||
doc->SetAttribute(domElement, AttrTypeLine, dialogTool->GetTypeLine());
|
doc->SetAttribute(domElement, AttrTypeLine, dialogTool->GetTypeLine());
|
||||||
doc->SetAttribute(domElement, AttrLineColor, dialogTool->GetLineColor());
|
doc->SetAttribute(domElement, AttrLineColor, dialogTool->GetLineColor());
|
||||||
|
|
|
@ -55,7 +55,7 @@ public:
|
||||||
static QPointF FindPoint(const QPointF &firstPoint, const QPointF &secondPoint, const QPointF &thirdPoint,
|
static QPointF FindPoint(const QPointF &firstPoint, const QPointF &secondPoint, const QPointF &thirdPoint,
|
||||||
const qreal& length);
|
const qreal& length);
|
||||||
virtual void setDialog() Q_DECL_OVERRIDE;
|
virtual void setDialog() Q_DECL_OVERRIDE;
|
||||||
static VToolBisector* Create(DialogTool *dialog, VMainGraphicsScene *scene, VAbstractPattern *doc,
|
static VToolBisector* Create(QSharedPointer<DialogTool> dialog, VMainGraphicsScene *scene, VAbstractPattern *doc,
|
||||||
VContainer *data);
|
VContainer *data);
|
||||||
static VToolBisector* Create(const quint32 _id, QString &formula, const quint32 &firstPointId,
|
static VToolBisector* Create(const quint32 _id, QString &formula, const quint32 &firstPointId,
|
||||||
const quint32 &secondPointId, const quint32 &thirdPointId, const QString &typeLine,
|
const quint32 &secondPointId, const quint32 &thirdPointId, const QString &typeLine,
|
||||||
|
|
|
@ -84,10 +84,10 @@ VToolCurveIntersectAxis::VToolCurveIntersectAxis(VAbstractPattern *doc, VContain
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VToolCurveIntersectAxis::setDialog()
|
void VToolCurveIntersectAxis::setDialog()
|
||||||
{
|
{
|
||||||
SCASSERT(dialog != nullptr)
|
SCASSERT(not m_dialog.isNull())
|
||||||
dialog->setModal(true);
|
m_dialog->setModal(true);
|
||||||
DialogCurveIntersectAxis *dialogTool = qobject_cast<DialogCurveIntersectAxis*>(dialog);
|
QSharedPointer<DialogCurveIntersectAxis> dialogTool = m_dialog.objectCast<DialogCurveIntersectAxis>();
|
||||||
SCASSERT(dialogTool != nullptr)
|
SCASSERT(not dialogTool.isNull())
|
||||||
const QSharedPointer<VPointF> p = VAbstractTool::data.GeometricObject<VPointF>(id);
|
const QSharedPointer<VPointF> p = VAbstractTool::data.GeometricObject<VPointF>(id);
|
||||||
dialogTool->SetTypeLine(typeLine);
|
dialogTool->SetTypeLine(typeLine);
|
||||||
dialogTool->SetLineColor(lineColor);
|
dialogTool->SetLineColor(lineColor);
|
||||||
|
@ -98,13 +98,13 @@ void VToolCurveIntersectAxis::setDialog()
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
VToolCurveIntersectAxis *VToolCurveIntersectAxis::Create(DialogTool *dialog, VMainGraphicsScene *scene,
|
VToolCurveIntersectAxis *VToolCurveIntersectAxis::Create(QSharedPointer<DialogTool> dialog, VMainGraphicsScene *scene,
|
||||||
VAbstractPattern *doc,
|
VAbstractPattern *doc,
|
||||||
VContainer *data)
|
VContainer *data)
|
||||||
{
|
{
|
||||||
SCASSERT(dialog != nullptr)
|
SCASSERT(not dialog.isNull())
|
||||||
DialogCurveIntersectAxis *dialogTool = qobject_cast<DialogCurveIntersectAxis*>(dialog);
|
QSharedPointer<DialogCurveIntersectAxis> dialogTool = dialog.objectCast<DialogCurveIntersectAxis>();
|
||||||
SCASSERT(dialogTool)
|
SCASSERT(not dialogTool.isNull())
|
||||||
const QString pointName = dialogTool->getPointName();
|
const QString pointName = dialogTool->getPointName();
|
||||||
const QString typeLine = dialogTool->GetTypeLine();
|
const QString typeLine = dialogTool->GetTypeLine();
|
||||||
const QString lineColor = dialogTool->GetLineColor();
|
const QString lineColor = dialogTool->GetLineColor();
|
||||||
|
@ -113,11 +113,10 @@ VToolCurveIntersectAxis *VToolCurveIntersectAxis::Create(DialogTool *dialog, VMa
|
||||||
const quint32 curveId = dialogTool->getCurveId();
|
const quint32 curveId = dialogTool->getCurveId();
|
||||||
|
|
||||||
VToolCurveIntersectAxis *point = Create(0, pointName, typeLine, lineColor, formulaAngle, basePointId,
|
VToolCurveIntersectAxis *point = Create(0, pointName, typeLine, lineColor, formulaAngle, basePointId,
|
||||||
curveId, 5, 10, scene, doc, data, Document::FullParse,
|
curveId, 5, 10, scene, doc, data, Document::FullParse, Source::FromGui);
|
||||||
Source::FromGui);
|
|
||||||
if (point != nullptr)
|
if (point != nullptr)
|
||||||
{
|
{
|
||||||
point->dialog=dialogTool;
|
point->m_dialog = dialogTool;
|
||||||
}
|
}
|
||||||
return point;
|
return point;
|
||||||
}
|
}
|
||||||
|
@ -279,9 +278,9 @@ void VToolCurveIntersectAxis::contextMenuEvent(QGraphicsSceneContextMenuEvent *e
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VToolCurveIntersectAxis::SaveDialog(QDomElement &domElement)
|
void VToolCurveIntersectAxis::SaveDialog(QDomElement &domElement)
|
||||||
{
|
{
|
||||||
SCASSERT(dialog != nullptr)
|
SCASSERT(not m_dialog.isNull())
|
||||||
DialogCurveIntersectAxis *dialogTool = qobject_cast<DialogCurveIntersectAxis*>(dialog);
|
QSharedPointer<DialogCurveIntersectAxis> dialogTool = m_dialog.objectCast<DialogCurveIntersectAxis>();
|
||||||
SCASSERT(dialogTool != nullptr)
|
SCASSERT(not dialogTool.isNull())
|
||||||
doc->SetAttribute(domElement, AttrName, dialogTool->getPointName());
|
doc->SetAttribute(domElement, AttrName, dialogTool->getPointName());
|
||||||
doc->SetAttribute(domElement, AttrTypeLine, dialogTool->GetTypeLine());
|
doc->SetAttribute(domElement, AttrTypeLine, dialogTool->GetTypeLine());
|
||||||
doc->SetAttribute(domElement, AttrLineColor, dialogTool->GetLineColor());
|
doc->SetAttribute(domElement, AttrLineColor, dialogTool->GetLineColor());
|
||||||
|
|
|
@ -53,8 +53,8 @@ public:
|
||||||
virtual ~VToolCurveIntersectAxis() Q_DECL_EQ_DEFAULT;
|
virtual ~VToolCurveIntersectAxis() Q_DECL_EQ_DEFAULT;
|
||||||
virtual void setDialog() Q_DECL_OVERRIDE;
|
virtual void setDialog() Q_DECL_OVERRIDE;
|
||||||
|
|
||||||
static VToolCurveIntersectAxis *Create(DialogTool *dialog, VMainGraphicsScene *scene, VAbstractPattern *doc,
|
static VToolCurveIntersectAxis *Create(QSharedPointer<DialogTool> dialog, VMainGraphicsScene *scene,
|
||||||
VContainer *data);
|
VAbstractPattern *doc, VContainer *data);
|
||||||
static VToolCurveIntersectAxis *Create(const quint32 _id, const QString &pointName, const QString &typeLine,
|
static VToolCurveIntersectAxis *Create(const quint32 _id, const QString &pointName, const QString &typeLine,
|
||||||
const QString &lineColor, QString &formulaAngle, const quint32 &basePointId,
|
const QString &lineColor, QString &formulaAngle, const quint32 &basePointId,
|
||||||
const quint32 &curveId, const qreal &mx, const qreal &my,
|
const quint32 &curveId, const qreal &mx, const qreal &my,
|
||||||
|
|
|
@ -84,10 +84,10 @@ VToolEndLine::VToolEndLine(VAbstractPattern *doc, VContainer *data, const quint3
|
||||||
*/
|
*/
|
||||||
void VToolEndLine::setDialog()
|
void VToolEndLine::setDialog()
|
||||||
{
|
{
|
||||||
SCASSERT(dialog != nullptr)
|
SCASSERT(not m_dialog.isNull())
|
||||||
dialog->setModal(true);
|
m_dialog->setModal(true);
|
||||||
DialogEndLine *dialogTool = qobject_cast<DialogEndLine*>(dialog);
|
QSharedPointer<DialogEndLine> dialogTool = m_dialog.objectCast<DialogEndLine>();
|
||||||
SCASSERT(dialogTool != nullptr)
|
SCASSERT(not dialogTool.isNull())
|
||||||
const QSharedPointer<VPointF> p = VAbstractTool::data.GeometricObject<VPointF>(id);
|
const QSharedPointer<VPointF> p = VAbstractTool::data.GeometricObject<VPointF>(id);
|
||||||
dialogTool->SetTypeLine(typeLine);
|
dialogTool->SetTypeLine(typeLine);
|
||||||
dialogTool->SetLineColor(lineColor);
|
dialogTool->SetLineColor(lineColor);
|
||||||
|
@ -106,12 +106,12 @@ void VToolEndLine::setDialog()
|
||||||
* @param data container with variables.
|
* @param data container with variables.
|
||||||
* @return the created tool
|
* @return the created tool
|
||||||
*/
|
*/
|
||||||
VToolEndLine* VToolEndLine::Create(DialogTool *dialog, VMainGraphicsScene *scene, VAbstractPattern *doc,
|
VToolEndLine* VToolEndLine::Create(QSharedPointer<DialogTool> dialog, VMainGraphicsScene *scene, VAbstractPattern *doc,
|
||||||
VContainer *data)
|
VContainer *data)
|
||||||
{
|
{
|
||||||
SCASSERT(dialog != nullptr)
|
SCASSERT(not dialog.isNull())
|
||||||
DialogEndLine *dialogTool = qobject_cast<DialogEndLine*>(dialog);
|
QSharedPointer<DialogEndLine> dialogTool = dialog.objectCast<DialogEndLine>();
|
||||||
SCASSERT(dialogTool)
|
SCASSERT(not dialogTool.isNull())
|
||||||
const QString pointName = dialogTool->getPointName();
|
const QString pointName = dialogTool->getPointName();
|
||||||
const QString typeLine = dialogTool->GetTypeLine();
|
const QString typeLine = dialogTool->GetTypeLine();
|
||||||
const QString lineColor = dialogTool->GetLineColor();
|
const QString lineColor = dialogTool->GetLineColor();
|
||||||
|
@ -123,7 +123,7 @@ VToolEndLine* VToolEndLine::Create(DialogTool *dialog, VMainGraphicsScene *scene
|
||||||
basePointId, 5, 10, scene, doc, data, Document::FullParse, Source::FromGui);
|
basePointId, 5, 10, scene, doc, data, Document::FullParse, Source::FromGui);
|
||||||
if (point != nullptr)
|
if (point != nullptr)
|
||||||
{
|
{
|
||||||
point->dialog=dialogTool;
|
point->m_dialog = dialogTool;
|
||||||
}
|
}
|
||||||
return point;
|
return point;
|
||||||
}
|
}
|
||||||
|
@ -213,9 +213,9 @@ void VToolEndLine::contextMenuEvent(QGraphicsSceneContextMenuEvent *event)
|
||||||
*/
|
*/
|
||||||
void VToolEndLine::SaveDialog(QDomElement &domElement)
|
void VToolEndLine::SaveDialog(QDomElement &domElement)
|
||||||
{
|
{
|
||||||
SCASSERT(dialog != nullptr)
|
SCASSERT(not m_dialog.isNull())
|
||||||
DialogEndLine *dialogTool = qobject_cast<DialogEndLine*>(dialog);
|
QSharedPointer<DialogEndLine> dialogTool = m_dialog.objectCast<DialogEndLine>();
|
||||||
SCASSERT(dialogTool != nullptr)
|
SCASSERT(not dialogTool.isNull())
|
||||||
doc->SetAttribute(domElement, AttrName, dialogTool->getPointName());
|
doc->SetAttribute(domElement, AttrName, dialogTool->getPointName());
|
||||||
doc->SetAttribute(domElement, AttrTypeLine, dialogTool->GetTypeLine());
|
doc->SetAttribute(domElement, AttrTypeLine, dialogTool->GetTypeLine());
|
||||||
doc->SetAttribute(domElement, AttrLineColor, dialogTool->GetLineColor());
|
doc->SetAttribute(domElement, AttrLineColor, dialogTool->GetLineColor());
|
||||||
|
|
|
@ -53,7 +53,7 @@ class VToolEndLine : public VToolLinePoint
|
||||||
public:
|
public:
|
||||||
virtual ~VToolEndLine() Q_DECL_EQ_DEFAULT;
|
virtual ~VToolEndLine() Q_DECL_EQ_DEFAULT;
|
||||||
virtual void setDialog() Q_DECL_OVERRIDE;
|
virtual void setDialog() Q_DECL_OVERRIDE;
|
||||||
static VToolEndLine *Create(DialogTool *dialog, VMainGraphicsScene *scene, VAbstractPattern *doc,
|
static VToolEndLine *Create(QSharedPointer<DialogTool> dialog, VMainGraphicsScene *scene, VAbstractPattern *doc,
|
||||||
VContainer *data);
|
VContainer *data);
|
||||||
static VToolEndLine *Create(const quint32 _id, const QString &pointName, const QString &typeLine,
|
static VToolEndLine *Create(const quint32 _id, const QString &pointName, const QString &typeLine,
|
||||||
const QString &lineColor, QString &formulaLength, QString &formulaAngle,
|
const QString &lineColor, QString &formulaLength, QString &formulaAngle,
|
||||||
|
|
|
@ -80,9 +80,9 @@ VToolHeight::VToolHeight(VAbstractPattern *doc, VContainer *data, const quint32
|
||||||
*/
|
*/
|
||||||
void VToolHeight::setDialog()
|
void VToolHeight::setDialog()
|
||||||
{
|
{
|
||||||
SCASSERT(dialog != nullptr)
|
SCASSERT(not m_dialog.isNull())
|
||||||
DialogHeight *dialogTool = qobject_cast<DialogHeight*>(dialog);
|
QSharedPointer<DialogHeight> dialogTool = m_dialog.objectCast<DialogHeight>();
|
||||||
SCASSERT(dialogTool != nullptr)
|
SCASSERT(not dialogTool.isNull())
|
||||||
const QSharedPointer<VPointF> p = VAbstractTool::data.GeometricObject<VPointF>(id);
|
const QSharedPointer<VPointF> p = VAbstractTool::data.GeometricObject<VPointF>(id);
|
||||||
dialogTool->SetTypeLine(typeLine);
|
dialogTool->SetTypeLine(typeLine);
|
||||||
dialogTool->SetLineColor(lineColor);
|
dialogTool->SetLineColor(lineColor);
|
||||||
|
@ -101,11 +101,12 @@ void VToolHeight::setDialog()
|
||||||
* @param data container with variables.
|
* @param data container with variables.
|
||||||
* @return the created tool
|
* @return the created tool
|
||||||
*/
|
*/
|
||||||
VToolHeight* VToolHeight::Create(DialogTool *dialog, VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data)
|
VToolHeight* VToolHeight::Create(QSharedPointer<DialogTool> dialog, VMainGraphicsScene *scene, VAbstractPattern *doc,
|
||||||
|
VContainer *data)
|
||||||
{
|
{
|
||||||
SCASSERT(dialog != nullptr)
|
SCASSERT(not dialog.isNull())
|
||||||
DialogHeight *dialogTool = qobject_cast<DialogHeight*>(dialog);
|
QSharedPointer<DialogHeight> dialogTool = dialog.objectCast<DialogHeight>();
|
||||||
SCASSERT(dialogTool != nullptr)
|
SCASSERT(not dialogTool.isNull())
|
||||||
const QString pointName = dialogTool->getPointName();
|
const QString pointName = dialogTool->getPointName();
|
||||||
const QString typeLine = dialogTool->GetTypeLine();
|
const QString typeLine = dialogTool->GetTypeLine();
|
||||||
const QString lineColor = dialogTool->GetLineColor();
|
const QString lineColor = dialogTool->GetLineColor();
|
||||||
|
@ -117,7 +118,7 @@ VToolHeight* VToolHeight::Create(DialogTool *dialog, VMainGraphicsScene *scene,
|
||||||
data, Document::FullParse, Source::FromGui);
|
data, Document::FullParse, Source::FromGui);
|
||||||
if (point != nullptr)
|
if (point != nullptr)
|
||||||
{
|
{
|
||||||
point->dialog=dialogTool;
|
point->m_dialog = dialogTool;
|
||||||
}
|
}
|
||||||
return point;
|
return point;
|
||||||
}
|
}
|
||||||
|
@ -236,9 +237,9 @@ void VToolHeight::contextMenuEvent(QGraphicsSceneContextMenuEvent *event)
|
||||||
*/
|
*/
|
||||||
void VToolHeight::SaveDialog(QDomElement &domElement)
|
void VToolHeight::SaveDialog(QDomElement &domElement)
|
||||||
{
|
{
|
||||||
SCASSERT(dialog != nullptr)
|
SCASSERT(not m_dialog.isNull())
|
||||||
DialogHeight *dialogTool = qobject_cast<DialogHeight*>(dialog);
|
QSharedPointer<DialogHeight> dialogTool = m_dialog.objectCast<DialogHeight>();
|
||||||
SCASSERT(dialogTool != nullptr)
|
SCASSERT(not dialogTool.isNull())
|
||||||
doc->SetAttribute(domElement, AttrName, dialogTool->getPointName());
|
doc->SetAttribute(domElement, AttrName, dialogTool->getPointName());
|
||||||
doc->SetAttribute(domElement, AttrTypeLine, dialogTool->GetTypeLine());
|
doc->SetAttribute(domElement, AttrTypeLine, dialogTool->GetTypeLine());
|
||||||
doc->SetAttribute(domElement, AttrLineColor, dialogTool->GetLineColor());
|
doc->SetAttribute(domElement, AttrLineColor, dialogTool->GetLineColor());
|
||||||
|
|
|
@ -53,7 +53,8 @@ class VToolHeight: public VToolLinePoint
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
virtual void setDialog() Q_DECL_OVERRIDE;
|
virtual void setDialog() Q_DECL_OVERRIDE;
|
||||||
static VToolHeight *Create(DialogTool *dialog, VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data);
|
static VToolHeight *Create(QSharedPointer<DialogTool> dialog, VMainGraphicsScene *scene, VAbstractPattern *doc,
|
||||||
|
VContainer *data);
|
||||||
static VToolHeight *Create(const quint32 _id, const QString &pointName, const QString &typeLine,
|
static VToolHeight *Create(const quint32 _id, const QString &pointName, const QString &typeLine,
|
||||||
const QString &lineColor, const quint32 &basePointId, const quint32 &p1LineId,
|
const QString &lineColor, const quint32 &basePointId, const quint32 &p1LineId,
|
||||||
const quint32 &p2LineId, const qreal &mx, const qreal &my, VMainGraphicsScene *scene,
|
const quint32 &p2LineId, const qreal &mx, const qreal &my, VMainGraphicsScene *scene,
|
||||||
|
|
|
@ -70,10 +70,10 @@ VToolLineIntersectAxis::VToolLineIntersectAxis(VAbstractPattern *doc, VContainer
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VToolLineIntersectAxis::setDialog()
|
void VToolLineIntersectAxis::setDialog()
|
||||||
{
|
{
|
||||||
SCASSERT(dialog != nullptr)
|
SCASSERT(not m_dialog.isNull())
|
||||||
dialog->setModal(true);
|
m_dialog->setModal(true);
|
||||||
DialogLineIntersectAxis *dialogTool = qobject_cast<DialogLineIntersectAxis*>(dialog);
|
QSharedPointer<DialogLineIntersectAxis> dialogTool = m_dialog.objectCast<DialogLineIntersectAxis>();
|
||||||
SCASSERT(dialogTool != nullptr)
|
SCASSERT(not dialogTool.isNull())
|
||||||
const QSharedPointer<VPointF> p = VAbstractTool::data.GeometricObject<VPointF>(id);
|
const QSharedPointer<VPointF> p = VAbstractTool::data.GeometricObject<VPointF>(id);
|
||||||
dialogTool->SetTypeLine(typeLine);
|
dialogTool->SetTypeLine(typeLine);
|
||||||
dialogTool->SetLineColor(lineColor);
|
dialogTool->SetLineColor(lineColor);
|
||||||
|
@ -85,13 +85,12 @@ void VToolLineIntersectAxis::setDialog()
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
VToolLineIntersectAxis *VToolLineIntersectAxis::Create(DialogTool *dialog, VMainGraphicsScene *scene,
|
VToolLineIntersectAxis *VToolLineIntersectAxis::Create(QSharedPointer<DialogTool> dialog, VMainGraphicsScene *scene,
|
||||||
VAbstractPattern *doc,
|
VAbstractPattern *doc, VContainer *data)
|
||||||
VContainer *data)
|
|
||||||
{
|
{
|
||||||
SCASSERT(dialog != nullptr)
|
SCASSERT(not dialog.isNull())
|
||||||
DialogLineIntersectAxis *dialogTool = qobject_cast<DialogLineIntersectAxis*>(dialog);
|
QSharedPointer<DialogLineIntersectAxis> dialogTool = dialog.objectCast<DialogLineIntersectAxis>();
|
||||||
SCASSERT(dialogTool)
|
SCASSERT(not dialogTool.isNull())
|
||||||
const QString pointName = dialogTool->getPointName();
|
const QString pointName = dialogTool->getPointName();
|
||||||
const QString typeLine = dialogTool->GetTypeLine();
|
const QString typeLine = dialogTool->GetTypeLine();
|
||||||
const QString lineColor = dialogTool->GetLineColor();
|
const QString lineColor = dialogTool->GetLineColor();
|
||||||
|
@ -105,7 +104,7 @@ VToolLineIntersectAxis *VToolLineIntersectAxis::Create(DialogTool *dialog, VMain
|
||||||
scene, doc, data, Document::FullParse, Source::FromGui);
|
scene, doc, data, Document::FullParse, Source::FromGui);
|
||||||
if (point != nullptr)
|
if (point != nullptr)
|
||||||
{
|
{
|
||||||
point->dialog=dialogTool;
|
point->m_dialog = dialogTool;
|
||||||
}
|
}
|
||||||
return point;
|
return point;
|
||||||
}
|
}
|
||||||
|
@ -281,9 +280,9 @@ void VToolLineIntersectAxis::contextMenuEvent(QGraphicsSceneContextMenuEvent *ev
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VToolLineIntersectAxis::SaveDialog(QDomElement &domElement)
|
void VToolLineIntersectAxis::SaveDialog(QDomElement &domElement)
|
||||||
{
|
{
|
||||||
SCASSERT(dialog != nullptr)
|
SCASSERT(not m_dialog.isNull())
|
||||||
DialogLineIntersectAxis *dialogTool = qobject_cast<DialogLineIntersectAxis*>(dialog);
|
QSharedPointer<DialogLineIntersectAxis> dialogTool = m_dialog.objectCast<DialogLineIntersectAxis>();
|
||||||
SCASSERT(dialogTool != nullptr)
|
SCASSERT(not dialogTool.isNull())
|
||||||
doc->SetAttribute(domElement, AttrName, dialogTool->getPointName());
|
doc->SetAttribute(domElement, AttrName, dialogTool->getPointName());
|
||||||
doc->SetAttribute(domElement, AttrTypeLine, dialogTool->GetTypeLine());
|
doc->SetAttribute(domElement, AttrTypeLine, dialogTool->GetTypeLine());
|
||||||
doc->SetAttribute(domElement, AttrLineColor, dialogTool->GetLineColor());
|
doc->SetAttribute(domElement, AttrLineColor, dialogTool->GetLineColor());
|
||||||
|
|
|
@ -53,8 +53,8 @@ public:
|
||||||
virtual ~VToolLineIntersectAxis() Q_DECL_EQ_DEFAULT;
|
virtual ~VToolLineIntersectAxis() Q_DECL_EQ_DEFAULT;
|
||||||
virtual void setDialog() Q_DECL_OVERRIDE;
|
virtual void setDialog() Q_DECL_OVERRIDE;
|
||||||
|
|
||||||
static VToolLineIntersectAxis *Create(DialogTool *dialog, VMainGraphicsScene *scene, VAbstractPattern *doc,
|
static VToolLineIntersectAxis *Create(QSharedPointer<DialogTool> dialog, VMainGraphicsScene *scene,
|
||||||
VContainer *data);
|
VAbstractPattern *doc, VContainer *data);
|
||||||
static VToolLineIntersectAxis *Create(const quint32 _id, const QString &pointName, const QString &typeLine,
|
static VToolLineIntersectAxis *Create(const quint32 _id, const QString &pointName, const QString &typeLine,
|
||||||
const QString &lineColor, QString &formulaAngle, const quint32 &basePointId,
|
const QString &lineColor, QString &formulaAngle, const quint32 &basePointId,
|
||||||
const quint32 &firstPointId, const quint32 &secondPointId,
|
const quint32 &firstPointId, const quint32 &secondPointId,
|
||||||
|
|
|
@ -87,9 +87,9 @@ VToolNormal::VToolNormal(VAbstractPattern *doc, VContainer *data, const quint32
|
||||||
*/
|
*/
|
||||||
void VToolNormal::setDialog()
|
void VToolNormal::setDialog()
|
||||||
{
|
{
|
||||||
SCASSERT(dialog != nullptr)
|
SCASSERT(not m_dialog.isNull())
|
||||||
DialogNormal *dialogTool = qobject_cast<DialogNormal*>(dialog);
|
QSharedPointer<DialogNormal> dialogTool = m_dialog.objectCast<DialogNormal>();
|
||||||
SCASSERT(dialogTool != nullptr)
|
SCASSERT(not dialogTool.isNull())
|
||||||
const QSharedPointer<VPointF> p = VAbstractTool::data.GeometricObject<VPointF>(id);
|
const QSharedPointer<VPointF> p = VAbstractTool::data.GeometricObject<VPointF>(id);
|
||||||
dialogTool->SetTypeLine(typeLine);
|
dialogTool->SetTypeLine(typeLine);
|
||||||
dialogTool->SetFormula(formulaLength);
|
dialogTool->SetFormula(formulaLength);
|
||||||
|
@ -107,11 +107,12 @@ void VToolNormal::setDialog()
|
||||||
* @param doc dom document container.
|
* @param doc dom document container.
|
||||||
* @param data container with variables.
|
* @param data container with variables.
|
||||||
*/
|
*/
|
||||||
VToolNormal* VToolNormal::Create(DialogTool *dialog, VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data)
|
VToolNormal* VToolNormal::Create(QSharedPointer<DialogTool> dialog, VMainGraphicsScene *scene, VAbstractPattern *doc,
|
||||||
|
VContainer *data)
|
||||||
{
|
{
|
||||||
SCASSERT(dialog != nullptr)
|
SCASSERT(not dialog.isNull())
|
||||||
DialogNormal *dialogTool = qobject_cast<DialogNormal*>(dialog);
|
QSharedPointer<DialogNormal> dialogTool = dialog.objectCast<DialogNormal>();
|
||||||
SCASSERT(dialogTool != nullptr)
|
SCASSERT(not dialogTool.isNull())
|
||||||
QString formula = dialogTool->GetFormula();
|
QString formula = dialogTool->GetFormula();
|
||||||
const quint32 firstPointId = dialogTool->GetFirstPointId();
|
const quint32 firstPointId = dialogTool->GetFirstPointId();
|
||||||
const quint32 secondPointId = dialogTool->GetSecondPointId();
|
const quint32 secondPointId = dialogTool->GetSecondPointId();
|
||||||
|
@ -123,7 +124,7 @@ VToolNormal* VToolNormal::Create(DialogTool *dialog, VMainGraphicsScene *scene,
|
||||||
scene, doc, data, Document::FullParse, Source::FromGui);
|
scene, doc, data, Document::FullParse, Source::FromGui);
|
||||||
if (point != nullptr)
|
if (point != nullptr)
|
||||||
{
|
{
|
||||||
point->dialog=dialogTool;
|
point->m_dialog = dialogTool;
|
||||||
}
|
}
|
||||||
return point;
|
return point;
|
||||||
}
|
}
|
||||||
|
@ -262,9 +263,9 @@ void VToolNormal::RemoveReferens()
|
||||||
*/
|
*/
|
||||||
void VToolNormal::SaveDialog(QDomElement &domElement)
|
void VToolNormal::SaveDialog(QDomElement &domElement)
|
||||||
{
|
{
|
||||||
SCASSERT(dialog != nullptr)
|
SCASSERT(not m_dialog.isNull())
|
||||||
DialogNormal *dialogTool = qobject_cast<DialogNormal*>(dialog);
|
QSharedPointer<DialogNormal> dialogTool = m_dialog.objectCast<DialogNormal>();
|
||||||
SCASSERT(dialogTool != nullptr)
|
SCASSERT(not dialogTool.isNull())
|
||||||
doc->SetAttribute(domElement, AttrName, dialogTool->getPointName());
|
doc->SetAttribute(domElement, AttrName, dialogTool->getPointName());
|
||||||
doc->SetAttribute(domElement, AttrTypeLine, dialogTool->GetTypeLine());
|
doc->SetAttribute(domElement, AttrTypeLine, dialogTool->GetTypeLine());
|
||||||
doc->SetAttribute(domElement, AttrLineColor, dialogTool->GetLineColor());
|
doc->SetAttribute(domElement, AttrLineColor, dialogTool->GetLineColor());
|
||||||
|
|
|
@ -52,7 +52,8 @@ class VToolNormal : public VToolLinePoint
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
virtual void setDialog() Q_DECL_OVERRIDE;
|
virtual void setDialog() Q_DECL_OVERRIDE;
|
||||||
static VToolNormal* Create(DialogTool *dialog, VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data);
|
static VToolNormal* Create(QSharedPointer<DialogTool> dialog, VMainGraphicsScene *scene, VAbstractPattern *doc,
|
||||||
|
VContainer *data);
|
||||||
static VToolNormal* Create(const quint32 _id, QString &formula, const quint32 &firstPointId,
|
static VToolNormal* Create(const quint32 _id, QString &formula, const quint32 &firstPointId,
|
||||||
const quint32 &secondPointId, const QString &typeLine, const QString &lineColor,
|
const quint32 &secondPointId, const QString &typeLine, const QString &lineColor,
|
||||||
const QString &pointName, const qreal angle, const qreal &mx, const qreal &my,
|
const QString &pointName, const qreal angle, const qreal &mx, const qreal &my,
|
||||||
|
|
|
@ -89,9 +89,9 @@ VToolShoulderPoint::VToolShoulderPoint(VAbstractPattern *doc, VContainer *data,
|
||||||
*/
|
*/
|
||||||
void VToolShoulderPoint::setDialog()
|
void VToolShoulderPoint::setDialog()
|
||||||
{
|
{
|
||||||
SCASSERT(dialog != nullptr)
|
SCASSERT(not m_dialog.isNull())
|
||||||
DialogShoulderPoint *dialogTool = qobject_cast<DialogShoulderPoint*>(dialog);
|
QSharedPointer<DialogShoulderPoint> dialogTool = m_dialog.objectCast<DialogShoulderPoint>();
|
||||||
SCASSERT(dialogTool != nullptr)
|
SCASSERT(not dialogTool.isNull())
|
||||||
const QSharedPointer<VPointF> p = VAbstractTool::data.GeometricObject<VPointF>(id);
|
const QSharedPointer<VPointF> p = VAbstractTool::data.GeometricObject<VPointF>(id);
|
||||||
dialogTool->SetTypeLine(typeLine);
|
dialogTool->SetTypeLine(typeLine);
|
||||||
dialogTool->SetLineColor(lineColor);
|
dialogTool->SetLineColor(lineColor);
|
||||||
|
@ -156,12 +156,12 @@ QPointF VToolShoulderPoint::FindPoint(const QPointF &p1Line, const QPointF &p2Li
|
||||||
* @param data container with variables.
|
* @param data container with variables.
|
||||||
* @return the created tool
|
* @return the created tool
|
||||||
*/
|
*/
|
||||||
VToolShoulderPoint* VToolShoulderPoint::Create(DialogTool *dialog, VMainGraphicsScene *scene, VAbstractPattern *doc,
|
VToolShoulderPoint* VToolShoulderPoint::Create(QSharedPointer<DialogTool> dialog, VMainGraphicsScene *scene,
|
||||||
VContainer *data)
|
VAbstractPattern *doc, VContainer *data)
|
||||||
{
|
{
|
||||||
SCASSERT(dialog != nullptr)
|
SCASSERT(not dialog.isNull())
|
||||||
DialogShoulderPoint *dialogTool = qobject_cast<DialogShoulderPoint*>(dialog);
|
QSharedPointer<DialogShoulderPoint> dialogTool = dialog.objectCast<DialogShoulderPoint>();
|
||||||
SCASSERT(dialogTool)
|
SCASSERT(not dialogTool.isNull())
|
||||||
QString formula = dialogTool->GetFormula();
|
QString formula = dialogTool->GetFormula();
|
||||||
const quint32 p1Line = dialogTool->GetP1Line();
|
const quint32 p1Line = dialogTool->GetP1Line();
|
||||||
const quint32 p2Line = dialogTool->GetP2Line();
|
const quint32 p2Line = dialogTool->GetP2Line();
|
||||||
|
@ -173,7 +173,7 @@ VToolShoulderPoint* VToolShoulderPoint::Create(DialogTool *dialog, VMainGraphics
|
||||||
10, scene, doc, data, Document::FullParse, Source::FromGui);
|
10, scene, doc, data, Document::FullParse, Source::FromGui);
|
||||||
if (point != nullptr)
|
if (point != nullptr)
|
||||||
{
|
{
|
||||||
point->dialog=dialogTool;
|
point->m_dialog = dialogTool;
|
||||||
}
|
}
|
||||||
return point;
|
return point;
|
||||||
}
|
}
|
||||||
|
@ -308,9 +308,9 @@ void VToolShoulderPoint::RemoveReferens()
|
||||||
*/
|
*/
|
||||||
void VToolShoulderPoint::SaveDialog(QDomElement &domElement)
|
void VToolShoulderPoint::SaveDialog(QDomElement &domElement)
|
||||||
{
|
{
|
||||||
SCASSERT(dialog != nullptr)
|
SCASSERT(not m_dialog.isNull())
|
||||||
DialogShoulderPoint *dialogTool = qobject_cast<DialogShoulderPoint*>(dialog);
|
QSharedPointer<DialogShoulderPoint> dialogTool = m_dialog.objectCast<DialogShoulderPoint>();
|
||||||
SCASSERT(dialogTool != nullptr)
|
SCASSERT(not dialogTool.isNull())
|
||||||
doc->SetAttribute(domElement, AttrName, dialogTool->getPointName());
|
doc->SetAttribute(domElement, AttrName, dialogTool->getPointName());
|
||||||
doc->SetAttribute(domElement, AttrTypeLine, dialogTool->GetTypeLine());
|
doc->SetAttribute(domElement, AttrTypeLine, dialogTool->GetTypeLine());
|
||||||
doc->SetAttribute(domElement, AttrLineColor, dialogTool->GetLineColor());
|
doc->SetAttribute(domElement, AttrLineColor, dialogTool->GetLineColor());
|
||||||
|
|
|
@ -55,8 +55,8 @@ public:
|
||||||
virtual void setDialog() Q_DECL_OVERRIDE;
|
virtual void setDialog() Q_DECL_OVERRIDE;
|
||||||
static QPointF FindPoint(const QPointF &p1Line, const QPointF &p2Line, const QPointF &pShoulder,
|
static QPointF FindPoint(const QPointF &p1Line, const QPointF &p2Line, const QPointF &pShoulder,
|
||||||
const qreal &length);
|
const qreal &length);
|
||||||
static VToolShoulderPoint* Create(DialogTool *dialog, VMainGraphicsScene *scene, VAbstractPattern *doc,
|
static VToolShoulderPoint* Create(QSharedPointer<DialogTool> dialog, VMainGraphicsScene *scene,
|
||||||
VContainer *data);
|
VAbstractPattern *doc, VContainer *data);
|
||||||
static VToolShoulderPoint* Create(const quint32 _id, QString &formula, const quint32 &p1Line, const quint32 &p2Line,
|
static VToolShoulderPoint* Create(const quint32 _id, QString &formula, const quint32 &p1Line, const quint32 &p2Line,
|
||||||
const quint32 &pShoulder, const QString &typeLine, const QString &lineColor,
|
const quint32 &pShoulder, const QString &typeLine, const QString &lineColor,
|
||||||
const QString &pointName, const qreal &mx, const qreal &my,
|
const QString &pointName, const qreal &mx, const qreal &my,
|
||||||
|
|
|
@ -104,9 +104,9 @@ VToolBasePoint::~VToolBasePoint()
|
||||||
*/
|
*/
|
||||||
void VToolBasePoint::setDialog()
|
void VToolBasePoint::setDialog()
|
||||||
{
|
{
|
||||||
SCASSERT(dialog != nullptr)
|
SCASSERT(not m_dialog.isNull())
|
||||||
DialogSinglePoint *dialogTool = qobject_cast<DialogSinglePoint*>(dialog);
|
QSharedPointer<DialogSinglePoint> dialogTool = m_dialog.objectCast<DialogSinglePoint>();
|
||||||
SCASSERT(dialogTool != nullptr)
|
SCASSERT(not dialogTool.isNull())
|
||||||
const QSharedPointer<VPointF> p = VAbstractTool::data.GeometricObject<VPointF>(id);
|
const QSharedPointer<VPointF> p = VAbstractTool::data.GeometricObject<VPointF>(id);
|
||||||
dialogTool->SetData(p->name(), static_cast<QPointF>(*p));
|
dialogTool->SetData(p->name(), static_cast<QPointF>(*p));
|
||||||
}
|
}
|
||||||
|
@ -280,11 +280,11 @@ void VToolBasePoint::DeleteTool(bool ask)
|
||||||
*/
|
*/
|
||||||
void VToolBasePoint::SaveDialog(QDomElement &domElement)
|
void VToolBasePoint::SaveDialog(QDomElement &domElement)
|
||||||
{
|
{
|
||||||
SCASSERT(dialog != nullptr)
|
SCASSERT(not m_dialog.isNull())
|
||||||
DialogSinglePoint *dialogTool = qobject_cast<DialogSinglePoint*>(dialog);
|
QSharedPointer<DialogSinglePoint> dialogTool = m_dialog.objectCast<DialogSinglePoint>();
|
||||||
SCASSERT(dialogTool != nullptr)
|
SCASSERT(not dialogTool.isNull())
|
||||||
QPointF p = dialogTool->GetPoint();
|
const QPointF p = dialogTool->GetPoint();
|
||||||
QString name = dialogTool->getPointName();
|
const QString name = dialogTool->getPointName();
|
||||||
doc->SetAttribute(domElement, AttrName, name);
|
doc->SetAttribute(domElement, AttrName, name);
|
||||||
doc->SetAttribute(domElement, AttrX, QString().setNum(qApp->fromPixel(p.x())));
|
doc->SetAttribute(domElement, AttrX, QString().setNum(qApp->fromPixel(p.x())));
|
||||||
doc->SetAttribute(domElement, AttrY, QString().setNum(qApp->fromPixel(p.y())));
|
doc->SetAttribute(domElement, AttrY, QString().setNum(qApp->fromPixel(p.y())));
|
||||||
|
|
|
@ -84,9 +84,9 @@ VToolLineIntersect::VToolLineIntersect(VAbstractPattern *doc, VContainer *data,
|
||||||
*/
|
*/
|
||||||
void VToolLineIntersect::setDialog()
|
void VToolLineIntersect::setDialog()
|
||||||
{
|
{
|
||||||
SCASSERT(dialog != nullptr)
|
SCASSERT(not m_dialog.isNull())
|
||||||
DialogLineIntersect *dialogTool = qobject_cast<DialogLineIntersect*>(dialog);
|
QSharedPointer<DialogLineIntersect> dialogTool = m_dialog.objectCast<DialogLineIntersect>();
|
||||||
SCASSERT(dialogTool != nullptr)
|
SCASSERT(not dialogTool.isNull())
|
||||||
const QSharedPointer<VPointF> p = VAbstractTool::data.GeometricObject<VPointF>(id);
|
const QSharedPointer<VPointF> p = VAbstractTool::data.GeometricObject<VPointF>(id);
|
||||||
dialogTool->SetP1Line1(p1Line1);
|
dialogTool->SetP1Line1(p1Line1);
|
||||||
dialogTool->SetP2Line1(p2Line1);
|
dialogTool->SetP2Line1(p2Line1);
|
||||||
|
@ -104,12 +104,12 @@ void VToolLineIntersect::setDialog()
|
||||||
* @param data container with variables.
|
* @param data container with variables.
|
||||||
* @return the created tool
|
* @return the created tool
|
||||||
*/
|
*/
|
||||||
VToolLineIntersect* VToolLineIntersect::Create(DialogTool *dialog, VMainGraphicsScene *scene, VAbstractPattern *doc,
|
VToolLineIntersect* VToolLineIntersect::Create(QSharedPointer<DialogTool> dialog, VMainGraphicsScene *scene,
|
||||||
VContainer *data)
|
VAbstractPattern *doc, VContainer *data)
|
||||||
{
|
{
|
||||||
SCASSERT(dialog != nullptr)
|
SCASSERT(not dialog.isNull())
|
||||||
DialogLineIntersect *dialogTool = qobject_cast<DialogLineIntersect*>(dialog);
|
QSharedPointer<DialogLineIntersect> dialogTool = dialog.objectCast<DialogLineIntersect>();
|
||||||
SCASSERT(dialogTool != nullptr)
|
SCASSERT(not dialogTool.isNull())
|
||||||
const quint32 p1Line1Id = dialogTool->GetP1Line1();
|
const quint32 p1Line1Id = dialogTool->GetP1Line1();
|
||||||
const quint32 p2Line1Id = dialogTool->GetP2Line1();
|
const quint32 p2Line1Id = dialogTool->GetP2Line1();
|
||||||
const quint32 p1Line2Id = dialogTool->GetP1Line2();
|
const quint32 p1Line2Id = dialogTool->GetP1Line2();
|
||||||
|
@ -119,7 +119,7 @@ VToolLineIntersect* VToolLineIntersect::Create(DialogTool *dialog, VMainGraphics
|
||||||
data, Document::FullParse, Source::FromGui);
|
data, Document::FullParse, Source::FromGui);
|
||||||
if (point != nullptr)
|
if (point != nullptr)
|
||||||
{
|
{
|
||||||
point->dialog=dialogTool;
|
point->m_dialog = dialogTool;
|
||||||
}
|
}
|
||||||
return point;
|
return point;
|
||||||
}
|
}
|
||||||
|
@ -275,9 +275,9 @@ void VToolLineIntersect::RemoveReferens()
|
||||||
*/
|
*/
|
||||||
void VToolLineIntersect::SaveDialog(QDomElement &domElement)
|
void VToolLineIntersect::SaveDialog(QDomElement &domElement)
|
||||||
{
|
{
|
||||||
SCASSERT(dialog != nullptr)
|
SCASSERT(not m_dialog.isNull())
|
||||||
DialogLineIntersect *dialogTool = qobject_cast<DialogLineIntersect*>(dialog);
|
QSharedPointer<DialogLineIntersect> dialogTool = m_dialog.objectCast<DialogLineIntersect>();
|
||||||
SCASSERT(dialogTool != nullptr)
|
SCASSERT(not dialogTool.isNull())
|
||||||
doc->SetAttribute(domElement, AttrName, dialogTool->getPointName());
|
doc->SetAttribute(domElement, AttrName, dialogTool->getPointName());
|
||||||
doc->SetAttribute(domElement, AttrP1Line1, QString().setNum(dialogTool->GetP1Line1()));
|
doc->SetAttribute(domElement, AttrP1Line1, QString().setNum(dialogTool->GetP1Line1()));
|
||||||
doc->SetAttribute(domElement, AttrP2Line1, QString().setNum(dialogTool->GetP2Line1()));
|
doc->SetAttribute(domElement, AttrP2Line1, QString().setNum(dialogTool->GetP2Line1()));
|
||||||
|
|
|
@ -51,8 +51,8 @@ class VToolLineIntersect:public VToolSinglePoint
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
virtual void setDialog() Q_DECL_OVERRIDE;
|
virtual void setDialog() Q_DECL_OVERRIDE;
|
||||||
static VToolLineIntersect *Create(DialogTool *dialog, VMainGraphicsScene *scene, VAbstractPattern *doc,
|
static VToolLineIntersect *Create(QSharedPointer<DialogTool> dialog, VMainGraphicsScene *scene,
|
||||||
VContainer *data);
|
VAbstractPattern *doc, VContainer *data);
|
||||||
static VToolLineIntersect *Create(const quint32 _id, const quint32 &p1Line1Id, const quint32 &p2Line1Id,
|
static VToolLineIntersect *Create(const quint32 _id, const quint32 &p1Line1Id, const quint32 &p2Line1Id,
|
||||||
const quint32 &p1Line2Id, const quint32 &p2Line2Id, const QString &pointName,
|
const quint32 &p1Line2Id, const quint32 &p2Line2Id, const QString &pointName,
|
||||||
const qreal &mx, const qreal &my, VMainGraphicsScene *scene,
|
const qreal &mx, const qreal &my, VMainGraphicsScene *scene,
|
||||||
|
|
|
@ -67,9 +67,9 @@ VToolPointFromArcAndTangent::VToolPointFromArcAndTangent(VAbstractPattern *doc,
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VToolPointFromArcAndTangent::setDialog()
|
void VToolPointFromArcAndTangent::setDialog()
|
||||||
{
|
{
|
||||||
SCASSERT(dialog != nullptr)
|
SCASSERT(not m_dialog.isNull())
|
||||||
DialogPointFromArcAndTangent *dialogTool = qobject_cast<DialogPointFromArcAndTangent*>(dialog);
|
QSharedPointer<DialogPointFromArcAndTangent> dialogTool = m_dialog.objectCast<DialogPointFromArcAndTangent>();
|
||||||
SCASSERT(dialogTool != nullptr)
|
SCASSERT(not dialogTool.isNull())
|
||||||
const QSharedPointer<VPointF> p = VAbstractTool::data.GeometricObject<VPointF>(id);
|
const QSharedPointer<VPointF> p = VAbstractTool::data.GeometricObject<VPointF>(id);
|
||||||
dialogTool->SetArcId(arcId);
|
dialogTool->SetArcId(arcId);
|
||||||
dialogTool->SetCrossCirclesPoint(crossPoint);
|
dialogTool->SetCrossCirclesPoint(crossPoint);
|
||||||
|
@ -78,12 +78,13 @@ void VToolPointFromArcAndTangent::setDialog()
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
VToolPointFromArcAndTangent *VToolPointFromArcAndTangent::Create(DialogTool *dialog, VMainGraphicsScene *scene,
|
VToolPointFromArcAndTangent *VToolPointFromArcAndTangent::Create(QSharedPointer<DialogTool> dialog,
|
||||||
|
VMainGraphicsScene *scene,
|
||||||
VAbstractPattern *doc, VContainer *data)
|
VAbstractPattern *doc, VContainer *data)
|
||||||
{
|
{
|
||||||
SCASSERT(dialog != nullptr)
|
SCASSERT(not dialog.isNull())
|
||||||
DialogPointFromArcAndTangent *dialogTool = qobject_cast<DialogPointFromArcAndTangent*>(dialog);
|
QSharedPointer<DialogPointFromArcAndTangent> dialogTool = dialog.objectCast<DialogPointFromArcAndTangent>();
|
||||||
SCASSERT(dialogTool != nullptr)
|
SCASSERT(not dialogTool.isNull())
|
||||||
const quint32 arcId = dialogTool->GetArcId();
|
const quint32 arcId = dialogTool->GetArcId();
|
||||||
const quint32 tangentPointId = dialogTool->GetTangentPointId();
|
const quint32 tangentPointId = dialogTool->GetTangentPointId();
|
||||||
const CrossCirclesPoint pType = dialogTool->GetCrossCirclesPoint();
|
const CrossCirclesPoint pType = dialogTool->GetCrossCirclesPoint();
|
||||||
|
@ -92,7 +93,7 @@ VToolPointFromArcAndTangent *VToolPointFromArcAndTangent::Create(DialogTool *dia
|
||||||
data, Document::FullParse, Source::FromGui);
|
data, Document::FullParse, Source::FromGui);
|
||||||
if (point != nullptr)
|
if (point != nullptr)
|
||||||
{
|
{
|
||||||
point->dialog=dialogTool;
|
point->m_dialog = dialogTool;
|
||||||
}
|
}
|
||||||
return point;
|
return point;
|
||||||
}
|
}
|
||||||
|
@ -310,9 +311,9 @@ void VToolPointFromArcAndTangent::contextMenuEvent(QGraphicsSceneContextMenuEven
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VToolPointFromArcAndTangent::SaveDialog(QDomElement &domElement)
|
void VToolPointFromArcAndTangent::SaveDialog(QDomElement &domElement)
|
||||||
{
|
{
|
||||||
SCASSERT(dialog != nullptr)
|
SCASSERT(not m_dialog.isNull())
|
||||||
DialogPointFromArcAndTangent *dialogTool = qobject_cast<DialogPointFromArcAndTangent*>(dialog);
|
QSharedPointer<DialogPointFromArcAndTangent> dialogTool = m_dialog.objectCast<DialogPointFromArcAndTangent>();
|
||||||
SCASSERT(dialogTool != nullptr)
|
SCASSERT(not dialogTool.isNull())
|
||||||
doc->SetAttribute(domElement, AttrName, dialogTool->getPointName());
|
doc->SetAttribute(domElement, AttrName, dialogTool->getPointName());
|
||||||
doc->SetAttribute(domElement, AttrArc, QString().setNum(dialogTool->GetArcId()));
|
doc->SetAttribute(domElement, AttrArc, QString().setNum(dialogTool->GetArcId()));
|
||||||
doc->SetAttribute(domElement, AttrTangent, QString().setNum(dialogTool->GetTangentPointId()));
|
doc->SetAttribute(domElement, AttrTangent, QString().setNum(dialogTool->GetTangentPointId()));
|
||||||
|
|
|
@ -49,8 +49,8 @@ class VToolPointFromArcAndTangent : public VToolSinglePoint
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
virtual void setDialog() Q_DECL_OVERRIDE;
|
virtual void setDialog() Q_DECL_OVERRIDE;
|
||||||
static VToolPointFromArcAndTangent *Create(DialogTool *dialog, VMainGraphicsScene *scene, VAbstractPattern *doc,
|
static VToolPointFromArcAndTangent *Create(QSharedPointer<DialogTool> dialog, VMainGraphicsScene *scene,
|
||||||
VContainer *data);
|
VAbstractPattern *doc, VContainer *data);
|
||||||
static VToolPointFromArcAndTangent *Create(const quint32 _id, const QString &pointName, quint32 arcId,
|
static VToolPointFromArcAndTangent *Create(const quint32 _id, const QString &pointName, quint32 arcId,
|
||||||
quint32 tangentPointId, CrossCirclesPoint crossPoint, const qreal &mx,
|
quint32 tangentPointId, CrossCirclesPoint crossPoint, const qreal &mx,
|
||||||
const qreal &my, VMainGraphicsScene *scene, VAbstractPattern *doc,
|
const qreal &my, VMainGraphicsScene *scene, VAbstractPattern *doc,
|
||||||
|
|
|
@ -70,9 +70,9 @@ VToolPointFromCircleAndTangent::VToolPointFromCircleAndTangent(VAbstractPattern
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VToolPointFromCircleAndTangent::setDialog()
|
void VToolPointFromCircleAndTangent::setDialog()
|
||||||
{
|
{
|
||||||
SCASSERT(dialog != nullptr)
|
SCASSERT(not m_dialog.isNull())
|
||||||
DialogPointFromCircleAndTangent *dialogTool = qobject_cast<DialogPointFromCircleAndTangent*>(dialog);
|
QSharedPointer<DialogPointFromCircleAndTangent> dialogTool = m_dialog.objectCast<DialogPointFromCircleAndTangent>();
|
||||||
SCASSERT(dialogTool != nullptr)
|
SCASSERT(not dialogTool.isNull())
|
||||||
const QSharedPointer<VPointF> p = VAbstractTool::data.GeometricObject<VPointF>(id);
|
const QSharedPointer<VPointF> p = VAbstractTool::data.GeometricObject<VPointF>(id);
|
||||||
dialogTool->SetCircleCenterId(circleCenterId);
|
dialogTool->SetCircleCenterId(circleCenterId);
|
||||||
dialogTool->SetCircleRadius(circleRadius);
|
dialogTool->SetCircleRadius(circleRadius);
|
||||||
|
@ -82,12 +82,13 @@ void VToolPointFromCircleAndTangent::setDialog()
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
VToolPointFromCircleAndTangent *VToolPointFromCircleAndTangent::Create(DialogTool *dialog, VMainGraphicsScene *scene,
|
VToolPointFromCircleAndTangent *VToolPointFromCircleAndTangent::Create(QSharedPointer<DialogTool> dialog,
|
||||||
|
VMainGraphicsScene *scene,
|
||||||
VAbstractPattern *doc, VContainer *data)
|
VAbstractPattern *doc, VContainer *data)
|
||||||
{
|
{
|
||||||
SCASSERT(dialog != nullptr)
|
SCASSERT(not dialog.isNull())
|
||||||
DialogPointFromCircleAndTangent *dialogTool = qobject_cast<DialogPointFromCircleAndTangent*>(dialog);
|
QSharedPointer<DialogPointFromCircleAndTangent> dialogTool = dialog.objectCast<DialogPointFromCircleAndTangent>();
|
||||||
SCASSERT(dialogTool != nullptr)
|
SCASSERT(not dialogTool.isNull())
|
||||||
const quint32 circleCenterId = dialogTool->GetCircleCenterId();
|
const quint32 circleCenterId = dialogTool->GetCircleCenterId();
|
||||||
QString circleRadius = dialogTool->GetCircleRadius();
|
QString circleRadius = dialogTool->GetCircleRadius();
|
||||||
const quint32 tangentPointId = dialogTool->GetTangentPointId();
|
const quint32 tangentPointId = dialogTool->GetTangentPointId();
|
||||||
|
@ -97,7 +98,7 @@ VToolPointFromCircleAndTangent *VToolPointFromCircleAndTangent::Create(DialogToo
|
||||||
5, 10, scene, doc, data, Document::FullParse, Source::FromGui);
|
5, 10, scene, doc, data, Document::FullParse, Source::FromGui);
|
||||||
if (point != nullptr)
|
if (point != nullptr)
|
||||||
{
|
{
|
||||||
point->dialog=dialogTool;
|
point->m_dialog = dialogTool;
|
||||||
}
|
}
|
||||||
return point;
|
return point;
|
||||||
}
|
}
|
||||||
|
@ -295,9 +296,9 @@ void VToolPointFromCircleAndTangent::contextMenuEvent(QGraphicsSceneContextMenuE
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VToolPointFromCircleAndTangent::SaveDialog(QDomElement &domElement)
|
void VToolPointFromCircleAndTangent::SaveDialog(QDomElement &domElement)
|
||||||
{
|
{
|
||||||
SCASSERT(dialog != nullptr)
|
SCASSERT(not m_dialog.isNull())
|
||||||
DialogPointFromCircleAndTangent *dialogTool = qobject_cast<DialogPointFromCircleAndTangent*>(dialog);
|
QSharedPointer<DialogPointFromCircleAndTangent> dialogTool = m_dialog.objectCast<DialogPointFromCircleAndTangent>();
|
||||||
SCASSERT(dialogTool != nullptr)
|
SCASSERT(not dialogTool.isNull())
|
||||||
doc->SetAttribute(domElement, AttrName, dialogTool->getPointName());
|
doc->SetAttribute(domElement, AttrName, dialogTool->getPointName());
|
||||||
doc->SetAttribute(domElement, AttrCCenter, QString().setNum(dialogTool->GetCircleCenterId()));
|
doc->SetAttribute(domElement, AttrCCenter, QString().setNum(dialogTool->GetCircleCenterId()));
|
||||||
doc->SetAttribute(domElement, AttrTangent, QString().setNum(dialogTool->GetTangentPointId()));
|
doc->SetAttribute(domElement, AttrTangent, QString().setNum(dialogTool->GetTangentPointId()));
|
||||||
|
|
|
@ -50,8 +50,8 @@ class VToolPointFromCircleAndTangent : public VToolSinglePoint
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
virtual void setDialog() Q_DECL_OVERRIDE;
|
virtual void setDialog() Q_DECL_OVERRIDE;
|
||||||
static VToolPointFromCircleAndTangent *Create(DialogTool *dialog, VMainGraphicsScene *scene, VAbstractPattern *doc,
|
static VToolPointFromCircleAndTangent *Create(QSharedPointer<DialogTool> dialog, VMainGraphicsScene *scene,
|
||||||
VContainer *data);
|
VAbstractPattern *doc, VContainer *data);
|
||||||
static VToolPointFromCircleAndTangent *Create(const quint32 _id, const QString &pointName,
|
static VToolPointFromCircleAndTangent *Create(const quint32 _id, const QString &pointName,
|
||||||
quint32 circleCenterId, QString &circleRadius, quint32 tangentPointId,
|
quint32 circleCenterId, QString &circleRadius, quint32 tangentPointId,
|
||||||
CrossCirclesPoint crossPoint, const qreal &mx, const qreal &my,
|
CrossCirclesPoint crossPoint, const qreal &mx, const qreal &my,
|
||||||
|
|
|
@ -89,9 +89,9 @@ VToolPointOfContact::VToolPointOfContact(VAbstractPattern *doc, VContainer *data
|
||||||
*/
|
*/
|
||||||
void VToolPointOfContact::setDialog()
|
void VToolPointOfContact::setDialog()
|
||||||
{
|
{
|
||||||
SCASSERT(dialog != nullptr)
|
SCASSERT(not m_dialog.isNull())
|
||||||
DialogPointOfContact *dialogTool = qobject_cast<DialogPointOfContact*>(dialog);
|
QSharedPointer<DialogPointOfContact> dialogTool = m_dialog.objectCast<DialogPointOfContact>();
|
||||||
SCASSERT(dialogTool != nullptr)
|
SCASSERT(not dialogTool.isNull())
|
||||||
const QSharedPointer<VPointF> p = VAbstractTool::data.GeometricObject<VPointF>(id);
|
const QSharedPointer<VPointF> p = VAbstractTool::data.GeometricObject<VPointF>(id);
|
||||||
dialogTool->setRadius(arcRadius);
|
dialogTool->setRadius(arcRadius);
|
||||||
dialogTool->setCenter(center);
|
dialogTool->setCenter(center);
|
||||||
|
@ -164,12 +164,12 @@ QPointF VToolPointOfContact::FindPoint(const qreal &radius, const QPointF ¢e
|
||||||
* @param doc dom document container.
|
* @param doc dom document container.
|
||||||
* @param data container with variables.
|
* @param data container with variables.
|
||||||
*/
|
*/
|
||||||
VToolPointOfContact* VToolPointOfContact::Create(DialogTool *dialog, VMainGraphicsScene *scene, VAbstractPattern *doc,
|
VToolPointOfContact* VToolPointOfContact::Create(QSharedPointer<DialogTool> dialog, VMainGraphicsScene *scene,
|
||||||
VContainer *data)
|
VAbstractPattern *doc, VContainer *data)
|
||||||
{
|
{
|
||||||
SCASSERT(dialog != nullptr)
|
SCASSERT(not dialog.isNull())
|
||||||
DialogPointOfContact *dialogTool = qobject_cast<DialogPointOfContact*>(dialog);
|
QSharedPointer<DialogPointOfContact> dialogTool = dialog.objectCast<DialogPointOfContact>();
|
||||||
SCASSERT(dialogTool != nullptr)
|
SCASSERT(not dialogTool.isNull())
|
||||||
QString radius = dialogTool->getRadius();
|
QString radius = dialogTool->getRadius();
|
||||||
const quint32 center = dialogTool->getCenter();
|
const quint32 center = dialogTool->getCenter();
|
||||||
const quint32 firstPointId = dialogTool->GetFirstPoint();
|
const quint32 firstPointId = dialogTool->GetFirstPoint();
|
||||||
|
@ -179,7 +179,7 @@ VToolPointOfContact* VToolPointOfContact::Create(DialogTool *dialog, VMainGraphi
|
||||||
data, Document::FullParse, Source::FromGui);
|
data, Document::FullParse, Source::FromGui);
|
||||||
if (point != nullptr)
|
if (point != nullptr)
|
||||||
{
|
{
|
||||||
point->dialog=dialogTool;
|
point->m_dialog = dialogTool;
|
||||||
}
|
}
|
||||||
return point;
|
return point;
|
||||||
}
|
}
|
||||||
|
@ -319,9 +319,9 @@ void VToolPointOfContact::RemoveReferens()
|
||||||
*/
|
*/
|
||||||
void VToolPointOfContact::SaveDialog(QDomElement &domElement)
|
void VToolPointOfContact::SaveDialog(QDomElement &domElement)
|
||||||
{
|
{
|
||||||
SCASSERT(dialog != nullptr)
|
SCASSERT(not m_dialog.isNull())
|
||||||
DialogPointOfContact *dialogTool = qobject_cast<DialogPointOfContact*>(dialog);
|
QSharedPointer<DialogPointOfContact> dialogTool = m_dialog.objectCast<DialogPointOfContact>();
|
||||||
SCASSERT(dialogTool != nullptr)
|
SCASSERT(not dialogTool.isNull())
|
||||||
doc->SetAttribute(domElement, AttrName, dialogTool->getPointName());
|
doc->SetAttribute(domElement, AttrName, dialogTool->getPointName());
|
||||||
doc->SetAttribute(domElement, AttrRadius, dialogTool->getRadius());
|
doc->SetAttribute(domElement, AttrRadius, dialogTool->getRadius());
|
||||||
doc->SetAttribute(domElement, AttrCenter, QString().setNum(dialogTool->getCenter()));
|
doc->SetAttribute(domElement, AttrCenter, QString().setNum(dialogTool->getCenter()));
|
||||||
|
|
|
@ -55,8 +55,8 @@ public:
|
||||||
virtual void setDialog() Q_DECL_OVERRIDE;
|
virtual void setDialog() Q_DECL_OVERRIDE;
|
||||||
static QPointF FindPoint(const qreal &radius, const QPointF ¢er, const QPointF &firstPoint,
|
static QPointF FindPoint(const qreal &radius, const QPointF ¢er, const QPointF &firstPoint,
|
||||||
const QPointF &secondPoint);
|
const QPointF &secondPoint);
|
||||||
static VToolPointOfContact* Create(DialogTool *dialog, VMainGraphicsScene *scene, VAbstractPattern *doc,
|
static VToolPointOfContact* Create(QSharedPointer<DialogTool> dialog, VMainGraphicsScene *scene,
|
||||||
VContainer *data);
|
VAbstractPattern *doc, VContainer *data);
|
||||||
static VToolPointOfContact* Create(const quint32 _id, QString &radius, const quint32 ¢er,
|
static VToolPointOfContact* Create(const quint32 _id, QString &radius, const quint32 ¢er,
|
||||||
const quint32 &firstPointId, const quint32 &secondPointId,
|
const quint32 &firstPointId, const quint32 &secondPointId,
|
||||||
const QString &pointName,
|
const QString &pointName,
|
||||||
|
|
|
@ -78,9 +78,9 @@ VToolPointOfIntersection::VToolPointOfIntersection(VAbstractPattern *doc, VConta
|
||||||
*/
|
*/
|
||||||
void VToolPointOfIntersection::setDialog()
|
void VToolPointOfIntersection::setDialog()
|
||||||
{
|
{
|
||||||
SCASSERT(dialog != nullptr)
|
SCASSERT(not m_dialog.isNull())
|
||||||
DialogPointOfIntersection *dialogTool = qobject_cast<DialogPointOfIntersection*>(dialog);
|
QSharedPointer<DialogPointOfIntersection> dialogTool = m_dialog.objectCast<DialogPointOfIntersection>();
|
||||||
SCASSERT(dialogTool != nullptr)
|
SCASSERT(not dialogTool.isNull())
|
||||||
const QSharedPointer<VPointF> p = VAbstractTool::data.GeometricObject<VPointF>(id);
|
const QSharedPointer<VPointF> p = VAbstractTool::data.GeometricObject<VPointF>(id);
|
||||||
dialogTool->SetFirstPointId(firstPointId);
|
dialogTool->SetFirstPointId(firstPointId);
|
||||||
dialogTool->SetSecondPointId(secondPointId);
|
dialogTool->SetSecondPointId(secondPointId);
|
||||||
|
@ -96,13 +96,12 @@ void VToolPointOfIntersection::setDialog()
|
||||||
* @param data container with variables.
|
* @param data container with variables.
|
||||||
* @return the created tool
|
* @return the created tool
|
||||||
*/
|
*/
|
||||||
VToolPointOfIntersection *VToolPointOfIntersection::Create(DialogTool *dialog, VMainGraphicsScene *scene,
|
VToolPointOfIntersection *VToolPointOfIntersection::Create(QSharedPointer<DialogTool> dialog, VMainGraphicsScene *scene,
|
||||||
VAbstractPattern *doc,
|
VAbstractPattern *doc, VContainer *data)
|
||||||
VContainer *data)
|
|
||||||
{
|
{
|
||||||
SCASSERT(dialog != nullptr)
|
SCASSERT(not dialog.isNull())
|
||||||
DialogPointOfIntersection *dialogTool = qobject_cast<DialogPointOfIntersection*>(dialog);
|
QSharedPointer<DialogPointOfIntersection> dialogTool = dialog.objectCast<DialogPointOfIntersection>();
|
||||||
SCASSERT(dialogTool != nullptr)
|
SCASSERT(not dialogTool.isNull())
|
||||||
const quint32 firstPointId = dialogTool->GetFirstPointId();
|
const quint32 firstPointId = dialogTool->GetFirstPointId();
|
||||||
const quint32 secondPointId = dialogTool->GetSecondPointId();
|
const quint32 secondPointId = dialogTool->GetSecondPointId();
|
||||||
const QString pointName = dialogTool->getPointName();
|
const QString pointName = dialogTool->getPointName();
|
||||||
|
@ -110,7 +109,7 @@ VToolPointOfIntersection *VToolPointOfIntersection::Create(DialogTool *dialog, V
|
||||||
data, Document::FullParse, Source::FromGui);
|
data, Document::FullParse, Source::FromGui);
|
||||||
if (point != nullptr)
|
if (point != nullptr)
|
||||||
{
|
{
|
||||||
point->dialog=dialogTool;
|
point->m_dialog = dialogTool;
|
||||||
}
|
}
|
||||||
return point;
|
return point;
|
||||||
}
|
}
|
||||||
|
@ -220,9 +219,9 @@ void VToolPointOfIntersection::contextMenuEvent(QGraphicsSceneContextMenuEvent *
|
||||||
*/
|
*/
|
||||||
void VToolPointOfIntersection::SaveDialog(QDomElement &domElement)
|
void VToolPointOfIntersection::SaveDialog(QDomElement &domElement)
|
||||||
{
|
{
|
||||||
SCASSERT(dialog != nullptr)
|
SCASSERT(not m_dialog.isNull())
|
||||||
DialogPointOfIntersection *dialogTool = qobject_cast<DialogPointOfIntersection*>(dialog);
|
QSharedPointer<DialogPointOfIntersection> dialogTool = m_dialog.objectCast<DialogPointOfIntersection>();
|
||||||
SCASSERT(dialogTool != nullptr)
|
SCASSERT(not dialogTool.isNull())
|
||||||
doc->SetAttribute(domElement, AttrName, dialogTool->getPointName());
|
doc->SetAttribute(domElement, AttrName, dialogTool->getPointName());
|
||||||
doc->SetAttribute(domElement, AttrFirstPoint, QString().setNum(dialogTool->GetFirstPointId()));
|
doc->SetAttribute(domElement, AttrFirstPoint, QString().setNum(dialogTool->GetFirstPointId()));
|
||||||
doc->SetAttribute(domElement, AttrSecondPoint, QString().setNum(dialogTool->GetSecondPointId()));
|
doc->SetAttribute(domElement, AttrSecondPoint, QString().setNum(dialogTool->GetSecondPointId()));
|
||||||
|
|
|
@ -51,8 +51,8 @@ class VToolPointOfIntersection : public VToolSinglePoint
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
virtual void setDialog() Q_DECL_OVERRIDE;
|
virtual void setDialog() Q_DECL_OVERRIDE;
|
||||||
static VToolPointOfIntersection *Create(DialogTool *dialog, VMainGraphicsScene *scene, VAbstractPattern *doc,
|
static VToolPointOfIntersection *Create(QSharedPointer<DialogTool> dialog, VMainGraphicsScene *scene,
|
||||||
VContainer *data);
|
VAbstractPattern *doc, VContainer *data);
|
||||||
static VToolPointOfIntersection *Create(const quint32 _id, const QString &pointName, const quint32 &firstPointId,
|
static VToolPointOfIntersection *Create(const quint32 _id, const QString &pointName, const quint32 &firstPointId,
|
||||||
const quint32 &secondPointId, const qreal &mx, const qreal &my,
|
const quint32 &secondPointId, const qreal &mx, const qreal &my,
|
||||||
VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data,
|
VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data,
|
||||||
|
|
|
@ -67,9 +67,9 @@ VToolPointOfIntersectionArcs::VToolPointOfIntersectionArcs(VAbstractPattern *doc
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VToolPointOfIntersectionArcs::setDialog()
|
void VToolPointOfIntersectionArcs::setDialog()
|
||||||
{
|
{
|
||||||
SCASSERT(dialog != nullptr)
|
SCASSERT(not m_dialog.isNull())
|
||||||
DialogPointOfIntersectionArcs *dialogTool = qobject_cast<DialogPointOfIntersectionArcs*>(dialog);
|
QSharedPointer<DialogPointOfIntersectionArcs> dialogTool = m_dialog.objectCast<DialogPointOfIntersectionArcs>();
|
||||||
SCASSERT(dialogTool != nullptr)
|
SCASSERT(not dialogTool.isNull())
|
||||||
const QSharedPointer<VPointF> p = VAbstractTool::data.GeometricObject<VPointF>(id);
|
const QSharedPointer<VPointF> p = VAbstractTool::data.GeometricObject<VPointF>(id);
|
||||||
dialogTool->SetFirstArcId(firstArcId);
|
dialogTool->SetFirstArcId(firstArcId);
|
||||||
dialogTool->SetSecondArcId(secondArcId);
|
dialogTool->SetSecondArcId(secondArcId);
|
||||||
|
@ -78,12 +78,13 @@ void VToolPointOfIntersectionArcs::setDialog()
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
VToolPointOfIntersectionArcs *VToolPointOfIntersectionArcs::Create(DialogTool *dialog, VMainGraphicsScene *scene,
|
VToolPointOfIntersectionArcs *VToolPointOfIntersectionArcs::Create(QSharedPointer<DialogTool> dialog,
|
||||||
VAbstractPattern *doc, VContainer *data)
|
VMainGraphicsScene *scene, VAbstractPattern *doc,
|
||||||
|
VContainer *data)
|
||||||
{
|
{
|
||||||
SCASSERT(dialog != nullptr)
|
SCASSERT(not dialog.isNull())
|
||||||
DialogPointOfIntersectionArcs *dialogTool = qobject_cast<DialogPointOfIntersectionArcs*>(dialog);
|
QSharedPointer<DialogPointOfIntersectionArcs> dialogTool = dialog.objectCast<DialogPointOfIntersectionArcs>();
|
||||||
SCASSERT(dialogTool != nullptr)
|
SCASSERT(not dialogTool.isNull())
|
||||||
const quint32 firstArcId = dialogTool->GetFirstArcId();
|
const quint32 firstArcId = dialogTool->GetFirstArcId();
|
||||||
const quint32 secondArcId = dialogTool->GetSecondArcId();
|
const quint32 secondArcId = dialogTool->GetSecondArcId();
|
||||||
const CrossCirclesPoint pType = dialogTool->GetCrossArcPoint();
|
const CrossCirclesPoint pType = dialogTool->GetCrossArcPoint();
|
||||||
|
@ -92,7 +93,7 @@ VToolPointOfIntersectionArcs *VToolPointOfIntersectionArcs::Create(DialogTool *d
|
||||||
data, Document::FullParse, Source::FromGui);
|
data, Document::FullParse, Source::FromGui);
|
||||||
if (point != nullptr)
|
if (point != nullptr)
|
||||||
{
|
{
|
||||||
point->dialog=dialogTool;
|
point->m_dialog = dialogTool;
|
||||||
}
|
}
|
||||||
return point;
|
return point;
|
||||||
}
|
}
|
||||||
|
@ -317,9 +318,9 @@ void VToolPointOfIntersectionArcs::contextMenuEvent(QGraphicsSceneContextMenuEve
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VToolPointOfIntersectionArcs::SaveDialog(QDomElement &domElement)
|
void VToolPointOfIntersectionArcs::SaveDialog(QDomElement &domElement)
|
||||||
{
|
{
|
||||||
SCASSERT(dialog != nullptr)
|
SCASSERT(not m_dialog.isNull())
|
||||||
DialogPointOfIntersectionArcs *dialogTool = qobject_cast<DialogPointOfIntersectionArcs*>(dialog);
|
QSharedPointer<DialogPointOfIntersectionArcs> dialogTool = m_dialog.objectCast<DialogPointOfIntersectionArcs>();
|
||||||
SCASSERT(dialogTool != nullptr)
|
SCASSERT(not dialogTool.isNull())
|
||||||
doc->SetAttribute(domElement, AttrName, dialogTool->getPointName());
|
doc->SetAttribute(domElement, AttrName, dialogTool->getPointName());
|
||||||
doc->SetAttribute(domElement, AttrFirstArc, QString().setNum(dialogTool->GetFirstArcId()));
|
doc->SetAttribute(domElement, AttrFirstArc, QString().setNum(dialogTool->GetFirstArcId()));
|
||||||
doc->SetAttribute(domElement, AttrSecondArc, QString().setNum(dialogTool->GetSecondArcId()));
|
doc->SetAttribute(domElement, AttrSecondArc, QString().setNum(dialogTool->GetSecondArcId()));
|
||||||
|
|
|
@ -50,8 +50,8 @@ class VToolPointOfIntersectionArcs : public VToolSinglePoint
|
||||||
|
|
||||||
public:
|
public:
|
||||||
virtual void setDialog() Q_DECL_OVERRIDE;
|
virtual void setDialog() Q_DECL_OVERRIDE;
|
||||||
static VToolPointOfIntersectionArcs *Create(DialogTool *dialog, VMainGraphicsScene *scene, VAbstractPattern *doc,
|
static VToolPointOfIntersectionArcs *Create(QSharedPointer<DialogTool> dialog, VMainGraphicsScene *scene,
|
||||||
VContainer *data);
|
VAbstractPattern *doc, VContainer *data);
|
||||||
static VToolPointOfIntersectionArcs *Create(const quint32 _id, const QString &pointName, const quint32 &firstArcId,
|
static VToolPointOfIntersectionArcs *Create(const quint32 _id, const QString &pointName, const quint32 &firstArcId,
|
||||||
const quint32 &secondArcId, CrossCirclesPoint pType,
|
const quint32 &secondArcId, CrossCirclesPoint pType,
|
||||||
const qreal &mx, const qreal &my, VMainGraphicsScene *scene,
|
const qreal &mx, const qreal &my, VMainGraphicsScene *scene,
|
||||||
|
|
|
@ -74,9 +74,10 @@ VToolPointOfIntersectionCircles::VToolPointOfIntersectionCircles(VAbstractPatter
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VToolPointOfIntersectionCircles::setDialog()
|
void VToolPointOfIntersectionCircles::setDialog()
|
||||||
{
|
{
|
||||||
SCASSERT(dialog != nullptr)
|
SCASSERT(not m_dialog.isNull())
|
||||||
DialogPointOfIntersectionCircles *dialogTool = qobject_cast<DialogPointOfIntersectionCircles*>(dialog);
|
QSharedPointer<DialogPointOfIntersectionCircles> dialogTool =
|
||||||
SCASSERT(dialogTool != nullptr)
|
m_dialog.objectCast<DialogPointOfIntersectionCircles>();
|
||||||
|
SCASSERT(not dialogTool.isNull())
|
||||||
const QSharedPointer<VPointF> p = VAbstractTool::data.GeometricObject<VPointF>(id);
|
const QSharedPointer<VPointF> p = VAbstractTool::data.GeometricObject<VPointF>(id);
|
||||||
dialogTool->SetFirstCircleCenterId(firstCircleCenterId);
|
dialogTool->SetFirstCircleCenterId(firstCircleCenterId);
|
||||||
dialogTool->SetSecondCircleCenterId(secondCircleCenterId);
|
dialogTool->SetSecondCircleCenterId(secondCircleCenterId);
|
||||||
|
@ -87,12 +88,14 @@ void VToolPointOfIntersectionCircles::setDialog()
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
VToolPointOfIntersectionCircles *VToolPointOfIntersectionCircles::Create(DialogTool *dialog, VMainGraphicsScene *scene,
|
VToolPointOfIntersectionCircles *VToolPointOfIntersectionCircles::Create(QSharedPointer<DialogTool> dialog,
|
||||||
|
VMainGraphicsScene *scene,
|
||||||
VAbstractPattern *doc, VContainer *data)
|
VAbstractPattern *doc, VContainer *data)
|
||||||
{
|
{
|
||||||
SCASSERT(dialog != nullptr)
|
SCASSERT(not dialog.isNull())
|
||||||
DialogPointOfIntersectionCircles *dialogTool = qobject_cast<DialogPointOfIntersectionCircles*>(dialog);
|
QSharedPointer<DialogPointOfIntersectionCircles> dialogTool =
|
||||||
SCASSERT(dialogTool != nullptr)
|
dialog.objectCast<DialogPointOfIntersectionCircles>();
|
||||||
|
SCASSERT(not dialogTool.isNull())
|
||||||
const quint32 firstCircleCenterId = dialogTool->GetFirstCircleCenterId();
|
const quint32 firstCircleCenterId = dialogTool->GetFirstCircleCenterId();
|
||||||
const quint32 secondCircleCenterId = dialogTool->GetSecondCircleCenterId();
|
const quint32 secondCircleCenterId = dialogTool->GetSecondCircleCenterId();
|
||||||
QString firstCircleRadius = dialogTool->GetFirstCircleRadius();
|
QString firstCircleRadius = dialogTool->GetFirstCircleRadius();
|
||||||
|
@ -104,7 +107,7 @@ VToolPointOfIntersectionCircles *VToolPointOfIntersectionCircles::Create(DialogT
|
||||||
data, Document::FullParse, Source::FromGui);
|
data, Document::FullParse, Source::FromGui);
|
||||||
if (point != nullptr)
|
if (point != nullptr)
|
||||||
{
|
{
|
||||||
point->dialog=dialogTool;
|
point->m_dialog = dialogTool;
|
||||||
}
|
}
|
||||||
return point;
|
return point;
|
||||||
}
|
}
|
||||||
|
@ -332,9 +335,10 @@ void VToolPointOfIntersectionCircles::contextMenuEvent(QGraphicsSceneContextMenu
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VToolPointOfIntersectionCircles::SaveDialog(QDomElement &domElement)
|
void VToolPointOfIntersectionCircles::SaveDialog(QDomElement &domElement)
|
||||||
{
|
{
|
||||||
SCASSERT(dialog != nullptr)
|
SCASSERT(not m_dialog.isNull())
|
||||||
DialogPointOfIntersectionCircles *dialogTool = qobject_cast<DialogPointOfIntersectionCircles*>(dialog);
|
QSharedPointer<DialogPointOfIntersectionCircles> dialogTool =
|
||||||
SCASSERT(dialogTool != nullptr)
|
m_dialog.objectCast<DialogPointOfIntersectionCircles>();
|
||||||
|
SCASSERT(not dialogTool.isNull())
|
||||||
doc->SetAttribute(domElement, AttrName, dialogTool->getPointName());
|
doc->SetAttribute(domElement, AttrName, dialogTool->getPointName());
|
||||||
doc->SetAttribute(domElement, AttrC1Center, QString().setNum(dialogTool->GetFirstCircleCenterId()));
|
doc->SetAttribute(domElement, AttrC1Center, QString().setNum(dialogTool->GetFirstCircleCenterId()));
|
||||||
doc->SetAttribute(domElement, AttrC2Center, QString().setNum(dialogTool->GetSecondCircleCenterId()));
|
doc->SetAttribute(domElement, AttrC2Center, QString().setNum(dialogTool->GetSecondCircleCenterId()));
|
||||||
|
|
|
@ -50,9 +50,8 @@ class VToolPointOfIntersectionCircles : public VToolSinglePoint
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
virtual void setDialog() Q_DECL_OVERRIDE;
|
virtual void setDialog() Q_DECL_OVERRIDE;
|
||||||
static VToolPointOfIntersectionCircles *Create(DialogTool *dialog, VMainGraphicsScene *scene,
|
static VToolPointOfIntersectionCircles *Create(QSharedPointer<DialogTool> dialog, VMainGraphicsScene *scene,
|
||||||
VAbstractPattern *doc,
|
VAbstractPattern *doc, VContainer *data);
|
||||||
VContainer *data);
|
|
||||||
static VToolPointOfIntersectionCircles *Create(const quint32 _id, const QString &pointName,
|
static VToolPointOfIntersectionCircles *Create(const quint32 _id, const QString &pointName,
|
||||||
quint32 firstCircleCenterId, quint32 secondCircleCenterId,
|
quint32 firstCircleCenterId, quint32 secondCircleCenterId,
|
||||||
QString &firstCircleRadius, QString &secondCircleRadius,
|
QString &firstCircleRadius, QString &secondCircleRadius,
|
||||||
|
|
|
@ -72,8 +72,8 @@ VToolPointOfIntersectionCurves::VToolPointOfIntersectionCurves(VAbstractPattern
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VToolPointOfIntersectionCurves::setDialog()
|
void VToolPointOfIntersectionCurves::setDialog()
|
||||||
{
|
{
|
||||||
SCASSERT(dialog != nullptr)
|
SCASSERT(not m_dialog.isNull())
|
||||||
auto dialogTool = qobject_cast<DialogPointOfIntersectionCurves*>(dialog);
|
auto dialogTool = qobject_cast<DialogPointOfIntersectionCurves*>(m_dialog);
|
||||||
SCASSERT(dialogTool != nullptr)
|
SCASSERT(dialogTool != nullptr)
|
||||||
auto p = VAbstractTool::data.GeometricObject<VPointF>(id);
|
auto p = VAbstractTool::data.GeometricObject<VPointF>(id);
|
||||||
dialogTool->SetFirstCurveId(firstCurveId);
|
dialogTool->SetFirstCurveId(firstCurveId);
|
||||||
|
@ -84,12 +84,13 @@ void VToolPointOfIntersectionCurves::setDialog()
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
VToolPointOfIntersectionCurves *VToolPointOfIntersectionCurves::Create(DialogTool *dialog, VMainGraphicsScene *scene,
|
VToolPointOfIntersectionCurves *VToolPointOfIntersectionCurves::Create(QSharedPointer<DialogTool> dialog,
|
||||||
|
VMainGraphicsScene *scene,
|
||||||
VAbstractPattern *doc, VContainer *data)
|
VAbstractPattern *doc, VContainer *data)
|
||||||
{
|
{
|
||||||
SCASSERT(dialog != nullptr)
|
SCASSERT(not dialog.isNull())
|
||||||
auto dialogTool = qobject_cast<DialogPointOfIntersectionCurves*>(dialog);
|
QSharedPointer<DialogPointOfIntersectionCurves> dialogTool = dialog.objectCast<DialogPointOfIntersectionCurves>();
|
||||||
SCASSERT(dialogTool != nullptr)
|
SCASSERT(not dialogTool.isNull())
|
||||||
const quint32 firstCurveId = dialogTool->GetFirstCurveId();
|
const quint32 firstCurveId = dialogTool->GetFirstCurveId();
|
||||||
const quint32 secondCurveId = dialogTool->GetSecondCurveId();
|
const quint32 secondCurveId = dialogTool->GetSecondCurveId();
|
||||||
const VCrossCurvesPoint vCrossPoint = dialogTool->GetVCrossPoint();
|
const VCrossCurvesPoint vCrossPoint = dialogTool->GetVCrossPoint();
|
||||||
|
@ -99,7 +100,7 @@ VToolPointOfIntersectionCurves *VToolPointOfIntersectionCurves::Create(DialogToo
|
||||||
5, 10, scene, doc, data, Document::FullParse, Source::FromGui);
|
5, 10, scene, doc, data, Document::FullParse, Source::FromGui);
|
||||||
if (point != nullptr)
|
if (point != nullptr)
|
||||||
{
|
{
|
||||||
point->dialog=dialogTool;
|
point->m_dialog = dialogTool;
|
||||||
}
|
}
|
||||||
return point;
|
return point;
|
||||||
}
|
}
|
||||||
|
@ -380,8 +381,8 @@ void VToolPointOfIntersectionCurves::contextMenuEvent(QGraphicsSceneContextMenuE
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VToolPointOfIntersectionCurves::SaveDialog(QDomElement &domElement)
|
void VToolPointOfIntersectionCurves::SaveDialog(QDomElement &domElement)
|
||||||
{
|
{
|
||||||
SCASSERT(dialog != nullptr)
|
SCASSERT(not m_dialog.isNull())
|
||||||
auto dialogTool = qobject_cast<DialogPointOfIntersectionCurves*>(dialog);
|
auto dialogTool = qobject_cast<DialogPointOfIntersectionCurves*>(m_dialog);
|
||||||
SCASSERT(dialogTool != nullptr)
|
SCASSERT(dialogTool != nullptr)
|
||||||
doc->SetAttribute(domElement, AttrName, dialogTool->getPointName());
|
doc->SetAttribute(domElement, AttrName, dialogTool->getPointName());
|
||||||
doc->SetAttribute(domElement, AttrCurve1, QString().setNum(dialogTool->GetFirstCurveId()));
|
doc->SetAttribute(domElement, AttrCurve1, QString().setNum(dialogTool->GetFirstCurveId()));
|
||||||
|
|
|
@ -50,7 +50,7 @@ class VToolPointOfIntersectionCurves : public VToolSinglePoint
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
virtual void setDialog() Q_DECL_OVERRIDE;
|
virtual void setDialog() Q_DECL_OVERRIDE;
|
||||||
static VToolPointOfIntersectionCurves *Create(DialogTool *dialog, VMainGraphicsScene *scene,
|
static VToolPointOfIntersectionCurves *Create(QSharedPointer<DialogTool> dialog, VMainGraphicsScene *scene,
|
||||||
VAbstractPattern *doc, VContainer *data);
|
VAbstractPattern *doc, VContainer *data);
|
||||||
static VToolPointOfIntersectionCurves *Create(const quint32 _id, const QString &pointName,
|
static VToolPointOfIntersectionCurves *Create(const quint32 _id, const QString &pointName,
|
||||||
quint32 firstCurveId, quint32 secondCurveId,
|
quint32 firstCurveId, quint32 secondCurveId,
|
||||||
|
|
|
@ -83,9 +83,9 @@ VToolTriangle::VToolTriangle(VAbstractPattern *doc, VContainer *data, const quin
|
||||||
*/
|
*/
|
||||||
void VToolTriangle::setDialog()
|
void VToolTriangle::setDialog()
|
||||||
{
|
{
|
||||||
SCASSERT(dialog != nullptr)
|
SCASSERT(not m_dialog.isNull())
|
||||||
DialogTriangle *dialogTool = qobject_cast<DialogTriangle*>(dialog);
|
QSharedPointer<DialogTriangle> dialogTool = m_dialog.objectCast<DialogTriangle>();
|
||||||
SCASSERT(dialogTool != nullptr)
|
SCASSERT(not dialogTool.isNull())
|
||||||
const QSharedPointer<VPointF> p = VAbstractTool::data.GeometricObject<VPointF>(id);
|
const QSharedPointer<VPointF> p = VAbstractTool::data.GeometricObject<VPointF>(id);
|
||||||
dialogTool->SetAxisP1Id(axisP1Id);
|
dialogTool->SetAxisP1Id(axisP1Id);
|
||||||
dialogTool->SetAxisP2Id(axisP2Id);
|
dialogTool->SetAxisP2Id(axisP2Id);
|
||||||
|
@ -103,12 +103,12 @@ void VToolTriangle::setDialog()
|
||||||
* @param data container with variables.
|
* @param data container with variables.
|
||||||
* @return the created tool
|
* @return the created tool
|
||||||
*/
|
*/
|
||||||
VToolTriangle* VToolTriangle::Create(DialogTool *dialog, VMainGraphicsScene *scene, VAbstractPattern *doc,
|
VToolTriangle* VToolTriangle::Create(QSharedPointer<DialogTool> dialog, VMainGraphicsScene *scene,
|
||||||
VContainer *data)
|
VAbstractPattern *doc, VContainer *data)
|
||||||
{
|
{
|
||||||
SCASSERT(dialog != nullptr)
|
SCASSERT(not dialog.isNull())
|
||||||
DialogTriangle *dialogTool = qobject_cast<DialogTriangle*>(dialog);
|
QSharedPointer<DialogTriangle> dialogTool = dialog.objectCast<DialogTriangle>();
|
||||||
SCASSERT(dialogTool != nullptr)
|
SCASSERT(not dialogTool.isNull())
|
||||||
const quint32 axisP1Id = dialogTool->GetAxisP1Id();
|
const quint32 axisP1Id = dialogTool->GetAxisP1Id();
|
||||||
const quint32 axisP2Id = dialogTool->GetAxisP2Id();
|
const quint32 axisP2Id = dialogTool->GetAxisP2Id();
|
||||||
const quint32 firstPointId = dialogTool->GetFirstPointId();
|
const quint32 firstPointId = dialogTool->GetFirstPointId();
|
||||||
|
@ -118,7 +118,7 @@ VToolTriangle* VToolTriangle::Create(DialogTool *dialog, VMainGraphicsScene *sce
|
||||||
scene, doc, data, Document::FullParse, Source::FromGui);
|
scene, doc, data, Document::FullParse, Source::FromGui);
|
||||||
if (point != nullptr)
|
if (point != nullptr)
|
||||||
{
|
{
|
||||||
point->dialog=dialogTool;
|
point->m_dialog = dialogTool;
|
||||||
}
|
}
|
||||||
return point;
|
return point;
|
||||||
}
|
}
|
||||||
|
@ -297,9 +297,9 @@ void VToolTriangle::contextMenuEvent(QGraphicsSceneContextMenuEvent *event)
|
||||||
*/
|
*/
|
||||||
void VToolTriangle::SaveDialog(QDomElement &domElement)
|
void VToolTriangle::SaveDialog(QDomElement &domElement)
|
||||||
{
|
{
|
||||||
SCASSERT(dialog != nullptr)
|
SCASSERT(not m_dialog.isNull())
|
||||||
DialogTriangle *dialogTool = qobject_cast<DialogTriangle*>(dialog);
|
QSharedPointer<DialogTriangle> dialogTool = m_dialog.objectCast<DialogTriangle>();
|
||||||
SCASSERT(dialogTool != nullptr)
|
SCASSERT(not dialogTool.isNull())
|
||||||
doc->SetAttribute(domElement, AttrName, dialogTool->getPointName());
|
doc->SetAttribute(domElement, AttrName, dialogTool->getPointName());
|
||||||
doc->SetAttribute(domElement, AttrAxisP1, QString().setNum(dialogTool->GetAxisP1Id()));
|
doc->SetAttribute(domElement, AttrAxisP1, QString().setNum(dialogTool->GetAxisP1Id()));
|
||||||
doc->SetAttribute(domElement, AttrAxisP2, QString().setNum(dialogTool->GetAxisP2Id()));
|
doc->SetAttribute(domElement, AttrAxisP2, QString().setNum(dialogTool->GetAxisP2Id()));
|
||||||
|
|
|
@ -53,7 +53,7 @@ class VToolTriangle : public VToolSinglePoint
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
virtual void setDialog() Q_DECL_OVERRIDE;
|
virtual void setDialog() Q_DECL_OVERRIDE;
|
||||||
static VToolTriangle *Create(DialogTool *dialog, VMainGraphicsScene *scene, VAbstractPattern *doc,
|
static VToolTriangle *Create(QSharedPointer<DialogTool> dialog, VMainGraphicsScene *scene, VAbstractPattern *doc,
|
||||||
VContainer *data);
|
VContainer *data);
|
||||||
static VToolTriangle *Create(const quint32 _id, const QString &pointName, const quint32 &axisP1Id,
|
static VToolTriangle *Create(const quint32 _id, const QString &pointName, const quint32 &axisP1Id,
|
||||||
const quint32 &axisP2Id, const quint32 &firstPointId, const quint32 &secondPointId,
|
const quint32 &axisP2Id, const quint32 &firstPointId, const quint32 &secondPointId,
|
||||||
|
|
|
@ -59,20 +59,16 @@ qreal VDrawTool::factor = 1;
|
||||||
* @param id object id in container.
|
* @param id object id in container.
|
||||||
*/
|
*/
|
||||||
VDrawTool::VDrawTool(VAbstractPattern *doc, VContainer *data, quint32 id, QObject *parent)
|
VDrawTool::VDrawTool(VAbstractPattern *doc, VContainer *data, quint32 id, QObject *parent)
|
||||||
:VAbstractTool(doc, data, id, parent), nameActivDraw(doc->GetNameActivPP()),
|
: VInteractiveTool(doc, data, id, parent),
|
||||||
dialog(nullptr), typeLine(TypeLineLine), enabled(true)
|
nameActivDraw(doc->GetNameActivPP()),
|
||||||
|
typeLine(TypeLineLine),
|
||||||
|
enabled(true)
|
||||||
{
|
{
|
||||||
connect(this->doc, &VAbstractPattern::ChangedActivPP, this, &VDrawTool::ChangedActivDraw);
|
connect(this->doc, &VAbstractPattern::ChangedActivPP, this, &VDrawTool::ChangedActivDraw);
|
||||||
connect(this->doc, &VAbstractPattern::ChangedNameDraw, this, &VDrawTool::ChangedNameDraw);
|
connect(this->doc, &VAbstractPattern::ChangedNameDraw, this, &VDrawTool::ChangedNameDraw);
|
||||||
connect(this->doc, &VAbstractPattern::ShowTool, this, &VDrawTool::ShowTool);
|
connect(this->doc, &VAbstractPattern::ShowTool, this, &VDrawTool::ShowTool);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
|
||||||
VDrawTool::~VDrawTool()
|
|
||||||
{
|
|
||||||
delete dialog;
|
|
||||||
}
|
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief ShowTool highlight tool.
|
* @brief ShowTool highlight tool.
|
||||||
|
@ -109,30 +105,6 @@ void VDrawTool::ChangedNameDraw(const QString &oldName, const QString &newName)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
|
||||||
/**
|
|
||||||
* @brief FullUpdateFromGuiOk refresh tool data after change in options.
|
|
||||||
* @param result keep result working dialog.
|
|
||||||
*/
|
|
||||||
void VDrawTool::FullUpdateFromGuiOk(int result)
|
|
||||||
{
|
|
||||||
if (result == QDialog::Accepted)
|
|
||||||
{
|
|
||||||
SaveDialogChange();
|
|
||||||
}
|
|
||||||
delete dialog;
|
|
||||||
dialog=nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
|
||||||
/**
|
|
||||||
* @brief FullUpdateFromGuiApply refresh tool data after change in options but do not delete dialog
|
|
||||||
*/
|
|
||||||
void VDrawTool::FullUpdateFromGuiApply()
|
|
||||||
{
|
|
||||||
SaveDialogChange();
|
|
||||||
}
|
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VDrawTool::SaveDialogChange()
|
void VDrawTool::SaveDialogChange()
|
||||||
{
|
{
|
||||||
|
@ -252,15 +224,6 @@ void VDrawTool::ReadAttributes()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
|
||||||
/**
|
|
||||||
* @brief DialogLinkDestroy removes dialog pointer
|
|
||||||
*/
|
|
||||||
void VDrawTool::DialogLinkDestroy()
|
|
||||||
{
|
|
||||||
this->dialog=nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief SetFactor set current scale factor of scene.
|
* @brief SetFactor set current scale factor of scene.
|
||||||
|
|
|
@ -42,9 +42,8 @@
|
||||||
#include <QString>
|
#include <QString>
|
||||||
#include <QtGlobal>
|
#include <QtGlobal>
|
||||||
|
|
||||||
#include "../../dialogs/tools/dialogtool.h"
|
|
||||||
#include "../ifc/exception/vexceptionbadid.h"
|
#include "../ifc/exception/vexceptionbadid.h"
|
||||||
#include "../vabstracttool.h"
|
#include "../vinteractivetool.h"
|
||||||
#include "../vmisc/vabstractapplication.h"
|
#include "../vmisc/vabstractapplication.h"
|
||||||
#include "../vmisc/def.h"
|
#include "../vmisc/def.h"
|
||||||
#include "../vwidgets/vmaingraphicsscene.h"
|
#include "../vwidgets/vmaingraphicsscene.h"
|
||||||
|
@ -56,22 +55,17 @@ template <class T> class QSharedPointer;
|
||||||
/**
|
/**
|
||||||
* @brief The VDrawTool abstract class for all draw tool.
|
* @brief The VDrawTool abstract class for all draw tool.
|
||||||
*/
|
*/
|
||||||
class VDrawTool : public VAbstractTool
|
class VDrawTool : public VInteractiveTool
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
|
|
||||||
VDrawTool(VAbstractPattern *doc, VContainer *data, quint32 id, QObject *parent = nullptr);
|
VDrawTool(VAbstractPattern *doc, VContainer *data, quint32 id, QObject *parent = nullptr);
|
||||||
virtual ~VDrawTool() Q_DECL_OVERRIDE;
|
virtual ~VDrawTool() Q_DECL_EQ_DEFAULT;
|
||||||
|
|
||||||
/** @brief factor scene scale factor. */
|
/** @brief factor scene scale factor. */
|
||||||
static qreal factor;
|
static qreal factor;
|
||||||
|
|
||||||
/** @brief setDialog set dialog when user want change tool option. */
|
|
||||||
virtual void setDialog() {}
|
|
||||||
|
|
||||||
void DialogLinkDestroy();
|
|
||||||
|
|
||||||
QString getLineType() const;
|
QString getLineType() const;
|
||||||
virtual void SetTypeLine(const QString &value);
|
virtual void SetTypeLine(const QString &value);
|
||||||
|
|
||||||
|
@ -82,8 +76,6 @@ public slots:
|
||||||
virtual void ShowTool(quint32 id, bool enable);
|
virtual void ShowTool(quint32 id, bool enable);
|
||||||
virtual void ChangedActivDraw(const QString &newName);
|
virtual void ChangedActivDraw(const QString &newName);
|
||||||
void ChangedNameDraw(const QString &oldName, const QString &newName);
|
void ChangedNameDraw(const QString &oldName, const QString &newName);
|
||||||
virtual void FullUpdateFromGuiOk(int result);
|
|
||||||
virtual void FullUpdateFromGuiApply();
|
|
||||||
virtual void SetFactor(qreal factor);
|
virtual void SetFactor(qreal factor);
|
||||||
virtual void EnableToolMove(bool move);
|
virtual void EnableToolMove(bool move);
|
||||||
virtual void Disable(bool disable, const QString &namePP)=0;
|
virtual void Disable(bool disable, const QString &namePP)=0;
|
||||||
|
@ -96,9 +88,6 @@ protected:
|
||||||
/** @brief nameActivDraw name of tool's pattern peace. */
|
/** @brief nameActivDraw name of tool's pattern peace. */
|
||||||
QString nameActivDraw;
|
QString nameActivDraw;
|
||||||
|
|
||||||
/** @brief dialog dialog options.*/
|
|
||||||
DialogTool *dialog;
|
|
||||||
|
|
||||||
/** @brief typeLine line type. */
|
/** @brief typeLine line type. */
|
||||||
QString typeLine;
|
QString typeLine;
|
||||||
|
|
||||||
|
@ -108,7 +97,7 @@ protected:
|
||||||
|
|
||||||
/** @brief SaveDialog save options into file after change in dialog. */
|
/** @brief SaveDialog save options into file after change in dialog. */
|
||||||
virtual void SaveDialog(QDomElement &domElement)=0;
|
virtual void SaveDialog(QDomElement &domElement)=0;
|
||||||
void SaveDialogChange();
|
virtual void SaveDialogChange() Q_DECL_FINAL;
|
||||||
virtual void AddToFile() Q_DECL_OVERRIDE;
|
virtual void AddToFile() Q_DECL_OVERRIDE;
|
||||||
virtual void RefreshDataInFile() Q_DECL_OVERRIDE;
|
virtual void RefreshDataInFile() Q_DECL_OVERRIDE;
|
||||||
void SaveOption(QSharedPointer<VGObject> &obj);
|
void SaveOption(QSharedPointer<VGObject> &obj);
|
||||||
|
@ -188,15 +177,15 @@ void VDrawTool::ContextMenu(Tool *tool, QGraphicsSceneContextMenuEvent *event, c
|
||||||
{
|
{
|
||||||
qCDebug(vTool, "Show options.");
|
qCDebug(vTool, "Show options.");
|
||||||
qApp->getSceneView()->itemClicked(nullptr);
|
qApp->getSceneView()->itemClicked(nullptr);
|
||||||
dialog = new Dialog(getData(), id, qApp->getMainWindow());
|
m_dialog = QSharedPointer<Dialog>(new Dialog(getData(), id, qApp->getMainWindow()));
|
||||||
dialog->setModal(true);
|
m_dialog->setModal(true);
|
||||||
|
|
||||||
connect(dialog, &DialogTool::DialogClosed, tool, &Tool::FullUpdateFromGuiOk);
|
connect(m_dialog.data(), &DialogTool::DialogClosed, tool, &Tool::FullUpdateFromGuiOk);
|
||||||
connect(dialog, &DialogTool::DialogApplied, tool, &Tool::FullUpdateFromGuiApply);
|
connect(m_dialog.data(), &DialogTool::DialogApplied, tool, &Tool::FullUpdateFromGuiApply);
|
||||||
|
|
||||||
tool->setDialog();
|
tool->setDialog();
|
||||||
|
|
||||||
dialog->show();
|
m_dialog->show();
|
||||||
}
|
}
|
||||||
if (selectedAction == actionRemove)
|
if (selectedAction == actionRemove)
|
||||||
{
|
{
|
||||||
|
|
|
@ -93,9 +93,9 @@ VToolLine::VToolLine(VAbstractPattern *doc, VContainer *data, quint32 id, quint3
|
||||||
*/
|
*/
|
||||||
void VToolLine::setDialog()
|
void VToolLine::setDialog()
|
||||||
{
|
{
|
||||||
SCASSERT(dialog != nullptr)
|
SCASSERT(not m_dialog.isNull())
|
||||||
DialogLine *dialogTool = qobject_cast<DialogLine*>(dialog);
|
QSharedPointer<DialogLine> dialogTool = m_dialog.objectCast<DialogLine>();
|
||||||
SCASSERT(dialogTool != nullptr)
|
SCASSERT(not dialogTool.isNull())
|
||||||
dialogTool->SetFirstPoint(firstPoint);
|
dialogTool->SetFirstPoint(firstPoint);
|
||||||
dialogTool->SetSecondPoint(secondPoint);
|
dialogTool->SetSecondPoint(secondPoint);
|
||||||
dialogTool->SetTypeLine(typeLine);
|
dialogTool->SetTypeLine(typeLine);
|
||||||
|
@ -110,11 +110,12 @@ void VToolLine::setDialog()
|
||||||
* @param doc dom document container.
|
* @param doc dom document container.
|
||||||
* @param data container with variables.
|
* @param data container with variables.
|
||||||
*/
|
*/
|
||||||
VToolLine *VToolLine::Create(DialogTool *dialog, VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data)
|
VToolLine *VToolLine::Create(QSharedPointer<DialogTool> dialog, VMainGraphicsScene *scene, VAbstractPattern *doc,
|
||||||
|
VContainer *data)
|
||||||
{
|
{
|
||||||
SCASSERT(dialog != nullptr)
|
SCASSERT(not dialog.isNull())
|
||||||
DialogLine *dialogTool = qobject_cast<DialogLine*>(dialog);
|
QSharedPointer<DialogLine> dialogTool = dialog.objectCast<DialogLine>();
|
||||||
SCASSERT(dialogTool != nullptr)
|
SCASSERT(not dialogTool.isNull())
|
||||||
const quint32 firstPoint = dialogTool->GetFirstPoint();
|
const quint32 firstPoint = dialogTool->GetFirstPoint();
|
||||||
const quint32 secondPoint = dialogTool->GetSecondPoint();
|
const quint32 secondPoint = dialogTool->GetSecondPoint();
|
||||||
const QString typeLine = dialogTool->GetTypeLine();
|
const QString typeLine = dialogTool->GetTypeLine();
|
||||||
|
@ -124,7 +125,7 @@ VToolLine *VToolLine::Create(DialogTool *dialog, VMainGraphicsScene *scene, VAbs
|
||||||
Source::FromGui);
|
Source::FromGui);
|
||||||
if (line != nullptr)
|
if (line != nullptr)
|
||||||
{
|
{
|
||||||
line->dialog=dialogTool;
|
line->m_dialog = dialogTool;
|
||||||
}
|
}
|
||||||
return line;
|
return line;
|
||||||
}
|
}
|
||||||
|
@ -398,9 +399,9 @@ void VToolLine::keyReleaseEvent(QKeyEvent *event)
|
||||||
*/
|
*/
|
||||||
void VToolLine::SaveDialog(QDomElement &domElement)
|
void VToolLine::SaveDialog(QDomElement &domElement)
|
||||||
{
|
{
|
||||||
SCASSERT(dialog != nullptr)
|
SCASSERT(not m_dialog.isNull())
|
||||||
DialogLine *dialogTool = qobject_cast<DialogLine*>(dialog);
|
QSharedPointer<DialogLine> dialogTool = m_dialog.objectCast<DialogLine>();
|
||||||
SCASSERT(dialogTool != nullptr)
|
SCASSERT(not dialogTool.isNull())
|
||||||
doc->SetAttribute(domElement, AttrFirstPoint, QString().setNum(dialogTool->GetFirstPoint()));
|
doc->SetAttribute(domElement, AttrFirstPoint, QString().setNum(dialogTool->GetFirstPoint()));
|
||||||
doc->SetAttribute(domElement, AttrSecondPoint, QString().setNum(dialogTool->GetSecondPoint()));
|
doc->SetAttribute(domElement, AttrSecondPoint, QString().setNum(dialogTool->GetSecondPoint()));
|
||||||
doc->SetAttribute(domElement, AttrTypeLine, dialogTool->GetTypeLine());
|
doc->SetAttribute(domElement, AttrTypeLine, dialogTool->GetTypeLine());
|
||||||
|
|
|
@ -53,7 +53,8 @@ class VToolLine: public VDrawTool, public QGraphicsLineItem
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
virtual void setDialog() Q_DECL_OVERRIDE;
|
virtual void setDialog() Q_DECL_OVERRIDE;
|
||||||
static VToolLine *Create(DialogTool *dialog, VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data);
|
static VToolLine *Create(QSharedPointer<DialogTool> dialog, VMainGraphicsScene *scene, VAbstractPattern *doc,
|
||||||
|
VContainer *data);
|
||||||
static VToolLine *Create(const quint32 &_id, const quint32 &firstPoint, const quint32 &secondPoint,
|
static VToolLine *Create(const quint32 &_id, const quint32 &firstPoint, const quint32 &secondPoint,
|
||||||
const QString &typeLine, const QString &lineColor, VMainGraphicsScene *scene,
|
const QString &typeLine, const QString &lineColor, VMainGraphicsScene *scene,
|
||||||
VAbstractPattern *doc, VContainer *data, const Document &parse,
|
VAbstractPattern *doc, VContainer *data, const Document &parse,
|
||||||
|
|
|
@ -34,12 +34,12 @@
|
||||||
#include "../vtoolseamallowance.h"
|
#include "../vtoolseamallowance.h"
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
VToolPiecePath *VToolPiecePath::Create(DialogTool *dialog, VMainGraphicsScene *scene, VAbstractPattern *doc,
|
VToolPiecePath *VToolPiecePath::Create(QSharedPointer<DialogTool> dialog, VMainGraphicsScene *scene,
|
||||||
VContainer *data)
|
VAbstractPattern *doc, VContainer *data)
|
||||||
{
|
{
|
||||||
SCASSERT(dialog != nullptr);
|
SCASSERT(not dialog.isNull());
|
||||||
DialogPiecePath *dialogTool = qobject_cast<DialogPiecePath*>(dialog);
|
QSharedPointer<DialogPiecePath> dialogTool = dialog.objectCast<DialogPiecePath>();
|
||||||
SCASSERT(dialogTool != nullptr);
|
SCASSERT(not dialogTool.isNull())
|
||||||
VPiecePath path = dialogTool->GetPiecePath();
|
VPiecePath path = dialogTool->GetPiecePath();
|
||||||
const quint32 pieceId = dialogTool->GetPieceId();
|
const quint32 pieceId = dialogTool->GetPieceId();
|
||||||
qApp->getUndoStack()->beginMacro("add path");
|
qApp->getUndoStack()->beginMacro("add path");
|
||||||
|
|
|
@ -39,7 +39,7 @@ class VToolPiecePath : public VAbstractNode, public QGraphicsPathItem
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
static VToolPiecePath* Create(DialogTool *dialog, VMainGraphicsScene *scene, VAbstractPattern *doc,
|
static VToolPiecePath* Create(QSharedPointer<DialogTool> dialog, VMainGraphicsScene *scene, VAbstractPattern *doc,
|
||||||
VContainer *data);
|
VContainer *data);
|
||||||
static VToolPiecePath *Create(quint32 _id, const VPiecePath &path, quint32 pieceId, VMainGraphicsScene *scene,
|
static VToolPiecePath *Create(quint32 _id, const VPiecePath &path, quint32 pieceId, VMainGraphicsScene *scene,
|
||||||
VAbstractPattern *doc, VContainer *data, const Document &parse,
|
VAbstractPattern *doc, VContainer *data, const Document &parse,
|
||||||
|
|
|
@ -35,11 +35,11 @@
|
||||||
const QString VToolPin::ToolType = QStringLiteral("pin");
|
const QString VToolPin::ToolType = QStringLiteral("pin");
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
VToolPin *VToolPin::Create(DialogTool *dialog, VAbstractPattern *doc, VContainer *data)
|
VToolPin *VToolPin::Create(QSharedPointer<DialogTool> dialog, VAbstractPattern *doc, VContainer *data)
|
||||||
{
|
{
|
||||||
SCASSERT(dialog != nullptr);
|
SCASSERT(not dialog.isNull());
|
||||||
DialogPin *dialogTool = qobject_cast<DialogPin*>(dialog);
|
QSharedPointer<DialogPin> dialogTool = dialog.objectCast<DialogPin>();
|
||||||
SCASSERT(dialogTool != nullptr);
|
SCASSERT(not dialogTool.isNull())
|
||||||
const quint32 pointId = dialogTool->GetPointId();
|
const quint32 pointId = dialogTool->GetPointId();
|
||||||
const quint32 pieceId = dialogTool->GetPieceId();
|
const quint32 pieceId = dialogTool->GetPieceId();
|
||||||
|
|
||||||
|
|
|
@ -39,7 +39,7 @@ class VToolPin : public VAbstractNode
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
static VToolPin* Create(DialogTool *dialog, VAbstractPattern *doc, VContainer *data);
|
static VToolPin* Create(QSharedPointer<DialogTool> dialog, VAbstractPattern *doc, VContainer *data);
|
||||||
static VToolPin *Create(quint32 _id, quint32 pointId, quint32 pieceId, VAbstractPattern *doc, VContainer *data,
|
static VToolPin *Create(quint32 _id, quint32 pointId, quint32 pieceId, VAbstractPattern *doc, VContainer *data,
|
||||||
const Document &parse, const Source &typeCreation, const QString &drawName = QString(),
|
const Document &parse, const Source &typeCreation, const QString &drawName = QString(),
|
||||||
const quint32 &idTool = 0);
|
const quint32 &idTool = 0);
|
||||||
|
|
|
@ -59,7 +59,8 @@ HEADERS += \
|
||||||
$$PWD/nodeDetails/vnodeellipticalarc.h \
|
$$PWD/nodeDetails/vnodeellipticalarc.h \
|
||||||
$$PWD/vtoolseamallowance.h \
|
$$PWD/vtoolseamallowance.h \
|
||||||
$$PWD/nodeDetails/vtoolpiecepath.h \
|
$$PWD/nodeDetails/vtoolpiecepath.h \
|
||||||
$$PWD/nodeDetails/vtoolpin.h
|
$$PWD/nodeDetails/vtoolpin.h \
|
||||||
|
$$PWD/vinteractivetool.h
|
||||||
|
|
||||||
SOURCES += \
|
SOURCES += \
|
||||||
$$PWD/vdatatool.cpp \
|
$$PWD/vdatatool.cpp \
|
||||||
|
@ -116,4 +117,5 @@ SOURCES += \
|
||||||
$$PWD/nodeDetails/vnodeellipticalarc.cpp \
|
$$PWD/nodeDetails/vnodeellipticalarc.cpp \
|
||||||
$$PWD/vtoolseamallowance.cpp \
|
$$PWD/vtoolseamallowance.cpp \
|
||||||
$$PWD/nodeDetails/vtoolpiecepath.cpp \
|
$$PWD/nodeDetails/vtoolpiecepath.cpp \
|
||||||
$$PWD/nodeDetails/vtoolpin.cpp
|
$$PWD/nodeDetails/vtoolpin.cpp \
|
||||||
|
$$PWD/vinteractivetool.cpp
|
||||||
|
|
65
src/libs/vtools/tools/vinteractivetool.cpp
Normal file
65
src/libs/vtools/tools/vinteractivetool.cpp
Normal file
|
@ -0,0 +1,65 @@
|
||||||
|
/************************************************************************
|
||||||
|
**
|
||||||
|
** @file
|
||||||
|
** @author Roman Telezhynskyi <dismine(at)gmail.com>
|
||||||
|
** @date 15 4, 2017
|
||||||
|
**
|
||||||
|
** @brief
|
||||||
|
** @copyright
|
||||||
|
** This source code is part of the Valentine project, a pattern making
|
||||||
|
** program, whose allow create and modeling patterns of clothing.
|
||||||
|
** Copyright (C) 2017 Valentina project
|
||||||
|
** <https://bitbucket.org/dismine/valentina> All Rights Reserved.
|
||||||
|
**
|
||||||
|
** Valentina is free software: you can redistribute it and/or modify
|
||||||
|
** it under the terms of the GNU General Public License as published by
|
||||||
|
** the Free Software Foundation, either version 3 of the License, or
|
||||||
|
** (at your option) any later version.
|
||||||
|
**
|
||||||
|
** Valentina is distributed in the hope that it will be useful,
|
||||||
|
** but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
** GNU General Public License for more details.
|
||||||
|
**
|
||||||
|
** You should have received a copy of the GNU General Public License
|
||||||
|
** along with Valentina. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
**
|
||||||
|
*************************************************************************/
|
||||||
|
|
||||||
|
#include "vinteractivetool.h"
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
VInteractiveTool::VInteractiveTool(VAbstractPattern *doc, VContainer *data, quint32 id, QObject *parent)
|
||||||
|
: VAbstractTool(doc, data, id),
|
||||||
|
m_dialog()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
void VInteractiveTool::DialogLinkDestroy()
|
||||||
|
{
|
||||||
|
m_dialog.clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief FullUpdateFromGuiOk refresh tool data after change in options.
|
||||||
|
* @param result keep result working dialog.
|
||||||
|
*/
|
||||||
|
void VInteractiveTool::FullUpdateFromGuiOk(int result)
|
||||||
|
{
|
||||||
|
if (result == QDialog::Accepted)
|
||||||
|
{
|
||||||
|
SaveDialogChange();
|
||||||
|
}
|
||||||
|
m_dialog.clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief FullUpdateFromGuiApply refresh tool data after change in options but do not delete dialog
|
||||||
|
*/
|
||||||
|
void VInteractiveTool::FullUpdateFromGuiApply()
|
||||||
|
{
|
||||||
|
SaveDialogChange();
|
||||||
|
}
|
62
src/libs/vtools/tools/vinteractivetool.h
Normal file
62
src/libs/vtools/tools/vinteractivetool.h
Normal file
|
@ -0,0 +1,62 @@
|
||||||
|
/************************************************************************
|
||||||
|
**
|
||||||
|
** @file
|
||||||
|
** @author Roman Telezhynskyi <dismine(at)gmail.com>
|
||||||
|
** @date 15 4, 2017
|
||||||
|
**
|
||||||
|
** @brief
|
||||||
|
** @copyright
|
||||||
|
** This source code is part of the Valentine project, a pattern making
|
||||||
|
** program, whose allow create and modeling patterns of clothing.
|
||||||
|
** Copyright (C) 2017 Valentina project
|
||||||
|
** <https://bitbucket.org/dismine/valentina> All Rights Reserved.
|
||||||
|
**
|
||||||
|
** Valentina is free software: you can redistribute it and/or modify
|
||||||
|
** it under the terms of the GNU General Public License as published by
|
||||||
|
** the Free Software Foundation, either version 3 of the License, or
|
||||||
|
** (at your option) any later version.
|
||||||
|
**
|
||||||
|
** Valentina is distributed in the hope that it will be useful,
|
||||||
|
** but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
** GNU General Public License for more details.
|
||||||
|
**
|
||||||
|
** You should have received a copy of the GNU General Public License
|
||||||
|
** along with Valentina. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
**
|
||||||
|
*************************************************************************/
|
||||||
|
|
||||||
|
#ifndef VINTERACTIVETOOL_H
|
||||||
|
#define VINTERACTIVETOOL_H
|
||||||
|
|
||||||
|
#include "vabstracttool.h"
|
||||||
|
#include "../dialogs/tools/dialogtool.h"
|
||||||
|
|
||||||
|
#include <QtCore/qglobal.h>
|
||||||
|
|
||||||
|
class VInteractiveTool : public VAbstractTool
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
public:
|
||||||
|
VInteractiveTool(VAbstractPattern *doc, VContainer *data, quint32 id, QObject *parent = nullptr);
|
||||||
|
virtual ~VInteractiveTool() Q_DECL_EQ_DEFAULT;
|
||||||
|
|
||||||
|
void DialogLinkDestroy();
|
||||||
|
|
||||||
|
public slots:
|
||||||
|
void FullUpdateFromGuiOk(int result);
|
||||||
|
void FullUpdateFromGuiApply();
|
||||||
|
|
||||||
|
protected:
|
||||||
|
/** @brief m_dialog tool's dialog options.*/
|
||||||
|
QSharedPointer<DialogTool> m_dialog;
|
||||||
|
|
||||||
|
/** @brief setDialog set dialog when user want change tool option. */
|
||||||
|
virtual void setDialog() {}
|
||||||
|
virtual void SaveDialogChange()=0;
|
||||||
|
|
||||||
|
private:
|
||||||
|
Q_DISABLE_COPY(VInteractiveTool)
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // VINTERACTIVETOOL_H
|
|
@ -84,18 +84,12 @@ const QString VToolSeamAllowance::AttrTopPin = QStringLiteral("top
|
||||||
const QString VToolSeamAllowance::AttrBottomPin = QStringLiteral("bottomPin");
|
const QString VToolSeamAllowance::AttrBottomPin = QStringLiteral("bottomPin");
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
VToolSeamAllowance::~VToolSeamAllowance()
|
VToolSeamAllowance *VToolSeamAllowance::Create(QSharedPointer<DialogTool> dialog, VMainGraphicsScene *scene,
|
||||||
|
VAbstractPattern *doc, VContainer *data)
|
||||||
{
|
{
|
||||||
delete m_dialog;
|
SCASSERT(not dialog.isNull());
|
||||||
}
|
QSharedPointer<DialogSeamAllowance> dialogTool = dialog.objectCast<DialogSeamAllowance>();
|
||||||
|
SCASSERT(not dialogTool.isNull())
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
|
||||||
VToolSeamAllowance *VToolSeamAllowance::Create(DialogTool *dialog, VMainGraphicsScene *scene, VAbstractPattern *doc,
|
|
||||||
VContainer *data)
|
|
||||||
{
|
|
||||||
SCASSERT(dialog != nullptr);
|
|
||||||
DialogSeamAllowance *dialogTool = qobject_cast<DialogSeamAllowance*>(dialog);
|
|
||||||
SCASSERT(dialogTool != nullptr);
|
|
||||||
VPiece detail = dialogTool->GetPiece();
|
VPiece detail = dialogTool->GetPiece();
|
||||||
QString width = detail.GetFormulaSAWidth();
|
QString width = detail.GetFormulaSAWidth();
|
||||||
qApp->getUndoStack()->beginMacro("add detail");
|
qApp->getUndoStack()->beginMacro("add detail");
|
||||||
|
@ -167,12 +161,6 @@ void VToolSeamAllowance::Remove(bool ask)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
|
||||||
void VToolSeamAllowance::DialogLinkDestroy()
|
|
||||||
{
|
|
||||||
m_dialog=nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VToolSeamAllowance::InsertNode(VPieceNode node, quint32 pieceId, VMainGraphicsScene *scene,
|
void VToolSeamAllowance::InsertNode(VPieceNode node, quint32 pieceId, VMainGraphicsScene *scene,
|
||||||
VContainer *data, VAbstractPattern *doc)
|
VContainer *data, VAbstractPattern *doc)
|
||||||
|
@ -475,22 +463,6 @@ void VToolSeamAllowance::FullUpdateFromFile()
|
||||||
RefreshGeometry();
|
RefreshGeometry();
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
|
||||||
void VToolSeamAllowance::FullUpdateFromGuiOk(int result)
|
|
||||||
{
|
|
||||||
if (result == QDialog::Accepted)
|
|
||||||
{
|
|
||||||
SaveDialogChange();
|
|
||||||
}
|
|
||||||
delete m_dialog;
|
|
||||||
}
|
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
|
||||||
void VToolSeamAllowance::FullUpdateFromGuiApply()
|
|
||||||
{
|
|
||||||
SaveDialogChange();
|
|
||||||
}
|
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VToolSeamAllowance::EnableToolMove(bool move)
|
void VToolSeamAllowance::EnableToolMove(bool move)
|
||||||
{
|
{
|
||||||
|
@ -1103,7 +1075,8 @@ void VToolSeamAllowance::contextMenuEvent(QGraphicsSceneContextMenuEvent *event)
|
||||||
QAction *selectedAction = menu.exec(event->screenPos());
|
QAction *selectedAction = menu.exec(event->screenPos());
|
||||||
if (selectedAction == actionOption)
|
if (selectedAction == actionOption)
|
||||||
{
|
{
|
||||||
auto *dialog = new DialogSeamAllowance(getData(), id, qApp->getMainWindow());
|
QSharedPointer<DialogSeamAllowance> dialog =
|
||||||
|
QSharedPointer<DialogSeamAllowance>(new DialogSeamAllowance(getData(), id, qApp->getMainWindow()));
|
||||||
dialog->EnableApply(true);
|
dialog->EnableApply(true);
|
||||||
m_dialog = dialog;
|
m_dialog = dialog;
|
||||||
m_dialog->setModal(true);
|
m_dialog->setModal(true);
|
||||||
|
@ -1161,8 +1134,8 @@ void VToolSeamAllowance::keyReleaseEvent(QKeyEvent *event)
|
||||||
void VToolSeamAllowance::SetDialog()
|
void VToolSeamAllowance::SetDialog()
|
||||||
{
|
{
|
||||||
SCASSERT(not m_dialog.isNull());
|
SCASSERT(not m_dialog.isNull());
|
||||||
DialogSeamAllowance *dialogTool = qobject_cast<DialogSeamAllowance*>(m_dialog);
|
QSharedPointer<DialogSeamAllowance> dialogTool = m_dialog.objectCast<DialogSeamAllowance>();
|
||||||
SCASSERT(dialogTool != nullptr);
|
SCASSERT(not dialogTool.isNull())
|
||||||
dialogTool->SetPiece(VAbstractTool::data.GetPiece(id));
|
dialogTool->SetPiece(VAbstractTool::data.GetPiece(id));
|
||||||
dialogTool->EnableApply(true);
|
dialogTool->EnableApply(true);
|
||||||
}
|
}
|
||||||
|
@ -1171,9 +1144,8 @@ void VToolSeamAllowance::SetDialog()
|
||||||
VToolSeamAllowance::VToolSeamAllowance(VAbstractPattern *doc, VContainer *data, const quint32 &id,
|
VToolSeamAllowance::VToolSeamAllowance(VAbstractPattern *doc, VContainer *data, const quint32 &id,
|
||||||
const Source &typeCreation, VMainGraphicsScene *scene,
|
const Source &typeCreation, VMainGraphicsScene *scene,
|
||||||
const QString &drawName, QGraphicsItem *parent)
|
const QString &drawName, QGraphicsItem *parent)
|
||||||
: VAbstractTool(doc, data, id),
|
: VInteractiveTool(doc, data, id),
|
||||||
QGraphicsPathItem(parent),
|
QGraphicsPathItem(parent),
|
||||||
m_dialog(),
|
|
||||||
m_sceneDetails(scene),
|
m_sceneDetails(scene),
|
||||||
m_drawName(drawName),
|
m_drawName(drawName),
|
||||||
m_seamAllowance(new VNoBrushScalePathItem(this)),
|
m_seamAllowance(new VNoBrushScalePathItem(this)),
|
||||||
|
|
|
@ -34,21 +34,21 @@
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include <QGraphicsPathItem>
|
#include <QGraphicsPathItem>
|
||||||
|
|
||||||
#include "vabstracttool.h"
|
#include "vinteractivetool.h"
|
||||||
#include "../vwidgets/vtextgraphicsitem.h"
|
#include "../vwidgets/vtextgraphicsitem.h"
|
||||||
#include "../vwidgets/vgrainlineitem.h"
|
#include "../vwidgets/vgrainlineitem.h"
|
||||||
|
|
||||||
class DialogTool;
|
class DialogTool;
|
||||||
class VNoBrushScalePathItem;
|
class VNoBrushScalePathItem;
|
||||||
|
|
||||||
class VToolSeamAllowance : public VAbstractTool, public QGraphicsPathItem
|
class VToolSeamAllowance : public VInteractiveTool, public QGraphicsPathItem
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
virtual ~VToolSeamAllowance();
|
virtual ~VToolSeamAllowance() Q_DECL_EQ_DEFAULT;
|
||||||
|
|
||||||
static VToolSeamAllowance* Create(DialogTool *dialog, VMainGraphicsScene *scene, VAbstractPattern *doc,
|
static VToolSeamAllowance* Create(QSharedPointer<DialogTool> dialog, VMainGraphicsScene *scene,
|
||||||
VContainer *data);
|
VAbstractPattern *doc, VContainer *data);
|
||||||
static VToolSeamAllowance* Create(quint32 id, VPiece newPiece, QString &width, VMainGraphicsScene *scene,
|
static VToolSeamAllowance* Create(quint32 id, VPiece newPiece, QString &width, VMainGraphicsScene *scene,
|
||||||
VAbstractPattern *doc, VContainer *data, const Document &parse,
|
VAbstractPattern *doc, VContainer *data, const Document &parse,
|
||||||
const Source &typeCreation, const QString &drawName = QString());
|
const Source &typeCreation, const QString &drawName = QString());
|
||||||
|
@ -74,7 +74,6 @@ public:
|
||||||
static const QString AttrBottomPin;
|
static const QString AttrBottomPin;
|
||||||
|
|
||||||
void Remove(bool ask);
|
void Remove(bool ask);
|
||||||
void DialogLinkDestroy();
|
|
||||||
|
|
||||||
static void InsertNode(VPieceNode node, quint32 pieceId, VMainGraphicsScene *scene, VContainer *data,
|
static void InsertNode(VPieceNode node, quint32 pieceId, VMainGraphicsScene *scene, VContainer *data,
|
||||||
VAbstractPattern *doc);
|
VAbstractPattern *doc);
|
||||||
|
@ -96,8 +95,6 @@ public:
|
||||||
virtual void GroupVisibility(quint32 object, bool visible) Q_DECL_OVERRIDE;
|
virtual void GroupVisibility(quint32 object, bool visible) Q_DECL_OVERRIDE;
|
||||||
public slots:
|
public slots:
|
||||||
virtual void FullUpdateFromFile () Q_DECL_OVERRIDE;
|
virtual void FullUpdateFromFile () Q_DECL_OVERRIDE;
|
||||||
virtual void FullUpdateFromGuiOk(int result);
|
|
||||||
void FullUpdateFromGuiApply();
|
|
||||||
void EnableToolMove(bool move);
|
void EnableToolMove(bool move);
|
||||||
virtual void AllowHover(bool enabled) Q_DECL_OVERRIDE;
|
virtual void AllowHover(bool enabled) Q_DECL_OVERRIDE;
|
||||||
virtual void AllowSelecting(bool enabled) Q_DECL_OVERRIDE;
|
virtual void AllowSelecting(bool enabled) Q_DECL_OVERRIDE;
|
||||||
|
@ -134,13 +131,12 @@ protected:
|
||||||
virtual void SetVisualization() Q_DECL_OVERRIDE {}
|
virtual void SetVisualization() Q_DECL_OVERRIDE {}
|
||||||
virtual void DeleteTool(bool ask = true) Q_DECL_OVERRIDE;
|
virtual void DeleteTool(bool ask = true) Q_DECL_OVERRIDE;
|
||||||
virtual void ToolCreation(const Source &typeCreation) Q_DECL_OVERRIDE;
|
virtual void ToolCreation(const Source &typeCreation) Q_DECL_OVERRIDE;
|
||||||
|
virtual void SetDialog() Q_DECL_FINAL;
|
||||||
|
virtual void SaveDialogChange() Q_DECL_FINAL;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Q_DISABLE_COPY(VToolSeamAllowance)
|
Q_DISABLE_COPY(VToolSeamAllowance)
|
||||||
|
|
||||||
/** @brief dialog dialog options. */
|
|
||||||
QPointer<DialogTool> m_dialog;
|
|
||||||
|
|
||||||
/** @brief sceneDetails pointer to the scene. */
|
/** @brief sceneDetails pointer to the scene. */
|
||||||
VMainGraphicsScene *m_sceneDetails;
|
VMainGraphicsScene *m_sceneDetails;
|
||||||
QString m_drawName;
|
QString m_drawName;
|
||||||
|
@ -150,14 +146,12 @@ private:
|
||||||
VTextGraphicsItem *m_patternInfo;
|
VTextGraphicsItem *m_patternInfo;
|
||||||
VGrainlineItem *m_grainLine;
|
VGrainlineItem *m_grainLine;
|
||||||
|
|
||||||
void SetDialog();
|
|
||||||
|
|
||||||
VToolSeamAllowance(VAbstractPattern *doc, VContainer *data, const quint32 &id, const Source &typeCreation,
|
VToolSeamAllowance(VAbstractPattern *doc, VContainer *data, const quint32 &id, const Source &typeCreation,
|
||||||
VMainGraphicsScene *scene, const QString &drawName, QGraphicsItem * parent = nullptr);
|
VMainGraphicsScene *scene, const QString &drawName, QGraphicsItem * parent = nullptr);
|
||||||
|
|
||||||
void UpdateExcludeState();
|
void UpdateExcludeState();
|
||||||
void RefreshGeometry();
|
void RefreshGeometry();
|
||||||
void SaveDialogChange();
|
|
||||||
VPieceItem::MoveTypes FindLabelGeometry(const VPatternLabelData &labelData, qreal &rotationAngle, qreal &labelWidth,
|
VPieceItem::MoveTypes FindLabelGeometry(const VPatternLabelData &labelData, qreal &rotationAngle, qreal &labelWidth,
|
||||||
qreal &labelHeight, QPointF &pos);
|
qreal &labelHeight, QPointF &pos);
|
||||||
VPieceItem::MoveTypes FindGrainlineGeometry(const VGrainlineData &geom, qreal &length, qreal &rotationAngle,
|
VPieceItem::MoveTypes FindGrainlineGeometry(const VGrainlineData &geom, qreal &length, qreal &rotationAngle,
|
||||||
|
|
|
@ -1437,12 +1437,12 @@ void VToolUnionDetails::GroupVisibility(quint32 object, bool visible)
|
||||||
* @param doc dom document container.
|
* @param doc dom document container.
|
||||||
* @param data container with variables.
|
* @param data container with variables.
|
||||||
*/
|
*/
|
||||||
VToolUnionDetails* VToolUnionDetails::Create(DialogTool *dialog, VMainGraphicsScene *scene, VAbstractPattern *doc,
|
VToolUnionDetails* VToolUnionDetails::Create(QSharedPointer<DialogTool> dialog, VMainGraphicsScene *scene,
|
||||||
VContainer *data)
|
VAbstractPattern *doc, VContainer *data)
|
||||||
{
|
{
|
||||||
SCASSERT(dialog != nullptr)
|
SCASSERT(not dialog.isNull())
|
||||||
const DialogUnionDetails *dialogTool = qobject_cast<DialogUnionDetails*>(dialog);
|
QSharedPointer<DialogUnionDetails> dialogTool = dialog.objectCast<DialogUnionDetails>();
|
||||||
SCASSERT(dialogTool != nullptr)
|
SCASSERT(not dialogTool.isNull())
|
||||||
|
|
||||||
VToolUnionDetailsInitData initData;
|
VToolUnionDetailsInitData initData;
|
||||||
initData.d1id = dialogTool->getD1();
|
initData.d1id = dialogTool->getD1();
|
||||||
|
|
|
@ -85,8 +85,8 @@ public:
|
||||||
* @brief setDialog set dialog when user want change tool option.
|
* @brief setDialog set dialog when user want change tool option.
|
||||||
*/
|
*/
|
||||||
virtual void setDialog() {}
|
virtual void setDialog() {}
|
||||||
static VToolUnionDetails *Create(DialogTool *dialog, VMainGraphicsScene *scene, VAbstractPattern *doc,
|
static VToolUnionDetails *Create(QSharedPointer<DialogTool> dialog, VMainGraphicsScene *scene,
|
||||||
VContainer *data);
|
VAbstractPattern *doc, VContainer *data);
|
||||||
static VToolUnionDetails *Create(const quint32 _id, const VToolUnionDetailsInitData &initData);
|
static VToolUnionDetails *Create(const quint32 _id, const VToolUnionDetailsInitData &initData);
|
||||||
|
|
||||||
static const QString ToolType;
|
static const QString ToolType;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user