]> Creatis software - creaMaracasVisu.git/blobdiff - lib/maracasVisuLib/src/interface/wxWindows/widgets/imageUndoRedo/imageUndoRedo.cxx
DFCH: ManualPaint + imageUndoRedo: Undo/Redo functionality its now working =) =)
[creaMaracasVisu.git] / lib / maracasVisuLib / src / interface / wxWindows / widgets / imageUndoRedo / imageUndoRedo.cxx
index 2137a713e5d4fcd57277cf17a94598dfcba30bea..7cc28e581fffdbc62336b41e51f9e950192b1ec5 100755 (executable)
@@ -18,18 +18,17 @@ ImageUndoRedo::~ImageUndoRedo() {
 void ImageUndoRedo::Undo() {
        ImageInfoUR* imageInfo = this->m_ImagesDeque->Undo();
        if (imageInfo != NULL) {
-               //this->SetRedoImage(imageInfo->GetImageMManager());
                this->DrawUR(imageInfo, true);
                this->UpdateUndoImage();
        }
 }
 //virtual
 void ImageUndoRedo::Redo() {
-       /*ImageInfoUR* imageInfo = this->m_ImagesDeque->Redo();
-        if (imageInfo != NULL)
-        {
-        this->DrawUR(imageInfo);
-        }*/
+       ImageInfoUR* imageInfo = this->m_ImagesDeque->Redo();
+       if (imageInfo != NULL) {
+               this->DrawUR(imageInfo, false);
+               this->UpdateUndoImage();
+       }
 }
 void ImageUndoRedo::SetImage(VTKImageDataPointerType image) {
        this->m_CurrentImage = image;
@@ -66,7 +65,7 @@ ImageUndoRedo::VTKImageDataPointerType ImageUndoRedo::GetImageRegion(
        extract->SetVOI(region.minX, region.maxX, region.minY, region.maxY,
                        region.minZ, region.maxZ);
        extract->SetSampleRate(1, 1, 1);
-       extract->SetInput(this->m_UndoImage);
+       extract->SetInput(img);
        VTKImageDataPointerType imgResult = extract->GetOutput();
        imgResult->Update();
        return (imgResult);