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: InstantPlayer
30 Module: $RCSfile: InstantPlayer.h,v $
32 Date: $Date: 2012/11/15 12:12:26 $
33 Version: $Revision: 1.2 $
34 Objective: it do the play methods as stop,pause, play, etc using an instant handler
35 Authot: 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 =========================================================================*/
48 #ifndef __INSTANTPLAYER_H_INCLUDED__
49 #define __INSTANTPLAYER_H_INCLUDED__
57 #include "InstantHandler.h"
58 #include "ViewerNDimensionsException.h"
78 //====== CONSTANTS =======
79 const static int REAL_TIME=1;
80 const static int PLUS_PLUS=2;
82 //========= LYFECYCLE ==========
83 InstantPlayer(SomeEnvironment<S>* environment)throw (ViewerNDimensionsException);
87 //========= OPERATIONS =========
89 * When the user wants to play the dimensions selected by the user
90 * and are already defined
95 * Paused the reproduction of the dimension played
100 * Used for change to the next instant in the reproduction
101 * Note: next instant from the instant that's being reproduced
102 * @param loop , if want to do next instant with looping
103 * @return true if the player has changed of instant, false if not
106 bool nextInstant(bool loop=false)throw (ViewerNDimensionsException);
108 * Used for change to the previous instant in the reproduction
109 * Note: previous instant from the instant that's being reproduced
110 * @return true if the player has changed of instant, false if not
113 bool previousInstant()throw (ViewerNDimensionsException);
115 * Used for stops the reproduction
117 * in the index value in the index of the dimensin in the actual Instant
123 * Removes all the concepts handled
125 void removeAllConcepts();
128 * Removes the concept with the name given
129 * @param nameConcept, name of the concept to remove
131 void removeConceptToHandled(std::string nameConcept);
133 //====== INQUIRY ========
135 * Returns the things of the actual instant
137 std::vector<S*>* getThingsOfInstant()throw (ViewerNDimensionsException);
139 * return the actual instant in the instant handler
141 Instant* getActualInstant()throw (ViewerNDimensionsException);
143 * add new concept to handled
145 * @param mode= REAL_TIME,PLUS_PLUS
146 * @param position, position in the player
148 bool addConceptToHandled(std::string nameConcept,int mode,int position)throw (ViewerNDimensionsException);
150 * Returns the things of the actual instant and its names in the
153 void getThingsWithName(std::vector<std::string>& names,std::vector< S* >& thingsVector)throw (ViewerNDimensionsException);
155 * Returns the names of the concepts handled and its modes
158 void getConceptsInfo(std::vector<std::string>& namesConcepts,std::vector<int>& modes);
160 * Returns the name of the concept that handled the real time
163 void getTimeConcept(std::string& nameConcept);
165 * get the number of instants that is playing
167 int getNumInstantsPlaying();
170 * Returns the names of the concept with its respectively actual value
171 * @param conceptsAndIndexes is where is going to be save the data searched
173 void getConceptsActualIndexes(std::map<std::string,int>* conceptsAndIndexes)throw (ViewerNDimensionsException);
175 //========= ACCESS =========
177 * Sets the time of reproduction of the concept
178 * that managed the real time
179 * @param time, is in milliseconds
181 void setTimeReproduction(double time);
183 * Sets the environment
185 void setEnvironment(SomeEnvironment<S>* environmment);
189 void setActualInstant(Instant* actualInstant);
193 void setActualInstant(std::vector<int>* actualInstant);
195 * Set the increase Value for changing the instant
197 void setIncreaseValue(int increase);
199 * Set the decrease Value for changing the instant
201 void setDecreaseValue(int decrease);
204 * Set the mode of a concept that's being handled
207 //void setModeOfConcept(std::string nameConcept,int mode);
209 * Set actual time to the instant handler
212 //void setActualTime(double actualTime);
214 * set the modes of the concept that handled the time
215 * to the plus plus mode or real time mode
218 // void setTimeConceptToMode(int mode);
228 SomeEnvironment < S >* environment;
231 * The instant handler
233 InstantHandler < S > * instantHandler;
239 //double timeReproduction;
244 //std::vector<S*>* thingsOfInstant;
249 //include the implementation of the template
250 #include "InstantPlayer_Txx.h"