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

void Impala::Visualization::GUI::ConceptPreviewBar::Init ( ThreadSet threadset,
int  thumbW,
int  thumbH,
double  viewscale 
) [inline, private]

Definition at line 31 of file ConceptPreviewBar.h.

References Impala::Visualization::ImagesWindow::AddImage(), Impala::Core::Trec::Thread::GetFirstShot(), Impala::Core::Trec::ThreadSet::GetImageByShotID(), Impala::CmdOptions::GetInstance(), Impala::CmdOptions::GetInt(), Impala::Core::Trec::Thread::GetName(), Impala::Core::Trec::ThreadSet::GetNrThreads(), Impala::Core::Trec::Thread::GetShotAt(), Impala::Core::Trec::ThreadSet::GetThread(), ILOG_DEBUG, ILOG_WARN, mMaxImages, Impala::Visualization::GUI::PreviewBar::mName, Impala::Visualization::GUI::PreviewBar::mPreviewImages, mThread, mThreadSet, Impala::Visualization::ImagesWindow::SetImagesListener(), OglGui::Window::Window(), OglGui::OglWindow::WndHeight(), and OglGui::OglWindow::WndWidth().

00032     {
00033         int wndW = WndWidth();
00034         int wndH = WndHeight();
00035 
00036         if (wndH < thumbH) // H smaller than thumbH, adjusting scale to fit
00037             viewscale = (wndH-2) / (double)thumbH;
00038 
00039         mThread    = NULL;
00040         mThreadSet = threadset;
00041         mMaxImages = CmdOptions::GetInstance().GetInt("maxImagesOnRow");
00042 
00043         // images:
00044         if (threadset == NULL)
00045         {
00046             mPreviewImages = NULL;
00047             return;
00048         }
00049 
00050         int nrImOnRow = (wndW - 174) / (thumbW * viewscale) + 1;
00051         if (nrImOnRow > mMaxImages)
00052             nrImOnRow = mMaxImages;
00053 
00054         Window *c      = new Window(this, 170, 0, wndW - 174, wndH);
00055         mPreviewImages = new Visualization::ImageSet(c, thumbW, thumbH,
00056                                                      viewscale,nrImOnRow,1,0);
00057         mPreviewImages->ActivateInfoBox(false);
00058         mPreviewImages->SetImagesListener(this, 0);
00059 
00060         // 1. find the Thread using the "concept" name
00061         //    TODO: make this less hardcoded.
00062         Thread *t = NULL;
00063         for (int i=0; i < threadset->GetNrThreads(); i++)
00064         {
00065             if (threadset->GetThread(i)->GetName() == String("rank_") + mName)
00066             {
00067                 t = threadset->GetThread(i);
00068                 break;
00069             }
00070         }
00071 
00072         ILOG_DEBUG("finding " << mName << " thread=" << t);
00073 
00074         // 2. show one row of images
00075         if (t != NULL)
00076         {
00077             int firstShot = t->GetFirstShot();
00078             for (int i=0; i<nrImOnRow; i++)
00079             {
00080                 int shot = t->GetShotAt(firstShot, i);
00081                 if (shot < 0)
00082                     break;
00083                 // shot name is not interesting for end users, but if you need
00084                 // it: threadset->GetShotName(shot)
00085                 mPreviewImages->AddImage(threadset->GetImageByShotID(shot),
00086                                          "Direct", "", true);
00087             }
00088             mThread = t;
00089         }
00090         else
00091         {
00092             ILOG_WARN("Could not find thread for concept '" << mName << "'");
00093         }
00094     }

Here is the call graph for this function:


Generated on Fri Mar 19 11:51:43 2010 for ImpalaSrc by  doxygen 1.5.1