Skip to content

Commit

Permalink
+ improve performance of editing fillet feature (patch from chrisf)
Browse files Browse the repository at this point in the history
  • Loading branch information
wwmayer committed Apr 24, 2014
1 parent a31ce8e commit 96f3666
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/Mod/Part/Gui/DlgFilletEdges.cpp
Expand Up @@ -42,6 +42,7 @@
# include <QVBoxLayout>
# include <QItemSelection>
# include <QItemSelectionModel>
# include <QTimer>
# include <boost/signal.hpp>
# include <boost/bind.hpp>
# include <Inventor/actions/SoSearchAction.h>
Expand Down Expand Up @@ -181,6 +182,7 @@ namespace PartGui {
App::DocumentObject* object;
EdgeFaceSelection* selection;
Part::FilletBase* fillet;
QTimer* highlighttimer;
FilletType filletType;
std::vector<int> edge_ids;
TopTools_IndexedMapOfShape all_edges;
Expand Down Expand Up @@ -217,6 +219,12 @@ DlgFilletEdges::DlgFilletEdges(FilletType type, Part::FilletBase* fillet, QWidge
this, SLOT(toggleCheckState(const QModelIndex&)));
model->insertColumns(0,3);

// timer for highlighting
d->highlighttimer = new QTimer(this);
d->highlighttimer->setSingleShot(true);
connect(d->highlighttimer,SIGNAL(timeout()),
this, SLOT(onHighlightEdges()));

d->filletType = type;
if (d->filletType == DlgFilletEdges::CHAMFER) {
ui->labelRadius->setText(tr("Length:"));
Expand Down Expand Up @@ -282,7 +290,7 @@ void DlgFilletEdges::onSelectionChanged(const Gui::SelectionChanges& msg)

if (msg.Type != Gui::SelectionChanges::SetPreselect &&
msg.Type != Gui::SelectionChanges::RmvPreselect)
QTimer::singleShot(20, this, SLOT(onHighlightEdges()));
d->highlighttimer->start(20);
}

void DlgFilletEdges::onHighlightEdges()
Expand Down

0 comments on commit 96f3666

Please sign in to comment.