1 /*=========================================================================
4 Module: $RCSfile: InstantPlayer.h,v $
6 Date: $Date: 2008/10/31 15:08:40 $
7 Version: $Revision: 1.1 $
8 Objective: it do the play methods as stop,pause, play, etc using an 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 =========================================================================*/
22 #ifndef __INSTANTPLAYER_H_INCLUDED__
23 #define __INSTANTPLAYER_H_INCLUDED__
31 #include "InstantHandler.h"
32 #include "ViewerNDimensionsException.h"
52 //====== CONSTANTS =======
53 const static int REAL_TIME=1;
54 const static int PLUS_PLUS=2;
56 //========= LYFECYCLE ==========
57 InstantPlayer(SomeEnvironment<S>* environment)throw (ViewerNDimensionsException);
61 //========= OPERATIONS =========
63 * When the user wants to play the dimensions selected by the user
64 * and are already defined
69 * Paused the reproduction of the dimension played
74 * Used for change to the next instant in the reproduction
75 * Note: next instant from the instant that's being reproduced
76 * @param loop , if want to do next instant with looping
77 * @return true if the player has changed of instant, false if not
80 bool nextInstant(bool loop=false)throw (ViewerNDimensionsException);
82 * Used for change to the previous instant in the reproduction
83 * Note: previous instant from the instant that's being reproduced
84 * @return true if the player has changed of instant, false if not
87 bool previousInstant()throw (ViewerNDimensionsException);
89 * Used for stops the reproduction
91 * in the index value in the index of the dimensin in the actual Instant
97 * Removes all the concepts handled
99 void removeAllConcepts();
102 * Removes the concept with the name given
103 * @param nameConcept, name of the concept to remove
105 void removeConceptToHandled(std::string nameConcept);
107 //====== INQUIRY ========
109 * Returns the things of the actual instant
111 std::vector<S*>* getThingsOfInstant()throw (ViewerNDimensionsException);
113 * return the actual instant in the instant handler
115 Instant* getActualInstant()throw (ViewerNDimensionsException);
117 * add new concept to handled
119 * @param mode= REAL_TIME,PLUS_PLUS
120 * @param position, position in the player
122 bool addConceptToHandled(std::string nameConcept,int mode,int position)throw (ViewerNDimensionsException);
124 * Returns the things of the actual instant and its names in the
127 void getThingsWithName(std::vector<std::string>& names,std::vector< S* >& thingsVector)throw (ViewerNDimensionsException);
129 * Returns the names of the concepts handled and its modes
132 void getConceptsInfo(std::vector<std::string>& namesConcepts,std::vector<int>& modes);
134 * Returns the name of the concept that handled the real time
137 void getTimeConcept(std::string& nameConcept);
139 * get the number of instants that is playing
141 int getNumInstantsPlaying();
144 * Returns the names of the concept with its respectively actual value
145 * @param conceptsAndIndexes is where is going to be save the data searched
147 void getConceptsActualIndexes(std::map<std::string,int>* conceptsAndIndexes)throw (ViewerNDimensionsException);
149 //========= ACCESS =========
151 * Sets the time of reproduction of the concept
152 * that managed the real time
153 * @param time, is in milliseconds
155 void setTimeReproduction(double time);
157 * Sets the environment
159 void setEnvironment(SomeEnvironment<S>* environmment);
163 void setActualInstant(Instant* actualInstant);
167 void setActualInstant(std::vector<int>* actualInstant);
169 * Set the increase Value for changing the instant
171 void setIncreaseValue(int increase);
173 * Set the decrease Value for changing the instant
175 void setDecreaseValue(int decrease);
178 * Set the mode of a concept that's being handled
181 //void setModeOfConcept(std::string nameConcept,int mode);
183 * Set actual time to the instant handler
186 //void setActualTime(double actualTime);
188 * set the modes of the concept that handled the time
189 * to the plus plus mode or real time mode
192 // void setTimeConceptToMode(int mode);
202 SomeEnvironment < S >* environment;
205 * The instant handler
207 InstantHandler < S > * instantHandler;
213 //double timeReproduction;
218 //std::vector<S*>* thingsOfInstant;
223 //include the implementation of the template
224 #include "InstantPlayer_Txx.h"