- Additinally: show "Return to 3D" button in 2D projection views to quickly switch to 3D mode
view area to the minimized / maximized state.
<hr>
+\image html occ_view_return_3d_view.png
+
+<b>Return to 3D</b> - this button switches from 2D view projection back to the 3D view mode.
+<hr>
+
\image html occ_view_sync.png
<b>Synchronize view</b> - allows to synchronize 3d view
resources/occ_view_preselection.png
resources/occ_view_presets.png
resources/occ_view_reset.png
+ resources/occ_view_return_3d_view.png
resources/occ_view_right.png
resources/occ_view_rotate.png
resources/occ_view_rotation_point.png
}
}
+//**************************************************************************************
+void OCCViewer_ViewFrame::returnTo3dView()
+{
+ OCCViewer_ViewWindow* view = 0;
+ for (int i = BOTTOM_RIGHT; i <= TOP_RIGHT; i++ ) {
+ view = myViews.at(i);
+ view->setVisible( view->get2dMode() == No2dMode );
+ view->setMaximized( true, false );
+ if (view->get2dMode() == No2dMode) myMaximizedView = view;
+ }
+ myLayout->setColumnStretch(0, 0);
+ myLayout->setColumnStretch(1, 0);
+ myLayout->addWidget( myMaximizedView, 0, 0 );
+ mySplitMode = -1;
+ myViewsMode.clear();
+ myLayout->invalidate();
+}
+
//**************************************************************************************
void OCCViewer_ViewFrame::onMaximizedView( OCCViewer_ViewWindow* theView, bool isMaximized)
{
}
OCCViewer_ViewWindow* view = 0;
+ bool isVisible3dView = false;
for ( int i = 0; i< myViews.count(); i++ ) {
view = myViews.at(i);
bool isShowed = false;
if( isShowed ) {
view->show();
view->setMaximized( false, false );
+ if ( view->get2dMode() == No2dMode ) isVisible3dView = true;
///////////////QApplication::processEvents(); // VSR: hangs up ?
if ( view != myMaximizedView )
view->onViewFitAll();
else
view->setVisible( false );
}
+ if ( !isVisible3dView ) {
+ for ( int i = 0; i< myViews.count(); i++ ){
+ view = myViews.at(i);
+ if( view->isVisible() )
+ view->setReturnedTo3dView( false );
+ }
+ }
}
//**************************************************************************************
//**************************************************************************************
void OCCViewer_ViewFrame::connectViewSignals(OCCViewer_ViewWindow* theView)
{
+ connect( theView, SIGNAL( returnedTo3d( ) ), this, SLOT( returnTo3dView( ) ) );
+
connect( theView, SIGNAL( maximized( OCCViewer_ViewWindow*, bool ) ),
this, SLOT( onMaximizedView( OCCViewer_ViewWindow*, bool ) ) );
virtual void updateGravityCoords() {}
void onMaximizedView( OCCViewer_ViewWindow*, bool );
+ void returnTo3dView();
virtual void onDumpView();
connect(aAction, SIGNAL(triggered()), this, SLOT(onMaximizedView()));
toolMgr()->registerAction( aAction, MaximizedId );
+ // Return to 3d view
+ if (my2dMode!=No2dMode){
+ aAction = new QtxAction(tr("MNU_RETURN_3D_VIEW"), aResMgr->loadPixmap( "OCCViewer", tr( "ICON_OCCVIEWER_RETURN_3D_VIEW" ) ),
+ tr( "MNU_RETURN_3D_VIEW" ), 0, this );
+ aAction->setStatusTip(tr("DSC_RETURN_3D_VIEW"));
+ connect(aAction, SIGNAL(triggered()), this, SLOT(returnTo3dView()));
+ toolMgr()->registerAction( aAction, ReturnTo3dViewId );
+ }
+
// Synchronize View
toolMgr()->registerAction( synchronizeAction(), SynchronizeId );
}
}
int tid = toolMgr()->createToolBar( aToolbarName, false );
-
+ if ( my2dMode != No2dMode ){
+ toolMgr()->append( ReturnTo3dViewId, tid );
+ toolMgr()->append( toolMgr()->separator(), tid );
+ }
toolMgr()->append( DumpId, tid );
toolMgr()->append( SwitchInteractionStyleId, tid );
#if OCC_VERSION_LARGE > 0x0603000A // available only with OCC-6.3-sp11 and higher version
setMaximized(!isMaximized());
}
+void OCCViewer_ViewWindow::returnTo3dView()
+{
+ setReturnedTo3dView( true );
+}
+
+void OCCViewer_ViewWindow::setReturnedTo3dView(bool isVisible3dView)
+{
+ if ( !toolMgr()->action( ReturnTo3dViewId ) ||
+ toolMgr()->isShown(ReturnTo3dViewId) != isVisible3dView ) return;
+ if ( !isVisible3dView )
+ toolMgr()->show( ReturnTo3dViewId );
+ else
+ toolMgr()->hide( ReturnTo3dViewId );
+ if ( isVisible3dView ) emit returnedTo3d( );
+}
+
void OCCViewer_ViewWindow::setMaximized(bool toMaximize, bool toSendSignal)
{
QAction* anAction = toolMgr()->action( MaximizedId );
+ QAction* anAction2 = toolMgr()->action( ReturnTo3dViewId );
SUIT_ResourceMgr* aResMgr = SUIT_Session::session()->resourceMgr();
if ( toMaximize ) {
anAction->setText( tr( "MNU_MINIMIZE_VIEW" ) );
anAction->setToolTip( tr( "MNU_MINIMIZE_VIEW" ) );
anAction->setIcon( aResMgr->loadPixmap( "OCCViewer", tr( "ICON_OCCVIEWER_MINIMIZE" ) ) );
anAction->setStatusTip( tr( "DSC_MINIMIZE_VIEW" ) );
+ if ( anAction2 && my2dMode != No2dMode ) toolMgr()->show( ReturnTo3dViewId );
if (toSendSignal) {
emit maximized( this, true );
}
anAction->setToolTip( tr( "MNU_MAXIMIZE_VIEW" ) );
anAction->setIcon( aResMgr->loadPixmap( "OCCViewer", tr( "ICON_OCCVIEWER_MAXIMIZE" ) ) );
anAction->setStatusTip( tr( "DSC_MAXIMIZE_VIEW" ) );
+ if ( anAction2 && my2dMode != No2dMode ) toolMgr()->hide( ReturnTo3dViewId );
if (toSendSignal) {
emit maximized( this, false );
}
}
}
-
bool OCCViewer_ViewWindow::isMaximized() const
{
return !(toolMgr()->action( MaximizedId )->text() == tr( "MNU_MAXIMIZE_VIEW" ));
TrihedronShowId, AxialScaleId, GraduatedAxesId, AmbientId,
SwitchInteractionStyleId, SwitchZoomingStyleId,
SwitchPreselectionId, SwitchSelectionId,
- MaximizedId, SynchronizeId,
+ MaximizedId, SynchronizeId, ReturnTo3dViewId,
UserId };
enum OperationType{ NOTHING, PANVIEW, ZOOMVIEW, ROTATE,
void setMaximized( bool, bool = true );
bool isMaximized() const;
+ void setReturnedTo3dView( bool = true );
void setSketcherStyle( bool enable );
bool isSketcherStyle() const;
virtual void hideEvent( QHideEvent * );
virtual void onMaximizedView();
+ virtual void returnTo3dView();
signals:
void vpTransformationStarted(OCCViewer_ViewWindow::OperationType type);
void Show( QShowEvent * );
void Hide( QHideEvent * );
void maximized( OCCViewer_ViewWindow*, bool );
+ void returnedTo3d( );
protected slots:
void synchronize( SUIT_ViewWindow* );
<source>ICON_OCCVIEWER_MINIMIZE</source>
<translation>occ_view_minimized.png</translation>
</message>
+ <message>
+ <source>ICON_OCCVIEWER_RETURN_3D_VIEW</source>
+ <translation>occ_view_return_3d_view.png</translation>
+ </message>
<message>
<source>ICON_OCCVIEWER_PRESELECTION</source>
<translation>occ_view_preselection.png</translation>
<source>DSC_MINIMIZE_VIEW</source>
<translation>Minimize view</translation>
</message>
+ <message>
+ <source>DSC_RETURN_3D_VIEW</source>
+ <translation>Return to 3D view</translation>
+ </message>
<message>
<source>MNU_MAXIMIZE_VIEW</source>
<translation>Maximize</translation>
<source>MNU_MINIMIZE_VIEW</source>
<translation>Minimize</translation>
</message>
+ <message>
+ <source>MNU_RETURN_3D_VIEW</source>
+ <translation>Return to 3D</translation>
+ </message>
</context>
<context>
<name>OCCViewer_CreateRestoreViewDlg</name>
<source>DSC_MINIMIZE_VIEW</source>
<translation>Minimiser la vue</translation>
</message>
+ <message>
+ <source>DSC_RETURN_3D_VIEW</source>
+ <translation type="unfinished">Return to 3D view</translation>
+ </message>
<message>
<source>MNU_MAXIMIZE_VIEW</source>
<translation>Maximiser</translation>
<source>MNU_MINIMIZE_VIEW</source>
<translation>Minimiser</translation>
</message>
+ <message>
+ <source>MNU_RETURN_3D_VIEW</source>
+ <translation type="unfinished">Return to 3D</translation>
+ </message>
</context>
<context>
<name>OCCViewer_CreateRestoreViewDlg</name>