]> Creatis software - crea.git/commitdiff
#3227 vtk8itk4wx3-mingw64 MACOS
authorEduardo DAVILA <davila@creatis.insa-lyon.fr>
Thu, 9 Sep 2021 10:53:42 +0000 (12:53 +0200)
committerEduardo DAVILA <davila@creatis.insa-lyon.fr>
Thu, 9 Sep 2021 10:53:42 +0000 (12:53 +0200)
cmake/CREAMacro_FindAndUseLibraries.cmake
cmake/CREAMacro_FindAndUseVTK.cmake
cmake/CREAMacro_FindAndUseWt.cmake
cmake/CREAMacro_FindAndUseWxWidgets.cmake
src/CMakeLists.txt
src/creaRTTI.cxx
src/creaVtk_MACROS.h
src/creawxVTKRenderWindowInteractor.mm

index eb8b24a4ecdcbf1e6fc3ad4dd90ed4860777e18e..e5e57ba93b3db58324832d9bf98865e306f9fa07 100644 (file)
@@ -96,6 +96,7 @@ ENDIF(USE_KWWIDGETS)
 #
 
 #-----------------------------------------------------------------------------
+
 IF(USE_ITK)
   IF(NOT ITK_FOUND)
     # Search ITK
@@ -110,14 +111,12 @@ IF(USE_ITK)
       INCLUDE(${ITK_USE_FILE})
       CREA_DEFINE( USE_ITK )
       CREA_DEFINE( _USE_ITK_ )
-         If (${ITK_VERSION_MAJOR} MATCHES "4")
-          MESSAGE ( STATUS "* Version = ${ITK_VERSION_MAJOR}.${ITK_VERSION_MINOR}.${ITK_VERSION_PATCH}")
-               SET(ITK_LIBRARIES
-               ${ITK_LIBRARIES}) 
-                MESSAGE ( STATUS "${ITK_LIBRARIES}")
+               If (${ITK_VERSION_MAJOR} MATCHES "4"  OR  ${ITK_VERSION_MAJOR} MATCHES "5"  )
+                       MESSAGE ( STATUS "* Version = ${ITK_VERSION_MAJOR}.${ITK_VERSION_MINOR}.${ITK_VERSION_PATCH}")
+                       SET(ITK_LIBRARIES ${ITK_LIBRARIES}) 
+                       MESSAGE ( STATUS "${ITK_LIBRARIES}")
                ELSEIF()
-               SET(ITK_LIBRARIES
-                       ITKCommon ITKIO ITKBasicFilters ITKAlgorithms)
+                       SET(ITK_LIBRARIES ITKCommon ITKIO ITKBasicFilters ITKAlgorithms)
                ENDIF()
       MARK_AS_ADVANCED(ITK_DIR)
     ELSE(ITK_FOUND)
@@ -328,10 +327,15 @@ IF(USE_BOOST)
        add_definitions( -DBOOST_ALL_NO_LIB )
        add_definitions( -DBOOST_ALL_DYN_LINK )
        IF (MINGW)
-               FIND_PACKAGE(Boost COMPONENTS filesystem-mgw71 system-mgw71 signals-mgw71 date_time-mgw71 thread-mgw71 regex-mgw71 program_options-mgw71 REQUIRED)
+               IF(APPLE)
+                       FIND_PACKAGE(Boost COMPONENTS filesystem-mgw71 system-mgw71 signals-mgw71 date_time-mgw71 thread-mgw71 regex-mgw71 program_options-mgw71 REQUIRED)
+               ELSE(APPLE)
+                       set( Boost_INCLUDE_DIR $ENV{BOOST_ROOT}/include/boost-1_69)
+                       FIND_PACKAGE(Boost COMPONENTS filesystem-mgw73-mt-x64-1_69  system-mgw73-mt-x64-1_69  date_time-mgw73-mt-x64-1_69 thread-mgw73-mt-x64-1_69 regex-mgw73-mt-x64-1_69 program_options-mgw73-mt-x64-1_69  REQUIRED)
+               ENDIF(APPLE)
        ELSE (MINGW)
 #              FIND_PACKAGE(Boost COMPONENTS filesystem system signals date_time thread regex program_options REQUIRED)
