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 <SUIT_ViewManager.h>
30 #include <SUIT_ViewModel.h>
36 #include <QPaintEvent>
37 #include <QResizeEvent>
38 #include <QApplication>
40 #include <Visual3d_View.hxx>
41 #include <V3d_Viewer.hxx>
43 #if OCC_VERSION_LARGE > 0x06070100
44 #include <V3d_View.hxx>
46 #include <V3d_PerspectiveView.hxx>
47 #include <V3d_OrthographicView.hxx>
50 #include "utilities.h"
53 #include <WNT_Window.hxx>
55 #include <Xw_Window.hxx>
58 static double rx = 0.;
59 static double ry = 0.;
62 static Standard_Boolean zRotation = Standard_False;
64 //#include <Standard_Version.hxx>
69 OCCViewer_ViewPort3d::OCCViewer_ViewPort3d( QWidget* parent, const Handle( V3d_Viewer)& viewer, V3d_TypeOfView type )
70 : OCCViewer_ViewPort( parent ),
73 myIsAdvancedZoomingEnabled( false )
75 // VSR: 01/07/2010 commented to avoid SIGSEGV at SALOME exit
78 #if OCC_VERSION_LARGE > 0x06070100
79 myActiveView = new V3d_View( viewer, type );
81 if ( type == V3d_ORTHOGRAPHIC ) {
82 myOrthoView = new V3d_OrthographicView( viewer );
83 myActiveView = myOrthoView;
86 myPerspView = new V3d_PerspectiveView( viewer );
87 myActiveView = myPerspView;
91 setBackground( Qtx::BackgroundData( Qt::black ) ); // set default background
97 OCCViewer_ViewPort3d::~OCCViewer_ViewPort3d()
100 Handle(V3d_View) aView = activeView();
106 Activates the desired 'type' of view in the viewer
107 ( view of 'type' is created if it doesn't exist ). [ public ]
109 /*void OCCViewer_ViewPort3d::setActive( V3d_TypeOfView type )
111 if ( activeView().IsNull() )
114 if ( activeView()->Type() != type )
116 if ( type == V3d_ORTHOGRAPHIC )
117 setView( myOrthoView );
118 if ( type == V3d_PERSPECTIVE )
119 setView( myPerspView );
124 Maps CasCade 'view' to this viewport. [ private ]
126 bool OCCViewer_ViewPort3d::mapView( const Handle(V3d_View)& view )
128 if ( !setWindow( view ) )
131 if ( !mapped( view ) ) {
132 view->SetWindow( myWindow );
133 if ( view != activeView() )
134 view->View()->Deactivate();
137 /* create static trihedron (16551: EDF PAL 501) */
138 OCCViewer_ViewWindow* aVW = dynamic_cast<OCCViewer_ViewWindow*>( parentWidget()->parentWidget()->parentWidget() );
140 OCCViewer_Viewer* aViewModel = dynamic_cast<OCCViewer_Viewer*>( aVW->getViewManager()->getViewModel() );
141 if ( aViewModel && aViewModel->isStaticTrihedronDisplayed() ){
142 view->ZBufferTriedronSetup();
143 view->TriedronDisplay( Aspect_TOTP_LEFT_LOWER, Quantity_NOC_WHITE, 0.05, V3d_ZBUFFER );
155 Sets new CASCADE view on viewport. Returns the previous active view. [ public ]
157 Handle( V3d_View ) OCCViewer_ViewPort3d::setView( const Handle( V3d_View )& view )
159 /* map the new view */
160 if ( view == activeView() || !mapView( view ) )
163 /* activate the new view*/
164 Handle( V3d_View ) oldView = activeView();
165 if ( !oldView.IsNull() ) {
166 if (oldView->View()->IsDefined())
167 oldView->View()->Deactivate();
168 view->SetBackgroundColor( oldView->BackgroundColor() );
171 view->View()->Activate();
177 Returns CasCade 3D view. [ public ]
179 Handle(V3d_View) OCCViewer_ViewPort3d::getView() const
185 Returns CasCade 3D viewer [ public ]
187 Handle(V3d_Viewer) OCCViewer_ViewPort3d::getViewer() const
189 Handle(V3d_Viewer) viewer;
190 if ( !activeView().IsNull() )
191 viewer = activeView()->Viewer();
196 Syncronizes visual state of this viewport with 'ref'
197 ( scale, projection, eye etc ) Returns 'true' if copied OK,
198 'false' otherwise. [ virtual public ]
200 bool OCCViewer_ViewPort3d::syncronize( const OCCViewer_ViewPort3d* ref )
202 OCCViewer_ViewPort3d* ref3d = (OCCViewer_ViewPort3d*)ref;
203 Handle(V3d_View) refView = ref3d->getView();
204 Handle(V3d_View) tgtView = getView();
206 /* Syncronize view types */
207 /* if ( tgtView->Type() != refView->Type() )
209 setActive( refView->Type() );
213 /* The following params are copied:
214 - view type( ortho/persp )
215 - position of view point
216 - orientation of high point
217 - position of the eye
224 /* we'll update after setting all params */
225 tgtView->SetImmediateUpdate( Standard_False );
228 if ( refView->Type() == V3d_PERSPECTIVE )
229 tgtView->SetFocale( refView->Focale() );
232 Standard_Real x, y, z;
233 refView->At( x, y, z ); tgtView->SetAt( x, y, z );
234 refView->Up( x, y, z ); tgtView->SetUp( x, y, z );
235 refView->Eye( x, y, z ); tgtView->SetEye( x, y, z );
236 refView->Proj( x, y, z ); tgtView->SetProj( x, y, z );
237 #if OCC_VERSION_LARGE <= 0x06070100
238 refView->Center( x, y ); tgtView->SetCenter( x, y );
240 tgtView->SetScale( refView->Scale() );
241 tgtView->SetTwist( refView->Twist() );
245 tgtView->SetImmediateUpdate( Standard_True );
251 Returns Z-size of this view. [ public ]
253 double OCCViewer_ViewPort3d::getZSize() const
255 if ( !activeView().IsNull() )
256 return activeView()->ZSize();
261 Sets Z-size of this view ( for both orthographic and perspective ). [ public ]
263 void OCCViewer_ViewPort3d::setZSize( double zsize )
265 myActiveView->SetZSize( zsize );
266 /* if ( !myOrthoView.IsNull() )
267 myOrthoView->SetZSize( zsize );
268 if ( !myPerspView.IsNull() )
269 myPerspView->SetZSize( zsize );*/
273 Get axial scale to the view
275 void OCCViewer_ViewPort3d::getAxialScale( double& xScale, double& yScale, double& zScale )
277 xScale = yScale = zScale = 1.;
279 if ( !activeView().IsNull() )
280 activeView()->AxialScale( xScale, yScale, zScale );
284 Returns the background color [ virtual public ] [ obsolete ]
286 QColor OCCViewer_ViewPort3d::backgroundColor() const
288 return background().color();
292 Sets the background color [ virtual public ] [ obsolete ]
294 void OCCViewer_ViewPort3d::setBackgroundColor( const QColor& color )
296 Qtx::BackgroundData bg = background();
297 bg.setColor( color );
302 Returns the background data
304 Qtx::BackgroundData OCCViewer_ViewPort3d::background() const
310 Sets the background data
312 void OCCViewer_ViewPort3d::setBackground( const Qtx::BackgroundData& bgData )
314 if ( bgData.isValid() ) {
315 myBackground = bgData;
317 emit vpChangeBackground( myBackground );
321 void OCCViewer_ViewPort3d::updateBackground()
323 if ( activeView().IsNull() ) return;
324 if ( !myBackground.isValid() ) return;
326 // VSR: Important note on below code.
327 // In OCCT (in version 6.5.2), things about the background drawing
328 // are not straightforward and not clearly understandable:
329 // - Horizontal gradient is drawn vertically (!), well ok, from top side to bottom one.
330 // - Vertical gradient is drawn horizontally (!), from right side to left one (!!!).
331 // - First and second diagonal gradients are confused.
332 // - Image texture, once set, can not be removed (!).
333 // - Texture image fill mode Aspect_FM_NONE is not taken into account (and means the same
334 // as Aspect_FM_CENTERED).
335 // - The only way to cancel gradient background (and get back to single colored) is to
336 // set gradient background style to Aspect_GFM_NONE while passing two colors is also needed
337 // (see V3d_View::SetBgGradientColors() function).
338 // - Also, it is impossible to draw texture image above the gradiented background (only above
340 // In OCCT 6.5.3 all above mentioned problems are fixed; so, above comment should be removed as soon
341 // as SALOME is migrated to OCCT 6.5.3. The same concerns #ifdef statements in the below code
342 switch ( myBackground.mode() ) {
343 case Qtx::ColorBackground:
345 QColor c = myBackground.color();
347 // Unset texture should be done here
349 Quantity_Color qCol( c.red()/255., c.green()/255., c.blue()/255., Quantity_TOC_RGB );
350 #if OCC_VERSION_LARGE > 0x06050200 // available since OCCT 6.5.3
351 activeView()->SetBgGradientStyle( Aspect_GFM_NONE ); // cancel gradient background
352 activeView()->SetBgImageStyle( Aspect_FM_NONE ); // cancel texture background
354 // 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)
355 activeView()->SetBgGradientColors( qCol, qCol, Aspect_GFM_NONE );
357 // then change background color
358 activeView()->SetBackgroundColor( qCol );
360 activeView()->Update();
364 case Qtx::SimpleGradientBackground:
367 int type = myBackground.gradient( c1, c2 );
368 if ( c1.isValid() && type >= OCCViewer_Viewer::HorizontalGradient && type <= OCCViewer_Viewer::LastGradient ) {
369 // Unset texture should be done here
371 // Get colors and set-up gradiented background
372 if ( !c2.isValid() ) c2 = c1;
373 Quantity_Color qCol1( c1.red()/255., c1.green()/255., c1.blue()/255., Quantity_TOC_RGB );
374 Quantity_Color qCol2( c2.red()/255., c2.green()/255., c2.blue()/255., Quantity_TOC_RGB );
375 activeView()->SetBgImageStyle( Aspect_FM_NONE ); // cancel texture background
377 case OCCViewer_Viewer::HorizontalGradient:
378 #if OCC_VERSION_LARGE > 0x06050200 // available since OCCT 6.5.3
379 activeView()->SetBgGradientColors( qCol1, qCol2, Aspect_GFM_HOR, Standard_True );
381 // in OCCT before v6.5.3, to draw horizontal gradient it's necessary to use Aspect_GFM_VER type
382 // and interchange the colors
383 activeView()->SetBgGradientColors( qCol2, qCol1, Aspect_GFM_VER, Standard_True );
386 case OCCViewer_Viewer::VerticalGradient:
387 #if OCC_VERSION_LARGE > 0x06050200 // available since OCCT 6.5.3
388 activeView()->SetBgGradientColors( qCol1, qCol2, Aspect_GFM_VER, Standard_True );
390 // in OCCT before v6.5.3, to draw vertical gradient it's necessary to use Aspect_GFM_HOR type
391 activeView()->SetBgGradientColors( qCol1, qCol2, Aspect_GFM_HOR, Standard_True );
394 case OCCViewer_Viewer::Diagonal1Gradient:
395 #if OCC_VERSION_LARGE > 0x06050200 // available since OCCT 6.5.3
396 activeView()->SetBgGradientColors( qCol1, qCol2, Aspect_GFM_DIAG1, Standard_True );
398 // in OCCT before v6.5.3, to draw 1st dialognal gradient it's necessary to use Aspect_GFM_DIAG2 type
399 // and interchange the colors
400 activeView()->SetBgGradientColors( qCol2, qCol1, Aspect_GFM_DIAG2, Standard_True );
403 case OCCViewer_Viewer::Diagonal2Gradient:
404 #if OCC_VERSION_LARGE > 0x06050200 // available since OCCT 6.5.3
405 activeView()->SetBgGradientColors( qCol1, qCol2, Aspect_GFM_DIAG2, Standard_True );
407 // in OCCT before v6.5.3, to draw 2nd dialognal gradient it's necessary to use Aspect_GFM_DIAG1 type
408 activeView()->SetBgGradientColors( qCol1, qCol2, Aspect_GFM_DIAG1, Standard_True );
411 case OCCViewer_Viewer::Corner1Gradient:
412 activeView()->SetBgGradientColors( qCol1, qCol2, Aspect_GFM_CORNER1, Standard_True );
414 case OCCViewer_Viewer::Corner2Gradient:
415 activeView()->SetBgGradientColors( qCol1, qCol2, Aspect_GFM_CORNER2, Standard_True );
417 case OCCViewer_Viewer::Corner3Gradient:
418 activeView()->SetBgGradientColors( qCol1, qCol2, Aspect_GFM_CORNER3, Standard_True );
420 case OCCViewer_Viewer::Corner4Gradient:
421 activeView()->SetBgGradientColors( qCol1, qCol2, Aspect_GFM_CORNER4, Standard_True );
429 case Qtx::CustomGradientBackground:
431 // NOT IMPLEMENTED YET
437 #if OCC_VERSION_LARGE > 0x06050200 // available since OCCT 6.5.3
438 // VSR: In OCCT before v6.5.3 below code can't be used because of very ugly bug - it has been impossible to
439 // clear the background texture image as soon as it was once set to the viewer.
440 if ( myBackground.isTextureShown() ) {
442 int textureMode = myBackground.texture( fileName );
443 QFileInfo fi( fileName );
444 if ( !fileName.isEmpty() && fi.exists() ) {
445 // set texture image: file name and fill mode
446 switch ( textureMode ) {
447 case Qtx::CenterTexture:
448 activeView()->SetBackgroundImage( fi.absoluteFilePath().toLatin1().constData(), Aspect_FM_CENTERED );
450 case Qtx::TileTexture:
451 activeView()->SetBackgroundImage( fi.absoluteFilePath().toLatin1().constData(), Aspect_FM_TILED );
453 case Qtx::StretchTexture:
454 activeView()->SetBackgroundImage( fi.absoluteFilePath().toLatin1().constData(), Aspect_FM_STRETCH );
459 activeView()->Update();
466 Updates the active viewport. [ virtual public ]
468 void OCCViewer_ViewPort3d::onUpdate()
470 if ( !activeView().IsNull() )
471 activeView()->Update();
475 Called at 'window fit' transformation. [ virtual protected ]
477 void OCCViewer_ViewPort3d::fitRect( const QRect& rect )
479 if ( !activeView().IsNull() ) {
480 activeView()->WindowFit( rect.left(), rect.top(), rect.right(), rect.bottom() );
481 emit vpTransformed( this );
486 Inits 'zoom' transformation. [ protected ]
488 void OCCViewer_ViewPort3d::startZoomAtPoint( int x, int y )
490 #if OCC_VERSION_LARGE > 0x0603000A // available only with OCC-6.3-sp11 and higher version
491 if ( !activeView().IsNull() && isAdvancedZoomingEnabled() )
492 activeView()->StartZoomAtPoint( x, y );
497 Called at 'zoom' transformation. [ virtual protected ]
499 void OCCViewer_ViewPort3d::zoom( int x0, int y0, int x, int y )
501 if ( !activeView().IsNull() ) {
502 // as OCCT respects a sign of only dx,
503 // but we want both signes to be taken into account
504 //activeView()->Zoom( x0, y0, x, y );
505 #if OCC_VERSION_LARGE > 0x0603000A // available only with OCC-6.3-sp11 and higher version
506 if ( isAdvancedZoomingEnabled() )
507 activeView()->ZoomAtPoint( x0, y0, x, y );
510 activeView()->Zoom( x0 + y0, 0, x + y, 0 );
511 emit vpTransformed( this );
516 Centers the viewport. [ virtual protected ]
518 void OCCViewer_ViewPort3d::setCenter( int x, int y )
520 if ( !activeView().IsNull() ) {
521 activeView()->Place( x, y, myScale );
522 emit vpTransformed( this );
527 Called at 'pan' transformation. [ virtual protected ]
529 void OCCViewer_ViewPort3d::pan( int dx, int dy )
531 if ( !activeView().IsNull() ) {
532 activeView()->Pan( dx, dy, 1.0 );
533 emit vpTransformed( this );
538 Inits 'rotation' transformation. [ protected ]
540 void OCCViewer_ViewPort3d::startRotation( int x, int y,
541 int theRotationPointType,
542 const gp_Pnt& theSelectedPoint )
544 if ( !activeView().IsNull() ) {
546 //double gx = activeView()->gx;
547 //activeView()->Gravity(gx,gy,gz);
549 switch ( theRotationPointType ) {
550 case OCCViewer_ViewWindow::GRAVITY:
551 activeView()->StartRotation( x, y, 0.45 );
553 case OCCViewer_ViewWindow::SELECTED:
557 activeView()->Size(X,Y);
558 rx = Standard_Real(activeView()->Convert(X));
559 ry = Standard_Real(activeView()->Convert(Y));
561 activeView()->Rotate( 0., 0., 0.,
562 theSelectedPoint.X(),theSelectedPoint.Y(), theSelectedPoint.Z(),
565 Quantity_Ratio zRotationThreshold;
566 zRotation = Standard_False;
567 zRotationThreshold = 0.45;
568 if( zRotationThreshold > 0. ) {
569 Standard_Real dx = Abs(sx - rx/2.);
570 Standard_Real dy = Abs(sy - ry/2.);
571 Standard_Real dd = zRotationThreshold * (rx + ry)/2.;
572 if( dx > dd || dy > dd ) zRotation = Standard_True;
578 activeView()->DepthFitAll();
583 Rotates the viewport. [ protected ]
585 void OCCViewer_ViewPort3d::rotate( int x, int y,
586 int theRotationPointType,
587 const gp_Pnt& theSelectedPoint )
589 if ( !activeView().IsNull() ) {
590 switch ( theRotationPointType ) {
591 case OCCViewer_ViewWindow::GRAVITY:
592 activeView()->Rotation( x, y );
594 case OCCViewer_ViewWindow::SELECTED:
597 dz = atan2(Standard_Real(x)-rx/2., ry/2.-Standard_Real(y)) -
598 atan2(sx-rx/2.,ry/2.-sy);
602 dx = (Standard_Real(x) - sx) * M_PI/rx;
603 dy = (sy - Standard_Real(y)) * M_PI/ry;
607 activeView()->Rotate( dx, dy, dz,
608 theSelectedPoint.X(),theSelectedPoint.Y(), theSelectedPoint.Z(),
614 emit vpTransformed( this );
616 // setZSize( getZSize() );
620 Resets the viewport after 'rotation'. [ protected ]
622 void OCCViewer_ViewPort3d::endRotation()
624 if ( !activeView().IsNull() ) {
625 activeView()->ZFitAll( 1.0 );
626 #if OCC_VERSION_LARGE <= 0x06070100
627 activeView()->SetZSize( 0.0 );
629 activeView()->Update();
630 emit vpTransformed( this );
635 Repaints the viewport. [ virtual protected ]
637 void OCCViewer_ViewPort3d::paintEvent( QPaintEvent* e )
640 /* X11 : map before show doesn't work */
641 if ( !mapped( activeView() ) )
642 mapView( activeView() );
644 if ( !myWindow.IsNull() ) {
645 QApplication::syncX();
646 QRect rc = e->rect();
647 if ( !myPaintersRedrawing )
648 activeView()->Redraw( rc.x(), rc.y(), rc.width(), rc.height() );
650 OCCViewer_ViewPort::paintEvent( e );
655 Resizes the viewport. [ virtual protected ]
657 void OCCViewer_ViewPort3d::resizeEvent( QResizeEvent* e )
660 /* Win32 : map before first show to avoid flicker */
661 if ( !mapped( activeView() ) )
662 mapView( activeView() );
664 QApplication::syncX();
665 if ( !activeView().IsNull() )
666 activeView()->MustBeResized();
670 Fits all objects in view. [ virtual protected ]
672 void OCCViewer_ViewPort3d::fitAll( bool keepScale, bool withZ, bool upd )
674 if ( activeView().IsNull() )
678 myScale = activeView()->Scale();
680 Standard_Real margin = 0.01;
682 #if OCC_VERSION_LARGE > 0x06070100
683 activeView()->FitAll( margin, upd );
685 activeView()->ZFitAll();
687 activeView()->FitAll( margin, withZ, upd );
689 activeView()->SetZSize(0.);
690 emit vpTransformed( this );
694 Resets the view. [ virtual protected ]
696 void OCCViewer_ViewPort3d::reset()
698 // double zsize = getZSize();
699 if ( !activeView().IsNull() ) {
700 activeView()->Reset();
701 emit vpTransformed( this );
702 // setZSize( zsize );
707 Rotate the view in the view plane (orthogonal to the view vector)
709 void OCCViewer_ViewPort3d::rotateXY( double degrees )
711 if ( activeView().IsNull() )
714 int x = width()/2, y = height()/2;
716 activeView()->Convert( x, y, X, Y, Z );
717 activeView()->Rotate( 0, 0, degrees * M_PI / 180., X, Y, Z );
718 emit vpTransformed( this );
722 Set axial scale to the view
724 void OCCViewer_ViewPort3d::setAxialScale( double xScale, double yScale, double zScale )
726 if ( activeView().IsNull() )
729 activeView()->SetAxialScale( xScale, yScale, zScale );
730 emit vpTransformed( this );
734 Passed the handle of native window of the component to CASCADE view. [ private ]
736 bool OCCViewer_ViewPort3d::setWindow( const Handle(V3d_View)& view )
738 if ( !myWindow.IsNull() )
744 attachWindow( view, OCCViewer_VService::CreateWindow( view, winId() ) );
746 myWindow = view->Window();
747 return !myWindow.IsNull();
750 void OCCViewer_ViewPort3d::attachWindow( const Handle(V3d_View)& view,
751 const Handle(Aspect_Window)& window)
753 if (!view.IsNull()) {
754 view->SetWindow( window );
760 Returns the current active view. [ private ]
762 Handle(V3d_View) OCCViewer_ViewPort3d::activeView() const
768 Returns the current inactive view [ private ]
770 /*Handle(V3d_View) OCCViewer_ViewPort3d::inactiveView() const
772 return ( activeView() == myOrthoView ? myPerspView : myOrthoView );
776 Returns 'true' if the given view is mapped to window. [ private ]
778 bool OCCViewer_ViewPort3d::mapped( const Handle(V3d_View)& view ) const
780 return ( !view.IsNull() && view->View()->IsDefined() );
784 Performs synchronization of view parameters with the specified view.
785 Returns \c true if synchronization is done successfully or \c false otherwise.
786 Default implementation does nothing (return \c false)
788 bool OCCViewer_ViewPort3d::synchronize( OCCViewer_ViewPort* view )
791 OCCViewer_ViewPort3d* vp3d = qobject_cast<OCCViewer_ViewPort3d*>( view );
793 bool blocked = blockSignals( false );
794 Handle(V3d_View) aView3d = getView();
795 Handle(V3d_View) aRefView3d = vp3d->getView();
796 aView3d->SetImmediateUpdate( Standard_False );
797 #if OCC_VERSION_LARGE > 0x06070100
798 aView3d->Camera()->Copy( aRefView3d->Camera() );
800 aView3d->SetViewMapping( aRefView3d->ViewMapping() );
801 aView3d->SetViewOrientation( aRefView3d->ViewOrientation() );
804 aView3d->SetImmediateUpdate( Standard_True );
806 blockSignals( blocked );
813 * Show/Hide static triedron
815 void OCCViewer_ViewPort3d::updateStaticTriedronVisibility() {
816 OCCViewer_ViewWindow* aVW = dynamic_cast<OCCViewer_ViewWindow*>( parentWidget()->parentWidget()->parentWidget() );
818 OCCViewer_Viewer* aViewModel = dynamic_cast<OCCViewer_Viewer*>( aVW->getViewManager()->getViewModel() );
819 Handle(V3d_View) aView = activeView();
821 if(aViewModel->isStaticTrihedronDisplayed()) {
822 aView->TriedronDisplay( Aspect_TOTP_LEFT_LOWER, Quantity_NOC_WHITE, 0.05, V3d_ZBUFFER );
824 aView->TriedronErase();