Bug IPAL22924 - TC6.5.0: The View->Display mode menu doesn't work

This commit is contained in:
vsr 2012-04-19 16:23:23 +00:00
parent 3f8a20c607
commit 06219c5b73
9 changed files with 32 additions and 64 deletions

View File

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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 997 B

After

Width:  |  Height:  |  Size: 751 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 730 B

BIN
resources/wireframe.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 568 B

View File

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

View File

@ -59,11 +59,6 @@ public:
// DISPLAY MODE methods : 0 - wireframe, 1 - shading
// Set display mode for the viewer (current viewer if <viewWindow> - 0 )
void SetDisplayMode( const int, SUIT_ViewWindow* = 0 );
// Get display mode of the viewer (current viewer if <viewWindow> - 0 )
int GetDisplayMode( SUIT_ViewWindow* = 0 );
// Invert display mode ( shadin <-> wireframe ) for the viewer
// (current viewer if <viewWindow> = 0 )
void InvertDisplayMode( SUIT_ViewWindow* = 0 );
// VECTOR MODE methods
// Set vectror mode for the viewer

View File

@ -1031,10 +1031,18 @@
<source>ICO_SEWING</source>
<translation>sewing.png</translation>
</message>
<message>
<source>ICO_WIREFRAME</source>
<translation>wireframe.png</translation>
</message>
<message>
<source>ICO_SHADING</source>
<translation>shading.png</translation>
</message>
<message>
<source>ICO_SHADING_WITH_EDGES</source>
<translation>shading_with_edges.png</translation>
</message>
<message>
<source>ICO_VECTOR_MODE</source>
<translation>vector_mode.png</translation>

View File

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

View File

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