-           FIND_PACKAGE(Boost COMPONENTS filesystem system  date_time thread regex program_options REQUIRED)
+               FIND_PACKAGE(Boost COMPONENTS filesystem system  date_time thread regex program_options REQUIRED)
        ENDIF(MINGW)
     IF(Boost_FOUND) 
          ADD_DEFINITIONS(-DBOOST_FILESYSTEM_VERSION=3)
@@ -416,11 +420,21 @@ IF(USE_XERCES)
                  
                ENDIF(NOT XERCES_LIB_DIR)       
                
-               IF(USE_DEBUG_LIB)
-                       set(XERCES_LIBRARIES  xerces-c_3D)
-               ELSE(USE_DEBUG_LIB)
-                       set(XERCES_LIBRARIES  xerces-c_3)
-               ENDIF(USE_DEBUG_LIB)
+               IF(APPLE)
+                       IF(USE_DEBUG_LIB)
+                               set(XERCES_LIBRARIES  xerces-c_3D)
+                       ELSE(USE_DEBUG_LIB)
+                               set(XERCES_LIBRARIES  xerces-c_3)
+                       ENDIF(USE_DEBUG_LIB)
+               ELSEIF(APPLE)
+                       IF(USE_DEBUG_LIB)
+                               #EED 2019-07-03                 set(XERCES_LIBRARIES  xerces-c_3D)
+                               set(XERCES_LIBRARIES  xerces-c)
+                       ELSE(USE_DEBUG_LIB)
+                               #EED 2019-07-03                 set(XERCES_LIBRARIES  xerces-c_3)
+                               set(XERCES_LIBRARIES  xerces-c)
+                       ENDIF(USE_DEBUG_LIB)
+               ENDIF(APPLE)
                
                MARK_AS_ADVANCED(XERCES_LIB_DIR)
        ENDIF(WIN32)
index 2b889d9cfd63c914a66a441d80f2e1df91122175..7d1518c6d9573de59218aedc012cfdefe953834b 100644 (file)
@@ -38,8 +38,6 @@ MACRO(CREA_FIND_AND_USE_VTK)
       MESSAGE ( STATUS "Looking for VTK... found")
       MESSAGE ( STATUS "* Dir     = ${VTK_DIR}")
       MESSAGE ( STATUS "* Version = ${VTK_MAJOR_VERSION}.${VTK_MINOR_VERSION}.${VTK_BUILD_VERSION}")
-
-
       SET(VTK_BUILD_SETTINGS_FILE OFF)      
        INCLUDE(${VTK_USE_FILE})
        LINK_DIRECTORIES(${VTK_DIR}) #DFCH -- 16/7/2012
@@ -53,6 +51,8 @@ MACRO(CREA_FIND_AND_USE_VTK)
                #MESSAGE("${GTK2_INCLUDE_DIRS}")
                INCLUDE_DIRECTORIES(${GTK2_INCLUDE_DIRS})
                LINK_LIBRARIES(${GTK2_LIBRARIES})
+message("EED CREAMacro_FindAndUseVTK.cmake  GTK2_INCLUDE_DIRS "${GTK2_INCLUDE_DIRS} )
+message("EED CREAMacro_FindAndUseVTK.cmake  GTK2_VERSION "${GTK2_VERSION} )
                # Can I require all my user to have the gl lib on linux, even if they do not really need it...
                SET(WXGLCANVASLIBS "gl")
        ENDIF(VTK_USE_GL2PS)  
