From: Eduardo DAVILA Date: Mon, 24 Feb 2014 15:16:58 +0000 (+0100) Subject: 2315 creaMaracasVisu Feature New Normal Color Layer synchronisation X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=b87fbe3810201505125d9a8e40ac156881f008b9;p=creaMaracasVisu.git 2315 creaMaracasVisu Feature New Normal Color Layer synchronisation --- diff --git a/lib/maracasVisuLib/CMakeLists.txt b/lib/maracasVisuLib/CMakeLists.txt index 4929a37..fe7909c 100644 --- a/lib/maracasVisuLib/CMakeLists.txt +++ b/lib/maracasVisuLib/CMakeLists.txt @@ -63,6 +63,7 @@ IF ( BUILD_${LIBRARY_NAME} ) #FILE(GLOB ${LIBRARY_NAME}_HEADERS "*.h") # OR MANUALLY LIST YOUR HEADERS WITH NEXT COMMAND + FILE(GLOB ${LIBRARY_NAME}_HEADERS_WXWIN "src/interface/wxWindows/*.h") FILE(GLOB ${LIBRARY_NAME}_SOURCES_WXWIN src/interface/wxWindows/*.cxx src/interface/wxWindows/*.cpp src/interface/wxWindows/*.cc) @@ -98,10 +99,10 @@ IF ( BUILD_${LIBRARY_NAME} ) FILE(GLOB ${LIBRARY_NAME}_HEADERS_KERNEL "src/kernel/*.h") FILE(GLOB ${LIBRARY_NAME}_SOURCES_KERNEL src/kernel/*.cxx src/kernel/*.cpp src/kernel/*.cc) -FILE(GLOB ${LIBRARY_NAME}_HEADERS_CUTMODULE src/CutModule/interface/*.h src/CutModule/kernel/*.h) + FILE(GLOB ${LIBRARY_NAME}_HEADERS_CUTMODULE src/CutModule/interface/*.h src/CutModule/kernel/*.h) FILE(GLOB ${LIBRARY_NAME}_SOURCES_CUTMODULE src/CutModule/interface/*.cxx src/CutModule/kernel/*.cxx) -FILE(GLOB ${LIBRARY_NAME}_HEADERS_MARACASVISULIB_INCLUDE include/*.h ) + FILE(GLOB ${LIBRARY_NAME}_HEADERS_MARACASVISULIB_INCLUDE include/*.h ) SET ( ${LIBRARY_NAME}_HEADERS ${${LIBRARY_NAME}_HEADERS_WXWIN} @@ -117,7 +118,6 @@ FILE(GLOB ${LIBRARY_NAME}_HEADERS_MARACASVISULIB_INCLUDE include/*.h ) ${${LIBRARY_NAME}_HEADERS_CBUTTONCONTAINER} ${${LIBRARY_NAME}_HEADERS_CPBUTTONCONTAINER} ${${LIBRARY_NAME}_HEADERS_UNDO_REDO} - ) #---------------------------------------------------------------------------- @@ -208,7 +208,6 @@ FILE(GLOB ${LIBRARY_NAME}_HEADERS_MARACASVISULIB_INCLUDE include/*.h ) SET(${LIBRARY_NAME}_INSTALL_FOLDER ${LIBRARY_NAME}) SET(${LIBRARY_NAME}_LIBRARIES - BaseVolumeRenderer BaseSurfaceRenderer KernelVolumeRenderer diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/ThresholdImageView/LayerImageBase.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/ThresholdImageView/LayerImageBase.cxx index d340e7f..0a2ccf9 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/ThresholdImageView/LayerImageBase.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/ThresholdImageView/LayerImageBase.cxx @@ -30,6 +30,9 @@ #include "LayerImageBase.h" +#include "wxVtk2DBaseView.h" +#include "wxVTKRenderWindowInteractor.h" + //--------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------- @@ -37,7 +40,9 @@ ColorLayerImageBasevtkInteractor::ColorLayerImageBasevtkInteractor(LayerImageBase* layerImageBase) { + _state=false; _layerImageBase=layerImageBase; + } //--------------------------------------------------------------------------------------------- @@ -47,15 +52,56 @@ ColorLayerImageBasevtkInteractor::~ColorLayerImageBasevtkInteractor() //--------------------------------------------------------------------------------------------- -bool ColorLayerImageBasevtkInteractor::OnMouseMove() +bool ColorLayerImageBasevtkInteractor::OnMouseMove() // vitual { printf("EED ColorLayerImageBasevtkInteractor::OnMouseMove \n"); - if (_vtkInteractorStyleBaseView->GetRefresh_waiting()==true) - { - _layerImageBase->GetvtkImageReslice()->Modified(); - } + + if (_state==true) + { + + wxVtk2DBaseView *wxvtk2Dbaseview = (wxVtk2DBaseView*) _vtkInteractorStyleBaseView->GetWxVtk2DBaseView(); + wxVTKRenderWindowInteractor *wxVTKiren = wxvtk2Dbaseview->GetWxVTKRenderWindowInteractor(); + int px, py; + wxVTKiren->GetEventPosition(px, py); - return true; +// int typeView = 1; + double X = (double) px; + double Y = (double) py; + double Z = wxvtk2Dbaseview->GetActualSlice(); +// wxvtk2Dbaseview->TransFromCoordScreenToWorld(X, Y, Z,true, typeView); + wxvtk2Dbaseview->TransFromCoordScreenToWorld(X, Y, Z, true); + +// _manualPaintControler->PaintImage((int) X, (int) Y, (int) Z); + + _layerImageBase->SetZ( (int)Z ); + _layerImageBase->onThreshold(); +// _layerImageBase->Refresh(); + + + this->_vtkInteractorStyleBaseView->SetParent_refresh_waiting(); + + if (_vtkInteractorStyleBaseView->GetRefresh_waiting()==true) + { + _layerImageBase->GetvtkImageReslice()->Modified(); + } + printf("EED ColorLayerImageBasevtkInteractor::YESSSSSS \n"); + } + return true; +} + + +bool ColorLayerImageBasevtkInteractor::OnRightButtonDown() // virtual +{ + printf("EED ColorLayerImageBasevtkInteractor::OnRightButtonDown \n"); + _state=true; + return true; +} + +bool ColorLayerImageBasevtkInteractor::OnRightButtonUp() // virtual +{ + printf("EED ColorLayerImageBasevtkInteractor::OnRightButtonUp \n"); + _state=false; + return true; } @@ -173,12 +219,19 @@ int LayerImageBase::CleanZ(int z) //---------------------------------------------------------------------------- void LayerImageBase::onThreshold() { - + printf("EED LayerImageBase::onThreshold start \n"); if ((_image!=NULL) && (_baseView!=NULL)) { - int z=CleanZ( GetZ() ); + double spc[3]; + GetImage()-> GetSpacing(spc); + double z = CleanZ( GetZ() ); + z = z*spc[2]; + + printf("EED LayerImageBase::onThreshold z = %d spcZ%f\n" , z, spc[2]); + + if (!GetActorPresent()) { @@ -225,7 +278,7 @@ void LayerImageBase::onThreshold() } // _image - printf("EED LayerImageBase::onThreshold end"); + printf("EED LayerImageBase::onThreshold end \n"); } diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/ThresholdImageView/LayerImageBase.h b/lib/maracasVisuLib/src/interface/wxWindows/widgets/ThresholdImageView/LayerImageBase.h index 3731e9e..c96d748 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/ThresholdImageView/LayerImageBase.h +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/ThresholdImageView/LayerImageBase.h @@ -56,9 +56,12 @@ public: virtual ~ColorLayerImageBasevtkInteractor(); virtual bool OnMouseMove(); + virtual bool OnRightButtonDown(); + virtual bool OnRightButtonUp(); private: - LayerImageBase* _layerImageBase; + bool _state; + LayerImageBase* _layerImageBase; protected: