00001
00002
00003 #ifndef Impala_Application_SDash_CameraEvent_h
00004 #define Impala_Application_SDash_CameraEvent_h
00005
00006 #include <string>
00007
00008 #include "Link/OGL/OGLWnd.h"
00009
00010 namespace Impala {
00011 namespace Application {
00012 namespace SDash {
00013
00014 class CameraEvent {
00015
00016 public:
00017
00018 CameraEvent()
00019 {
00020 mCameraId = -1;
00021 mType = -1;
00022 mFrameNr = -1;
00023 mSeconds = -1;
00024 mComments = "";
00025 }
00026
00027 CameraEvent(int camId, int type, std::string comments = "")
00028 {
00029 mCameraId = camId;
00030 mType = type;
00031 mFrameNr = -1;
00032 mSeconds = -1;
00033 mComments = comments;
00034 }
00035
00036 CameraEvent(int camId, int type, long seconds, std::string comments = "")
00037 {
00038 mCameraId = camId;
00039 mType = type;
00040 mFrameNr = -1;
00041 mSeconds = seconds;
00042 mComments = comments;
00043 }
00044
00045 CameraEvent(int camId, int type, int frameNr, std::string comments = "")
00046 {
00047 mCameraId = camId;
00048 mType = type;
00049 mFrameNr = frameNr;
00050 mSeconds = -1;
00051 mComments = comments;
00052 }
00053
00054 int CameraId() const { return mCameraId; }
00055 int Type() const { return mType; }
00056 int FrameNr() const { return mFrameNr; }
00057 long Seconds() const { return mSeconds; }
00058
00059 std::string Comments() { return mComments; }
00060 const std::string& Comments() const { return mComments; }
00061 const char* CommentsC() const { return mComments.c_str(); }
00062
00063 void SetSeconds(long virtualSecondsSinceStart)
00064 {
00065 mSeconds = virtualSecondsSinceStart;
00066 }
00067
00068 void SetComments(const std::string& comments)
00069 {
00070 mComments = comments;
00071 }
00072
00073 const char* AlertDescription() const
00074 {
00075 return sAlertDescriptions[mType - 1];
00076 }
00077
00078 ULONG PreferredBackColor() const
00079 {
00080 ULONG color = oglWHITE;
00081 switch (mType)
00082 {
00083 case 1:
00084
00085 color = oglBLUE;
00086 break;
00087 case 2:
00088
00089 color = 0xffffff00;
00090 break;
00091 case 3:
00092
00093 color = oglGREEN;
00094 break;
00095 }
00096 return color;
00097 }
00098
00099 private:
00100
00101 int mType;
00102 int mCameraId;
00103 int mFrameNr;
00104 long mSeconds;
00105 std::string mComments;
00106
00107 static const char* sAlertDescriptions[];
00108
00109 };
00110
00111 const char* CameraEvent::sAlertDescriptions[] = {"demo", "activity", "camera moves"};
00112
00113 }
00114 }
00115 }
00116 #endif
00117