- add new translation

- correct some files
This commit is contained in:
mpa 2014-06-03 10:14:22 +04:00
parent d2cf8fc7f2
commit 589fb20740
17 changed files with 220 additions and 285 deletions

View 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 -->

View 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}")

View File

@ -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()
{
}

View File

@ -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;
};

View File

@ -46,7 +46,7 @@ public:
std::string getEntry() const;
GEOM::GEOM_BaseObject_var getGeomObject() const;
GEOM::GEOM_BaseObject_var getGeomObject() const;
void updateName();

View 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 ) );
}
}
}
//=================================================================================

View File

@ -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 <GEOMBase.h>
// GUI includes
#include <SUIT_Session.h>
#include <SUIT_ResourceMgr.h>
@ -31,17 +30,20 @@
#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 );
}

View File

@ -20,24 +20,21 @@
#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;

View File

@ -18,24 +18,21 @@
//
#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;
//}

View File

@ -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 <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

View 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>
@ -23,13 +23,22 @@
<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>

View 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>

View 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>
<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>

View 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>

View 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>

View File

@ -4735,6 +4735,10 @@
<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>

View 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();
}
}