]> SALOME platform Git repositories - modules/geom.git/commitdiff
Salome HOME
- add new translation
authormpa <mpa@opencascade.com>
Tue, 3 Jun 2014 06:14:22 +0000 (10:14 +0400)
committermpa <mpa@opencascade.com>
Tue, 3 Jun 2014 06:14:22 +0000 (10:14 +0400)
- correct some files

17 files changed:
resources/SalomeApp.xml.in
src/DependencyTree/CMakeLists.txt
src/DependencyTree/DependencyTree.cxx [deleted file]
src/DependencyTree/DependencyTree.h [deleted file]
src/DependencyTree/DependencyTree_Object.h
src/DependencyTree/DependencyTree_Selector.cxx
src/DependencyTree/DependencyTree_View.cxx
src/DependencyTree/DependencyTree_View.h
src/DependencyTree/DependencyTree_ViewModel.cxx
src/DependencyTree/DependencyTree_ViewModel.h
src/DependencyTree/resources/DependencyTree_msg_en.ts
src/DependencyTree/resources/DependencyTree_msg_fr.ts
src/DependencyTree/resources/DependencyTree_msg_ja.ts
src/GEOMGUI/GEOM_msg_en.ts
src/GEOMGUI/GEOM_msg_fr.ts
src/GEOMGUI/GEOM_msg_ja.ts
src/GEOMToolsGUI/GEOMToolsGUI_1.cxx

index d8d3253d4df7e09b0018292a0acaf3e52e4bf177..465b04884fb8f27c942199ea9bdd8893ad0afd72 100644 (file)
@@ -38,6 +38,7 @@
     <!-- Module resources -->
     <parameter name="GEOM" value="%GEOM_ROOT_DIR%/share/salome/resources/geom"/>
     <parameter name="AdvancedGUI" value="%GEOM_ROOT_DIR%/share/salome/resources/geom"/>
+    <parameter name="DependencyTree" value="%GEOM_ROOT_DIR%/share/salome/resources/geom"/>
   </section>
   <section name="Geometry" >
     <!-- Other module preferences -->
