]> Creatis software - bbtk.git/commitdiff
#135 BBTK Feature New Normal - branch vtk7itk4wx3
authorEduardo DAVILA <davila@localhost.localdomain>
Tue, 3 Oct 2017 14:12:03 +0000 (16:12 +0200)
committerEduardo DAVILA <davila@localhost.localdomain>
Tue, 3 Oct 2017 14:12:03 +0000 (16:12 +0200)
17 files changed:
kernel/appli/bbStudio/bbStudio.cxx
kernel/appli/bbi/bbi.cxx
kernel/src/bbtkDynamicLibraryHandling.h
kernel/src/bbtkFactory.cxx
kernel/src/bbtkInterpreterVirtual.cxx
kernel/src/bbtkPackage.cxx
kernel/src/bbtkWxGUICommand.cxx
kernel/src/bbtkWxGUIPackageBrowser2.cxx
kernel/src/bbtkWxGUITextEditor.cxx
packages/wx/src/bbwxFileSelector.cxx
packages/wxvtk/src/bbwxvtkViewer2D.cxx
packages/wxvtk/src/bbwxvtkViewer2D.h
packages/wxvtk/src/bbwxvtkViewer3D.cxx
packages/wxvtk/src/bbwxvtkViewer3D.h
packages/wxvtk/src/bbwxvtkwxVTKRenderWindowInteractorTovtkRenderWindowInteractor.cxx
packages/wxvtk/src/wxVTKRenderWindowInteractor.cxx [deleted file]
packages/wxvtk/src/wxVTKRenderWindowInteractor.h [deleted file]

index 4a00d22c35e82c046b0b3052aed9855868c29f08..25e4612cf6f2fd227a4601f37534e3850519a199 100644 (file)
 #include <wx/cmdline.h> 
 #include <vector>
 
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
+       static const wxCmdLineEntryDesc cmdLineDesc[] =
+       {
+         { wxCMD_LINE_PARAM,  NULL, NULL, _T("file1 [file2 [...]]"), wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_OPTIONAL }, 
+         { wxCMD_LINE_SWITCH, _T("h"), _T("help"),   _T("Prints this help") },
+         { wxCMD_LINE_SWITCH, _T("d"), _T("debug"),   _T("Message all 9") },
+         { wxCMD_LINE_NONE }
+       };
+#else
+       static const wxCmdLineEntryDesc cmdLineDesc[] =
+       {
+         { wxCMD_LINE_PARAM,  NULL, NULL, "file1 [file2 [...]]", wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_OPTIONAL }, 
+         { wxCMD_LINE_SWITCH, "h", "help",   "Prints this help" },
+         { wxCMD_LINE_SWITCH, "d", "debug",   "Message all 9" },
+         { wxCMD_LINE_NONE }
+       };
+#endif
 
-static const wxCmdLineEntryDesc cmdLineDesc[] =
-{
-  { wxCMD_LINE_PARAM,  NULL, NULL, _T("file1 [file2 [...]]"), wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_OPTIONAL }, 
-  { wxCMD_LINE_SWITCH, _T("h"), _T("help"),   _T("Prints this help") },
-  { wxCMD_LINE_SWITCH, _T("d"), _T("debug"),   _T("Message all 9") },
-  { wxCMD_LINE_NONE }
-};
 
 
 
index 89a3daa305de477cb5ad38f819a1875e7758de05..c594a081f5d939f8e5d30948b8eb1b3b3197bd5c 100644 (file)
@@ -27,6 +27,8 @@
 
 #ifdef _USE_WXWIDGETS_
 
+#include <exception>
+
 //==========================================================================
 // WITH WX
 //==========================================================================
 #include <map>
 
 //==========================================================================
-// Command line options definition
-static const wxCmdLineEntryDesc cmdLineDesc[] =
-{
-  { wxCMD_LINE_SWITCH, _T("h"), _T("help"),   _T("print this help or help on the application defined in input bbs file if any") },
-  { wxCMD_LINE_SWITCH, _T("g"), _T("graphical-dialog"),   _T("prompt the input parameter values using graphical dialog") },
-  { wxCMD_LINE_SWITCH, _T("t"), _T("text-dialog"),   _T("prompt the input parameter values in text mode") },
-  { wxCMD_LINE_SWITCH, _T("c"), _T("console"), _T("open bbi console") },
-  { wxCMD_LINE_SWITCH, _T("N"), _T("no-console"),   _T("never open bbi console even on error") },
-  { wxCMD_LINE_SWITCH, _T("q"), _T("quiet"),   _T("be quiet (='message max 0')") },
-  { wxCMD_LINE_SWITCH, _T("d"), _T("debug"), _T("turn all messages on (='message all 9')") },
-  { wxCMD_LINE_SWITCH, _T("D"), _T("Debug"), _T("memory debug on exit (='debug -D')") },
-  { wxCMD_LINE_PARAM,  NULL, NULL, _T("file [file [...]]"), wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_OPTIONAL | wxCMD_LINE_PARAM_MULTIPLE },
-  { wxCMD_LINE_NONE }
-};
+
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
+       // Command line options definition
+       static const wxCmdLineEntryDesc cmdLineDesc[] =
+       {
+         { wxCMD_LINE_SWITCH, _T("h"), _T("help"),   _T("print this help or help on the application defined in input bbs file if any") },
+         { wxCMD_LINE_SWITCH, _T("g"), _T("graphical-dialog"),   _T("prompt the input parameter values using graphical dialog") },
+         { wxCMD_LINE_SWITCH, _T("t"), _T("text-dialog"),   _T("prompt the input parameter values in text mode") },
+         { wxCMD_LINE_SWITCH, _T("c"), _T("console"), _T("open bbi console") },
+         { wxCMD_LINE_SWITCH, _T("N"), _T("no-console"),   _T("never open bbi console even on error") },
+         { wxCMD_LINE_SWITCH, _T("q"), _T("quiet"),   _T("be quiet (='message max 0')") },
+         { wxCMD_LINE_SWITCH, _T("d"), _T("debug"), _T("turn all messages on (='message all 9')") },
+         { wxCMD_LINE_SWITCH, _T("D"), _T("Debug"), _T("memory debug on exit (='debug -D')") },
+         { wxCMD_LINE_PARAM,  NULL, NULL, _T("file [file [...]]"), wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_OPTIONAL | wxCMD_LINE_PARAM_MULTIPLE },
+         { wxCMD_LINE_NONE }
+       };
+#else
+       // Command line options definition
+       static const wxCmdLineEntryDesc cmdLineDesc[] =
+       {
+         { wxCMD_LINE_SWITCH, "h", "help",   "print this help or help on the application defined in input bbs file if any" },
+         { wxCMD_LINE_SWITCH, "g", "graphical-dialog",   "prompt the input parameter values using graphical dialog" },
+         { wxCMD_LINE_SWITCH, "t", "text-dialog",   "prompt the input parameter values in text mode" },
+         { wxCMD_LINE_SWITCH, "c", "console", "open bbi console" },
+         { wxCMD_LINE_SWITCH, "N", "no-console",   "never open bbi console even on error" },
+         { wxCMD_LINE_SWITCH, "q", "quiet",   "be quiet (='message max 0')" },
+         { wxCMD_LINE_SWITCH, "d", "debug", "turn all messages on (='message all 9')" },
+         { wxCMD_LINE_SWITCH, "D", "Debug", "memory debug on exit (='debug -D')" },
+         { wxCMD_LINE_PARAM,  NULL, NULL, "file [file [...]]", wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_OPTIONAL | wxCMD_LINE_PARAM_MULTIPLE },
+         { wxCMD_LINE_NONE }
+       };
+#endif
+
+
+
+
 //==========================================================================
 
 //==========================================================================
