diff --git a/resources/SalomeApp.xml.in b/resources/SalomeApp.xml.in
index d8d3253d4..465b04884 100644
--- a/resources/SalomeApp.xml.in
+++ b/resources/SalomeApp.xml.in
@@ -38,6 +38,7 @@
+
diff --git a/src/DependencyTree/CMakeLists.txt b/src/DependencyTree/CMakeLists.txt
index 4b5943fcd..a3807832a 100644
--- a/src/DependencyTree/CMakeLists.txt
+++ b/src/DependencyTree/CMakeLists.txt
@@ -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
index 97b428988..000000000
--- a/src/DependencyTree/DependencyTree.cxx
+++ /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
-
-#include "DependencyTree.h"
-#include "DependencyTree_ViewModel.h"
-
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-
-#include
-
-#include "DependencyTree_View.h"
-#include
-
-#include
-#include
-#include
-
-#include
-#include
-#include
-#include
-
-
-#include
-#include
-
-
-#include
-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(svw);
-
- myView->init( aViewFrame );
- svm->setTitle("DEPENDENCY_TREE");
- }
- else {
- if( DependencyTree_ViewModel* viewModel = dynamic_cast( svm->getViewModel() ) )
- if( DependencyTree_View* view = dynamic_cast( 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
index 4b5d54eae..000000000
--- a/src/DependencyTree/DependencyTree.h
+++ /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
-
-#include
-
-#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;
-};
-
diff --git a/src/DependencyTree/DependencyTree_Object.h b/src/DependencyTree/DependencyTree_Object.h
index a4a27b303..64be40adc 100644
--- a/src/DependencyTree/DependencyTree_Object.h
+++ b/src/DependencyTree/DependencyTree_Object.h
@@ -46,7 +46,7 @@ public:
std::string getEntry() const;
- GEOM::GEOM_BaseObject_var getGeomObject() const;
+ GEOM::GEOM_BaseObject_var getGeomObject() const;
void updateName();
diff --git a/src/DependencyTree/DependencyTree_Selector.cxx b/src/DependencyTree/DependencyTree_Selector.cxx
index 5c1c9a7e5..78b72c371 100644
--- a/src/DependencyTree/DependencyTree_Selector.cxx
+++ b/src/DependencyTree/DependencyTree_Selector.cxx
@@ -50,20 +50,22 @@ void DependencyTree_Selector::getSelection( SUIT_DataOwnerPtrList& theList ) con
if( DependencyTree_Object* treeObject = dynamic_cast( 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 ) );
+ }
+ }
}
//=================================================================================
diff --git a/src/DependencyTree/DependencyTree_View.cxx b/src/DependencyTree/DependencyTree_View.cxx
index e17a506e2..6faf9da62 100644
--- a/src/DependencyTree/DependencyTree_View.cxx
+++ b/src/DependencyTree/DependencyTree_View.cxx
@@ -17,12 +17,11 @@
// 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
-
// GUI includes
#include
#include
@@ -31,17 +30,20 @@
#include
#include
+// GEOM includes
+#include
+
// Qt includes
#include
#include
-#include
+#include
-#define DRAW_EVENT ( QEvent::User + 1 )
+#define UPDATE_EVENT ( QEvent::User + 1 )
#include
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( cancelAction->defaultWidget() );
QProgressBar* progressBar = dynamic_cast( 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 );
}
diff --git a/src/DependencyTree/DependencyTree_View.h b/src/DependencyTree/DependencyTree_View.h
index 4c1b86e8d..e589958ce 100644
--- a/src/DependencyTree/DependencyTree_View.h
+++ b/src/DependencyTree/DependencyTree_View.h
@@ -20,24 +20,21 @@
#ifndef DEPENDENCYTREE_VIEW_H
#define DEPENDENCYTREE_VIEW_H
+// GEOM includes
+#include
+#include
+
+// GUI includes
#include
#include
-#include
#include
-#include
-
-#include
-#include
-#include
-
-
+// QT includes
#include
#include
#include
#include
-#include
#include
#include
@@ -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;
diff --git a/src/DependencyTree/DependencyTree_ViewModel.cxx b/src/DependencyTree/DependencyTree_ViewModel.cxx
index afeda3d61..a2638b82b 100644
--- a/src/DependencyTree/DependencyTree_ViewModel.cxx
+++ b/src/DependencyTree/DependencyTree_ViewModel.cxx
@@ -18,24 +18,21 @@
//
#include "DependencyTree_ViewModel.h"
-
#include "DependencyTree_View.h"
-#include "GEOM_Displayer.h"
-#include
-#include
-#include
+// GUI includes
+#include
#include
#include
-#include
#include
-#include
-#include
#include
-#include
+// GEOM includes
+#include
+
+// QT includes
#include
-#include
+
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(app->activeStudy());
+ SalomeApp_Study* appStudy = dynamic_cast( 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( vmod ) ) {
+ if ( SUIT_ViewModel* viewModel = anOCCVM->getViewModel() ) {
+ if ( SALOME_View* viewFrame = dynamic_cast( 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(app->activeStudy());
+ SalomeApp_Study* appStudy = dynamic_cast( 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( vmod ) ) {
- disp->EraseAll( true, false, aViewFrame );
+ if ( SUIT_ViewModel* viewModel = anOCCVM->getViewModel() ) {
+ if ( SALOME_View* viewFrame = dynamic_cast( 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(getActiveViewPort()) )
+ if( DependencyTree_View* viewPort = dynamic_cast( 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;
-//}
-
diff --git a/src/DependencyTree/DependencyTree_ViewModel.h b/src/DependencyTree/DependencyTree_ViewModel.h
index e41fd8156..d33f1de4b 100644
--- a/src/DependencyTree/DependencyTree_ViewModel.h
+++ b/src/DependencyTree/DependencyTree_ViewModel.h
@@ -17,27 +17,27 @@
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+#ifndef DEPENDENCYTREE_VIEWMODEL_H
+#define DEPENDENCYTREE_VIEWMODEL_H
+
#include
-#include
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
diff --git a/src/DependencyTree/resources/DependencyTree_msg_en.ts b/src/DependencyTree/resources/DependencyTree_msg_en.ts
index c62ab0de1..42bf72258 100644
--- a/src/DependencyTree/resources/DependencyTree_msg_en.ts
+++ b/src/DependencyTree/resources/DependencyTree_msg_en.ts
@@ -13,7 +13,7 @@
- Hierarchy depth
+ Hierarchy depth
@@ -23,13 +23,22 @@
Display descendants
+
+
+ Show all
+
+
+
+ Update
+
Cancel
-
-
- Canceling...
+ DependencyTree_ViewModel
+
+
+ Rebuild the tree
diff --git a/src/DependencyTree/resources/DependencyTree_msg_fr.ts b/src/DependencyTree/resources/DependencyTree_msg_fr.ts
index b4eae6fca..5f3cbad93 100644
--- a/src/DependencyTree/resources/DependencyTree_msg_fr.ts
+++ b/src/DependencyTree/resources/DependencyTree_msg_fr.ts
@@ -2,11 +2,43 @@
- @default
+ DependencyTree_View
-
- Texture
+
+ Dependency Tree
+
+
+
+ Move nodes
+
+
+
+ Hierarchy depth
+
+
+
+ Display ascendants
+
+
+
+ Display descendants
+
+
+
+ Show all
+
+
+
+ Update
+
+
+
+ Cancel
+
+ DependencyTree_ViewModel
+
+
+ Rebuild the tree
-
diff --git a/src/DependencyTree/resources/DependencyTree_msg_ja.ts b/src/DependencyTree/resources/DependencyTree_msg_ja.ts
index 26250801e..3636aab07 100644
--- a/src/DependencyTree/resources/DependencyTree_msg_ja.ts
+++ b/src/DependencyTree/resources/DependencyTree_msg_ja.ts
@@ -1,12 +1,44 @@
-
- @default
+
+ DependencyTree_View
-
- Texture
+
+ Dependency Tree
-
-
-
+
+
+ Move nodes
+
+
+
+ Hierarchy depth
+
+
+
+ Display ascendants
+
+
+
+ Display descendants
+
+
+
+ Show all
+
+
+
+ Update
+
+
+
+ Cancel
+
+ DependencyTree_ViewModel
+
+
+ Rebuild the tree
+
+
+
\ No newline at end of file
diff --git a/src/GEOMGUI/GEOM_msg_en.ts b/src/GEOMGUI/GEOM_msg_en.ts
index 39e2393f5..5f45808a3 100644
--- a/src/GEOMGUI/GEOM_msg_en.ts
+++ b/src/GEOMGUI/GEOM_msg_en.ts
@@ -4760,6 +4760,10 @@ Please, select face, shell or solid and try again
Manage measurement dimensions of an object
+
+
+ Show dependency tree
+
Show all dimensions
diff --git a/src/GEOMGUI/GEOM_msg_fr.ts b/src/GEOMGUI/GEOM_msg_fr.ts
index df93751d1..7c7878d86 100644
--- a/src/GEOMGUI/GEOM_msg_fr.ts
+++ b/src/GEOMGUI/GEOM_msg_fr.ts
@@ -4760,6 +4760,10 @@ Choisissez une face, une coque ou un solide et essayez de nouveau
GĂ©rer la cotation d'un objet
+
+
+ Show dependency tree
+
Afficher les cotations
diff --git a/src/GEOMGUI/GEOM_msg_ja.ts b/src/GEOMGUI/GEOM_msg_ja.ts
index d445fab84..ecad4cb1f 100644
--- a/src/GEOMGUI/GEOM_msg_ja.ts
+++ b/src/GEOMGUI/GEOM_msg_ja.ts
@@ -4735,6 +4735,10 @@
Manage measurement dimensions of an object
+
+
+ Show dependency tree
+
Show all dimensions
diff --git a/src/GEOMToolsGUI/GEOMToolsGUI_1.cxx b/src/GEOMToolsGUI/GEOMToolsGUI_1.cxx
index fd817c14a..90ea6bf25 100644
--- a/src/GEOMToolsGUI/GEOMToolsGUI_1.cxx
+++ b/src/GEOMToolsGUI/GEOMToolsGUI_1.cxx
@@ -46,7 +46,9 @@
#include
#include
-#include
+#include
+#include
+#include
#include
@@ -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(svw);
+
+ view->init( aViewFrame );
+ svm->setTitle( view->getViewName() );
+ }
+ else
+ if( DependencyTree_ViewModel* viewModel = dynamic_cast( svm->getViewModel() ) )
+ if( DependencyTree_View* view = dynamic_cast( viewModel->getActiveViewPort() ) ) {
+ svm->getActiveView()->setFocus();
+ view->updateModel();
+ }
}