1 // Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License, or (at your option) any later version.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
23 #include "OCCViewer_ViewPort3d.h"
25 #include "OCCViewer_VService.h"
26 #include "OCCViewer_ViewWindow.h"
27 #include "OCCViewer_ViewModel.h"
29 #include <Basics_OCCTVersion.hxx>
31 #include <SUIT_ViewManager.h>
32 #include <SUIT_ViewModel.h>
38 #include <QPaintEvent>
39 #include <QResizeEvent>
40 #include <QApplication>
42 #include <Visual3d_View.hxx>
43 #include <V3d_Viewer.hxx>
45 #if OCC_VERSION_LARGE > 0x06070000
46 #include <V3d_View.hxx>
48 #include <V3d_PerspectiveView.hxx>
49 #include <V3d_OrthographicView.hxx>
52 #include "utilities.h"
55 #include <WNT_Window.hxx>
57 #include <Xw_Window.hxx>
60 static double rx = 0.;
61 static double ry = 0.;
64 static Standard_Boolean zRotation = Standard_False;
66 //#include <Standard_Version.hxx>
71 OCCViewer_ViewPort3d::OCCViewer_ViewPort3d( QWidget* parent, const Handle( V3d_Viewer)& viewer, V3d_TypeOfView type )
72 : OCCViewer_ViewPort( parent ),
75 myIsAdvancedZoomingEnabled( false )
77 // VSR: 01/07/2010 commented to avoid SIGSEGV at SALOME exit
80 #if OCC_VERSION_LARGE > 0x06070000
81 myActiveView = new V3d_View( viewer, type );
83 if ( type == V3d_ORTHOGRAPHIC ) {
84 myOrthoView = new V3d_OrthographicView( viewer );
85 myActiveView = myOrthoView;
88 myPerspView = new V3d_PerspectiveView( viewer );
89 myActiveView = myPerspView;
93 setBackground( Qtx::BackgroundData( Qt::black ) ); // set default background
99 OCCViewer_ViewPort3d::~OCCViewer_ViewPort3d()
102 Handle(V3d_View) aView = activeView();
108 Activates the desired 'type' of view in the viewer
109 ( view of 'type' is created if it doesn't exist ). [ public ]
111 /*void OCCViewer_ViewPort3d::setActive( V3d_TypeOfView type )
113 if ( activeView().IsNull() )
116 if ( activeView()->Type() != type )
118 if ( type == V3d_ORTHOGRAPHIC )
119 setView( myOrthoView );
120 if ( type == V3d_PERSPECTIVE )
121 setView( myPerspView );
126 Maps CasCade 'view' to this viewport. [ private ]
128 bool OCCViewer_ViewPort3d::mapView( const Handle(V3d_View)& view )
130 if ( !setWindow( view ) )
133 if ( !mapped( view ) ) {
134 view->SetWindow( myWindow );
135 if ( view != activeView() )
136 view->View()->Deactivate();
139 /* create static trihedron (16551: EDF PAL 501) */
140 OCCViewer_ViewWindow* aVW = dynamic_cast<OCCViewer_ViewWindow*>( parentWidget()->parentWidget()->parentWidget() );
142 OCCViewer_Viewer* aViewModel = dynamic_cast<OCCViewer_Viewer*>( aVW->getViewManager()->getViewModel() );
143 if ( aViewModel && aViewModel->isStaticTrihedronDisplayed() ){
144 view->ZBufferTriedronSetup();
145 view->TriedronDisplay( Aspect_TOTP_LEFT_LOWER, Quantity_NOC_WHITE, 0.05, V3d_ZBUFFER );
157 Sets new CASCADE view on viewport. Returns the previous active view. [ public ]
159 Handle( V3d_View ) OCCViewer_ViewPort3d::setView( const Handle( V3d_View )& view )
161 /* map the new view */
162 if ( view == activeView() || !mapView( view ) )
165 /* activate the new view*/
166 Handle( V3d_View ) oldView = activeView();
167 if ( !oldView.IsNull() ) {
168 if (oldView->View()->IsDefined())
169 oldView->View()->Deactivate();
170 view->SetBackgroundColor( oldView->BackgroundColor() );
173 view->View()->Activate();
179 Returns CasCade 3D view. [ public ]
181 Handle(V3d_View) OCCViewer_ViewPort3d::getView() const
187 Returns CasCade 3D viewer [ public ]
189 Handle(V3d_Viewer) OCCViewer_ViewPort3d::getViewer() const
191 Handle(V3d_Viewer) viewer;
192 if ( !activeView().IsNull() )
193 viewer = activeView()->Viewer();
198 Syncronizes visual state of this viewport with 'ref'
199 ( scale, projection, eye etc ) Returns 'true' if copied OK,
200 'false' otherwise. [ virtual public ]
202 bool OCCViewer_ViewPort3d::syncronize( const OCCViewer_ViewPort3d* ref )
204 OCCViewer_ViewPort3d* ref3d = (OCCViewer_ViewPort3d*)ref;
205 Handle(V3d_View) refView = ref3d->getView();
206 Handle(V3d_View) tgtView = getView();
208 /* Syncronize view types */
209 /* if ( tgtView->Type() != refView->Type() )
211 setActive( refView->Type() );
215 /* The following params are copied:
216 - view type( ortho/persp )
217 - position of view point
218 - orientation of high point
219 - position of the eye
226 /* we'll update after setting all params */
227 tgtView->SetImmediateUpdate( Standard_False );
230 if ( refView->Type() == V3d_PERSPECTIVE )
231 tgtView->SetFocale( refView->Focale() );
234 Standard_Real x, y, z;
235 refView->At( x, y, z ); tgtView->SetAt( x, y, z );
236 refView->Up( x, y, z ); tgtView->SetUp( x, y, z );
237 refView->Eye( x, y, z ); tgtView->SetEye( x, y, z );
238 refView->Proj( x, y, z ); tgtView->SetProj( x, y, z );
239 refView->Center( x, y ); tgtView->SetCenter( x, y );
240 tgtView->SetScale( refView->Scale() );
241 tgtView->SetTwist( refView->Twist() );
245 tgtView->SetImmediateUpdate( Standard_True );
250 Returns Z-size of this view. [ public ]
252 double OCCViewer_ViewPort3d::getZSize() const
254 if ( !activeView().IsNull() )
255 return activeView()->ZSize();
260 Sets Z-size of this view ( for both orthographic and perspective ). [ public ]
262 void OCCViewer_ViewPort3d::setZSize( double zsize )
264 myActiveView->SetZSize( zsize );
265 /* if ( !myOrthoView.IsNull() )
266 myOrthoView->SetZSize( zsize );
267 if ( !myPerspView.IsNull() )
268 myPerspView->SetZSize( zsize );*/
272 Get axial scale to the view
274 void OCCViewer_ViewPort3d::getAxialScale( double& xScale, double& yScale, double& zScale )
276 xScale = yScale = zScale = 1.;
278 if ( !activeView().IsNull() )
279 activeView()->AxialScale( xScale, yScale, zScale );
283 Returns the background color [ virtual public ] [ obsolete ]
285 QColor OCCViewer_ViewPort3d::backgroundColor() const
287 return background().color();
291 Sets the background color [ virtual public ] [ obsolete ]
293 void OCCViewer_ViewPort3d::setBackgroundColor( const QColor& color )
295 Qtx::BackgroundData bg = background();
296 bg.setColor( color );
301 Returns the background data
303 Qtx::BackgroundData OCCViewer_ViewPort3d::background() const
309 Sets the background data
311 void OCCViewer_ViewPort3d::setBackground( const Qtx::BackgroundData& bgData )
313 if ( bgData.isValid() ) {
314 myBackground = bgData;
316 emit vpChangeBackground( myBackground );
320 void OCCViewer_ViewPort3d::updateBackground()
322 if ( activeView().IsNull() ) return;
323 if ( !myBackground.isValid() ) return;
325 // VSR: Important note on below code.
326 // In OCCT (in version 6.5.2), things about the background drawing
327 // are not straightforward and not clearly understandable:
328 // - Horizontal gradient is drawn vertically (!), well ok, from top side to bottom one.
329 // - Vertical gradient is drawn horizontally (!), from right side to left one (!!!).
330 // - First and second diagonal gradients are confused.
331 // - Image texture, once set, can not be removed (!).
332 // - Texture image fill mode Aspect_FM_NONE is not taken into account (and means the same
333 // as Aspect_FM_CENTERED).
334 // - The only way to cancel gradient background (and get back to single colored) is to
335 // set gradient background style to Aspect_GFM_NONE while passing two colors is also needed
336 // (see V3d_View::SetBgGradientColors() function).
337 // - Also, it is impossible to draw texture image above the gradiented background (only above
339 // In OCCT 6.5.3 all above mentioned problems are fixed; so, above comment should be removed as soon
340 // as SALOME is migrated to OCCT 6.5.3. The same concerns #ifdef statements in the below code
341 switch ( myBackground.mode() ) {
342 case Qtx::ColorBackground:
344 QColor c = myBackground.color();
346 // Unset texture should be done here
348 Quantity_Color qCol( c.red()/255., c.green()/255., c.blue()/255., Quantity_TOC_RGB );
349 #if OCC_VERSION_LARGE > 0x06050200 // available since OCCT 6.5.3
350 activeView()->SetBgGradientStyle( Aspect_GFM_NONE ); // cancel gradient background
351 activeView()->SetBgImageStyle( Aspect_FM_NONE ); // cancel texture background
353 // cancel gradient background (in OCC before v6.5.3 the only way to do this is to set it to NONE type passing arbitrary colors as parameters)
354 activeView()->SetBgGradientColors( qCol, qCol, Aspect_GFM_NONE );
356 // then change background color
357 activeView()->SetBackgroundColor( qCol );
359 activeView()->Update();
363 case Qtx::SimpleGradientBackground:
366 int type = myBackground.gradient( c1, c2 );
367 if ( c1.isValid() && type >= OCCViewer_Viewer::HorizontalGradient && type <= OCCViewer_Viewer::LastGradient ) {
368 // Unset texture should be done here
370 // Get colors and set-up gradiented background
371 if ( !c2.isValid() ) c2 = c1;
372 Quantity_Color qCol1( c1.red()/255., c1.green()/255., c1.blue()/255., Quantity_TOC_RGB );
373 Quantity_Color qCol2( c2.red()/255., c2.green()/255., c2.blue()/255., Quantity_TOC_RGB );
374 activeView()->SetBgImageStyle( Aspect_FM_NONE ); // cancel texture background
376 case OCCViewer_Viewer::HorizontalGradient:
377 #if OCC_VERSION_LARGE > 0x06050200 // available since OCCT 6.5.3
378 activeView()->SetBgGradientColors( qCol1, qCol2, Aspect_GFM_HOR, Standard_True );
380 // in OCCT before v6.5.3, to draw horizontal gradient it's necessary to use Aspect_GFM_VER type
381 // and interchange the colors
382 activeView()->SetBgGradientColors( qCol2, qCol1, Aspect_GFM_VER, Standard_True );
385 case OCCViewer_Viewer::VerticalGradient:
386 #if OCC_VERSION_LARGE > 0x06050200 // available since OCCT 6.5.3
387 activeView()->SetBgGradientColors( qCol1, qCol2, Aspect_GFM_VER, Standard_True );
389 // in OCCT before v6.5.3, to draw vertical gradient it's necessary to use Aspect_GFM_HOR type
390 activeView()->SetBgGradientColors( qCol1, qCol2, Aspect_GFM_HOR, Standard_True );
393 case OCCViewer_Viewer::Diagonal1Gradient:
394 #if OCC_VERSION_LARGE > 0x06050200 // available since OCCT 6.5.3
395 activeView()->SetBgGradientColors( qCol1, qCol2, Aspect_GFM_DIAG1, Standard_True );
397 // in OCCT before v6.5.3, to draw 1st dialognal gradient it's necessary to use Aspect_GFM_DIAG2 type
398 // and interchange the colors
399 activeView()->SetBgGradientColors( qCol2, qCol1, Aspect_GFM_DIAG2, Standard_True );
402 case OCCViewer_Viewer::Diagonal2Gradient:
403 #if OCC_VERSION_LARGE > 0x06050200 // available since OCCT 6.5.3
404 activeView()->SetBgGradientColors( qCol1, qCol2, Aspect_GFM_DIAG2, Standard_True );
406 // in OCCT before v6.5.3, to draw 2nd dialognal gradient it's necessary to use Aspect_GFM_DIAG1 type
407 activeView()->SetBgGradientColors( qCol1, qCol2, Aspect_GFM_DIAG1, Standard_True );
410 case OCCViewer_Viewer::Corner1Gradient:
411 activeView()->SetBgGradientColors( qCol1, qCol2, Aspect_GFM_CORNER1, Standard_True );
413 case OCCViewer_Viewer::Corner2Gradient:
414 activeView()->SetBgGradientColors( qCol1, qCol2, Aspect_GFM_CORNER2, Standard_True );
416 case OCCViewer_Viewer::Corner3Gradient:
417 activeView()->SetBgGradientColors( qCol1, qCol2, Aspect_GFM_CORNER3, Standard_True );
419 case OCCViewer_Viewer::Corner4Gradient:
420 activeView()->SetBgGradientColors( qCol1, qCol2, Aspect_GFM_CORNER4, Standard_True );
428 case Qtx::CustomGradientBackground:
430 // NOT IMPLEMENTED YET
436 #if OCC_VERSION_LARGE > 0x06050200 // available since OCCT 6.5.3
437 // VSR: In OCCT before v6.5.3 below code can't be used because of very ugly bug - it has been impossible to
438 // clear the background texture image as soon as it was once set to the viewer.
439 if ( myBackground.isTextureShown() ) {
441 int textureMode = myBackground.texture( fileName );
442 QFileInfo fi( fileName );
443 if ( !fileName.isEmpty() && fi.exists() ) {
444 // set texture image: file name and fill mode
445 switch ( textureMode ) {
446 case Qtx::CenterTexture:
447 activeView()->SetBackgroundImage( fi.absoluteFilePath().toLatin1().constData(), Aspect_FM_CENTERED );
449 case Qtx::TileTexture:
450 activeView()->SetBackgroundImage( fi.absoluteFilePath().toLatin1().constData(), Aspect_FM_TILED );
452 case Qtx::StretchTexture:
453 activeView()->SetBackgroundImage( fi.absoluteFilePath().toLatin1().constData(), Aspect_FM_STRETCH );
458 activeView()->Update();
465 Updates the active viewport. [ virtual public ]
467 void OCCViewer_ViewPort3d::onUpdate()
469 if ( !activeView().IsNull() )
470 activeView()->Update();
474 Called at 'window fit' transformation. [ virtual protected ]
476 void OCCViewer_ViewPort3d::fitRect( const QRect& rect )
478 if ( !activeView().IsNull() ) {
479 activeView()->WindowFit( rect.left(), rect.top(), rect.right(), rect.bottom() );
480 emit vpTransformed( this );
485 Inits 'zoom' transformation. [ protected ]
487 void OCCViewer_ViewPort3d::startZoomAtPoint( int x, int y )
489 #if OCC_VERSION_LARGE > 0x0603000A // available only with OCC-6.3-sp11 and higher version
490 if ( !activeView().IsNull() && isAdvancedZoomingEnabled() )
491 activeView()->StartZoomAtPoint( x, y );
496 Called at 'zoom' transformation. [ virtual protected ]
498 void OCCViewer_ViewPort3d::zoom( int x0, int y0, int x, int y )
500 if ( !activeView().IsNull() ) {
501 // as OCCT respects a sign of only dx,
502 // but we want both signes to be taken into account
503 //activeView()->Zoom( x0, y0, x, y );
504 #if OCC_VERSION_LARGE > 0x0603000A // available only with OCC-6.3-sp11 and higher version
505 if ( isAdvancedZoomingEnabled() )
506 activeView()->ZoomAtPoint( x0, y0, x, y );
509 activeView()->Zoom( x0 + y0, 0, x + y, 0 );
510 emit vpTransformed( this );
515 Centers the viewport. [ virtual protected ]
517 void OCCViewer_ViewPort3d::setCenter( int x, int y )
519 if ( !activeView().IsNull() ) {
520 activeView()->Place( x, y, myScale );
521 emit vpTransformed( this );
526 Called at 'pan' transformation. [ virtual protected ]
528 void OCCViewer_ViewPort3d::pan( int dx, int dy )
530 if ( !activeView().IsNull() ) {
531 activeView()->Pan( dx, dy, 1.0 );
532 emit vpTransformed( this );
537 Inits 'rotation' transformation. [ protected ]
539 void OCCViewer_ViewPort3d::startRotation( int x, int y,
540 int theRotationPointType,
541 const gp_Pnt& theSelectedPoint )
543 if ( !activeView().IsNull() ) {
545 //double gx = activeView()->gx;
546 //activeView()->Gravity(gx,gy,gz);
548 switch ( theRotationPointType ) {
549 case OCCViewer_ViewWindow::GRAVITY:
550 activeView()->StartRotation( x, y, 0.45 );
552 case OCCViewer_ViewWindow::SELECTED:
556 activeView()->Size(X,Y);
557 rx = Standard_Real(activeView()->Convert(X));
558 ry = Standard_Real(activeView()->Convert(Y));
560 activeView()->Rotate( 0., 0., 0.,
561 theSelectedPoint.X(),theSelectedPoint.Y(), theSelectedPoint.Z(),
564 Quantity_Ratio zRotationThreshold;
565 zRotation = Standard_False;
566 zRotationThreshold = 0.45;
567 if( zRotationThreshold > 0. ) {
568 Standard_Real dx = Abs(sx - rx/2.);
569 Standard_Real dy = Abs(sy - ry/2.);
570 Standard_Real dd = zRotationThreshold * (rx + ry)/2.;
571 if( dx > dd || dy > dd ) zRotation = Standard_True;
577 activeView()->DepthFitAll();
582 Rotates the viewport. [ protected ]
584 void OCCViewer_ViewPort3d::rotate( int x, int y,
585 int theRotationPointType,
586 const gp_Pnt& theSelectedPoint )
588 if ( !activeView().IsNull() ) {
589 switch ( theRotationPointType ) {
590 case OCCViewer_ViewWindow::GRAVITY:
591 activeView()->Rotation( x, y );
593 case OCCViewer_ViewWindow::SELECTED:
596 dz = atan2(Standard_Real(x)-rx/2., ry/2.-Standard_Real(y)) -
597 atan2(sx-rx/2.,ry/2.-sy);
601 dx = (Standard_Real(x) - sx) * M_PI/rx;
602 dy = (sy - Standard_Real(y)) * M_PI/ry;
606 activeView()->Rotate( dx, dy, dz,
607 theSelectedPoint.X(),theSelectedPoint.Y(), theSelectedPoint.Z(),
613 emit vpTransformed( this );
615 // setZSize( getZSize() );
619 Resets the viewport after 'rotation'. [ protected ]
621 void OCCViewer_ViewPort3d::endRotation()
623 if ( !activeView().IsNull() ) {
624 activeView()->ZFitAll(1.);
625 activeView()->SetZSize(0.);
626 activeView()->Update();
627 emit vpTransformed( this );
632 Repaints the viewport. [ virtual protected ]
634 void OCCViewer_ViewPort3d::paintEvent( QPaintEvent* e )
637 /* X11 : map before show doesn't work */
638 if ( !mapped( activeView() ) )
639 mapView( activeView() );
641 if ( !myWindow.IsNull() ) {
642 QApplication::syncX();
643 QRect rc = e->rect();
644 if ( !myPaintersRedrawing )
645 activeView()->Redraw( rc.x(), rc.y(), rc.width(), rc.height() );
647 OCCViewer_ViewPort::paintEvent( e );
652 Resizes the viewport. [ virtual protected ]
654 void OCCViewer_ViewPort3d::resizeEvent( QResizeEvent* e )
657 /* Win32 : map before first show to avoid flicker */
658 if ( !mapped( activeView() ) )
659 mapView( activeView() );
661 QApplication::syncX();
662 if ( !activeView().IsNull() )
663 activeView()->MustBeResized();
667 Fits all objects in view. [ virtual protected ]
669 void OCCViewer_ViewPort3d::fitAll( bool keepScale, bool withZ, bool upd )
671 if ( activeView().IsNull() )
675 myScale = activeView()->Scale();
677 Standard_Real margin = 0.01;
679 #if OCC_VERSION_LARGE > 0x06070000
680 activeView()->FitAll( margin, upd );
682 activeView()->ZFitAll();
684 activeView()->FitAll( margin, withZ, upd );
686 activeView()->SetZSize(0.);
687 emit vpTransformed( this );
691 Resets the view. [ virtual protected ]
693 void OCCViewer_ViewPort3d::reset()
695 // double zsize = getZSize();
696 if ( !activeView().IsNull() ) {
697 activeView()->Reset();
698 emit vpTransformed( this );
699 // setZSize( zsize );
704 Rotate the view in the view plane (orthogonal to the view vector)
706 void OCCViewer_ViewPort3d::rotateXY( double degrees )
708 if ( activeView().IsNull() )
711 int x = width()/2, y = height()/2;
713 activeView()->Convert( x, y, X, Y, Z );
714 activeView()->Rotate( 0, 0, degrees * M_PI / 180., X, Y, Z );
715 emit vpTransformed( this );
719 Set axial scale to the view
721 void OCCViewer_ViewPort3d::setAxialScale( double xScale, double yScale, double zScale )
723 if ( activeView().IsNull() )
726 activeView()->SetAxialScale( xScale, yScale, zScale );
727 emit vpTransformed( this );
731 Passed the handle of native window of the component to CASCADE view. [ private ]
733 bool OCCViewer_ViewPort3d::setWindow( const Handle(V3d_View)& view )
735 if ( !myWindow.IsNull() )
741 attachWindow( view, OCCViewer_VService::CreateWindow( view, winId() ) );
743 myWindow = view->Window();
744 return !myWindow.IsNull();
747 void OCCViewer_ViewPort3d::attachWindow( const Handle(V3d_View)& view,
748 const Handle(Aspect_Window)& window)
750 if (!view.IsNull()) {
751 view->SetWindow( window );
757 Returns the current active view. [ private ]
759 Handle(V3d_View) OCCViewer_ViewPort3d::activeView() const
765 Returns the current inactive view [ private ]
767 /*Handle(V3d_View) OCCViewer_ViewPort3d::inactiveView() const
769 return ( activeView() == myOrthoView ? myPerspView : myOrthoView );
773 Returns 'true' if the given view is mapped to window. [ private ]
775 bool OCCViewer_ViewPort3d::mapped( const Handle(V3d_View)& view ) const
777 return ( !view.IsNull() && view->View()->IsDefined() );
781 Performs synchronization of view parameters with the specified view.
782 Returns \c true if synchronization is done successfully or \c false otherwise.
783 Default implementation does nothing (return \c false)
785 bool OCCViewer_ViewPort3d::synchronize( OCCViewer_ViewPort* view )
788 OCCViewer_ViewPort3d* vp3d = qobject_cast<OCCViewer_ViewPort3d*>( view );
790 bool blocked = blockSignals( false );
791 Handle(V3d_View) aView3d = getView();
792 Handle(V3d_View) aRefView3d = vp3d->getView();
793 aView3d->SetImmediateUpdate( Standard_False );
794 #if OCC_VERSION_LARGE > 0x06070000
795 aView3d->Camera()->Copy( aRefView3d->Camera() );
797 aView3d->SetViewMapping( aRefView3d->ViewMapping() );
798 aView3d->SetViewOrientation( aRefView3d->ViewOrientation() );
801 aView3d->SetImmediateUpdate( Standard_True );
803 blockSignals( blocked );
810 * Show/Hide static triedron
812 void OCCViewer_ViewPort3d::updateStaticTriedronVisibility() {
813 OCCViewer_ViewWindow* aVW = dynamic_cast<OCCViewer_ViewWindow*>( parentWidget()->parentWidget()->parentWidget() );
815 OCCViewer_Viewer* aViewModel = dynamic_cast<OCCViewer_Viewer*>( aVW->getViewManager()->getViewModel() );
816 Handle(V3d_View) aView = activeView();
818 if(aViewModel->isStaticTrihedronDisplayed()) {
819 aView->TriedronDisplay( Aspect_TOTP_LEFT_LOWER, Quantity_NOC_WHITE, 0.05, V3d_ZBUFFER );
821 aView->TriedronErase();