X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=src%2FSMESHGUI%2FSMESHGUI.cxx;h=1a79cb09654d1a92e503870ba2cab2b05cab022d;hp=d481b7d9ca0848397e22b028e7f2d9fc359bbcd0;hb=81f4aba6d730b754eeac248a753c33ba673beaa1;hpb=94bdfc735c8615ab24bb304128c1b3c49bc597f4 diff --git a/src/SMESHGUI/SMESHGUI.cxx b/src/SMESHGUI/SMESHGUI.cxx index d481b7d9c..1a79cb096 100644 --- a/src/SMESHGUI/SMESHGUI.cxx +++ b/src/SMESHGUI/SMESHGUI.cxx @@ -95,8 +95,7 @@ #include #include #include - -#include +#include #include "OB_Browser.h" @@ -583,6 +582,10 @@ namespace{ aTitle = QObject::tr( "SKEW_ELEMENTS" ); aControl = SMESH_Actor::eSkew; break; + case 6009: + aTitle = QObject::tr( "VOLUME_3D_ELEMENTS" ); + aControl = SMESH_Actor::eVolume3D; + break; } anActor->SetControlMode(aControl); anActor->GetScalarBarActor()->SetTitle(aTitle.latin1()); @@ -805,8 +808,8 @@ SalomeApp_Module( "SMESH" ) myComponentSMESH = SMESH::SMESH_Gen::_narrow( comp ); } - myActiveDialogBox = 0 ; - myState = -1 ; + myActiveDialogBox = 0; + myState = -1; myDisplayer = 0; SMESH::GetFilterManager(); @@ -824,6 +827,7 @@ SalomeApp_Module( "SMESH" ) SMESHGUI::~SMESHGUI() { SMESH::GetFilterManager()->Destroy(); + SMESH::GetFilterManager() = SMESH::FilterManager::_nil(); } //============================================================================= @@ -1058,6 +1062,10 @@ bool SMESHGUI::OnGUIEvent( int theCommandID ) if( !mgr ) return false; + if (CORBA::is_nil(GetSMESHGen()->GetCurrentStudy())) { + GetSMESHGen()->SetCurrentStudy(_CAST(Study,aStudy)->GetStudy()); + } + SUIT_ViewWindow* view = application()->desktop()->activeWindow(); SVTK_ViewWindow* vtkwnd = dynamic_cast( view ); @@ -1181,11 +1189,11 @@ bool SMESHGUI::OnGUIEvent( int theCommandID ) comp = SC->ComponentDataType().c_str(), val = valSO->GetName().c_str(); - Handle( SALOME_InteractiveObject ) new_obj = + Handle( SALOME_InteractiveObject ) new_obj = new SALOME_InteractiveObject( id.latin1(), comp.latin1(), val.latin1() ); to_process.Append( new_obj ); } - anIter->Next(); + anIter->Next(); } continue; } @@ -2057,6 +2065,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID ) case 6002: case 6003: case 6004: + case 6009: if ( vtkwnd ) { SalomeApp_SelectionMgr* mgr = selectionMgr(); @@ -2278,6 +2287,7 @@ void SMESHGUI::initialize( CAM_Application* app ) createSMESHAction( 6017, "ASPECT_3D", "ICON_ASPECT_3D", 0, true ); createSMESHAction( 6018, "LENGTH_2D", "ICON_LENGTH_2D", 0, true ); createSMESHAction( 6019, "CONNECTION_2D", "ICON_CONNECTION_2D", 0, true ); + createSMESHAction( 6009, "VOLUME_3D", "ICON_VOLUME_3D", 0, true ); createSMESHAction( 400, "NODE", "ICON_DLG_NODE" ); createSMESHAction( 401, "EDGE", "ICON_DLG_EDGE" ); createSMESHAction( 4021, "TRIANGLE", "ICON_DLG_TRIANGLE" ); @@ -2401,6 +2411,7 @@ void SMESHGUI::initialize( CAM_Application* app ) createMenu( 6016, ctrlId, -1 ); createMenu( separator(), ctrlId, -1 ); createMenu( 6017, ctrlId, -1 ); + createMenu( 6009, ctrlId, -1 ); createMenu( separator(), ctrlId, -1 ); createMenu( 400, addId, -1 ); @@ -2475,6 +2486,7 @@ void SMESHGUI::initialize( CAM_Application* app ) createTool( 6016, ctrlTb ); createTool( separator(), ctrlTb ); createTool( 6017, ctrlTb ); + createTool( 6009, ctrlTb ); createTool( separator(), ctrlTb ); createTool( 400, addRemTb ); @@ -2739,6 +2751,10 @@ void SMESHGUI::initialize( CAM_Application* app ) popupMgr()->setRule( action( 6017 ), aMeshInVtkHasVolumes, true ); popupMgr()->setRule( action( 6017 ), "controlMode = 'eAspectRatio3D'", false ); + popupMgr()->insert ( action( 6009 ), anId, -1 ); // VOLUME_3D + popupMgr()->setRule( action( 6009 ), aMeshInVtkHasVolumes, true ); + popupMgr()->setRule( action( 6009 ), "controlMode = 'eVolume3D'", false ); + popupMgr()->insert( separator(), anId, -1 ); popupMgr()->insert( action( 201 ), anId, -1 ); // SCALAR_BAR_PROP @@ -2750,11 +2766,11 @@ void SMESHGUI::initialize( CAM_Application* app ) // Display / Erase //------------------------------------------------- aClient = "($client in {'VTKViewer' 'ObjectBrowser'})"; - QString anActiveVTK = QString("activeView = '%1'").arg(VTKViewer_Viewer::Type()); + QString anActiveVTK = QString("activeView = '%1'").arg(SVTK_Viewer::Type()); QString aSelCount = QString( "%1 > 0" ).arg( QtxPopupMgr::Selection::defSelCountParam() ); - QString aRule = "type='Component' or (" + aClient + " and " + aType + " and " + aSelCount + - " and " + anActiveVTK + " and " + isNotEmpty + " %1 )"; + QString aRule = "$component={'SMESH'} and ( type='Component' or (" + aClient + " and " + + aType + " and " + aSelCount + " and " + anActiveVTK + " and " + isNotEmpty + " %1 ) )"; popupMgr()->insert( action( 301 ), -1, -1 ); // DISPLAY popupMgr()->setRule( action( 301 ), aRule.arg( "and (not isVisible)" ), true); @@ -2837,7 +2853,7 @@ void SMESHGUI::viewManagers( QStringList& list ) const void SMESHGUI::onViewManagerAdded( SUIT_ViewManager* mgr ) { - if ( dynamic_cast( mgr ) ) + if ( dynamic_cast( mgr ) ) SMESH::UpdateSelectionProp( this ); } @@ -3006,6 +3022,11 @@ void SMESHGUI::createPreferences() void SMESHGUI::preferencesChanged( const QString& sect, const QString& name ) { + if( sect=="SMESH" ) + if( name=="selection_object_color" || name=="selection_element_color" || + name=="selection_width" || name=="highlight_color" || name=="highlight_width" || + name=="selection_precision_node" || name=="selection_precision_element" ) + SMESH::UpdateSelectionProp( this ); } //================================================================================