]> Creatis software - creaMaracasVisu.git/commitdiff
#3470 merge vtk8itk5wx3-mingw64
authorEduardo DAVILA <davila@creatis.insa-lyon.fr>
Fri, 10 Sep 2021 12:40:16 +0000 (14:40 +0200)
committerEduardo DAVILA <davila@creatis.insa-lyon.fr>
Fri, 10 Sep 2021 12:40:16 +0000 (14:40 +0200)
12 files changed:
CMakeLists.txt
lib/Kernel/VTKObjects/SurfaceRenderer/wxMaracasSurfaceRenderingManagerDataMhd.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/ContourView.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/LineView.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualViewBaseContour.cpp
lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkInteractorStyleBaseView.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkPlane2DView.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/wxSTLWidget_03.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkBaseView.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR2DView.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR3DView.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/wxWidgetMesure2D_Plane.cxx

index c74a28ef0544b1e9dc7bf092951bee5fba59e96b..6fbc02988847a18a0b66d0250e685dcba82b6010 100644 (file)
@@ -69,6 +69,9 @@ IF (crea_FOUND)
 ENDIF(crea_FOUND)
 
 
+
+
+
 CREA_PREVENT_IN_SOURCE_BUILD()
 
 #SET(USE_GDCM ON)
@@ -165,3 +168,30 @@ ELSE(WIN32)
        SET(OUTPUT_DATA_DIR ${PROJECT_BINARY_DIR}/data)
        CREA_CPDIR(${INPUT_DATA_DIR} ${OUTPUT_DATA_DIR})
 ENDIF(WIN32)
+
+
+#.  ----  MacOs ---------
+#EED  /Library/Developer/CommandLineTools/usr/bin/c++ 
+#EED FLAGS C++ :      -Xpreprocessor -fopenmp
+#                      http://secomparteosepierde.blogspot.com/2019/04/how-to-install-openmp-on-mac-using.html
+#                       https://stackoverflow.com/questions/23554716/using-openmp-on-windows-with-mingw-cannot-find-lpthread
+#You need -Xpreprocessor flag to use -fopenmp flag
+#
+#  sudo port install libomp-devel   
+#  sudo port -f activate libomp-devel
+
+##. This cmake code is not working ??????   MacOs..
+
+message(STATUS "Checking OpenMP")
+find_package(OpenMP)
+IF(OPENMP_FOUND)
+    message("Found OpenMP! ^_^")
+    # add flags for OpenMP
+    set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
+    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
+    set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${OpenMP_SHARED_LINKER_FLAGS}")
+    set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${OpenMP_EXE_LINKER_FLAGS}")
+ELSE()
+    message("Missed OpenMP! :(")
+ENDIF()
+
index 5396f21bca18be4ebce31c87e12c456d9673cbda..86bb966dfd2ee1b33cd991f76195996c508fa65d 100644 (file)
@@ -81,7 +81,10 @@ wxMaracasSurfaceRenderingManagerDataMhd::wxMaracasSurfaceRenderingManagerDataMhd
 
        _dataMapper = vtkPolyDataMapper::New( );
        _dataMapper->ScalarVisibilityOff( );
-       _dataMapper->ImmediateModeRenderingOn();
+       
+//EED  vtk 8 method deprecated
+//     _dataMapper->ImmediateModeRenderingOn();
+
        vtkActor* dataActor = vtkActor::New();
 
        //if(_boxWidgetS1){
