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 image3DDequeUR.h
28 * @brief This file contains the Image3DDequeUR class.
30 * @author Diego CACERES (diego.caceres[AT]creatis.insa-lyon.fr)
34 #ifndef IMAGE3DDEQUEUR_H_
35 #define IMAGE3DDEQUEUR_H_
37 #include "imageDequeUR.h"
40 /*! @class Image3DDequeUR image3DDequeUR.h "image3DDequeUR.cxx"
41 * @brief This class contains the management of the undo/redo deque - Concrete Class
42 * @details This class derives from ImageDequeUR.
44 class Image3DDequeUR: public ImageDequeUR {
47 // ----------------------------------------------------------------------------------
48 /*! @typedef std::deque<ImageInfoUR*> ImageInfoDeque;
49 * @brief Defines the deque of ImageInfoUR for the undo/redo.
51 typedef std::deque<ImageInfoUR*> ImageInfoDeque;
52 // ----------------------------------------------------------------------------------
54 // ----------------------------------------------------------------------------------
55 /*! @fn Image3DDequeUR();
56 * @brief This is the default constructor.
59 // ----------------------------------------------------------------------------------
60 /*! @fn virtual ~Image3DDequeUR();
61 * @brief This is the destructor.
63 virtual ~Image3DDequeUR();
64 // ----------------------------------------------------------------------------------
65 /*! @fn virtual void AddImagesToURContainer(VTKImageDataPointerType imgUndo,
66 VTKImageDataPointerType imgRedo, ImageMManager* imMManager);
67 * @brief This method adds the images for undo and redo in a container
68 * @param imgUndo The undoImage cropped.
69 * @param imgRedo The redoImage cropped.
70 * @param imManager The image manager.
72 virtual void AddImagesToURContainer(VTKImageDataPointerType imgUndo,
73 VTKImageDataPointerType imgRedo, ImageMManager* imMManager);
74 // ----------------------------------------------------------------------------------
75 /*! @fn virtual void CleanURContainerFromIndex(const int& index);
76 * @brief This method allows to clean the container from a given index.
77 * @param index The index.
79 virtual void CleanURContainerFromIndex(const int& index);
80 // ----------------------------------------------------------------------------------
81 /*! @fn virtual void ManageMemory();
82 * @brief This method cleans the memory.
83 * @details This method cleans the principal memory when the images are not in use.
85 virtual void ManageMemory();
86 // ----------------------------------------------------------------------------------
87 /*! @fn virtual ImageInfoUR* Undo();
88 * @brief This method is the undo action.
91 virtual ImageInfoUR* Undo();
92 // ----------------------------------------------------------------------------------
93 /*! @fn virtual ImageInfoUR* Redo();
94 * @brief This method is the redo action.
97 virtual ImageInfoUR* Redo();
98 // ----------------------------------------------------------------------------------
99 /*! @fn void SetGlobalPath(const StringType& globalPath);
100 * @brief This method sets the global path where the temporary files will be stored.
101 * @param globalPath The String with the path.
103 void SetGlobalPath(const StringType& globalPath);
104 // ----------------------------------------------------------------------------------
105 /*! @fn StringType GetGlobalPath();
106 * @brief This method returns a String with the global path.
109 StringType GetGlobalPath();
110 // ----------------------------------------------------------------------------------
111 /*! @fn StringType GetImageName(const int & pos);
112 * @brief This method returns a String with an image name which won't be repeated.
113 * @param pos The position of the container to manage a sequence.
116 StringType GetImageName(const int & pos);
117 // ----------------------------------------------------------------------------------
118 /*! @fn void CleanHardDisk();
119 * @brief This method cleans the hard disk of the temporary files.
121 void CleanHardDisk();
122 // ----------------------------------------------------------------------------------
124 ImageInfoDeque m_ImgURDeque; //!<This is the container of the images for undo and redo.
125 int m_CurrentURPos; //!<This is the index where is located the undo and redo state.
126 StringType m_GlobalPath; //!<This is the string with the global path.
127 StringType m_IDImages; //!<This is the string with the ID of the images (For the filenames).
130 #endif /* IMAGE3DDEQUEUR_H_ */