]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
To introduce Gauss Points selection for VVTK viewer
authorapo <apo@opencascade.com>
Thu, 8 Sep 2005 07:38:07 +0000 (07:38 +0000)
committerapo <apo@opencascade.com>
Thu, 8 Sep 2005 07:38:07 +0000 (07:38 +0000)
src/VISUGUI/VISUM_images.po
src/VISUGUI/VISUM_msg_en.po
src/VVTK/VVTK_ViewWindow.cxx
src/VVTK/VVTK_ViewWindow.h

index 6f6a2892692b6334d9ab1cae6d6301a682a726bc..1bde3ccc06aea8016ef9673f1698b59bdc2367a5 100644 (file)
@@ -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"
+
index 35a08e1bd7ec8b20d0cd5609d7d53dfd894dc906..76e0e9c280e6193d3db7db350afa674a0fc2af6a 100644 (file)
@@ -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
index 81bdb7078bba410151b85c4ea125aa727f5db190..b7caabad144ee25c599ac38be0f7035f615a0115 100755 (executable)
@@ -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);
+}
index a89c5a8339a2c12e42d424ee2c265d761117bb78..a98808600f1a272ae045cfbcdfab7b9ed7c224f8 100755 (executable)
@@ -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;