index d79354eedaa0441fdcf71fea82fca1e58decbb0e..48f1173662d9bcf5f706a578db25447422a24aab 100644 (file)
@@ -67,12 +67,12 @@ void ContourView::Refresh()
 void ContourView::CreateNewContour(vtkPolyData *contour, int type)
 {
        contour_mapped.push_back(vtkPolyDataMapper::New());
-       contour_mapped.back()->ImmediateModeRenderingOn();
        contour_mapped.back()->ScalarVisibilityOff( );
 
 
 //EED 2017-01-01 Migration VTK7
 #if VTK_MAJOR_VERSION <= 5
+       contour_mapped.back()->ImmediateModeRenderingOn();
        contour_mapped.back()->SetInput(contour);
 #else
        contour_mapped.back()->SetInputData(contour);
index 253fa58ab8f1e021f41c8308b5ea309b9c76b8f0..4d49919874205c01fe7e1180e3e2feaa3d06e727 100644 (file)
@@ -89,11 +89,11 @@ void LineView::CreateNewLine(double x1, double y1, double z1, double x2, double
 //EED 2017-01-01 Migration VTK7
 #if VTK_MAJOR_VERSION <= 5
        contour_mapped.back()->SetInput(aLineGrid);
+       contour_mapped.back()->ImmediateModeRenderingOn();
 #else
        contour_mapped.back()->SetInputData(aLineGrid);
 #endif
 
-       contour_mapped.back()->ImmediateModeRenderingOn();
 
        contour_actor.back()->SetMapper(contour_mapped.back());
        contour_actor.back()->GetProperty()->BackfaceCullingOn();
index 89d6ed18e7b68e447e1f41f28a9471364ddea780..58198eef1edbc9d72a39225f21f0233a5b166916 100644 (file)
@@ -314,12 +314,12 @@ void manualViewBaseContour::ConstructVTKObjects()
 //EED 2017-01-01 Migration VTK7
 #if VTK_MAJOR_VERSION <= 5
        _bboxMapper->SetInput(_pd);
+       _bboxMapper->ImmediateModeRenderingOn();
 #else
        _bboxMapper->SetInputData(_pd);
 #endif
 
 
-       _bboxMapper->ImmediateModeRenderingOn();
        _contourVtkActor->SetMapper(_bboxMapper);
        _contourVtkActor->GetProperty()->BackfaceCullingOff();
 
index d7c6b6843aca7ba420ab5742f9bce08f551f3ffb..7b8c144d3bbf197f37c84db88bf6556e7b48c392 100644 (file)
@@ -287,7 +287,8 @@ void vtkInteractorStyleBaseView::TransformCoordinate(double &X, double &Y, doubl
                double fP[4];
                imageViewer->GetRenderer()->GetWorldPoint( fP );
 
-               if ( fP[3] ){
+               if ( fP[3] )
+               {
                        fP[0] /= fP[3];
                        fP[1] /= fP[3];
                        fP[2] /= fP[3];
index 3c715ae038aa09f20939c2d2a435b0050d3a7a76..306b6e3f60fef7d5d2ec4aff70c4bf74de16ec55 100644 (file)
@@ -448,10 +448,10 @@ void vtkPlane2DView::HorizontalLine()
 //EED 2017-01-01 Migration VTK7
 #if VTK_MAJOR_VERSION <= 5
        _lineMapper->SetInput(_pd);
+       _lineMapper->ImmediateModeRenderingOn();
 #else
        _lineMapper->SetInputData(_pd);
 #endif
-       _lineMapper->ImmediateModeRenderingOn();
        _lineActor->SetMapper(_lineMapper);
        _lineActor->GetProperty()->BackfaceCullingOn();
        _lineActor->GetProperty()->SetDiffuseColor(0,0,1);
index 9e73b799e4761645ee923f766b845578070a5641..4767c5f3aea21715d52c92af8ae5ad1cd5f9d88b 100644 (file)
@@ -791,13 +791,13 @@ void wxSTLWidget_03::ExtractSurface(int x, int y, int z)
 //EED 2017-01-01 Migration VTK7
 #if VTK_MAJOR_VERSION <= 5
     _2_isoMapperMC6->SetInput(_2_isoMC6->GetOutput());
+    _2_isoMapperMC6->ImmediateModeRenderingOn();
 #else
     _2_isoMapperMC6->SetInputData(_2_isoMC6->GetOutput());
 #endif
 
 
     _2_isoMapperMC6->ScalarVisibilityOff();
-    _2_isoMapperMC6->ImmediateModeRenderingOn();
 
        vtkRenderer *ren = _wxMaracasMPR->GetWxvtkmpr3Dview_BB()->GetWxvtk3Dbaseview()->GetRenderer();
 
index b18d582c3334587e964397a1d35f6375c6f5ebd0..2e0e2d62ffbd1e27132a160caa931f75e55df9a2 100644 (file)
@@ -116,7 +116,7 @@ void wxVtkBaseView::TransCoordScreenToWorld(double &X, double &Y, double &Z, int
        GetRenderer()->DisplayToWorld();
        double fP[4];
        GetRenderer()->GetWorldPoint( fP );
-       if ( fP[3] ){
+    if ( fP[3] ){
                fP[0] /= fP[3];
                fP[1] /= fP[3];
                fP[2] /= fP[3];
@@ -148,7 +148,7 @@ void wxVtkBaseView::TransFromCoordScreenToWorld(double &X, double &Y, double &Z,
 
        X = xx;
        Y = yy;
-       Z=zz;
+       Z = zz;
 
 // EEDx5
        //JCP 13/05/2009
@@ -174,7 +174,8 @@ void wxVtkBaseView::TransFromCoordScreenToWorld(double &X, double &Y, double &Z,
        if (type!=2)
        {
                Z=fP[2];
-       } 
+       }
+
 }
 
 //---------------------------------------------------------------------------
index bbb02ec611eaa1866393db0d064aea43ffcf52d1..0b3e8ea32a1001b66bfa264262acf0c6adaced7a 100644 (file)
@@ -120,11 +120,11 @@ void wxVtkMPR2DView::Configure()
 //EED 2017-01-01 Migration VTK7
 #if VTK_MAJOR_VERSION <= 5
                _lineAMapper->SetInput(_pdA);
+               _lineAMapper->ImmediateModeRenderingOn();
 #else
                _lineAMapper->SetInputData(_pdA);
 #endif
 
-               _lineAMapper->ImmediateModeRenderingOn();
                _lineAActor->SetMapper(_lineAMapper);
        }
 
@@ -166,11 +166,11 @@ void wxVtkMPR2DView::Configure()
 //EED 2017-01-01 Migration VTK7
 #if VTK_MAJOR_VERSION <= 5
        _lineBMapper->SetInput(_pdB);
+       _lineBMapper->ImmediateModeRenderingOn();
 #else
        _lineBMapper->SetInputData(_pdB);
 #endif
 
-       _lineBMapper->ImmediateModeRenderingOn();
        if(_imageViewer2XYZ)
        {
                _imageViewer2XYZ->GetVtkImageViewer2()->GetRenderer()->AddActor( _lineAActor );
index 80af2e1c15246effa43e1c4eb76070f7e08092ac..23b6ce1ad4b199dde4a41aa3525362bc8b08d38b 100644 (file)
@@ -41,6 +41,7 @@
 #include "vtkCellPicker.h"
 #include "vtkInteractorStyleBaseView.h"
 #include <vtkImageReslice.h>
+#include "vtkTexture.h"
 
 
 
@@ -562,7 +563,7 @@ void wxVtkMPR3DView::RefreshView()   // virtual
        {
                _planeWidgetX->SetSlicePosition( x*spc[0] );
 //EED 2016/02/19
-//             _planeWidgetX->GetReslice()->SetInterpolate( _vtkmpr3Ddataviewer->GetVtkMPRBaseData()->GetInterpolate() );
+               _planeWidgetX->GetReslice()->SetInterpolate( _vtkmpr3Ddataviewer->GetVtkMPRBaseData()->GetInterpolate() );
                _planeWidgetX->GetTexture()->SetInterpolate( _vtkmpr3Ddataviewer->GetVtkMPRBaseData()->GetInterpolate() );
        }
        // FreePlaneY
@@ -583,9 +584,9 @@ void wxVtkMPR3DView::RefreshView()   // virtual
                _planeWidgetZ->GetReslice()->SetInterpolate( _vtkmpr3Ddataviewer->GetVtkMPRBaseData()->GetInterpolate() );
                _planeWidgetZ->GetTexture()->SetInterpolate( _vtkmpr3Ddataviewer->GetVtkMPRBaseData()->GetInterpolate() );
        }
-
+    
        SetWindowColorLevel(_vtkmpr3Ddataviewer->GetVtkMPRBaseData()->GetColorWindow() , _vtkmpr3Ddataviewer->GetVtkMPRBaseData()->GetColorLevel() );
-
+    
        x = x*spc[0];
        y = y*spc[1];
        z = z*spc[2];
@@ -895,13 +896,13 @@ void wxVtkMPR3DView::TestLoic1()
 //EED 2017-01-01 Migration VTK7
 #if VTK_MAJOR_VERSION <= 5
        _3DSliceMapper->SetInput(change->GetOutput( ) );
+       _3DSliceMapper->ImmediateModeRenderingOn( );
 #else
        _3DSliceMapper->SetInputData(change->GetOutput( ) );
 #endif
 
        _3DSliceMapper->SetLookupTable( _bwlookup );
        _3DSliceMapper->SetScalarRange( _range );
-       _3DSliceMapper->ImmediateModeRenderingOn( );
 
        vtkActor *_3DSliceActor = vtkActor::New( );
        _3DSliceActor->SetMapper( _3DSliceMapper );
index 54455923c47dc0c8860715b62ae408fb475bf99c..3f47a4ebfe25ecee14691dcb17dd58730371fa12 100644 (file)
@@ -230,10 +230,10 @@ void wxWidgetMesure2D_Plane::CircleLine()
 //EED 2017-01-01 Migration VTK7
 #if VTK_MAJOR_VERSION <= 5
        _circle1Mapper->SetInput(_pdCircle1);
+       _circle1Mapper->ImmediateModeRenderingOn();
 #else
        _circle1Mapper->SetInputData(_pdCircle1);
 #endif
-       _circle1Mapper->ImmediateModeRenderingOn();
        _circle1Actor->SetMapper(_circle1Mapper);
        _circle1Actor->GetProperty()->BackfaceCullingOn();
        _circle1Actor->GetProperty()->SetDiffuseColor(0,0,1);
@@ -262,10 +262,10 @@ void wxWidgetMesure2D_Plane::CircleLine()
 //EED 2017-01-01 Migration VTK7
 #if VTK_MAJOR_VERSION <= 5
        _circle2Mapper->SetInput(_pdCircle2);
+       _circle2Mapper->ImmediateModeRenderingOn();
 #else
        _circle2Mapper->SetInputData(_pdCircle2);
 #endif
-       _circle2Mapper->ImmediateModeRenderingOn();
        _circle2Actor->SetMapper(_circle2Mapper);
        _circle2Actor->GetProperty()->BackfaceCullingOn();
        _circle2Actor->GetProperty()->SetDiffuseColor(0,0,1);
@@ -292,11 +292,11 @@ void wxWidgetMesure2D_Plane::CircleLine()
 //EED 2017-01-01 Migration VTK7
 #if VTK_MAJOR_VERSION <= 5
        _lineRef1Mapper->SetInput(_pdLineRef1);
+       _lineRef1Mapper->ImmediateModeRenderingOn();
 #else
        _lineRef1Mapper->SetInputData(_pdLineRef1);
 #endif
 
-       _lineRef1Mapper->ImmediateModeRenderingOn();
        _lineRef1Actor->SetMapper(_lineRef1Mapper);
        _lineRef1Actor->GetProperty()->BackfaceCullingOn();
        _lineRef1Actor->GetProperty()->SetDiffuseColor(0,0,1);
@@ -323,11 +323,11 @@ void wxWidgetMesure2D_Plane::CircleLine()
 //EED 2017-01-01 Migration VTK7
 #if VTK_MAJOR_VERSION <= 5
        _lineRef2Mapper->SetInput(_pdLineRef2);
+       _lineRef2Mapper->ImmediateModeRenderingOn();
 #else
        _lineRef2Mapper->SetInputData(_pdLineRef2);
 #endif
 
-       _lineRef2Mapper->ImmediateModeRenderingOn();
        _lineRef2Actor->SetMapper(_lineRef2Mapper);
        _lineRef2Actor->GetProperty()->BackfaceCullingOn();
        _lineRef2Actor->GetProperty()->SetDiffuseColor(0,0,1);