1 /*=========================================================================
3 Program: Visualization Toolkit
4 Module: $RCSfile: wxVTKRenderWindowInteractor.cxx,v $
6 Date: $Date: 2009/05/14 13:54:35 $
7 Version: $Revision: 1.3 $
9 Copyright (c) 1993-2002 Ken Martin, Will Schroeder, Bill Lorensen
11 See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
13 This software is distributed WITHOUT ANY WARRANTY; without even
14 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 PURPOSE. See the above copyright notice for more information.
17 =========================================================================*/
19 #include "wxVTKRenderWindowInteractor.h"
21 //This is needed for vtk 3.1 :
22 #ifndef VTK_MAJOR_VERSION
23 # include "vtkVersion.h"
26 #if VTK_MAJOR_VERSION == 5 || (VTK_MAJOR_VERSION == 4 && VTK_MINOR_VERSION > 0)
27 # include "vtkCommand.h"
29 # include "vtkInteractorStyle.h"
32 //Keep this for compatibilty reason, this was introduced in wxGTK 2.4.0
33 #if (!wxCHECK_VERSION(2, 4, 0))
34 wxWindow* wxGetTopLevelParent(wxWindow *win)
36 while ( win && !win->IsTopLevel() )
37 win = win->GetParent();
42 // To access objc calls on cocoa
45 #import <Cocoa/Cocoa.h>
46 // This trick is no longer need in VTK CVS, should get rid of that:
49 #error Build mismatch you need both wxWidgets and VTK to be configure against Cocoa to work
50 #endif //VTK_USE_COCOA
54 # include <gdk/gdkx.h> // GDK_WINDOW_XWINDOW is found here in wxWidgets 2.8.0
55 # include "gdk/gdkprivate.h"
57 #include <wx/gtk/win_gtk.h>
59 #include <wx/gtk1/win_gtk.h>
61 #define GetXWindow(wxwin) (wxwin)->m_wxwindow ? \
62 GDK_WINDOW_XWINDOW(GTK_PIZZA((wxwin)->m_wxwindow)->bin_window) : \
63 GDK_WINDOW_XWINDOW((wxwin)->m_widget->window)
67 #include "wx/x11/privx.h"
68 #define GetXWindow(wxwin) ((Window)(wxwin)->GetHandle())
72 //For more info on this class please go to:
74 //This hack is for some buggy wxGTK version:
75 #if wxCHECK_VERSION(2, 3, 2) && !wxCHECK_VERSION(2, 4, 1) && defined(__WXGTK__)
76 # define WX_USE_X_CAPTURE 0
78 # define WX_USE_X_CAPTURE 1
81 #define ID_wxVTKRenderWindowInteractor_TIMER 1001
83 #if defined(__WXGTK__) && defined(USE_WXGLCANVAS)
84 IMPLEMENT_DYNAMIC_CLASS(wxVTKRenderWindowInteractor, wxGLCanvas)
86 IMPLEMENT_DYNAMIC_CLASS(wxVTKRenderWindowInteractor, wxWindow)
89 //---------------------------------------------------------------------------
90 #if defined(__WXGTK__) && defined(USE_WXGLCANVAS)
91 BEGIN_EVENT_TABLE(wxVTKRenderWindowInteractor, wxGLCanvas)
93 BEGIN_EVENT_TABLE(wxVTKRenderWindowInteractor, wxWindow)
95 //refresh window by doing a Render
96 EVT_PAINT (wxVTKRenderWindowInteractor::OnPaint)
97 EVT_ERASE_BACKGROUND(wxVTKRenderWindowInteractor::OnEraseBackground)
98 EVT_MOTION (wxVTKRenderWindowInteractor::OnMotion)
100 //Bind the events to the event converters
101 EVT_LEFT_DOWN (wxVTKRenderWindowInteractor::OnButtonDown)
102 EVT_MIDDLE_DOWN (wxVTKRenderWindowInteractor::OnButtonDown)
103 EVT_RIGHT_DOWN (wxVTKRenderWindowInteractor::OnButtonDown)
104 EVT_LEFT_UP (wxVTKRenderWindowInteractor::OnButtonUp)
105 EVT_MIDDLE_UP (wxVTKRenderWindowInteractor::OnButtonUp)
106 EVT_RIGHT_UP (wxVTKRenderWindowInteractor::OnButtonUp)
107 #if !(VTK_MAJOR_VERSION == 3 && VTK_MINOR_VERSION == 1)
108 EVT_ENTER_WINDOW(wxVTKRenderWindowInteractor::OnEnter)
109 EVT_LEAVE_WINDOW(wxVTKRenderWindowInteractor::OnLeave)
110 EVT_MOUSEWHEEL (wxVTKRenderWindowInteractor::OnMouseWheel)
111 // If we use EVT_KEY_DOWN instead of EVT_CHAR, capital versions
112 // of all characters are always returned. EVT_CHAR also performs
113 // other necessary keyboard-dependent translations.
114 //EVT_KEY_DOWN (wxVTKRenderWindowInteractor::OnKeyDown)
115 EVT_CHAR (wxVTKRenderWindowInteractor::OnKeyDown)
116 EVT_KEY_UP (wxVTKRenderWindowInteractor::OnKeyUp)
118 EVT_TIMER (ID_wxVTKRenderWindowInteractor_TIMER, wxVTKRenderWindowInteractor::OnTimer)
119 EVT_SIZE (wxVTKRenderWindowInteractor::OnSize)
122 //---------------------------------------------------------------------------
123 #if defined(__WXGTK__) && defined(USE_WXGLCANVAS)
124 wxVTKRenderWindowInteractor::wxVTKRenderWindowInteractor() : vtkRenderWindowInteractor(), wxGLCanvas()
126 wxVTKRenderWindowInteractor::wxVTKRenderWindowInteractor() : vtkRenderWindowInteractor(), wxWindow()
128 , timer(this, ID_wxVTKRenderWindowInteractor_TIMER)
129 , ActiveButton(wxEVT_NULL)
134 , RenderWhenDisabled(1)
138 this->RenderWindow = NULL;
139 this->SetRenderWindow(vtkRenderWindow::New());
140 this->RenderWindow->Delete();
142 //this->SetBackgroundColour( wxColour(255,0,255) );
144 //---------------------------------------------------------------------------
145 wxVTKRenderWindowInteractor::wxVTKRenderWindowInteractor(wxWindow *parent,
150 const wxString &name)
151 #if defined(__WXGTK__) && defined(USE_WXGLCANVAS)
152 : vtkRenderWindowInteractor(), wxGLCanvas(parent, id, pos, size, style, name)
154 : vtkRenderWindowInteractor(), wxWindow(parent, id, pos, size, style, name)
156 , timer(this, ID_wxVTKRenderWindowInteractor_TIMER)
157 , ActiveButton(wxEVT_NULL)
162 , RenderWhenDisabled(1)
166 this->RenderWindow = NULL;
167 this->SetRenderWindow(vtkRenderWindow::New());
168 this->RenderWindow->Delete();
170 // this->SetBackgroundColour( wxColour(255,0,0) );
172 //---------------------------------------------------------------------------
173 wxVTKRenderWindowInteractor::~wxVTKRenderWindowInteractor()
175 // LG : trompe la mort !
176 SetReferenceCount(0);
178 //---------------------------------------------------------------------------
179 wxVTKRenderWindowInteractor * wxVTKRenderWindowInteractor::New()
181 // we don't make use of the objectfactory, because we're not registered
182 return new wxVTKRenderWindowInteractor;
184 //---------------------------------------------------------------------------
185 void wxVTKRenderWindowInteractor::Initialize()
187 int *size = RenderWindow->GetSize();
188 // enable everything and start rendering
190 //RenderWindow->Start();
192 // set the size in the render window interactor
196 // this is initialized
199 //---------------------------------------------------------------------------
200 void wxVTKRenderWindowInteractor::Enable()
202 // if already enabled then done
208 #if defined(__WXGTK__) && defined(USE_WXGLCANVAS)
213 //---------------------------------------------------------------------------
214 bool wxVTKRenderWindowInteractor::Enable(bool enable)
216 #if defined(__WXGTK__) && defined(USE_WXGLCANVAS)
217 return wxGLCanvas::Enable(enable);
219 return wxWindow::Enable(enable);
222 //---------------------------------------------------------------------------
223 void wxVTKRenderWindowInteractor::Disable()
225 // if already disabled then done
229 // that's it (we can't remove the event handler like it should be...)
233 //---------------------------------------------------------------------------
234 void wxVTKRenderWindowInteractor::Start()
236 // the interactor cannot control the event loop
237 vtkErrorMacro( << "wxVTKRenderWindowInteractor::Start() "
238 "interactor cannot control event loop.");
240 //---------------------------------------------------------------------------
241 void wxVTKRenderWindowInteractor::UpdateSize(int x, int y)
245 // if the size changed tell render window
246 if ( x != Size[0] || y != Size[1] )
248 // adjust our (vtkRenderWindowInteractor size)
251 // and our RenderWindow's size
252 RenderWindow->SetSize(x, y);
256 //---------------------------------------------------------------------------
257 int wxVTKRenderWindowInteractor::CreateTimer(int WXUNUSED(timertype))
259 // it's a one shot timer
260 if (!timer.Start(10, TRUE))
266 //---------------------------------------------------------------------------
267 int wxVTKRenderWindowInteractor::DestroyTimer()
272 //---------------------------------------------------------------------------
273 void wxVTKRenderWindowInteractor::OnTimer(wxTimerEvent& WXUNUSED(event))
278 #if VTK_MAJOR_VERSION == 5 || (VTK_MAJOR_VERSION == 4 && VTK_MINOR_VERSION > 0)
280 InvokeEvent(vtkCommand::TimerEvent, NULL);
283 InteractorStyle->OnTimer();
287 //---------------------------------------------------------------------------
288 // NOTE on implementation:
289 // Bad luck you ended up in the only tricky place of this code.
290 // A few note, wxWidgets still refuse to provide such convenient method
291 // so I have to maintain it myself, eventhough this is completely integrated
293 // Anyway if this happen to break for you then compare to a recent version of wxPython
294 // and look for the function long wxPyGetWinHandle(wxWindow* win)
295 // in wxPython/src/helpers.cpp
296 long wxVTKRenderWindowInteractor::GetHandleHack()
298 //helper function to hide the MSW vs GTK stuff
301 // __WXMSW__ is for Win32
302 //__WXMAX__ stands for using Carbon C-headers, using either the CarbonLib/CFM or the native Mach-O builds (which then also use the latest features available)
303 // __WXGTK__ is for both gtk 1.2.x and gtk 2.x
304 #if defined(__WXMSW__) || defined(__WXMAC__)
305 handle_tmp = (long)this->GetHandle();
308 //__WXCOCOA__ stands for using the objective-c Cocoa API
310 // Here is how to find the NSWindow
311 wxTopLevelWindow* toplevel = dynamic_cast<wxTopLevelWindow*>(
312 wxGetTopLevelParent( this ) );
313 if (toplevel != NULL )
315 handle_tmp = (long)toplevel->GetNSWindow();
317 // The NSView will be deducted from
318 // [(NSWindow*)Handle contentView]
319 // if only I knew how to write that in c++
322 // Find and return the actual X-Window.
323 #if defined(__WXGTK__) || defined(__WXX11__)
324 return (long)GetXWindow(this);
328 // handle_tmp = (long)this->GetXWindow();
333 //---------------------------------------------------------------------------
334 void wxVTKRenderWindowInteractor::OnPaint(wxPaintEvent& WXUNUSED(event))
337 //must always be here
340 //do it here rather than in the cstor: this is safer.
343 Handle = GetHandleHack();
344 RenderWindow->SetWindowId(reinterpret_cast<void *>(Handle));
346 RenderWindow->SetParentId(reinterpret_cast<void *>(this->GetParent()->GetHWND()));
349 // get vtk to render to the wxWindows
350 //bbtkDebugMessage("Wx",9,"wxVTKRenderWindowInteractor::OnPaint"<<std::endl);
351 //std::cout << "wxVTKRenderWindowInteractor::OnPaint"<<std::endl;
354 #if defined(__WXGTK__) && defined(USE_WXGLCANVAS)
355 // bbtkDebugMessage("Core",9,"wxVTKRenderWindowInteractor::OnPaint public wxGLCanvas, virtual public vtkRenderWindowInteractor \n");
357 // bbtkDebugMessage("Core",9,"wxVTKRenderWindowInteractor::OnPaint public wxWindow, virtual public vtkRenderWindowInteractor \n");
361 //---------------------------------------------------------------------------
362 void wxVTKRenderWindowInteractor::OnEraseBackground(wxEraseEvent &event)
364 //printf("EED wxVTKRenderWindowInteractor::OnEraseBackground \n");
365 //turn off background erase to reduce flickering on MSW
368 //---------------------------------------------------------------------------
369 void wxVTKRenderWindowInteractor::OnSize(wxSizeEvent& WXUNUSED(event))
372 GetClientSize(&w, &h);
380 #if VTK_MAJOR_VERSION == 5 || (VTK_MAJOR_VERSION == 4 && VTK_MINOR_VERSION > 0)
381 InvokeEvent(vtkCommand::ConfigureEvent, NULL);
383 //this will check for Handle
386 //---------------------------------------------------------------------------
387 void wxVTKRenderWindowInteractor::OnMotion(wxMouseEvent &event)
394 #if VTK_MAJOR_VERSION == 5 || (VTK_MAJOR_VERSION == 4 && VTK_MINOR_VERSION > 0)
395 SetEventInformationFlipY(event.GetX(), event.GetY(),
396 event.ControlDown(), event.ShiftDown(), '\0', 0, NULL);
398 InvokeEvent(vtkCommand::MouseMoveEvent, NULL);
400 InteractorStyle->OnMouseMove(event.ControlDown(), event.ShiftDown(),
401 event.GetX(), Size[1] - event.GetY() - 1);
404 //---------------------------------------------------------------------------
405 #if !(VTK_MAJOR_VERSION == 3 && VTK_MINOR_VERSION == 1)
406 void wxVTKRenderWindowInteractor::OnEnter(wxMouseEvent &event)
414 #if VTK_MAJOR_VERSION == 5 || (VTK_MAJOR_VERSION == 4 && VTK_MINOR_VERSION > 0)
416 SetEventInformationFlipY(event.GetX(), event.GetY(),
417 event.ControlDown(), event.ShiftDown(), '\0', 0, NULL);
419 InvokeEvent(vtkCommand::EnterEvent, NULL);
422 InteractorStyle->OnEnter(event.ControlDown(), event.ShiftDown(),
423 event.GetX(), Size[1] - event.GetY() - 1);
426 //---------------------------------------------------------------------------
427 void wxVTKRenderWindowInteractor::OnLeave(wxMouseEvent &event)
434 #if VTK_MAJOR_VERSION == 5 || (VTK_MAJOR_VERSION == 4 && VTK_MINOR_VERSION > 0)
436 SetEventInformationFlipY(event.GetX(), event.GetY(),
437 event.ControlDown(), event.ShiftDown(), '\0', 0, NULL);
439 InvokeEvent(vtkCommand::LeaveEvent, NULL);
442 InteractorStyle->OnLeave(event.ControlDown(), event.ShiftDown(),
443 event.GetX(), Size[1] - event.GetY() - 1);
446 //---------------------------------------------------------------------------
447 void wxVTKRenderWindowInteractor::OnKeyDown(wxKeyEvent &event)
454 #if VTK_MAJOR_VERSION == 5 || (VTK_MAJOR_VERSION == 4 && VTK_MINOR_VERSION > 0)
456 int keycode = event.GetKeyCode();
462 // TODO: Unicode in non-Unicode mode ??
467 if ( keycode==314 )//Real keyCode for Left ARROW and non-Unicode
471 else if( keycode==315 )//Real keyCode for Left ARROW and non-Unicode
475 else if( keycode==316 )//Real keyCode for Left ARROW and non-Unicode
479 else if( keycode==317 )//Real keyCode for Down ARROW and non-Unicode
483 else if( keycode==312 )//Real keyCode for Diagonal left down ARROW and non-Unicode
485 key = 'W';//Diagonal left down
487 else if( keycode==313 )//Real keyCode for Diagonal left up ARROW and non-Unicode
489 key = 'Q';//Diagonal left up
491 else if( keycode==366 )//Real keyCode for Diagonal right up ARROW and non-Unicode
493 key = 'P';//Diagonal right up
495 else if( keycode==367 )//Real keyCode for Diagonal right down ARROW and non-Unicode
497 key = 'M';//Diagonal right down
501 SetEventInformationFlipY(event.GetX(), event.GetY(),
502 event.ControlDown(), event.ShiftDown(), key, 0, NULL);
504 InvokeEvent(vtkCommand::KeyPressEvent, NULL);
505 InvokeEvent(vtkCommand::CharEvent, NULL);
507 InteractorStyle->OnKeyDown(event.ControlDown(), event.ShiftDown(),
508 event.GetKeyCode(), 1);
512 //---------------------------------------------------------------------------
513 void wxVTKRenderWindowInteractor::OnKeyUp(wxKeyEvent &event)
520 #if VTK_MAJOR_VERSION == 5 || (VTK_MAJOR_VERSION == 4 && VTK_MINOR_VERSION > 0)
522 int keycode = event.GetKeyCode();
526 // TODO: Unicode in non-Unicode mode ??
530 SetEventInformationFlipY(event.GetX(), event.GetY(),
531 event.ControlDown(), event.ShiftDown(), key, 0, NULL);
532 InvokeEvent(vtkCommand::KeyReleaseEvent, NULL);
534 InteractorStyle->OnKeyUp(event.ControlDown(), event.ShiftDown(),
535 event.GetKeyCode(), 1);
539 #endif //!(VTK_MAJOR_VERSION == 3 && VTK_MINOR_VERSION == 1)
540 //---------------------------------------------------------------------------
541 void wxVTKRenderWindowInteractor::OnButtonDown(wxMouseEvent &event)
543 if (!Enabled || (ActiveButton != wxEVT_NULL))
547 ActiveButton = event.GetEventType();
549 #if VTK_MAJOR_VERSION == 5 || (VTK_MAJOR_VERSION == 4 && VTK_MINOR_VERSION > 0)
550 SetEventInformationFlipY(event.GetX(), event.GetY(),
551 event.ControlDown(), event.ShiftDown(), '\0', 0, NULL);
554 if(event.RightDown())
556 #if VTK_MAJOR_VERSION == 5 || (VTK_MAJOR_VERSION == 4 && VTK_MINOR_VERSION > 0)
558 InvokeEvent(vtkCommand::RightButtonPressEvent, NULL);
561 InteractorStyle->OnRightButtonDown(event.ControlDown(), event.ShiftDown(),
562 event.GetX(), Size[1] - event.GetY() - 1);
565 else if(event.LeftDown())
567 #if VTK_MAJOR_VERSION == 5 || (VTK_MAJOR_VERSION == 4 && VTK_MINOR_VERSION > 0)
569 InvokeEvent(vtkCommand::LeftButtonPressEvent, NULL);
572 InteractorStyle->OnLeftButtonDown(event.ControlDown(), event.ShiftDown(),
573 event.GetX(), Size[1] - event.GetY() - 1);
576 else if(event.MiddleDown())
578 #if VTK_MAJOR_VERSION == 5 || (VTK_MAJOR_VERSION == 4 && VTK_MINOR_VERSION > 0)
580 InvokeEvent(vtkCommand::MiddleButtonPressEvent, NULL);
583 InteractorStyle->OnMiddleButtonDown(event.ControlDown(), event.ShiftDown(),
584 event.GetX(), Size[1] - event.GetY() - 1);
587 //save the button and capture mouse until the button is released
589 //1. it is possible (WX_USE_X_CAPTURE)
590 //2. user decided to.
591 if ((ActiveButton != wxEVT_NULL) && WX_USE_X_CAPTURE && UseCaptureMouse)
596 //---------------------------------------------------------------------------
597 void wxVTKRenderWindowInteractor::OnButtonUp(wxMouseEvent &event)
599 //EVT_xxx_DOWN == EVT_xxx_UP - 1
600 //This is only needed if two mouse buttons are pressed at the same time.
601 //In wxWindows 2.4 and later: better use of wxMOUSE_BTN_RIGHT or
602 //wxEVT_COMMAND_RIGHT_CLICK
603 if (!Enabled || (ActiveButton != (event.GetEventType()-1)))
608 #if VTK_MAJOR_VERSION == 5 || (VTK_MAJOR_VERSION == 4 && VTK_MINOR_VERSION > 0)
609 SetEventInformationFlipY(event.GetX(), event.GetY(),
610 event.ControlDown(), event.ShiftDown(), '\0', 0, NULL);
613 if(ActiveButton == wxEVT_RIGHT_DOWN)
615 #if VTK_MAJOR_VERSION == 5 || (VTK_MAJOR_VERSION == 4 && VTK_MINOR_VERSION > 0)
617 InvokeEvent(vtkCommand::RightButtonReleaseEvent, NULL);
620 InteractorStyle->OnRightButtonUp(event.ControlDown(), event.ShiftDown(),
621 event.GetX(), Size[1] - event.GetY() - 1);
624 else if(ActiveButton == wxEVT_LEFT_DOWN)
626 #if VTK_MAJOR_VERSION == 5 || (VTK_MAJOR_VERSION == 4 && VTK_MINOR_VERSION > 0)
628 InvokeEvent(vtkCommand::LeftButtonReleaseEvent, NULL);
631 InteractorStyle->OnLeftButtonUp(event.ControlDown(), event.ShiftDown(),
632 event.GetX(), Size[1] - event.GetY() - 1);
635 else if(ActiveButton == wxEVT_MIDDLE_DOWN)
637 #if VTK_MAJOR_VERSION == 5 || (VTK_MAJOR_VERSION == 4 && VTK_MINOR_VERSION > 0)
639 InvokeEvent(vtkCommand::MiddleButtonReleaseEvent, NULL);
642 InteractorStyle->OnMiddleButtonUp(event.ControlDown(), event.ShiftDown(),
643 event.GetX(), Size[1] - event.GetY() - 1);
646 //if the ActiveButton is realeased, then release mouse capture
647 if ((ActiveButton != wxEVT_NULL) && WX_USE_X_CAPTURE && UseCaptureMouse)
651 ActiveButton = wxEVT_NULL;
653 //---------------------------------------------------------------------------
654 void wxVTKRenderWindowInteractor::OnMouseWheel(wxMouseEvent& event)
656 // Mouse wheel was only added after VTK 4.4 (I think...)
657 #if VTK_MAJOR_VERSION == 5 || (VTK_MAJOR_VERSION == 4 && VTK_MINOR_VERSION > 2)
659 //Set vtk event information ... The numebr of wheel rotations is stored in
660 //the x varible. y varible is zero
661 SetEventInformationFlipY(event.GetWheelRotation() / event.GetWheelDelta(), 0,
662 event.ControlDown(), event.ShiftDown(), '\0', 0, NULL);
663 if(event.GetWheelRotation() > 0)
667 // InvokeEvent(vtkCommand::MouseWheelForwardEvent, NULL);
673 // InvokeEvent(vtkCommand::MouseWheelBackwardEvent, NULL);
679 //---------------------------------------------------------------------------
680 void wxVTKRenderWindowInteractor::Render() throw (char*)
683 if (!RenderWhenDisabled)
685 //the user doesn't want us to render when the toplevel frame
686 //is disabled - first find the top level parent
687 wxWindow *topParent = wxGetTopLevelParent(this);
690 //if it exists, check whether it's enabled
691 //if it's not enabeld, RenderAllowed will be false
692 RenderAllowed = topParent->IsEnabled();
698 if(Handle && (Handle == GetHandleHack()) )
700 if(RenderWindow!=NULL){
701 RenderWindow->Render();
703 throw "wxVTKRenderWindowInteractor::Render(){RenderWindow not set}";
706 #if VTK_MAJOR_VERSION == 5 || (VTK_MAJOR_VERSION == 4 && VTK_MINOR_VERSION > 2)
707 else if(GetHandleHack())
709 //this means the user has reparented us; let's adapt to the
710 //new situation by doing the WindowRemap dance
711 //store the new situation
712 if(RenderWindow!=NULL){
713 Handle = GetHandleHack();
714 RenderWindow->SetNextWindowId(reinterpret_cast<void *>(Handle));
715 RenderWindow->WindowRemap();
716 RenderWindow->Render();
722 //---------------------------------------------------------------------------
723 void wxVTKRenderWindowInteractor::SetRenderWhenDisabled(int newValue)
725 //Change value of __RenderWhenDisabled ivar.
726 //If __RenderWhenDisabled is false (the default), this widget will not
727 //call Render() on the RenderWindow if the top level frame (i.e. the
728 //containing frame) has been disabled.
730 //This prevents recursive rendering during wxSafeYield() calls.
731 //wxSafeYield() can be called during the ProgressMethod() callback of
732 //a VTK object to have progress bars and other GUI elements updated -
733 //it does this by disabling all windows (disallowing user-input to
734 //prevent re-entrancy of code) and then handling all outstanding
737 //However, this often triggers an OnPaint() method for wxVTKRWIs,
738 //resulting in a Render(), resulting in Update() being called whilst
741 RenderWhenDisabled = (bool)newValue;
743 //---------------------------------------------------------------------------
745 // Set the variable that indicates that we want a stereo capable window
746 // be created. This method can only be called before a window is realized.
748 void wxVTKRenderWindowInteractor::SetStereo(int capable)
750 if (Stereo != capable)
753 RenderWindow->StereoCapableWindowOn();
754 RenderWindow->SetStereoTypeToCrystalEyes();
759 //---------------------------------------------------------------------------
762 void wxVTKRenderWindowInteractor::PrintSelf(ostream& os, vtkIndent indent)
764 this->Superclass::PrintSelf(os, indent);
769 const char * wxVTKRenderWindowInteractor::GetClassName() const
771 return "wxVTKRenderWindowInteractor";