]> Creatis software - creaMaracasVisu.git/blob - lib/maracasVisuLib/src/interface/wxWindows/widgets/imageUndoRedo/image3DDequeUR.h
#3332 creaContours Bug New - Manual Paint UnDo ReDo with vtk update (working)
[creaMaracasVisu.git] / lib / maracasVisuLib / src / interface / wxWindows / widgets / imageUndoRedo / image3DDequeUR.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        image3DDequeUR.h
28  * @brief       This file contains the Image3DDequeUR 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 IMAGE3DDEQUEUR_H_
35 #define IMAGE3DDEQUEUR_H_
36
37 #include <deque>
38
39 #include "imageDequeUR.h"
40
41
42
43 /*! @class Image3DDequeUR image3DDequeUR.h "image3DDequeUR.cxx"
44  *      @brief This class contains the management of the undo/redo deque - Concrete Class
45  *  @details This class derives from ImageDequeUR.
46  */
47 class Image3DDequeUR: public ImageDequeUR {
48 public:
49         //typedef definition
50         // ----------------------------------------------------------------------------------
51         /*!     @typedef std::deque<ImageInfoUR*> ImageInfoDeque;
52          *      @brief Defines the deque of ImageInfoUR for the undo/redo.
53          */
54         typedef std::deque<ImageInfoUR*> ImageInfoDeque;
55         // ----------------------------------------------------------------------------------
56 public:
57         // ----------------------------------------------------------------------------------
58         /*! @fn Image3DDequeUR();
59          * @brief This is the default constructor.
60          */
61         Image3DDequeUR();
62         // ----------------------------------------------------------------------------------
63         /*! @fn virtual ~Image3DDequeUR();
64          * @brief This is the destructor.
65          */
66         virtual ~Image3DDequeUR();
67         // ----------------------------------------------------------------------------------
68         /*! @fn virtual void AddImagesToURContainer(VTKImageDataPointerType imgUndo,
69          VTKImageDataPointerType imgRedo, ImageMManager* imMManager);
70          * @brief This method adds the images for undo and redo in a container
71          * @param imgUndo The undoImage cropped.
72          * @param imgRedo The redoImage cropped.
73          * @param imManager The image manager.
74          */
75         virtual void AddImagesToURContainer(VTKImageDataPointerType imgUndo,
76                         VTKImageDataPointerType imgRedo, ImageMManager* imMManager);
77         // ----------------------------------------------------------------------------------
78         /*! @fn virtual void CleanURContainerFromIndex(const int& index);
79          * @brief This method allows to clean the container from a given index.
80          * @param index The index.
81          */
82         virtual void CleanURContainerFromIndex(const int& index);
83         // ----------------------------------------------------------------------------------
84         /*! @fn virtual void ManageMemory();
85          * @brief This method cleans the memory.
86          * @details This method cleans the principal memory when the images are not in use.
87          */
88         virtual void ManageMemory();
89         // ----------------------------------------------------------------------------------
90         /*! @fn virtual ImageInfoUR* Undo();
91          * @brief This method is the undo action.
92          * @return
93          */
94         virtual ImageInfoUR* Undo();
95         // ----------------------------------------------------------------------------------
96         /*! @fn virtual ImageInfoUR* Redo();
97          * @brief This method is the redo action.
98          * @return
99          */
100         virtual ImageInfoUR* Redo();
101         // ----------------------------------------------------------------------------------
102         /*! @fn void SetGlobalPath(const StringType& globalPath);
103          * @brief This method sets the global path where the temporary files will be stored.
104          * @param globalPath The String with the path.
105          */
106         void SetGlobalPath(const StringType& globalPath);
107         // ----------------------------------------------------------------------------------
108         /*! @fn StringType GetGlobalPath();
109          * @brief This method returns a String with the global path.
110          * @return
111          */
112         StringType GetGlobalPath();
113         // ----------------------------------------------------------------------------------
114         /*! @fn StringType GetImageName(const int & pos);
115          * @brief This method returns a String with an image name which won't be repeated.
116          * @param pos The position of the container to manage a sequence.
117          * @return
118          */
119         StringType GetImageName(const int & pos);
120         // ----------------------------------------------------------------------------------
121         /*! @fn void CleanHardDisk();
122          * @brief This method cleans the hard disk of the temporary files.
123          */
124         void CleanHardDisk();
125         // ----------------------------------------------------------------------------------
126 protected:
127         ImageInfoDeque  m_ImgURDeque;   //!<This is the container of the images for undo and redo.
128         int                     m_CurrentURPos; //!<This is the index where is located the undo and redo state.
129         StringType              m_GlobalPath;   //!<This is the string with the global path.
130         StringType              m_IDImages;     //!<This is the string with the ID of the images (For the filenames).
131 };
132
133 #endif /* IMAGE3DDEQUEUR_H_ */