mirror of
https://git.salome-platform.org/gitpub/modules/geom.git
synced 2024-12-25 17:00:35 +05:00
0022472: EDF 2690 Reduce Study: Delete cyclic dependency
This commit is contained in:
parent
9e822ecfcd
commit
b0494784bf
@ -32,7 +32,6 @@ INCLUDE_DIRECTORIES(
|
||||
${PROJECT_SOURCE_DIR}/src/OBJECT
|
||||
${PROJECT_SOURCE_DIR}/src/GEOMUtils
|
||||
${PROJECT_SOURCE_DIR}/src/GEOMClient
|
||||
${PROJECT_SOURCE_DIR}/src/GEOMToolsGUI
|
||||
${PROJECT_BINARY_DIR}/idl
|
||||
)
|
||||
|
||||
@ -51,7 +50,6 @@ SET(_link_LIBRARIES
|
||||
${GUI_GraphicsView}
|
||||
GEOM
|
||||
GEOMBase
|
||||
GEOMToolsGUI
|
||||
)
|
||||
|
||||
# --- headers ---
|
||||
|
@ -31,7 +31,7 @@
|
||||
|
||||
// GEOM includes
|
||||
#include <GEOM_Displayer.h>
|
||||
#include <GEOMToolsGUI_ReduceStudyDlg.h>
|
||||
#include <GeometryGUI_Operations.h>
|
||||
|
||||
// QT includes
|
||||
#include <QMenu>
|
||||
@ -113,18 +113,6 @@ void DependencyTree_ViewModel::onShowOnlySelected()
|
||||
}
|
||||
}
|
||||
|
||||
//=================================================================================
|
||||
// function : onReduceStudy()
|
||||
// purpose : slot for showing dialog box "Reduce Study"
|
||||
//=================================================================================
|
||||
void DependencyTree_ViewModel::onReduceStudy()
|
||||
{
|
||||
DependencyTree_View* viewPort = dynamic_cast<DependencyTree_View*>( getActiveViewPort() );
|
||||
QDialog* dlg = new GEOMToolsGUI_ReduceStudyDlg( viewPort );
|
||||
if( dlg != NULL )
|
||||
dlg->show();
|
||||
}
|
||||
|
||||
//=================================================================================
|
||||
// function : contextMenuPopup()
|
||||
// purpose : process calling of context menu popup
|
||||
@ -137,12 +125,14 @@ void DependencyTree_ViewModel::contextMenuPopup( QMenu* theMenu )
|
||||
{
|
||||
int aNbSelected = viewPort->nbSelected();
|
||||
if( aNbSelected > 0 ) {
|
||||
SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() );
|
||||
GeometryGUI* aGeomGUI = dynamic_cast<GeometryGUI*>( app->module( "Geometry" ) );
|
||||
theMenu->clear();
|
||||
theMenu->addAction( tr( "MEN_DISPLAY" ), this, SLOT( onShowSelected() ) );
|
||||
theMenu->addAction( tr( "MEN_DISPLAY_ONLY" ), this, SLOT( onShowOnlySelected() ) );
|
||||
theMenu->addAction( tr( "MEN_REBUILD_THE_TREE"), viewPort, SLOT( onRebuildModel() ) );
|
||||
theMenu->addSeparator();
|
||||
theMenu->addAction( tr( "MEN_REDUCE_STUDY" ), this, SLOT( onReduceStudy() ) );
|
||||
theMenu->addAction( aGeomGUI->action( GEOMOp::OpReduceStudy ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -41,7 +41,6 @@ private slots:
|
||||
|
||||
void onShowSelected();
|
||||
void onShowOnlySelected();
|
||||
void onReduceStudy();
|
||||
|
||||
};
|
||||
|
||||
|
@ -65,6 +65,8 @@
|
||||
#include <SVTK_InteractorStyle.h>
|
||||
#include <SVTK_ViewModel.h>
|
||||
|
||||
#include <GraphicsView_Viewer.h>
|
||||
|
||||
#include <SalomeApp_Application.h>
|
||||
#include <SalomeApp_DataObject.h>
|
||||
#include <SalomeApp_Study.h>
|
||||
@ -433,6 +435,7 @@ void GeometryGUI::OnGUIEvent( int id, const QVariant& theParam )
|
||||
SUIT_ViewWindow* window = desk->activeWindow();
|
||||
bool ViewOCC = ( window && window->getViewManager()->getType() == OCCViewer_Viewer::Type() );
|
||||
bool ViewVTK = ( window && window->getViewManager()->getType() == SVTK_Viewer::Type() );
|
||||
bool ViewDep = ( window && window->getViewManager()->getType() == GraphicsView_Viewer::Type() );
|
||||
// if current viewframe is not of OCC and not of VTK type - return immediately
|
||||
// fix for IPAL8958 - allow some commands to execute even when NO viewer is active (rename for example)
|
||||
QList<int> NotViewerDependentCommands;
|
||||
@ -447,7 +450,7 @@ void GeometryGUI::OnGUIEvent( int id, const QVariant& theParam )
|
||||
<< GEOMOp::OpPointMarker
|
||||
<< GEOMOp::OpCreateFolder
|
||||
<< GEOMOp::OpSortChildren;
|
||||
if ( !ViewOCC && !ViewVTK && !NotViewerDependentCommands.contains( id ) ) {
|
||||
if ( !ViewOCC && !ViewVTK && !ViewDep && !NotViewerDependentCommands.contains( id ) ) {
|
||||
// activate OCC viewer
|
||||
getApp()->getViewManager(OCCViewer_Viewer::Type(), /*create=*/true);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user