]> Creatis software - creaMaracasVisu.git/blob - lib/maracasVisuLib/src/interface/wxWindows/widgets/imageUndoRedo/imageUndoRedo.h
Support #1768 CREATIS Licence insertion
[creaMaracasVisu.git] / lib / maracasVisuLib / src / interface / wxWindows / widgets / imageUndoRedo / imageUndoRedo.h
1 /*# ---------------------------------------------------------------------
2 #
3 # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
4 #                        pour la Sant�)
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
8 #
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.
15 #
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
20 #  liability.
21 #
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 # ------------------------------------------------------------------------ */
25
26 /*!
27  * @file        imageUndoRedo.h
28  * @brief       This file contains the ImageUndoRedo class.
29  * @author      Info-Dev
30  * @author      Diego CACERES (diego.caceres[AT]creatis.insa-lyon.fr)
31  * @date        2011-11-15
32  */
33
34 #ifndef IMAGEUNDOREDO_H_
35 #define IMAGEUNDOREDO_H_
36
37 #include "managerUR.h"
38
39 /*! @class ImageUndoRedo imageUndoRedo.h "imageUndoRedo.cxx"
40  *      @brief This class manages the undo/redo -- Concrete Class
41  *      @details This class derives from ManagerUR
42  */
43 class ImageUndoRedo: public ManagerUR {
44
45 public:
46         //typedef definition
47         // ----------------------------------------------------------------------------------
48         /*!     @typedef typedef Image3DDequeUR IDequeType;
49          *      @brief Redefines the Image3DDequeUR type
50          */
51         typedef Image3DDequeUR IDequeType;
52         // ----------------------------------------------------------------------------------
53 public:
54         // ----------------------------------------------------------------------------------
55         /*! @fn ImageUndoRedo();
56          * @brief This is the default constructor.
57          */
58         ImageUndoRedo();
59         // ----------------------------------------------------------------------------------
60         /*! @fn virtual ~ImageUndoRedo();
61          * @brief This is the destructor.
62          */
63         virtual ~ImageUndoRedo();
64         // ----------------------------------------------------------------------------------
65         /*! @fn virtual void Undo();
66          * @brief This method manages the undo action.
67          */
68         virtual void Undo();
69         // ----------------------------------------------------------------------------------
70         /*! @fn virtual void Redo();
71          * @brief This method manages the redo action.
72          */
73         virtual void Redo();
74         // ----------------------------------------------------------------------------------
75         /*! @fn virtual void SetImage(VTKImageDataPointerType image);
76          * @brief This method sets the modification image (The image which will be modified an manipulated)
77          */
78         virtual void SetImage(VTKImageDataPointerType image);
79         // ----------------------------------------------------------------------------------
80         /*! @fn virtual void SetURImages(ImageMManagerType* imMManager);
81          * @brief This methods adds a new image Undo/Redo.
82          */
83         virtual void SetURImages(ImageMManagerType* imMManager);
84         // ----------------------------------------------------------------------------------
85         /*! @fn void UpdateUndoImage();
86          * @brief This method updates the undo image t(m_CurrentImage - 1).
87          */
88         void UpdateUndoImage();
89         // ----------------------------------------------------------------------------------
90         /*! @fn void SetCurrentImage(VTKImageDataPointerType img);
91          * @brief This method sets the image to be manipulated.
92          */
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).
98          */
99         VTKImageDataPointerType GetImageRegion(const RegionSType& region,
100                         VTKImageDataPointerType img);
101 protected:
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.
105          */
106         virtual void DrawUR(ImageInfoUR* imageInfo, const bool& undo);
107         // ----------------------------------------------------------------------------------
108 protected:
109
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).
113
114 };
115
116 #endif /* IMAGEUNDOREDO_H_ */