]> Creatis software - crea.git/commitdiff
#3392 vtk9itk5wx3-macos
authorEduardo DAVILA <davila@creatis.insa-lyon.fr>
Fri, 22 Jul 2022 13:19:27 +0000 (15:19 +0200)
committerEduardo DAVILA <davila@creatis.insa-lyon.fr>
Fri, 22 Jul 2022 13:19:27 +0000 (15:19 +0200)
cmake/CREAMacro_AddLibrary.cmake
cmake/CREAMacro_FindAndUseVTK.cmake
src/creaVtk.txx
src/creawxVTKRenderWindowInteractor.h
src/creawxVTKRenderWindowInteractor.mm

index 679b0134e68e4a66e4402427d20b0ab97864a1fa..504b815355afe8f446bc70bc107ea9bb20fd39ce 100644 (file)
@@ -1,7 +1,7 @@
 # ---------------------------------------------------------------------
 #
 # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image 
 # ---------------------------------------------------------------------
 #
 # 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
 # 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
index c60c8f43a9efd63a2e36d052299d79ba182d22ea..9541f57cd80c5c39cd8183dab81b43e3de1a35a0 100644 (file)
@@ -30,7 +30,9 @@ MACRO(CREA_FIND_AND_USE_VTK)
     # Search VTK
        message("DFCH--VTK: CREAMacro_FindAndUseVTK.cmake: " ${CMAKE_CURRENT_LIST_FILE})
        message("DFCH--VTK: CREAMacro_FindAndUseVTK.cmake: " ${_IMPORT_PREFIX})
     # Search VTK
        message("DFCH--VTK: CREAMacro_FindAndUseVTK.cmake: " ${CMAKE_CURRENT_LIST_FILE})
        message("DFCH--VTK: CREAMacro_FindAndUseVTK.cmake: " ${_IMPORT_PREFIX})
+    
     FIND_PACKAGE(VTK)
     FIND_PACKAGE(VTK)
+    
     # If vtk found
     IF(VTK_FOUND)
 
     # If vtk found
     IF(VTK_FOUND)
 
@@ -38,9 +40,12 @@ 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}")
       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
+      SET(VTK_BUILD_SETTINGS_FILE OFF)
+      
+## EED 2022-07-21
+##     INCLUDE(${VTK_USE_FILE})
+##     LINK_DIRECTORIES(${VTK_DIR}) #DFCH -- 16/7/2012
+INCLUDE_DIRECTORIES(include ${VTK_INCLUDE_DIRS} )
 
        IF(VTK_USE_GL2PS)
                add_definitions(-DUSE_WXGLCANVAS)
 
        IF(VTK_USE_GL2PS)
                add_definitions(-DUSE_WXGLCANVAS)
@@ -204,16 +209,19 @@ ENDIF("${VTK_MAJOR_VERSION}" LESS 6)
 #          vtkRenderingContextOpenGL2
 #      )
        IF (WIN32)
 #          vtkRenderingContextOpenGL2
 #      )
        IF (WIN32)
-         SET(VTK_LIBRARIES ${VTK_LIBRARIES} )
+#        SET(VTK_LIBRARIES ${VTK_LIBRARIES} )
     ELSE(WIN32)
     ELSE(WIN32)
-         SET(VTK_LIBRARIES ${VTK_LIBRARIES}   
+#        SET(VTK_LIBRARIES ${VTK_LIBRARIES}
 #          vtkRenderingQt
 #          vtkGUISupportQt            
 #          vtkGUISupportQtSQL         
 #          vtkViewsQt
 #          vtkNetCDF_cxx       
 #          vtkRenderingQt
 #          vtkGUISupportQt            
 #          vtkGUISupportQtSQL         
 #          vtkViewsQt
 #          vtkNetCDF_cxx       
-               )
-    message("EED vtk libraries: "${VTK_LIBRARIES})
+#              )
+    message("EED-a vtk libraries: "${VTK_LIBRARIES})
+    message("EED-start vtk include dirs: "${VTK_INCLUDE_DIRS})
+    message("EED-end")
+    
        ENDIF(WIN32)
        
 
        ENDIF(WIN32)
        
 
index c83e758d6bb7ecbdcc5c8da594ff19fb24fbff2f..a53111f95b7b55bc1da81a6c82e147bcebfe47ed 100644 (file)
 */                                                                         
 
 
 */                                                                         
 
 
