#include <QAction>
-void OCCViewer_Utilities::setViewer2DMode( OCCViewer_Viewer* theViewer,
+OCCViewer_ViewWindow::Mode2dType OCCViewer_Utilities::setViewer2DMode
+ ( OCCViewer_Viewer* theViewer,
const OCCViewer_ViewWindow::Mode2dType& theMode )
{
+ OCCViewer_ViewWindow::Mode2dType anOldMode = OCCViewer_ViewWindow::No2dMode;
OCCViewer_ViewFrame* aFrame = dynamic_cast<OCCViewer_ViewFrame*>
( theViewer->getViewManager()->getActiveView() );
OCCViewer_ViewWindow* aView = aFrame ? aFrame->getView( OCCViewer_ViewFrame::MAIN_VIEW ) : 0;
if ( !aView )
- return;
+ return anOldMode;
// set a view mode
+ anOldMode = aView->get2dMode();
aView->set2dMode( theMode );
bool is2dMode = theMode != OCCViewer_ViewWindow::No2dMode;
break;
}
}
+
+ return anOldMode;
}
* Set 2D mode for the viewer. Hide or show 3D actions.
* \param theViewer an OCC viewer
* \param theMode OCC view window mode
+ * \return the old 2d mode.
*/
- static void setViewer2DMode( OCCViewer_Viewer* theViewer,
+ static OCCViewer_ViewWindow::Mode2dType
+ setViewer2DMode( OCCViewer_Viewer* theViewer,
const OCCViewer_ViewWindow::Mode2dType& theMode );
};