1 /*# ---------------------------------------------------------------------
3 # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
5 # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
6 # Previous Authors : Laurent Guigues, Jean-Pierre Roux
7 # CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
9 # This software is governed by the CeCILL-B license under French law and
10 # abiding by the rules of distribution of free software. You can use,
11 # modify and/ or redistribute the software under the terms of the CeCILL-B
12 # license as circulated by CEA, CNRS and INRIA at the following URL
13 # http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
14 # or in the file LICENSE.txt.
16 # As a counterpart to the access to the source code and rights to copy,
17 # modify and redistribute granted by the license, users are provided only
18 # with a limited warranty and the software's author, the holder of the
19 # economic rights, and the successive licensors have only limited
22 # The fact that you are presently reading this means that you have had
23 # knowledge of the CeCILL-B license and that you accept its terms.
24 # ------------------------------------------------------------------------ */
27 * @file imageUndoRedo.h
28 * @brief This file contains the ImageUndoRedo class.
30 * @author Diego CACERES (diego.caceres[AT]creatis.insa-lyon.fr)
34 #ifndef IMAGEUNDOREDO_H_
35 #define IMAGEUNDOREDO_H_
37 #include "managerUR.h"
39 /*! @class ImageUndoRedo imageUndoRedo.h "imageUndoRedo.cxx"
40 * @brief This class manages the undo/redo -- Concrete Class
41 * @details This class derives from ManagerUR
43 class ImageUndoRedo: public ManagerUR {
47 // ----------------------------------------------------------------------------------
48 /*! @typedef typedef Image3DDequeUR IDequeType;
49 * @brief Redefines the Image3DDequeUR type
51 typedef Image3DDequeUR IDequeType;
52 // ----------------------------------------------------------------------------------
54 // ----------------------------------------------------------------------------------
55 /*! @fn ImageUndoRedo();
56 * @brief This is the default constructor.
59 // ----------------------------------------------------------------------------------
60 /*! @fn virtual ~ImageUndoRedo();
61 * @brief This is the destructor.
63 virtual ~ImageUndoRedo();
64 // ----------------------------------------------------------------------------------
65 /*! @fn virtual void Undo();
66 * @brief This method manages the undo action.
69 // ----------------------------------------------------------------------------------
70 /*! @fn virtual void Redo();
71 * @brief This method manages the redo action.
74 // ----------------------------------------------------------------------------------
75 /*! @fn virtual void SetImage(VTKImageDataPointerType image);
76 * @brief This method sets the modification image (The image which will be modified an manipulated)
78 virtual void SetImage(VTKImageDataPointerType image);
79 // ----------------------------------------------------------------------------------
80 /*! @fn virtual void SetURImages(ImageMManagerType* imMManager);
81 * @brief This methods adds a new image Undo/Redo.
83 virtual void SetURImages(ImageMManagerType* imMManager);
84 // ----------------------------------------------------------------------------------
85 /*! @fn void UpdateUndoImage();
86 * @brief This method updates the undo image t(m_CurrentImage - 1).
88 void UpdateUndoImage();
89 // ----------------------------------------------------------------------------------
90 /*! @fn void SetCurrentImage(VTKImageDataPointerType img);
91 * @brief This method sets the image to be manipulated.
93 void SetCurrentImage(VTKImageDataPointerType img);
94 // ----------------------------------------------------------------------------------
95 /*! @fn VTKImageDataPointerType GetImageRegion(const RegionSType& region,
96 VTKImageDataPointerType img);
97 * @brief This method extract from an image the region of interest (In the undo/redo returns the volume of the modified or t-1 image).
99 VTKImageDataPointerType GetImageRegion(const RegionSType& region,
100 VTKImageDataPointerType img);
102 // ----------------------------------------------------------------------------------
103 /*! @fn virtual void DrawUR(ImageInfoUR* imageInfo, const bool& undo);
104 * @brief This method writes in the visualized image the changes of the undo/redo.
106 virtual void DrawUR(ImageInfoUR* imageInfo, const bool& undo);
107 // ----------------------------------------------------------------------------------
110 IDequeType *m_ImagesDeque; //!<The manager of the ImagesDeque.
111 VTKImageDataPointerType m_UndoImage; //!< This is the image for undo t(m_CurrentImage - 1).
112 VTKImageDataPointerType m_CurrentImage; //!< This is the current image (The modification image).
116 #endif /* IMAGEUNDOREDO_H_ */