The visualization connected to tool dialog.
--HG-- branch : feature
This commit is contained in:
parent
65a38141de
commit
bf306f6101
|
@ -936,7 +936,7 @@ void MainWindow::ToolDetail(bool checked)
|
||||||
{
|
{
|
||||||
ToolSelectAllDrawObjects();
|
ToolSelectAllDrawObjects();
|
||||||
SetToolButton<DialogSeamAllowance>(checked, Tool::Detail, "://cursor/new_detail_cursor.png",
|
SetToolButton<DialogSeamAllowance>(checked, Tool::Detail, "://cursor/new_detail_cursor.png",
|
||||||
tr("Select points, arcs, curves clockwise."), &MainWindow::ClosedDialogDetail);
|
tr("Select main path objects clockwise."), &MainWindow::ClosedDialogDetail);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
|
@ -29,6 +29,7 @@
|
||||||
#include "dialogseamallowance.h"
|
#include "dialogseamallowance.h"
|
||||||
#include "ui_dialogseamallowance.h"
|
#include "ui_dialogseamallowance.h"
|
||||||
#include "../vpatterndb/vpiecenode.h"
|
#include "../vpatterndb/vpiecenode.h"
|
||||||
|
#include "visualization/path/vistoolpiece.h"
|
||||||
|
|
||||||
#include <QBuffer>
|
#include <QBuffer>
|
||||||
#include <QMenu>
|
#include <QMenu>
|
||||||
|
@ -51,6 +52,8 @@ DialogSeamAllowance::DialogSeamAllowance(const VContainer *data, const quint32 &
|
||||||
|
|
||||||
ui->listWidget->setContextMenuPolicy(Qt::CustomContextMenu);
|
ui->listWidget->setContextMenuPolicy(Qt::CustomContextMenu);
|
||||||
connect(ui->listWidget, &QListWidget::customContextMenuRequested, this, &DialogSeamAllowance::ShowContextMenu);
|
connect(ui->listWidget, &QListWidget::customContextMenuRequested, this, &DialogSeamAllowance::ShowContextMenu);
|
||||||
|
|
||||||
|
vis = new VisToolPiece(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
@ -122,8 +125,35 @@ void DialogSeamAllowance::ChosenObject(quint32 id, const SceneObject &type)
|
||||||
}
|
}
|
||||||
|
|
||||||
ValidObjects(MainPathIsValid());
|
ValidObjects(MainPathIsValid());
|
||||||
|
|
||||||
|
auto visPath = qobject_cast<VisToolPiece *>(vis);
|
||||||
|
SCASSERT(visPath != nullptr);
|
||||||
|
const VPiece p = CreatePiece();
|
||||||
|
visPath->SetPiece(p);
|
||||||
|
|
||||||
|
if (p.CountNode() == 1)
|
||||||
|
{
|
||||||
|
emit ToolTip(tr("Select main path objects clockwise, <b>Shift</b> - reverse direction curve, "
|
||||||
|
"<b>Enter</b> - finish creation"));
|
||||||
|
|
||||||
|
visPath->VisualMode(NULL_ID);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
visPath->RefreshGeometry();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
void DialogSeamAllowance::ShowDialog(bool click)
|
||||||
|
{
|
||||||
|
if (click == false)
|
||||||
|
{
|
||||||
|
emit ToolTip("");
|
||||||
|
setModal(true);
|
||||||
show();
|
show();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void DialogSeamAllowance::SaveData()
|
void DialogSeamAllowance::SaveData()
|
||||||
|
|
|
@ -52,6 +52,7 @@ public:
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
virtual void ChosenObject(quint32 id, const SceneObject &type) Q_DECL_OVERRIDE;
|
virtual void ChosenObject(quint32 id, const SceneObject &type) Q_DECL_OVERRIDE;
|
||||||
|
virtual void ShowDialog(bool click) Q_DECL_OVERRIDE;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
/** @brief SaveData Put dialog data in local variables */
|
/** @brief SaveData Put dialog data in local variables */
|
||||||
|
|
|
@ -53,9 +53,6 @@ void VisToolPiece::RefreshGeometry()
|
||||||
QGraphicsEllipseItem *point = GetPoint(static_cast<quint32>(i), supportColor);
|
QGraphicsEllipseItem *point = GetPoint(static_cast<quint32>(i), supportColor);
|
||||||
DrawPoint(point, nodes.at(i), supportColor);
|
DrawPoint(point, nodes.at(i), supportColor);
|
||||||
}
|
}
|
||||||
|
|
||||||
Visualization::toolTip = tr("Select main path objects, <b>Shift</b> - reverse direction curves, "
|
|
||||||
"<b>Enter</b> - finish creation");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user