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() { ...@@ -64,27 +64,28 @@ void TopologyPlugin::pluginsInitialized() {
toolbar_ = new QToolBar("Topology"); toolbar_ = new QToolBar("Topology");
QActionGroup* group = new QActionGroup(0); QActionGroup* group = new QActionGroup(0);
QAction* act;
QString iconPath = OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator();
act = toolbar_->addAction( EDGE_FLIP_POPUP );
act->setCheckable( true); edgeFlipAction_ = toolbar_->addAction( QIcon(iconPath + "topology-edgeFlip.png"), EDGE_FLIP_POPUP );
act->setActionGroup(group); edgeFlipAction_->setCheckable( true);
act = toolbar_->addAction( EDGE_SPLIT_POPUP ); edgeFlipAction_->setActionGroup(group);
act->setCheckable( true); edgeSplitAction_ = toolbar_->addAction( QIcon(iconPath + "topology-edgeSplit.png"), EDGE_SPLIT_POPUP );
act->setActionGroup(group); edgeSplitAction_->setCheckable( true);
act = toolbar_->addAction( EDGE_COLLAPSE_POPUP ); edgeSplitAction_->setActionGroup(group);
act->setCheckable( true); edgeCollapseAction_ = toolbar_->addAction( QIcon(iconPath + "topology-edgeCollapse.png"), EDGE_COLLAPSE_POPUP );
act->setActionGroup(group); edgeCollapseAction_->setCheckable( true);
edgeCollapseAction_->setActionGroup(group);
toolbar_->addSeparator(); toolbar_->addSeparator();
act = toolbar_->addAction( FACE_ADD_POPUP ); faceAddAction_ = toolbar_->addAction( QIcon(iconPath + "topology-addFace.png"), FACE_ADD_POPUP );
act->setCheckable( true); faceAddAction_->setCheckable( true);
act->setActionGroup(group); faceAddAction_->setActionGroup(group);
act = toolbar_->addAction( FACE_SPLIT_POPUP ); faceDeleteAction_ = toolbar_->addAction( QIcon(iconPath + "topology-deleteFace.png"), FACE_DELETE_POPUP );
act->setCheckable( true); faceDeleteAction_->setCheckable( true);
act->setActionGroup(group); faceDeleteAction_->setActionGroup(group);
act = toolbar_->addAction( FACE_DELETE_POPUP ); faceSplitAction_ = toolbar_->addAction( QIcon(iconPath + "topology-splitFace.png"), FACE_SPLIT_POPUP );
act->setCheckable( true); faceSplitAction_->setCheckable( true);
act->setActionGroup(group); faceSplitAction_->setActionGroup(group);
group->setExclusive(true); group->setExclusive(true);
...@@ -119,6 +120,22 @@ void TopologyPlugin::toolBarTriggered(QAction* _action){ ...@@ -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 /** \brief this is called when a mouse event occurred
......
...@@ -77,6 +77,9 @@ class TopologyPlugin : public QObject, BaseInterface , MouseInterface, KeyInterf ...@@ -77,6 +77,9 @@ class TopologyPlugin : public QObject, BaseInterface , MouseInterface, KeyInterf
// BaseInterface // BaseInterface
void pluginsInitialized(); void pluginsInitialized();
//PickingInterface
void slotPickModeChanged( const std::string& _mode);
// MouseInterface // MouseInterface
void slotMouseEvent( QMouseEvent* _event ); void slotMouseEvent( QMouseEvent* _event );
...@@ -123,6 +126,14 @@ class TopologyPlugin : public QObject, BaseInterface , MouseInterface, KeyInterf ...@@ -123,6 +126,14 @@ class TopologyPlugin : public QObject, BaseInterface , MouseInterface, KeyInterf
QToolBar* toolbar_; QToolBar* toolbar_;
QAction* edgeFlipAction_;
QAction* edgeSplitAction_;
QAction* edgeCollapseAction_;
QAction* faceAddAction_;
QAction* faceDeleteAction_;
QAction* faceSplitAction_;
public slots: public slots:
QString version() { return QString("1.0"); }; 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