From 06219c5b73c1c5a62d3c35f08bdf92cf36e20be5 Mon Sep 17 00:00:00 2001 From: vsr Date: Thu, 19 Apr 2012 16:23:23 +0000 Subject: [PATCH] Bug IPAL22924 - TC6.5.0: The View->Display mode menu doesn't work --- resources/Makefile.am | 2 + resources/shading.png | Bin 997 -> 751 bytes resources/shading_with_edges.png | Bin 0 -> 730 bytes resources/wireframe.png | Bin 0 -> 568 bytes src/DisplayGUI/DisplayGUI.cxx | 61 ++++----------------------- src/DisplayGUI/DisplayGUI.h | 5 --- src/GEOMGUI/GEOM_images.ts | 8 ++++ src/GEOMGUI/GeometryGUI.cxx | 16 ++++--- src/GEOMGUI/GeometryGUI_Operations.h | 4 +- 9 files changed, 32 insertions(+), 64 deletions(-) create mode 100644 resources/shading_with_edges.png create mode 100644 resources/wireframe.png 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 27ca4e1d16d9cc5af0256a0649e3b6a7934e0fcb..909df3d18db75ef00e0791f22d9fbb89e05bad29 100755 GIT binary patch delta 707 zcmV;!0zCcY2k!-tBpd;AQb$4nuFf3k00006VoOIv0RI600RN!9r<0K(7=H(JNliru z+yoO43K|8kn#BMB0&ht~K~y-)jnu!3TvZgn@$Z}2aST}yBt;r40|_<}s}$Qxnw0(x zDfW->kFXHz`~xf$#9B~DBeH^|GL=SUF`CWHd+*-!)8f9_ota&-xp0biAMe9C=bm@F z%mkq8IyUR`Z=WWwS;vn)=zsS2&Yf*=AM!}lf}z?)6yx-)0PyvvA9wrUY_swBvmdgk zqaK(CYAvcdMf@D=s{t@n<-y}G61cgY#BBTF^ySE3{|;1b&?rU`r{BW*V%&T09X`5q zYxCKM+vveIc=+~$u7ek=veTdCV#ac@^^*>m0WUJju)+;D32cL8X4sGsge`002ovPDHLkV1fdeUtjRI+y?e7jKeZ#YO-C16xT%K~#9!T+BfY05Avxz!riU{L8>nyX--- z>;xQb<06UG-Ofx@6(RyJNthYpv(FJgEXabYs;d7%24B5;l?TX`e*j`01}s2NPw)Tt z@8212-@c7uFhBq?!c5lG)ck+r#toQ368H=Rf-gY)LPSL5$eTBBKx)3i%mD}>xC=pE z1A6rf8yg$L`Sa&PKpLPLF@UM5>4o?2-!r^^{Tjqo0pdF#LqQyX0AfK7gKO8WC4gLI zWo5O7i;IhagM)*Ce}#nw9Bv@|_wQeZFJHbe96o$lBCKuii*Ls009Iy z5Tp_6O@?E~j^T7+LhYstqNe#Te*F5&@aNATmQwf6MUo^9P2n-+wW1NXs(3 z0~+@0=MSv01rR{!2EqU+fbTZVJpBLX_s`kC)*C z(4fCSum1Y;kKsEonSB2Co8iaTPjFZL0eSc5H-^8zvBxq%0KpA>_wF6oYanla{`d}P z*l%FK{{)BC?{6O&ego;hz=#0FE+Z2&!+&6|!3F>V2*tpcFJFLDKMN}-Si}E6KNF%`SWLn{|wB)0uLB=U*3Sd1q!D>KfZ!p`3LB- ze^5gi8JSR01u_5#AV#DDRv(rp4I)~=27$Z?F&LO0fv)}k59sRu{}>*h-U!ow0IFvJ z(431P0e}EPHc%NzfeHm1AogLv4-O!ei${QXGY!xjaA^Y&K*%Nb3#cRmw!#5h0SnFZ fN1$vl00=Mu(OSgff^0Mz00000NkvXXu0mjf;x@b< diff --git a/resources/shading_with_edges.png b/resources/shading_with_edges.png new file mode 100644 index 0000000000000000000000000000000000000000..a452c544c7c31b700d4794a2cd2c5b7477212a43 GIT binary patch literal 730 zcmV<00ww*4P)Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FZT01FZU(%pXi00007bV*G`2iyb` z5DPXgY{zE+00LS`L_t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y=r58Of zPS`YZ+U+o=k?em66G=~xb=)oYMon2K>;P|~+0O}^^4{I@vj7QhM55V_0An{Ln(e#q z*CNmS^;dqEwVx;2nxV9*?Q+Lkk>Y3;=tr|}E^Tt)S3}zDt8Nqc1N;CYFnG#CU=dgb zmZI602_AmZ>XpEe&%<9SDmCWjld!R0000selectedObjects( 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 -- 2.39.2