From: Diego Caceres Date: Tue, 11 Oct 2011 16:21:01 +0000 (+0000) Subject: DFCH: Manual paint changes! X-Git-Tag: v1.0.4~57 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=8138ced89fa9f1cc6933ff739dfa28b1e3c3883b;p=creaMaracasVisu.git DFCH: Manual paint changes! --- diff --git a/lib/maracasVisuLib/CMakeLists.txt b/lib/maracasVisuLib/CMakeLists.txt index fc4152e..060e92d 100644 --- a/lib/maracasVisuLib/CMakeLists.txt +++ b/lib/maracasVisuLib/CMakeLists.txt @@ -65,8 +65,8 @@ IF ( BUILD_${LIBRARY_NAME} ) FILE(GLOB ${LIBRARY_NAME}_SOURCES_MANUAL_CONTOUR src/interface/wxWindows/widgets/manualContour/*.cpp ) FILE(GLOB ${LIBRARY_NAME}_HEADERS_MANUAL_PAINT "src/interface/wxWindows/widgets/manualPaint/*.h") - FILE(GLOB ${LIBRARY_NAME}_SOURCES_MANUAL_PAINT src/interface/wxWindows/widgets/manualPaint/*.cpp ) - FILE(GLOB ${LIBRARY_NAME}_SOURCES_MANUAL_PAINT src/interface/wxWindows/widgets/manualPaint/*.cxx ) + FILE(GLOB ${LIBRARY_NAME}_SOURCES_MANUAL_PAINT src/interface/wxWindows/widgets/manualPaint/*.cpp src/interface/wxWindows/widgets/manualPaint/*.cxx ) + # FILE(GLOB ${LIBRARY_NAME}_SOURCES_MANUAL_PAINT src/interface/wxWindows/widgets/manualPaint/*.cxx ) #DFCH FILE(GLOB ${LIBRARY_NAME}_HEADERS_KERNEL "src/kernel/*.h") FILE(GLOB ${LIBRARY_NAME}_SOURCES_KERNEL src/kernel/*.cxx src/kernel/*.cpp src/kernel/*.cc) diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualPaint/BrushFilter.cpp b/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualPaint/BrushFilter.cpp index d58d6db..c174558 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualPaint/BrushFilter.cpp +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualPaint/BrushFilter.cpp @@ -119,13 +119,13 @@ void BrushFilter::Run() // virtual zz=zz*zz; if (_brushform==0) { - this->CalculateMinMaxRegion(i,j,k); //DFCH + //this->CalculateMinMaxRegion(i,j,k); //DFCH _image->SetScalarComponentFromFloat (i,j,k, 0, value ); } else if (_brushform==1) { if ((xx+yy+zz)<=rr) { - this->CalculateMinMaxRegion(i,j,k); //DFCH + //this->CalculateMinMaxRegion(i,j,k); //DFCH _image->SetScalarComponentFromFloat (i,j,k, 0, value ); } } // _brushform diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualPaint/FillFilter.cpp b/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualPaint/FillFilter.cpp index 694c6ab..0e36513 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualPaint/FillFilter.cpp +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualPaint/FillFilter.cpp @@ -99,7 +99,7 @@ void FillFilter::FillToolRecursive(int px,int py, int pz) { if (_usingAuxImageFill==true) { - this->CalculateMinMaxRegion(px,py,pz); //DFCH + //this->CalculateMinMaxRegion(px,py,pz); //DFCH _auxImageFill->SetScalarComponentFromFloat (px, py, pz,0, 0); } _tmpDistfill=(px-_pxfill)*(px-_pxfill) + (py-_pyfill)*(py-_pyfill) + (pz-_pzfill)*(pz-_pzfill); @@ -150,7 +150,7 @@ void FillFilter::FillToolRecursive(int px,int py, int pz) if ( _auxGrayLevelValidationFill==true ) { - this->CalculateMinMaxRegion(px,py,pz); //DFCH + //this->CalculateMinMaxRegion(px,py,pz); //DFCH _image->SetScalarComponentFromFloat (px,py,pz, 0, (float)_graylevel ); if (_countRecursiveFill< _limitRecursionFill) @@ -259,7 +259,7 @@ void FillFilter::SetAuxImageFill(int px,int py, int pz) { if ((px>=_minX) && (px<=_maxX) && (py>=_minY) && (py<=_maxY) && (pz>=_minZ) && (pz<=_maxZ)) { - this->CalculateMinMaxRegion(px,py,pz); //DFCH + //this->CalculateMinMaxRegion(px,py,pz); //DFCH _auxImageFill->SetScalarComponentFromFloat (px, py, pz,0, 1); } } diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualPaint/ManualPaintControler.cpp b/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualPaint/ManualPaintControler.cpp index cdfc6ba..f51d7d2 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualPaint/ManualPaintControler.cpp +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualPaint/ManualPaintControler.cpp @@ -49,7 +49,7 @@ void ManualPaintControler::PaintImage(int px, int py, int pz) { } //--------------------------------------------------------------------------- -void ManualPaintControler::SetImageUndo() +/*void ManualPaintControler::SetImageUndo() { _manualPaintModel->SetUndoImage(); -} +}*/ diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualPaint/ManualPaintModel.cpp b/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualPaint/ManualPaintModel.cpp index 3c1f351..c610bd7 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualPaint/ManualPaintModel.cpp +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualPaint/ManualPaintModel.cpp @@ -4,7 +4,7 @@ ManualPaintModel::ManualPaintModel() { _tool = 0; // 0 pencil , 1 fill _brushfilter = new BrushFilter(); _fillfilter = new FillFilter(); - _imageUndoRedo = new ImageUndoRedo(); + //_imageUndoRedo = new ImageUndoRedo(); } //--------------------------------------------------------------------------- @@ -40,7 +40,7 @@ void ManualPaintModel::Set2D3D(int dim2D3D) { void ManualPaintModel::SetImage(vtkImageData *image) { _brushfilter->SetImage(image); _fillfilter->SetImage(image); - _imageUndoRedo->SetImage(image); + //_imageUndoRedo->SetImage(image); } //--------------------------------------------------------------------------- @@ -91,7 +91,7 @@ void ManualPaintModel::GetScalarRange(double * range) { _fillfilter->GetScalarRange(range); } //--------------------------------------------------------------------------- -void ManualPaintModel::SetUndoImage() { +/*void ManualPaintModel::SetUndoImage() { RegionStructUR* region = NULL; if (_tool == 0) { region = this->_brushfilter->GetModifiedRegion(); @@ -107,4 +107,4 @@ void ManualPaintModel::SetUndoImage() { void ManualPaintModel::Undo() { //this->_imageUndoRedo->Undo(); -} +}*/ diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualPaint/ManualPaintModel.h b/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualPaint/ManualPaintModel.h index 93adac9..e8c8b04 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualPaint/ManualPaintModel.h +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualPaint/ManualPaintModel.h @@ -24,15 +24,15 @@ public: void SetRangeMin( int min ); void SetRangeMax( int max ); void GetScalarRange( double * range ); - void SetUndoImage();//DFCH - void Undo();//DFCH + //void SetUndoImage();//DFCH + //void Undo();//DFCH private: int _tool; BrushFilter *_brushfilter; FillFilter *_fillfilter; - ImageUndoRedo *_imageUndoRedo; + //ImageUndoRedo *_imageUndoRedo; protected: diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualPaint/baseFilterManualPaint.cpp b/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualPaint/baseFilterManualPaint.cpp index d9ce41a..80dbcc4 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualPaint/baseFilterManualPaint.cpp +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualPaint/baseFilterManualPaint.cpp @@ -1,8 +1,8 @@ #include "baseFilterManualPaint.h" baseFilterManualPaint::baseFilterManualPaint() { - _MRegion = new RegionStructUR(); - CleanModifiedRegion(); + //_MRegion = new RegionStructUR(); + //CleanModifiedRegion(); _graylevel = 0.0; _2D3D = 1; // 0 2D , 1 true 3D _direction = 0; // 1 XZ , 0 YZ , 2 XY @@ -109,6 +109,7 @@ void baseFilterManualPaint::SetGeneralMinMax(int minX, int maxX, int minY, void baseFilterManualPaint::GetScalarRange(double * range) { range = this->_image->GetScalarRange(); } +/* RegionStructUR* baseFilterManualPaint::GetModifiedRegion() { return (this->_MRegion); } //DFCH @@ -138,4 +139,5 @@ void baseFilterManualPaint::CalculateMinMaxRegion(const int& i, const int& j, this->_MRegion->maxZ = k; } //fi } +*/ diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualPaint/baseFilterManualPaint.h b/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualPaint/baseFilterManualPaint.h index ad3f662..f8e521a 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualPaint/baseFilterManualPaint.h +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualPaint/baseFilterManualPaint.h @@ -18,15 +18,15 @@ class baseFilterManualPaint { void ResetGeneralMinMax(); void SetGeneralMinMax(int minX,int maxX,int minY,int maxY,int minZ,int maxZ); void GetScalarRange( double * range ); - RegionStructUR* GetModifiedRegion();//DFCH + /* RegionStructUR* GetModifiedRegion();//DFCH void CleanModifiedRegion();//DFCH - void CalculateMinMaxRegion( const int& i, const int& j, const int& k);//DFCH + void CalculateMinMaxRegion( const int& i, const int& j, const int& k);//DFCH*/ virtual void Run(); private: protected: - RegionStructUR *_MRegion; //Saves the last modified region (MinX, MaxX, MinY, MaxY, MinZ, MaxZ). + //RegionStructUR *_MRegion; //Saves the last modified region (MinX, MaxX, MinY, MaxY, MinZ, MaxZ). vtkImageData *_image; int _direction; int _px; // start point of the brush diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualPaint/imageDequeUR.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualPaint/imageDequeUR.cxx index 5ac8965..1cfbe81 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualPaint/imageDequeUR.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualPaint/imageDequeUR.cxx @@ -1,41 +1,39 @@ -/* #include "imageDequeUR.h" ImageDequeUR::ImageDequeUR() { - this->m_currentPos = 0; + } -//virtual ImageDequeUR::~ImageDequeUR() { } -//virtual -void ImageDequeUR::addImageToContainer(ImageType* img, const RegionS& region) { +void ImageDequeUR::AddImageToUndoContainer(ImageType* img, + const RegionS& region) { + } -//virtual -void ImageDequeUR::loadImageToPMemory() { +void ImageDequeUR::AddImageToRedoContainer(ImageType* img, + const RegionS& region) { + } -//virtual -void ImageDequeUR::removeImageFromPMemory() { +void ImageDequeUR::LoadUndoImageToPMemory(const unsigned int& index) { } -ImageType* ImageDequeUR::undo() { - return NULL; +void ImageDequeUR::RemoveUndoImageFromPMemory(const unsigned int& index) { + } -ImageType* ImageDequeUR::redo() { - return NULL; +void ImageDequeUR::LoadRedoImageToPMemory(const unsigned int& index) { + } -void ImageDequeUR::removeFirstImageFromContainer() { - this->m_ImgDeque.pop_front(); +void ImageDequeUR::RemoveRedoImageFromPMemory(const unsigned int& index) { + } -void ImageDequeUR::removeLastImageFromContainer() { - this->m_ImgDeque.pop_back(); +void ImageDequeUR::SaveImageAsMHD(ImageType* img, const std::string& filename) { + } -void ImageDequeUR::cleanContainer() { - this->m_ImgDeque.clear(); +ImageInfoUR ImageDequeUR::Undo() { + ImageInfoUR im; + return im; } -void ImageDequeUR::cleanContainerFromIndex(const unsigned int& index) { - for (int i = this->m_ImgDeque.size(); i >= index; i--) { - this->m_ImgDeque.pop_back(); - } +ImageInfoUR ImageDequeUR::Redo() { + ImageInfoUR im; + return im; } -*/ diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualPaint/managerUR.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualPaint/managerUR.cxx index 126fee0..e298e79 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualPaint/managerUR.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualPaint/managerUR.cxx @@ -5,42 +5,29 @@ * Author: caceres */ -/*#include "managerUR.h" +#include "managerUR.h" -ManagerUR::ManagerUR(ImageType* current) { +ManagerUR::ManagerUR() { - this->m_CurrentImage = current; - this->m_CurrentImage->Update(); - this->m_OriginalImage = ImageType::New(); - this->m_OriginalImage->ShallowCopy(m_CurrentImage); } -//virtual ManagerUR::~ManagerUR() { } -//virtual -void ManagerUR::undo() { +void ManagerUR::SetImage(vtkImageData *image) { } -//virtual -void ManagerUR::redo() { +void ManagerUR::Undo() { } -//virtual -void ManagerUR::setUndoImage(const RegionSType& region) { +void ManagerUR::Redo() { } -//virtual -void ManagerUR::setRedoImage( ) { +void ManagerUR::SetUndoImage(const RegionSType& region) { } -void ManagerUR::setOriginalImage(ImageType* img) { - this->m_OriginalImage = img; -} -void ManagerUR::setCurrentImage(ImageType* img) { - this->m_CurrentImage = img; +void ManagerUR::SetRedoImage(const RegionSType& region) { + } -//virtual -void ManagerUR::drawUR(ImageType* urImage, const RegionSType& region){ +void ManagerUR::DrawUR(ImageInfoUR imageInfo) { -}*/ +} diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualPaint/vtkInteractorManualPaint.cpp b/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualPaint/vtkInteractorManualPaint.cpp index a148339..0b607c2 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualPaint/vtkInteractorManualPaint.cpp +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualPaint/vtkInteractorManualPaint.cpp @@ -38,7 +38,7 @@ bool vtkInteractorManualPaint::OnLeftButtonDown() { //--------------------------------------------------------------------------- bool vtkInteractorManualPaint::OnLeftButtonUp() { - _manualPaintControler->SetImageUndo(); + //_manualPaintControler->SetImageUndo(); _state = false; return true; } diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualPaint/wxManualPaintPanel.cpp b/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualPaint/wxManualPaintPanel.cpp index 22b1400..44b7c0c 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualPaint/wxManualPaintPanel.cpp +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualPaint/wxManualPaintPanel.cpp @@ -3,7 +3,6 @@ wxManualPaintPanel::wxManualPaintPanel(wxWindow * parent) : wxPanel(parent, -1) { - wxPanel *panel = this; wxSizer *sizer = NULL; @@ -340,7 +339,7 @@ void wxManualPaintPanel::OnCopy(wxCommandEvent &event) { //--------------------------------------------------------------------------- void wxManualPaintPanel::OnUndo(wxCommandEvent &event) { - this->_manualPaintModel->Undo(); + //this->_manualPaintModel->Undo(); } //--------------------------------------------------------------------------------------------------------------------------------