@@ -88,13 +113,20 @@ void WxProcessCmdLine::Process(wxCmdLineParser& parser)
       bbtk::StaticInitTime::PrintObjectListInfo = true;
     }
   
-  debug = ( parser.Found(_T("d")) );  
-  quiet = ( parser.Found(_T("q")) );
-  help = ( parser.Found(_T("h")) );
-  graphical_dialog = ( parser.Found(_T("wxcommandlineg")) );
-  text_dialog = ( parser.Found(_T("t")) );
-  no_console = ( parser.Found(_T("N")) );
-  
+  debug                        = ( parser.Found(_T("d")) );  
+  quiet                        = ( parser.Found(_T("q")) );
+  help                         = ( parser.Found(_T("h")) );
+
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
+  graphical_dialog     = ( parser.Found(_T("wxcommandlineg")) );
+#else
+  printf("EED Warnning. WxProcessCmdLine::Process  g  wxcommandlineg   ");
+  graphical_dialog     = ( parser.Found(_T("g")) );
+#endif
+
+  text_dialog          = ( parser.Found(_T("t")) );
+  no_console           = ( parser.Found(_T("N")) );
   if (quiet) bbtk::MessageManager::SetMessageLevel("max",0);
   if (debug) bbtk::MessageManager::SetMessageLevel("all",9);
 
@@ -130,7 +162,7 @@ void WxProcessCmdLine::Process(wxCmdLineParser& parser)
              ((input_file.size() == 0) && 
               (!no_console) &&
               (!usage) ) );
-  
+
 }
 //==========================================================================
 
@@ -300,7 +332,7 @@ int main(int argc, char* argv[])
 
   if (!cmdline.proceed) return 0;
 
-  if (cmdline.no_console) 
+       if (cmdline.no_console) 
     {
       //      std::cout << "main NC"<<std::endl;
       // Interpreter 
@@ -313,27 +345,26 @@ int main(int argc, char* argv[])
       bool error = false;
       for (i=cmdline.input_file.begin(); 
           i!=cmdline.input_file.end(); ++i) 
-       {
-         error = ! I->InterpretFile(*i);
-         if (error) break;
-       }
-      if (help_on_script) 
-       {
-         I->SetNoExecMode(false);
-         std::string package; 
-         I->GetExecuter()->GetFactory()->PrintHelpDescriptor("workspace",
+               {
+                       error = ! I->InterpretFile(*i);
+                       if (error) break;
+               }
+       if (help_on_script) 
+               {
+                       I->SetNoExecMode(false);
+                       std::string package; 
+                       I->GetExecuter()->GetFactory()->PrintHelpDescriptor("workspace",
                                                              package,
                                                              false);
-       }
-      if (cmdline.input_file.size()==0)
-       I->CommandLineInterpreter();
-
+               }
+       if (cmdline.input_file.size()==0)
+               {
+                       I->CommandLineInterpreter();
+               } // if cmdline.input_file.size
       //
-    }
-  else 
-    {
+    } else {
       wxEntry(argc, argv);
-    }
+    } // if cmdline.no_console
 
 }
 
index 335c67128aaebcce9cae1e2b388992c051d897e0..9118e9b8226b5d784b69bde6fc646a7e676c15cc 100644 (file)
 // the RTTI mechanism travel correctly across packages (typeid,dynamic_cast...)
 // however this can cause problems (symbol clashes) ...
 // see :
+// https://linux.die.net/man/3/dlopen
 // http://gcc.gnu.org/faq.html#dso
 // http://gcc.gnu.org/ml/gcc/2003-04/msg00256.html
 // http://gcc.gnu.org/ml/gcc-bugs/2003-10/msg02771.html
+
+#define BBTK_RTLD_LOCAL
+
 #ifndef BBTK_RTLD_LOCAL
 #  define BBTK_RTLD_SCOPE RTLD_GLOBAL
 #else 
index d541db35b9203e89b984a63daa7c2dd1a7760eb5..820085a430e9a0bcda9a50826ac42982b1bcd74b 100644 (file)
@@ -106,7 +106,6 @@ namespace bbtk
                               std::string pkgname,
                               std::string path)
   {
-    
     Package::Pointer p = Package::CreateFromDynamicLibrary(libname,
                                                           pkgname,
                                                           path);
@@ -125,8 +124,7 @@ namespace bbtk
        mPackageMap[pkgname] = p;
        return true;
       }
-    return false;
-    
+    return false;    
   }
   
   //===================================================================
@@ -147,8 +145,6 @@ namespace bbtk
   
   void Factory::LoadPackage( const std::string& name )
   {
-         
-         
   // Note : in the following :
   // name : the user supplied name
   //      - abreviated name    e.g.       pkg   pkg.so   libbpkg   libbbpkg.so
@@ -280,7 +276,6 @@ namespace bbtk
                        foundFile = true; 
 
                  // Try to Load the library
-
                        ok = DoLoadPackage( libname, pkgname, path);
                        if (ok)
                        {
@@ -317,9 +312,6 @@ namespace bbtk
                }       
                bbtkMessage("output",2,"[" << libname << "] loaded" << std::endl);
        }
-
-    
-
   }
 
   //===================================================================
index 93d05ed5cf88ef1d335734a949476b26cb088134..451ade9e45cabbbfea1285770f41f77aa45bec28 100644 (file)
@@ -516,6 +516,7 @@ namespace bbtk
   //=======================================================================
   void InterpreterVirtual::CatchUnknownException()
   {
+printf("EED InterpreterVirtual::CatchUnknownException Start\n");
 //EED Borrame   if (GetExecuter()->GetNoErrorMode()) 
 //EED Borrame       {
 //EED Borrame  std::string file("?");
@@ -556,27 +557,28 @@ namespace bbtk
        CloseAllFiles();
        std::cerr << mess.str();
       }
+printf("EED InterpreterVirtual::CatchUnknownException End\n");
   }
   //=======================================================================
 
   //=======================================================================
   
-#define CATCH_MACRO                                    \
-  catch (InterpreterException e)                       \
-    {                                                  \
-      CatchInterpreterException(e);                    \
-    }                                                  \
+#define CATCH_MACRO                                            \
+  catch (InterpreterException e)               \
+    {                                                                  \
+      CatchInterpreterException(e);            \
+    }                                                                  \
   catch (bbtk::Exception e)                            \
-    {                                                  \
-      CatchBbtkException(e);                           \
-    }                                                  \
+    {                                                                  \
+      CatchBbtkException(e);                   \
+    }                                                                  \
   catch (std::exception& e)                            \
