X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=src%2FcreawxVTKRenderWindowInteractor.h;fp=src%2FcreawxVTKRenderWindowInteractor.h;h=db0187dca8f3db139a3c986802e934056d16e7d5;hb=23e9509fe3c71033515d60b110a84f2310d8f082;hp=d0b90df118ebf30372847cfc518cb695d084b6f2;hpb=2a697011e9f49d1b394665cf956a2fdf4bb88100;p=crea.git diff --git a/src/creawxVTKRenderWindowInteractor.h b/src/creawxVTKRenderWindowInteractor.h index d0b90df..db0187d 100644 --- a/src/creawxVTKRenderWindowInteractor.h +++ b/src/creawxVTKRenderWindowInteractor.h @@ -3,8 +3,8 @@ Program: Visualization Toolkit Module: $RCSfile: creawxVTKRenderWindowInteractor.h,v $ Language: C++ - Date: $Date: 2010/01/22 19:16:54 $ - Version: $Revision: 1.3 $ + Date: $Date: 2011/02/17 11:02:08 $ + Version: $Revision: 1.4 $ Copyright (c) 1993-2002 Ken Martin, Will Schroeder, Bill Lorensen All rights reserved. @@ -32,7 +32,7 @@ // - This class might not be easily readable as it tried to work with VTK 3.2 // and 4.x. This class doesn't support reparenting with VTK 4.2 and earlier. // .SECTION see also -// creawxVTKRenderWindowInteractor.py creawxVTKRenderWindow.py +// creawxVTKRenderWindowInteractor.py wxVTKRenderWindow.py #ifndef _creawxVTKRenderWindowInteractor_h_ #define _creawxVTKRenderWindowInteractor_h_ @@ -40,10 +40,7 @@ #ifdef USE_WXWIDGETS #ifdef USE_VTK -#include -#include -/* // For compilers that support precompilation, includes "wx/wx.h". #include "wx/wxprec.h" @@ -54,7 +51,7 @@ #ifndef WX_PRECOMP #include #endif -*/ + #include #include @@ -64,17 +61,19 @@ // Apparently since wxGTK 2.8.0 one can finally use wxWindow (just as in any // other port): +// MM: tested on 2008/04/08: experienced some heavy flickering with wx-widget 2.6.0 +// using a wxWindow instead of wxGLCanvas fixed the symptoms +//#if (!wxCHECK_VERSION(2, 6, 0)) #if (!wxCHECK_VERSION(2, 8, 0)) #define USE_WXGLCANVAS #endif - #if defined(__WXGTK__) && defined(USE_WXGLCANVAS) -# if wxUSE_GLCANVAS +# if wxUSE_GLCANVAS # include -# else +# else # error "problem of wxGLCanvas, you need to build wxWidgets with opengl" -# endif //wxUSE_GLCANVAS +# endif //wxUSE_GLCANVAS #endif //__WXGTK__ // Motif version (renamed into wxX11 for wxWindow 2.4 and newer) @@ -82,7 +81,6 @@ # error This GUI is not supported by creawxVTKRenderWindowInteractor for now #endif - // wx forward declarations class wxPaintEvent; class wxMouseEvent; @@ -97,9 +95,9 @@ namespace crea #if defined(__WXGTK__) && defined(USE_WXGLCANVAS) -class CREA_EXPORT creawxVTKRenderWindowInteractor : public wxGLCanvas, virtual public vtkRenderWindowInteractor +class creawxVTKRenderWindowInteractor : public wxGLCanvas, public vtkRenderWindowInteractor #else -class CREA_EXPORT creawxVTKRenderWindowInteractor : virtual public vtkRenderWindowInteractor, public wxWindow +class creawxVTKRenderWindowInteractor : public wxWindow, public vtkRenderWindowInteractor #endif //__WXGTK__ { DECLARE_DYNAMIC_CLASS(creawxVTKRenderWindowInteractor) @@ -114,18 +112,13 @@ class CREA_EXPORT creawxVTKRenderWindowInteractor : virtual public vtkRenderWind const wxSize &size = wxDefaultSize, long style = wxWANTS_CHARS | wxNO_FULL_REPAINT_ON_RESIZE, const wxString &name = wxPanelNameStr); - //vtk ::New() + vtkTypeRevisionMacro(creawxVTKRenderWindowInteractor,vtkRenderWindowInteractor); static creawxVTKRenderWindowInteractor * New(); void PrintSelf(ostream& os, vtkIndent indent); //destructor ~creawxVTKRenderWindowInteractor(); -#if defined(_WIN32) - const char * creawxVTKRenderWindowInteractor::GetClassName() const; -#endif //_WIN32 - - // vtkRenderWindowInteractor overrides void Initialize(); void Enable(); @@ -149,6 +142,7 @@ class CREA_EXPORT creawxVTKRenderWindowInteractor : virtual public vtkRenderWind void OnLeave(wxMouseEvent &event); void OnKeyDown(wxKeyEvent &event); void OnKeyUp(wxKeyEvent &event); + void OnChar(wxKeyEvent &event); #endif void OnTimer(wxTimerEvent &event); void OnSize(wxSizeEvent &event); @@ -187,10 +181,13 @@ class CREA_EXPORT creawxVTKRenderWindowInteractor : virtual public vtkRenderWind DECLARE_EVENT_TABLE() }; + } // LG : EO namespace crea //====================================================================== #endif // USE_WX #endif // USE_VTK + + #endif //_creawxVTKRenderWindowInteractor_h_