@@ -63,14 +63,14 @@ MACRO(CREA_FIND_AND_USE_VTK)
 ##EED 2017-01-01 Migration VTK7
 IF("${VTK_MAJOR_VERSION}" LESS 6)
        SET(VTK_LIBRARIES
-               vtkCommon                       # Mandatory
-               vtkFiltering                                    # vtkImageData
-               vtkRendering                            # vtkProp3D
-               vtkWidgets                              # vtkImagePlaneWidget
-               vtkIO                                           # vtkMetaImageReader/Writer
-               vtkImaging                              # filters such as vtkImageAnisotropicDiffusion3D
-               vtkGraphics                             # vtkContourFilter, sources
-               vtkVolumeRendering      # Mappers 
+               vtkCommon     # Mandatory
+               vtkFiltering  # vtkImageData
+               vtkRendering  # vtkProp3D
+               vtkWidgets    # vtkImagePlaneWidget
+               vtkIO         # vtkMetaImageReader/Writer
+               vtkImaging    # filters such as vtkImageAnisotropicDiffusion3D
+               vtkGraphics   # vtkContourFilter, sources
+               vtkVolumeRendering # Mappers 
                vtkGenericFiltering
                vtkHybrid
 #              vtkInfovis
@@ -213,7 +213,9 @@ ENDIF("${VTK_MAJOR_VERSION}" LESS 6)
 #          vtkViewsQt
 #          vtkNetCDF_cxx       
                )
-       ENDIF(WIN32)    
+       ENDIF(WIN32)
+       
+       
 # ENDIF("${VTK_MAJOR_VERSION}" GREATER 5)
 
 
index 41ffd7bc61b339c075da35dc5fafa30a522a3705..ce3fddd3cb147725f3179d0c69ec8f29ad627760 100644 (file)
@@ -2,10 +2,18 @@ MACRO(CREA_FINDANDUSEWT)
 
         
        SET (WT_CONNECTOR "wthttp" CACHE STRING "Connector used (wthttp or wtfcgi)")
-       SET(WT_LIBRARIES wt wtfcgi wtext)
+
+#EED2019-08-20
+#      SET(WT_LIBRARIES wt wtfcgi wtext)
+       SET(WT_LIBRARIES wt wtfcgi )
+
 #      SET(WT_LIBRARIES wt wthttp wtext)
        INCLUDE_DIRECTORIES($ENV{WT_DIR}/../../include)
-       LINK_DIRECTORIES($ENV{WT_DIR}/../../lib/wt-3.3.4)
+
+#EED2019-08-20
+#      LINK_DIRECTORIES($ENV{WT_DIR}/../../lib/wt-3.3.4)
+       LINK_DIRECTORIES($ENV{WT_DIR}/../../lib/wt-4.0.4-rc1)
+
 
        CREA_DEFINE( USE_WT)
        CREA_DEFINE( _USE_WT_ )
index 3d45b7854ca3bc16566ef40525ccb510fcd373cd..8acd436ff52be7cb7f42e381012fc986608ad614 100644 (file)
@@ -1,7 +1,7 @@
 # ---------------------------------------------------------------------
 #
 # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image 
-#                        pour la Santé©
+#                        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
@@ -60,35 +60,33 @@ MACRO(CREA_FIND_WXWIDGETS)
 ##2018-08-28     
  if(APPLE)
     message("EED CREAMacro_FindAndUseWxWidgets APPLE.  forsing wxWidgets_CONFIG_EXECUTABLE.   wxWidgets_wxrc_EXECUTABLE ")
-       #set(wxWidgets_CONFIGURATION mswu)
-    #set(wxWidgets_USE_LIBS)
-    SET(wxWidgets_CONFIG_EXECUTABLE  /opt/local/Library/Frameworks/wxWidgets.framework/Versions/wxWidgets/3.0/bin/wx-config CACHE STRING wxWidgets_CONFIG_EXECUTABLE FORCE)
+  SET(wxWidgets_CONFIG_EXECUTABLE  /opt/local/Library/Frameworks/wxWidgets.framework/Versions/wxWidgets/3.0/bin/wx-config CACHE STRING wxWidgets_CONFIG_EXECUTABLE FORCE)
        SET(wxWidgets_wxrc_EXECUTABLE   /opt/local/Library/Frameworks/wxWidgets.framework/Versions/wxWidgets/3.0/bin/wxrc-3.0 CACHE STRING wxWidgets_wxrc_EXECUTABLE FORCE)