index 4b5943fcde4425234081912123aa355335c43cc6..a3807832a017e0a4ed50e6347f433f13d941a50c 100644 (file)
@@ -71,7 +71,6 @@ SET(_link_LIBRARIES
 # --- headers ---
 
 SET(DependencyTree_HEADERS
-  DependencyTree.h
   DependencyTree_Arrow.h
   DependencyTree_Object.h
   DependencyTree_Selector.h
@@ -89,12 +88,10 @@ SET(_moc_HEADERS
 QT4_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS})
 
 SET(DependencyTree_SOURCES
-  DependencyTree.cxx
   DependencyTree_View.cxx
   DependencyTree_Object.cxx
   DependencyTree_Arrow.cxx
   DependencyTree_Selector.cxx
-  #arrow.cxx
   DependencyTree_ViewModel.cxx
   ${_moc_SOURCES}
 )
@@ -107,13 +104,13 @@ SET(_res_files
   resources/DependencyTree_msg_fr.ts 
   resources/DependencyTree_msg_ja.ts          
 )
+
 # --- rules ---
 
 ADD_LIBRARY(DependencyTree ${DependencyTree_SOURCES})
 TARGET_LINK_LIBRARIES(DependencyTree ${_link_LIBRARIES})
 INSTALL(TARGETS DependencyTree EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
 
-#INSTALL(FILES ${_res_files} DESTINATION ${SALOME_GEOM_INSTALL_RES_DATA})
-QT4_INSTALL_TS_RESOURCES("${_res_files}" "${SALOME_GEOM_INSTALL_RES_DATA}")
-
 INSTALL(FILES ${DependencyTree_HEADERS} DESTINATION ${SALOME_INSTALL_HEADERS})
+
+QT4_INSTALL_TS_RESOURCES("${_res_files}" "${SALOME_GEOM_INSTALL_RES_DATA}")
diff --git a/src/DependencyTree/DependencyTree.cxx b/src/DependencyTree/DependencyTree.cxx
deleted file mode 100644 (file)
index 97b4289..0000000
+++ /dev/null
@@ -1,96 +0,0 @@
-// Copyright (C) 2014  CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-
-#include <GraphicsView_Object.h>
-
-#include "DependencyTree.h"
-#include "DependencyTree_ViewModel.h"
-
-#include <QGraphicsItem>
-#include <QPolygonF>
-#include <QPointF>
-#include <QMenu>
-#include <QPen>
-#include <QFont>
-#include <QString>
-#include <QGraphicsPolygonItem>
-#include <QGraphicsSimpleTextItem>
-#include <QWidgetAction>
-#include <QSpinBox>
-#include <QLabel>
-#include <QCheckBox>
-
-#include <QtxActionToolMgr.h>
-
-#include "DependencyTree_View.h"
-#include <DependencyTree_Selector.h>
-
-#include <GraphicsView_Viewer.h>
-#include <GraphicsView_ViewFrame.h>
-#include <GraphicsView_Scene.h>
-
-#include <SUIT_Session.h>
-#include <SUIT_ViewManager.h>
-#include <SUIT_SelectionMgr.h>
-#include <SalomeApp_Application.h>
-
-
-#include <QList>
-#include <QGraphicsView>
-
-
-#include <iostream>
-DependencyTree::DependencyTree()
-{
-         SUIT_ResourceMgr* aResMgr = SUIT_Session::session()->resourceMgr();
-         SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() );
-           if ( !app ) return;
-
-           LightApp_SelectionMgr* mySelMgr = app->selectionMgr();
-
-           SUIT_ViewManager *svm = app->getViewManager(GraphicsView_Viewer::Type(), false );
-
-           if(!svm) {
-             myView = new DependencyTree_View();
-             DependencyTree_ViewModel* ViewModel = new DependencyTree_ViewModel(GraphicsView_Viewer::Type(), myView);
-             SUIT_ViewManager *svm = app->createViewManager( ViewModel );
-             new DependencyTree_Selector( ViewModel,
-                        ( SUIT_SelectionMgr*)mySelMgr );
-             SUIT_ViewWindow* svw = svm->getActiveView();
-             GraphicsView_ViewFrame* aViewFrame = 0;
-             if (!svw) svw = svm->createViewWindow();
-             if (svw) aViewFrame = dynamic_cast<GraphicsView_ViewFrame*>(svw);
-
-             myView->init( aViewFrame );
-             svm->setTitle("DEPENDENCY_TREE");
-           }
-           else {
-          if( DependencyTree_ViewModel* viewModel = dynamic_cast<DependencyTree_ViewModel*>( svm->getViewModel() ) )
-               if( DependencyTree_View* view = dynamic_cast<DependencyTree_View*>( viewModel->getActiveViewPort() ) ) {
-                 svm->getActiveView()->setFocus();
-                 view->updateModel();
-               }
-           }
-
-
-}
-
-DependencyTree::~DependencyTree()
-{
-}
diff --git a/src/DependencyTree/DependencyTree.h b/src/DependencyTree/DependencyTree.h
deleted file mode 100644 (file)
index 4b5d54e..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright (C) 2014  CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-
-#include <GraphicsView_Object.h>
-
-#include <QGraphicsPolygonItem>
-
-#include "DependencyTree_View.h"
-class DependencyTree
-{
-public:
-  DependencyTree();
-  ~DependencyTree();
-
-//  static void setBackgroundColor( const QColor& );
-//  static void setNodeColor( const QColor& );
-//  static void setMainNodeColor( const QColor& );
-//  static void setSelectNodeColor( const QColor& );
-//  static void setArrowColor( const QColor& );
-//  static void setHighlightArrowColor( const QColor& );
-//  static void setSelectArrowColor( const QColor& );
-
-private:
-  DependencyTree_View* myView;
-
-  QColor* myBackgroundColor;
-};
-
index a4a27b3035b7408dba9a61fa4b299a3edce8f870..64be40adc8123bbed41e9a02924093d345a0e025 100644 (file)
@@ -46,7 +46,7 @@ public:
 
   std::string                 getEntry() const;
 
-  GEOM::GEOM_BaseObject_var  getGeomObject() const;
+  GEOM::GEOM_BaseObject_var   getGeomObject() const;
 
   void                        updateName();
 
index 5c1c9a7e5d85c8942d2b8db6434ef8108ae2b997..78b72c371b5fda15ff5229e85d1c785f83dd0bb0 100644 (file)
@@ -50,20 +50,22 @@ void DependencyTree_Selector::getSelection( SUIT_DataOwnerPtrList& theList ) con
     if( DependencyTree_Object* treeObject = dynamic_cast<DependencyTree_Object*>( myView->selectedObject() ) ) {
       const char* entry;
       const char* name;
-      QString studyEntry = treeObject->getGeomObject()->GetStudyEntry();
-      if( studyEntry.isEmpty() ) {
-        entry = treeObject->getEntry().c_str();
-        name = "TEMP_IO_UNPUBLISHED";
-      }
-      else {
-        entry = studyEntry.toStdString().c_str();
-        name = "TEMP_IO";
-      }
-      Handle(SALOME_InteractiveObject) tmpIO =
-        new SALOME_InteractiveObject( entry, "GEOM", name);
+      if( !treeObject->getGeomObject()->_is_nil() ) {
+        QString studyEntry = treeObject->getGeomObject()->GetStudyEntry();
+        if( studyEntry.isEmpty() ) {
+          entry = treeObject->getEntry().c_str();
+          name = "TEMP_IO_UNPUBLISHED";
+        }
+        else {
+          entry = studyEntry.toStdString().c_str();
+          name = "TEMP_IO";
+        }
+        Handle(SALOME_InteractiveObject) tmpIO =
+          new SALOME_InteractiveObject( entry, "GEOM", name);
 
-      theList.append( new LightApp_DataOwner( tmpIO ) );
-  }
+        theList.append( new LightApp_DataOwner( tmpIO ) );
+      }
+    }
 }
 
 //=================================================================================
