Definition at line 62 of file mainVideoExcel.cpp. References Impala::Application::VideoExcel::GridWindow::AddColumnsFromDataSource(), Impala::Application::VideoExcel::TableWindow::AddColumnsFromDataSource(), OglGui::OglWindow::ConnectTo(), Impala::CmdOptions::GetBool(), Impala::Application::VideoExcel::ImageCache::GetInstance(), Impala::CmdOptions::GetInstance(), Impala::CmdOptions::GetInt(), OglGui::OglWindow::GetOGLWND(), Impala::CmdOptions::GetString(), ILOG_ERROR, ILOG_INFO, Impala::Application::VideoExcel::ImageCache::InitializeCache(), mGrid, mTable, Impala::Application::VideoExcel::ImageCache::PreloadCache(), OglGui::OglWindow::SetBackground(), Impala::Application::VideoExcel::TableUpdateListener::SetListenTableUpdates(), OglGui::OglWindow::SetVisible(), Impala::Application::VideoExcel::GridWindow::SetZoomViewTargetWindow(), Impala::Application::VideoExcel::TableWindow::SetZoomViewTargetWindow(), OglGui::TOBOTTOM, OglGui::TOLEFTRIGHT, OglGui::TORIGHT, OglGui::TOTOP, and OglGui::TOTOPBOTTOM. 00063 { 00064 /* quick parsing of options, to be redone later */ 00065 Impala::CmdOptions& options = Impala::CmdOptions::GetInstance(); 00066 00067 //ULONG bgCol = 0xffd2c799; 00068 ULONG bgCol = oglGUI_BG; 00069 String bgStr = options.GetString("wndBg"); 00070 if (!bgStr.empty()) 00071 bgCol = OglColorStr(bgStr.c_str()); 00072 SetBackground(bgCol); 00073 00074 TableDataSource *src = 0; 00075 00076 #ifdef VE_USING_SQLITE 00077 if (options.GetString("database") != "") 00078 src = new TableDataSourceSqliteDb(options.GetString("database")); 00079 #endif 00080 if (options.GetString("directory") != "") 00081 src = new TableDataSourceImageDir(options.GetString("directory")); 00082 #ifdef VE_USING_TREC 00083 if (options.GetBool("trec")) 00084 src = new TableDataSourceTrec(); 00085 #endif 00086 if (!src) 00087 { 00088 ILOG_ERROR("Please start with either -a <db>, -d <directory> " << 00089 "or --trec --ini <inifile>"); 00090 return; 00091 } 00092 00093 int csize = options.GetInt("imageCacheSize"); 00094 if (csize < 100) csize = 100; 00095 ImageCache::InitializeCache(src, csize); 00096 00097 if (options.GetBool("preload")) 00098 { 00099 ILOG_INFO("Pre-filling cache with content..."); 00100 ImageCache::GetInstance()->PreloadCache(); 00101 } 00102 00103 int btnH = 32; 00104 int botH = 140; 00105 int centerH = h - 10 - btnH - botH; 00106 00107 GridWindow *grid = new GridWindow(this,src,5,5+botH,w-160,centerH); 00108 grid->ConnectTo(this); 00109 00110 TableWindow *table = new TableWindow(this,src,5,5+botH,w-160,centerH); 00111 table->ConnectTo(this); 00112 00113 TableOverviewWindow *overview = 00114 new TableOverviewWindow(this,src,w-155,5+botH,150,centerH); 00115 //overview->ConnectTo(this, L2R|R2R|T2T|B2B); 00116 overview->ConnectTo(this, OglGui::TORIGHT|OglGui::TOTOPBOTTOM); 00117 00118 TableControlBarWindow *buttonbar = 00119 new TableControlBarWindow(this,table,grid,5,h-btnH-5,w-10,btnH); 00120 //buttonbar->ConnectTo(this, L2L|R2R|T2T|B2T); 00121 buttonbar->ConnectTo(this, OglGui::TOLEFTRIGHT | OglGui::TOTOP); 00122 00123 SelectionCollection *selcol = 00124 new SelectionCollection(this,src,5,5,w-10,botH); 00125 //selcol->ConnectTo(this, L2L|R2R|T2B|B2B); 00126 selcol->ConnectTo(this, OglGui::TOLEFTRIGHT | OglGui::TOBOTTOM); 00127 00128 // overlay window to show preview of table on top of everything else.. 00129 // there must be a better way to do this though :) 00130 Window *overlay = new Window(this, 0, 0, w, h); 00131 overlay->ConnectTo(this); 00132 oglSys.SetNoMouseInput(overlay->GetOGLWND(),1); 00133 00134 grid->SetListenTableUpdates(false); 00135 table->SetListenTableUpdates(true); 00136 overview->SetListenTableUpdates(true); 00137 00138 // add default data columns for specified data source: 00139 table->AddColumnsFromDataSource(); 00140 grid->AddColumnsFromDataSource(); 00141 00142 // for which column/cache should the table display larger images 00143 // OBS: (need to set here because there can be more than one images row) 00144 table->SetZoomViewTargetWindow(overlay, true); 00145 grid->SetZoomViewTargetWindow(overlay, true); 00146 00147 table->SetVisible(true); 00148 grid->SetVisible(false); 00149 00150 00151 mTable = table; 00152 mGrid = grid; 00153 00154 /* Example of manually marking ranges: 00155 src->MarkRange(10, 20, 2); 00156 src->MarkRange(15, 25, 4); 00157 src->MarkRange(19, 28, 8); 00158 */ 00159 00160 /* 00161 Example of manually adding data columns: 00162 00163 table->AddColumn(new TableColumn(table, src, "id", 40)); 00164 TableColumn *p = new TableColumn(table, src, "picture", 100); 00165 p->SetDisplayMode(TableCell::DISPLAY_IMAGE); 00166 table->AddColumn(p); 00167 00168 table->AddColumn(new TableColumn(table, src, "filename", 300)); 00169 table->AddColumn(new TableColumn(table, src, "width", 80)); 00170 table->AddColumn(new TableColumn(table, src, "height", 80)); 00171 00172 TableColumn *c = new TableColumn(table, src, "red", 20); 00173 c->SetDisplayMode(TableCell::DISPLAY_DOT, TableCell::GRADIENT_REDFADE); 00174 table->AddColumn(c); 00175 00176 c = new TableColumn(table, src, "green", 20); 00177 c->SetDisplayMode(TableCell::DISPLAY_DOT,TableCell::GRADIENT_GREENFADE); 00178 table->AddColumn(c); 00179 00180 c = new TableColumn(table, src, "blue", 20); 00181 c->SetDisplayMode(TableCell::DISPLAY_DOT, TableCell::GRADIENT_BLUEFADE); 00182 table->AddColumn(c); 00183 */ 00184 }
Here is the call graph for this function:
|