]> Creatis software - creaMaracasVisu.git/commitdiff
DFCH: Manual paint changes!
authorDiego Caceres <Diego.Caceres@creatis.insa-lyon.fr>
Tue, 11 Oct 2011 16:21:01 +0000 (16:21 +0000)
committerDiego Caceres <Diego.Caceres@creatis.insa-lyon.fr>
Tue, 11 Oct 2011 16:21:01 +0000 (16:21 +0000)
12 files changed:
lib/maracasVisuLib/CMakeLists.txt
lib/maracasVisuLib/src/interface/wxWindows/widgets/manualPaint/BrushFilter.cpp
lib/maracasVisuLib/src/interface/wxWindows/widgets/manualPaint/FillFilter.cpp
lib/maracasVisuLib/src/interface/wxWindows/widgets/manualPaint/ManualPaintControler.cpp
lib/maracasVisuLib/src/interface/wxWindows/widgets/manualPaint/ManualPaintModel.cpp
lib/maracasVisuLib/src/interface/wxWindows/widgets/manualPaint/ManualPaintModel.h
lib/maracasVisuLib/src/interface/wxWindows/widgets/manualPaint/baseFilterManualPaint.cpp
lib/maracasVisuLib/src/interface/wxWindows/widgets/manualPaint/baseFilterManualPaint.h
lib/maracasVisuLib/src/interface/wxWindows/widgets/manualPaint/imageDequeUR.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/manualPaint/managerUR.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/manualPaint/vtkInteractorManualPaint.cpp
lib/maracasVisuLib/src/interface/wxWindows/widgets/manualPaint/wxManualPaintPanel.cpp

index fc4152ef0d6db49eef75c63b6ae2db8536816246..060e92d9d94862c5cba95b384bc38e66ad55ee8c 100644 (file)
@@ -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)
index d58d6db7d528ca24b7ef322d3fb07e85a81bbd94..c174558261c83575409a0c55022a870c77bae77c 100644 (file)
@@ -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
index 694c6abc8d92e852c5f4374795b4d78d0986ded4..0e3651383f6a1bfbc36474fdb8a2692eb7abd35c 100644 (file)
@@ -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);
     }
 }
index cdfc6ba889bdac6be08a30b61f340da3bce94423..f51d7d29451262d336bc0dfa6f6b0fe95d79fb12 100644 (file)
@@ -49,7 +49,7 @@ void ManualPaintControler::PaintImage(int px, int py, int pz) {
 }
 
 //---------------------------------------------------------------------------
-void ManualPaintControler::SetImageUndo()
+/*void ManualPaintControler::SetImageUndo()
 {
        _manualPaintModel->SetUndoImage();
-}
+}*/
index 3c1f351f7927f9fc2a958313c779448803fa969b..c610bd7766327b298c18967908cb48f75bcbd61b 100644 (file)
@@ -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();
-}
+}*/
index 93adac962337fc698c78ceeaa3c62668c158f668..e8c8b04b830c037a40abf47c83828deb1dd010ac 100644 (file)
@@ -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:
 
index d9ce41aaed5a077d9091134d9588d600b445005f..80dbcc4a8d8f99ebeabaa54615f7608e4bef8bbb 100644 (file)
@@ -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
 }
+*/
 
index ad3f662ea1861e0c3642bf5d7ba4d454fc13c8d1..f8e521a5429677564183b484c759cd0b21dae47a 100644 (file)
@@ -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
index 5ac89654645aaffc71e12ecf6f38b66fdae61c3c..1cfbe8165e00623d2f6ccd4275a38e912cecf1e1 100644 (file)
@@ -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;
 }
-*/
index 126fee0ed8ff96d549bf29c98231668c89f1437e..e298e7981e35311347b1ce5ee3272ff3860601df 100644 (file)
@@ -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) {
 
-}*/
+}
index a1483399af7dc726e4644232b9fd2ebb8ef78855..0b607c2311345d98c9cab59e2c980e30a2cbbf92 100644 (file)
@@ -38,7 +38,7 @@ bool vtkInteractorManualPaint::OnLeftButtonDown() {
 
 //---------------------------------------------------------------------------
 bool vtkInteractorManualPaint::OnLeftButtonUp() {
-       _manualPaintControler->SetImageUndo();
+       //_manualPaintControler->SetImageUndo();
        _state = false;
        return true;
 }
index 22b1400f3933618d04a03b3283ecd92501a6cc3e..44b7c0cd702922019cfd9ed597a4932e49ed5e75 100644 (file)
@@ -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();
 }
 
 //--------------------------------------------------------------------------------------------------------------------------------