]> Creatis software - creaEnvironment.git/blob - lib/kernel_Environment/ConceptInstantHandler.h
*** empty log message ***
[creaEnvironment.git] / lib / kernel_Environment / ConceptInstantHandler.h
1 /*=========================================================================
2
3   Program:  ConceptInstantHandler
4   Module:    $RCSfile: ConceptInstantHandler.h,v $
5   Language:  C++
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
10
11   Copyright: (c) 2007
12   License:
13
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.
17
18
19 =========================================================================*/
20
21 // SYSTEM INCLUDES
22 #include <iostream>
23 #include <map>
24 #include <vector>
25 #include <string>
26
27 // PROJECT INCLUDES
28
29
30
31 // LOCAL INCLUDES
32
33 // FORWARD REFERENCES
34
35
36
37 /*
38 *       COMMENT
39 *       @param
40 *       @return
41 */
42
43
44 #ifndef __CONCEPTINSTANTHANDLER_H_INCLUDED__
45 #define __CONCEPTINSTANTHANDLER_H_INCLUDED__
46
47 #if defined(WIN32)
48 //If we're using a dynamic library
49 # ifdef NDimensionsEnvironment_BUILD_SHARED
50 #   define NDimensionsEnvironment_EXPORTS __declspec( dllexport )
51 # else
52 #   define NDimensionsEnvironment_EXPORTS //__declspec( dllimport )
53 # endif //maracasvisulib_EXPORTS
54 #endif
55
56
57 class NDimensionsEnvironment_EXPORTS ConceptInstantHandler
58         {
59                                 public:
60                                                 //===== CONSTANTS ========
61                                                 /*
62                                                 * if the concept is  being reproduced in real time
63                                                 */
64                                                 const static int REAL_TIME=1;
65                                                 /*
66                                                 * if the concept is being reproduced by doing
67                                                 * plus plus to its indexes
68                                                 */
69                                                 const static int PLUS_PLUS=2;
70
71                                                 
72                                                 //====== LIFECYCLE ========
73                                                 ConceptInstantHandler(std::string name,int mode,int positionInReproduction);
74                                                 ~ConceptInstantHandler();                                       
75                                                 //====== OPERATIONS =======
76                                                 /*
77                                                 * change the actual index by increasing
78                                                 * the index until the maximum by the increaseValue
79                                                 */
80                                                 void nextIndex();
81                                                 /*
82                                                 * change the actual index by decreasing
83                                                 * the index until zero  by the decreaseValue
84                                                 */
85                                                 void previousIndex();
86                                                 
87                                                 
88                                                 //====== INQUIRY =========
89                                                 /*
90                                                 *       @return name
91                                                 */
92                                                 std::string getName();
93                                                 /*
94                                                 *       @return PositionInReproduction
95                                                 */
96                                                 int getPosition();
97                                                 /*
98                                                 *       @return mode
99                                                 */
100                                                 int getMode();
101                                                 /*
102                                                 *       @return increaseValue
103                                                 */
104                                                 int getIncreaseValue();
105                                                         
106                                                 /*
107                                                 *       @return decreaseValue
108                                                 */
109                                                 int getDecreaseValue();
110                                                 
111                                                 /*
112                                                 * @return indexInInstant
113                                                 */
114                                                 int getIndexInInstant();
115                                                 /*
116                                                 *       @return actualIndex
117                                                 */
118                                                 int geActualIndex();
119                                                 /*
120                                                 *       @return maximumIndex
121                                                 */
122                                                 
123                                                 int getMaximumIndex();
124                                                 /*
125                                                 *       @return timeReproduction
126                                                 */
127                                                 double getTimeReproduction();
128                                                 /*
129                                                 *       @return scaleTime
130                                                 */
131                                                 double getScale();
132                                                 
133                                                 /*
134                                                 * if the actual index is not the maximum index
135                                                 */
136                                                 bool hasNextIndex();
137                                                 /*
138                                                 * if the actual index is not zero
139                                                 */
140                                                 bool hasPreviousIndex();
141                                         
142                                                 /*
143                                                 * Get initial time
144                                                 */
145                                                 double getInitialTime();
146
147
148                                                 //====== ACCESS ==========
149                                                 /*
150                                                 *       Sets the name of the concept
151                                                 *       @param name, new name
152                                                 */
153                                                 void setName(std::string name);
154                                                 /*
155                                                 *       Sets the position of the concept
156                                                 *       @param position
157                                                 */
158                                                 void setPosition(int position);
159                                                 /*
160                                                 *       Sets the mode of the concept
161                                                 *       @param mode, new mode= REAL_TIME or
162                                                 *       PLUS_PLUS
163                                                 */
164                                                 void setMode(int mode);
165                                                 /*
166                                                 *       Set Increase of the concept
167                                                 *       @param increaseValue
168                                                 */
169                                                 void setIncreaseValue(int increaseValue);
170
171                                                 /*
172                                                 *       Set decrease of the concept
173                                                 *       @param decreaseValue
174                                                 */
175                                                 void setDecreaseValue(int decreaseValue);
176
177                                                 /*
178                                                 *  Sets  the index of the concept in the instant
179                                                 *  @param indexInInstant
180                                                 */
181                                                 void setIndexInInstant(int indexInInstant);
182                                                 /*
183                                                 *  Sets  sets the maximum value
184                                                 *  @param maximumIndex
185                                                 */
186                                                 void setMaximumIndex(int maximumIndex);
187                                                 /*
188                                                 * set the actualIndex
189                                                 * @param index
190                                                 */
191                                                 void setActualIndex(int index);
192                                                 /*
193                                                 * set the timeReproduction
194                                                 * @param time
195                                                 */
196                                                 void setTimeReproduction(double time);
197                                                 /*
198                                                 * set the scaleTime
199                                                 * @param scale
200                                                 */
201                                                 void setScale(double scale);
202                                                 /*
203                                                 * set the actualTime
204                                                 * @param actualTime
205                                                 */
206                                                 void setActualTime(double actualTime);
207                                                 /*
208                                                 *       reset the initial time
209                                                 */
210                                                 void resetInitialTime();
211                                                 /*
212                                                 * Sets the initial time
213                                                 */
214                                                 void setInitialTime(double time);
215                                                 
216                                                 
217                                 private:
218                                         
219                                         //======= ATTRIBUTES=======
220                                         
221                                         /*
222                                         * Name of the concept
223                                         */
224                                         std::string name;
225                                         /*
226                                         *       Mode of changing the instant
227                                         *       REAL_TIME
228                                         *   PLUS_PLUS
229                                         */
230                                         int mode;
231                                         
232                                         /*
233                                         * position in the reproduction
234                                         */
235                                         int positionInReproduction;
236                                         /*
237                                         * Increment for an instant
238                                         * for default is 1
239                                         */
240                                         int increaseValue;
241                                         /*
242                                         * Decrease for an instant
243                                         * for default is 1
244                                         */
245                                         int decreaseValue;
246                                         /*
247                                         * index in Instant
248                                         */
249                                         int indexInInstant;
250                                         /*
251                                         * index that it is
252                                         */
253                                         int actualIndex;
254                                         /*
255                                         * maximum index that can have in the instant
256                                         */
257                                         int maximumIndex;
258                                         /*
259                                         * Time in miliseconds of the reproduction 
260                                         */
261                                         double timeReproduction;
262                                         /*
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
267                                         */
268                                         double scaleTime;
269                                         /*
270                                         *       actual time of the reproduction
271                                         *       is in miliseconds
272                                         */
273                                         double actualTime;
274                                         /*
275                                         *       Initial time
276                                         *   is in miliseconds
277                                         */
278                                         double initialTime;
279
280
281
282                                         //====== PRIVATE METHODS=========
283                                         
284                                                         
285         };
286 #endif