From: asv Date: Thu, 18 Aug 2005 07:15:34 +0000 (+0000) Subject: Implementation of preferences in Visu_Module X-Git-Tag: BR-D5-38-2003_D2005-12-09~112 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=d89fe2f2092327ab228df8f5fdba82bf09a8fc05;p=modules%2Fvisu.git Implementation of preferences in Visu_Module --- diff --git a/src/VISUGUI/VISUM_msg_en.po b/src/VISUGUI/VISUM_msg_en.po index e7171a98..62899b51 100644 --- a/src/VISUGUI/VISUM_msg_en.po +++ b/src/VISUGUI/VISUM_msg_en.po @@ -12,8 +12,86 @@ msgstr "Gauss" msgid "VisuGUI_Module::MEN_GAUSS_NEW_VIEWER" msgstr "New Viewer" +msgid "VisuGUI_Module::VISU_GAUSS_PREF_TAB_TLT" +msgstr "Gauss Points" + +msgid "VisuGUI_Module::VISU_MOUSE_PREF_GROUP_TLT" +msgstr "Mouse" + +msgid "VisuGUI_Module::VISU_MOUSE_PREF" +msgstr "Mouse behaviour" + +msgid "VisuGUI_Module::VISU_MOUSE_PREF_STANDARD" +msgstr "Salome standard controls" + +msgid "VisuGUI_Module::VISU_MOUSE_PREF_KEYBOARD_FREE" +msgstr "Keyboard free" + +msgid "VisuGUI_Module::VISU_KEYBOARD_PREF_GROUP_TTL" +msgstr "Keyboard" + +msgid "VisuGUI_Module::VISU_KEYBOARD_PREF" +msgstr "[+]/[-] Speed increment" + +msgid "VisuGUI_Module::VISU_SPACEMOUSE_PREF" +msgstr "Spacemouse" + +msgid "VisuGUI_Module::VISU_SPACEMOUSE_PREF_1" +msgstr "Decrease speed increment" + +msgid "VisuGUI_Module::VISU_SPACEMOUSE_PREF_2" +msgstr "Increase speed increment" + +msgid "VisuGUI_Module::VISU_SPACEMOUSE_PREF_3" +msgstr "Decrease Gauss points magnification" + +msgid "VisuGUI_Module::VISU_SPACEMOUSE_PREF_4" +msgstr "Increase Gauss points magnification" + +msgid "VisuGUI_Module::VISU_SPACEMOUSE_PREF_5" +msgstr "Dominant / combined switch" + +msgid "VisuGUI_Module::VISU_SPACEMOUSE_PREF_BTN_1" +msgstr "Button 1" + +msgid "VisuGUI_Module::VISU_SPACEMOUSE_PREF_BTN_2" +msgstr "Button 2" + +msgid "VisuGUI_Module::VISU_SPACEMOUSE_PREF_BTN_3" +msgstr "Button 3" + +msgid "VisuGUI_Module::VISU_SPACEMOUSE_PREF_BTN_4" +msgstr "Button 4" + +msgid "VisuGUI_Module::VISU_SPACEMOUSE_PREF_BTN_5" +msgstr "Button 5" + +msgid "VisuGUI_Module::VISU_SPACEMOUSE_PREF_BTN_6" +msgstr "Button 6" + +msgid "VisuGUI_Module::VISU_SPACEMOUSE_PREF_BTN_7" +msgstr "Button 7" + +msgid "VisuGUI_Module::VISU_SPACEMOUSE_PREF_BTN_8" +msgstr "Button 8" + +msgid "VisuGUI_Module::VISU_SPACEMOUSE_PREF_BTN_10" +msgstr "Button 10" + +msgid "VisuGUI_Module::VISU_SPACEMOUSE_PREF_BTN_11" +msgstr "Button 11" + +msgid "VisuGUI_Module::VISU_SPACEMOUSE_PREF_BTN_*" +msgstr "Button *" + +msgid "VisuGUI_Module::VISU_CAMERA_PREF_GROUP_TTL" +msgstr "Camera movements" + +msgid "VisuGUI_Module::VISU_CAMERA_MOVE_PREF" +msgstr "Number of steps between two positions" + msgid "VisuGUI_Module::MEN_GAUSS_CREATE_PRS" msgstr "Create Gauss Points" msgid "VVTK_ViewManager::VTK_VIEW_TITLE" -msgstr "VISU scene:%1 - viewer:%2" \ No newline at end of file +msgstr "VISU scene:%1 - viewer:%2" diff --git a/src/VISUGUI/VisuGUI_Module.cxx b/src/VISUGUI/VisuGUI_Module.cxx index 95abf331..01aff079 100644 --- a/src/VISUGUI/VisuGUI_Module.cxx +++ b/src/VISUGUI/VisuGUI_Module.cxx @@ -1,4 +1,4 @@ -// VISU VISUGUI : GUI of VISU component + // // Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS @@ -37,6 +37,7 @@ #include "SalomeApp_Application.h" #include "SalomeApp_SelectionMgr.h" #include "SalomeApp_VTKSelector.h" +#include "SalomeApp_Preferences.h" #include "VVTK_ViewManager.h" #include "VVTK_ViewWindow.h" @@ -205,6 +206,75 @@ VisuGUI_Module myViewerMap.erase(theViewManager); } +void +VisuGUI_Module +::createPreferences() +{ + VisuGUI::createPreferences(); + + int gaussTab = addPreference( tr( "VISU_GAUSS_PREF_TAB_TLT" ) ); + + int mouseGr = addPreference( tr( "VISU_MOUSE_PREF_GROUP_TLT" ), gaussTab ); + int mousePref = addPreference( tr( "VISU_MOUSE_PREF" ), mouseGr, SalomeApp_Preferences::Selector, "VISU", "mouse_behaviour" ); + QStringList values; + values.append( tr( "VISU_MOUSE_PREF_STANDARD" ) ); + values.append( tr( "VISU_MOUSE_PREF_KEYBOARD_FREE" ) ); + QValueList indices; + indices.append( 0 ); + indices.append( 1 ); + setPreferenceProperty( mousePref, "strings", values ); + setPreferenceProperty( mousePref, "indexes", indices ); + + int keybrdGr = addPreference( tr( "VISU_KEYBOARD_PREF_GROUP_TTL" ), gaussTab ); + int keybrdPref = addPreference( tr( "VISU_KEYBOARD_PREF" ), keybrdGr, SalomeApp_Preferences::IntSpin, "VISU", "speed_increment" ); + setPreferenceProperty( keybrdPref, "max", 1000 ); + + int spacemouseGr = addPreference( tr( "VISU_SPACEMOUSE_PREF" ), gaussTab ); + setPreferenceProperty( spacemouseGr, "columns", 1 ); + int spacemousePref1 = addPreference( tr( "VISU_SPACEMOUSE_PREF_1" ), spacemouseGr, SalomeApp_Preferences::Selector, "VISU", "spacemouse_func1_btn" ); //decrease_speed_increment + int spacemousePref2 = addPreference( tr( "VISU_SPACEMOUSE_PREF_2" ), spacemouseGr, SalomeApp_Preferences::Selector, "VISU", "spacemouse_func2_btn" ); //increase_speed_increment + int spacemousePref3 = addPreference( tr( "VISU_SPACEMOUSE_PREF_3" ), spacemouseGr, SalomeApp_Preferences::Selector, "VISU", "spacemouse_func3_btn" ); //decrease_gauss_point_magnification + int spacemousePref4 = addPreference( tr( "VISU_SPACEMOUSE_PREF_4" ), spacemouseGr, SalomeApp_Preferences::Selector, "VISU", "spacemouse_func4_btn" ); //increase_gauss_point_magnification + int spacemousePref5 = addPreference( tr( "VISU_SPACEMOUSE_PREF_5" ), spacemouseGr, SalomeApp_Preferences::Selector, "VISU", "spacemouse_func5_btn" ); //dominant_combined_switch + values.clear(); + values.append( tr( "VISU_SPACEMOUSE_PREF_BTN_1" ) ); + values.append( tr( "VISU_SPACEMOUSE_PREF_BTN_2" ) ); + values.append( tr( "VISU_SPACEMOUSE_PREF_BTN_3" ) ); + values.append( tr( "VISU_SPACEMOUSE_PREF_BTN_4" ) ); + values.append( tr( "VISU_SPACEMOUSE_PREF_BTN_5" ) ); + values.append( tr( "VISU_SPACEMOUSE_PREF_BTN_6" ) ); + values.append( tr( "VISU_SPACEMOUSE_PREF_BTN_7" ) ); + values.append( tr( "VISU_SPACEMOUSE_PREF_BTN_8" ) ); + values.append( tr( "VISU_SPACEMOUSE_PREF_BTN_*" ) ); + values.append( tr( "VISU_SPACEMOUSE_PREF_BTN_10" ) ); + values.append( tr( "VISU_SPACEMOUSE_PREF_BTN_11" ) ); + indices.clear(); + indices.append( 1 ); + indices.append( 2 ); + indices.append( 3 ); + indices.append( 4 ); + indices.append( 5 ); + indices.append( 6 ); + indices.append( 7 ); + indices.append( 8 ); + indices.append( 9 ); // == button_* + indices.append( 10 ); + indices.append( 11 ); + setPreferenceProperty( spacemousePref1, "strings", values ); + setPreferenceProperty( spacemousePref1, "indexes", indices ); + setPreferenceProperty( spacemousePref2, "strings", values ); + setPreferenceProperty( spacemousePref2, "indexes", indices ); + setPreferenceProperty( spacemousePref3, "strings", values ); + setPreferenceProperty( spacemousePref3, "indexes", indices ); + setPreferenceProperty( spacemousePref4, "strings", values ); + setPreferenceProperty( spacemousePref4, "indexes", indices ); + setPreferenceProperty( spacemousePref5, "strings", values ); + setPreferenceProperty( spacemousePref5, "indexes", indices ); + + int cameraGr = addPreference( tr( "VISU_CAMERA_PREF_GROUP_TTL" ), gaussTab ); + int cameraPref = addPreference( tr( "VISU_CAMERA_MOVE_PREF" ), cameraGr, SalomeApp_Preferences::IntSpin, "VISU", "camera_movement_steps" ); + setPreferenceProperty( cameraPref, "max", 1000 ); +} void VisuGUI_Module diff --git a/src/VISUGUI/VisuGUI_Module.h b/src/VISUGUI/VisuGUI_Module.h index e766cce2..034c31ae 100644 --- a/src/VISUGUI/VisuGUI_Module.h +++ b/src/VISUGUI/VisuGUI_Module.h @@ -62,6 +62,11 @@ public: void initialize( CAM_Application* ); + virtual + void + createPreferences(); + + public slots: virtual bool