myPopupRequestedView = dynamic_cast<OCCViewer_ViewWindow*>(sender());
}
+void OCCViewer_ViewFrame::onDumpView()
+{
+ if (myPopupRequestedView) {
+ myPopupRequestedView->onDumpView();
+ } else {
+ getView(MAIN_VIEW)->onDumpView();
+ }
+}
void onMaximizedView( OCCViewer_ViewWindow*, bool );
- virtual void onDumpView() { getView(MAIN_VIEW)->onDumpView(); }
+ virtual void onDumpView();
private slots:
void onContextMenuRequested(QContextMenuEvent*);
Handle(V3d_View) view = myViewPort->getView();
if ( view.IsNull() )
return QImage();
+
int aWidth = myViewPort->width();
int aHeight = myViewPort->height();
QApplication::syncX();
- view->Update();
+ view->Redraw(); // In order to reactivate GL context
+ //view->Update();
OpenGLUtils_FrameBuffer aFrameBuffer;
if( aFrameBuffer.init( aWidth, aHeight ) )
{
+ QImage anImage( aWidth, aHeight, QImage::Format_RGB32 );
+
glPushAttrib( GL_VIEWPORT_BIT );
glViewport( 0, 0, aWidth, aHeight );
aFrameBuffer.bind();
aFrameBuffer.unbind();
glPopAttrib();
- QImage anImage( aWidth, aHeight, QImage::Format_RGB32 );
-
aFrameBuffer.bind();
glReadPixels( 0, 0, aWidth, aHeight, GL_RGBA, GL_UNSIGNED_BYTE, anImage.bits() );
aFrameBuffer.unbind();
anImage = anImage.mirrored();
return anImage;
}
-
// if frame buffers are unsupported, use old functionality
- view->Redraw();
+ //view->Redraw();
unsigned char* data = new unsigned char[ aWidth*aHeight*4 ];