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

ScreenBase.h

Go to the documentation of this file.
00001 //345678901234567890123456789012345678901234567890123456789012345678901234567890
00002 /*******************************************************************************
00003  *
00004  * Application: Investigator's Dashboard (MultimediaN project 6)
00005  * 
00006  * Base template for all screens
00007  *
00008  * Primary author(s): Ork
00009  *                  : 
00010  *                  : 
00011  ******************************************************************************/
00012 
00013 #ifndef Impala_Application_IDash_ScreenBase_h
00014 #define Impala_Application_IDash_ScreenBase_h
00015 
00016 #include "Visualization/Window.h"
00017 #include "Visualization/AppControlDoc.h"
00018 #include "Visualization/AppController.h"
00019 #include "Core/Database/DataDocumentListener.h"
00020 #include "OglGui/Button.h"
00021 
00022 #include "Application/idash/TrecEngine.h"
00023 //#include "Application/idash/AppControlDossier.h"
00024 
00025 namespace Impala {
00026 namespace Application {
00027 namespace IDash {
00028 
00029 class ScreenBase : public Visualization::Window,
00030                    public OglGui::ButtonListener, 
00031                    public Core::Database::DataDocumentListener
00032 {
00033 
00034 public:
00035     typedef Visualization::AppControlDoc    AppControlDoc;
00036 
00037     // as a new window (screen)
00038     ScreenBase(int width, int height) :
00039         Visualization::Window(sSidebySide, 1, width, height, true)
00040     {
00041         sSidebySide += width;
00042 #ifdef AS_TODS_BROWSER
00043         GetOGLWND()->topTitle = "TODS - Video Analysis Toolkit";
00044 #else
00045         GetOGLWND()->topTitle =
00046             "MultimediaN - Investigators Dashboard - Golden Demo";
00047 #endif
00048         SetBackground(oglGUI_BG);
00049 
00050         ScreenBaseInit();
00051     }
00052 
00053     // as an child window
00054     ScreenBase(OglGui::Window *parent, int x, int y, int width, int height) :
00055         Visualization::Window(parent, x, y, width, height, true)
00056     {
00057         ScreenBaseInit();
00058     }
00059 
00060     // as an child window
00061     ScreenBase(OglGui::Window *parent, int width, int height) :
00062         Visualization::Window(parent, width, height, true)
00063     {
00064         ScreenBaseInit();
00065     }
00066 
00067     // as a tab pane
00068     ScreenBase(OglGui::Window *parent) :
00069         Visualization::Window(parent,0,0,parent->W(), parent->H(), true)
00070     {
00071         ScreenBaseInit();
00072         ConnectTo(parent, OglGui::ALLSIDES);
00073     }
00074 
00075     // LAYOUT -------------------------------------
00076     // functions to be used by all:
00077     void
00078     SetAsBox(OglGui::Window *w, bool rounded=true)
00079     {
00080         if (rounded)
00081             w->SetRoundness(10,10,10,10);
00082         w->SetBorderType(4);
00083         w->SetBorderFillShaded(2);
00084     }
00085 
00086     OglGui::Window *
00087     CreateLogos(OglGui::Window *w, int x, int y)
00088     {
00089         OglGui::Window *v = new OglGui::Window(w, x, y, 340, 50);
00090         v->SetBorderType(4);
00091         v->SetRoundness(3,3,3,3);
00092         v->SetBorderFillShaded(1);
00093         v->SetClipRounded(true);
00094         std::string imname = "icons/logos.png";
00095         ILOG_DEBUG(" reading image " << imname);
00096         OGLIMAGE *image = OGLReadPNG(imname.c_str(), false);
00097         if (image != NULL)
00098         {
00099             OglGui::View *icon =
00100                 new OglGui::View(v->GetOGLWND(),image,0,0,340,50);
00101             oglSys.ReleaseOglImage(image);
00102         }
00103 
00104         return v;
00105     }
00106 
00107     virtual void
00108     SetAppControlDoc(AppControlDoc *a, int appControlID)
00109     {
00110         mAppControlDoc = a;
00111         mAppControlID = appControlID;
00112         a->AddDocListener(this);
00113     }
00114 
00115     int GetAppControlID()
00116     {
00117         ILOG_DEBUG("note: AppControlID=" << mAppControlID << " requested.");
00118         return mAppControlID;
00119     }
00120 
00121     // ENGINE -------------------------------------
00122     static void
00123     SetEngine(TrecEngine *e)
00124     {
00125         sTrecEngine = e;
00126     }
00127 
00128     TrecEngine*
00129     Engine()
00130     {
00131         return sTrecEngine;
00132     }
00133 
00134 
00135     virtual void
00136     HandleNewFile()
00137     {
00138         ILOG_DEBUG("AppId(" << mAppControlID <<")::HandleNewFile()");
00139     }
00140 
00141     virtual void
00142     HandleNewBookmarked()
00143     {
00144         ILOG_DEBUG("AppId(" << mAppControlID <<")::HandleNewBookmarked()");
00145     }
00146 
00147     virtual void
00148     HandleAddedBookmark()
00149     {
00150         ILOG_DEBUG("AppId(" << mAppControlID <<")::HandleAddedBookmark()");
00151     }
00152 
00153     virtual void
00154     HandleRemovedBookmark()
00155     {
00156         ILOG_DEBUG("AppId("<<mAppControlID <<")::HandleRemovedBookmark()");
00157     }
00158 
00159     virtual void
00160     HandleCursorBookmarked()
00161     {
00162         ILOG_DEBUG("AppId("<< mAppControlID<<")::HandleCursorBookmarked()");
00163     }
00164 
00165     virtual void
00166     HandleBookmarkEvent(int shotid, bool isSelected)
00167     {
00168         ILOG_DEBUG("AppId(" << mAppControlID <<")::HandleBookmarkEvent(" <<
00169                    shotid << ": " << isSelected << ")");
00170     }
00171 
00172 protected:
00173     AppControlDoc *mAppControlDoc;
00174 
00175 private:
00176 
00177     void
00178     ScreenBaseInit()
00179     {
00180         mAppControlDoc = NULL;
00181         mAppControlID = -1;
00182     }
00183 
00184     static  int         sSidebySide;
00185     static  TrecEngine  *sTrecEngine;
00186 
00187     int                 mAppControlID;
00188 
00189     ILOG_VAR_DEC;
00190 };
00191 
00192 ILOG_VAR_INIT(ScreenBase, Application.IDash);
00193 
00194 int ScreenBase::sSidebySide = 1;
00195 TrecEngine* ScreenBase::sTrecEngine = 0;
00196 }
00197 }
00198 }
00199 
00200 #endif

Generated on Fri Mar 19 09:30:26 2010 for ImpalaSrc by  doxygen 1.5.1