if( !myViewPort )
{
myViewPort = new OCCViewer_ViewPort3d( this, myMainView->getViewPort()->getViewer(), V3d_ORTHOGRAPHIC );
- myViewPort->setBackgroundColor( myMainView->getViewPort()->backgroundColor() );
- connect( myViewPort, SIGNAL( vpMouseEvent( QMouseEvent* ) ),
- this, SLOT( OnMouseEvent( QMouseEvent* ) ) );
- connect( myViewPort, SIGNAL( vpResizeEvent( QResizeEvent* ) ),
- this, SLOT( OnResizeEvent( QResizeEvent* ) ) );
+ if( myViewPort )
+ {
+ myViewPort->setBackgroundColor( myMainView->getViewPort()->backgroundColor() );
+
+ connect( myViewPort, SIGNAL( vpMouseEvent( QMouseEvent* ) ),
+ this, SLOT( OnMouseEvent( QMouseEvent* ) ) );
+ connect( myViewPort, SIGNAL( vpResizeEvent( QResizeEvent* ) ),
+ this, SLOT( OnResizeEvent( QResizeEvent* ) ) );
- myLayout->addWidget( myViewPort, 0, 0 );
+ myLayout->addWidget( myViewPort, 0, 0 );
+ }
}
#if defined(TEST_MODE) || defined(_DEBUG)
void HYDROGUI_Overview::setTopView()
{
+ if( !myViewPort )
+ return;
+
Handle(V3d_View) aView3d = myViewPort->getView();
if( !aView3d.IsNull() )
aView3d->SetProj( V3d_Zpos );
void HYDROGUI_Overview::OnTransformationAfterOp( OCCViewer_ViewWindow::OperationType theOp )
{
- if( theOp>=OCCViewer_ViewWindow::WINDOWFIT )
+ if( myViewPort && theOp>=OCCViewer_ViewWindow::WINDOWFIT )
{
myViewPort->fitAll();
}
QPoint HYDROGUI_Overview::fromMain( int xp, int yp ) const
{
+ if( !myMainView || !myViewPort )
+ return QPoint();
+
const double EPS = 1E-2;
Handle(V3d_View) aMain = myMainView->getViewPort()->getView();