The visualization connected to tool dialog.

--HG--
branch : feature
This commit is contained in:
Roman Telezhynskyi 2016-11-05 12:49:20 +02:00
parent 65a38141de
commit bf306f6101
4 changed files with 33 additions and 5 deletions

View File

@ -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);
}
//---------------------------------------------------------------------------------------------------------------------

View File

@ -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();
}
}
//---------------------------------------------------------------------------------------------------------------------

View File

@ -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 */

View File

@ -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");
}
}