1 /*=========================================================================
3 Program: ConceptInstantHandler
4 Module: $RCSfile: ConceptInstantHandler.h,v $
6 Date: $Date: 2008/11/04 16:33:55 $
7 Version: $Revision: 1.4 $
8 Objective: Wrapper fo the concepts that subscribe to the instant handler
9 Authot: Monica Maria Lozano Romero
14 This software is distributed WITHOUT ANY WARRANTY; without even
15 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
16 PURPOSE. See the above copyright notice for more information.
19 =========================================================================*/
44 #ifndef __CONCEPTINSTANTHANDLER_H_INCLUDED__
45 #define __CONCEPTINSTANTHANDLER_H_INCLUDED__
48 //If we're using a dynamic library
49 # ifdef CreaEnvironment_BUILD_SHARED
50 # define CreaEnvironment_EXPORTS __declspec( dllexport )
52 # define CreaEnvironment_EXPORTS //__declspec( dllimport )
53 # endif //maracasvisulib_EXPORTS
55 #ifndef CreaEnvironment_EXPORTS
56 #define CreaEnvironment_EXPORTS
61 class CreaEnvironment_EXPORTS ConceptInstantHandler
64 //===== CONSTANTS ========
66 * if the concept is being reproduced in real time
68 const static int REAL_TIME=1;
70 * if the concept is being reproduced by doing
71 * plus plus to its indexes
73 const static int PLUS_PLUS=2;
76 //====== LIFECYCLE ========
77 ConceptInstantHandler(std::string name,int mode,int positionInReproduction);
78 ~ConceptInstantHandler();
79 //====== OPERATIONS =======
81 * change the actual index by increasing
82 * the index until the maximum by the increaseValue
86 * change the actual index by decreasing
87 * the index until zero by the decreaseValue
92 //====== INQUIRY =========
96 std::string getName();
98 * @return PositionInReproduction
106 * @return increaseValue
108 int getIncreaseValue();
111 * @return decreaseValue
113 int getDecreaseValue();
116 * @return indexInInstant
118 int getIndexInInstant();
120 * @return actualIndex
124 * @return maximumIndex
127 int getMaximumIndex();
129 * @return timeReproduction
131 double getTimeReproduction();
138 * if the actual index is not the maximum index
142 * if the actual index is not zero
144 bool hasPreviousIndex();
149 double getInitialTime();
152 //====== ACCESS ==========
154 * Sets the name of the concept
155 * @param name, new name
157 void setName(std::string name);
159 * Sets the position of the concept
162 void setPosition(int position);
164 * Sets the mode of the concept
165 * @param mode, new mode= REAL_TIME or
168 void setMode(int mode);
170 * Set Increase of the concept
171 * @param increaseValue
173 void setIncreaseValue(int increaseValue);
176 * Set decrease of the concept
177 * @param decreaseValue
179 void setDecreaseValue(int decreaseValue);
182 * Sets the index of the concept in the instant
183 * @param indexInInstant
185 void setIndexInInstant(int indexInInstant);
187 * Sets sets the maximum value
188 * @param maximumIndex
190 void setMaximumIndex(int maximumIndex);
192 * set the actualIndex
195 void setActualIndex(int index);
197 * set the timeReproduction
200 void setTimeReproduction(double time);
205 void setScale(double scale);
210 void setActualTime(double actualTime);
212 * reset the initial time
214 void resetInitialTime();
216 * Sets the initial time
218 void setInitialTime(double time);
223 //======= ATTRIBUTES=======
226 * Name of the concept
230 * Mode of changing the instant
237 * position in the reproduction
239 int positionInReproduction;
241 * Increment for an instant
246 * Decrease for an instant
259 * maximum index that can have in the instant
263 * Time in miliseconds of the reproduction
265 double timeReproduction;
267 * Scale use for calculate the index
268 * of the concept according to the time of reproduction
269 * defined in timeReproduction
270 * scaleTime=maximumIndex/timeReproduction
274 * actual time of the reproduction
286 //====== PRIVATE METHODS=========