- elseif(UNIX)
+ elseif(APPLE)
            message("EED CREAMacro_FindAndUseWxWidgets UNIX")
                #MESSAGE ( "===============Manual wx-config 2 EED =======================")
                #SET(wxWidgets_CONFIG_EXECUTABLE /usr/bin/wx-config-2.0 CACHE STRING wxWidgets_CONFIG_EXECUTABLE FORCE)
                #SET(wxWidgets_wxrc_EXECUTABLE /usr/bin/wxrc-2.8 CACHE STRING wxWidgets_wxrc_EXECUTABLE FORCE)
-        SET(wxWidgets_CONFIG_EXECUTABLE /usr/bin/wx-config-3.0 CACHE STRING wxWidgets_CONFIG_EXECUTABLE FORCE)
-           SET(wxWidgets_wxrc_EXECUTABLE /usr/bin/wxrc-3.0 CACHE STRING wxWidgets_wxrc_EXECUTABLE FORCE)
+      SET(wxWidgets_CONFIG_EXECUTABLE /usr/bin/wx-config-3.0 CACHE STRING wxWidgets_CONFIG_EXECUTABLE FORCE)
+         SET(wxWidgets_wxrc_EXECUTABLE /usr/bin/wxrc-3.0 CACHE STRING wxWidgets_wxrc_EXECUTABLE FORCE)
        # CMake 2.6:
        # technically those packages are not required 
        # since one can still use the Motif/X11 version and not the gtk one:
-        FIND_PACKAGE(PkgConfig REQUIRED)
-        ##    pkg_check_modules (GTK2 gtk+-2.0)
-        ##    pkg_check_modules (GTK322 gtk+-3.0)
-        pkg_check_modules (GTK3 REQUIRED gtk+-3.0)
- endif(APPLE)
+      FIND_PACKAGE(PkgConfig REQUIRED)
+       ##    pkg_check_modules (GTK2 gtk+-2.0)
+       ##    pkg_check_modules (GTK322 gtk+-3.0)
+      pkg_check_modules (GTK3 REQUIRED gtk+-3.0)
+endif(APPLE)
 
-    # Can I require all my user to have the gl lib on linux, even if they do not really need it...
-    SET(WXGLCANVASLIBS "gl")     
-    SET(WXAUILIBS "aui")
-    # LG : These options should be set by the user at top level of crea
-    FIND_PACKAGE(wxWidgets REQUIRED COMPONENTS base core adv html
-        ${WXAUILIBS}
-        ${WXGLCANVASLIBS}
-    )
+      # Can I require all my user to have the gl lib on linux, even if they do not really need it...
+      SET(WXGLCANVASLIBS "gl")   
 
+      SET(WXAUILIBS "aui")
+      # LG : These options should be set by the user at top level of crea
+      FIND_PACKAGE(wxWidgets REQUIRED COMPONENTS base core adv html
+      ${WXAUILIBS}
+      ${WXGLCANVASLIBS}
+    )
     IF(wxWidgets_FOUND)
       MESSAGE ( STATUS "=======================================")
       MESSAGE ( STATUS "Looking for wxWidgets... found ${wxWidgets_CONFIG_EXECUTABLE}")
@@ -141,22 +139,20 @@ MACRO(CREA_USE_WXWIDGETS)
                ##    INCLUDE_DIRECTORIES(${GTK2_INCLUDE_DIRS})
                ##    LINK_DIRECTORIES(${GTK2_LIBRARY_DIRS})
                ##    LINK_LIBRARIES(${GTK2_LIBRARIES})
