]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
Popup item "Dump view"
authorstv <stv@opencascade.com>
Tue, 31 May 2005 09:17:35 +0000 (09:17 +0000)
committerstv <stv@opencascade.com>
Tue, 31 May 2005 09:17:35 +0000 (09:17 +0000)
src/OCCViewer/OCCViewer_ViewManager.cxx
src/OCCViewer/OCCViewer_ViewModel.cxx
src/OCCViewer/OCCViewer_ViewModel.h
src/OCCViewer/OCCViewer_ViewWindow.cxx
src/OCCViewer/resources/OCCViewer_msg_en.po
src/SVTK/SVTK_ViewModel.cxx
src/SVTK/SVTK_ViewModel.h
src/VTKViewer/VTKViewer_ViewModel.cxx
src/VTKViewer/VTKViewer_ViewModel.h
src/VTKViewer/resources/VTKViewer_msg_en.po

index 976b13d7ee613913e15fb2a352783744d8aaff8a..017d9d78166b90fa560c17ce26d12c2122a059c4 100755 (executable)
@@ -4,7 +4,7 @@
 
 int OCCViewer_ViewManager::myMaxId = 0;
 
-//***************************************************************
+//***************************************************************/
 OCCViewer_ViewManager::OCCViewer_ViewManager( SUIT_Study* study, SUIT_Desktop* theDesktop, bool DisplayTrihedron )
 : SUIT_ViewManager( study, theDesktop )
 {
@@ -12,30 +12,19 @@ OCCViewer_ViewManager::OCCViewer_ViewManager( SUIT_Study* study, SUIT_Desktop* t
   setViewModel( new OCCViewer_Viewer( DisplayTrihedron ) );
 }
 
-//***************************************************************
+//***************************************************************/
 OCCViewer_ViewManager::~OCCViewer_ViewManager()
 {
 }
 
-//***************************************************************
+//***************************************************************/
 void OCCViewer_ViewManager::setViewName(SUIT_ViewWindow* theView)
 {
   int aPos = myViews.find(theView);
   theView->setCaption( QString( "OCC scene:%1 - viewer:%2" ).arg(myId).arg(aPos+1));
 }
 
-//***************************************************************
-/*bool OCCViewer_ViewManager::insertView(SUIT_ViewWindow* theView)
-{
-  bool res = SUIT_ViewManager::insertView( theView );
-  if ( res ) {
-    OCCViewer_ViewWindow* view = (OCCViewer_ViewWindow*)theView;
-    connect( view, SIGNAL(cloneView()), this, SLOT(createView()) );
-  }
-  return res;
-}*/
-
-//***************************************************************
+//***************************************************************/
 void OCCViewer_ViewManager::contextMenuPopup( QPopupMenu* popup )
 {
   SUIT_ViewManager::contextMenuPopup( popup );
index 8878b837ab62fd30509d33378dff4fd254ec8038..5de1e756ad55883c2865af098a47b955ca3bb876 100755 (executable)
@@ -181,16 +181,21 @@ void OCCViewer_Viewer::enableMultiselection(bool isEnable)
 //*********************************************************************
 void OCCViewer_Viewer::contextMenuPopup(QPopupMenu* thePopup)
 {
-  if (thePopup->count() > 0) thePopup->insertSeparator();
-  thePopup->insertItem("Change background...", this, SLOT(onChangeBgColor()));
+  thePopup->insertItem( tr( "MEN_DUMP_VIEW" ), this, SLOT( onDumpView() ) );
+  thePopup->insertItem( tr( "MEN_CHANGE_BACKGROUD" ), this, SLOT( onChangeBgColor() ) );
+
+  thePopup->insertSeparator();
 
   OCCViewer_ViewWindow* aView = (OCCViewer_ViewWindow*)(myViewManager->getActiveView());
-  if ( aView ) {
-    if ( !aView->getToolBar()->isVisible() ) {
-      if (thePopup->count() > 0) thePopup->insertSeparator();
-      thePopup->insertItem("Show toolbar", this, SLOT(onShowToolbar()));
-    }
-  }
+  if ( aView && !aView->getToolBar()->isVisible() )
+    thePopup->insertItem( tr( "MEN_SHOW_TOOLBAR" ), this, SLOT( onShowToolbar() ) );
+}
+
+void OCCViewer_Viewer::onDumpView()
+{
+  OCCViewer_ViewWindow* aView = (OCCViewer_ViewWindow*)(myViewManager->getActiveView());
+  if ( aView )
+    aView->onDumpView();
 }
 
 //*********************************************************************
index fe8703b5607dd75d1aa6f4ea580c6c73078da169..f523cb43f5397904c607ba4d8825fc853b4357bb 100755 (executable)
@@ -110,8 +110,9 @@ protected slots:
   void onMouseMove(SUIT_ViewWindow*, QMouseEvent*);
   void onMouseRelease(SUIT_ViewWindow*, QMouseEvent*);
 
-  void onChangeBgColor();
+  void onDumpView();
   void onShowToolbar();
+  void onChangeBgColor();
 
 private:
   Handle(V3d_Viewer)              myV3dViewer;
index f9065da7ba270657dda1e78925a35634c58b97a7..58df1e2456b29cb58efe4202c0de5ca106e148c7 100755 (executable)
@@ -391,7 +391,7 @@ void OCCViewer_ViewWindow::setTransformRequested ( OperationType op )
 }
 
 
-//****************************************************************
+//****************************************************************/
 void OCCViewer_ViewWindow::vpMouseMoveEvent(QMouseEvent* theEvent)
 {
   myCurrX = theEvent->x();
@@ -442,7 +442,7 @@ void OCCViewer_ViewWindow::vpMouseMoveEvent(QMouseEvent* theEvent)
   }
 }
 