-
-#include <vtkDataArrayTemplate.h>
+//EED 2022-07-21
+// https://www.slicer.org/wiki/Documentation/Labs/VTK7
+// #include <vtkDataArrayTemplate.h>
+ #include <vtkAOSDataArrayTemplate.h>
 
 #include <vtkCharArray.h>
 #include <vtkSignedCharArray.h>
 
 #include <vtkCharArray.h>
 #include <vtkSignedCharArray.h>
@@ -105,8 +107,12 @@ namespace crea
                  <<vtkTypeTraits<T>::SizedName()
                  <<" non implemented");
       }
                  <<vtkTypeTraits<T>::SizedName()
                  <<" non implemented");
       }
-    vtkDataArrayTemplate<T>* tarray 
-               = dynamic_cast<vtkDataArrayTemplate<T>*>(array);
+    
+//EED 2022-07-21
+// https://www.slicer.org/wiki/Documentation/Labs/VTK7
+//    vtkDataArrayTemplate<T>* tarray = dynamic_cast<vtkDataArrayTemplate<T>*>(array);
+    vtkAOSDataArrayTemplate<T>* tarray = dynamic_cast<vtkAOSDataArrayTemplate<T>*>(array);
+    
     array->SetNumberOfComponents( 1 );
     size_t size = (long)nx*(long)ny*(long)nz;
     // The last param of SetArray is set to 1 to keep the class from deleting the array 
     array->SetNumberOfComponents( 1 );
     size_t size = (long)nx*(long)ny*(long)nz;
     // The last param of SetArray is set to 1 to keep the class from deleting the array 
index b465e3c5ea240efd155a1df89917fb5b9c12fa8e..82b463a681d8bca11044b7cf46705c33e88a79c2 100644 (file)
@@ -79,6 +79,7 @@
 #include <wx/dcclient.h>
 
 // vtk includes
 #include <wx/dcclient.h>
 
 // vtk includes
+#include <vtkVersionMacros.h>
 #include "vtkRenderWindowInteractor.h"
 #include "vtkRenderWindow.h"
 
 #include "vtkRenderWindowInteractor.h"
 #include "vtkRenderWindow.h"
 
index 6109749fb5c86a64e280c3b19e7f0c979060892a..1dab3fa44133c5e354b2e6ef7e590323527327cb 100644 (file)
@@ -53,6 +53,7 @@
 #  include "vtkVersion.h"
 #endif
 
 #  include "vtkVersion.h"
 #endif
 
+
 #if VTK_MAJOR_VERSION > 4 || (VTK_MAJOR_VERSION == 4 && VTK_MINOR_VERSION > 0)
 #  include "vtkCommand.h"
 #else
 #if VTK_MAJOR_VERSION > 4 || (VTK_MAJOR_VERSION == 4 && VTK_MINOR_VERSION > 0)
 #  include "vtkCommand.h"
 #else
@@ -106,12 +107,16 @@ wxWindow* wxGetTopLevelParent(wxWindow *win)
 
 // To access objc calls on cocoa
 #ifdef __WXCOCOA__
 
 // To access objc calls on cocoa
 #ifdef __WXCOCOA__
-#ifdef VTK_USE_COCOA
-// This trick is no longer need in VTK CVS, should get rid of that:
+
 #define id Id
 #define id Id
-#else
-#error Build mismatch you need both wxWidgets and VTK to be configure against Cocoa to work
-#endif //VTK_USE_COCOA
+
+// #ifdef VTK_USE_COCOA
+// // 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__
 
 #if wxMAJOR_VERSION <= 2
 #endif //__WXCOCOA__
 
 #if wxMAJOR_VERSION <= 2
@@ -449,9 +454,9 @@ void wxVTKRenderWindowInteractor::UpdateSize(int x, int y)
       // and our RenderWindow's size
 
 #ifdef __WXCOCOA__
       // and our RenderWindow's size
 
 #ifdef __WXCOCOA__
-  #ifdef VTK_USE_COCOA
-  #else
-  #endif //VTK_USE_COCOA
+//  #ifdef VTK_USE_COCOA
+//  #else
+//  #endif //VTK_USE_COCOA
 #else
       RenderWindow->SetSize(x, y);
 #endif //__WXCOCOA__
 #else
       RenderWindow->SetSize(x, y);
 #endif //__WXCOCOA__