diff --git a/Polyhedron/demo/Polyhedron/Polyhedron_demo_mean_curvature_flow_skeleton_plugin.cpp b/Polyhedron/demo/Polyhedron/Polyhedron_demo_mean_curvature_flow_skeleton_plugin.cpp index b90b84d72fb..d65b8b4777c 100644 --- a/Polyhedron/demo/Polyhedron/Polyhedron_demo_mean_curvature_flow_skeleton_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Polyhedron_demo_mean_curvature_flow_skeleton_plugin.cpp @@ -123,6 +123,36 @@ public: actionConvert_to_medial_skeleton->setObjectName("actionConvert_to_medial_skeleton"); Polyhedron_demo_plugin_helper::init(mainWindow, scene_interface); + + dockWidget = new QDockWidget(mw); + dockWidget->setVisible(false); + ui = new Ui::Mean_curvature_flow_skeleton_plugin(); + ui->setupUi(dockWidget); + dockWidget->setFeatures(QDockWidget::DockWidgetMovable + | QDockWidget::DockWidgetFloatable + | QDockWidget::DockWidgetClosable); + dockWidget->setWindowTitle("Mean Curvature Flow Skeleton"); + add_dock_widget(dockWidget); + + connect(ui->pushButton_contract, SIGNAL(clicked()), + this, SLOT(on_actionContract())); + connect(ui->pushButton_collapse, SIGNAL(clicked()), + this, SLOT(on_actionCollapse())); + connect(ui->pushButton_split, SIGNAL(clicked()), + this, SLOT(on_actionSplit())); + connect(ui->pushButton_degeneracy, SIGNAL(clicked()), + this, SLOT(on_actionDegeneracy())); + connect(ui->pushButton_run, SIGNAL(clicked()), + this, SLOT(on_actionRun())); + connect(ui->pushButton_skeletonize, SIGNAL(clicked()), + this, SLOT(on_actionSkeletonize())); + connect(ui->pushButton_converge, SIGNAL(clicked()), + this, SLOT(on_actionConverge())); + connect(dynamic_cast(scene), SIGNAL(updated_bbox()), + this, SLOT(on_actionUpdateBBox())); + connect(ui->pushButton_segment, SIGNAL(clicked()), + this, SLOT(on_actionSegment())); + } QList actions() const { @@ -347,6 +377,9 @@ private: void Polyhedron_demo_mean_curvature_flow_skeleton_plugin::on_actionMCFSkeleton_triggered() { + dockWidget->show(); + dockWidget->raise(); + const Scene_interface::Item_id index = scene->mainSelectionIndex(); Scene_polyhedron_item* item = @@ -358,36 +391,6 @@ void Polyhedron_demo_mean_curvature_flow_skeleton_plugin::on_actionMCFSkeleton_t if(!pMesh) return; - dockWidget = new QDockWidget(mw); - ui = new Ui::Mean_curvature_flow_skeleton_plugin(); - ui->setupUi(dockWidget); - dockWidget->setFeatures(QDockWidget::DockWidgetMovable - | QDockWidget::DockWidgetFloatable - | QDockWidget::DockWidgetClosable); - dockWidget->setWindowTitle("Mean Curvature Flow Skeleton"); - mw->addDockWidget(Qt::LeftDockWidgetArea, dockWidget); - dockWidget->show(); - dockWidget->raise(); - - connect(ui->pushButton_contract, SIGNAL(clicked()), - this, SLOT(on_actionContract())); - connect(ui->pushButton_collapse, SIGNAL(clicked()), - this, SLOT(on_actionCollapse())); - connect(ui->pushButton_split, SIGNAL(clicked()), - this, SLOT(on_actionSplit())); - connect(ui->pushButton_degeneracy, SIGNAL(clicked()), - this, SLOT(on_actionDegeneracy())); - connect(ui->pushButton_run, SIGNAL(clicked()), - this, SLOT(on_actionRun())); - connect(ui->pushButton_skeletonize, SIGNAL(clicked()), - this, SLOT(on_actionSkeletonize())); - connect(ui->pushButton_converge, SIGNAL(clicked()), - this, SLOT(on_actionConverge())); - connect(dynamic_cast(scene), SIGNAL(updated_bbox()), - this, SLOT(on_actionUpdateBBox())); - connect(ui->pushButton_segment, SIGNAL(clicked()), - this, SLOT(on_actionSegment())); - double diag = scene->len_diagonal(); init_ui(diag);