OCCViewer_ViewPort3d* HYDROGUI_Overview::getViewPort( bool isMain ) const
{
- return isMain ? myMainView->getViewPort() : myViewPort;
+ if ( isMain)
+ {
+ myMainView ? myMainView->getViewPort() : NULL;
+ }
+ else
+ return myViewPort;
}
void HYDROGUI_Overview::setMainView( OCCViewer_ViewFrame* theMainView )
connect( aMainView->getViewPort(), SIGNAL( vpResizeEvent( QResizeEvent* ) ),
this, SLOT( OnResizeEvent( QResizeEvent* ) ) );
connect( aMainView->getViewPort(), SIGNAL( vpTransformed( OCCViewer_ViewPort* ) ),
- this, SLOT( OnTransformation() ) );
+ this, SLOT( OnTransformation() ) );
+
+ connect( myMainView, SIGNAL(destroyed()), this, SLOT( onMainViewDestr() ) );
if( !myViewPort )
{
myBand->update( true );
}
+
+void HYDROGUI_Overview::onMainViewDestr()
+{
+ myMainView = NULL;
+ if (myViewPort == NULL)
+ return;
+ Handle(V3d_View) ov = myViewPort->getView();
+ ov->View()->Deactivate();
+ delete myViewPort;
+ myViewPort = NULL;
+}
+
+
void HYDROGUI_Overview::CustomFitSelection() const
{
OCCViewer_ViewPort3d* main = getViewPort( true );