2 # ---------------------------------------------------------------------
4 # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
6 # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
7 # Previous Authors : Laurent Guigues, Jean-Pierre Roux
8 # CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
10 # This software is governed by the CeCILL-B license under French law and
11 # abiding by the rules of distribution of free software. You can use,
12 # modify and/ or redistribute the software under the terms of the CeCILL-B
13 # license as circulated by CEA, CNRS and INRIA at the following URL
14 # http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
15 # or in the file LICENSE.txt.
17 # As a counterpart to the access to the source code and rights to copy,
18 # modify and redistribute granted by the license, users are provided only
19 # with a limited warranty and the software's author, the holder of the
20 # economic rights, and the successive licensors have only limited
23 # The fact that you are presently reading this means that you have had
24 # knowledge of the CeCILL-B license and that you accept its terms.
25 # ------------------------------------------------------------------------ */
27 /*=========================================================================
29 Program: ConceptInstantHandler
30 Module: $RCSfile: ConceptInstantHandler.h,v $
32 Date: $Date: 2012/11/15 12:12:26 $
33 Version: $Revision: 1.8 $
34 Objective: Wrapper fo the concepts that subscribe to the instant handler
35 Author: Monica Maria Lozano Romero
40 This software is distributed WITHOUT ANY WARRANTY; without even
41 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
42 PURPOSE. See the above copyright notice for more information.
45 =========================================================================*/
66 #ifndef __CONCEPTINSTANTHANDLER_H_INCLUDED__
67 #define __CONCEPTINSTANTHANDLER_H_INCLUDED__
71 #ifdef creaEnvironment_BUILD_SHARED
72 #define creaEnvironment_EXPORTS __declspec( dllexport )
74 #define creaEnvironment_EXPORTS
77 #define creaEnvironment_EXPORTS
81 class creaEnvironment_EXPORTS ConceptInstantHandler
84 //===== CONSTANTS ========
86 * if the concept is being reproduced in real time
88 const static int REAL_TIME=1;
90 * if the concept is being reproduced by doing
91 * plus plus to its indexes
93 const static int PLUS_PLUS=2;
96 //====== LIFECYCLE ========
97 ConceptInstantHandler(std::string name,int mode,int positionInReproduction);
98 ~ConceptInstantHandler();
99 //====== OPERATIONS =======
101 * change the actual index by increasing
102 * the index until the maximum by the increaseValue
106 * change the actual index by decreasing
107 * the index until zero by the decreaseValue
109 void previousIndex();
111 //====== INQUIRY =========
115 std::string getName();
117 * @return PositionInReproduction
125 * @return increaseValue
127 int getIncreaseValue();
130 * @return decreaseValue
132 int getDecreaseValue();
135 * @return indexInInstant
137 int getIndexInInstant();
139 * @return actualIndex
143 * @return maximumIndex
146 int getMaximumIndex();
148 * @return timeReproduction
150 double getTimeReproduction();
157 * if the actual index is not the maximum index
161 * if the actual index is not zero
163 bool hasPreviousIndex();
168 double getInitialTime();
171 //====== ACCESS ==========
173 * Sets the name of the concept
174 * @param name, new name
176 void setName(std::string name);
178 * Sets the position of the concept
181 void setPosition(int position);
183 * Sets the mode of the concept
184 * @param mode, new mode= REAL_TIME or
187 void setMode(int mode);
189 * Set Increase of the concept
190 * @param increaseValue
192 void setIncreaseValue(int increaseValue);
195 * Set decrease of the concept
196 * @param decreaseValue
198 void setDecreaseValue(int decreaseValue);
201 * Sets the index of the concept in the instant
202 * @param indexInInstant
204 void setIndexInInstant(int indexInInstant);
206 * Sets sets the maximum value
207 * @param maximumIndex
209 void setMaximumIndex(int maximumIndex);
211 * set the actualIndex
214 void setActualIndex(int index);
216 * set the timeReproduction
219 void setTimeReproduction(double time);
224 void setScale(double scale);
229 void setActualTime(double actualTime);
231 * reset the initial time
233 void resetInitialTime();
235 * Sets the initial time
237 void setInitialTime(double time);
242 //======= ATTRIBUTES=======
245 * Name of the concept
249 * Mode of changing the instant
256 * position in the reproduction
258 int positionInReproduction;
260 * Increment for an instant
265 * Decrease for an instant
278 * maximum index that can have in the instant
282 * Time in miliseconds of the reproduction
284 double timeReproduction;
286 * Scale use for calculate the index
287 * of the concept according to the time of reproduction
288 * defined in timeReproduction
289 * scaleTime=maximumIndex/timeReproduction
293 * actual time of the reproduction
303 //====== PRIVATE METHODS=========