mirror of
https://git.salome-platform.org/gitpub/modules/geom.git
synced 2025-03-26 09:07:55 +05:00
Adjust to HEAD modifications
This commit is contained in:
parent
369e0bc8cb
commit
cced5d27a9
@ -30,28 +30,29 @@
|
|||||||
#include "GeometryGUI.h"
|
#include "GeometryGUI.h"
|
||||||
#include "GEOM_Displayer.h"
|
#include "GEOM_Displayer.h"
|
||||||
|
|
||||||
#include "SUIT_Desktop.h"
|
#include <SUIT_Desktop.h>
|
||||||
#include "SUIT_Session.h"
|
#include <SUIT_Session.h>
|
||||||
#include "SUIT_ViewWindow.h"
|
#include <SUIT_ViewWindow.h>
|
||||||
#include "SUIT_OverrideCursor.h"
|
#include <SUIT_OverrideCursor.h>
|
||||||
|
|
||||||
#include "VTKViewer_ViewWindow.h"
|
#include <OCCViewer_ViewManager.h>
|
||||||
#include "OCCViewer_ViewManager.h"
|
#include <OCCViewer_ViewModel.h>
|
||||||
#include "OCCViewer_ViewModel.h"
|
#include <OCCViewer_ViewWindow.h>
|
||||||
#include "OCCViewer_ViewWindow.h"
|
|
||||||
|
|
||||||
#include "SALOME_ListIteratorOfListIO.hxx"
|
#include <SALOME_ListIteratorOfListIO.hxx>
|
||||||
|
|
||||||
#include "SVTK_ViewWindow.h"
|
#include <SVTK_ViewWindow.h>
|
||||||
#include "SVTK_View.h"
|
#include <SVTK_View.h>
|
||||||
#include "SVTK_ViewModel.h"
|
#include <SVTK_ViewModel.h>
|
||||||
#include "SOCC_ViewModel.h"
|
#include <SOCC_ViewModel.h>
|
||||||
#include "SVTK_Prs.h"
|
#include <SVTK_Prs.h>
|
||||||
#include "SOCC_Prs.h"
|
#include <SOCC_Prs.h>
|
||||||
|
|
||||||
#include "SalomeApp_Application.h"
|
#include <QtxActionMenuMgr.h>
|
||||||
#include "SalomeApp_SelectionMgr.h"
|
|
||||||
#include "SalomeApp_Study.h"
|
#include <SalomeApp_Application.h>
|
||||||
|
#include <LightApp_SelectionMgr.h>
|
||||||
|
#include <SalomeApp_Study.h>
|
||||||
|
|
||||||
#include <AIS_ListIteratorOfListOfInteractive.hxx>
|
#include <AIS_ListIteratorOfListOfInteractive.hxx>
|
||||||
|
|
||||||
@ -98,23 +99,30 @@ DisplayGUI::~DisplayGUI()
|
|||||||
bool DisplayGUI::OnGUIEvent(int theCommandID, SUIT_Desktop* parent)
|
bool DisplayGUI::OnGUIEvent(int theCommandID, SUIT_Desktop* parent)
|
||||||
{
|
{
|
||||||
DisplayGUI* myDisplayGUI = GetDisplayGUI( getGeometryGUI() );
|
DisplayGUI* myDisplayGUI = GetDisplayGUI( getGeometryGUI() );
|
||||||
|
LightApp_SelectionMgr *Sel = getGeometryGUI()->getApp()->selectionMgr();
|
||||||
|
SALOME_ListIO selected;
|
||||||
|
Sel->selectedObjects( selected );
|
||||||
|
|
||||||
switch (theCommandID) {
|
switch (theCommandID) {
|
||||||
case 211: // MENU VIEW - WIREFRAME/SHADING
|
case 211: // MENU VIEW - WIREFRAME/SHADING
|
||||||
{
|
{
|
||||||
myDisplayGUI->InvertDisplayMode();
|
myDisplayGUI->InvertDisplayMode();
|
||||||
int newMode = myDisplayGUI->GetDisplayMode();
|
int newMode = myDisplayGUI->GetDisplayMode();
|
||||||
SUIT_Session::session()->activeApplication()->desktop()->menuBar()->
|
getGeometryGUI()->action( 211 )->setMenuText( newMode == 1 ? tr( "GEOM_MEN_WIREFRAME" ) : tr("GEOM_MEN_SHADING") );
|
||||||
changeItem( 211, newMode == 1 ? tr( "GEOM_MEN_WIREFRAME" ) : tr("GEOM_MEN_SHADING") );
|
getGeometryGUI()->menuMgr()->update();
|
||||||
|
// SUIT_Session::session()->activeApplication()->desktop()->menuBar()->
|
||||||
|
// changeItem( 211, newMode == 1 ? tr( "GEOM_MEN_WIREFRAME" ) : tr("GEOM_MEN_SHADING") );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 212: // MENU VIEW - DISPLAY ALL
|
case 212: // MENU VIEW - DISPLAY ALL
|
||||||
{
|
{
|
||||||
|
getGeometryGUI()->EmitSignalDeactivateDialog();
|
||||||
myDisplayGUI->DisplayAll();
|
myDisplayGUI->DisplayAll();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 213: // MENU VIEW - DISPLAY ONLY
|
case 213: // MENU VIEW - DISPLAY ONLY
|
||||||
{
|
{
|
||||||
|
getGeometryGUI()->EmitSignalDeactivateDialog();
|
||||||
myDisplayGUI->DisplayOnly();
|
myDisplayGUI->DisplayOnly();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -130,6 +138,7 @@ bool DisplayGUI::OnGUIEvent(int theCommandID, SUIT_Desktop* parent)
|
|||||||
}
|
}
|
||||||
case 216: // MENU VIEW - DISPLAY
|
case 216: // MENU VIEW - DISPLAY
|
||||||
{
|
{
|
||||||
|
getGeometryGUI()->EmitSignalDeactivateDialog();
|
||||||
myDisplayGUI->Display();
|
myDisplayGUI->Display();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -149,6 +158,7 @@ bool DisplayGUI::OnGUIEvent(int theCommandID, SUIT_Desktop* parent)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Sel->setSelectedObjects( selected );
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -198,7 +208,7 @@ void DisplayGUI::EraseAll()
|
|||||||
SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>( app->activeStudy() );
|
SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>( app->activeStudy() );
|
||||||
SUIT_ViewManager* vman = vw->getViewManager();
|
SUIT_ViewManager* vman = vw->getViewManager();
|
||||||
if ( vman->getType() == OCCViewer_Viewer::Type() ||
|
if ( vman->getType() == OCCViewer_Viewer::Type() ||
|
||||||
vman->getType() == VTKViewer_Viewer::Type() ) {
|
vman->getType() == SVTK_Viewer::Type() ) {
|
||||||
GEOM_Displayer( appStudy ).EraseAll();
|
GEOM_Displayer( appStudy ).EraseAll();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -230,7 +240,7 @@ void DisplayGUI::Display()
|
|||||||
if ( !anActiveStudy ) return;
|
if ( !anActiveStudy ) return;
|
||||||
|
|
||||||
//get SalomeApp selection manager
|
//get SalomeApp selection manager
|
||||||
SalomeApp_SelectionMgr* aSelMgr = app->selectionMgr();
|
LightApp_SelectionMgr* aSelMgr = app->selectionMgr();
|
||||||
if ( !aSelMgr ) return;
|
if ( !aSelMgr ) return;
|
||||||
|
|
||||||
SALOME_ListIO aList;
|
SALOME_ListIO aList;
|
||||||
@ -286,7 +296,7 @@ void DisplayGUI::Erase()
|
|||||||
if ( !anActiveStudy ) return;
|
if ( !anActiveStudy ) return;
|
||||||
|
|
||||||
//get SalomeApp selection manager
|
//get SalomeApp selection manager
|
||||||
SalomeApp_SelectionMgr* aSelMgr = app->selectionMgr();
|
LightApp_SelectionMgr* aSelMgr = app->selectionMgr();
|
||||||
if ( !aSelMgr ) return;
|
if ( !aSelMgr ) return;
|
||||||
|
|
||||||
SALOME_ListIO aList;
|
SALOME_ListIO aList;
|
||||||
@ -337,7 +347,7 @@ void DisplayGUI::SetDisplayMode( const int mode, SUIT_ViewWindow* viewWindow )
|
|||||||
|
|
||||||
if ( !viewWindow )
|
if ( !viewWindow )
|
||||||
viewWindow = SUIT_Session::session()->activeApplication()->desktop()->activeWindow();
|
viewWindow = SUIT_Session::session()->activeApplication()->desktop()->activeWindow();
|
||||||
if ( viewWindow->getViewManager()->getType() == VTKViewer_Viewer::Type() ) {
|
if ( viewWindow->getViewManager()->getType() == SVTK_Viewer::Type() ) {
|
||||||
SVTK_View* aView = ((SVTK_ViewWindow*)viewWindow)->getView();
|
SVTK_View* aView = ((SVTK_ViewWindow*)viewWindow)->getView();
|
||||||
aView->SetDisplayMode( mode );
|
aView->SetDisplayMode( mode );
|
||||||
}
|
}
|
||||||
@ -373,7 +383,7 @@ int DisplayGUI::GetDisplayMode( SUIT_ViewWindow* viewWindow )
|
|||||||
int dispMode = 0;
|
int dispMode = 0;
|
||||||
if ( !viewWindow )
|
if ( !viewWindow )
|
||||||
viewWindow = SUIT_Session::session()->activeApplication()->desktop()->activeWindow();
|
viewWindow = SUIT_Session::session()->activeApplication()->desktop()->activeWindow();
|
||||||
if ( viewWindow->getViewManager()->getType() == VTKViewer_Viewer::Type() ) {
|
if ( viewWindow->getViewManager()->getType() == SVTK_Viewer::Type() ) {
|
||||||
SVTK_View* aView = ((SVTK_ViewWindow*)viewWindow)->getView();
|
SVTK_View* aView = ((SVTK_ViewWindow*)viewWindow)->getView();
|
||||||
dispMode = aView->GetDisplayMode();
|
dispMode = aView->GetDisplayMode();
|
||||||
}
|
}
|
||||||
@ -409,14 +419,14 @@ void DisplayGUI::ChangeDisplayMode( const int mode, SUIT_ViewWindow* viewWindow
|
|||||||
SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() );
|
SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() );
|
||||||
if ( !app ) return;
|
if ( !app ) return;
|
||||||
|
|
||||||
SalomeApp_SelectionMgr* aSelMgr = app->selectionMgr();
|
LightApp_SelectionMgr* aSelMgr = app->selectionMgr();
|
||||||
if ( !aSelMgr ) return;
|
if ( !aSelMgr ) return;
|
||||||
|
|
||||||
SUIT_OverrideCursor();
|
SUIT_OverrideCursor();
|
||||||
|
|
||||||
SALOME_ListIO aList;
|
SALOME_ListIO aList;
|
||||||
|
|
||||||
if ( viewWindow->getViewManager()->getType() == VTKViewer_Viewer::Type() ) {
|
if ( viewWindow->getViewManager()->getType() == SVTK_Viewer::Type() ) {
|
||||||
SVTK_ViewWindow* vw = dynamic_cast<SVTK_ViewWindow*>( viewWindow );
|
SVTK_ViewWindow* vw = dynamic_cast<SVTK_ViewWindow*>( viewWindow );
|
||||||
SVTK_View* aView = vw->getView();
|
SVTK_View* aView = vw->getView();
|
||||||
|
|
||||||
@ -424,8 +434,8 @@ void DisplayGUI::ChangeDisplayMode( const int mode, SUIT_ViewWindow* viewWindow
|
|||||||
SALOME_ListIteratorOfListIO It( aList );
|
SALOME_ListIteratorOfListIO It( aList );
|
||||||
|
|
||||||
for( ;It.More(); It.Next() ) {
|
for( ;It.More(); It.Next() ) {
|
||||||
SVTK_Viewer* stvkViewer = (SVTK_Viewer*)(vw->getViewManager()->getViewModel());
|
SVTK_Viewer* stvkViewer = dynamic_cast<SVTK_Viewer*>(vw->getViewManager()->getViewModel());
|
||||||
SVTK_Prs* vtkPrs = dynamic_cast<SVTK_Prs*>( stvkViewer->CreatePrs( It.Value()->getEntry() ) );
|
SVTK_Prs* vtkPrs = stvkViewer ? dynamic_cast<SVTK_Prs*>( stvkViewer->CreatePrs( It.Value()->getEntry() ) ) : 0;
|
||||||
if ( vtkPrs && !vtkPrs->IsNull() ) {
|
if ( vtkPrs && !vtkPrs->IsNull() ) {
|
||||||
if ( mode == 0 )
|
if ( mode == 0 )
|
||||||
aView->ChangeRepresentationToWireframe( vtkPrs->GetObjects() );
|
aView->ChangeRepresentationToWireframe( vtkPrs->GetObjects() );
|
||||||
|
@ -41,25 +41,25 @@
|
|||||||
#include "SALOME_ListIO.hxx"
|
#include "SALOME_ListIO.hxx"
|
||||||
#include "SALOME_ListIteratorOfListIO.hxx"
|
#include "SALOME_ListIteratorOfListIO.hxx"
|
||||||
|
|
||||||
#include "VTKViewer_ViewModel.h"
|
#include <SVTK_ViewModel.h>
|
||||||
#include "OCCViewer_ViewModel.h"
|
#include <SVTK_ViewWindow.h>
|
||||||
#include "OCCViewer_ViewWindow.h"
|
#include <SVTK_View.h>
|
||||||
|
|
||||||
#include "SVTK_ViewWindow.h"
|
#include <OCCViewer_ViewModel.h>
|
||||||
#include "SVTK_View.h"
|
#include <OCCViewer_ViewWindow.h>
|
||||||
|
|
||||||
#include "SUIT_ViewManager.h"
|
#include <SUIT_ViewManager.h>
|
||||||
#include "SUIT_Application.h"
|
#include <SUIT_Application.h>
|
||||||
#include "SUIT_Desktop.h"
|
#include <SUIT_Desktop.h>
|
||||||
#include "SUIT_ResourceMgr.h"
|
#include <SUIT_ResourceMgr.h>
|
||||||
#include "SUIT_Session.h"
|
#include <SUIT_Session.h>
|
||||||
#include "SUIT_OverrideCursor.h"
|
#include <SUIT_OverrideCursor.h>
|
||||||
#include "SUIT_MessageBox.h"
|
#include <SUIT_MessageBox.h>
|
||||||
|
|
||||||
#include "SalomeApp_Application.h"
|
#include <SalomeApp_Application.h>
|
||||||
#include "SalomeApp_SelectionMgr.h"
|
#include <LightApp_SelectionMgr.h>
|
||||||
#include "SalomeApp_Study.h"
|
#include <SalomeApp_Study.h>
|
||||||
#include "SalomeApp_Module.h"
|
#include <SalomeApp_Module.h>
|
||||||
|
|
||||||
#include "SALOMEDSClient.hxx"
|
#include "SALOMEDSClient.hxx"
|
||||||
|
|
||||||
@ -100,7 +100,7 @@ void GEOMToolsGUI::OnSettingsColor()
|
|||||||
if( aDialogColor.isValid() )
|
if( aDialogColor.isValid() )
|
||||||
{
|
{
|
||||||
QString type = desk->activeWindow()->getViewManager()->getType();
|
QString type = desk->activeWindow()->getViewManager()->getType();
|
||||||
if( type != OCCViewer_Viewer::Type() && type != VTKViewer_Viewer::Type() )
|
if( type != OCCViewer_Viewer::Type() && type != SVTK_Viewer::Type() )
|
||||||
MESSAGE("Settings Color is not supported for current Viewer");
|
MESSAGE("Settings Color is not supported for current Viewer");
|
||||||
|
|
||||||
resMgr->setValue( "Geometry", "SettingsShadingColor", aDialogColor );
|
resMgr->setValue( "Geometry", "SettingsShadingColor", aDialogColor );
|
||||||
@ -170,7 +170,7 @@ void GEOMToolsGUI::OnRename()
|
|||||||
SALOME_ListIO selected;
|
SALOME_ListIO selected;
|
||||||
SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() );
|
SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() );
|
||||||
if ( app ) {
|
if ( app ) {
|
||||||
SalomeApp_SelectionMgr* aSelMgr = app->selectionMgr();
|
LightApp_SelectionMgr* aSelMgr = app->selectionMgr();
|
||||||
SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>( app->activeStudy() );
|
SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>( app->activeStudy() );
|
||||||
if ( aSelMgr && appStudy ) {
|
if ( aSelMgr && appStudy ) {
|
||||||
aSelMgr->selectedObjects( selected );
|
aSelMgr->selectedObjects( selected );
|
||||||
@ -225,13 +225,13 @@ void GEOMToolsGUI::OnColor()
|
|||||||
SALOME_ListIO selected;
|
SALOME_ListIO selected;
|
||||||
SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() );
|
SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() );
|
||||||
if ( app ) {
|
if ( app ) {
|
||||||
SalomeApp_SelectionMgr* aSelMgr = app->selectionMgr();
|
LightApp_SelectionMgr* aSelMgr = app->selectionMgr();
|
||||||
if ( aSelMgr ) {
|
if ( aSelMgr ) {
|
||||||
aSelMgr->selectedObjects( selected );
|
aSelMgr->selectedObjects( selected );
|
||||||
if ( !selected.IsEmpty() ) {
|
if ( !selected.IsEmpty() ) {
|
||||||
SUIT_ViewWindow* window = app->desktop()->activeWindow();
|
SUIT_ViewWindow* window = app->desktop()->activeWindow();
|
||||||
bool isOCC = ( window && window->getViewManager()->getType() == OCCViewer_Viewer::Type() );
|
bool isOCC = ( window && window->getViewManager()->getType() == OCCViewer_Viewer::Type() );
|
||||||
bool isVTK = ( window && window->getViewManager()->getType() == VTKViewer_Viewer::Type() );
|
bool isVTK = ( window && window->getViewManager()->getType() == SVTK_Viewer::Type() );
|
||||||
if ( isVTK ) {
|
if ( isVTK ) {
|
||||||
SVTK_ViewWindow* vtkVW = dynamic_cast<SVTK_ViewWindow*>( window );
|
SVTK_ViewWindow* vtkVW = dynamic_cast<SVTK_ViewWindow*>( window );
|
||||||
if ( !vtkVW )
|
if ( !vtkVW )
|
||||||
|
@ -33,22 +33,22 @@
|
|||||||
#include "SALOME_ListIO.hxx"
|
#include "SALOME_ListIO.hxx"
|
||||||
#include "SALOME_ListIteratorOfListIO.hxx"
|
#include "SALOME_ListIteratorOfListIO.hxx"
|
||||||
|
|
||||||
#include "VTKViewer_ViewModel.h"
|
#include <SVTK_ViewModel.h>
|
||||||
#include "OCCViewer_ViewModel.h"
|
#include <SVTK_ViewWindow.h>
|
||||||
#include "OCCViewer_ViewWindow.h"
|
#include <SVTK_View.h>
|
||||||
|
|
||||||
#include "SVTK_ViewWindow.h"
|
#include <OCCViewer_ViewModel.h>
|
||||||
#include "SVTK_View.h"
|
#include <OCCViewer_ViewWindow.h>
|
||||||
|
|
||||||
#include "SUIT_ViewManager.h"
|
#include <SUIT_ViewManager.h>
|
||||||
#include "SUIT_Application.h"
|
#include <SUIT_Application.h>
|
||||||
#include "SUIT_Desktop.h"
|
#include <SUIT_Desktop.h>
|
||||||
#include "SUIT_ResourceMgr.h"
|
#include <SUIT_ResourceMgr.h>
|
||||||
#include "SUIT_Session.h"
|
#include <SUIT_Session.h>
|
||||||
#include "SUIT_OverrideCursor.h"
|
#include <SUIT_OverrideCursor.h>
|
||||||
|
|
||||||
#include "SalomeApp_Application.h"
|
#include <SalomeApp_Application.h>
|
||||||
#include "SalomeApp_SelectionMgr.h"
|
#include <LightApp_SelectionMgr.h>
|
||||||
|
|
||||||
#include <qframe.h>
|
#include <qframe.h>
|
||||||
#include <qlabel.h>
|
#include <qlabel.h>
|
||||||
@ -185,7 +185,7 @@ void GEOMToolsGUI_TransparencyDlg::ValueHasChanged( int newValue )
|
|||||||
SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() );
|
SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() );
|
||||||
if ( !app )
|
if ( !app )
|
||||||
return;
|
return;
|
||||||
SalomeApp_SelectionMgr* aSelMgr = app->selectionMgr();
|
LightApp_SelectionMgr* aSelMgr = app->selectionMgr();
|
||||||
if ( !aSelMgr )
|
if ( !aSelMgr )
|
||||||
return;
|
return;
|
||||||
SALOME_ListIO selected;
|
SALOME_ListIO selected;
|
||||||
@ -199,7 +199,7 @@ void GEOMToolsGUI_TransparencyDlg::ValueHasChanged( int newValue )
|
|||||||
|
|
||||||
SUIT_ViewWindow* window = app->desktop()->activeWindow();
|
SUIT_ViewWindow* window = app->desktop()->activeWindow();
|
||||||
bool isOCC = ( window && window->getViewManager()->getType() == OCCViewer_Viewer::Type() );
|
bool isOCC = ( window && window->getViewManager()->getType() == OCCViewer_Viewer::Type() );
|
||||||
bool isVTK = ( window && window->getViewManager()->getType() == VTKViewer_Viewer::Type() );
|
bool isVTK = ( window && window->getViewManager()->getType() == SVTK_Viewer::Type() );
|
||||||
|
|
||||||
if ( isVTK ) {
|
if ( isVTK ) {
|
||||||
SVTK_ViewWindow* vtkVW = dynamic_cast<SVTK_ViewWindow*>( window );
|
SVTK_ViewWindow* vtkVW = dynamic_cast<SVTK_ViewWindow*>( window );
|
||||||
|
Loading…
x
Reference in New Issue
Block a user