mirror of
https://git.salome-platform.org/gitpub/modules/geom.git
synced 2025-01-26 19:10:34 +05:00
Bug IPAL22924 - TC6.5.0: The View->Display mode menu doesn't work
This commit is contained in:
parent
3f8a20c607
commit
06219c5b73
@ -149,6 +149,7 @@ section.png \
|
|||||||
select1.png \
|
select1.png \
|
||||||
sewing.png \
|
sewing.png \
|
||||||
shading.png \
|
shading.png \
|
||||||
|
shading_with_edges.png \
|
||||||
shapesonshape.png \
|
shapesonshape.png \
|
||||||
shared_shapes.png \
|
shared_shapes.png \
|
||||||
sketch.png \
|
sketch.png \
|
||||||
@ -184,6 +185,7 @@ vector.png \
|
|||||||
vector_mode.png \
|
vector_mode.png \
|
||||||
vector2points.png \
|
vector2points.png \
|
||||||
vectordxyz.png \
|
vectordxyz.png \
|
||||||
|
wireframe.png \
|
||||||
whatis.png \
|
whatis.png \
|
||||||
ellipse.png \
|
ellipse.png \
|
||||||
ellipsepointvector.png \
|
ellipsepointvector.png \
|
||||||
|
Binary file not shown.
Before Width: | Height: | Size: 997 B After Width: | Height: | Size: 751 B |
BIN
resources/shading_with_edges.png
Normal file
BIN
resources/shading_with_edges.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 730 B |
BIN
resources/wireframe.png
Normal file
BIN
resources/wireframe.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 568 B |
@ -92,29 +92,15 @@ bool DisplayGUI::OnGUIEvent(int theCommandID, SUIT_Desktop* parent)
|
|||||||
SALOME_ListIO selected;
|
SALOME_ListIO selected;
|
||||||
Sel->selectedObjects( selected );
|
Sel->selectedObjects( selected );
|
||||||
|
|
||||||
QString aDispModeName;
|
|
||||||
int aDispMode;
|
|
||||||
if ( theCommandID == GEOMOp::OpDisplayMode )
|
|
||||||
aDispMode = GetDisplayMode();
|
|
||||||
|
|
||||||
switch ( theCommandID ) {
|
switch ( theCommandID ) {
|
||||||
case GEOMOp::OpDisplayMode: // MENU VIEW - DISPLAY MODE - WIREFRAME/SHADING/SHADING WITH EDGES
|
case GEOMOp::OpDMWireframe: // MENU VIEW - DISPLAY MODE - WIREFRAME
|
||||||
//InvertDisplayMode();
|
SetDisplayMode( 0 );
|
||||||
switch ( aDispMode) {
|
break;
|
||||||
case 0:
|
case GEOMOp::OpDMShading: // MENU VIEW - DISPLAY MODE - SHADING
|
||||||
aDispModeName = tr( "GEOM_MEN_WIREFRAME" );
|
SetDisplayMode( 1 );
|
||||||
break;
|
break;
|
||||||
case 1:
|
case GEOMOp::OpDMShadingWithEdges: // MENU VIEW - DISPLAY MODE - SHADING WITH EDGES
|
||||||
aDispModeName = tr("GEOM_MEN_SHADING");
|
SetDisplayMode( 2 );
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
aDispModeName = tr("GEOM_MEN_SHADING_WITH_EDGES");
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
getGeometryGUI()->action( GEOMOp::OpDisplayMode )->setText( aDispModeName );
|
|
||||||
getGeometryGUI()->menuMgr()->update();
|
|
||||||
break;
|
break;
|
||||||
case GEOMOp::OpShowAll: // MENU VIEW - SHOW ALL
|
case GEOMOp::OpShowAll: // MENU VIEW - SHOW ALL
|
||||||
getGeometryGUI()->EmitSignalDeactivateDialog();
|
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()
|
// function : DisplayGUI::SetVectorsMode()
|
||||||
// purpose : Set vector mode for the viewer
|
// purpose : Set vector mode for the viewer
|
||||||
@ -493,16 +458,6 @@ int DisplayGUI::GetVectorMode( SUIT_ViewWindow* viewWindow )
|
|||||||
return viewWindow->property( "VectorsMode" ).toBool();
|
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()
|
// function : DisplayGUI::ChangeDisplayMode()
|
||||||
// purpose : Set display mode for selected objects in the viewer given
|
// purpose : Set display mode for selected objects in the viewer given
|
||||||
|
@ -59,11 +59,6 @@ public:
|
|||||||
// DISPLAY MODE methods : 0 - wireframe, 1 - shading
|
// DISPLAY MODE methods : 0 - wireframe, 1 - shading
|
||||||
// Set display mode for the viewer (current viewer if <viewWindow> - 0 )
|
// Set display mode for the viewer (current viewer if <viewWindow> - 0 )
|
||||||
void SetDisplayMode( const int, SUIT_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
|
// VECTOR MODE methods
|
||||||
// Set vectror mode for the viewer
|
// Set vectror mode for the viewer
|
||||||
|
@ -1031,10 +1031,18 @@
|
|||||||
<source>ICO_SEWING</source>
|
<source>ICO_SEWING</source>
|
||||||
<translation>sewing.png</translation>
|
<translation>sewing.png</translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>ICO_WIREFRAME</source>
|
||||||
|
<translation>wireframe.png</translation>
|
||||||
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>ICO_SHADING</source>
|
<source>ICO_SHADING</source>
|
||||||
<translation>shading.png</translation>
|
<translation>shading.png</translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>ICO_SHADING_WITH_EDGES</source>
|
||||||
|
<translation>shading_with_edges.png</translation>
|
||||||
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>ICO_VECTOR_MODE</source>
|
<source>ICO_VECTOR_MODE</source>
|
||||||
<translation>vector_mode.png</translation>
|
<translation>vector_mode.png</translation>
|
||||||
|
@ -430,7 +430,9 @@ void GeometryGUI::OnGUIEvent( int id )
|
|||||||
case GEOMOp::OpClsBringToFront: //
|
case GEOMOp::OpClsBringToFront: //
|
||||||
libName = "GEOMToolsGUI";
|
libName = "GEOMToolsGUI";
|
||||||
break;
|
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::OpShowAll: // MENU VIEW - SHOW ALL
|
||||||
case GEOMOp::OpShowOnly: // MENU VIEW - DISPLAY ONLY
|
case GEOMOp::OpShowOnly: // MENU VIEW - DISPLAY ONLY
|
||||||
case GEOMOp::OpHideAll: // MENU VIEW - ERASE ALL
|
case GEOMOp::OpHideAll: // MENU VIEW - ERASE ALL
|
||||||
@ -829,7 +831,9 @@ void GeometryGUI::initialize( CAM_Application* app )
|
|||||||
createGeomAction( GEOMOp::OpCheckGeom, "CHECK_GEOMETRY" );
|
createGeomAction( GEOMOp::OpCheckGeom, "CHECK_GEOMETRY" );
|
||||||
#endif
|
#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::OpShowAll, "DISPLAY_ALL" );
|
||||||
createGeomAction( GEOMOp::OpHideAll, "ERASE_ALL" );
|
createGeomAction( GEOMOp::OpHideAll, "ERASE_ALL" );
|
||||||
createGeomAction( GEOMOp::OpShow, "DISPLAY" );
|
createGeomAction( GEOMOp::OpShow, "DISPLAY" );
|
||||||
@ -1059,9 +1063,11 @@ void GeometryGUI::initialize( CAM_Application* app )
|
|||||||
createMenu( separator(), viewId, -1 );
|
createMenu( separator(), viewId, -1 );
|
||||||
|
|
||||||
int dispmodeId = createMenu( tr( "MEN_DISPLAY_MODE" ), viewId, -1 );
|
int dispmodeId = createMenu( tr( "MEN_DISPLAY_MODE" ), viewId, -1 );
|
||||||
createMenu( GEOMOp::OpDisplayMode, dispmodeId, -1 );
|
createMenu( GEOMOp::OpDMWireframe, dispmodeId, -1 );
|
||||||
createMenu( separator(), dispmodeId, -1 );
|
createMenu( GEOMOp::OpDMShading, dispmodeId, -1 );
|
||||||
createMenu( GEOMOp::OpSwitchVectors, dispmodeId, -1 );
|
createMenu( GEOMOp::OpDMShadingWithEdges, dispmodeId, -1 );
|
||||||
|
createMenu( separator(), dispmodeId, -1 );
|
||||||
|
createMenu( GEOMOp::OpSwitchVectors, dispmodeId, -1 );
|
||||||
|
|
||||||
createMenu( separator(), viewId, -1 );
|
createMenu( separator(), viewId, -1 );
|
||||||
createMenu( GEOMOp::OpShowAll, viewId, -1 );
|
createMenu( GEOMOp::OpShowAll, viewId, -1 );
|
||||||
|
@ -58,10 +58,12 @@ namespace GEOMOp {
|
|||||||
OpIsosWidth = 1261, // POPUP MENU - LINE WIDTH - ISOS WIDTH
|
OpIsosWidth = 1261, // POPUP MENU - LINE WIDTH - ISOS WIDTH
|
||||||
|
|
||||||
// DisplayGUI ----------------//--------------------------------
|
// DisplayGUI ----------------//--------------------------------
|
||||||
OpDisplayMode = 2000, // MENU VIEW - DISPLAY MODE - WIREFRAME/SHADING/SHADING WITH EDGES
|
|
||||||
OpSwitchVectors = 2001, // MENU VIEW - DISPLAY MODE - SHOW/HIDE EDGE DIRECTION
|
OpSwitchVectors = 2001, // MENU VIEW - DISPLAY MODE - SHOW/HIDE EDGE DIRECTION
|
||||||
OpShowAll = 2002, // MENU VIEW - SHOW ALL
|
OpShowAll = 2002, // MENU VIEW - SHOW ALL
|
||||||
OpHideAll = 2003, // MENU VIEW - HIDE 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
|
OpShow = 2100, // POPUP MENU - SHOW
|
||||||
OpShowOnly = 2101, // POPUP MENU - SHOW ONLY
|
OpShowOnly = 2101, // POPUP MENU - SHOW ONLY
|
||||||
OpHide = 2102, // POPUP MENU - HIDE
|
OpHide = 2102, // POPUP MENU - HIDE
|
||||||
|
Loading…
Reference in New Issue
Block a user