1 // Copyright (C) 2007-2012 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.
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>
44 #include <V3d_PerspectiveView.hxx>
45 #include <V3d_OrthographicView.hxx>
47 #include "utilities.h"
50 #include <WNT_Window.hxx>
52 #include <Xw_Window.hxx>
55 static double rx = 0.;
56 static double ry = 0.;
59 static Standard_Boolean zRotation = Standard_False;
61 //#include <Standard_Version.hxx>
66 OCCViewer_ViewPort3d::OCCViewer_ViewPort3d( QWidget* parent, const Handle( V3d_Viewer)& viewer, V3d_TypeOfView type )
67 : OCCViewer_ViewPort( parent ),
69 myDegenerated( true ),
72 myIsAdvancedZoomingEnabled( false )
74 // VSR: 01/07/2010 commented to avoid SIGSEGV at SALOME exit
77 if ( type == V3d_ORTHOGRAPHIC ) {
78 myOrthoView = new V3d_OrthographicView( viewer );
79 myActiveView = myOrthoView;
82 myPerspView = new V3d_PerspectiveView( viewer );
83 myActiveView = myPerspView;
86 activeView()->SetDegenerateModeOn();
87 setBackground( Qtx::BackgroundData( Qt::black ) ); // set default background
93 OCCViewer_ViewPort3d::~OCCViewer_ViewPort3d()
95 Handle(V3d_View) aView = activeView();
101 Activates the desired 'type' of view in the viewer
102 ( view of 'type' is created if it doesn't exist ). [ public ]
104 /*void OCCViewer_ViewPort3d::setActive( V3d_TypeOfView type )
106 if ( activeView().IsNull() )
109 if ( activeView()->Type() != type )
111 if ( type == V3d_ORTHOGRAPHIC )
112 setView( myOrthoView );
113 if ( type == V3d_PERSPECTIVE )
114 setView( myPerspView );
119 Maps CasCade 'view' to this viewport. [ private ]
121 bool OCCViewer_ViewPort3d::mapView( const Handle(V3d_View)& view )
123 if ( !setWindow( view ) )
126 if ( !mapped( view ) ) {
127 view->SetWindow( myWindow );
128 if ( view != activeView() )
129 view->View()->Deactivate();
132 /* create static trihedron (16551: EDF PAL 501) */
133 OCCViewer_ViewWindow* aVW = dynamic_cast<OCCViewer_ViewWindow*>( parentWidget()->parentWidget()->parentWidget() );
135 OCCViewer_Viewer* aViewModel = dynamic_cast<OCCViewer_Viewer*>( aVW->getViewManager()->getViewModel() );
136 if ( aViewModel && aViewModel->isStaticTrihedronDisplayed() ){
137 view->ZBufferTriedronSetup();
138 view->TriedronDisplay( Aspect_TOTP_LEFT_LOWER, Quantity_NOC_WHITE, 0.05, V3d_ZBUFFER );
147 Sets new CASCADE view on viewport. Returns the previous active view. [ public ]
149 Handle( V3d_View ) OCCViewer_ViewPort3d::setView( const Handle( V3d_View )& view )
151 /* map the new view */
152 if ( view == activeView() || !mapView( view ) )
155 /* activate the new view*/
156 Handle( V3d_View ) oldView = activeView();
157 if ( !oldView.IsNull() ) {
158 if (oldView->View()->IsDefined())
159 oldView->View()->Deactivate();
160 view->SetBackgroundColor( oldView->BackgroundColor() );
164 view->SetDegenerateModeOn();
166 view->SetDegenerateModeOff();
168 view->View()->Activate();
174 Returns CasCade 3D view. [ public ]
176 Handle(V3d_View) OCCViewer_ViewPort3d::getView() const
182 Returns CasCade 3D viewer [ public ]
184 Handle(V3d_Viewer) OCCViewer_ViewPort3d::getViewer() const
186 Handle(V3d_Viewer) viewer;
187 if ( !activeView().IsNull() )
188 viewer = activeView()->Viewer();
193 Syncronizes visual state of this viewport with 'ref'
194 ( scale, projection, eye etc ) Returns 'true' if copied OK,
195 'false' otherwise. [ virtual public ]
197 bool OCCViewer_ViewPort3d::syncronize( const OCCViewer_ViewPort3d* ref )
199 OCCViewer_ViewPort3d* ref3d = (OCCViewer_ViewPort3d*)ref;
200 Handle(V3d_View) refView = ref3d->getView();
201 Handle(V3d_View) tgtView = getView();
203 /* Syncronize view types */
204 /* if ( tgtView->Type() != refView->Type() )
206 setActive( refView->Type() );
210 /* The following params are copied:
211 - view type( ortho/persp )
212 - position of view point
213 - orientation of high point
214 - position of the eye
221 /* we'll update after setting all params */
222 tgtView->SetImmediateUpdate( Standard_False );
225 if ( refView->Type() == V3d_PERSPECTIVE )
226 tgtView->SetFocale( refView->Focale() );
229 Standard_Real x, y, z;
230 refView->At( x, y, z ); tgtView->SetAt( x, y, z );
231 refView->Up( x, y, z ); tgtView->SetUp( x, y, z );
232 refView->Eye( x, y, z ); tgtView->SetEye( x, y, z );
233 refView->Proj( x, y, z ); tgtView->SetProj( x, y, z );
234 refView->Center( x, y ); tgtView->SetCenter( x, y );
235 tgtView->SetScale( refView->Scale() );
236 tgtView->SetTwist( refView->Twist() );
240 tgtView->SetImmediateUpdate( Standard_True );
245 Returns Z-size of this view. [ public ]
247 double OCCViewer_ViewPort3d::getZSize() const
249 if ( !activeView().IsNull() )
250 return activeView()->ZSize();
255 Sets Z-size of this view ( for both orthographic and perspective ). [ public ]
257 void OCCViewer_ViewPort3d::setZSize( double zsize )
259 myActiveView->SetZSize( zsize );
260 /* if ( !myOrthoView.IsNull() )
261 myOrthoView->SetZSize( zsize );
262 if ( !myPerspView.IsNull() )
263 myPerspView->SetZSize( zsize );*/
267 Get axial scale to the view
269 void OCCViewer_ViewPort3d::getAxialScale( double& xScale, double& yScale, double& zScale )
271 xScale = yScale = zScale = 1.;
273 if ( !activeView().IsNull() )
274 activeView()->AxialScale( xScale, yScale, zScale );
278 Returns the background color [ virtual public ] [ obsolete ]
280 QColor OCCViewer_ViewPort3d::backgroundColor() const
282 return background().color();
286 Sets the background color [ virtual public ] [ obsolete ]
288 void OCCViewer_ViewPort3d::setBackgroundColor( const QColor& color )
290 Qtx::BackgroundData bg = background();
291 bg.setColor( color );
296 Returns the background data
298 Qtx::BackgroundData OCCViewer_ViewPort3d::background() const
304 Sets the background data
306 void OCCViewer_ViewPort3d::setBackground( const Qtx::BackgroundData& bgData )
308 if ( bgData.isValid() ) {
309 myBackground = bgData;
311 emit vpChangeBackground( myBackground );
315 void OCCViewer_ViewPort3d::updateBackground()
317 if ( activeView().IsNull() ) return;
318 if ( !myBackground.isValid() ) return;
320 // VSR: Important note on below code.
321 // In OCCT (in version 6.5.2), things about the background drawing
322 // are not straightforward and not clearly understandable:
323 // - Horizontal gradient is drawn vertically (!), well ok, from top side to bottom one.
324 // - Vertical gradient is drawn horizontally (!), from right side to left one (!!!).
325 // - First and second diagonal gradients are confused.
326 // - Image texture, once set, can not be removed (!).
327 // - Texture image fill mode Aspect_FM_NONE is not taken into account (and means the same
328 // as Aspect_FM_CENTERED).
329 // - The only way to cancel gradient background (and get back to single colored) is to
330 // set gradient background style to Aspect_GFM_NONE while passing two colors is also needed
331 // (see V3d_View::SetBgGradientColors() function).
332 // - Also, it is impossible to draw texture image above the gradiented background (only above
334 // In OCCT 6.5.3 all above mentioned problems are fixed; so, above comment should be removed as soon
335 // as SALOME is migrated to OCCT 6.5.3. The same concerns #ifdef statements in the below code
336 switch ( myBackground.mode() ) {
337 case Qtx::ColorBackground:
339 QColor c = myBackground.color();
341 // Unset texture should be done here
343 Quantity_Color qCol( c.red()/255., c.green()/255., c.blue()/255., Quantity_TOC_RGB );
344 #if OCC_VERSION_LARGE > 0x06050200 // available since OCCT 6.5.3
345 activeView()->SetBgGradientStyle( Aspect_GFM_NONE ); // cancel gradient background
346 activeView()->SetBgImageStyle( Aspect_FM_NONE ); // cancel texture background
348 // 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)
349 activeView()->SetBgGradientColors( qCol, qCol, Aspect_GFM_NONE );
351 // then change background color
352 activeView()->SetBackgroundColor( qCol );
354 activeView()->Update();
358 case Qtx::SimpleGradientBackground:
361 int type = myBackground.gradient( c1, c2 );
362 if ( c1.isValid() && type >= OCCViewer_Viewer::HorizontalGradient && type <= OCCViewer_Viewer::LastGradient ) {
363 // Unset texture should be done here
365 // Get colors and set-up gradiented background
366 if ( !c2.isValid() ) c2 = c1;
367 Quantity_Color qCol1( c1.red()/255., c1.green()/255., c1.blue()/255., Quantity_TOC_RGB );
368 Quantity_Color qCol2( c2.red()/255., c2.green()/255., c2.blue()/255., Quantity_TOC_RGB );
369 activeView()->SetBgImageStyle( Aspect_FM_NONE ); // cancel texture background
371 case OCCViewer_Viewer::HorizontalGradient:
372 #if OCC_VERSION_LARGE > 0x06050200 // available since OCCT 6.5.3
373 activeView()->SetBgGradientColors( qCol1, qCol2, Aspect_GFM_HOR, Standard_True );
375 // in OCCT before v6.5.3, to draw horizontal gradient it's necessary to use Aspect_GFM_VER type
376 // and interchange the colors
377 activeView()->SetBgGradientColors( qCol2, qCol1, Aspect_GFM_VER, Standard_True );
380 case OCCViewer_Viewer::VerticalGradient:
381 #if OCC_VERSION_LARGE > 0x06050200 // available since OCCT 6.5.3
382 activeView()->SetBgGradientColors( qCol1, qCol2, Aspect_GFM_VER, Standard_True );
384 // in OCCT before v6.5.3, to draw vertical gradient it's necessary to use Aspect_GFM_HOR type
385 activeView()->SetBgGradientColors( qCol1, qCol2, Aspect_GFM_HOR, Standard_True );
388 case OCCViewer_Viewer::Diagonal1Gradient:
389 #if OCC_VERSION_LARGE > 0x06050200 // available since OCCT 6.5.3
390 activeView()->SetBgGradientColors( qCol1, qCol2, Aspect_GFM_DIAG1, Standard_True );
392 // in OCCT before v6.5.3, to draw 1st dialognal gradient it's necessary to use Aspect_GFM_DIAG2 type
393 // and interchange the colors
394 activeView()->SetBgGradientColors( qCol2, qCol1, Aspect_GFM_DIAG2, Standard_True );
397 case OCCViewer_Viewer::Diagonal2Gradient:
398 #if OCC_VERSION_LARGE > 0x06050200 // available since OCCT 6.5.3
399 activeView()->SetBgGradientColors( qCol1, qCol2, Aspect_GFM_DIAG2, Standard_True );
401 // in OCCT before v6.5.3, to draw 2nd dialognal gradient it's necessary to use Aspect_GFM_DIAG1 type
402 activeView()->SetBgGradientColors( qCol1, qCol2, Aspect_GFM_DIAG1, Standard_True );
405 case OCCViewer_Viewer::Corner1Gradient:
406 activeView()->SetBgGradientColors( qCol1, qCol2, Aspect_GFM_CORNER1, Standard_True );
408 case OCCViewer_Viewer::Corner2Gradient:
409 activeView()->SetBgGradientColors( qCol1, qCol2, Aspect_GFM_CORNER2, Standard_True );
411 case OCCViewer_Viewer::Corner3Gradient:
412 activeView()->SetBgGradientColors( qCol1, qCol2, Aspect_GFM_CORNER3, Standard_True );
414 case OCCViewer_Viewer::Corner4Gradient:
415 activeView()->SetBgGradientColors( qCol1, qCol2, Aspect_GFM_CORNER4, Standard_True );
423 case Qtx::CustomGradientBackground:
425 // NOT IMPLEMENTED YET
431 #if OCC_VERSION_LARGE > 0x06050200 // available since OCCT 6.5.3
432 // VSR: In OCCT before v6.5.3 below code can't be used because of very ugly bug - it has been impossible to
433 // clear the background texture image as soon as it was once set to the viewer.
434 if ( myBackground.isTextureShown() ) {
436 int textureMode = myBackground.texture( fileName );
437 QFileInfo fi( fileName );
438 if ( !fileName.isEmpty() && fi.exists() ) {
439 // set texture image: file name and fill mode
440 switch ( textureMode ) {
441 case Qtx::CenterTexture:
442 activeView()->SetBackgroundImage( fi.absoluteFilePath().toLatin1().constData(), Aspect_FM_CENTERED );
444 case Qtx::TileTexture:
445 activeView()->SetBackgroundImage( fi.absoluteFilePath().toLatin1().constData(), Aspect_FM_TILED );
447 case Qtx::StretchTexture:
448 activeView()->SetBackgroundImage( fi.absoluteFilePath().toLatin1().constData(), Aspect_FM_STRETCH );
453 activeView()->Update();
461 \param theDegenerated - degenerated mode
463 void OCCViewer_ViewPort3d::setAnimationMode(bool theDegenerated)
465 if ( !activeView().IsNull() ) {
466 myAnimate = theDegenerated;
467 activeView()->SetAnimationMode(true, theDegenerated);
472 Updates the active viewport. [ virtual public ]
474 void OCCViewer_ViewPort3d::onUpdate()
476 if ( !activeView().IsNull() )
477 activeView()->Update();
481 Called at 'window fit' transformation. [ virtual protected ]
483 void OCCViewer_ViewPort3d::fitRect( const QRect& rect )
485 if ( !activeView().IsNull() ) {
486 activeView()->WindowFit( rect.left(), rect.top(), rect.right(), rect.bottom() );
487 emit vpTransformed( this );
492 Inits 'zoom' transformation. [ protected ]
494 void OCCViewer_ViewPort3d::startZoomAtPoint( int x, int y )
496 #if OCC_VERSION_LARGE > 0x0603000A // available only with OCC-6.3-sp11 and higher version
497 if ( !activeView().IsNull() && isAdvancedZoomingEnabled() )
498 activeView()->StartZoomAtPoint( x, y );
503 Called at 'zoom' transformation. [ virtual protected ]
505 void OCCViewer_ViewPort3d::zoom( int x0, int y0, int x, int y )
507 if ( !activeView().IsNull() ) {
508 // as OCCT respects a sign of only dx,
509 // but we want both signes to be taken into account
510 //activeView()->Zoom( x0, y0, x, y );
511 #if OCC_VERSION_LARGE > 0x0603000A // available only with OCC-6.3-sp11 and higher version
512 if ( isAdvancedZoomingEnabled() )
513 activeView()->ZoomAtPoint( x0, y0, x, y );
516 activeView()->Zoom( x0 + y0, 0, x + y, 0 );
517 emit vpTransformed( this );
522 Centers the viewport. [ virtual protected ]
524 void OCCViewer_ViewPort3d::setCenter( int x, int y )
526 if ( !activeView().IsNull() ) {
527 activeView()->Place( x, y, myScale );
528 emit vpTransformed( this );
533 Called at 'pan' transformation. [ virtual protected ]
535 void OCCViewer_ViewPort3d::pan( int dx, int dy )
537 if ( !activeView().IsNull() ) {
538 activeView()->Pan( dx, dy, 1.0 );
539 emit vpTransformed( this );
544 Inits 'rotation' transformation. [ protected ]
546 void OCCViewer_ViewPort3d::startRotation( int x, int y,
547 int theRotationPointType,
548 const gp_Pnt& theSelectedPoint )
550 if ( !activeView().IsNull() ) {
551 myDegenerated = activeView()->DegenerateModeIsOn();
552 activeView()->SetDegenerateModeOn();
553 if (myAnimate) activeView()->SetAnimationModeOn();
556 //double gx = activeView()->gx;
557 //activeView()->Gravity(gx,gy,gz);
559 switch ( theRotationPointType ) {
560 case OCCViewer_ViewWindow::GRAVITY:
561 activeView()->StartRotation( x, y, 0.45 );
563 case OCCViewer_ViewWindow::SELECTED:
567 activeView()->Size(X,Y);
568 rx = Standard_Real(activeView()->Convert(X));
569 ry = Standard_Real(activeView()->Convert(Y));
571 activeView()->Rotate( 0., 0., 0.,
572 theSelectedPoint.X(),theSelectedPoint.Y(), theSelectedPoint.Z(),
575 Quantity_Ratio zRotationThreshold;
576 zRotation = Standard_False;
577 zRotationThreshold = 0.45;
578 if( zRotationThreshold > 0. ) {
579 Standard_Real dx = Abs(sx - rx/2.);
580 Standard_Real dy = Abs(sy - ry/2.);
581 Standard_Real dd = zRotationThreshold * (rx + ry)/2.;
582 if( dx > dd || dy > dd ) zRotation = Standard_True;
588 activeView()->DepthFitAll();
593 Rotates the viewport. [ protected ]
595 void OCCViewer_ViewPort3d::rotate( int x, int y,
596 int theRotationPointType,
597 const gp_Pnt& theSelectedPoint )
599 if ( !activeView().IsNull() ) {
600 switch ( theRotationPointType ) {
601 case OCCViewer_ViewWindow::GRAVITY:
602 activeView()->Rotation( x, y );
604 case OCCViewer_ViewWindow::SELECTED:
607 dz = atan2(Standard_Real(x)-rx/2., ry/2.-Standard_Real(y)) -
608 atan2(sx-rx/2.,ry/2.-sy);
612 dx = (Standard_Real(x) - sx) * M_PI/rx;
613 dy = (sy - Standard_Real(y)) * M_PI/ry;
617 activeView()->Rotate( dx, dy, dz,
618 theSelectedPoint.X(),theSelectedPoint.Y(), theSelectedPoint.Z(),
624 emit vpTransformed( this );
626 // setZSize( getZSize() );
630 Resets the viewport after 'rotation'. [ protected ]
632 void OCCViewer_ViewPort3d::endRotation()
634 if ( !activeView().IsNull() ) {
635 if (myAnimate) activeView()->SetAnimationModeOff();
636 if ( !myDegenerated )
637 activeView()->SetDegenerateModeOff();
638 activeView()->ZFitAll(1.);
639 activeView()->SetZSize(0.);
640 activeView()->Update();
641 emit vpTransformed( this );
646 Repaints the viewport. [ virtual protected ]
648 void OCCViewer_ViewPort3d::paintEvent( QPaintEvent* e )
651 /* X11 : map before show doesn't work */
652 if ( !mapped( activeView() ) )
653 mapView( activeView() );
655 if ( !myWindow.IsNull() ) {
656 QApplication::syncX();
657 QRect rc = e->rect();
658 if ( !myPaintersRedrawing )
659 activeView()->Redraw( rc.x(), rc.y(), rc.width(), rc.height() );
661 OCCViewer_ViewPort::paintEvent( e );
666 Resizes the viewport. [ virtual protected ]
668 void OCCViewer_ViewPort3d::resizeEvent( QResizeEvent* e )
671 /* Win32 : map before first show to avoid flicker */
672 if ( !mapped( activeView() ) )
673 mapView( activeView() );
675 QApplication::syncX();
676 if ( !activeView().IsNull() )
677 activeView()->MustBeResized();
681 Fits all objects in view. [ virtual protected ]
683 void OCCViewer_ViewPort3d::fitAll( bool keepScale, bool withZ, bool upd )
685 if ( activeView().IsNull() )
689 myScale = activeView()->Scale();
691 Standard_Real margin = 0.01;
692 activeView()->FitAll( margin, withZ, upd );
693 activeView()->SetZSize(0.);
694 emit vpTransformed( this );
698 Resets the view. [ virtual protected ]
700 void OCCViewer_ViewPort3d::reset()
702 // double zsize = getZSize();
703 if ( !activeView().IsNull() ) {
704 activeView()->Reset();
705 emit vpTransformed( this );
706 // setZSize( zsize );
711 Rotate the view in the view plane (orthogonal to the view vector)
713 void OCCViewer_ViewPort3d::rotateXY( double degrees )
715 if ( activeView().IsNull() )
718 int x = width()/2, y = height()/2;
720 activeView()->Convert( x, y, X, Y, Z );
721 activeView()->Rotate( 0, 0, degrees * M_PI / 180., X, Y, Z );
722 emit vpTransformed( this );
726 Set axial scale to the view
728 void OCCViewer_ViewPort3d::setAxialScale( double xScale, double yScale, double zScale )
730 if ( activeView().IsNull() )
733 activeView()->SetAxialScale( xScale, yScale, zScale );
734 emit vpTransformed( this );
738 Passed the handle of native window of the component to CASCADE view. [ private ]
740 bool OCCViewer_ViewPort3d::setWindow( const Handle(V3d_View)& view )
742 if ( !myWindow.IsNull() )
748 int hwnd = (int)winId();
752 /* set this widget as the drawing window */
753 short lo = (short)hwnd;
754 short hi = (short)( hwnd >> 16 );
756 attachWindow( view, OCCViewer_VService::CreateWindow( view, (int)hi, (int)lo, Xw_WQ_SAMEQUALITY ) );
758 myWindow = view->Window();
759 return !myWindow.IsNull();
762 void OCCViewer_ViewPort3d::attachWindow( const Handle(V3d_View)& view,
763 const Handle(Aspect_Window)& window)
765 if (!view.IsNull()) {
766 view->SetWindow( window );
772 Returns the current active view. [ private ]
774 Handle(V3d_View) OCCViewer_ViewPort3d::activeView() const
780 Returns the current inactive view [ private ]
782 /*Handle(V3d_View) OCCViewer_ViewPort3d::inactiveView() const
784 return ( activeView() == myOrthoView ? myPerspView : myOrthoView );
788 Returns 'true' if the given view is mapped to window. [ private ]
790 bool OCCViewer_ViewPort3d::mapped( const Handle(V3d_View)& view ) const
792 return ( !view.IsNull() && view->View()->IsDefined() );
796 Performs synchronization of view parameters with the specified view.
797 Returns \c true if synchronization is done successfully or \c false otherwise.
798 Default implementation does nothing (return \c false)
800 bool OCCViewer_ViewPort3d::synchronize( OCCViewer_ViewPort* view )
803 OCCViewer_ViewPort3d* vp3d = qobject_cast<OCCViewer_ViewPort3d*>( view );
805 bool blocked = blockSignals( false );
806 Handle(V3d_View) aView3d = getView();
807 Handle(V3d_View) aRefView3d = vp3d->getView();
808 aView3d->SetImmediateUpdate( Standard_False );
809 aView3d->SetViewMapping( aRefView3d->ViewMapping() );
810 aView3d->SetViewOrientation( aRefView3d->ViewOrientation() );
812 aView3d->SetImmediateUpdate( Standard_True );
814 blockSignals( blocked );
821 * Show/Hide static triedron
823 void OCCViewer_ViewPort3d::updateStaticTriedronVisibility() {
824 OCCViewer_ViewWindow* aVW = dynamic_cast<OCCViewer_ViewWindow*>( parentWidget()->parentWidget()->parentWidget() );
826 OCCViewer_Viewer* aViewModel = dynamic_cast<OCCViewer_Viewer*>( aVW->getViewManager()->getViewModel() );
827 Handle(V3d_View) aView = activeView();
829 if(aViewModel->isStaticTrihedronDisplayed()) {
830 aView->TriedronDisplay( Aspect_TOTP_LEFT_LOWER, Quantity_NOC_WHITE, 0.05, V3d_ZBUFFER );
832 aView->TriedronErase();