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