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();
|
||||
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 "ui_dialogseamallowance.h"
|
||||
#include "../vpatterndb/vpiecenode.h"
|
||||
#include "visualization/path/vistoolpiece.h"
|
||||
|
||||
#include <QBuffer>
|
||||
#include <QMenu>
|
||||
|
@ -51,6 +52,8 @@ DialogSeamAllowance::DialogSeamAllowance(const VContainer *data, const quint32 &
|
|||
|
||||
ui->listWidget->setContextMenuPolicy(Qt::CustomContextMenu);
|
||||
connect(ui->listWidget, &QListWidget::customContextMenuRequested, this, &DialogSeamAllowance::ShowContextMenu);
|
||||
|
||||
vis = new VisToolPiece(data);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
|
@ -122,7 +125,34 @@ void DialogSeamAllowance::ChosenObject(quint32 id, const SceneObject &type)
|
|||
}
|
||||
|
||||
ValidObjects(MainPathIsValid());
|
||||
show();
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
|
|
|
@ -52,6 +52,7 @@ public:
|
|||
|
||||
public slots:
|
||||
virtual void ChosenObject(quint32 id, const SceneObject &type) Q_DECL_OVERRIDE;
|
||||
virtual void ShowDialog(bool click) Q_DECL_OVERRIDE;
|
||||
|
||||
protected:
|
||||
/** @brief SaveData Put dialog data in local variables */
|
||||
|
|
|
@ -53,9 +53,6 @@ void VisToolPiece::RefreshGeometry()
|
|||
QGraphicsEllipseItem *point = GetPoint(static_cast<quint32>(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