-        ##    SET(WXWIDGETS_LIBRARIES
-        ##                 GTK2
-        ##                 ${GTK2_LIBRARIES}
-        ##               #${GTK_LIBRARIES}
-        ##                 ${wxWidgets_LIBRARIES}      
-        ##             )
-               
        # GTK3
        INCLUDE_DIRECTORIES(${GTK3_INCLUDE_DIRS})
        LINK_DIRECTORIES(${GTK3_LIBRARY_DIRS})
+       LINK_LIBRARIES(${GTK3_LIBRARIES} )
+message("EED GTK3_VERSION "${GTK3_VERSION})
        # WX
                #    INCLUDE( ${GTK_USE_FILE} )
        INCLUDE( ${wxWidgets_USE_FILE} )
        MARK_AS_ADVANCED(wxWidgets_CONFIG_EXECUTABLE)
        SET(WXWIDGETS_LIBRARIES
+                       ##    GTK2
+                       ##      ${GTK2_LIBRARIES}
                ${GTK3_LIBRARIES}
+               #${GTK_LIBRARIES}
                ${wxWidgets_LIBRARIES}      
                )
 
index c9a15681e2b96006e04213dbc3fdac78c5367665..9c99fbb936a13f49467379e4d37139ed483ee0de 100644 (file)
@@ -104,3 +104,5 @@ INSTALL(
   DESTINATION ${CREA_LIB_PATH})
 #----------------------------------------------------------------------------
 MESSAGE(STATUS "===============================================")
+MESSAGE(STATUS "===============================================")
+
index 0f682ed12d208143eba7d64506b25dd2fe1d3232..a89d2bdb8c3f789af521c73b764698ef9d714fb7 100644 (file)
@@ -2,7 +2,7 @@
 # ---------------------------------------------------------------------
 #
 # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image 
-#                        pour la Santé©
+#                        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
@@ -74,7 +74,6 @@ namespace crea
    (__GNUC__ == 3 && (__GNUC_MINOR__ > 1 ||            \
                     (__GNUC_MINOR__ == 1 &&            \
                      __GNUC_PATCHLEVEL__ > 0)))    
-                     
     const abi::__class_type_info* targetTI = (const abi::__class_type_info *)( &(target_type));
     creaDebugMessage("info",7," * source   = "<<source_pointer<<std::endl);
     void* tmp = source_pointer;