-    {                                                  \
+    {                                                                  \
       CatchStdException(e);                            \
-    }                                                  \
-  catch (...)                                          \
-    {                                                  \
-      CatchUnknownException();                         \
+    }                                                                  \
+  catch (...)                                                  \
+    {                                                                  \
+      CatchUnknownException();                 \
     }                                          
   //=======================================================================
    
@@ -611,8 +613,7 @@ namespace bbtk
 
 
   //=======================================================================
-  InterpreterVirtual::ExitStatus 
-  InterpreterVirtual::InterpretBuffer( std::stringstream* buffer )
+  InterpreterVirtual::ExitStatus   InterpreterVirtual::InterpretBuffer( std::stringstream* buffer )
   {
     bbtkDebugMessage("interpreter",4,"==> InterpreterVirtual::InterpretBuffer()"<<std::endl);
 
@@ -633,6 +634,7 @@ namespace bbtk
 
     
     mCommandLine = exm;
+
     return mStatus;
   }
   //=======================================================================
index 91cdb518372b220f124b1de33af8dc5c22c8912a..f2268bdd39cf20282d9151c4bf6aa3855d2da306 100644 (file)
@@ -368,7 +368,7 @@ namespace bbtk
     // Open shared lib
     void *handler;
     handler = dlopen(libname.c_str(), BBTK_RTLD_TIME | BBTK_RTLD_SCOPE );
-//EED     handler = dlopen(libname.c_str(), RTLD_LAZY | RTLD_LOCAL );
+//     handler = dlopen(libname.c_str(), RTLD_LAZY | RTLD_LOCAL );
          
     if (!handler)
       {
index 2e37ec476a6922b11453d95112e2ef97f88feae8..c9fc3823e04e1483d8c5ac86facc84dc083790b9 100644 (file)
@@ -164,7 +164,13 @@ namespace bbtk
     std::string stdDir = default_doc_dir+"/share/bbtk/bbs";
     wxString defaultDir(stdDir.c_str(), wxConvUTF8);
 
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
     wxFileDialog dialog(this, _T("Include file"),defaultDir, _T(""), _T("*.bbs"), wxOPEN );
+#else
+    wxFileDialog dialog(this, _T("Include file"),defaultDir, _T(""), _T("*.bbs"), wxFD_OPEN );
+#endif
+
     if (dialog.ShowModal() == wxID_OK)
      {
        // std::string command(_T("include "));
index bc5b5253bffcbc0d811f8e824bcaedc755544c4b..21fc26d2e584a6a39bd9453a682bb83572a31f10 100644 (file)
@@ -105,16 +105,19 @@ namespace bbtk
     EVT_RIGHT_DOWN(WxGUIBlackBoxList::OnRightClick)
     END_EVENT_TABLE()
 
-  int wxCALLBACK MyCompareFunction(long item1, long item2, long WXUNUSED(sortData))
-  {
+int wxCALLBACK MyCompareFunction(long item1, long item2, long WXUNUSED(sortData))
+{
     // inverse the order
     if (item1 < item2)
-      return -1;
+       {
+        return -1;
+       }
     if (item1 > item2)
-      return 1;
-
+       {
+        return 1;
+       }
     return 0;
-  }
+}
 
   // WxGUIBlackBoxList
   WxGUIBlackBoxList::WxGUIBlackBoxList(wxWindow *parent,
index 5f3aea8afe8f077f0ed4ef5a62fda940c58615dd..3ab49d038c28d5d4642d98578951188c24cb4211 100644 (file)
@@ -227,9 +227,18 @@ namespace bbtk
     //    std::cout << "-------------- SAVE ---------------"<<std::endl;
     if (mAskFilename)
       {
+
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
        wxFileDialog* fd = new wxFileDialog(this,_T("Save file"),_T(""),
                                            _T(""),std2wx(filter),
                                            wxSAVE | wxOVERWRITE_PROMPT );
+#else
+       wxFileDialog* fd = new wxFileDialog(this,_T("Save file"),_T(""),
+                                           _T(""),std2wx(filter),
+                                           wxFD_SAVE | wxFD_OVERWRITE_PROMPT );
+#endif
+
        int result_fd = fd->ShowModal();
     
        // This line is need it by windows // EED
@@ -530,9 +539,16 @@ namespace bbtk
   {
     //    std::cout << "-------------- OPEN ---------------"<<std::endl;
 
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
     wxFileDialog* fd = new wxFileDialog(this,_T("Open file"),_T(""),
                                        _T(""),std2wx(mFileNameFilter),
                                        wxOPEN | wxFILE_MUST_EXIST );
+#else
+    wxFileDialog* fd = new wxFileDialog(this,_T("Open file"),_T(""),
+                                       _T(""),std2wx(mFileNameFilter),
+                                       wxFD_OPEN | wxFD_FILE_MUST_EXIST );
+#endif
     int result_fd = fd->ShowModal();
 
        // This line is need it by windows //EED
index 4757485e021b57407f02fbbbf0b32b1fef04b41b..c216cdd5c60d641b86a9b107f2fc83fbfd8dadb6 100644 (file)
@@ -80,11 +80,21 @@ namespace bbwx
     long style;
     if (bbGetInputOpenSave()=="Save") 
       {
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
        style = wxSAVE | wxOVERWRITE_PROMPT;
-      }
-    else 
-      {
+#else
+       style = wxFD_SAVE | wxFD_OVERWRITE_PROMPT;
+#endif
+      }  else  {
+
+//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0
+#if wxMAJOR_VERSION <= 2
        style = wxOPEN | wxFILE_MUST_EXIST;
+#else
+       style = wxFD_OPEN | wxFD_FILE_MUST_EXIST;
+#endif
+
       }
     
     std::string wc(bbGetInputWildcard());
index 23cd7d2dbec6325ecb4ac5c00f41952025a20bc0..26c2d367fa2ee10b7f67bd0d742a645799aa311c 100644 (file)
@@ -89,7 +89,7 @@ namespace bbwxvtk
 
     vtkImageData                               *backImageData;
     vtkImageData                               *mDefaultImage;
-    wxVTKRenderWindowInteractor *wxvtkrenderwindowinteractor;
+    crea::wxVTKRenderWindowInteractor *wxvtkrenderwindowinteractor;
     bool mUpdateCamera;
 
     vtkImplicitPlaneWidget * maPlane1, * maPlane2, * mbPlane1, * mbPlane2;
@@ -101,9 +101,8 @@ namespace bbwxvtk
     mFirstTime(true),
     mBox(box)
   {
-    wxPanel *panel     = this;
-
-    wxvtkrenderwindowinteractor = new wxVTKRenderWindowInteractor(panel,-1);
+    wxPanel *panel             = this;
+    wxvtkrenderwindowinteractor = new crea::wxVTKRenderWindowInteractor(panel,-1);
     wxvtkrenderwindowinteractor->UseCaptureMouseOn();  
 
 //EED 2017-01-01 Migration VTK7
index 8400ae0fd23ba58368c5b810da4f5f5f8683bcd6..2acb2834fdf428aa472ce139c5c7d49a61a38dda 100644 (file)
@@ -60,6 +60,8 @@
 
 #include "bbtkWxBlackBox.h"
 
+#include "creawxVTKRenderWindowInteractor.h"
+
 namespace bbwxvtk
 {
   //------------------------------------------------------------------------
index 1d5fd58d97ee02fb2dcc677fd9e62856cfd9c10b..c0ece1383b554253a3c4b40e91a120a13ee097b1 100644 (file)
@@ -62,7 +62,7 @@ namespace bbwxvtk
   {
     wxPanel *panel = this;
 
-    wxvtkrenderwindowinteractor = new wxVTKRenderWindowInteractor(panel,-1);
+    wxvtkrenderwindowinteractor = new crea::wxVTKRenderWindowInteractor(panel,-1);
     wxvtkrenderwindowinteractor->UseCaptureMouseOn();
 
    renderer     = vtkRenderer::New();
@@ -144,7 +144,7 @@ namespace bbwxvtk
   //-------------------------------------------------------------------------
 
   //-------------------------------------------------------------------------
-  wxVTKRenderWindowInteractor * Viewer3DWidget::GetInteractor()
+  crea::wxVTKRenderWindowInteractor * Viewer3DWidget::GetInteractor()
   {
     return wxvtkrenderwindowinteractor;
   }
index 25dc71231fad950babc9d346cc61ea3f70c08de9..d353d59f1f71cdf53cab8cc60796e59401451657 100644 (file)
@@ -61,7 +61,7 @@
 #include <vtkInteractorStyleTrackballCamera.h>
 
 #include "bbtkWxBlackBox.h"
-#include "wxVTKRenderWindowInteractor.h"
+#include "creawxVTKRenderWindowInteractor.h"
 
 
 
@@ -78,15 +78,15 @@ namespace bbwxvtk
 
     void Update();
     vtkRenderer *GetRenderer();
-    wxVTKRenderWindowInteractor * GetInteractor();
+    crea::wxVTKRenderWindowInteractor * GetInteractor();
     virtual void Refresh(bool eraseBackground = true, const wxRect* rect = NULL);
 
   private:
-    Viewer3D*            mBox;
-    vtkRenderer                  *renderer;
-    vtkRenderWindow              *renderwindow;
-    vtkInteractorStyleTrackballCamera *interactorstyle;
-    wxVTKRenderWindowInteractor  *wxvtkrenderwindowinteractor;
+    Viewer3D                                                   *mBox;
+    vtkRenderer                                *renderer;
+    vtkRenderWindow                            *renderwindow;
+    vtkInteractorStyleTrackballCamera  *interactorstyle;
+    crea::wxVTKRenderWindowInteractor          *wxvtkrenderwindowinteractor;
   };
   
   //------------------------------------------------------------------------
@@ -109,7 +109,7 @@ namespace bbwxvtk
     BBTK_DECLARE_INPUT(Stereo, bool);
     BBTK_DECLARE_INPUT(BackgroundColor,std::vector<double>);
     BBTK_DECLARE_OUTPUT(Renderer,vtkRenderer*);
-    BBTK_DECLARE_OUTPUT(Interactor,wxVTKRenderWindowInteractor*);
+    BBTK_DECLARE_OUTPUT(Interactor,crea::wxVTKRenderWindowInteractor*);
     BBTK_PROCESS(Process);
     BBTK_CREATE_WIDGET(CreateWidget);
     BBTK_ON_SHOW_WIDGET(OnShowWidget);
@@ -144,7 +144,7 @@ namespace bbwxvtk
   BBTK_INPUT(Viewer3D,Obs5,"Input observer",vtkInteractorObserver *,"");
   BBTK_INPUT(Viewer3D,Stereo,"Stereo with Red-Blue filter.  False/True  (default False)",bool,"");
   BBTK_OUTPUT(Viewer3D,Renderer,"Renderer to which actors can be added.",vtkRenderer*,"");
-  BBTK_OUTPUT(Viewer3D,Interactor,"Interactor with which vtk widgets can interact",wxVTKRenderWindowInteractor*,"");
+  BBTK_OUTPUT(Viewer3D,Interactor,"Interactor with which vtk widgets can interact",crea::wxVTKRenderWindowInteractor*,"");
   BBTK_END_DESCRIBE_BLACK_BOX(Viewer3D);
   //=================================================================
 
index 36d16a9aa51c50f599eec773cf74f9a5e5e6f17c..2c206a0a4c3177847e152c82d3ed593538405da3 100644 (file)
@@ -28,7 +28,7 @@
 #ifdef _USE_VTK_
 
 #include "bbstdCast.h"
-#include "wxVTKRenderWindowInteractor.h"
+#include "creawxVTKRenderWindowInteractor.h"
 #include "bbwxvtkPackage.h"
 
 
@@ -48,7 +48,7 @@ namespace bbwxvtk
 {
   //====================================================================
   // Add the specialized adaptors to the package
-  typedef wxVTKRenderWindowInteractor* I;
+  typedef crea::wxVTKRenderWindowInteractor* I;
   typedef vtkRenderWindowInteractor* O;
 
   BBTK_ADD_TEMPLATE2_BLACK_BOX_TO_PACKAGE(wxvtk,Cast,I,O);
diff --git a/packages/wxvtk/src/wxVTKRenderWindowInteractor.cxx b/packages/wxvtk/src/wxVTKRenderWindowInteractor.cxx
deleted file mode 100644 (file)
index 2e58ec6..0000000
+++ /dev/null
@@ -1,827 +0,0 @@
-/*
- # ---------------------------------------------------------------------
- #
- # 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: 2012/11/16 08:52:36 $
-  Version:   $Revision: 1.5 $
-
-=========================================================================*/
-
-#include <assert.h>
-
-#include "wxVTKRenderWindowInteractor.h"
-
-//This is needed for vtk 3.1 :
-#ifndef VTK_MAJOR_VERSION
-#  include "vtkVersion.h"
-#endif
-
-#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
-#if (!wxCHECK_VERSION(2, 4, 0))
-wxWindow* wxGetTopLevelParent(wxWindow *win)
-{
-    while ( win && !win->IsTopLevel() )
-         win = win->GetParent();
-    return win;
-}
-#endif
-}
-// LG : EO namespace bbwxvtk
-//=======================================================================
-
-// To access objc calls on cocoa
-#ifdef __WXCOCOA__
-#ifdef VTK_USE_COCOA
-#import <Cocoa/Cocoa.h>
-// This trick is no longer need in VTK CVS, should get rid of that:
-#define id Id
-#else
-#error Build mismatch you need both wxWidgets and VTK to be configure against Cocoa to work
-#endif //VTK_USE_COCOA
-#endif //__WXCOCOA__
-
-#ifdef __WXGTK__
-#    include <gdk/gdkx.h> // GDK_WINDOW_XWINDOW is found here in wxWidgets 2.8.0
-#    include "gdk/gdkprivate.h"
-#if wxCHECK_VERSION(2, 8, 0)
-#ifdef __WXGTK20__
-#include <wx/gtk/win_gtk.h>
-#else
-#include <wx/gtk1/win_gtk.h>
-#endif
-#else
-#include <wx/gtk/win_gtk.h>
-#endif
-#define GetXWindow(wxwin) (wxwin)->m_wxwindow ? \
-                          GDK_WINDOW_XWINDOW(GTK_PIZZA((wxwin)->m_wxwindow)->bin_window) : \
-                          GDK_WINDOW_XWINDOW((wxwin)->m_widget->window)
-#endif
-
-#ifdef __WXX11__
-#include "wx/x11/privx.h"
-#define GetXWindow(wxwin)   ((Window)(wxwin)->GetHandle())
-#endif
-
-
-//For more info on this class please go to:
-//http://wxvtk.sf.net
-//This hack is for some buggy wxGTK version:
-#if wxCHECK_VERSION(2, 3, 2) && !wxCHECK_VERSION(2, 4, 1) && defined(__WXGTK__)
-#  define WX_USE_X_CAPTURE 0
-#else
-#  define WX_USE_X_CAPTURE 1
-#endif
-
-#define ID_wxVTKRenderWindowInteractor_TIMER 1001
-
-//=======================================================================
-// LG : NAMESPACE IS NECESSARY TO AVOID CONFLICTING SYMBOLS IN DYN LIBS
-namespace bbwxvtk
-{
-
-#if defined(__WXGTK__) && defined(USE_WXGLCANVAS)
-IMPLEMENT_DYNAMIC_CLASS(wxVTKRenderWindowInteractor, wxGLCanvas)
-#else
-IMPLEMENT_DYNAMIC_CLASS(wxVTKRenderWindowInteractor, wxWindow)
-#endif  //__WXGTK__
-
-//---------------------------------------------------------------------------
-#if defined(__WXGTK__) && defined(USE_WXGLCANVAS)
-BEGIN_EVENT_TABLE(wxVTKRenderWindowInteractor, wxGLCanvas)
-#else
-BEGIN_EVENT_TABLE(wxVTKRenderWindowInteractor, wxWindow)
-#endif //__WXGTK__
-  //refresh window by doing a Render
-  EVT_PAINT       (wxVTKRenderWindowInteractor::OnPaint)
-  EVT_ERASE_BACKGROUND(wxVTKRenderWindowInteractor::OnEraseBackground)
-  EVT_MOTION      (wxVTKRenderWindowInteractor::OnMotion)
-
-  //Bind the events to the event converters
-  EVT_LEFT_DOWN   (wxVTKRenderWindowInteractor::OnButtonDown)
-  EVT_MIDDLE_DOWN (wxVTKRenderWindowInteractor::OnButtonDown)
-  EVT_RIGHT_DOWN  (wxVTKRenderWindowInteractor::OnButtonDown)
-  EVT_LEFT_UP     (wxVTKRenderWindowInteractor::OnButtonUp)
-  EVT_MIDDLE_UP   (wxVTKRenderWindowInteractor::OnButtonUp)
-  EVT_RIGHT_UP    (wxVTKRenderWindowInteractor::OnButtonUp)
-#if !(VTK_MAJOR_VERSION == 3 && VTK_MINOR_VERSION == 1)
-  EVT_ENTER_WINDOW(wxVTKRenderWindowInteractor::OnEnter)
-  EVT_LEAVE_WINDOW(wxVTKRenderWindowInteractor::OnLeave)
-  EVT_MOUSEWHEEL  (wxVTKRenderWindowInteractor::OnMouseWheel)
-  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)
-#if (wxCHECK_VERSION(2, 8, 0))
-wxVTKRenderWindowInteractor::wxVTKRenderWindowInteractor() : wxGLCanvas(0, -1, wxDefaultPosition), vtkRenderWindowInteractor()
-#else
-wxVTKRenderWindowInteractor::wxVTKRenderWindowInteractor() : wxGLCanvas(), vtkRenderWindowInteractor()
-#endif
-#else
-wxVTKRenderWindowInteractor::wxVTKRenderWindowInteractor() : wxWindow(), vtkRenderWindowInteractor()
-#endif //__WXGTK__
-      , timer(this, ID_wxVTKRenderWindowInteractor_TIMER)
-      , ActiveButton(wxEVT_NULL)
-      , RenderAllowed(0)
-      , Stereo(0)
-      , Handle(0)
-      , Created(true)
-      , RenderWhenDisabled(1)
-      , UseCaptureMouse(0)
-{
-#ifdef VTK_DEBUG_LEAKS
-  vtkDebugLeaks::ConstructClass("wxVTKRenderWindowInteractor");
-#endif
-
-  this->RenderWindow = NULL;
-  this->SetRenderWindow(vtkRenderWindow::New());
-  this->RenderWindow->Delete();
-  this->SetBackgroundStyle( wxBG_STYLE_COLOUR );
-  this->SetBackgroundColour( wxColor(0,0,0,0) );
-}
-//---------------------------------------------------------------------------
-wxVTKRenderWindowInteractor::wxVTKRenderWindowInteractor(wxWindow *parent,
-                                                         wxWindowID id,
-                                                         const wxPoint &pos,
-                                                         const wxSize &size,
-                                                         long style,
-                                                         const wxString &name)
-#if defined(__WXGTK__) && defined(USE_WXGLCANVAS)
-      : wxGLCanvas(parent, id, pos, size, style, name), vtkRenderWindowInteractor()
-#else
-      : wxWindow(parent, id, pos, size, style, name), vtkRenderWindowInteractor()
-#endif //__WXGTK__
-      , timer(this, ID_wxVTKRenderWindowInteractor_TIMER)
-      , ActiveButton(wxEVT_NULL)
-      , RenderAllowed(0)
-      , Stereo(0)
-      , Handle(0)
-      , Created(true)
-      , RenderWhenDisabled(1)
-      , UseCaptureMouse(0)
-{
-#ifdef VTK_DEBUG_LEAKS
-  vtkDebugLeaks::ConstructClass("wxVTKRenderWindowInteractor");
-#endif
-  this->RenderWindow = NULL;
-  this->SetRenderWindow(vtkRenderWindow::New());
-  this->RenderWindow->Delete();
-#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()
-{
-  SetRenderWindow(NULL);
-  SetInteractorStyle(NULL);
-}
-//---------------------------------------------------------------------------
-wxVTKRenderWindowInteractor * wxVTKRenderWindowInteractor::New()
-{
-  // we don't make use of the objectfactory, because we're not registered
-  return new wxVTKRenderWindowInteractor;
-}
-//---------------------------------------------------------------------------
-void wxVTKRenderWindowInteractor::Initialize()
-{
-  int *size = RenderWindow->GetSize();
-  // enable everything and start rendering
-  Enable();
-  //RenderWindow->Start();
-
-  // set the size in the render window interactor
-  Size[0] = size[0];
-  Size[1] = size[1];
-
-  // this is initialized
-  Initialized = 1;
-}
-//---------------------------------------------------------------------------
-void wxVTKRenderWindowInteractor::Enable()
-{
-  // if already enabled then done
-  if (Enabled)
-    return;
-
-  // that's it
-  Enabled = 1;
-#if defined(__WXGTK__) && defined(USE_WXGLCANVAS)
-  SetCurrent();
-#endif
-  Modified();
-}
-//---------------------------------------------------------------------------
-bool wxVTKRenderWindowInteractor::Enable(bool enable)
-{
-#if defined(__WXGTK__) && defined(USE_WXGLCANVAS)
-  return wxGLCanvas::Enable(enable);
-#else
-  return wxWindow::Enable(enable);
-#endif
-}
-//---------------------------------------------------------------------------
-void wxVTKRenderWindowInteractor::Disable()
-{
-  // if already disabled then done
-  if (!Enabled)
-    return;
-
-  // that's it (we can't remove the event handler like it should be...)
-  Enabled = 0;
-  Modified();
-}
-//---------------------------------------------------------------------------
-void wxVTKRenderWindowInteractor::Start()
-{
-  // the interactor cannot control the event loop
-  vtkErrorMacro( << "wxVTKRenderWindowInteractor::Start() "
-    "interactor cannot control event loop.");
-}
-//---------------------------------------------------------------------------
-void wxVTKRenderWindowInteractor::UpdateSize(int x, int y)
-{
-  if( RenderWindow )
-  {
-    // if the size changed tell render window
-    if ( x != Size[0] || y != Size[1] )
-    {
-      // adjust our (vtkRenderWindowInteractor size)
-      Size[0] = x;
-      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);
-       }
-
-  return 1;
-  
-}
-//---------------------------------------------------------------------------
-int wxVTKRenderWindowInteractor::DestroyTimer()
-{
-  // do nothing
-  return 1;
-}
-//---------------------------------------------------------------------------
-void wxVTKRenderWindowInteractor::OnTimer(wxTimerEvent& WXUNUSED(event))
-{
-       if (!Enabled)
-       {
-           return;
-    }
-
-#if VTK_MAJOR_VERSION > 4 || (VTK_MAJOR_VERSION == 4 && VTK_MINOR_VERSION > 0)
-    // new style
-    InvokeEvent(vtkCommand::TimerEvent, NULL);
-#else
-    // old style
-    InteractorStyle->OnTimer();
-#endif
-}
-
-//---------------------------------------------------------------------------
-// NOTE on implementation:
-// Bad luck you ended up in the only tricky place of this code.
-// A few note, wxWidgets still refuse to provide such convenient method
-// so I have to maintain it myself, eventhough this is completely integrated
-// in wxPython...
-// Anyway if this happen to break for you then compare to a recent version of wxPython
-// and look for the function long wxPyGetWinHandle(wxWindow* win)
-// in wxPython/src/helpers.cpp
-long wxVTKRenderWindowInteractor::GetHandleHack()
-{
-  //helper function to hide the MSW vs GTK stuff
-  long handle_tmp = 0;
-
-// __WXMSW__ is for Win32
-//__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();
-#endif //__WXMSW__
-
-//__WXCOCOA__ stands for using the objective-c Cocoa API
-#ifdef __WXCOCOA__
-   // Here is how to find the NSWindow
-   wxTopLevelWindow* toplevel = dynamic_cast<wxTopLevelWindow*>(
-     wxGetTopLevelParent( this ) );
-   if (toplevel != NULL )    
-   {
-     handle_tmp = (long)toplevel->GetNSWindow();
-   }
-   // The NSView will be deducted from 
-   // [(NSWindow*)Handle contentView]
-   // if only I knew how to write that in c++
-#endif //__WXCOCOA__
-
-    // Find and return the actual X-Window.
-#if defined(__WXGTK__) || defined(__WXX11__)
-    return (long)GetXWindow(this);
-#endif
-
-//#ifdef __WXMOTIF__
-//    handle_tmp = (long)this->GetXWindow();
-//#endif
-
-  return handle_tmp;
-}
-//---------------------------------------------------------------------------
-void wxVTKRenderWindowInteractor::OnPaint(wxPaintEvent& WXUNUSED(event))
-{
-  //must always be here
-  wxPaintDC pDC(this);
-
-  //do it here rather than in the cstor: this is safer.
-  if(!Handle)
-  {
-    Handle = GetHandleHack();
-    RenderWindow->SetWindowId(reinterpret_cast<void *>(Handle));
-#ifdef __WXMSW__
-    RenderWindow->SetParentId(reinterpret_cast<void *>(this->GetParent()->GetHWND()));
-#endif //__WXMSW__
-  }
-  // get vtk to render to the wxWindows
-  Render();
-#ifdef __WXMAC__
-  // This solves a problem with repainting after a window resize
-  // See also: http://sourceforge.net/mailarchive/forum.php?thread_id=31690967&forum_id=41789
-  vtkCarbonRenderWindow* rwin = vtkCarbonRenderWindow::SafeDownCast(RenderWindow);
-  if( rwin )
-  {
-    rwin->UpdateGLRegion();
-  }
-#endif
-
-}
-//---------------------------------------------------------------------------
-void wxVTKRenderWindowInteractor::OnEraseBackground(wxEraseEvent &event)
-{
-  //turn off background erase to reduce flickering on MSW
-  event.Skip(false);
-}
-//---------------------------------------------------------------------------
-void wxVTKRenderWindowInteractor::OnSize(wxSizeEvent& WXUNUSED(event))
-{
-  int w, h;
-  GetClientSize(&w, &h);
-  UpdateSize(w, h);
-
-  if (!Enabled) 
-    {
-    return;
-    }
-
-#if VTK_MAJOR_VERSION > 4 || (VTK_MAJOR_VERSION == 4 && VTK_MINOR_VERSION > 0)
-  InvokeEvent(vtkCommand::ConfigureEvent, NULL);
-#endif
-  //this will check for Handle
-  //Render();
-}
-//---------------------------------------------------------------------------
-void wxVTKRenderWindowInteractor::OnMotion(wxMouseEvent &event)
-{
-       this->Render();
-
-       if (!Enabled) 
-    {
-       return;
-    }
-#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);
-#endif
-}
-//---------------------------------------------------------------------------
-#if !(VTK_MAJOR_VERSION == 3 && VTK_MINOR_VERSION == 1)
-void wxVTKRenderWindowInteractor::OnEnter(wxMouseEvent &event)
-{
-  if (!Enabled) 
-    {
-    return;
-    }
-
-#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);
-  InvokeEvent(vtkCommand::EnterEvent, NULL);
-#else
-    // old style
-  InteractorStyle->OnEnter(event.ControlDown(), event.ShiftDown(), event.GetX(), Size[1] - event.GetY() - 1);  
-#endif
-}
-//---------------------------------------------------------------------------
-void wxVTKRenderWindowInteractor::OnLeave(wxMouseEvent &event)
-{
-  if (!Enabled) 
-    {
-    return;
-    }
-
-#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);
-
-  InvokeEvent(vtkCommand::LeaveEvent, NULL);
-#else
-    // old style
-  InteractorStyle->OnLeave(event.ControlDown(), event.ShiftDown(),
-      event.GetX(), Size[1] - event.GetY() - 1);  
-#endif
-}
-//---------------------------------------------------------------------------
-void wxVTKRenderWindowInteractor::OnKeyDown(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::KeyPressEvent, NULL);
-#else
-  InteractorStyle->OnKeyDown(event.ControlDown(), event.ShiftDown(), 
-    event.GetKeyCode(), 1);
-#endif
-  event.Skip();
-}
-//---------------------------------------------------------------------------
-void wxVTKRenderWindowInteractor::OnKeyUp(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::KeyReleaseEvent, NULL);
-#else
-  InteractorStyle->OnKeyUp(event.ControlDown(), event.ShiftDown(), 
-    event.GetKeyCode(), 1);
-#endif
-  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)
-{
-  if (!Enabled || (ActiveButton != wxEVT_NULL))
-    {
-    return;
-    }
-  ActiveButton = event.GetEventType();
-
-    // 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 > 4 || (VTK_MAJOR_VERSION == 4 && VTK_MINOR_VERSION > 0)
-    // new style
-    InvokeEvent(vtkCommand::RightButtonPressEvent, NULL);
-#else            
-    // old style
-    InteractorStyle->OnRightButtonDown(event.ControlDown(), event.ShiftDown(),
-      event.GetX(), Size[1] - event.GetY() - 1);
-#endif
-  }
-  else if(event.LeftDown())
-  {
-#if VTK_MAJOR_VERSION > 4 || (VTK_MAJOR_VERSION == 4 && VTK_MINOR_VERSION > 0)
-    // new style
-    InvokeEvent(vtkCommand::LeftButtonPressEvent, NULL);
-#else            
-    // old style
-    InteractorStyle->OnLeftButtonDown(event.ControlDown(),  event.ShiftDown(),
-      event.GetX(), Size[1] - event.GetY() - 1);
-#endif
-  }
-  else if(event.MiddleDown())
-  {
-#if VTK_MAJOR_VERSION > 4 || (VTK_MAJOR_VERSION == 4 && VTK_MINOR_VERSION > 0)
-    // new style
-    InvokeEvent(vtkCommand::MiddleButtonPressEvent, NULL);
-#else            
-    // old style
-    InteractorStyle->OnMiddleButtonDown(event.ControlDown(), event.ShiftDown(),
-      event.GetX(), Size[1] - event.GetY() - 1);
-#endif
-  }
-  //save the button and capture mouse until the button is released
-  //Only if :
-  //1. it is possible (WX_USE_X_CAPTURE)
-  //2. user decided to.
-  if ((ActiveButton != wxEVT_NULL) && WX_USE_X_CAPTURE && UseCaptureMouse)
-  {
-    CaptureMouse();
-  }
-}
-//---------------------------------------------------------------------------
-void wxVTKRenderWindowInteractor::OnButtonUp(wxMouseEvent &event)
-{
-  //EVT_xxx_DOWN == EVT_xxx_UP - 1
-  //This is only needed if two mouse buttons are pressed at the same time.
-  //In wxWindows 2.4 and later: better use of wxMOUSE_BTN_RIGHT or 
-  //wxEVT_COMMAND_RIGHT_CLICK
-  if (!Enabled || (ActiveButton != (event.GetEventType()-1))) 
-    {
-    return;
-    }
-
-#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 > 4 || (VTK_MAJOR_VERSION == 4 && VTK_MINOR_VERSION > 0)
-    // new style
-    InvokeEvent(vtkCommand::RightButtonReleaseEvent, NULL);
-#else            
-    // old style
-    InteractorStyle->OnRightButtonUp(event.ControlDown(), event.ShiftDown(),
-      event.GetX(), Size[1] - event.GetY() - 1);
-#endif
-  }
-  else if(ActiveButton == wxEVT_LEFT_DOWN)
-  {
-#if VTK_MAJOR_VERSION > 4 || (VTK_MAJOR_VERSION == 4 && VTK_MINOR_VERSION > 0)
-    // new style
-    InvokeEvent(vtkCommand::LeftButtonReleaseEvent, NULL);
-#else            
-    // old style
-    InteractorStyle->OnLeftButtonUp(event.ControlDown(), event.ShiftDown(),
-      event.GetX(), Size[1] - event.GetY() - 1);
-#endif
-  }
-  else if(ActiveButton == wxEVT_MIDDLE_DOWN)
-  {
-#if VTK_MAJOR_VERSION > 4 || (VTK_MAJOR_VERSION == 4 && VTK_MINOR_VERSION > 0)
-    // new style
-    InvokeEvent(vtkCommand::MiddleButtonReleaseEvent, NULL);
-#else            
-    // old style
-    InteractorStyle->OnMiddleButtonUp(event.ControlDown(), event.ShiftDown(),
-      event.GetX(), Size[1] - event.GetY() - 1);
-#endif
-  }
-  //if the ActiveButton is realeased, then release mouse capture
-  if ((ActiveButton != wxEVT_NULL) && WX_USE_X_CAPTURE && UseCaptureMouse)
-  {
-    ReleaseMouse();
-  }
-  ActiveButton = wxEVT_NULL;
-}
-//---------------------------------------------------------------------------
-void wxVTKRenderWindowInteractor::OnMouseWheel(wxMouseEvent& event)
-{
-// Mouse wheel was only added after VTK 4.4 (I think...)
-#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
-  SetEventInformationFlipY(event.GetWheelRotation() / event.GetWheelDelta(), 0, 
-                           event.ControlDown(), event.ShiftDown(), '\0', 0, NULL);
-  if(event.GetWheelRotation() > 0)
-    {
-      //Send event to VTK
-      InvokeEvent(vtkCommand::MouseWheelForwardEvent, NULL);
-    }
-  else
-    {
-      //Send event to VTK
-      InvokeEvent(vtkCommand::MouseWheelBackwardEvent, NULL);
-    }
-#endif
-    
-}
-
-//---------------------------------------------------------------------------
-void wxVTKRenderWindowInteractor::Render()
-{
-  RenderAllowed = 1;
-  if (!RenderWhenDisabled)
-    {
-    //the user doesn't want us to render when the toplevel frame
-    //is disabled - first find the top level parent
-    wxWindow *topParent = wxGetTopLevelParent(this);
-    if (topParent)
-      {
-      //if it exists, check whether it's enabled
-      //if it's not enabeld, RenderAllowed will be false
-      RenderAllowed = topParent->IsEnabled();
-      }
-    }
-
-  if (RenderAllowed)
-    {
-    if(Handle && (Handle == GetHandleHack()) )
-      {
-      RenderWindow->Render();
-      }
-#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
-      //new situation by doing the WindowRemap dance
-      //store the new situation
-      Handle = GetHandleHack();
-      RenderWindow->SetNextWindowId(reinterpret_cast<void *>(Handle));
-      RenderWindow->WindowRemap();
-      RenderWindow->Render();
-      }
-#endif
-    }
-}
-//---------------------------------------------------------------------------
-void wxVTKRenderWindowInteractor::SetRenderWhenDisabled(int newValue)
-{
-  //Change value of __RenderWhenDisabled ivar.
-  //If __RenderWhenDisabled is false (the default), this widget will not
-  //call Render() on the RenderWindow if the top level frame (i.e. the
-  //containing frame) has been disabled.
-
-  //This prevents recursive rendering during wxSafeYield() calls.
-  //wxSafeYield() can be called during the ProgressMethod() callback of
-  //a VTK object to have progress bars and other GUI elements updated -
-  //it does this by disabling all windows (disallowing user-input to
-  //prevent re-entrancy of code) and then handling all outstanding
-  //GUI events.
-        
-  //However, this often triggers an OnPaint() method for wxVTKRWIs,
-  //resulting in a Render(), resulting in Update() being called whilst
-  //still in progress.
-
-  RenderWhenDisabled = (bool)newValue;
-}
-//---------------------------------------------------------------------------
-//
-// Set the variable that indicates that we want a stereo capable window
-// be created. This method can only be called before a window is realized.
-//
-void wxVTKRenderWindowInteractor::SetStereo(int capable)
-{
-  if (Stereo != capable)
-    {
-    Stereo = capable;
-    RenderWindow->StereoCapableWindowOn();
-    RenderWindow->SetStereoTypeToCrystalEyes();
-    Modified();
-    }
-}
-
-//---------------------------------------------------------------------------
-//
-//
-void wxVTKRenderWindowInteractor::PrintSelf(ostream& os, vtkIndent indent)
-{
-  this->Superclass::PrintSelf(os, indent);
-}
-
-
-}
-// LG : EO namespace bbwxvtk
-//=======================================================================
-
-
diff --git a/packages/wxvtk/src/wxVTKRenderWindowInteractor.h b/packages/wxvtk/src/wxVTKRenderWindowInteractor.h
deleted file mode 100644 (file)
index 2487c23..0000000
+++ /dev/null
@@ -1,210 +0,0 @@
-/*
- # ---------------------------------------------------------------------
- #
- # 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.h,v $
-  Language:  C++
-  Date:      $Date: 2012/11/16 08:52:36 $
-  Version:   $Revision: 1.4 $
-=========================================================================*/
-
-// .NAME  wxVTKRenderWindowInteractor - class to enable VTK to render to 
-// and interact with wxWindow.
-// .SECTION Description
-//  wxVTKRenderWindowInteractor provide a VTK widget for wxWindow. This class
-// was completely rewrote to have the 'Look & Feel' of the python version:
-// wxVTKRenderWindowInteractor.py
-// .SECTION Caveats 
-//  - There is a know bug that prevent this class to works for more info see 
-// WX_USE_X_CAPTURE. This bug only affect wxGTK from 2.3.2 to wxGTK 2.4.0.
-//  - Furthermore this class is tempated over either wxWindows or wxGLCanvas,
-// in wxWindows 2.3.1 and earlier, the wxGLCanvas had scroll bars, you can avoid
-// this effect by playing with WX_BASE_CLASS at your risk (you might end up with
-// lot of flickering.)
-//  - 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
-// wxVTKRenderWindowInteractor.py wxVTKRenderWindow.py
-
-#ifndef _wxVTKRenderWindowInteractor_h_
-#define _wxVTKRenderWindowInteractor_h_
-
-// For compilers that support precompilation, includes "wx/wx.h".
-#include "wx/wxprec.h"
-
-#ifdef __BORLANDC__
-#  pragma hdrstop
-#endif
-
-#ifndef WX_PRECOMP
-#include <wx/wx.h>
-#endif
-
-#include <wx/timer.h>
-#include <wx/dcclient.h>
-
-// vtk includes
-#include "vtkRenderWindowInteractor.h"
-#include "vtkRenderWindow.h"
-
-// 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
-#    include <wx/glcanvas.h>
-#  else
-#    error "problem of wxGLCanvas, you need to build wxWidgets with opengl"
-#  endif //wxUSE_GLCANVAS
-#endif //__WXGTK__
-
-// Motif version (renamed into wxX11 for wxWindow 2.4 and newer)
-#if defined(__WXMOTIF__) 
-# error This GUI is not supported by wxVTKRenderWindowInteractor for now
-#endif
-
-// wx forward declarations
-class wxPaintEvent;
-class wxMouseEvent;
-class wxTimerEvent;
-class wxKeyEvent;
-class wxSizeEvent;
-
-//=======================================================================
-// LG : NAMESPACE IS NECESSARY TO AVOID CONFLICTING SYMBOLS IN DYN LIBS
-namespace bbwxvtk
-{
-
-
-#if defined(__WXGTK__) && defined(USE_WXGLCANVAS)
-class wxVTKRenderWindowInteractor : public wxGLCanvas, public vtkRenderWindowInteractor
-#else
-class wxVTKRenderWindowInteractor : public wxWindow, public vtkRenderWindowInteractor
-#endif //__WXGTK__
-{
-  DECLARE_DYNAMIC_CLASS(wxVTKRenderWindowInteractor)
-  
-  public:
-    //constructors
-    wxVTKRenderWindowInteractor();
-
-    wxVTKRenderWindowInteractor(wxWindow *parent,
-                                wxWindowID id,
-                                const wxPoint &pos = wxDefaultPosition,
-                                const wxSize &size = wxDefaultSize,
-                                long style = wxWANTS_CHARS | wxNO_FULL_REPAINT_ON_RESIZE,
-                                const wxString &name = wxPanelNameStr);
-
-//EED 2017-01-01 Migration VTK7
-#if VTK_MAJOR_VERSION <= 5
-    vtkTypeRevisionMacro(wxVTKRenderWindowInteractor,vtkRenderWindowInteractor);
-#else
-    vtkTypeMacro(wxVTKRenderWindowInteractor,vtkRenderWindowInteractor);
-#endif
-
-    static wxVTKRenderWindowInteractor * New();
-    void PrintSelf(ostream& os, vtkIndent indent);
-
-         //destructor
-    ~wxVTKRenderWindowInteractor();
-
-    // vtkRenderWindowInteractor overrides
-    void Initialize();
-    void Enable();
-    bool Enable(bool enable);
-    void Disable();
-    void Start();
-    void UpdateSize(int x, int y);
-    int  CreateTimer(int timertype);
-    int  DestroyTimer();
-    void TerminateApp() {};
-
-    // event handlers
-    void OnPaint(wxPaintEvent &event);
-    void OnEraseBackground (wxEraseEvent& event);
-    void OnMotion(wxMouseEvent &event);
-
-    void OnButtonDown(wxMouseEvent &event);
-    void OnButtonUp(wxMouseEvent &event);
-#if !(VTK_MAJOR_VERSION == 3 && VTK_MINOR_VERSION == 1)
-    void OnEnter(wxMouseEvent &event);
-    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);
-    void OnMouseWheel(wxMouseEvent& event);
-
-    void Render();
-    void SetRenderWhenDisabled(int newValue);
-
-    // Description:
-    // Prescribe that the window be created in a stereo-capable mode. This
-    // method must be called before the window is realized. Default if off.
-    vtkGetMacro(Stereo,int);
-    vtkBooleanMacro(Stereo,int);
-    virtual void SetStereo(int capable);
-
-    // Description:
-    // As CaptureMouse could be a problem sometimes on a window box
-    // This method allow to set or not the CaptureMouse.
-    // This method actually will works only if WX_USE_X_CAPTURE was set to 1
-    vtkSetMacro(UseCaptureMouse,int);
-    vtkBooleanMacro(UseCaptureMouse,int);
-
-  protected:
-    wxTimer    timer;
-    int        ActiveButton;
-    int                RenderAllowed;
-    long       GetHandleHack();
-    int        Stereo;
-    
-  private:
-    long       Handle;
-    bool       Created;
-    int        RenderWhenDisabled;
-    int        UseCaptureMouse;
-
-    DECLARE_EVENT_TABLE()
-};
-
-} 
-// LG : EO namespace bbwxvtk
-//======================================================================
-
-#endif //_wxVTKRenderWindowInteractor_h_