]> Creatis software - creaMaracasVisu.git/commitdiff
#3404 creaMaracasVisu Feature New Normal - vtk8itk5wx3-macos
authorEduardo DAVILA <davila@creatis.insa-lyon.fr>
Tue, 21 Apr 2020 10:12:48 +0000 (12:12 +0200)
committerEduardo DAVILA <davila@creatis.insa-lyon.fr>
Tue, 21 Apr 2020 10:12:48 +0000 (12:12 +0200)
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/vtkPlane2DView.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/wxSTLWidget_03.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 47b19a033d802a515087015598f727e703e940fd..9e394c065b74c3ce4d7d795e80bb9135e3de138a 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 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 01c7e1400cc3f42652651dfc2c562649779e7fdf..e93a929c13f929e37590b9d358028d9ddb2e6ed8 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 3703011e6b5c35dbfc04b34c2d52cf076a99ff3c..b82f52a52c4ec01d628e9c99687dadfab8302c0e 100644 (file)
@@ -41,6 +41,7 @@
 #include "vtkCellPicker.h"
 #include "vtkInteractorStyleBaseView.h"
 #include <vtkImageReslice.h>
+#include "vtkTexture.h"
 
 
 
@@ -513,7 +514,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
@@ -534,11 +535,9 @@ void wxVtkMPR3DView::RefreshView()   // virtual
                _planeWidgetZ->GetReslice()->SetInterpolate( _vtkmpr3Ddataviewer->GetVtkMPRBaseData()->GetInterpolate() );
                _planeWidgetZ->GetTexture()->SetInterpolate( _vtkmpr3Ddataviewer->GetVtkMPRBaseData()->GetInterpolate() );
        }
-               
-       x=x*spc[0];
-       y=y*spc[1];
-       z=z*spc[2];
-
+       x = x*spc[0];
+       y = y*spc[1];
+       z = z*spc[2];
        if(_pointWidget)
        {
 //EED 2017-01-01 Migration VTK7
@@ -831,13 +830,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);