From f00f62ed3e06dbace91a7f36745304ece8eda1f5 Mon Sep 17 00:00:00 2001 From: Eduardo DAVILA Date: Tue, 21 Apr 2020 12:12:48 +0200 Subject: [PATCH] #3404 creaMaracasVisu Feature New Normal - vtk8itk5wx3-macos --- CMakeLists.txt | 30 +++++++++++++++++++ ...xMaracasSurfaceRenderingManagerDataMhd.cxx | 5 +++- .../wxWindows/widgets/ContourView.cxx | 2 +- .../interface/wxWindows/widgets/LineView.cxx | 2 +- .../manualContour/manualViewBaseContour.cpp | 2 +- .../wxWindows/widgets/vtkPlane2DView.cxx | 2 +- .../wxWindows/widgets/wxSTLWidget_03.cxx | 2 +- .../wxWindows/widgets/wxVtkMPR2DView.cxx | 4 +-- .../wxWindows/widgets/wxVtkMPR3DView.cxx | 13 ++++---- .../widgets/wxWidgetMesure2D_Plane.cxx | 8 ++--- 10 files changed, 51 insertions(+), 19 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c74a28e..6fbc029 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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() + diff --git a/lib/Kernel/VTKObjects/SurfaceRenderer/wxMaracasSurfaceRenderingManagerDataMhd.cxx b/lib/Kernel/VTKObjects/SurfaceRenderer/wxMaracasSurfaceRenderingManagerDataMhd.cxx index 5396f21..86bb966 100644 --- a/lib/Kernel/VTKObjects/SurfaceRenderer/wxMaracasSurfaceRenderingManagerDataMhd.cxx +++ b/lib/Kernel/VTKObjects/SurfaceRenderer/wxMaracasSurfaceRenderingManagerDataMhd.cxx @@ -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){ diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/ContourView.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/ContourView.cxx index d79354e..48f1173 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/ContourView.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/ContourView.cxx @@ -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); diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/LineView.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/LineView.cxx index 253fa58..4d49919 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/LineView.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/LineView.cxx @@ -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(); diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualViewBaseContour.cpp b/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualViewBaseContour.cpp index 47b19a0..9e394c0 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualViewBaseContour.cpp +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualViewBaseContour.cpp @@ -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(); diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkPlane2DView.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkPlane2DView.cxx index 3c715ae..306b6e3 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkPlane2DView.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkPlane2DView.cxx @@ -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); diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxSTLWidget_03.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxSTLWidget_03.cxx index 9e73b79..4767c5f 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxSTLWidget_03.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxSTLWidget_03.cxx @@ -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(); diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR2DView.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR2DView.cxx index 01c7e14..e93a929 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR2DView.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR2DView.cxx @@ -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 ); diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR3DView.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR3DView.cxx index 3703011..b82f52a 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR3DView.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR3DView.cxx @@ -41,6 +41,7 @@ #include "vtkCellPicker.h" #include "vtkInteractorStyleBaseView.h" #include +#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 ); diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxWidgetMesure2D_Plane.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxWidgetMesure2D_Plane.cxx index 5445592..3f47a4e 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxWidgetMesure2D_Plane.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxWidgetMesure2D_Plane.cxx @@ -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); -- 2.45.1