X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=packages%2Fwxvtk%2Fsrc%2FwxVTKRenderWindowInteractor.cxx;h=2e58ec634d418100a745519632c075d2c0200372;hb=08ce916eba56a6111014712fc931a1cce7e8f877;hp=a7ac807a4e679172df220de4ea2741b44626e524;hpb=6415d635327ce5d9058a45cc6f350551af2adff5;p=bbtk.git diff --git a/packages/wxvtk/src/wxVTKRenderWindowInteractor.cxx b/packages/wxvtk/src/wxVTKRenderWindowInteractor.cxx index a7ac807..2e58ec6 100644 --- a/packages/wxvtk/src/wxVTKRenderWindowInteractor.cxx +++ b/packages/wxvtk/src/wxVTKRenderWindowInteractor.cxx @@ -1,21 +1,42 @@ +/* + # --------------------------------------------------------------------- + # + # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image + # pour la SantÈ) + # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton + # Previous Authors : Laurent Guigues, Jean-Pierre Roux + # CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil + # + # This software is governed by the CeCILL-B license under French law and + # abiding by the rules of distribution of free software. You can use, + # modify and/ or redistribute the software under the terms of the CeCILL-B + # license as circulated by CEA, CNRS and INRIA at the following URL + # http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html + # or in the file LICENSE.txt. + # + # As a counterpart to the access to the source code and rights to copy, + # modify and redistribute granted by the license, users are provided only + # with a limited warranty and the software's author, the holder of the + # economic rights, and the successive licensors have only limited + # liability. + # + # The fact that you are presently reading this means that you have had + # knowledge of the CeCILL-B license and that you accept its terms. + # ------------------------------------------------------------------------ */ + + /*========================================================================= Program: Visualization Toolkit Module: $RCSfile: wxVTKRenderWindowInteractor.cxx,v $ Language: C++ - Date: $Date: 2008/03/03 13:14:28 $ - Version: $Revision: 1.1 $ - - Copyright (c) 1993-2002 Ken Martin, Will Schroeder, Bill Lorensen - All rights reserved. - See Copyright.txt or http://www.kitware.com/Copyright.htm for details. - - This software is distributed WITHOUT ANY WARRANTY; without even - the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - PURPOSE. See the above copyright notice for more information. + Date: $Date: 2012/11/16 08:52:36 $ + Version: $Revision: 1.5 $ =========================================================================*/ +#include + #include "wxVTKRenderWindowInteractor.h" //This is needed for vtk 3.1 : @@ -23,25 +44,31 @@ # include "vtkVersion.h" #endif -#if VTK_MAJOR_VERSION == 5 || (VTK_MAJOR_VERSION == 4 && VTK_MINOR_VERSION > 0) +#if VTK_MAJOR_VERSION > 4 || (VTK_MAJOR_VERSION == 4 && VTK_MINOR_VERSION > 0) # include "vtkCommand.h" #else # include "vtkInteractorStyle.h" #endif +#include "vtkDebugLeaks.h" + +#ifdef __WXMAC__ +#include "vtkCarbonRenderWindow.h" +#endif //======================================================================= // LG : NAMESPACE IS NECESSARY TO AVOID CONFLICTING SYMBOLS IN DYN LIBS namespace bbwxvtk { - //Keep this for compatibilty reason, this was introduced in wxGTK 2.4.0 + +//Keep this for compatibilty reason, this was introduced in wxGTK 2.4.0 #if (!wxCHECK_VERSION(2, 4, 0)) - wxWindow* wxGetTopLevelParent(wxWindow *win) - { +wxWindow* wxGetTopLevelParent(wxWindow *win) +{ while ( win && !win->IsTopLevel() ) - win = win->GetParent(); + win = win->GetParent(); return win; - } +} #endif } // LG : EO namespace bbwxvtk @@ -61,11 +88,15 @@ namespace bbwxvtk #ifdef __WXGTK__ # include // GDK_WINDOW_XWINDOW is found here in wxWidgets 2.8.0 # include "gdk/gdkprivate.h" +#if wxCHECK_VERSION(2, 8, 0) #ifdef __WXGTK20__ #include #else #include #endif +#else +#include +#endif #define GetXWindow(wxwin) (wxwin)->m_wxwindow ? \ GDK_WINDOW_XWINDOW(GTK_PIZZA((wxwin)->m_wxwindow)->bin_window) : \ GDK_WINDOW_XWINDOW((wxwin)->m_widget->window) @@ -121,22 +152,34 @@ BEGIN_EVENT_TABLE(wxVTKRenderWindowInteractor, wxWindow) EVT_ENTER_WINDOW(wxVTKRenderWindowInteractor::OnEnter) EVT_LEAVE_WINDOW(wxVTKRenderWindowInteractor::OnLeave) EVT_MOUSEWHEEL (wxVTKRenderWindowInteractor::OnMouseWheel) -// If we use EVT_KEY_DOWN instead of EVT_CHAR, capital versions -// of all characters are always returned. EVT_CHAR also performs -// other necessary keyboard-dependent translations. - //EVT_KEY_DOWN (wxVTKRenderWindowInteractor::OnKeyDown) - EVT_CHAR (wxVTKRenderWindowInteractor::OnKeyDown) + EVT_KEY_DOWN (wxVTKRenderWindowInteractor::OnKeyDown) EVT_KEY_UP (wxVTKRenderWindowInteractor::OnKeyUp) + EVT_CHAR (wxVTKRenderWindowInteractor::OnChar) #endif EVT_TIMER (ID_wxVTKRenderWindowInteractor_TIMER, wxVTKRenderWindowInteractor::OnTimer) EVT_SIZE (wxVTKRenderWindowInteractor::OnSize) END_EVENT_TABLE() + + +//EED 2017-01-01 Migration VTK7 +#if VTK_MAJOR_VERSION <= 5 + vtkCxxRevisionMacro(wxVTKRenderWindowInteractor, "$Revision: 1.5 $") +#else + //... +#endif + +vtkInstantiatorNewMacro(wxVTKRenderWindowInteractor) + //--------------------------------------------------------------------------- #if defined(__WXGTK__) && defined(USE_WXGLCANVAS) -wxVTKRenderWindowInteractor::wxVTKRenderWindowInteractor() : vtkRenderWindowInteractor(), wxGLCanvas() +#if (wxCHECK_VERSION(2, 8, 0)) +wxVTKRenderWindowInteractor::wxVTKRenderWindowInteractor() : wxGLCanvas(0, -1, wxDefaultPosition), vtkRenderWindowInteractor() #else -wxVTKRenderWindowInteractor::wxVTKRenderWindowInteractor() : vtkRenderWindowInteractor(), wxWindow() +wxVTKRenderWindowInteractor::wxVTKRenderWindowInteractor() : wxGLCanvas(), vtkRenderWindowInteractor() +#endif +#else +wxVTKRenderWindowInteractor::wxVTKRenderWindowInteractor() : wxWindow(), vtkRenderWindowInteractor() #endif //__WXGTK__ , timer(this, ID_wxVTKRenderWindowInteractor_TIMER) , ActiveButton(wxEVT_NULL) @@ -147,12 +190,15 @@ wxVTKRenderWindowInteractor::wxVTKRenderWindowInteractor() : vtkRenderWindowInte , RenderWhenDisabled(1) , UseCaptureMouse(0) { - +#ifdef VTK_DEBUG_LEAKS + vtkDebugLeaks::ConstructClass("wxVTKRenderWindowInteractor"); +#endif + this->RenderWindow = NULL; this->SetRenderWindow(vtkRenderWindow::New()); this->RenderWindow->Delete(); - - //this->SetBackgroundColour( wxColour(255,0,255) ); + this->SetBackgroundStyle( wxBG_STYLE_COLOUR ); + this->SetBackgroundColour( wxColor(0,0,0,0) ); } //--------------------------------------------------------------------------- wxVTKRenderWindowInteractor::wxVTKRenderWindowInteractor(wxWindow *parent, @@ -162,9 +208,9 @@ wxVTKRenderWindowInteractor::wxVTKRenderWindowInteractor(wxWindow *parent, long style, const wxString &name) #if defined(__WXGTK__) && defined(USE_WXGLCANVAS) - : vtkRenderWindowInteractor(), wxGLCanvas(parent, id, pos, size, style, name) + : wxGLCanvas(parent, id, pos, size, style, name), vtkRenderWindowInteractor() #else - : vtkRenderWindowInteractor(), wxWindow(parent, id, pos, size, style, name) + : wxWindow(parent, id, pos, size, style, name), vtkRenderWindowInteractor() #endif //__WXGTK__ , timer(this, ID_wxVTKRenderWindowInteractor_TIMER) , ActiveButton(wxEVT_NULL) @@ -175,18 +221,25 @@ wxVTKRenderWindowInteractor::wxVTKRenderWindowInteractor(wxWindow *parent, , RenderWhenDisabled(1) , UseCaptureMouse(0) { - +#ifdef VTK_DEBUG_LEAKS + vtkDebugLeaks::ConstructClass("wxVTKRenderWindowInteractor"); +#endif this->RenderWindow = NULL; this->SetRenderWindow(vtkRenderWindow::New()); this->RenderWindow->Delete(); - - // this->SetBackgroundColour( wxColour(255,0,0) ); +#ifdef __WXMAC__ + // On Mac (Carbon) we don't get notified of the initial window size with an EVT_SIZE event, + // so we update the size information of the interactor/renderwindow here + this->UpdateSize(size.x, size.y); +#endif + this->SetBackgroundStyle( wxBG_STYLE_COLOUR ); + this->SetBackgroundColour( wxColor(0,0,0,0) ); } //--------------------------------------------------------------------------- wxVTKRenderWindowInteractor::~wxVTKRenderWindowInteractor() -{ - // LG : trompe la mort ! - SetReferenceCount(0); +{ + SetRenderWindow(NULL); + SetInteractorStyle(NULL); } //--------------------------------------------------------------------------- wxVTKRenderWindowInteractor * wxVTKRenderWindowInteractor::New() @@ -263,15 +316,17 @@ void wxVTKRenderWindowInteractor::UpdateSize(int x, int y) Size[1] = y; // and our RenderWindow's size RenderWindow->SetSize(x, y); - } - } + } // if x y + } // if RenderWindow } //--------------------------------------------------------------------------- int wxVTKRenderWindowInteractor::CreateTimer(int WXUNUSED(timertype)) { // it's a one shot timer if (!timer.Start(10, TRUE)) - assert(false); + { + assert(false); + } return 1; @@ -285,10 +340,12 @@ int wxVTKRenderWindowInteractor::DestroyTimer() //--------------------------------------------------------------------------- void wxVTKRenderWindowInteractor::OnTimer(wxTimerEvent& WXUNUSED(event)) { - if (!Enabled) - return; - -#if VTK_MAJOR_VERSION == 5 || (VTK_MAJOR_VERSION == 4 && VTK_MINOR_VERSION > 0) + if (!Enabled) + { + return; + } + +#if VTK_MAJOR_VERSION > 4 || (VTK_MAJOR_VERSION == 4 && VTK_MINOR_VERSION > 0) // new style InvokeEvent(vtkCommand::TimerEvent, NULL); #else @@ -312,7 +369,7 @@ long wxVTKRenderWindowInteractor::GetHandleHack() long handle_tmp = 0; // __WXMSW__ is for Win32 -//__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) +//__WXMAC__ 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) // __WXGTK__ is for both gtk 1.2.x and gtk 2.x #if defined(__WXMSW__) || defined(__WXMAC__) handle_tmp = (long)this->GetHandle(); @@ -346,7 +403,6 @@ long wxVTKRenderWindowInteractor::GetHandleHack() //--------------------------------------------------------------------------- void wxVTKRenderWindowInteractor::OnPaint(wxPaintEvent& WXUNUSED(event)) { - //must always be here wxPaintDC pDC(this); @@ -360,21 +416,21 @@ void wxVTKRenderWindowInteractor::OnPaint(wxPaintEvent& WXUNUSED(event)) #endif //__WXMSW__ } // get vtk to render to the wxWindows - //bbtkDebugMessage("Wx",9,"wxVTKRenderWindowInteractor::OnPaint"<UpdateGLRegion(); + } +#endif } //--------------------------------------------------------------------------- void wxVTKRenderWindowInteractor::OnEraseBackground(wxEraseEvent &event) { - //printf("EED wxVTKRenderWindowInteractor::OnEraseBackground \n"); //turn off background erase to reduce flickering on MSW event.Skip(false); } @@ -390,7 +446,7 @@ void wxVTKRenderWindowInteractor::OnSize(wxSizeEvent& WXUNUSED(event)) return; } -#if VTK_MAJOR_VERSION == 5 || (VTK_MAJOR_VERSION == 4 && VTK_MINOR_VERSION > 0) +#if VTK_MAJOR_VERSION > 4 || (VTK_MAJOR_VERSION == 4 && VTK_MINOR_VERSION > 0) InvokeEvent(vtkCommand::ConfigureEvent, NULL); #endif //this will check for Handle @@ -399,19 +455,17 @@ void wxVTKRenderWindowInteractor::OnSize(wxSizeEvent& WXUNUSED(event)) //--------------------------------------------------------------------------- void wxVTKRenderWindowInteractor::OnMotion(wxMouseEvent &event) { - if (!Enabled) + this->Render(); + + if (!Enabled) { - return; + return; } - -#if VTK_MAJOR_VERSION == 5 || (VTK_MAJOR_VERSION == 4 && VTK_MINOR_VERSION > 0) - SetEventInformationFlipY(event.GetX(), event.GetY(), - event.ControlDown(), event.ShiftDown(), '\0', 0, NULL); - +#if VTK_MAJOR_VERSION > 4 || (VTK_MAJOR_VERSION == 4 && VTK_MINOR_VERSION > 0) + SetEventInformationFlipY(event.GetX(), event.GetY(), event.ControlDown(), event.ShiftDown(), '\0', 0, NULL); InvokeEvent(vtkCommand::MouseMoveEvent, NULL); #else - InteractorStyle->OnMouseMove(event.ControlDown(), event.ShiftDown(), - event.GetX(), Size[1] - event.GetY() - 1); + InteractorStyle->OnMouseMove(event.ControlDown(), event.ShiftDown(), event.GetX(), Size[1] - event.GetY() - 1); #endif } //--------------------------------------------------------------------------- @@ -423,16 +477,13 @@ void wxVTKRenderWindowInteractor::OnEnter(wxMouseEvent &event) return; } -#if VTK_MAJOR_VERSION == 5 || (VTK_MAJOR_VERSION == 4 && VTK_MINOR_VERSION > 0) +#if VTK_MAJOR_VERSION > 4 || (VTK_MAJOR_VERSION == 4 && VTK_MINOR_VERSION > 0) // new style - SetEventInformationFlipY(event.GetX(), event.GetY(), - event.ControlDown(), event.ShiftDown(), '\0', 0, NULL); - + SetEventInformationFlipY(event.GetX(), event.GetY(), event.ControlDown(), event.ShiftDown(), '\0', 0, NULL); InvokeEvent(vtkCommand::EnterEvent, NULL); #else // old style - InteractorStyle->OnEnter(event.ControlDown(), event.ShiftDown(), - event.GetX(), Size[1] - event.GetY() - 1); + InteractorStyle->OnEnter(event.ControlDown(), event.ShiftDown(), event.GetX(), Size[1] - event.GetY() - 1); #endif } //--------------------------------------------------------------------------- @@ -443,7 +494,7 @@ void wxVTKRenderWindowInteractor::OnLeave(wxMouseEvent &event) return; } -#if VTK_MAJOR_VERSION == 5 || (VTK_MAJOR_VERSION == 4 && VTK_MINOR_VERSION > 0) +#if VTK_MAJOR_VERSION > 4 || (VTK_MAJOR_VERSION == 4 && VTK_MINOR_VERSION > 0) // new style SetEventInformationFlipY(event.GetX(), event.GetY(), event.ControlDown(), event.ShiftDown(), '\0', 0, NULL); @@ -463,21 +514,22 @@ void wxVTKRenderWindowInteractor::OnKeyDown(wxKeyEvent &event) return; } -#if VTK_MAJOR_VERSION == 5 || (VTK_MAJOR_VERSION == 4 && VTK_MINOR_VERSION > 0) +#if VTK_MAJOR_VERSION > 4 || (VTK_MAJOR_VERSION == 4 && VTK_MINOR_VERSION > 0) // new style int keycode = event.GetKeyCode(); char key = '\0'; - if (keycode < 256) + if (((unsigned int)keycode) < 256) { // TODO: Unicode in non-Unicode mode ?? key = (char)keycode; } - SetEventInformationFlipY(event.GetX(), event.GetY(), - event.ControlDown(), event.ShiftDown(), key, 0, NULL); - + // we don't get a valid mouse position inside the key event on every platform + // so we retrieve the mouse position explicitly and pass it along + wxPoint mousePos = ScreenToClient(wxGetMousePosition()); + SetEventInformationFlipY(mousePos.x, mousePos.y, + event.ControlDown(), event.ShiftDown(), key, 0, NULL); InvokeEvent(vtkCommand::KeyPressEvent, NULL); - InvokeEvent(vtkCommand::CharEvent, NULL); #else InteractorStyle->OnKeyDown(event.ControlDown(), event.ShiftDown(), event.GetKeyCode(), 1); @@ -492,18 +544,21 @@ void wxVTKRenderWindowInteractor::OnKeyUp(wxKeyEvent &event) return; } -#if VTK_MAJOR_VERSION == 5 || (VTK_MAJOR_VERSION == 4 && VTK_MINOR_VERSION > 0) +#if VTK_MAJOR_VERSION > 4 || (VTK_MAJOR_VERSION == 4 && VTK_MINOR_VERSION > 0) // new style int keycode = event.GetKeyCode(); char key = '\0'; - if (keycode < 256) + if (((unsigned int)keycode) < 256) { // TODO: Unicode in non-Unicode mode ?? key = (char)keycode; } - SetEventInformationFlipY(event.GetX(), event.GetY(), - event.ControlDown(), event.ShiftDown(), key, 0, NULL); + // we don't get a valid mouse position inside the key event on every platform + // so we retrieve the mouse position explicitly and pass it along + wxPoint mousePos = ScreenToClient(wxGetMousePosition()); + SetEventInformationFlipY(mousePos.x, mousePos.y, + event.ControlDown(), event.ShiftDown(), key, 0, NULL); InvokeEvent(vtkCommand::KeyReleaseEvent, NULL); #else InteractorStyle->OnKeyUp(event.ControlDown(), event.ShiftDown(), @@ -512,6 +567,33 @@ void wxVTKRenderWindowInteractor::OnKeyUp(wxKeyEvent &event) event.Skip(); } #endif //!(VTK_MAJOR_VERSION == 3 && VTK_MINOR_VERSION == 1) + //--------------------------------------------------------------------------- +void wxVTKRenderWindowInteractor::OnChar(wxKeyEvent &event) +{ + if (!Enabled) + { + return; + } + +#if VTK_MAJOR_VERSION > 4 || (VTK_MAJOR_VERSION == 4 && VTK_MINOR_VERSION > 0) + // new style + int keycode = event.GetKeyCode(); + char key = '\0'; + if (((unsigned int)keycode) < 256) + { + // TODO: Unicode in non-Unicode mode ?? + key = (char)keycode; + } + + // we don't get a valid mouse position inside the key event on every platform + // so we retrieve the mouse position explicitly and pass it along + wxPoint mousePos = ScreenToClient(wxGetMousePosition()); + SetEventInformationFlipY(mousePos.x, mousePos.y, + event.ControlDown(), event.ShiftDown(), key, 0, NULL); + InvokeEvent(vtkCommand::CharEvent, NULL); +#endif + event.Skip(); +} //--------------------------------------------------------------------------- void wxVTKRenderWindowInteractor::OnButtonDown(wxMouseEvent &event) { @@ -521,14 +603,20 @@ void wxVTKRenderWindowInteractor::OnButtonDown(wxMouseEvent &event) } ActiveButton = event.GetEventType(); -#if VTK_MAJOR_VERSION == 5 || (VTK_MAJOR_VERSION == 4 && VTK_MINOR_VERSION > 0) + // On Mac (Carbon) and Windows we don't automatically get the focus when + // you click inside the window + // we therefore set the focus explicitly + // Apparently we need that on linux (GTK) too: + this->SetFocus(); + +#if VTK_MAJOR_VERSION > 4 || (VTK_MAJOR_VERSION == 4 && VTK_MINOR_VERSION > 0) SetEventInformationFlipY(event.GetX(), event.GetY(), event.ControlDown(), event.ShiftDown(), '\0', 0, NULL); #endif if(event.RightDown()) { -#if VTK_MAJOR_VERSION == 5 || (VTK_MAJOR_VERSION == 4 && VTK_MINOR_VERSION > 0) +#if VTK_MAJOR_VERSION > 4 || (VTK_MAJOR_VERSION == 4 && VTK_MINOR_VERSION > 0) // new style InvokeEvent(vtkCommand::RightButtonPressEvent, NULL); #else @@ -539,7 +627,7 @@ void wxVTKRenderWindowInteractor::OnButtonDown(wxMouseEvent &event) } else if(event.LeftDown()) { -#if VTK_MAJOR_VERSION == 5 || (VTK_MAJOR_VERSION == 4 && VTK_MINOR_VERSION > 0) +#if VTK_MAJOR_VERSION > 4 || (VTK_MAJOR_VERSION == 4 && VTK_MINOR_VERSION > 0) // new style InvokeEvent(vtkCommand::LeftButtonPressEvent, NULL); #else @@ -550,7 +638,7 @@ void wxVTKRenderWindowInteractor::OnButtonDown(wxMouseEvent &event) } else if(event.MiddleDown()) { -#if VTK_MAJOR_VERSION == 5 || (VTK_MAJOR_VERSION == 4 && VTK_MINOR_VERSION > 0) +#if VTK_MAJOR_VERSION > 4 || (VTK_MAJOR_VERSION == 4 && VTK_MINOR_VERSION > 0) // new style InvokeEvent(vtkCommand::MiddleButtonPressEvent, NULL); #else @@ -580,14 +668,14 @@ void wxVTKRenderWindowInteractor::OnButtonUp(wxMouseEvent &event) return; } -#if VTK_MAJOR_VERSION == 5 || (VTK_MAJOR_VERSION == 4 && VTK_MINOR_VERSION > 0) +#if VTK_MAJOR_VERSION > 4 || (VTK_MAJOR_VERSION == 4 && VTK_MINOR_VERSION > 0) SetEventInformationFlipY(event.GetX(), event.GetY(), event.ControlDown(), event.ShiftDown(), '\0', 0, NULL); #endif if(ActiveButton == wxEVT_RIGHT_DOWN) { -#if VTK_MAJOR_VERSION == 5 || (VTK_MAJOR_VERSION == 4 && VTK_MINOR_VERSION > 0) +#if VTK_MAJOR_VERSION > 4 || (VTK_MAJOR_VERSION == 4 && VTK_MINOR_VERSION > 0) // new style InvokeEvent(vtkCommand::RightButtonReleaseEvent, NULL); #else @@ -598,7 +686,7 @@ void wxVTKRenderWindowInteractor::OnButtonUp(wxMouseEvent &event) } else if(ActiveButton == wxEVT_LEFT_DOWN) { -#if VTK_MAJOR_VERSION == 5 || (VTK_MAJOR_VERSION == 4 && VTK_MINOR_VERSION > 0) +#if VTK_MAJOR_VERSION > 4 || (VTK_MAJOR_VERSION == 4 && VTK_MINOR_VERSION > 0) // new style InvokeEvent(vtkCommand::LeftButtonReleaseEvent, NULL); #else @@ -609,7 +697,7 @@ void wxVTKRenderWindowInteractor::OnButtonUp(wxMouseEvent &event) } else if(ActiveButton == wxEVT_MIDDLE_DOWN) { -#if VTK_MAJOR_VERSION == 5 || (VTK_MAJOR_VERSION == 4 && VTK_MINOR_VERSION > 0) +#if VTK_MAJOR_VERSION > 4 || (VTK_MAJOR_VERSION == 4 && VTK_MINOR_VERSION > 0) // new style InvokeEvent(vtkCommand::MiddleButtonReleaseEvent, NULL); #else @@ -629,7 +717,7 @@ void wxVTKRenderWindowInteractor::OnButtonUp(wxMouseEvent &event) void wxVTKRenderWindowInteractor::OnMouseWheel(wxMouseEvent& event) { // Mouse wheel was only added after VTK 4.4 (I think...) -#if VTK_MAJOR_VERSION == 5 || (VTK_MAJOR_VERSION == 4 && VTK_MINOR_VERSION > 2) +#if VTK_MAJOR_VERSION > 4 || (VTK_MAJOR_VERSION == 4 && VTK_MINOR_VERSION > 2) // new style //Set vtk event information ... The numebr of wheel rotations is stored in //the x varible. y varible is zero @@ -638,14 +726,12 @@ void wxVTKRenderWindowInteractor::OnMouseWheel(wxMouseEvent& event) if(event.GetWheelRotation() > 0) { //Send event to VTK -// EED -// InvokeEvent(vtkCommand::MouseWheelForwardEvent, NULL); + InvokeEvent(vtkCommand::MouseWheelForwardEvent, NULL); } else { //Send event to VTK -// EED -// InvokeEvent(vtkCommand::MouseWheelBackwardEvent, NULL); + InvokeEvent(vtkCommand::MouseWheelBackwardEvent, NULL); } #endif @@ -674,7 +760,7 @@ void wxVTKRenderWindowInteractor::Render() { RenderWindow->Render(); } -#if VTK_MAJOR_VERSION == 5 || (VTK_MAJOR_VERSION == 4 && VTK_MINOR_VERSION > 2) +#if VTK_MAJOR_VERSION > 4 || (VTK_MAJOR_VERSION == 4 && VTK_MINOR_VERSION > 2) else if(GetHandleHack()) { //this means the user has reparented us; let's adapt to the @@ -734,14 +820,8 @@ void wxVTKRenderWindowInteractor::PrintSelf(ostream& os, vtkIndent indent) } -#if defined(_WIN32) -const char * wxVTKRenderWindowInteractor::GetClassName() const -{ - return "wxVTKRenderWindowInteractor"; -} -#endif //_WIN32 - } // LG : EO namespace bbwxvtk //======================================================================= +