X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=src%2FcreawxVTKRenderWindowInteractor.h;h=daf7f4ed914c0d86176384091914cef0f45891d7;hb=cf2e11cdafb5f71b1f978f06b08a1478d4cdcfa1;hp=ebc2030656342849c158858140e32cf9bdf3368b;hpb=ffbaf4177cae0647c558f89daf6783b91373930d;p=crea.git diff --git a/src/creawxVTKRenderWindowInteractor.h b/src/creawxVTKRenderWindowInteractor.h index ebc2030..daf7f4e 100644 --- a/src/creawxVTKRenderWindowInteractor.h +++ b/src/creawxVTKRenderWindowInteractor.h @@ -1,18 +1,41 @@ +/* +# --------------------------------------------------------------------- +# +# 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: creawxVTKRenderWindowInteractor.h,v $ Language: C++ - Date: $Date: 2008/10/15 11:19:18 $ - Version: $Revision: 1.1 $ + Date: $Date: 2012/11/15 10:43:26 $ + Version: $Revision: 1.9 $ - 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. + 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. =========================================================================*/ @@ -32,15 +55,17 @@ // - 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_ +#ifdef USE_WXWIDGETS +#ifdef USE_VTK + #include #include -/* // For compilers that support precompilation, includes "wx/wx.h". #include "wx/wxprec.h" @@ -51,7 +76,7 @@ #ifndef WX_PRECOMP #include #endif -*/ + #include #include @@ -61,17 +86,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) @@ -79,7 +106,6 @@ # error This GUI is not supported by creawxVTKRenderWindowInteractor for now #endif - // wx forward declarations class wxPaintEvent; class wxMouseEvent; @@ -96,7 +122,7 @@ namespace crea #if defined(__WXGTK__) && defined(USE_WXGLCANVAS) class CREA_EXPORT creawxVTKRenderWindowInteractor : public wxGLCanvas, virtual public vtkRenderWindowInteractor #else -class CREA_EXPORT creawxVTKRenderWindowInteractor : public wxWindow, virtual public vtkRenderWindowInteractor +class CREA_EXPORT creawxVTKRenderWindowInteractor : virtual public vtkRenderWindowInteractor, public wxWindow #endif //__WXGTK__ { DECLARE_DYNAMIC_CLASS(creawxVTKRenderWindowInteractor) @@ -111,18 +137,13 @@ class CREA_EXPORT creawxVTKRenderWindowInteractor : public wxWindow, virtual pub const wxSize &size = wxDefaultSize, long style = wxWANTS_CHARS | wxNO_FULL_REPAINT_ON_RESIZE, const wxString &name = wxPanelNameStr); - //vtk ::New() + //EED win Compilation why ??: 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(); @@ -146,6 +167,7 @@ class CREA_EXPORT creawxVTKRenderWindowInteractor : public wxWindow, virtual pub 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); @@ -184,8 +206,13 @@ class CREA_EXPORT creawxVTKRenderWindowInteractor : public wxWindow, virtual pub DECLARE_EVENT_TABLE() }; + } // LG : EO namespace crea //====================================================================== +#endif // USE_WX +#endif // USE_VTK + + #endif //_creawxVTKRenderWindowInteractor_h_