2 # ifndef GLX_GLXEXT_LEGACY
3 # define GLX_GLXEXT_LEGACY
12 #include "XGUI_ViewPort.h"
13 #include "XGUI_ViewWindow.h"
14 #include "XGUI_Viewer.h"
15 #include "XGUI_Constants.h"
17 #include <QGuiApplication>
18 #include <QPaintEvent>
22 #include <V3d_OrthographicView.hxx>
23 #include <V3d_PerspectiveView.hxx>
24 #include <Visual3d_View.hxx>
27 #include <WNT_Window.hxx>
29 #include <Xw_Window.hxx>
35 static double rx = 0.;
36 static double ry = 0.;
39 static Standard_Boolean zRotation = Standard_False;
44 Create native view window for CasCade view [ static ]
46 Handle(Aspect_Window) CreateCasWindow( const Handle(V3d_View)& view, WId winId )
48 Aspect_Handle aWindowHandle = (Aspect_Handle)winId;
50 Handle(WNT_Window) viewWindow = new WNT_Window( aWindowHandle );
52 Handle(Aspect_DisplayConnection) aDispConnection = view->Viewer()->Driver()->GetDisplayConnection();
53 Handle(Xw_Window) viewWindow = new Xw_Window( aDispConnection, aWindowHandle );
60 class OpenGLUtils_FrameBuffer
63 OpenGLUtils_FrameBuffer();
64 ~OpenGLUtils_FrameBuffer();
66 bool init( const GLsizei&, const GLsizei& );
83 #define APIENTRYP APIENTRY *
86 #ifndef GL_FRAMEBUFFER_EXT
87 #define GL_FRAMEBUFFER_EXT 0x8D40
90 #ifndef GL_RENDERBUFFER_EXT
91 #define GL_RENDERBUFFER_EXT 0x8D41
94 #ifndef GL_COLOR_ATTACHMENT0_EXT
95 #define GL_COLOR_ATTACHMENT0_EXT 0x8CE0
98 #ifndef GL_DEPTH_ATTACHMENT_EXT
99 #define GL_DEPTH_ATTACHMENT_EXT 0x8D00
102 #ifndef GL_FRAMEBUFFER_COMPLETE_EXT
103 #define GL_FRAMEBUFFER_COMPLETE_EXT 0x8CD5
106 typedef void (APIENTRYP PFNGLGENFRAMEBUFFERSEXTPROC) (GLsizei n, GLuint *framebuffers);
107 typedef void (APIENTRYP PFNGLBINDFRAMEBUFFEREXTPROC) (GLenum target, GLuint framebuffer);
108 typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
109 typedef GLenum (APIENTRYP PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC) (GLenum target);
110 typedef void (APIENTRYP PFNGLDELETEFRAMEBUFFERSEXTPROC) (GLsizei n, const GLuint *framebuffers);
111 typedef void (APIENTRYP PFNGLGENRENDERBUFFERSEXTPROC) (GLsizei n, GLuint *renderbuffers);
112 typedef void (APIENTRYP PFNGLBINDRENDERBUFFEREXTPROC) (GLenum target, GLuint renderbuffer);
113 typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
114 typedef void (APIENTRYP PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC) (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
115 typedef void (APIENTRYP PFNGLDELETERENDERBUFFERSEXTPROC) (GLsizei n, const GLuint *renderbuffers);
117 static PFNGLGENFRAMEBUFFERSEXTPROC vglGenFramebuffersEXT = NULL;
118 static PFNGLBINDFRAMEBUFFEREXTPROC vglBindFramebufferEXT = NULL;
119 static PFNGLFRAMEBUFFERTEXTURE2DEXTPROC vglFramebufferTexture2DEXT = NULL;
120 static PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC vglCheckFramebufferStatusEXT = NULL;
121 static PFNGLDELETEFRAMEBUFFERSEXTPROC vglDeleteFramebuffersEXT = NULL;
122 static PFNGLGENRENDERBUFFERSEXTPROC vglGenRenderbuffersEXT = NULL;
123 static PFNGLBINDRENDERBUFFEREXTPROC vglBindRenderbufferEXT = NULL;
124 static PFNGLRENDERBUFFERSTORAGEEXTPROC vglRenderbufferStorageEXT = NULL;
125 static PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC vglFramebufferRenderbufferEXT = NULL;
126 static PFNGLDELETERENDERBUFFERSEXTPROC vglDeleteRenderbuffersEXT = NULL;
129 #define GL_GetProcAddress( x ) glXGetProcAddressARB( (const GLubyte*)x )
131 #define GL_GetProcAddress( x ) wglGetProcAddress( (const LPCSTR)x )
136 vglGenFramebuffersEXT = (PFNGLGENFRAMEBUFFERSEXTPROC)GL_GetProcAddress( "glGenFramebuffersEXT" );
137 vglBindFramebufferEXT = (PFNGLBINDFRAMEBUFFEREXTPROC)GL_GetProcAddress( "glBindFramebufferEXT" );
138 vglFramebufferTexture2DEXT = (PFNGLFRAMEBUFFERTEXTURE2DEXTPROC)GL_GetProcAddress( "glFramebufferTexture2DEXT" );
139 vglCheckFramebufferStatusEXT = (PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC)GL_GetProcAddress( "glCheckFramebufferStatusEXT" );
140 vglDeleteFramebuffersEXT = (PFNGLDELETEFRAMEBUFFERSEXTPROC)GL_GetProcAddress( "glDeleteFramebuffersEXT" );
141 vglGenRenderbuffersEXT = (PFNGLGENRENDERBUFFERSEXTPROC)GL_GetProcAddress( "glGenRenderbuffersEXT" );
142 vglBindRenderbufferEXT = (PFNGLBINDRENDERBUFFEREXTPROC)GL_GetProcAddress( "glBindRenderbufferEXT" );
143 vglRenderbufferStorageEXT = (PFNGLRENDERBUFFERSTORAGEEXTPROC)GL_GetProcAddress( "glRenderbufferStorageEXT" );
144 vglFramebufferRenderbufferEXT = (PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC)GL_GetProcAddress( "glFramebufferRenderbufferEXT" );
145 vglDeleteRenderbuffersEXT = (PFNGLDELETERENDERBUFFERSEXTPROC)GL_GetProcAddress( "glDeleteRenderbuffersEXT" );
147 bool ok = vglGenFramebuffersEXT && vglBindFramebufferEXT && vglFramebufferTexture2DEXT &&
148 vglCheckFramebufferStatusEXT && vglDeleteFramebuffersEXT && vglGenRenderbuffersEXT &&
149 vglBindRenderbufferEXT && vglRenderbufferStorageEXT && vglFramebufferRenderbufferEXT &&
150 vglDeleteRenderbuffersEXT;
155 static bool IsEXTInitialized = InitializeEXT();
157 OpenGLUtils_FrameBuffer::OpenGLUtils_FrameBuffer()
164 OpenGLUtils_FrameBuffer::~OpenGLUtils_FrameBuffer()
169 bool OpenGLUtils_FrameBuffer::init( const GLsizei& xSize, const GLsizei& ySize )
171 char* ext = (char*)glGetString( GL_EXTENSIONS );
172 if( !IsEXTInitialized ||
173 strstr( ext, "GL_EXT_framebuffer_object" ) == NULL )
175 qDebug( "Initializing OpenGL FrameBuffer extension failed" );
179 // create a texture object
180 glEnable( GL_TEXTURE_2D );
181 glGenTextures( 1, &textureId );
182 glBindTexture( GL_TEXTURE_2D, textureId );
183 glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR );
184 glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR );
185 glTexImage2D( GL_TEXTURE_2D, 0, GL_RGBA8, xSize, ySize, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL );
186 glBindTexture( GL_TEXTURE_2D, 0 );
188 // create a renderbuffer object to store depth info
189 vglGenRenderbuffersEXT( 1, &rboId );
190 vglBindRenderbufferEXT( GL_RENDERBUFFER_EXT, rboId );
191 vglRenderbufferStorageEXT( GL_RENDERBUFFER_EXT, GL_DEPTH_COMPONENT, xSize, ySize );
192 vglBindRenderbufferEXT( GL_RENDERBUFFER_EXT, 0 );
194 // create a framebuffer object
195 vglGenFramebuffersEXT( 1, &fboId );
196 vglBindFramebufferEXT( GL_FRAMEBUFFER_EXT, fboId );
198 // attach the texture to FBO color attachment point
199 vglFramebufferTexture2DEXT( GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_TEXTURE_2D, textureId, 0 );
201 // attach the renderbuffer to depth attachment point
202 vglFramebufferRenderbufferEXT( GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT, GL_RENDERBUFFER_EXT, rboId );
205 GLenum status = vglCheckFramebufferStatusEXT( GL_FRAMEBUFFER_EXT );
208 vglBindFramebufferEXT( GL_FRAMEBUFFER_EXT, 0 );
210 return status == GL_FRAMEBUFFER_COMPLETE_EXT;
213 void OpenGLUtils_FrameBuffer::release()
215 if( !IsEXTInitialized )
218 glDeleteTextures( 1, &textureId );
221 vglDeleteFramebuffersEXT( 1, &fboId );
224 vglDeleteRenderbuffersEXT( 1, &rboId );
228 void OpenGLUtils_FrameBuffer::bind()
230 if( !IsEXTInitialized )
233 vglBindFramebufferEXT( GL_FRAMEBUFFER_EXT, fboId );
236 void OpenGLUtils_FrameBuffer::unbind()
238 if( !IsEXTInitialized )
241 vglBindFramebufferEXT( GL_FRAMEBUFFER_EXT, 0 );
246 //************************************************************************
247 //************************************************************************
248 //************************************************************************
249 XGUI_ViewPort::XGUI_ViewPort(XGUI_ViewWindow* theParent,
250 const Handle(V3d_Viewer)& theViewer,
251 V3d_TypeOfView theType) :
253 myPaintersRedrawing(false),
255 myIsAdvancedZoomingEnabled( false )
257 setMouseTracking( true );
258 setBackgroundRole( QPalette::NoRole );
260 // set focus policy to threat QContextMenuEvent from keyboard
261 setFocusPolicy( Qt::StrongFocus );
262 setAttribute( Qt::WA_PaintOnScreen );
263 setAttribute( Qt::WA_NoSystemBackground );
265 if ( theType == V3d_ORTHOGRAPHIC ) {
266 myOrthoView = new V3d_OrthographicView( theViewer );
267 myActiveView = myOrthoView;
270 myPerspView = new V3d_PerspectiveView( theViewer );
271 myActiveView = myPerspView;
273 myActiveView->SetSurfaceDetail(V3d_TEX_ALL);
275 //setBackground( Qtx::BackgroundData( Qt::black ) ); // set default background
278 //***********************************************
279 XGUI_ViewPort::~XGUI_ViewPort()
283 //***********************************************
284 bool XGUI_ViewPort::mapView( const Handle(V3d_View)& theView)
286 if ( !setWindow( theView ) )
289 if ( !mapped( theView ) ) {
290 theView->SetWindow( myWindow );
291 if ( theView != activeView() )
292 theView->View()->Deactivate();
295 /* create static trihedron (16551: EDF PAL 501) */
296 //OCCViewer_ViewWindow* aVW = dynamic_cast<OCCViewer_ViewWindow*>( parentWidget()->parentWidget()->parentWidget() );
298 // OCCViewer_Viewer* aViewModel = dynamic_cast<OCCViewer_Viewer*>( aVW->getViewManager()->getViewModel() );
299 // if ( aViewModel && aViewModel->isStaticTrihedronDisplayed() ){
300 //theView->ZBufferTriedronSetup();
301 theView->TriedronDisplay( Aspect_TOTP_LEFT_LOWER, Quantity_NOC_WHITE, 0.05, V3d_ZBUFFER );
310 //***********************************************
311 bool XGUI_ViewPort::setWindow( const Handle(V3d_View)& theView)
313 if ( !myWindow.IsNull() )
316 if ( theView.IsNull() )
319 attachWindow( theView, CreateCasWindow( theView, winId() ) );
321 myWindow = theView->Window();
322 return !myWindow.IsNull();
325 //***********************************************
326 bool XGUI_ViewPort::mapped( const Handle(V3d_View)& theView) const
328 return ( !theView.IsNull() && theView->View()->IsDefined() );
331 //***********************************************
332 void XGUI_ViewPort::updateBackground()
334 if ( activeView().IsNull() ) return;
335 if ( !myBackground.isValid() ) return;
337 // VSR: Important note on below code.
338 // In OCCT (in version 6.5.2), things about the background drawing
339 // are not straightforward and not clearly understandable:
340 // - Horizontal gradient is drawn vertically (!), well ok, from top side to bottom one.
341 // - Vertical gradient is drawn horizontally (!), from right side to left one (!!!).
342 // - First and second diagonal gradients are confused.
343 // - Image texture, once set, can not be removed (!).
344 // - Texture image fill mode Aspect_FM_NONE is not taken into account (and means the same
345 // as Aspect_FM_CENTERED).
346 // - The only way to cancel gradient background (and get back to single colored) is to
347 // set gradient background style to Aspect_GFM_NONE while passing two colors is also needed
348 // (see V3d_View::SetBgGradientColors() function).
349 // - Also, it is impossible to draw texture image above the gradiented background (only above
351 // In OCCT 6.5.3 all above mentioned problems are fixed; so, above comment should be removed as soon
352 // as SALOME is migrated to OCCT 6.5.3. The same concerns #ifdef statements in the below code
353 switch ( myBackground.mode() ) {
354 case XGUI::ColorBackground:
356 QColor c = myBackground.color();
358 // Unset texture should be done here
360 Quantity_Color qCol( c.red()/255., c.green()/255., c.blue()/255., Quantity_TOC_RGB );
361 activeView()->SetBgGradientStyle( Aspect_GFM_NONE ); // cancel gradient background
362 activeView()->SetBgImageStyle( Aspect_FM_NONE ); // cancel texture background
363 // then change background color
364 activeView()->SetBackgroundColor( qCol );
366 activeView()->Update();
370 case XGUI::SimpleGradientBackground:
373 int type = myBackground.gradient( c1, c2 );
374 if ( c1.isValid() && type >= XGUI::HorizontalGradient && type <= XGUI::LastGradient ) {
375 // Unset texture should be done here
377 // Get colors and set-up gradiented background
378 if ( !c2.isValid() ) c2 = c1;
379 Quantity_Color qCol1( c1.red()/255., c1.green()/255., c1.blue()/255., Quantity_TOC_RGB );
380 Quantity_Color qCol2( c2.red()/255., c2.green()/255., c2.blue()/255., Quantity_TOC_RGB );
381 activeView()->SetBgImageStyle( Aspect_FM_NONE ); // cancel texture background
383 case XGUI::HorizontalGradient:
384 activeView()->SetBgGradientColors( qCol1, qCol2, Aspect_GFM_HOR, Standard_True );
386 case XGUI::VerticalGradient:
387 activeView()->SetBgGradientColors( qCol1, qCol2, Aspect_GFM_VER, Standard_True );
389 case XGUI::Diagonal1Gradient:
390 activeView()->SetBgGradientColors( qCol1, qCol2, Aspect_GFM_DIAG1, Standard_True );
392 case XGUI::Diagonal2Gradient:
393 activeView()->SetBgGradientColors( qCol1, qCol2, Aspect_GFM_DIAG2, Standard_True );
395 case XGUI::Corner1Gradient:
396 activeView()->SetBgGradientColors( qCol1, qCol2, Aspect_GFM_CORNER1, Standard_True );
398 case XGUI::Corner2Gradient:
399 activeView()->SetBgGradientColors( qCol1, qCol2, Aspect_GFM_CORNER2, Standard_True );
401 case XGUI::Corner3Gradient:
402 activeView()->SetBgGradientColors( qCol1, qCol2, Aspect_GFM_CORNER3, Standard_True );
404 case XGUI::Corner4Gradient:
405 activeView()->SetBgGradientColors( qCol1, qCol2, Aspect_GFM_CORNER4, Standard_True );
413 case XGUI::CustomGradientBackground:
414 // NOT IMPLEMENTED YET
419 // VSR: In OCCT before v6.5.3 below code can't be used because of very ugly bug - it has been impossible to
420 // clear the background texture image as soon as it was once set to the viewer.
421 if ( myBackground.isTextureShown() ) {
423 int textureMode = myBackground.texture( fileName );
424 QFileInfo fi( fileName );
425 if ( !fileName.isEmpty() && fi.exists() ) {
426 // set texture image: file name and fill mode
427 switch ( textureMode ) {
428 case XGUI::CenterTexture:
429 activeView()->SetBackgroundImage( fi.absoluteFilePath().toLatin1().constData(), Aspect_FM_CENTERED );
431 case XGUI::TileTexture:
432 activeView()->SetBackgroundImage( fi.absoluteFilePath().toLatin1().constData(), Aspect_FM_TILED );
434 case XGUI::StretchTexture:
435 activeView()->SetBackgroundImage( fi.absoluteFilePath().toLatin1().constData(), Aspect_FM_STRETCH );
440 activeView()->Update();
445 //***********************************************
446 void XGUI_ViewPort::attachWindow( const Handle(V3d_View)& theView, const Handle(Aspect_Window)& theWnd)
448 if (!theView.IsNull()) {
449 theView->SetWindow( theWnd );
454 //***********************************************
455 void XGUI_ViewPort::paintEvent( QPaintEvent* theEvent)
458 /* X11 : map before show doesn't work */
459 if ( !mapped( activeView() ) )
460 mapView( activeView() );
462 if ( !myWindow.IsNull() ) {
463 //QGuiApplication::sync();
464 QRect rc = theEvent->rect();
465 //if ( !myPaintersRedrawing ) {
466 //activeView()->Redraw();
467 activeView()->Redraw( rc.x(), rc.y(), rc.width(), rc.height() );
471 //if ( myPaintersRedrawing ) {
472 // QPainter p( this );
473 // //emit vpDrawExternal( &p );
474 // myPaintersRedrawing = false;
478 //***********************************************
479 void XGUI_ViewPort::resizeEvent( QResizeEvent* )
482 /* Win32 : map before first show to avoid flicker */
483 if ( !mapped( activeView() ) )
484 mapView( activeView() );
486 //QGuiApplication::sync();
487 if ( !activeView().IsNull() )
488 activeView()->MustBeResized();
491 //***********************************************
492 QImage XGUI_ViewPort::dumpView(QRect theRect, bool toUpdate)
494 Handle(V3d_View) view = getView();
500 if (theRect.isNull()) {
504 aWidth = theRect.width();
505 aHeight = theRect.height();
507 //QApplication::syncX();
509 OpenGLUtils_FrameBuffer aFrameBuffer;
510 if( aFrameBuffer.init( aWidth, aHeight ) )
512 QImage anImage( aWidth, aHeight, QImage::Format_RGB32 );
514 glPushAttrib( GL_VIEWPORT_BIT );
515 glViewport( 0, 0, aWidth, aHeight );
520 if (theRect.isNull())
523 view->Redraw(theRect.x(), theRect.y(), theRect.width(), theRect.height());
525 aFrameBuffer.unbind();
529 if (theRect.isNull())
530 glReadPixels( 0, 0, aWidth, aHeight, GL_RGBA, GL_UNSIGNED_BYTE, anImage.bits() );
532 glReadPixels( theRect.x(), theRect.y(), aWidth, aHeight, GL_RGBA, GL_UNSIGNED_BYTE, anImage.bits() );
533 aFrameBuffer.unbind();
535 anImage = anImage.rgbSwapped();
536 anImage = anImage.mirrored();
539 // if frame buffers are unsupported, use old functionality
540 unsigned char* data = new unsigned char[ aWidth*aHeight*4 ];
543 if (theRect.isNull()) {
546 p = mapFromParent(geometry().topLeft());
549 view->Redraw(theRect.x(), theRect.y(), theRect.width(), theRect.height());
550 p = theRect.topLeft();
552 glReadPixels( p.x(), p.y(), aWidth, aHeight, GL_RGBA, GL_UNSIGNED_BYTE, data);
554 QImage anImage( data, aWidth, aHeight, QImage::Format_ARGB32 );
555 anImage = anImage.mirrored();
556 anImage = anImage.rgbSwapped();
562 Inits 'rotation' transformation.
564 void XGUI_ViewPort::startRotation( int x, int y,
565 int theRotationPointType,
566 const gp_Pnt& theSelectedPoint )
568 if ( !activeView().IsNull() ) {
569 switch ( theRotationPointType ) {
571 activeView()->StartRotation( x, y, 0.45 );
577 activeView()->Size(X,Y);
578 rx = Standard_Real(activeView()->Convert(X));
579 ry = Standard_Real(activeView()->Convert(Y));
581 activeView()->Rotate( 0., 0., 0.,
582 theSelectedPoint.X(),theSelectedPoint.Y(), theSelectedPoint.Z(),
585 Quantity_Ratio zRotationThreshold;
586 zRotation = Standard_False;
587 zRotationThreshold = 0.45;
588 if( zRotationThreshold > 0. ) {
589 Standard_Real dx = Abs(sx - rx/2.);
590 Standard_Real dy = Abs(sy - ry/2.);
591 Standard_Real dd = zRotationThreshold * (rx + ry)/2.;
592 if( dx > dd || dy > dd ) zRotation = Standard_True;
598 activeView()->DepthFitAll();
603 Rotates the viewport.
605 void XGUI_ViewPort::rotate( int x, int y,
606 int theRotationPointType,
607 const gp_Pnt& theSelectedPoint )
609 if ( !activeView().IsNull() ) {
610 switch ( theRotationPointType ) {
612 activeView()->Rotation( x, y );
617 dz = atan2(Standard_Real(x)-rx/2., ry/2.-Standard_Real(y)) -
618 atan2(sx-rx/2.,ry/2.-sy);
622 dx = (Standard_Real(x) - sx) * M_PI/rx;
623 dy = (sy - Standard_Real(y)) * M_PI/ry;
627 activeView()->Rotate( dx, dy, dz,
628 theSelectedPoint.X(),theSelectedPoint.Y(), theSelectedPoint.Z(),
634 emit vpTransformed( );
636 // setZSize( getZSize() );
640 Resets the viewport after 'rotation'.
642 void XGUI_ViewPort::endRotation()
644 if ( !activeView().IsNull() ) {
645 activeView()->ZFitAll(1.);
646 activeView()->SetZSize(0.);
647 activeView()->Update();
648 emit vpTransformed( );
653 Inits 'zoom' transformation.
655 void XGUI_ViewPort::startZoomAtPoint( int x, int y )
657 if ( !activeView().IsNull()/* && isAdvancedZoomingEnabled() */)
658 activeView()->StartZoomAtPoint( x, y );
662 Centers the viewport.
664 void XGUI_ViewPort::setCenter( int x, int y )
666 if ( !activeView().IsNull() ) {
667 activeView()->Place( x, y, myScale );
668 emit vpTransformed( );
673 Called at 'pan' transformation.
675 void XGUI_ViewPort::pan( int dx, int dy )
677 if ( !activeView().IsNull() ) {
678 activeView()->Pan( dx, dy, 1.0 );
679 emit vpTransformed( );
684 Called at 'window fit' transformation.
686 void XGUI_ViewPort::fitRect( const QRect& rect )
688 if ( !activeView().IsNull() ) {
689 activeView()->WindowFit( rect.left(), rect.top(), rect.right(), rect.bottom() );
690 emit vpTransformed( );
695 Called at 'zoom' transformation.
697 void XGUI_ViewPort::zoom( int x0, int y0, int x, int y )
699 if ( !activeView().IsNull() ) {
700 if ( isAdvancedZoomingEnabled() )
701 activeView()->ZoomAtPoint( x0, y0, x, y );
703 activeView()->Zoom( x0 + y0, 0, x + y, 0 );
704 emit vpTransformed( );
709 Sets the background data
711 void XGUI_ViewPort::setBackground( const XGUI_ViewBackground& bgData )
713 if ( bgData.isValid() ) {
714 myBackground = bgData;
716 emit vpChangeBackground( myBackground );