- OCCViewer_ViewWindow* anOCCViewWindow =
- dynamic_cast<OCCViewer_ViewWindow*>(theViewWindow);
- if ( !anOCCViewWindow ) {
- return;
+ double X, Y, Z;
+ bool doShow = false;
+ HYDROGUI_Displayer* aDisplayer = getDisplayer();
+ if ( aDisplayer )
+ aDisplayer->SaveCursorViewPosition( theViewWindow );
+ doShow = aDisplayer->GetCursorViewCoordinates( theViewWindow, X, Y, Z );
+
+ if ( doShow )
+ {
+ // Show the coordinates in the status bar
+ SUIT_Desktop* aDesktop = getApp()->desktop();
+ if ( aDesktop && aDesktop->statusBar() )
+ {
+ gp_Pnt aWPnt( X, Y, Z );
+ int aStudyId = application()->activeStudy()->id();
+ HYDROData_Document::Document( aStudyId )->Transform( aWPnt, false );
+ double WX = aWPnt.X(), WY = aWPnt.Y();
+
+ QString aXStr = HYDROGUI_Tool::GetCoordinateString( X, true );
+ QString anYStr = HYDROGUI_Tool::GetCoordinateString( Y, true );
+ QString aWXStr = HYDROGUI_Tool::GetCoordinateString( WX, true );
+ QString aWYStr = HYDROGUI_Tool::GetCoordinateString( WY, true );
+ QString aMsg = tr( "COORDINATES_INFO" );
+ aMsg = aMsg.arg( aXStr ).arg( anYStr ).arg( aWXStr ).arg( aWYStr );
+ aDesktop->statusBar()->showMessage( aMsg );
+ }