Home || Architecture || Video Search || Visual Search || Scripts || Applications || Important Messages || OGL || Src

AppControl.h

Go to the documentation of this file.
00001 #ifndef Impala_Visualization_AppControl_h
00002 #define Impala_Visualization_AppControl_h
00003 
00004 #include "OglGui/KeyListener.h"
00005 
00006 namespace Impala
00007 {
00008 namespace Visualization
00009 {
00010 
00011 
00012 class AppControl : public OglGui::KeyListener
00013 {
00014 public:
00015 
00016     AppControl(int id, bool alwaysActive)
00017     {
00018         mId = id;
00019         mAlwaysActive = alwaysActive; 
00020         mActive = false;
00021         mDone = false;
00022     }
00023 
00024     int
00025     GetControlId()
00026     {
00027         return mId;
00028     }
00029 
00030     void
00031     SetControlId(int id)
00032     {
00033         mId = id;
00034     }
00035 
00036     virtual void
00037     SetActive(bool flag)
00038     {
00039         mActive = flag;
00040     }
00041 
00042     bool
00043     GetActive()
00044     {
00045         return mAlwaysActive || mActive;
00046     }
00047 
00048     bool
00049     GetAlwaysActive()
00050     {
00051         return mAlwaysActive;
00052     }
00053 
00054     void
00055     SetDone()
00056     {
00057         mDone = true;
00058     }
00059 
00060     // interface to derived classes
00061 
00062     virtual void
00063     HandleStart()
00064     {
00065     }
00066 
00067     virtual void
00068     ComputeCycle(double elapsedTime)
00069     {
00070     }
00071 
00072     virtual bool
00073     Done()
00074     {
00075         return mDone;
00076     }
00077 
00078     virtual void
00079     HandleActivate()
00080     {
00081     }
00082 
00083     virtual void
00084     HandleDeactivate()
00085     {
00086     }
00087 
00088 private:
00089 
00090     int  mId;
00091     bool mActive;
00092     bool mAlwaysActive;
00093     bool mDone;
00094 
00095 };
00096 
00097 } // namespace Visualization
00098 } // namespace Impala
00099 
00100 #endif

Generated on Fri Mar 19 09:31:48 2010 for ImpalaSrc by  doxygen 1.5.1