Commit c20d17d8 authored by Dirk Wilden's avatar Dirk Wilden

last things to complete the move to toolbar actions

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@5170 383ad7c9-94d9-4d36-a494-682f7c89f535
parent e20af68a
......@@ -64,27 +64,28 @@ void TopologyPlugin::pluginsInitialized() {
toolbar_ = new QToolBar("Topology");
QActionGroup* group = new QActionGroup(0);
QAction* act;
act = toolbar_->addAction( EDGE_FLIP_POPUP );
act->setCheckable( true);
act->setActionGroup(group);
act = toolbar_->addAction( EDGE_SPLIT_POPUP );
act->setCheckable( true);
act->setActionGroup(group);
act = toolbar_->addAction( EDGE_COLLAPSE_POPUP );
act->setCheckable( true);
act->setActionGroup(group);
QString iconPath = OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator();
edgeFlipAction_ = toolbar_->addAction( QIcon(iconPath + "topology-edgeFlip.png"), EDGE_FLIP_POPUP );
edgeFlipAction_->setCheckable( true);
edgeFlipAction_->setActionGroup(group);
edgeSplitAction_ = toolbar_->addAction( QIcon(iconPath + "topology-edgeSplit.png"), EDGE_SPLIT_POPUP );
edgeSplitAction_->setCheckable( true);
edgeSplitAction_->setActionGroup(group);
edgeCollapseAction_ = toolbar_->addAction( QIcon(iconPath + "topology-edgeCollapse.png"), EDGE_COLLAPSE_POPUP );
edgeCollapseAction_->setCheckable( true);
edgeCollapseAction_->setActionGroup(group);
toolbar_->addSeparator();
act = toolbar_->addAction( FACE_ADD_POPUP );
act->setCheckable( true);
act->setActionGroup(group);
act = toolbar_->addAction( FACE_SPLIT_POPUP );
act->setCheckable( true);
act->setActionGroup(group);
act = toolbar_->addAction( FACE_DELETE_POPUP );
act->setCheckable( true);
act->setActionGroup(group);
faceAddAction_ = toolbar_->addAction( QIcon(iconPath + "topology-addFace.png"), FACE_ADD_POPUP );
faceAddAction_->setCheckable( true);
faceAddAction_->setActionGroup(group);
faceDeleteAction_ = toolbar_->addAction( QIcon(iconPath + "topology-deleteFace.png"), FACE_DELETE_POPUP );
faceDeleteAction_->setCheckable( true);
faceDeleteAction_->setActionGroup(group);
faceSplitAction_ = toolbar_->addAction( QIcon(iconPath + "topology-splitFace.png"), FACE_SPLIT_POPUP );
faceSplitAction_->setCheckable( true);
faceSplitAction_->setActionGroup(group);
group->setExclusive(true);
......@@ -119,6 +120,22 @@ void TopologyPlugin::toolBarTriggered(QAction* _action){
}
//******************************************************************************
/** \brief Toggle actions when the PickMode changes
*
* @param _mode the new PickMode
*/
void TopologyPlugin::slotPickModeChanged( const std::string& _mode) {
edgeFlipAction_->setChecked( _mode == EDGE_FLIP_POPUP );
edgeSplitAction_->setChecked( _mode == EDGE_SPLIT_POPUP );
edgeCollapseAction_->setChecked( _mode == EDGE_COLLAPSE_POPUP );
faceAddAction_->setChecked( _mode == FACE_ADD_POPUP );
faceDeleteAction_->setChecked( _mode == FACE_DELETE_POPUP );
faceSplitAction_->setChecked( _mode == FACE_SPLIT_POPUP );
}
//******************************************************************************
/** \brief this is called when a mouse event occurred
......
......@@ -77,6 +77,9 @@ class TopologyPlugin : public QObject, BaseInterface , MouseInterface, KeyInterf
// BaseInterface
void pluginsInitialized();
//PickingInterface
void slotPickModeChanged( const std::string& _mode);
// MouseInterface
void slotMouseEvent( QMouseEvent* _event );
......@@ -123,6 +126,14 @@ class TopologyPlugin : public QObject, BaseInterface , MouseInterface, KeyInterf
QToolBar* toolbar_;
QAction* edgeFlipAction_;
QAction* edgeSplitAction_;
QAction* edgeCollapseAction_;
QAction* faceAddAction_;
QAction* faceDeleteAction_;
QAction* faceSplitAction_;
public slots:
QString version() { return QString("1.0"); };
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment