*/
OCCViewer_Viewer::~OCCViewer_Viewer()
{
+ myAISContext.Nullify();
+ myV3dViewer.Nullify();
+ myV3dCollector.Nullify();
}
/*!
initView( vw );
// set default background for view window
vw->setBackground( background(0) ); // 0 means MAIN_VIEW (other views are not yet created here)
+ // connect signal from viewport
+ connect(view->getViewPort(), SIGNAL(vpClosed()), this, SLOT(onViewClosed()));
return view;
}
emit selectionChanged();
}
+void OCCViewer_Viewer::onViewClosed()
+{
+ Standard_Integer aViewsNb = 0;
+ for ( myV3dViewer->InitActiveViews(); myV3dViewer->MoreActiveViews(); myV3dViewer->NextActiveViews())
+ ++aViewsNb;
+ if ( aViewsNb < 2 ) {
+ //clean up presentations before last view is closed
+ myAISContext->RemoveAll(Standard_False);
+ }
+}
+
int OCCViewer_Viewer::getTopLayerId()
{
#if OCC_VERSION_LARGE > 0x06050200
virtual void onMouseMove(SUIT_ViewWindow*, QMouseEvent*);
virtual void onMouseRelease(SUIT_ViewWindow*, QMouseEvent*);
virtual void onKeyPress(SUIT_ViewWindow*, QKeyEvent*);
+ virtual void onViewClosed();
void onDumpView();
void onChangeBackground();