-//****************************************************************
+//****************************************************************/
 void OCCViewer_ViewWindow::vpMouseReleaseEvent(QMouseEvent* theEvent)
 {
   switch ( myOperation ) {
@@ -523,7 +523,7 @@ void OCCViewer_ViewWindow::resetState()
 }
 
 
-//****************************************************************
+//****************************************************************/
 void OCCViewer_ViewWindow::drawRect()
 {
   QPainter aPainter(myViewPort);
@@ -536,7 +536,7 @@ void OCCViewer_ViewWindow::drawRect()
   myRect = aRect;
 }
 
-//****************************************************************
+//****************************************************************/
 void OCCViewer_ViewWindow::createActions()
 {
   if (!myActionsMap.isEmpty()) return;
index 29d9ebfad1c711e4da55aa73dc64f6deef832918..c13b221b6509665fdaa5010151e4a7c8f3b1db95 100755 (executable)
@@ -134,8 +134,14 @@ msgstr "Restore View"
 msgid "DSC_PRESETS_VIEW"
 msgstr "Selection of the memorized state of the active view"
 
-msgid "MNU_DUMP_VIEW"
-msgstr "Dump"
+msgid "OCCViewer_Viewer::MEN_DUMP_VIEW"
+msgstr "Dump view..."
+
+msgid "OCCViewer_Viewer::MEN_SHOW_TOOLBAR"
+msgstr "Show toolbar"
+
+msgid "OCCViewer_Viewer::MEN_CHANGE_BACKGROUD"
+msgstr "Change background..."
 
 msgid "OCC_IMAGE_FILES"
 msgstr "Images Files (*.bmp *.png *.jpg *.jpeg)"
@@ -157,4 +163,3 @@ msgstr "Error"
 
 msgid "BUT_OK"
 msgstr "Ok"
-
index 04087ab3b08ea6e32ed298b8cc881105946df5c6..a9faa92cfdec3192cbcae49deb6e9164352e2f7d 100644 (file)
@@ -89,26 +89,20 @@ SVTK_Viewer
 }
 
 //==========================================================
-void
-SVTK_Viewer
-::contextMenuPopup(QPopupMenu* thePopup)
+void SVTK_Viewer::contextMenuPopup( QPopupMenu* thePopup )
 {
-  if (thePopup->count() > 0) thePopup->insertSeparator();
-  thePopup->insertItem("Change background...", this, SLOT(onChangeBgColor()));
-  if(SUIT_ViewWindow* aViewWindow = myViewManager->getActiveView()){
-    if(SVTK_ViewWindow* aView = dynamic_cast<SVTK_ViewWindow*>(aViewWindow)){
-      if(!aView->getToolBar()->isVisible()){
-       thePopup->insertSeparator();
-       thePopup->insertItem("Show toolbar", this, SLOT(onShowToolbar()));
-      }
-    }
-  }
+  thePopup->insertItem( VTKViewer_Viewer::tr( "MEN_DUMP_VIEW" ), this, SLOT( onDumpView() ) );
+  thePopup->insertItem( VTKViewer_Viewer::tr( "MEN_CHANGE_BACKGROUD" ), this, SLOT( onChangeBgColor() ) );
+
+  thePopup->insertSeparator();
+
+  SVTK_ViewWindow* aView = (SVTK_ViewWindow*)(myViewManager->getActiveView());
+  if ( aView && !aView->getToolBar()->isVisible() )
+    thePopup->insertItem( VTKViewer_Viewer::tr( "MEN_SHOW_TOOLBAR" ), this, SLOT( onShowToolbar() ) );
 }
 
 //==========================================================
-void
-SVTK_Viewer
-::onMousePress(SUIT_ViewWindow* vw, QMouseEvent* event)
+void SVTK_Viewer::onMousePress(SUIT_ViewWindow* vw, QMouseEvent* event)
 {
   if(SVTK_ViewWindow* aVW = dynamic_cast<SVTK_ViewWindow*>(vw)){
     if(SVTK_RenderWindowInteractor* aRWI = aVW->getRWInteractor()){
@@ -183,10 +177,15 @@ SVTK_Viewer
   //!! To be done for view windows
 }
 
+void SVTK_Viewer::onDumpView()
+{
+  SVTK_ViewWindow* aView = (SVTK_ViewWindow*)(myViewManager->getActiveView());
+  if ( aView )
+    aView->onDumpView();
+}
+
 //==========================================================
-void
-SVTK_Viewer
-::onChangeBgColor()
+void SVTK_Viewer::onChangeBgColor()
 {
   QPtrVector<SUIT_ViewWindow> aViews = myViewManager->getViews();
   for(int i = 0, iEnd = aViews.size(); i < iEnd; i++)
index de432ffaaedb6769ae75025488e471900ee90782..e780757c5fc59dbf3028766e227d65f4a0fa4933 100644 (file)
@@ -57,8 +57,9 @@ protected slots:
   void onMouseMove(SUIT_ViewWindow*, QMouseEvent*);
   void onMouseRelease(SUIT_ViewWindow*, QMouseEvent*);
 
-  void onChangeBgColor();
+  void onDumpView();
   void onShowToolbar();
+  void onChangeBgColor();
 
 private:
   bool mySelectionEnabled;
index 1d00cb59bfaf21e7f911dfc23a407740babede95..9ff5f3231718fc21669232c7e7c072496fc24a0a 100755 (executable)
@@ -47,16 +47,14 @@ void VTKViewer_Viewer::setViewManager(SUIT_ViewManager* theViewManager)
 //*********************************************************************
 void VTKViewer_Viewer::contextMenuPopup(QPopupMenu* thePopup)
 {
-  if (thePopup->count() > 0) thePopup->insertSeparator();
-  thePopup->insertItem("Change background...", this, SLOT(onChangeBgColor()));
+  thePopup->insertItem( tr( "MEN_DUMP_VIEW" ), this, SLOT( onDumpView() ) );
+  thePopup->insertItem( tr( "MEN_CHANGE_BACKGROUD" ), this, SLOT( onChangeBgColor() ) );
+
+  thePopup->insertSeparator();
 
   VTKViewer_ViewWindow* aView = (VTKViewer_ViewWindow*)(myViewManager->getActiveView());
-  if ( aView ) {
-    if ( !aView->getToolBar()->isVisible() ) {
-      thePopup->insertSeparator();
-      thePopup->insertItem("Show toolbar", this, SLOT(onShowToolbar()));
-    }
-  }
+  if ( aView && !aView->getToolBar()->isVisible() )
+    thePopup->insertItem( tr( "MEN_SHOW_TOOLBAR" ), this, SLOT( onShowToolbar() ) );
 }
 
 //*********************************************************************
@@ -131,6 +129,13 @@ void VTKViewer_Viewer::enableMultiselection(bool isEnable)
   //!! To be done for view windows
 }
 
+void VTKViewer_Viewer::onDumpView()
+{
+  VTKViewer_ViewWindow* aView = (VTKViewer_ViewWindow*)(myViewManager->getActiveView());
+  if ( aView )
+    aView->onDumpView();
+}
+
 //*********************************************************************
 void VTKViewer_Viewer::onChangeBgColor()
 {
index bfb6e97977bd256d84a3f14f85e7808a8e501f8b..fe54aa291cb2eae7c59f096e0f35310dcd7fa017 100755 (executable)
@@ -40,8 +40,9 @@ protected slots:
   void onMouseMove(SUIT_ViewWindow*, QMouseEvent*);
   void onMouseRelease(SUIT_ViewWindow*, QMouseEvent*);
 
-  void onChangeBgColor();
+  void onDumpView();
   void onShowToolbar();
+  void onChangeBgColor();
 
 private:
   bool mySelectionEnabled;
index e0424be9fb613aded416c55fa20d22f914ad45c9..23da3b43b7daec3fae8df3b5f1b22db4eaa62fdf 100755 (executable)
@@ -28,7 +28,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: example-Qt-message-extraction\n"
 "POT-Creation-Date: 1999-02-23 15:38+0200\n"
-"PO-Revision-Date: 1999-02-23 15:38+0200\n"
+"PO-Revision-Date: 2005-05-31 13:25+0400\n"
 "Last-Translator: \n"
 "Content-Type: text/plain; charset=iso-8859-1\n"
 
@@ -134,3 +134,11 @@ msgstr "Error"
 msgid "BUT_OK"
 msgstr "Ok"
 
+msgid "VTKViewer_Viewer::MEN_DUMP_VIEW"
+msgstr "Dump view..."
+
+msgid "VTKViewer_Viewer::MEN_SHOW_TOOLBAR"
+msgstr "Show toolbar"
+
+msgid "VTKViewer_Viewer::MEN_CHANGE_BACKGROUD"
+msgstr "Change background..."