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_
39 #include "imageDequeUR.h"
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.
47 class Image3DDequeUR: public ImageDequeUR {
50 // ----------------------------------------------------------------------------------
51 /*! @typedef std::deque<ImageInfoUR*> ImageInfoDeque;
52 * @brief Defines the deque of ImageInfoUR for the undo/redo.
54 typedef std::deque<ImageInfoUR*> ImageInfoDeque;
55 // ----------------------------------------------------------------------------------
57 // ----------------------------------------------------------------------------------
58 /*! @fn Image3DDequeUR();
59 * @brief This is the default constructor.
62 // ----------------------------------------------------------------------------------
63 /*! @fn virtual ~Image3DDequeUR();
64 * @brief This is the destructor.
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.
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.
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.
88 virtual void ManageMemory();
89 // ----------------------------------------------------------------------------------
90 /*! @fn virtual ImageInfoUR* Undo();
91 * @brief This method is the undo action.
94 virtual ImageInfoUR* Undo();
95 // ----------------------------------------------------------------------------------
96 /*! @fn virtual ImageInfoUR* Redo();
97 * @brief This method is the redo action.
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.
106 void SetGlobalPath(const StringType& globalPath);
107 // ----------------------------------------------------------------------------------
108 /*! @fn StringType GetGlobalPath();
109 * @brief This method returns a String with the global path.
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.
119 StringType GetImageName(const int & pos);
120 // ----------------------------------------------------------------------------------
121 /*! @fn void CleanHardDisk();
122 * @brief This method cleans the hard disk of the temporary files.
124 void CleanHardDisk();
125 // ----------------------------------------------------------------------------------
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 StringType m_PrivateID; //!<This is the string with the private ID of the images (For the filenames).
134 #endif /* IMAGE3DDEQUEUR_H_ */