index e17a506e2cc3d185463c0b46e1653796f954b0ba..6faf9da62e2bb4f032710e94bf6df124b2ff7e2e 100644 (file)
 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
+// Internal includes
 #include "DependencyTree_View.h"
 #include "DependencyTree_Object.h"
 #include "DependencyTree_Arrow.h"
 
-#include <GEOMBase.h>
-
 // GUI includes
 #include <SUIT_Session.h>
 #include <SUIT_ResourceMgr.h>
 #include <LightApp_SelectionMgr.h>
 #include <SALOME_ListIteratorOfListIO.hxx>
 
+// GEOM includes
+#include <GEOMBase.h>
+
 // Qt includes
 #include <QCloseEvent>
 #include <QApplication>
-#include <QGraphicsScene>
+#include <QProgressBar>
 
-#define DRAW_EVENT  ( QEvent::User + 1 )
+#define UPDATE_EVENT ( QEvent::User + 1 )
 
 #include <iostream>
 
 DependencyTree_View::DependencyTree_View( QWidget* theParent )
-:GraphicsView_ViewPort(theParent),
+:GraphicsView_ViewPort( theParent ),
 myMaxDownwardLevelsNumber(0),
 myMaxUpwardLevelsNumber(0),
 myLevelsNumber(0),
@@ -70,7 +72,7 @@ DependencyTree_View::~DependencyTree_View()
 
 void DependencyTree_View::init( GraphicsView_ViewFrame* theViewFrame )
 {
-  qthread = new DependencyTree_ComputeDlg_QThread( this );
+  qthread = new DependencyTree_QThread( this );
 
   SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
 
@@ -121,11 +123,11 @@ void DependencyTree_View::init( GraphicsView_ViewFrame* theViewFrame )
   QAction* separator2 = theViewFrame->toolMgr()->separator( false );
 
   theViewFrame->toolMgr()->append( separator1, theViewFrame->getToolBarId() );
-  theViewFrame->toolMgr()->append( nodesMovableAction, theViewFrame->getToolBarId() );
   theViewFrame->toolMgr()->append( hierarchyDepthLabelAction, theViewFrame->getToolBarId() );
   theViewFrame->toolMgr()->append( hierarchyDepthAction, theViewFrame->getToolBarId() );
   theViewFrame->toolMgr()->append( ShowParentsAction, theViewFrame->getToolBarId() );
   theViewFrame->toolMgr()->append( ShowChildrenAction, theViewFrame->getToolBarId() );
+  theViewFrame->toolMgr()->append( nodesMovableAction, theViewFrame->getToolBarId() );
 
   theViewFrame->toolMgr()->append( separator2, theViewFrame->getToolBarId() );
   theViewFrame->toolMgr()->append( updateAction, theViewFrame->getToolBarId() );
@@ -150,6 +152,11 @@ void DependencyTree_View::updateModel( bool theUseSelectedObject, bool theUseOB
   onHierarchyType();
 }
 
+QString DependencyTree_View::getViewName() const
+{
+  return tr( "DEPENDENCY_TREE" );
+}
+
 void DependencyTree_View::drawTree()
 {
   myComputedCost = 0;
@@ -232,7 +239,7 @@ void DependencyTree_View::drawTree()
 
 void DependencyTree_View::customEvent( QEvent * event )
 {
-  if( event->type() == DRAW_EVENT ) {
+  if( event->type() == UPDATE_EVENT ) {
 
     QPushButton* cancelButton = dynamic_cast<QPushButton*>( cancelAction->defaultWidget() );
     QProgressBar* progressBar = dynamic_cast<QProgressBar*>( progressAction->defaultWidget() );
@@ -246,7 +253,7 @@ void DependencyTree_View::customEvent( QEvent * event )
       cancelButton->setChecked( false );
       progressBar->setValue(0);
       fitAll();
-      QApplication::removePostedEvents( this, ( QEvent::Type )DRAW_EVENT );
+      QApplication::removePostedEvents( this, ( QEvent::Type )UPDATE_EVENT );
     }
   }
   event->accept();
@@ -254,11 +261,11 @@ void DependencyTree_View::customEvent( QEvent * event )
 
 void DependencyTree_View::addNewItem( QGraphicsItem* theObject )
 {
-  qthread->sleepDraw();
   if( theObject )
     addItem( theObject );
+  qthread->sleepDraw();
   SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() );
-  QApplication::postEvent( this, new QEvent( ( QEvent::Type )DRAW_EVENT ) );
+  QApplication::postEvent( this, new QEvent( ( QEvent::Type )UPDATE_EVENT ) );
 }
 
 void DependencyTree_View::mouseMoveEvent(QMouseEvent *event)
@@ -728,29 +735,29 @@ bool DependencyTree_View::updateObjectName( const std::string &theEntry )
   return res;
 }
 
-DependencyTree_ComputeDlg_QThread::DependencyTree_ComputeDlg_QThread( DependencyTree_View* theView )
+DependencyTree_QThread::DependencyTree_QThread( DependencyTree_View* theView )
 {
   myView = theView;
 }
 
-void DependencyTree_ComputeDlg_QThread::run()
+void DependencyTree_QThread::run()
 {
   myView->myMutex.lock();
  // QMutexLocker lock( &myView->myMutex );
   myView->setIsCompute( true );
   myView->drawTree();
 
-  QApplication::postEvent( myView, new QEvent( ( QEvent::Type )DRAW_EVENT ) );
+  QApplication::postEvent( myView, new QEvent( ( QEvent::Type )UPDATE_EVENT ) );
   myView->myMutex.unlock();
   //exec();
 }
 
-void DependencyTree_ComputeDlg_QThread::sleepDraw()
+void DependencyTree_QThread::sleepDraw()
 {
   msleep(1);
 }
 
-void DependencyTree_ComputeDlg_QThread::cancel()
+void DependencyTree_QThread::cancel()
 {
   myView->setIsCompute( false );
 }
index 4c1b86e8d6d26c60c425e629ca56755a9d58603b..e589958ce42b7554172752fac1a9d2733f2fff61 100644 (file)
 #ifndef DEPENDENCYTREE_VIEW_H
 #define DEPENDENCYTREE_VIEW_H
 
+// GEOM includes
+#include <GEOMUtils.hxx>
+#include <GeometryGUI.h>
+
+// GUI includes
 #include <GraphicsView_ViewPort.h>
 #include <GraphicsView_ViewFrame.h>
-#include <GraphicsView_Scene.h>
 
 #include <SalomeApp_Application.h>
 
-#include <SALOME_ListIO.hxx>
-
-#include <GEOMUtils.hxx>
-#include <GEOM_InteractiveObject.hxx>
-#include <GeometryGUI.h>
-
-
+// QT includes
 #include <QWidgetAction>
 #include <QPushButton>
 #include <QSpinBox>
 #include <QCheckBox>
-#include <QProgressBar>
 #include <QThread>
 #include <QMutex>
 
@@ -45,13 +42,13 @@ class DependencyTree_Object;
 class DependencyTree_Arrow;
 class DependencyTree_View;
 
-class DependencyTree_ComputeDlg_QThread : public QThread
+class DependencyTree_QThread : public QThread
 {
   Q_OBJECT
 
 public:
 
-  DependencyTree_ComputeDlg_QThread( DependencyTree_View* );
+  DependencyTree_QThread( DependencyTree_View* );
   void sleepDraw();
   void cancel();
 
@@ -80,6 +77,8 @@ public:
   void updateModel( bool = true, bool = true );
   void drawTree();
 
+  QString getViewName() const;
+
   virtual void customEvent ( QEvent* );
   void mouseMoveEvent(QMouseEvent *event);
 
@@ -166,7 +165,7 @@ private:
   int myTotalCost;
   int myComputedCost;
 
-  DependencyTree_ComputeDlg_QThread* qthread;
+  DependencyTree_QThread* qthread;
 
   GEOM::string_array_var myMainEntries;
 
index afeda3d6151642a33461e978e00be6194bd90f5d..a2638b82b55a677a830553d3ca7cb16056019378 100644 (file)
 //
 
 #include "DependencyTree_ViewModel.h"
-
 #include "DependencyTree_View.h"
-#include "GEOM_Displayer.h"
 
-#include <GraphicsView_Viewer.h>
-#include <GraphicsView_ViewPort.h>
-#include <SalomeApp_Application.h>
+// GUI includes
+#include <SUIT_Session.h>
 #include <SalomeApp_Study.h>
 #include <LightApp_SelectionMgr.h>
-#include <SALOME_ListIO.hxx>
 #include <SALOME_ListIteratorOfListIO.hxx>
-#include <SUIT_Session.h>
-#include <OCCViewer_ViewModel.h>
 #include <OCCViewer_ViewManager.h>
 
-#include <QWidget>
+// GEOM includes
+#include <GEOM_Displayer.h>
+
+// QT includes
 #include <QMenu>
-#include <iostream>
+
 
 DependencyTree_ViewModel::DependencyTree_ViewModel( const QString& title )
 : GraphicsView_Viewer( title )
@@ -45,23 +42,18 @@ DependencyTree_ViewModel::DependencyTree_ViewModel( const QString& title )
 DependencyTree_ViewModel::DependencyTree_ViewModel( const QString& title, QWidget* w )
 : GraphicsView_Viewer( title,  w )
 {
-
 }
 
 DependencyTree_ViewModel::~DependencyTree_ViewModel()
 {
 }
 
-void activateOCCViewer() {
-}
-
 void DependencyTree_ViewModel::onShowSelected()
 {
-  std::cout<<"\n\n\n\n *****onShowSelected " << std::endl;
   SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() );
   if ( !app ) return;
 
-  app->getViewManager(OCCViewer_Viewer::Type(), /*create=*/true);
+  app->getViewManager( OCCViewer_Viewer::Type(), /*create=*/ true );
 
   LightApp_SelectionMgr* aSelMgr = app->selectionMgr();
   if ( !aSelMgr ) return;
@@ -69,25 +61,23 @@ void DependencyTree_ViewModel::onShowSelected()
   SALOME_ListIO aSelList;
   aSelMgr->selectedObjects(aSelList);
 
-  SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>(app->activeStudy());
+  SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>( app->activeStudy() );
   GEOM_Displayer* disp = new GEOM_Displayer( appStudy );
 
-  OCCViewer_ViewManager* anOCCVM = (OCCViewer_ViewManager*) app->getViewManager( OCCViewer_Viewer::Type(), /*create=*/true );
+  OCCViewer_ViewManager* anOCCVM = ( OCCViewer_ViewManager* ) app->getViewManager( OCCViewer_Viewer::Type(), /*create=*/ true );
 
-  if ( SUIT_ViewModel* vmod = anOCCVM->getViewModel() ) {
-    if ( SALOME_View* aViewFrame = dynamic_cast<SALOME_View*>( vmod ) ) {
+  if ( SUIT_ViewModel* viewModel = anOCCVM->getViewModel() ) {
+    if ( SALOME_View* viewFrame = dynamic_cast<SALOME_View*>( viewModel ) ) {
       SALOME_ListIteratorOfListIO Iter( aSelList );
-      for ( ; Iter.More(); Iter.Next() ) {
-       disp->Display( Iter.Value(), false, aViewFrame );
-      }
-      aViewFrame->Repaint();
+      for ( ; Iter.More(); Iter.Next() )
+        disp->Display( Iter.Value(), false, viewFrame );
+      viewFrame->Repaint();
     }
   }
 }
 
 void DependencyTree_ViewModel::onShowOnlySelected()
 {
-  std::cout<<"\n\n\n\n *****onShowOnlySelected " << std::endl;
   SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() );
   if ( !app ) return;
 
@@ -95,21 +85,20 @@ void DependencyTree_ViewModel::onShowOnlySelected()
   if ( !aSelMgr ) return;
 
   SALOME_ListIO aSelList;
-  aSelMgr->selectedObjects(aSelList);
+  aSelMgr->selectedObjects( aSelList );
 
-  SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>(app->activeStudy());
+  SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>( app->activeStudy() );
   GEOM_Displayer* disp = new GEOM_Displayer( appStudy );
 
-  OCCViewer_ViewManager* anOCCVM = (OCCViewer_ViewManager*) app->getViewManager( OCCViewer_Viewer::Type(), /*create=*/true );
+  OCCViewer_ViewManager* anOCCVM = (OCCViewer_ViewManager*) app->getViewManager( OCCViewer_Viewer::Type(), /*create=*/ true );
 
-  if ( SUIT_ViewModel* vmod = anOCCVM->getViewModel() ) {
-    if ( SALOME_View* aViewFrame = dynamic_cast<SALOME_View*>( vmod ) ) {
-      disp->EraseAll( true, false, aViewFrame ); 
+  if ( SUIT_ViewModel* viewModel = anOCCVM->getViewModel() ) {
+    if ( SALOME_View* viewFrame = dynamic_cast<SALOME_View*>( viewModel ) ) {
+      disp->EraseAll( true, false, viewFrame );
       SALOME_ListIteratorOfListIO Iter( aSelList );
-      for ( ; Iter.More(); Iter.Next() ) {
-       disp->Display( Iter.Value(), false, aViewFrame );
-      }
-      aViewFrame->Repaint();
+      for ( ; Iter.More(); Iter.Next() )
+        disp->Display( Iter.Value(), false, viewFrame );
+      viewFrame->Repaint();
     }
   }
 }
@@ -117,50 +106,15 @@ void DependencyTree_ViewModel::onShowOnlySelected()
 void DependencyTree_ViewModel::contextMenuPopup( QMenu* theMenu )
 {
   GraphicsView_Viewer::contextMenuPopup( theMenu );
-  std::cout<<"\n\n\n\n *****contextMenuPopup " << std::endl;
 
-
-  if( DependencyTree_View* aViewPort = dynamic_cast<DependencyTree_View*>(getActiveViewPort()) )
+  if( DependencyTree_View* viewPort = dynamic_cast<DependencyTree_View*>( getActiveViewPort() ) )
   {
-    int aNbSelected = aViewPort->nbSelected();
-    std::cout<<"\n  aNbSelected " << aNbSelected << std::endl;
+    int aNbSelected = viewPort->nbSelected();
     if( aNbSelected > 0 ) {
       theMenu->clear();
       theMenu->addAction( tr( "MEN_DISPLAY" ), this, SLOT( onShowSelected() ) );
       theMenu->addAction( tr( "MEN_DISPLAY_ONLY" ), this, SLOT( onShowOnlySelected() ) );
-      theMenu->addAction( tr( "REBUILD_THE_TREE"), aViewPort, SLOT( onRebuildModel() ) );
+      theMenu->addAction( tr( "REBUILD_THE_TREE"), viewPort, SLOT( onRebuildModel() ) );
     }
   }
-
-
 }
-
-//SUIT_ViewWindow* DependencyTree_ViewModel::createView( SUIT_Desktop* theDesktop )
-//{
-//     DependencyTree_ViewWindow* aViewFrame;
-//if( myWidget )
-//  aViewFrame = new DependencyTree_ViewWindow( theDesktop, this, myWidget );
-//else
-//     aViewFrame = new DependencyTree_ViewWindow( theDesktop, this );
-//
-//connect( aViewFrame, SIGNAL( keyPressed( QKeyEvent* ) ),
-//         this, SLOT( onKeyEvent( QKeyEvent* ) ) );
-//
-//connect( aViewFrame, SIGNAL( keyReleased( QKeyEvent* ) ),
-//         this, SLOT( onKeyEvent( QKeyEvent* ) ) );
-//
-//connect( aViewFrame, SIGNAL( mousePressed( QGraphicsSceneMouseEvent* ) ),
-//         this, SLOT( onMouseEvent( QGraphicsSceneMouseEvent* ) ) );
-//
-//connect( aViewFrame, SIGNAL( mouseMoving( QGraphicsSceneMouseEvent* ) ),
-//         this, SLOT( onMouseEvent( QGraphicsSceneMouseEvent* ) ) );
-//
-//connect( aViewFrame, SIGNAL( mouseReleased( QGraphicsSceneMouseEvent* ) ),
-//         this, SLOT( onMouseEvent( QGraphicsSceneMouseEvent* ) ) );
-//
-//connect( aViewFrame, SIGNAL( wheeling( QGraphicsSceneWheelEvent* ) ),
-//         this, SLOT( onWheelEvent( QGraphicsSceneWheelEvent* ) ) );
-//
-//return aViewFrame;
-//}
-
index e41fd815691c7c7533af46274248c86bb449df5b..d33f1de4b1529bb6f5991ed304fd3b4a26f5222e 100644 (file)
 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
+#ifndef DEPENDENCYTREE_VIEWMODEL_H
+#define DEPENDENCYTREE_VIEWMODEL_H
+
 #include <GraphicsView_Viewer.h>
-#include <QWidget>
 
 class DependencyTree_ViewModel: public GraphicsView_Viewer
 {
+
   Q_OBJECT
 
 public:
-
   DependencyTree_ViewModel( const QString& title );
   DependencyTree_ViewModel( const QString& title, QWidget* w  );
   ~DependencyTree_ViewModel();
 
-public:
-  virtual void                  contextMenuPopup( QMenu* );
-//  virtual SUIT_ViewWindow*      createView( SUIT_Desktop* );
-
-//  static QString                Type() { return "DependencyTree";  }
+  virtual void contextMenuPopup( QMenu* );
 
 private slots:
   void onShowSelected();
   void onShowOnlySelected();
 
 };
+
+#endif
index c62ab0de1b8e15482d743ddcb5e03f4e39767e04..42bf72258cd51f2cf81beb28d4b66680970bba01 100644 (file)
@@ -13,7 +13,7 @@
     </message>
     <message>
       <source>HIERARCHY_DEPTH</source>
-      <translation>Hierarchy depth</translation>
+      <translation>Hierarchy depth  </translation>
     </message>
     <message>
       <source>DISPLAY_ASCENDANTS</source>
       <source>DISPLAY_DESCENDANTS</source>
       <translation>Display descendants</translation>
     </message>
+    <message>
+      <source>SHOW_ALL</source>
+      <translation>Show all</translation>
+    </message>
+    <message>
+      <source>UPDATE</source>
+      <translation>Update</translation>
+    </message>
     <message>
       <source>CANCEL</source>
       <translation>Cancel</translation>
     </message>
-        <message>
-      <source>CANCELING</source>
-      <translation>Canceling...</translation>
+  <name>DependencyTree_ViewModel</name>
+    <message>
+      <source>REBUILD_THE_TREE</source>
+      <translation>Rebuild the tree</translation>
     </message>
 </context>
 </TS>
index b4eae6fcacaa54aa4014f2493afd7fd255e23a2c..5f3cbad93404a1381e4ce1e7e245e98c8a5366ef 100644 (file)
@@ -2,11 +2,43 @@
 <!DOCTYPE TS>
 <TS version="2.0" language="fr_FR">
 <context>
-    <name>@default</name>
+  <name>DependencyTree_View</name>
     <message>
-        <source>MEN_TEXTURE</source>
-        <translation>Texture</translation>
+      <source>DEPENDENCY_TREE</source>
+      <translation type="unfinished">Dependency Tree</translation>
+    </message>
+    <message>
+      <source>MOVE_NODES</source>
+      <translation type="unfinished">Move nodes</translation>
+    </message>
+    <message>
+      <source>HIERARCHY_DEPTH</source>
+      <translation type="unfinished">Hierarchy depth  </translation>
+    </message>
+    <message>
+      <source>DISPLAY_ASCENDANTS</source>
+      <translation type="unfinished">Display ascendants</translation>
+    </message>
+    <message>
+      <source>DISPLAY_DESCENDANTS</source>
+      <translation type="unfinished">Display descendants</translation>
+    </message>
+    <message>
+      <source>SHOW_ALL</source>
+      <translation type="unfinished">Show all</translation>
+    </message>
+    <message>
+      <source>UPDATE</source>
+      <translation type="unfinished">Update</translation>
+    </message>
+    <message>
+      <source>CANCEL</source>
+      <translation type="unfinished">Cancel</translation>
+    </message>
+  <name>DependencyTree_ViewModel</name>
+    <message>
+      <source>REBUILD_THE_TREE</source>
+      <translation type="unfinished">Rebuild the tree</translation>
     </message>
-
 </context>
 </TS>
index 26250801e1b52bd2021dffc8d5c7e20edc9c7593..3636aab07075b43ac03472d7f22de313bcd46af3 100644 (file)
@@ -1,12 +1,44 @@
 <?xml version="1.0" encoding="utf-8"?>
 <!DOCTYPE TS>
 <TS>
-  <context>
-    <name>@default</name>
+<context>
+  <name>DependencyTree_View</name>
     <message>
-        <source>MEN_TEXTURE</source>
-        <translation type="unfinished">Texture</translation>
+      <source>DEPENDENCY_TREE</source>
+      <translation type="unfinished">Dependency Tree</translation>
     </message>
-
-  </context>
-</TS>
+    <message>
+      <source>MOVE_NODES</source>
+      <translation type="unfinished">Move nodes</translation>
+    </message>
+    <message>
+      <source>HIERARCHY_DEPTH</source>
+      <translation type="unfinished">Hierarchy depth  </translation>
+    </message>
+    <message>
+      <source>DISPLAY_ASCENDANTS</source>
+      <translation type="unfinished">Display ascendants</translation>
+    </message>
+    <message>
+      <source>DISPLAY_DESCENDANTS</source>
+      <translation type="unfinished">Display descendants</translation>
+    </message>
+    <message>
+      <source>SHOW_ALL</source>
+      <translation type="unfinished">Show all</translation>
+    </message>
+    <message>
+      <source>UPDATE</source>
+      <translation type="unfinished">Update</translation>
+    </message>
+    <message>
+      <source>CANCEL</source>
+      <translation type="unfinished">Cancel</translation>
+    </message>
+  <name>DependencyTree_ViewModel</name>
+    <message>
+      <source>REBUILD_THE_TREE</source>
+      <translation type="unfinished">Rebuild the tree</translation>
+    </message>
+</context>
+</TS>
\ No newline at end of file
index 39e2393f5357e3fa3a84d66103d824ae2df926fe..5f45808a3958c94172ce770c39b32352dde626ee 100644 (file)
@@ -4760,6 +4760,10 @@ Please, select face, shell or solid and try again</translation>
         <source>STB_MANAGE_DIMENSIONS</source>
         <translation>Manage measurement dimensions of an object</translation>
     </message>
+    <message>
+        <source>MEN_POP_SHOW_DEPENDENCY_TREE</source>
+        <translation>Show dependency tree</translation>
+    </message>
     <message>
         <source>MEN_POP_SHOW_ALL_DIMENSIONS</source>
         <translation>Show all dimensions</translation>
index df93751d191dc5203bdf931c2abb22a0a5e26260..7c7878d8604a85fcb3523ad0144ff2c912327026 100644 (file)
@@ -4760,6 +4760,10 @@ Choisissez une face, une coque ou un solide et essayez de nouveau</translation>
         <source>STB_MANAGE_DIMENSIONS</source>
         <translation>Gérer la cotation d&apos;un objet</translation>
     </message>
+    <message>
+        <source>MEN_POP_SHOW_DEPENDENCY_TREE</source>
+        <translation type="unfinished">Show dependency tree</translation>
+    </message>
     <message>
         <source>MEN_POP_SHOW_ALL_DIMENSIONS</source>
         <translation>Afficher les cotations </translation>
index d445fab840c0d2463dc74b43b77bc80bb3d84f8a..ecad4cb1f49f3f80b22d38b6f9da2183769ca945 100644 (file)
       <source>STB_MANAGE_DIMENSIONS</source>
       <translation type="unfinished">Manage measurement dimensions of an object</translation>
     </message>
+    <message>
+        <source>MEN_POP_SHOW_DEPENDENCY_TREE</source>
+        <translation type="unfinished">Show dependency tree</translation>
+    </message>
     <message>
       <source>MEN_POP_SHOW_ALL_DIMENSIONS</source>
       <translation type="unfinished">Show all dimensions</translation>
index fd817c14ac92d41eace7455c361ec7753bf3cf40..90ea6bf251878f26c845254fc5fd68b8f019fc3a 100644 (file)
@@ -46,7 +46,9 @@
 #include <GEOMBase.h>
 #include <GEOM_Actor.h>
 
-#include <DependencyTree.h>
+#include <DependencyTree_ViewModel.h>
+#include <DependencyTree_View.h>
+#include <DependencyTree_Selector.h>
 
 #include <Basics_OCCTVersion.hxx>
 
@@ -867,5 +869,33 @@ void GEOMToolsGUI::OnSortChildren()
 
 void GEOMToolsGUI::OnShowDependencyTree()
 {
-  DependencyTree();
+  SUIT_ResourceMgr* aResMgr = SUIT_Session::session()->resourceMgr();
+
+  SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() );
+  if ( !app ) return;
+
+  SUIT_ViewManager *svm = app->getViewManager( GraphicsView_Viewer::Type(), false );
+
+  if( !svm ) {
+    DependencyTree_View* view = new DependencyTree_View();
+    DependencyTree_ViewModel* viewModel = new DependencyTree_ViewModel( GraphicsView_Viewer::Type(), view );
+    SUIT_ViewManager *svm = app->createViewManager( viewModel );
+
+    LightApp_SelectionMgr* selMgr = app->selectionMgr();
+    new DependencyTree_Selector( viewModel, (SUIT_SelectionMgr*)selMgr );
+
+    SUIT_ViewWindow* svw = svm->getActiveView();
+    GraphicsView_ViewFrame* aViewFrame = 0;
+    if (!svw) svw = svm->createViewWindow();
+    if (svw) aViewFrame = dynamic_cast<GraphicsView_ViewFrame*>(svw);
+
+    view->init( aViewFrame );
+    svm->setTitle( view->getViewName() );
+  }
+  else
+    if( DependencyTree_ViewModel* viewModel = dynamic_cast<DependencyTree_ViewModel*>( svm->getViewModel() ) )
+      if( DependencyTree_View* view = dynamic_cast<DependencyTree_View*>( viewModel->getActiveViewPort() ) ) {
+        svm->getActiveView()->setFocus();
+        view->updateModel();
+      }
 }