0026780: Coding rules - eliminate warnings on Linux and Mac
[occt.git] / samples / qt / Common / src / View.cxx
CommitLineData
50fe2dab 1#if !defined _WIN32
7fd59977 2#define QT_CLEAN_NAMESPACE /* avoid definition of INT32 and INT8 */
3#endif
4
5#include "View.h"
6#include "ApplicationCommon.h"
7
8#include <QApplication>
9#include <QPainter>
10#include <QMenu>
11#include <QColorDialog>
12#include <QCursor>
13#include <QFileInfo>
e276548b 14#include <QFileDialog>
7fd59977 15#include <QMouseEvent>
16#include <QRubberBand>
861a7b03 17#include <QMdiSubWindow>
18#include <QStyleFactory>
7fd59977 19
7fd59977 20#include <Graphic3d_ExportFormat.hxx>
dc3fe572 21#include <Graphic3d_GraphicDriver.hxx>
e276548b 22#include <Graphic3d_TextureEnv.hxx>
7fd59977 23
5f9575b3 24#if defined(_WIN32) || defined(__WIN32__)
7fd59977 25#include <WNT_Window.hxx>
5f9575b3 26#elif defined(__APPLE__) && !defined(MACOSX_USE_GLX)
27#include <Cocoa_Window.hxx>
7fd59977 28#else
29#include <QX11Info>
30#include <GL/glx.h>
31#include <X11/Xutil.h>
32#include <X11/Xatom.h>
7fd59977 33#include <X11/Xlib.h>
34#include <Xw_Window.hxx>
7fd59977 35#include <QColormap>
36#endif
37
dc3fe572 38#include <Aspect_DisplayConnection.hxx>
39
7fd59977 40// the key for multi selection :
41#define MULTISELECTIONKEY Qt::ShiftModifier
42
43// the key for shortcut ( use to activate dynamic rotation, panning )
44#define CASCADESHORTCUTKEY Qt::ControlModifier
45
46// for elastic bean selection
47#define ValZWMin 1
48
49static QCursor* defCursor = NULL;
50static QCursor* handCursor = NULL;
51static QCursor* panCursor = NULL;
52static QCursor* globPanCursor = NULL;
53static QCursor* zoomCursor = NULL;
54static QCursor* rotCursor = NULL;
55
861a7b03 56View::View( Handle(AIS_InteractiveContext) theContext, QWidget* parent )
7fd59977 57: QWidget( parent ),
2ad228f6 58 myIsRaytracing( false ),
59 myIsShadowsEnabled (true),
60 myIsReflectionsEnabled (false),
61 myIsAntialiasingEnabled (false),
62 myViewActions( 0 ),
63 myRaytraceActions( 0 ),
64 myBackMenu( NULL )
7fd59977 65{
5f9575b3 66#if !defined(_WIN32) && !defined(__WIN32__) && (!defined(__APPLE__) || defined(MACOSX_USE_GLX))
7fd59977 67 //XSynchronize( x11Display(),true ); // it is possible to use QApplication::syncX();
68 XSynchronize( x11Info().display(),true ); // it is possible to use QApplication::syncX();
69#endif
7fd59977 70
2ad228f6 71 myFirst = true;
72 myContext = theContext;
e276548b 73
2ad228f6 74 myXmin = 0;
75 myYmin = 0;
76 myXmax = 0;
77 myYmax = 0;
78 myCurZoom = 0;
79 myRectBand = 0;
7fd59977 80
2ad228f6 81 setAttribute(Qt::WA_PaintOnScreen);
82 setAttribute(Qt::WA_NoSystemBackground);
7fd59977 83
5f9575b3 84#if !defined(_WIN32) && !defined(__WIN32__) && (!defined(__APPLE__) || defined(MACOSX_USE_GLX))
7fd59977 85 XVisualInfo* pVisualInfo;
86 if ( x11Info().display() )
87 {
88 /* Initialization with the default VisualID */
89 Visual *v = DefaultVisual( x11Info().display(), DefaultScreen( x11Info().display() ) );
90 int visualID = XVisualIDFromVisual( v );
91
92 /* Here we use the settings from Optimizer_ViewInfo::TxglCreateWindow() */
93 int visualAttr[] = { GLX_RGBA, GLX_DEPTH_SIZE, 1, GLX_RED_SIZE, 1, GLX_GREEN_SIZE, 1,
2ad228f6 94 GLX_BLUE_SIZE, 1, GLX_DOUBLEBUFFER, None };
7fd59977 95 pVisualInfo = ::glXChooseVisual( x11Info().display(), DefaultScreen( x11Info().display() ), visualAttr );
96
97 if ( isVisible() )
98 hide();
99
100 XSetWindowAttributes a;
101
102 Window p = RootWindow( x11Info().display(), DefaultScreen( x11Info().display() ) );
103 a.colormap = XCreateColormap( x11Info().display(), RootWindow( x11Info().display(), pVisualInfo->screen ),
104 pVisualInfo->visual, AllocNone );
2ad228f6 105
106 QColor color = palette().color( backgroundRole() );
7fd59977 107 QColormap colmap = QColormap::instance();
108 a.background_pixel = colmap.pixel( color );
109 a.border_pixel = colmap.pixel( Qt::black );
110 if ( parentWidget() )
111 p = parentWidget()->winId();
112
113 Window w = XCreateWindow( x11Info().display(), p, x(), y(), width(), height(),
2ad228f6 114 0, pVisualInfo->depth, InputOutput, pVisualInfo->visual,
115 CWBackPixel | CWBorderPixel | CWColormap, &a );
7fd59977 116 Window *cmw;
117 Window *cmwret;
118 int count;
119 if ( XGetWMColormapWindows( x11Info().display(), topLevelWidget()->winId(), &cmwret, &count ) )
120 {
121 cmw = new Window[count+1];
122 memcpy( (char *)cmw, (char *)cmwret, sizeof(Window)*count );
123 XFree( (char *)cmwret );
124 int i;
125 for ( i = 0; i < count; i++ )
126 {
2ad228f6 127 if ( cmw[i] == winId() ) /* replace old window */
128 {
129 cmw[i] = w;
130 break;
131 }
7fd59977 132 }
2ad228f6 133 if ( i >= count ) /* append new window */
134 cmw[count++] = w;
7fd59977 135 }
136 else
137 {
138 count = 1;
139 cmw = new Window[count];
140 cmw[0] = w;
141 }
142 /* Creating new window (with good VisualID) for this widget */
143 create(w);
144 XSetWMColormapWindows( x11Info().display(), topLevelWidget()->winId(), cmw, count );
145 delete [] cmw;
146
147 if ( isVisible() )
148 show();
149 if ( pVisualInfo )
150 XFree( (char *)pVisualInfo );
151 XFlush( x11Info().display() );
152 }
153#endif
2ad228f6 154
155 myCurrentMode = CurAction3d_Nothing;
156 myHlrModeIsOn = Standard_False;
157 setMouseTracking( true );
af4b4ba9 158
2ad228f6 159 initViewActions();
160 initCursors();
4d183a4b 161
2ad228f6 162 setBackgroundRole( QPalette::NoRole );//NoBackground );
163 // set focus policy to threat QContextMenuEvent from keyboard
164 setFocusPolicy( Qt::StrongFocus );
165 setAttribute( Qt::WA_PaintOnScreen );
166 setAttribute( Qt::WA_NoSystemBackground );
4d183a4b 167
7fd59977 168}
169
170View::~View()
171{
e276548b 172 delete myBackMenu;
7fd59977 173}
174
175void View::init()
176{
861a7b03 177 if ( myView.IsNull() )
178 myView = myContext->CurrentViewer()->CreateView();
179
5f9575b3 180#if defined(_WIN32) || defined(__WIN32__)
181 Aspect_Handle aWindowHandle = (Aspect_Handle )winId();
dc3fe572 182 Handle(WNT_Window) hWnd = new WNT_Window (aWindowHandle);
5f9575b3 183#elif defined(__APPLE__) && !defined(MACOSX_USE_GLX)
184 NSView* aViewHandle = (NSView* )winId();
185 Handle(Cocoa_Window) hWnd = new Cocoa_Window (aViewHandle);
7fd59977 186#else
ed97f43c 187 Window aWindowHandle = (Window )winId();
dc3fe572 188 Handle(Aspect_DisplayConnection) aDispConnection = myContext->CurrentViewer()->Driver()->GetDisplayConnection();
189 Handle(Xw_Window) hWnd = new Xw_Window (aDispConnection, aWindowHandle);
50fe2dab 190#endif // _WIN32
861a7b03 191
5f9575b3 192 myView->SetWindow (hWnd);
861a7b03 193 if ( !hWnd->IsMapped() )
5f9575b3 194 {
195 hWnd->Map();
196 }
197 myView->SetBackgroundColor (Quantity_NOC_BLACK);
198 myView->MustBeResized();
e276548b 199
861a7b03 200 if (myIsRaytracing)
2ad228f6 201 myView->ChangeRenderingParams().Method = Graphic3d_RM_RAYTRACING;
7fd59977 202}
203
de75ed09 204void View::paintEvent( QPaintEvent * )
7fd59977 205{
206// QApplication::syncX();
2ad228f6 207 if( myFirst )
208 {
209 init();
210 myFirst = false;
211 }
212 myView->Redraw();
7fd59977 213}
214
de75ed09 215void View::resizeEvent( QResizeEvent * )
7fd59977 216{
217// QApplication::syncX();
2ad228f6 218 if( !myView.IsNull() )
219 {
220 myView->MustBeResized();
221 }
7fd59977 222}
223
224void View::fitAll()
225{
2ad228f6 226 myView->FitAll();
227 myView->ZFitAll();
228 myView->Redraw();
7fd59977 229}
230
231void View::fitArea()
232{
2ad228f6 233 myCurrentMode = CurAction3d_WindowZooming;
7fd59977 234}
235
236void View::zoom()
237{
2ad228f6 238 myCurrentMode = CurAction3d_DynamicZooming;
7fd59977 239}
240
241void View::pan()
242{
2ad228f6 243 myCurrentMode = CurAction3d_DynamicPanning;
7fd59977 244}
245
246void View::rotation()
247{
2ad228f6 248 myCurrentMode = CurAction3d_DynamicRotation;
7fd59977 249}
250
251void View::globalPan()
252{
2ad228f6 253 // save the current zoom value
254 myCurZoom = myView->Scale();
255 // Do a Global Zoom
256 myView->FitAll();
257 // Set the mode
258 myCurrentMode = CurAction3d_GlobalPanning;
7fd59977 259}
260
261void View::front()
262{
2ad228f6 263 myView->SetProj( V3d_Xpos );
7fd59977 264}
265
266void View::back()
267{
2ad228f6 268 myView->SetProj( V3d_Xneg );
7fd59977 269}
270
271void View::top()
272{
2ad228f6 273 myView->SetProj( V3d_Zpos );
7fd59977 274}
275
276void View::bottom()
277{
2ad228f6 278 myView->SetProj( V3d_Zneg );
7fd59977 279}
280
281void View::left()
282{
2ad228f6 283 myView->SetProj( V3d_Ypos );
7fd59977 284}
285
286void View::right()
287{
2ad228f6 288 myView->SetProj( V3d_Yneg );
7fd59977 289}
290
291void View::axo()
292{
2ad228f6 293 myView->SetProj( V3d_XposYnegZpos );
7fd59977 294}
295
296void View::reset()
297{
2ad228f6 298 myView->Reset();
7fd59977 299}
300
301void View::hlrOff()
302{
2ad228f6 303 QApplication::setOverrideCursor( Qt::WaitCursor );
304 myHlrModeIsOn = Standard_False;
305 myView->SetComputedMode (myHlrModeIsOn);
306 QApplication::restoreOverrideCursor();
7fd59977 307}
308
309void View::hlrOn()
310{
2ad228f6 311 QApplication::setOverrideCursor( Qt::WaitCursor );
312 myHlrModeIsOn = Standard_True;
313 myView->SetComputedMode (myHlrModeIsOn);
314 QApplication::restoreOverrideCursor();
7fd59977 315}
316
861a7b03 317void View::SetRaytracedShadows (bool theState)
e276548b 318{
2ad228f6 319 myView->ChangeRenderingParams().IsShadowEnabled = theState;
861a7b03 320
321 myIsShadowsEnabled = theState;
322
323 myContext->UpdateCurrentViewer();
e276548b 324}
325
861a7b03 326void View::SetRaytracedReflections (bool theState)
e276548b 327{
2ad228f6 328 myView->ChangeRenderingParams().IsReflectionEnabled = theState;
861a7b03 329
330 myIsReflectionsEnabled = theState;
331
332 myContext->UpdateCurrentViewer();
e276548b 333}
334
861a7b03 335void View::onRaytraceAction()
e276548b 336{
861a7b03 337 QAction* aSentBy = (QAction*)sender();
338
339 if (aSentBy == myRaytraceActions->at (ToolRaytracingId))
340 {
341 bool aState = myRaytraceActions->at (ToolRaytracingId)->isChecked();
342
343 QApplication::setOverrideCursor (Qt::WaitCursor);
344 if (aState)
345 EnableRaytracing();
346 else
347 DisableRaytracing();
348 QApplication::restoreOverrideCursor();
349 }
350
351 if (aSentBy == myRaytraceActions->at (ToolShadowsId))
352 {
353 bool aState = myRaytraceActions->at (ToolShadowsId)->isChecked();
354 SetRaytracedShadows (aState);
355 }
356
357 if (aSentBy == myRaytraceActions->at (ToolReflectionsId))
358 {
359 bool aState = myRaytraceActions->at (ToolReflectionsId)->isChecked();
360 SetRaytracedReflections (aState);
361 }
362
363 if (aSentBy == myRaytraceActions->at (ToolAntialiasingId))
364 {
365 bool aState = myRaytraceActions->at (ToolAntialiasingId)->isChecked();
366 SetRaytracedAntialiasing (aState);
367 }
368}
369
370void View::SetRaytracedAntialiasing (bool theState)
371{
2ad228f6 372 myView->ChangeRenderingParams().IsAntialiasingEnabled = theState;
861a7b03 373
374 myIsAntialiasingEnabled = theState;
375
376 myContext->UpdateCurrentViewer();
377}
378
379void View::EnableRaytracing()
380{
381 if (!myIsRaytracing)
2ad228f6 382 myView->ChangeRenderingParams().Method = Graphic3d_RM_RAYTRACING;
861a7b03 383
384 myIsRaytracing = true;
385
386 myContext->UpdateCurrentViewer();
387}
388
389void View::DisableRaytracing()
390{
391 if (myIsRaytracing)
2ad228f6 392 myView->ChangeRenderingParams().Method = Graphic3d_RM_RASTERIZATION;
861a7b03 393
394 myIsRaytracing = false;
395
396 myContext->UpdateCurrentViewer();
e276548b 397}
398
7fd59977 399void View::updateToggled( bool isOn )
400{
2ad228f6 401 QAction* sentBy = (QAction*)sender();
7fd59977 402
2ad228f6 403 if( !isOn )
404 return;
7fd59977 405
2ad228f6 406 for ( int i = ViewFitAllId; i < ViewHlrOffId; i++ )
407 {
408 QAction* anAction = myViewActions->at( i );
409
410 if ( ( anAction == myViewActions->at( ViewFitAreaId ) ) ||
411 ( anAction == myViewActions->at( ViewZoomId ) ) ||
412 ( anAction == myViewActions->at( ViewPanId ) ) ||
413 ( anAction == myViewActions->at( ViewGlobalPanId ) ) ||
414 ( anAction == myViewActions->at( ViewRotationId ) ) )
7fd59977 415 {
2ad228f6 416 if ( anAction && ( anAction != sentBy ) )
417 {
418 anAction->setCheckable( true );
419 anAction->setChecked( false );
420 }
421 else
422 {
423 if ( sentBy == myViewActions->at( ViewFitAreaId ) )
424 setCursor( *handCursor );
425 else if ( sentBy == myViewActions->at( ViewZoomId ) )
426 setCursor( *zoomCursor );
427 else if ( sentBy == myViewActions->at( ViewPanId ) )
428 setCursor( *panCursor );
429 else if ( sentBy == myViewActions->at( ViewGlobalPanId ) )
430 setCursor( *globPanCursor );
431 else if ( sentBy == myViewActions->at( ViewRotationId ) )
432 setCursor( *rotCursor );
433 else
434 setCursor( *defCursor );
435
436 sentBy->setCheckable( false );
437 }
7fd59977 438 }
2ad228f6 439 }
7fd59977 440}
441
442void View::initCursors()
443{
2ad228f6 444 if ( !defCursor )
445 defCursor = new QCursor( Qt::ArrowCursor );
446 if ( !handCursor )
447 handCursor = new QCursor( Qt::PointingHandCursor );
448 if ( !panCursor )
449 panCursor = new QCursor( Qt::SizeAllCursor );
450 if ( !globPanCursor )
451 globPanCursor = new QCursor( Qt::CrossCursor );
452 if ( !zoomCursor )
453 zoomCursor = new QCursor( QPixmap( ApplicationCommonWindow::getResourceDir() + QString( "/" ) + QObject::tr( "ICON_CURSOR_ZOOM" ) ) );
454 if ( !rotCursor )
455 rotCursor = new QCursor( QPixmap( ApplicationCommonWindow::getResourceDir() + QString( "/" ) + QObject::tr( "ICON_CURSOR_ROTATE" ) ) );
7fd59977 456}
457
458QList<QAction*>* View::getViewActions()
459{
2ad228f6 460 initViewActions();
461 return myViewActions;
7fd59977 462}
463
861a7b03 464QList<QAction*>* View::getRaytraceActions()
465{
2ad228f6 466 initRaytraceActions();
467 return myRaytraceActions;
861a7b03 468}
469
4d183a4b 470/*!
471 Get paint engine for the OpenGL viewer. [ virtual public ]
472*/
473QPaintEngine* View::paintEngine() const
474{
475 return 0;
476}
477
7fd59977 478void View::initViewActions()
479{
480 if ( myViewActions )
481 return;
482
483 myViewActions = new QList<QAction*>();
484 QString dir = ApplicationCommonWindow::getResourceDir() + QString( "/" );
485 QAction* a;
486
487 a = new QAction( QPixmap( dir+QObject::tr("ICON_VIEW_FITALL") ), QObject::tr("MNU_FITALL"), this );
488 a->setToolTip( QObject::tr("TBR_FITALL") );
489 a->setStatusTip( QObject::tr("TBR_FITALL") );
3cb77da4 490 connect( a, SIGNAL( triggered() ) , this, SLOT( fitAll() ) );
7fd59977 491 myViewActions->insert(ViewFitAllId, a);
492
493 a = new QAction( QPixmap( dir+QObject::tr("ICON_VIEW_FITAREA") ), QObject::tr("MNU_FITAREA"), this );
494 a->setToolTip( QObject::tr("TBR_FITAREA") );
495 a->setStatusTip( QObject::tr("TBR_FITAREA") );
3cb77da4 496 connect( a, SIGNAL( triggered() ) , this, SLOT( fitArea() ) );
7fd59977 497
498 a->setCheckable( true );
499 connect( a, SIGNAL( toggled( bool ) ) , this, SLOT( updateToggled( bool ) ) );
500 myViewActions->insert( ViewFitAreaId, a );
501
502 a = new QAction( QPixmap( dir+QObject::tr("ICON_VIEW_ZOOM") ), QObject::tr("MNU_ZOOM"), this );
503 a->setToolTip( QObject::tr("TBR_ZOOM") );
504 a->setStatusTip( QObject::tr("TBR_ZOOM") );
3cb77da4 505 connect( a, SIGNAL( triggered() ) , this, SLOT( zoom() ) );
7fd59977 506
507 a->setCheckable( true );
508 connect( a, SIGNAL( toggled(bool) ) , this, SLOT( updateToggled(bool) ) );
509 myViewActions->insert( ViewZoomId, a );
510
511 a = new QAction( QPixmap( dir+QObject::tr("ICON_VIEW_PAN") ), QObject::tr("MNU_PAN"), this );
512 a->setToolTip( QObject::tr("TBR_PAN") );
513 a->setStatusTip( QObject::tr("TBR_PAN") );
3cb77da4 514 connect( a, SIGNAL( triggered() ) , this, SLOT( pan() ) );
7fd59977 515
516 a->setCheckable( true );
517 connect( a, SIGNAL( toggled(bool) ) , this, SLOT( updateToggled(bool) ) );
518 myViewActions->insert( ViewPanId, a );
519
520 a = new QAction( QPixmap( dir+QObject::tr("ICON_VIEW_GLOBALPAN") ), QObject::tr("MNU_GLOBALPAN"), this );
521 a->setToolTip( QObject::tr("TBR_GLOBALPAN") );
522 a->setStatusTip( QObject::tr("TBR_GLOBALPAN") );
3cb77da4 523 connect( a, SIGNAL( triggered() ) , this, SLOT( globalPan() ) );
7fd59977 524
525 a->setCheckable( true );
526 connect( a, SIGNAL( toggled(bool) ) , this, SLOT( updateToggled(bool) ) );
527 myViewActions->insert( ViewGlobalPanId, a );
528
529 a = new QAction( QPixmap( dir+QObject::tr("ICON_VIEW_FRONT") ), QObject::tr("MNU_FRONT"), this );
530 a->setToolTip( QObject::tr("TBR_FRONT") );
531 a->setStatusTip( QObject::tr("TBR_FRONT") );
3cb77da4 532 connect( a, SIGNAL( triggered() ) , this, SLOT( front() ) );
7fd59977 533 myViewActions->insert( ViewFrontId, a );
534
535 a = new QAction( QPixmap( dir+QObject::tr("ICON_VIEW_BACK") ), QObject::tr("MNU_BACK"), this );
536 a->setToolTip( QObject::tr("TBR_BACK") );
537 a->setStatusTip( QObject::tr("TBR_BACK") );
3cb77da4 538 connect( a, SIGNAL( triggered() ) , this, SLOT( back() ) );
7fd59977 539 myViewActions->insert(ViewBackId, a);
540
541 a = new QAction( QPixmap( dir+QObject::tr("ICON_VIEW_TOP") ), QObject::tr("MNU_TOP"), this );
542 a->setToolTip( QObject::tr("TBR_TOP") );
543 a->setStatusTip( QObject::tr("TBR_TOP") );
3cb77da4 544 connect( a, SIGNAL( triggered() ) , this, SLOT( top() ) );
7fd59977 545 myViewActions->insert( ViewTopId, a );
546
547 a = new QAction( QPixmap( dir+QObject::tr("ICON_VIEW_BOTTOM") ), QObject::tr("MNU_BOTTOM"), this );
548 a->setToolTip( QObject::tr("TBR_BOTTOM") );
549 a->setStatusTip( QObject::tr("TBR_BOTTOM") );
3cb77da4 550 connect( a, SIGNAL( triggered() ) , this, SLOT( bottom() ) );
7fd59977 551 myViewActions->insert( ViewBottomId, a );
552
553 a = new QAction( QPixmap( dir+QObject::tr("ICON_VIEW_LEFT") ), QObject::tr("MNU_LEFT"), this );
554 a->setToolTip( QObject::tr("TBR_LEFT") );
555 a->setStatusTip( QObject::tr("TBR_LEFT") );
3cb77da4 556 connect( a, SIGNAL( triggered() ) , this, SLOT( left() ) );
7fd59977 557 myViewActions->insert( ViewLeftId, a );
558
559 a = new QAction( QPixmap( dir+QObject::tr("ICON_VIEW_RIGHT") ), QObject::tr("MNU_RIGHT"), this );
560 a->setToolTip( QObject::tr("TBR_RIGHT") );
561 a->setStatusTip( QObject::tr("TBR_RIGHT") );
3cb77da4 562 connect( a, SIGNAL( triggered() ) , this, SLOT( right() ) );
7fd59977 563 myViewActions->insert( ViewRightId, a );
564
565 a = new QAction( QPixmap( dir+QObject::tr("ICON_VIEW_AXO") ), QObject::tr("MNU_AXO"), this );
566 a->setToolTip( QObject::tr("TBR_AXO") );
567 a->setStatusTip( QObject::tr("TBR_AXO") );
3cb77da4 568 connect( a, SIGNAL( triggered() ) , this, SLOT( axo() ) );
7fd59977 569 myViewActions->insert( ViewAxoId, a );
570
571 a = new QAction( QPixmap( dir+QObject::tr("ICON_VIEW_ROTATION") ), QObject::tr("MNU_ROTATION"), this );
572 a->setToolTip( QObject::tr("TBR_ROTATION") );
573 a->setStatusTip( QObject::tr("TBR_ROTATION") );
3cb77da4 574 connect( a, SIGNAL( triggered() ) , this, SLOT( rotation() ) );
7fd59977 575 a->setCheckable( true );
576 connect( a, SIGNAL( toggled(bool) ) , this, SLOT( updateToggled(bool) ) );
577 myViewActions->insert( ViewRotationId, a );
578
579 a = new QAction( QPixmap( dir+QObject::tr("ICON_VIEW_RESET") ), QObject::tr("MNU_RESET"), this );
580 a->setToolTip( QObject::tr("TBR_RESET") );
581 a->setStatusTip( QObject::tr("TBR_RESET") );
3cb77da4 582 connect( a, SIGNAL( triggered() ) , this, SLOT( reset() ) );
7fd59977 583 myViewActions->insert( ViewResetId, a );
584
585 QActionGroup* ag = new QActionGroup( this );
586
587 a = new QAction( QPixmap( dir+QObject::tr("ICON_VIEW_HLROFF") ), QObject::tr("MNU_HLROFF"), this );
588 a->setToolTip( QObject::tr("TBR_HLROFF") );
589 a->setStatusTip( QObject::tr("TBR_HLROFF") );
3cb77da4 590 connect( a, SIGNAL( triggered() ) , this, SLOT( hlrOff() ) );
7fd59977 591 a->setCheckable( true );
592 ag->addAction(a);
593 myViewActions->insert(ViewHlrOffId, a);
594
595 a = new QAction( QPixmap( dir+QObject::tr("ICON_VIEW_HLRON") ), QObject::tr("MNU_HLRON"), this );
596 a->setToolTip( QObject::tr("TBR_HLRON") );
597 a->setStatusTip( QObject::tr("TBR_HLRON") );
3cb77da4 598 connect( a, SIGNAL( triggered() ) ,this, SLOT( hlrOn() ) );
7fd59977 599
600 a->setCheckable( true );
601 ag->addAction(a);
602 myViewActions->insert( ViewHlrOnId, a );
603}
604
861a7b03 605void View::initRaytraceActions()
606{
607 if ( myRaytraceActions )
608 return;
609
610 myRaytraceActions = new QList<QAction*>();
611 QString dir = ApplicationCommonWindow::getResourceDir() + QString( "/" );
612 QAction* a;
613
614 a = new QAction( QPixmap( dir+QObject::tr("ICON_TOOL_RAYTRACING") ), QObject::tr("MNU_TOOL_RAYTRACING"), this );
615 a->setToolTip( QObject::tr("TBR_TOOL_RAYTRACING") );
616 a->setStatusTip( QObject::tr("TBR_TOOL_RAYTRACING") );
617 a->setCheckable( true );
618 a->setChecked( false );
619 connect( a, SIGNAL( activated() ) , this, SLOT( onRaytraceAction() ) );
620 myRaytraceActions->insert( ToolRaytracingId, a );
621
622 a = new QAction( QPixmap( dir+QObject::tr("ICON_TOOL_SHADOWS") ), QObject::tr("MNU_TOOL_SHADOWS"), this );
623 a->setToolTip( QObject::tr("TBR_TOOL_SHADOWS") );
624 a->setStatusTip( QObject::tr("TBR_TOOL_SHADOWS") );
625 a->setCheckable( true );
626 a->setChecked( true );
627 connect( a, SIGNAL( activated() ) , this, SLOT( onRaytraceAction() ) );
628 myRaytraceActions->insert( ToolShadowsId, a );
629
630 a = new QAction( QPixmap( dir+QObject::tr("ICON_TOOL_REFLECTIONS") ), QObject::tr("MNU_TOOL_REFLECTIONS"), this );
631 a->setToolTip( QObject::tr("TBR_TOOL_REFLECTIONS") );
632 a->setStatusTip( QObject::tr("TBR_TOOL_REFLECTIONS") );
633 a->setCheckable( true );
2ad228f6 634 a->setChecked( false );
861a7b03 635 connect( a, SIGNAL( activated() ) , this, SLOT( onRaytraceAction() ) );
636 myRaytraceActions->insert( ToolReflectionsId, a );
637
638 a = new QAction( QPixmap( dir+QObject::tr("ICON_TOOL_ANTIALIASING") ), QObject::tr("MNU_TOOL_ANTIALIASING"), this );
639 a->setToolTip( QObject::tr("TBR_TOOL_ANTIALIASING") );
640 a->setStatusTip( QObject::tr("TBR_TOOL_ANTIALIASING") );
641 a->setCheckable( true );
642 a->setChecked( false );
643 connect( a, SIGNAL( activated() ) , this, SLOT( onRaytraceAction() ) );
644 myRaytraceActions->insert( ToolAntialiasingId, a );
645}
646
7fd59977 647void View::mousePressEvent( QMouseEvent* e )
648{
649 if ( e->button() == Qt::LeftButton )
650 onLButtonDown( ( e->buttons() | e->modifiers() ), e->pos() );
651 else if ( e->button() == Qt::MidButton )
652 onMButtonDown( e->buttons() | e->modifiers(), e->pos() );
653 else if ( e->button() == Qt::RightButton )
654 onRButtonDown( e->buttons() | e->modifiers(), e->pos() );
655}
656
657void View::mouseReleaseEvent(QMouseEvent* e)
658{
659 if ( e->button() == Qt::LeftButton )
660 onLButtonUp( e->buttons(), e->pos() );
661 else if ( e->button() == Qt::MidButton )
662 onMButtonUp( e->buttons(), e->pos() );
663 else if( e->button() == Qt::RightButton )
664 onRButtonUp( e->buttons(), e->pos() );
665}
666
667void View::mouseMoveEvent(QMouseEvent* e)
668{
669 onMouseMove( e->buttons(), e->pos() );
670}
671
672void View::activateCursor( const CurrentAction3d mode )
673{
674 switch( mode )
675 {
676 case CurAction3d_DynamicPanning:
2ad228f6 677 setCursor( *panCursor );
678 break;
7fd59977 679 case CurAction3d_DynamicZooming:
2ad228f6 680 setCursor( *zoomCursor );
681 break;
7fd59977 682 case CurAction3d_DynamicRotation:
2ad228f6 683 setCursor( *rotCursor );
684 break;
7fd59977 685 case CurAction3d_GlobalPanning:
2ad228f6 686 setCursor( *globPanCursor );
687 break;
7fd59977 688 case CurAction3d_WindowZooming:
2ad228f6 689 setCursor( *handCursor );
690 break;
7fd59977 691 case CurAction3d_Nothing:
692 default:
2ad228f6 693 setCursor( *defCursor );
694 break;
7fd59977 695 }
696}
697
698void View::onLButtonDown( const int/*Qt::MouseButtons*/ nFlags, const QPoint point )
699{
700 // save the current mouse coordinate in min
701 myXmin = point.x();
702 myYmin = point.y();
703 myXmax = point.x();
704 myYmax = point.y();
705
706 if ( nFlags & CASCADESHORTCUTKEY )
707 {
708 myCurrentMode = CurAction3d_DynamicZooming;
709 }
710 else
711 {
712 switch ( myCurrentMode )
713 {
714 case CurAction3d_Nothing:
715 if ( nFlags & MULTISELECTIONKEY )
2ad228f6 716 MultiDragEvent( myXmax, myYmax, -1 );
7fd59977 717 else
2ad228f6 718 DragEvent( myXmax, myYmax, -1 );
7fd59977 719 break;
720 case CurAction3d_DynamicZooming:
721 break;
722 case CurAction3d_WindowZooming:
723 break;
724 case CurAction3d_DynamicPanning:
725 break;
726 case CurAction3d_GlobalPanning:
727 break;
728 case CurAction3d_DynamicRotation:
de75ed09 729 if (myHlrModeIsOn)
730 {
2ad228f6 731 myView->SetComputedMode (Standard_False);
de75ed09 732 }
7fd59977 733 myView->StartRotation( point.x(), point.y() );
734 break;
735 default:
2ad228f6 736 Standard_Failure::Raise( "incompatible Current Mode" );
7fd59977 737 break;
738 }
739 }
740 activateCursor( myCurrentMode );
741}
742
de75ed09 743void View::onMButtonDown( const int/*Qt::MouseButtons*/ nFlags, const QPoint /*point*/ )
7fd59977 744{
745 if ( nFlags & CASCADESHORTCUTKEY )
746 myCurrentMode = CurAction3d_DynamicPanning;
747 activateCursor( myCurrentMode );
748}
749
750void View::onRButtonDown( const int/*Qt::MouseButtons*/ nFlags, const QPoint point )
751{
752 if ( nFlags & CASCADESHORTCUTKEY )
753 {
de75ed09 754 if (myHlrModeIsOn)
755 {
756 myView->SetComputedMode (Standard_False);
757 }
7fd59977 758 myCurrentMode = CurAction3d_DynamicRotation;
759 myView->StartRotation( point.x(), point.y() );
760 }
761 else
762 {
763 Popup( point.x(), point.y() );
764 }
765 activateCursor( myCurrentMode );
766}
767
768void View::onLButtonUp( Qt::MouseButtons nFlags, const QPoint point )
769{
770 switch( myCurrentMode )
771 {
772 case CurAction3d_Nothing:
773 if ( point.x() == myXmin && point.y() == myYmin )
774 {
2ad228f6 775 // no offset between down and up --> selectEvent
776 myXmax = point.x();
777 myYmax = point.y();
778 if ( nFlags & MULTISELECTIONKEY )
779 MultiInputEvent( point.x(), point.y() );
7fd59977 780 else
2ad228f6 781 InputEvent( point.x(), point.y() );
7fd59977 782 }
783 else
784 {
2ad228f6 785 DrawRectangle( myXmin, myYmin, myXmax, myYmax, Standard_False );
786 myXmax = point.x();
787 myYmax = point.y();
788 if ( nFlags & MULTISELECTIONKEY )
789 MultiDragEvent( point.x(), point.y(), 1 );
7fd59977 790 else
2ad228f6 791 DragEvent( point.x(), point.y(), 1 );
7fd59977 792 }
793 break;
794 case CurAction3d_DynamicZooming:
795 myCurrentMode = CurAction3d_Nothing;
796 noActiveActions();
797 break;
798 case CurAction3d_WindowZooming:
799 DrawRectangle( myXmin, myYmin, myXmax, myYmax, Standard_False );//,LongDash);
800 myXmax = point.x();
801 myYmax = point.y();
802 if ( (abs( myXmin - myXmax ) > ValZWMin ) ||
803 (abs( myYmin - myYmax ) > ValZWMin ) )
2ad228f6 804 myView->WindowFitAll( myXmin, myYmin, myXmax, myYmax );
7fd59977 805 myCurrentMode = CurAction3d_Nothing;
806 noActiveActions();
807 break;
808 case CurAction3d_DynamicPanning:
809 myCurrentMode = CurAction3d_Nothing;
810 noActiveActions();
811 break;
812 case CurAction3d_GlobalPanning :
813 myView->Place( point.x(), point.y(), myCurZoom );
814 myCurrentMode = CurAction3d_Nothing;
815 noActiveActions();
816 break;
817 case CurAction3d_DynamicRotation:
818 myCurrentMode = CurAction3d_Nothing;
819 noActiveActions();
820 break;
821 default:
2ad228f6 822 Standard_Failure::Raise(" incompatible Current Mode ");
7fd59977 823 break;
824 }
825 activateCursor( myCurrentMode );
826 ApplicationCommonWindow::getApplication()->onSelectionChanged();
827}
828
de75ed09 829void View::onMButtonUp( Qt::MouseButtons /*nFlags*/, const QPoint /*point*/ )
7fd59977 830{
831 myCurrentMode = CurAction3d_Nothing;
832 activateCursor( myCurrentMode );
833}
834
de75ed09 835void View::onRButtonUp( Qt::MouseButtons /*nFlags*/, const QPoint point )
7fd59977 836{
837 if ( myCurrentMode == CurAction3d_Nothing )
838 Popup( point.x(), point.y() );
839 else
840 {
841 QApplication::setOverrideCursor( Qt::WaitCursor );
842 // reset tyhe good Degenerated mode according to the strored one
843 // --> dynamic rotation may have change it
de75ed09 844 myView->SetComputedMode (myHlrModeIsOn);
7fd59977 845 QApplication::restoreOverrideCursor();
846 myCurrentMode = CurAction3d_Nothing;
847 }
848 activateCursor( myCurrentMode );
849}
850
851void View::onMouseMove( Qt::MouseButtons nFlags, const QPoint point )
852{
853 if ( nFlags & Qt::LeftButton || nFlags & Qt::RightButton || nFlags & Qt::MidButton )
854 {
855 switch ( myCurrentMode )
856 {
857 case CurAction3d_Nothing:
2ad228f6 858 myXmax = point.x();
859 myYmax = point.y();
860 DrawRectangle( myXmin, myYmin, myXmax, myYmax, Standard_False );
861 if ( nFlags & MULTISELECTIONKEY )
862 MultiDragEvent( myXmax, myYmax, 0 );
7fd59977 863 else
2ad228f6 864 DragEvent( myXmax, myYmax, 0 );
865 DrawRectangle( myXmin, myYmin, myXmax, myYmax, Standard_True );
7fd59977 866 break;
867 case CurAction3d_DynamicZooming:
2ad228f6 868 myView->Zoom( myXmax, myYmax, point.x(), point.y() );
7fd59977 869 myXmax = point.x();
870 myYmax = point.y();
2ad228f6 871 break;
7fd59977 872 case CurAction3d_WindowZooming:
2ad228f6 873 myXmax = point.x();
7fd59977 874 myYmax = point.y();
2ad228f6 875 DrawRectangle( myXmin, myYmin, myXmax, myYmax, Standard_False );
876 DrawRectangle( myXmin, myYmin, myXmax, myYmax, Standard_True );
877 break;
7fd59977 878 case CurAction3d_DynamicPanning:
2ad228f6 879 myView->Pan( point.x() - myXmax, myYmax - point.y() );
880 myXmax = point.x();
881 myYmax = point.y();
882 break;
7fd59977 883 case CurAction3d_GlobalPanning:
884 break;
885 case CurAction3d_DynamicRotation:
2ad228f6 886 myView->Rotation( point.x(), point.y() );
887 myView->Redraw();
7fd59977 888 break;
889 default:
2ad228f6 890 Standard_Failure::Raise( "incompatible Current Mode" );
7fd59977 891 break;
892 }
893 }
894 else
895 {
896 myXmax = point.x();
897 myYmax = point.y();
2ad228f6 898 if ( nFlags & MULTISELECTIONKEY )
899 MultiMoveEvent( point.x(), point.y() );
7fd59977 900 else
2ad228f6 901 MoveEvent( point.x(), point.y() );
7fd59977 902 }
903}
904
905void View::DragEvent( const int x, const int y, const int TheState )
906{
907 // TheState == -1 button down
908 // TheState == 0 move
909 // TheState == 1 button up
910
911 static Standard_Integer theButtonDownX = 0;
912 static Standard_Integer theButtonDownY = 0;
913
914 if ( TheState == -1 )
915 {
916 theButtonDownX = x;
917 theButtonDownY = y;
918 }
919
4d183a4b 920 if ( TheState == 1 )
7fd59977 921 {
922 myContext->Select( theButtonDownX, theButtonDownY, x, y, myView );
923 emit selectionChanged();
924 }
925}
926
de75ed09 927void View::InputEvent( const int /*x*/, const int /*y*/ )
7fd59977 928{
929 myContext->Select();
930 emit selectionChanged();
931}
932
933void View::MoveEvent( const int x, const int y )
934{
935 myContext->MoveTo( x, y, myView );
936}
937
938void View::MultiMoveEvent( const int x, const int y )
939{
940 myContext->MoveTo( x, y, myView );
941}
942
943void View::MultiDragEvent( const int x, const int y, const int TheState )
944{
945 static Standard_Integer theButtonDownX = 0;
946 static Standard_Integer theButtonDownY = 0;
947
948 if ( TheState == -1 )
949 {
950 theButtonDownX = x;
951 theButtonDownY = y;
952 }
953 if ( TheState == 0 )
954 {
955 myContext->ShiftSelect( theButtonDownX, theButtonDownY, x, y, myView );
956 emit selectionChanged();
957 }
958}
959
de75ed09 960void View::MultiInputEvent( const int /*x*/, const int /*y*/ )
7fd59977 961{
962 myContext->ShiftSelect();
963 emit selectionChanged();
964}
965
de75ed09 966void View::Popup( const int /*x*/, const int /*y*/ )
7fd59977 967{
968 ApplicationCommonWindow* stApp = ApplicationCommonWindow::getApplication();
861a7b03 969 QMdiArea* ws = ApplicationCommonWindow::getWorkspace();
970 QMdiSubWindow* w = ws->activeSubWindow();
7fd59977 971 if ( myContext->NbSelected() )
972 {
973 QList<QAction*>* aList = stApp->getToolActions();
974 QMenu* myToolMenu = new QMenu( 0 );
2ad228f6 975 myToolMenu->addAction( aList->at( ApplicationCommonWindow::ToolWireframeId ) );
976 myToolMenu->addAction( aList->at( ApplicationCommonWindow::ToolShadingId ) );
977 myToolMenu->addAction( aList->at( ApplicationCommonWindow::ToolColorId ) );
7fd59977 978
979 QMenu* myMaterMenu = new QMenu( myToolMenu );
980
981 QList<QAction*>* aMeterActions = ApplicationCommonWindow::getApplication()->getMaterialActions();
982
983 QString dir = ApplicationCommonWindow::getResourceDir() + QString( "/" );
2ad228f6 984 myMaterMenu = myToolMenu->addMenu( QPixmap( dir+QObject::tr("ICON_TOOL_MATER")), QObject::tr("MNU_MATER") );
7fd59977 985 for ( int i = 0; i < aMeterActions->size(); i++ )
2ad228f6 986 myMaterMenu->addAction( aMeterActions->at( i ) );
7fd59977 987
988 myToolMenu->addAction( aList->at( ApplicationCommonWindow::ToolTransparencyId ) );
2ad228f6 989 myToolMenu->addAction( aList->at( ApplicationCommonWindow::ToolDeleteId ) );
7fd59977 990 addItemInPopup(myToolMenu);
2ad228f6 991 myToolMenu->exec( QCursor::pos() );
7fd59977 992 delete myToolMenu;
993 }
994 else
995 {
e276548b 996 if (!myBackMenu)
997 {
998 myBackMenu = new QMenu( 0 );
999
2ad228f6 1000 QAction* a = new QAction( QObject::tr("MNU_CH_BACK"), this );
1001 a->setToolTip( QObject::tr("TBR_CH_BACK") );
e276548b 1002 connect( a, SIGNAL( activated() ), this, SLOT( onBackground() ) );
2ad228f6 1003 myBackMenu->addAction( a );
e276548b 1004 addItemInPopup(myBackMenu);
1005
1006 a = new QAction( QObject::tr("MNU_CH_ENV_MAP"), this );
2ad228f6 1007 a->setToolTip( QObject::tr("TBR_CH_ENV_MAP") );
e276548b 1008 connect( a, SIGNAL( activated() ), this, SLOT( onEnvironmentMap() ) );
1009 a->setCheckable( true );
1010 a->setChecked( false );
2ad228f6 1011 myBackMenu->addAction( a );
e276548b 1012 addItemInPopup(myBackMenu);
1013 }
1014
7fd59977 1015 myBackMenu->exec( QCursor::pos() );
7fd59977 1016 }
1017 if ( w )
1018 w->setFocus();
1019}
1020
de75ed09 1021void View::addItemInPopup( QMenu* /*theMenu*/)
7fd59977 1022{
1023}
1024
1025void View::DrawRectangle(const int MinX, const int MinY,
2ad228f6 1026 const int MaxX, const int MaxY, const bool Draw)
7fd59977 1027{
1028 static Standard_Integer StoredMinX, StoredMaxX, StoredMinY, StoredMaxY;
1029 static Standard_Boolean m_IsVisible;
1030
1031 StoredMinX = (MinX < MaxX) ? MinX: MaxX ;
1032 StoredMinY = (MinY < MaxY) ? MinY: MaxY ;
1033 StoredMaxX = (MinX > MaxX) ? MinX: MaxX ;
1034 StoredMaxY = (MinY > MaxY) ? MinY: MaxY ;
1035
1036 QRect aRect;
1037 aRect.setRect( StoredMinX, StoredMinY, abs(StoredMaxX-StoredMinX), abs(StoredMaxY-StoredMinY));
1038
1039 if ( !myRectBand )
1040 {
1041 myRectBand = new QRubberBand( QRubberBand::Rectangle, this );
861a7b03 1042 myRectBand->setStyle( QStyleFactory::create("windows") );
7fd59977 1043 myRectBand->setGeometry( aRect );
1044 myRectBand->show();
1045
1046 /*QPalette palette;
1047 palette.setColor(myRectBand->foregroundRole(), Qt::white);
1048 myRectBand->setPalette(palette);*/
1049 }
1050
1051 if ( m_IsVisible && !Draw ) // move or up : erase at the old position
1052 {
1053 myRectBand->hide();
1054 delete myRectBand;
1055 myRectBand = 0;
1056 m_IsVisible = false;
1057 }
1058
1059 if (Draw) // move : draw
1060 {
1061 //aRect.setRect( StoredMinX, StoredMinY, abs(StoredMaxX-StoredMinX), abs(StoredMaxY-StoredMinY));
1062 m_IsVisible = true;
1063 myRectBand->setGeometry( aRect );
1064 //myRectBand->show();
1065 }
1066}
1067
1068void View::noActiveActions()
1069{
1070 for ( int i = ViewFitAllId; i < ViewHlrOffId ; i++ )
1071 {
1072 QAction* anAction = myViewActions->at( i );
1073 if( ( anAction == myViewActions->at( ViewFitAreaId ) ) ||
1074 ( anAction == myViewActions->at( ViewZoomId ) ) ||
1075 ( anAction == myViewActions->at( ViewPanId ) ) ||
1076 ( anAction == myViewActions->at( ViewGlobalPanId ) ) ||
1077 ( anAction == myViewActions->at( ViewRotationId ) ) )
1078 {
1079 setCursor( *defCursor );
2ad228f6 1080 anAction->setCheckable( true );
1081 anAction->setChecked( false );
7fd59977 1082 }
1083 }
1084}
1085
1086void View::onBackground()
1087{
1088 QColor aColor ;
1089 Standard_Real R1;
1090 Standard_Real G1;
1091 Standard_Real B1;
1092 myView->BackgroundColor(Quantity_TOC_RGB,R1,G1,B1);
1093 aColor.setRgb(R1*255,G1*255,B1*255);
1094
1095 QColor aRetColor = QColorDialog::getColor(aColor);
1096
1097 if( aRetColor.isValid() )
1098 {
1099 R1 = aRetColor.red()/255.;
1100 G1 = aRetColor.green()/255.;
1101 B1 = aRetColor.blue()/255.;
1102 myView->SetBackgroundColor(Quantity_TOC_RGB,R1,G1,B1);
1103 }
1104 myView->Redraw();
1105}
1106
e276548b 1107void View::onEnvironmentMap()
1108{
1109 if (myBackMenu->actions().at(1)->isChecked())
1110 {
1111 QString fileName = QFileDialog::getOpenFileName(this, tr("Open File"), "",
1112 tr("All Image Files (*.bmp *.gif *.jpg *.jpeg *.png *.tga)"));
1113
861a7b03 1114 Handle(Graphic3d_TextureEnv) aTexture = new Graphic3d_TextureEnv( fileName.toLatin1().data() );
e276548b 1115
1116 myView->SetTextureEnv (aTexture);
1117 myView->SetSurfaceDetail (V3d_TEX_ENVIRONMENT);
1118 }
1119 else
1120 {
1121 myView->SetSurfaceDetail (V3d_TEX_NONE);
1122 }
1123
1124 myView->Redraw();
1125}
1126
7fd59977 1127bool View::dump(Standard_CString theFile)
1128{
1129 myView->Redraw();
1130 QString ext = QFileInfo( QString( theFile ) ).completeSuffix();
1131 if ( !ext.compare("ps") || !ext.compare("eps") || !ext.compare("tex") || !ext.compare("pdf") || !ext.compare("svg") || !ext.compare("pgf") )
1132 {
1133 Graphic3d_ExportFormat exFormat;
1134 if ( !ext.compare("ps") )
1135 exFormat = Graphic3d_EF_PostScript;
1136 if ( !ext.compare("eps") )
1137 exFormat = Graphic3d_EF_EnhPostScript;
1138 if ( !ext.compare("tex") )
1139 exFormat = Graphic3d_EF_TEX;
1140 if ( !ext.compare("pdf") )
1141 exFormat = Graphic3d_EF_PDF;
1142 if ( !ext.compare("svg") )
1143 exFormat = Graphic3d_EF_SVG;
1144 if ( !ext.compare("pgf") )
1145 exFormat = Graphic3d_EF_PGF;
1146 try
1147 {
c357e426 1148 myView->Export( theFile, exFormat );
7fd59977 1149 }
1150 catch(...)
1151 {
1152 return false;
1153 }
1154 return true;
1155 }
1156 return myView->Dump(theFile);
1157}
1158
1159Handle(V3d_View)& View::getView()
1160{
1161 return myView;
1162}
1163
1164Handle(AIS_InteractiveContext)& View::getContext()
1165{
1166 return myContext;
1167}
1168
1169View::CurrentAction3d View::getCurrentMode()
1170{
1171 return myCurrentMode;
1172}
1173
1174
1175