From 09bfe843427238d3051cb3d94f571e9d3bb0ea9c Mon Sep 17 00:00:00 2001 From: apo Date: Thu, 8 Sep 2005 07:38:07 +0000 Subject: [PATCH] To introduce Gauss Points selection for VVTK viewer --- src/VISUGUI/VISUM_images.po | 5 +++- src/VISUGUI/VISUM_msg_en.po | 19 +++++++------ src/VVTK/VVTK_ViewWindow.cxx | 52 +++++++++++++++++++++++++++--------- src/VVTK/VVTK_ViewWindow.h | 3 ++- 4 files changed, 56 insertions(+), 23 deletions(-) diff --git a/src/VISUGUI/VISUM_images.po b/src/VISUGUI/VISUM_images.po index 6f6a2892..1bde3ccc 100644 --- a/src/VISUGUI/VISUM_images.po +++ b/src/VISUGUI/VISUM_images.po @@ -33,6 +33,9 @@ msgstr "" "Content-Type: text/plain; charset=iso-8859-1\n" -msgid "ICON_VVTK_SWITCH" +msgid "ICON_VVTK_INTERACTOR_STYLE_SWITCH" msgstr "Visu_vvtk_switch.png" +msgid "ICON_VVTK_SELECTION_MODE_SWITCH" +msgstr "Visu_points.png" + diff --git a/src/VISUGUI/VISUM_msg_en.po b/src/VISUGUI/VISUM_msg_en.po index 35a08e1b..76e0e9c2 100644 --- a/src/VISUGUI/VISUM_msg_en.po +++ b/src/VISUGUI/VISUM_msg_en.po @@ -10,7 +10,7 @@ msgid "VisuGUI_Module::MEN_GAUSS" msgstr "Gauss" msgid "VisuGUI_Module::MEN_GAUSS_NEW_VIEWER" -msgstr "GAUSS Viewer" +msgstr "Points view" msgid "VisuGUI_Module::VISU_GAUSS_PREF_TAB_TLT" msgstr "Gauss Points" @@ -102,14 +102,17 @@ msgstr "Gauss Points Properties" msgid "VVTK_ViewManager::VTK_VIEW_TITLE" msgstr "VISU scene:%1 - viewer:%2" -msgid "VVTK_ViewWindow::MNU_VVTK_SWITCH" -msgstr "GAUSS/VTK Viewer" +msgid "VVTK_ViewWindow::MNU_VVTK_INTERACTOR_STYLE_SWITCH" +msgstr "Interaction Style Switch" -msgid "VVTK_ViewWindow::DSC_VVTK_SWITCH" -msgstr "Switch to GAUSS/VTK viewer" - -msgid "VVTK_ViewWindow::LBL_TOOLBAR_LABEL" -msgstr "GAUSS viewer tools" +msgid "VVTK_ViewWindow::DSC_VVTK_INTERACTOR_STYLE_SWITCH" +msgstr "Interaction Style Switch" +msgid "VVTK_ViewWindow::MNU_VVTK_SELECTION_MODE_SWITCH" +msgstr "Selection Mode Switch" +msgid "VVTK_ViewWindow::DSC_VVTK_SELECTION_MODE_SWITCH" +msgstr "Selection Mode Switch" +msgid "VVTK_ViewWindow::LBL_TOOLBAR_LABEL" +msgstr "GAUSS viewer tools" \ No newline at end of file diff --git a/src/VVTK/VVTK_ViewWindow.cxx b/src/VVTK/VVTK_ViewWindow.cxx index 81bdb707..b7caabad 100755 --- a/src/VVTK/VVTK_ViewWindow.cxx +++ b/src/VVTK/VVTK_ViewWindow.cxx @@ -45,15 +45,34 @@ VVTK_ViewWindow myToolBar->setCloseMode(QDockWindow::Undocked); myToolBar->setLabel(tr("LBL_TOOLBAR_LABEL")); - // SVTK / VVTK switcher action - QtxAction* aAction = new QtxAction(tr("MNU_VVTK_SWITCH"), - aResourceMgr->loadPixmap( "VISU", tr( "ICON_VVTK_SWITCH" ) ), - tr( "MNU_VVTK_SWITCH" ), 0, this, "vvtk/svtk", true); - aAction->setToggleAction(true); // pressed by default - aAction->toggle(); - aAction->setStatusTip(tr("DSC_VVTK_SWITCH")); - connect(aAction, SIGNAL(toggled(bool)), this, SLOT(onSwitchIS(bool))); - aAction->addTo( myToolBar ); + QPixmap aPixmap; + QtxAction* anAction; + aPixmap = aResourceMgr->loadPixmap( "VISU", tr( "ICON_VVTK_INTERACTOR_STYLE_SWITCH" ) ); + anAction = new QtxAction(tr("MNU_VVTK_INTERACTOR_STYLE_SWITCH"), + aPixmap, + tr( "MNU_VVTK_INTERACTOR_STYLE_SWITCH" ), + 0, + this, + "VVTK/SVTK StyleSwitch", + true); + anAction->toggle(); + anAction->setToggleAction(true); + anAction->setStatusTip(tr("DSC_VVTK_INTERACTOR_STYLE_SWITCH")); + connect(anAction, SIGNAL(toggled(bool)), this, SLOT(OnInteractorStyleSwitch(bool))); + anAction->addTo( myToolBar ); + + aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_VVTK_SELECTION_MODE_SWITCH")); + anAction = new QtxAction(tr("MNU_VVTK_SELECTION_MODE_SWITCH"), + aPixmap, + tr( "MNU_VVTK_SELECTION_MODE_SWITCH" ), + 0, + this, + "VVTK/SVTK SelectionSwitch", + true); + anAction->setToggleAction(true); + anAction->setStatusTip(tr("DSC_VVTK_SELECTION_MODE_SWITCH")); + connect(anAction, SIGNAL(toggled(bool)), this, SLOT(OnSelectionModeSwitch(bool))); + anAction->addTo( myToolBar ); SVTK_ViewWindow::Initialize(myView,theModel); } @@ -62,20 +81,27 @@ VVTK_ViewWindow //---------------------------------------------------------------------------- VVTK_ViewWindow ::~VVTK_ViewWindow() -{ -} +{} //---------------------------------------------------------------------------- void VVTK_ViewWindow -::onSwitchIS(bool isVVTK) +::OnInteractorStyleSwitch(bool theIsVVTKStyle) { // default interactor style which is pushed in this view window constructor // is VVTK. If it is a current interactor style -- push SVTK "above" it. // if SVTK is a current one - pop it (remove from stack), below it there MUST BE // (logically) a VVTK interactor style. - if ( isVVTK ) + if ( theIsVVTKStyle ) getView()->PopInteractorStyle(); else getView()->PushInteractorStyle( SVTK_InteractorStyle::New() ); } + +void +VVTK_ViewWindow +::OnSelectionModeSwitch(bool theIsSelectionOn) +{ + Selection_Mode aMode = theIsSelectionOn? NodeSelection: ActorSelection; + getView()->SetSelectionMode(aMode); +} diff --git a/src/VVTK/VVTK_ViewWindow.h b/src/VVTK/VVTK_ViewWindow.h index a89c5a83..a9880860 100755 --- a/src/VVTK/VVTK_ViewWindow.h +++ b/src/VVTK/VVTK_ViewWindow.h @@ -26,7 +26,8 @@ public: Initialize(SVTK_ViewModelBase* theModel); protected slots: - void onSwitchIS(bool isVVTK); + void OnInteractorStyleSwitch(bool theIsVVTKStyle); + void OnSelectionModeSwitch(bool theIsSelectionOn); private: QToolBar* myToolBar; -- 2.39.2