From: vsr Date: Thu, 19 Apr 2012 16:23:23 +0000 (+0000) Subject: Bug IPAL22924 - TC6.5.0: The View->Display mode menu doesn't work X-Git-Tag: TRIPOLI_323~15 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=06219c5b73c1c5a62d3c35f08bdf92cf36e20be5;p=modules%2Fgeom.git Bug IPAL22924 - TC6.5.0: The View->Display mode menu doesn't work --- diff --git a/resources/Makefile.am b/resources/Makefile.am index f0ffacaf0..187ca89c6 100644 --- a/resources/Makefile.am +++ b/resources/Makefile.am @@ -149,6 +149,7 @@ section.png \ select1.png \ sewing.png \ shading.png \ +shading_with_edges.png \ shapesonshape.png \ shared_shapes.png \ sketch.png \ @@ -184,6 +185,7 @@ vector.png \ vector_mode.png \ vector2points.png \ vectordxyz.png \ +wireframe.png \ whatis.png \ ellipse.png \ ellipsepointvector.png \ diff --git a/resources/shading.png b/resources/shading.png index 27ca4e1d1..909df3d18 100755 Binary files a/resources/shading.png and b/resources/shading.png differ diff --git a/resources/shading_with_edges.png b/resources/shading_with_edges.png new file mode 100644 index 000000000..a452c544c Binary files /dev/null and b/resources/shading_with_edges.png differ diff --git a/resources/wireframe.png b/resources/wireframe.png new file mode 100644 index 000000000..e500831bc Binary files /dev/null and b/resources/wireframe.png differ diff --git a/src/DisplayGUI/DisplayGUI.cxx b/src/DisplayGUI/DisplayGUI.cxx index 6badd1c08..e0e94a8ee 100644 --- a/src/DisplayGUI/DisplayGUI.cxx +++ b/src/DisplayGUI/DisplayGUI.cxx @@ -92,29 +92,15 @@ bool DisplayGUI::OnGUIEvent(int theCommandID, SUIT_Desktop* parent) SALOME_ListIO selected; Sel->selectedObjects( selected ); - QString aDispModeName; - int aDispMode; - if ( theCommandID == GEOMOp::OpDisplayMode ) - aDispMode = GetDisplayMode(); - switch ( theCommandID ) { - case GEOMOp::OpDisplayMode: // MENU VIEW - DISPLAY MODE - WIREFRAME/SHADING/SHADING WITH EDGES - //InvertDisplayMode(); - switch ( aDispMode) { - case 0: - aDispModeName = tr( "GEOM_MEN_WIREFRAME" ); - break; - case 1: - aDispModeName = tr("GEOM_MEN_SHADING"); - break; - case 2: - aDispModeName = tr("GEOM_MEN_SHADING_WITH_EDGES"); - break; - default: - break; - } - getGeometryGUI()->action( GEOMOp::OpDisplayMode )->setText( aDispModeName ); - getGeometryGUI()->menuMgr()->update(); + case GEOMOp::OpDMWireframe: // MENU VIEW - DISPLAY MODE - WIREFRAME + SetDisplayMode( 0 ); + break; + case GEOMOp::OpDMShading: // MENU VIEW - DISPLAY MODE - SHADING + SetDisplayMode( 1 ); + break; + case GEOMOp::OpDMShadingWithEdges: // MENU VIEW - DISPLAY MODE - SHADING WITH EDGES + SetDisplayMode( 2 ); break; case GEOMOp::OpShowAll: // MENU VIEW - SHOW ALL getGeometryGUI()->EmitSignalDeactivateDialog(); @@ -411,27 +397,6 @@ void DisplayGUI::SetDisplayMode( const int mode, SUIT_ViewWindow* viewWindow ) } } -//===================================================================================== -// function : DisplayGUI::GetDisplayMode() -// purpose : Get display mode of the viewer (current viewer if - 0 ) -//===================================================================================== -int DisplayGUI::GetDisplayMode( SUIT_ViewWindow* viewWindow ) -{ - int dispMode = 0; - if ( !viewWindow ) - viewWindow = getGeometryGUI()->getApp()->desktop()->activeWindow(); - if ( viewWindow->getViewManager()->getType() == SVTK_Viewer::Type() ) { - SVTK_View* aView = ((SVTK_ViewWindow*)viewWindow)->getView(); - dispMode = aView->GetDisplayMode(); - } - else if ( viewWindow->getViewManager()->getType() == OCCViewer_Viewer::Type() ) { - OCCViewer_Viewer* v3d = ((OCCViewer_ViewManager*)(viewWindow->getViewManager()))->getOCCViewer(); - Handle(AIS_InteractiveContext) ic = v3d->getAISContext(); - dispMode = ic->DisplayMode(); - } - return dispMode; -} - //===================================================================================== // function : DisplayGUI::SetVectorsMode() // purpose : Set vector mode for the viewer @@ -493,16 +458,6 @@ int DisplayGUI::GetVectorMode( SUIT_ViewWindow* viewWindow ) return viewWindow->property( "VectorsMode" ).toBool(); } -//===================================================================================== -// function : DisplayGUI::InvertDisplayMode() -// purpose : Invert display mode ( shading <-> wireframe ) for the viewer -// (current viewer if = 0 ) -//===================================================================================== -void DisplayGUI::InvertDisplayMode( SUIT_ViewWindow* viewWindow ) -{ - SetDisplayMode( 1 - GetDisplayMode( viewWindow ) ); -} - //===================================================================================== // function : DisplayGUI::ChangeDisplayMode() // purpose : Set display mode for selected objects in the viewer given diff --git a/src/DisplayGUI/DisplayGUI.h b/src/DisplayGUI/DisplayGUI.h index df1c1826d..a52fe0352 100644 --- a/src/DisplayGUI/DisplayGUI.h +++ b/src/DisplayGUI/DisplayGUI.h @@ -59,11 +59,6 @@ public: // DISPLAY MODE methods : 0 - wireframe, 1 - shading // Set display mode for the viewer (current viewer if - 0 ) void SetDisplayMode( const int, SUIT_ViewWindow* = 0 ); - // Get display mode of the viewer (current viewer if - 0 ) - int GetDisplayMode( SUIT_ViewWindow* = 0 ); - // Invert display mode ( shadin <-> wireframe ) for the viewer - // (current viewer if = 0 ) - void InvertDisplayMode( SUIT_ViewWindow* = 0 ); // VECTOR MODE methods // Set vectror mode for the viewer diff --git a/src/GEOMGUI/GEOM_images.ts b/src/GEOMGUI/GEOM_images.ts index f6ae56bb9..98439825d 100644 --- a/src/GEOMGUI/GEOM_images.ts +++ b/src/GEOMGUI/GEOM_images.ts @@ -1031,10 +1031,18 @@ ICO_SEWING sewing.png + + ICO_WIREFRAME + wireframe.png + ICO_SHADING shading.png + + ICO_SHADING_WITH_EDGES + shading_with_edges.png + ICO_VECTOR_MODE vector_mode.png diff --git a/src/GEOMGUI/GeometryGUI.cxx b/src/GEOMGUI/GeometryGUI.cxx index 685c6551b..1a344a254 100644 --- a/src/GEOMGUI/GeometryGUI.cxx +++ b/src/GEOMGUI/GeometryGUI.cxx @@ -430,7 +430,9 @@ void GeometryGUI::OnGUIEvent( int id ) case GEOMOp::OpClsBringToFront: // libName = "GEOMToolsGUI"; break; - case GEOMOp::OpDisplayMode: // MENU VIEW - WIREFRAME/SHADING + case GEOMOp::OpDMWireframe: // MENU VIEW - WIREFRAME + case GEOMOp::OpDMShading: // MENU VIEW - SHADING + case GEOMOp::OpDMShadingWithEdges: // MENU VIEW - SHADING case GEOMOp::OpShowAll: // MENU VIEW - SHOW ALL case GEOMOp::OpShowOnly: // MENU VIEW - DISPLAY ONLY case GEOMOp::OpHideAll: // MENU VIEW - ERASE ALL @@ -829,7 +831,9 @@ void GeometryGUI::initialize( CAM_Application* app ) createGeomAction( GEOMOp::OpCheckGeom, "CHECK_GEOMETRY" ); #endif - createGeomAction( GEOMOp::OpDisplayMode, "SHADING" ); + createGeomAction( GEOMOp::OpDMWireframe, "WIREFRAME" ); + createGeomAction( GEOMOp::OpDMShading, "SHADING" ); + createGeomAction( GEOMOp::OpDMShadingWithEdges, "SHADING_WITH_EDGES" ); createGeomAction( GEOMOp::OpShowAll, "DISPLAY_ALL" ); createGeomAction( GEOMOp::OpHideAll, "ERASE_ALL" ); createGeomAction( GEOMOp::OpShow, "DISPLAY" ); @@ -1059,9 +1063,11 @@ void GeometryGUI::initialize( CAM_Application* app ) createMenu( separator(), viewId, -1 ); int dispmodeId = createMenu( tr( "MEN_DISPLAY_MODE" ), viewId, -1 ); - createMenu( GEOMOp::OpDisplayMode, dispmodeId, -1 ); - createMenu( separator(), dispmodeId, -1 ); - createMenu( GEOMOp::OpSwitchVectors, dispmodeId, -1 ); + createMenu( GEOMOp::OpDMWireframe, dispmodeId, -1 ); + createMenu( GEOMOp::OpDMShading, dispmodeId, -1 ); + createMenu( GEOMOp::OpDMShadingWithEdges, dispmodeId, -1 ); + createMenu( separator(), dispmodeId, -1 ); + createMenu( GEOMOp::OpSwitchVectors, dispmodeId, -1 ); createMenu( separator(), viewId, -1 ); createMenu( GEOMOp::OpShowAll, viewId, -1 ); diff --git a/src/GEOMGUI/GeometryGUI_Operations.h b/src/GEOMGUI/GeometryGUI_Operations.h index 816c5a61c..807643831 100644 --- a/src/GEOMGUI/GeometryGUI_Operations.h +++ b/src/GEOMGUI/GeometryGUI_Operations.h @@ -58,10 +58,12 @@ namespace GEOMOp { OpIsosWidth = 1261, // POPUP MENU - LINE WIDTH - ISOS WIDTH // DisplayGUI ----------------//-------------------------------- - OpDisplayMode = 2000, // MENU VIEW - DISPLAY MODE - WIREFRAME/SHADING/SHADING WITH EDGES OpSwitchVectors = 2001, // MENU VIEW - DISPLAY MODE - SHOW/HIDE EDGE DIRECTION OpShowAll = 2002, // MENU VIEW - SHOW ALL OpHideAll = 2003, // MENU VIEW - HIDE ALL + OpDMWireframe = 2010, // MENU VIEW - DISPLAY MODE - WIREFRAME + OpDMShading = 2011, // MENU VIEW - DISPLAY MODE - SHADING + OpDMShadingWithEdges = 2012, // MENU VIEW - DISPLAY MODE - SHADING WITH EDGES OpShow = 2100, // POPUP MENU - SHOW OpShowOnly = 2101, // POPUP MENU - SHOW ONLY OpHide = 2102, // POPUP MENU - HIDE