1 /*=========================================================================
3 Program: ConceptInstantHandler
4 Module: $RCSfile: ConceptInstantHandler.h,v $
6 Date: $Date: 2008/10/31 15:08:40 $
7 Version: $Revision: 1.1 $
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 NDimensionsEnvironment_BUILD_SHARED
50 # define NDimensionsEnvironment_EXPORTS __declspec( dllexport )
52 # define NDimensionsEnvironment_EXPORTS //__declspec( dllimport )
53 # endif //maracasvisulib_EXPORTS
57 class NDimensionsEnvironment_EXPORTS ConceptInstantHandler
60 //===== CONSTANTS ========
62 * if the concept is being reproduced in real time
64 const static int REAL_TIME=1;
66 * if the concept is being reproduced by doing
67 * plus plus to its indexes
69 const static int PLUS_PLUS=2;
72 //====== LIFECYCLE ========
73 ConceptInstantHandler(std::string name,int mode,int positionInReproduction);
74 ~ConceptInstantHandler();
75 //====== OPERATIONS =======
77 * change the actual index by increasing
78 * the index until the maximum by the increaseValue
82 * change the actual index by decreasing
83 * the index until zero by the decreaseValue
88 //====== INQUIRY =========
92 std::string getName();
94 * @return PositionInReproduction
102 * @return increaseValue
104 int getIncreaseValue();
107 * @return decreaseValue
109 int getDecreaseValue();
112 * @return indexInInstant
114 int getIndexInInstant();
116 * @return actualIndex
120 * @return maximumIndex
123 int getMaximumIndex();
125 * @return timeReproduction
127 double getTimeReproduction();
134 * if the actual index is not the maximum index
138 * if the actual index is not zero
140 bool hasPreviousIndex();
145 double getInitialTime();
148 //====== ACCESS ==========
150 * Sets the name of the concept
151 * @param name, new name
153 void setName(std::string name);
155 * Sets the position of the concept
158 void setPosition(int position);
160 * Sets the mode of the concept
161 * @param mode, new mode= REAL_TIME or
164 void setMode(int mode);
166 * Set Increase of the concept
167 * @param increaseValue
169 void setIncreaseValue(int increaseValue);
172 * Set decrease of the concept
173 * @param decreaseValue
175 void setDecreaseValue(int decreaseValue);
178 * Sets the index of the concept in the instant
179 * @param indexInInstant
181 void setIndexInInstant(int indexInInstant);
183 * Sets sets the maximum value
184 * @param maximumIndex
186 void setMaximumIndex(int maximumIndex);
188 * set the actualIndex
191 void setActualIndex(int index);
193 * set the timeReproduction
196 void setTimeReproduction(double time);
201 void setScale(double scale);
206 void setActualTime(double actualTime);
208 * reset the initial time
210 void resetInitialTime();
212 * Sets the initial time
214 void setInitialTime(double time);
219 //======= ATTRIBUTES=======
222 * Name of the concept
226 * Mode of changing the instant
233 * position in the reproduction
235 int positionInReproduction;
237 * Increment for an instant
242 * Decrease for an instant
255 * maximum index that can have in the instant
259 * Time in miliseconds of the reproduction
261 double timeReproduction;
263 * Scale use for calculate the index
264 * of the concept according to the time of reproduction
265 * defined in timeReproduction
266 * scaleTime=maximumIndex/timeReproduction
270 * actual time of the reproduction
282 //====== PRIVATE METHODS=========