index 07cbc89950a4d32e96a95b0a4509b34e24392395..fd3ceeb9941c1d1e090cc9be0cdf0c21f6d2971f 100644 (file)
 namespace crea
 {
 
+#define DEF_POINTER_IMAGE_VTK_CREA_difinition(VALUE,SCALARSIZE,POINTERIMAGE,SCALARTYPE)                                                \
+       double  VALUE                   ;                                                                                                                                                               \
+       int     SCALARSIZE              ;                                                                                                                                                               \
+       char    *POINTERIMAGE   ;                                                                                                                                                               \
+       int             SCALARTYPE              ;                               
+
+#define DEF_POINTER_IMAGE_VTK_CREA_set(VALUE,SCALARSIZE,POINTERIMAGE,SCALARTYPE,VTKIMAGE)                                      \
+                       VALUE                   = 0;                                                                                                                                                    \
+                       SCALARSIZE              = VTKIMAGE->GetScalarSize();                                                                                                    \
+                       POINTERIMAGE    = (char*)(VTKIMAGE->GetScalarPointer());                                                                                \
+                       SCALARTYPE              = VTKIMAGE->GetScalarType();                            
+
+
 #define DEF_POINTER_IMAGE_VTK_CREA(VALUE,SCALARSIZE,POINTERIMAGE,SCALARTYPE,VTKIMAGE)                                          \
        double  VALUE                   = 0;                                                                                                                                                    \
        int     SCALARSIZE              = VTKIMAGE->GetScalarSize();                                                                                                    \
index 3047c9397e9c54ec980e4edfa0b30ad39ef665b9..6bc66c2f2df9f15d6c850d60dd77f9d99c83e92a 100644 (file)
 
 =========================================================================*/
 
-//#import <Cocoa/Cocoa.h>
+
 
 #include <assert.h>
 
 #include "creawxVTKRenderWindowInteractor.h"
 
-#include <wx/display.h>
-
-
 //This is needed for vtk 3.1 :
 #ifndef VTK_MAJOR_VERSION
 #  include "vtkVersion.h"
@@ -66,7 +63,8 @@
 
 // AKT: wxOSX 2.9.x defines __WXOSX_COCOA__ rather than __WXCOCOA__
 #ifdef __WXOSX_COCOA__
-#define __WXCOCOA__
+   #import <Cocoa/Cocoa.h>
+   #define __WXCOCOA__
 #endif
 
 #if defined(__WXMAC__) && wxCHECK_VERSION(2,9,0)
@@ -105,7 +103,6 @@ wxWindow* wxGetTopLevelParent(wxWindow *win)
 // 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
@@ -114,7 +111,6 @@ wxWindow* wxGetTopLevelParent(wxWindow *win)
 #endif //__WXCOCOA__
 
 #if wxMAJOR_VERSION <= 2
-
        #ifdef __WXGTK__
         #include <gdk/gdkx.h> // GDK_WINDOW_XWINDOW is found here in wxWidgets 2.8.0
         #include "gdk/gdkprivate.h"
@@ -515,9 +511,12 @@ long wxVTKRenderWindowInteractor::GetHandleHack()
 //---------------------------------------------------------------------------
 void wxVTKRenderWindowInteractor::OnPaint(wxPaintEvent& WXUNUSED(event))
 {
-
   //must always be here
-//EED2021-08-26  wxPaintDC pDC(this);
+//EED2021-08-26  
+#ifdef __WXCOCOA__
+#else
+       wxPaintDC pDC(this);
+#endif
 
   //do it here rather than in the cstor: this is safer.
   if(!Handle)
@@ -526,9 +525,6 @@ void wxVTKRenderWindowInteractor::OnPaint(wxPaintEvent& WXUNUSED(event))
        
 #ifdef __WXCOCOA__
        vtkCocoaRenderWindow    *rwin           = vtkCocoaRenderWindow::SafeDownCast(RenderWindow);
-//2021-08-30
-//      rwin->SetWantsBestResolution(true);
-      
     NSView                                     *nvsview        = (NSView* )Handle;
        NSWindow                                *nswindow       = nvsview.window;
     rwin->SetRootWindow( nswindow );
@@ -555,8 +551,7 @@ void wxVTKRenderWindowInteractor::OnPaint(wxPaintEvent& WXUNUSED(event))
     #endif
   }
   // get vtk to render to the wxWindows
-
-Render();
+  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
@@ -570,7 +565,6 @@ Render();
     }
   #endif
 #else
-    
   vtkCarbonRenderWindow* rwin = vtkCarbonRenderWindow::SafeDownCast(RenderWindow);
   if( rwin )
   {
@@ -582,7 +576,6 @@ Render();
 #endif
 #endif
 }
-
 //---------------------------------------------------------------------------
 void wxVTKRenderWindowInteractor::OnEraseBackground(wxEraseEvent &event)
 {
@@ -606,9 +599,7 @@ void wxVTKRenderWindowInteractor::OnSize(wxSizeEvent& WXUNUSED(event))
 #endif
   //this will check for Handle
   //Render();
-
 }
-
 //---------------------------------------------------------------------------
 void wxVTKRenderWindowInteractor::OnMotion(wxMouseEvent &event)
 {
@@ -617,7 +608,6 @@ void wxVTKRenderWindowInteractor::OnMotion(wxMouseEvent &event)
     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);