00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #ifndef Impala_Visualization_SimilarityTimeLineVideo_h
00011 #define Impala_Visualization_SimilarityTimeLineVideo_h
00012
00013 #ifndef OglGui_TitledWindow_h
00014 #include "OglGui/TitledWindow.h"
00015 #endif
00016
00017 #ifndef OglGui_WindowDocScroller_h
00018 #include "OglGui/WindowDocScroller.h"
00019 #endif
00020
00021 #include "OglGui/CheckBoxValueBars.h"
00022 #include "OglGui/TexturedViewAnimator.h"
00023
00024 #include "Visualization/SimilarityTimeLine.h"
00025 #include "Visualization/VideoPlayerWithButtons.h"
00026 #include "Core/Table/SimilarityTableSet.h"
00027 #include "Core/Stream/RgbDataSrc.h"
00028
00029 namespace Impala {
00030 namespace Visualization {
00031
00032 class SimilarityTimeLineVideo : public OglGui::Window,
00033 public OglGui::CheckBoxListener,
00034 public OglGui::ButtonListener,
00035 public OglGui::ValueScrollBarListener,
00036
00037 public OglGui::CloseWindowListener,
00038 public SimilarityTimeLineListener,
00039 public VideoPlayerListener
00040 {
00041 public:
00042 typedef OglGui::Window Window;
00043 typedef OglGui::TitledWindow TitledWindow;
00044 typedef OglGui::SizableWindow SizableWindow;
00045 typedef OglGui::ScrollWnd ScrollWnd;
00046 typedef OglGui::StaticText StaticText;
00047 typedef OglGui::Button Button;
00048 typedef OglGui::CheckBox CheckBox;
00049 typedef OglGui::CheckBoxValueBar CheckBoxValueBar;
00050 typedef OglGui::CheckBoxValueBars CheckBoxValueBars;
00051 typedef OglGui::ValueScrollBar ValueScrollBar;
00052 typedef OglGui::WindowDocScroller WindowDocScroller;
00053 typedef Core::Table::SimilarityTableSet SimilarityTableSet;
00054 typedef SimilarityTableSet::SimTableType SimTableType;
00055 typedef std::vector<float> FloatVector;
00056 typedef std::vector<FloatVector*> Averages;
00057 typedef Core::Stream::RgbDataSrc RgbDataSrc;
00058
00059 SimilarityTimeLineVideo(int x, int y, int w, int h,
00060 SimilarityTableSet* simSet, int options=3):
00061 Window(x, y, w, h)
00062 {
00063 Init(w, h, options, simSet);
00064 }
00065
00066 SimilarityTimeLineVideo(Window* parent, int w, int h,
00067 SimilarityTableSet* simSet, int options=3):
00068 Window(parent, w, h)
00069 {
00070 Init(w, h, options, simSet);
00071 }
00072
00073 SimilarityTimeLineVideo(Window* parent, int x, int y, int w, int h,
00074 SimilarityTableSet* simSet, int options=3):
00075 Window(parent, x, y, w, h)
00076 {
00077 Init(w, h, options, simSet);
00078 }
00079
00080 VideoPlayer* Player() { return mVideoPlayer; }
00081 SimilarityTimeLine* TimeLine() { return mSimTimeLine; }
00082 CheckBoxValueBars* ChBoxValueBars()
00083 {
00084 return mChBoxValBars;
00085 }
00086 TitledWindow* TitledTimeLine() { return mTitledTimeLine; }
00087 Window* AxisThumb() { return mAxisThumb; }
00088
00089 void CenterNeedleOnPlay(bool mode) { mCenterNeedleOnPlay = mode; }
00090 bool CenterNeedleOnPlay() { return mCenterNeedleOnPlay; }
00091
00092 void CenterNeedle(bool mode) { mCenterNeedle = mode; }
00093 bool CenterNeedle() { return mCenterNeedle; }
00094
00095 SimilarityTimeLine* TimeLineExtra(int idx)
00096 {
00097 if (idx>=0 && idx<mExtraTimeLines.size())
00098 return mExtraTimeLines[idx];
00099 return 0;
00100 }
00101
00102 void OpenVideo(RgbDataSrc* rgbDataSrc, strconst videoName)
00103 {
00104 mVideoPlayer->OpenVideo(rgbDataSrc);
00105 if (rgbDataSrc)
00106 {
00107 ShowTitle(videoName);
00108 HandleNewVideo();
00109 }
00110 }
00111
00112 void OpenVideo(std::string videoName, strconst videoType)
00113 {
00114 mVideoPlayer->OpenVideo(videoName, videoType);
00115 ShowTitle(videoName);
00116 if (!videoName.empty())
00117 HandleNewVideo();
00118 }
00119
00120 void HandleNewVideo()
00121 {
00122 mVideoPlayer->Reset();
00123 HandleFrameSettings();
00124 }
00125
00126 void HandleFrameSettings()
00127 {
00128 int nFrames = mVideoPlayer->LastFrame();
00129 int imW = mVideoPlayer->DataSrc()->FrameWidth();
00130 if (mSimTimeLine->ViewStripRgbSrc())
00131 imW = mSimTimeLine->ViewStripRgbSrc()->FrameWidth();
00132 mSimTimeLine->Current(0);
00133 mSimTimeLine->SetSpan(40*nFrames);
00134 mSimTimeLine->SetMinMaxDocWidth(160, nFrames*imW);
00135
00136 mTimeLineRuler->SetSpan(40*nFrames);
00137 for (int t=0; t<mExtraTimeLines.size(); t++)
00138 {
00139 mExtraTimeLines[t]->Current(0);
00140 mExtraTimeLines[t]->SetSpan(40*nFrames);
00141 mExtraTimeLines[t]->SetMinMaxDocWidth(160, nFrames*imW);
00142 }
00143 }
00144
00145 void SetSimilarityTableSet(SimilarityTableSet* simSet)
00146 {
00147 mSimSet = simSet;
00148
00149 ClearAverages();
00150 int avgFrames = 12;
00151 if (mAvgFramesVSB)
00152 avgFrames = mAvgFramesVSB->GetValue();
00153 ComputeAverages(avgFrames);
00154 mSimTimeLine->SetSimilarityTableSet(simSet);
00155 mSimTimeLine->SetAverages(&mAverages, &mMaxima, &mMeans);
00156 for (int t=0; t<mExtraTimeLines.size(); t++)
00157 mExtraTimeLines[t]->SetSimilarityTableSet(simSet);
00158 }
00159
00160 void ClearAverages()
00161 {
00162 for (int i=0; i<mAverages.size(); i++)
00163 delete mAverages[i];
00164 mAverages.clear();
00165 mMaxima.clear();
00166 mMeans.clear();
00167 }
00168
00169 Averages* GetAverages()
00170 {
00171 return &mAverages;
00172 }
00173
00174 FloatVector* Means()
00175 {
00176 return &mMeans;
00177 }
00178
00179 FloatVector* Maxima()
00180 {
00181 return &mMaxima;
00182 }
00183
00184 void ComputeAverages(int nFrames)
00185 {
00186 if (!mSimSet)
00187 return;
00188 nFrames += (nFrames%2) ? 1 : 0;
00189 int nFramesDiv2 = nFrames/2;
00190
00191 for (int i=0; i<mSimSet->NrTables(); i++)
00192 {
00193 FloatVector* avgVector = new FloatVector;
00194 SimTableType* simTable = mSimSet->GetSimTable(i);
00195 int tableSize = mSimSet->TableSize();
00196 double sum = 0.f;
00197
00198 for (int s=0; s<nFrames; s++)
00199 {
00200 sum += simTable->Get1(s);
00201 if (s<nFramesDiv2)
00202 avgVector->push_back((float)(sum/(s+1)));
00203 }
00204 int sz = tableSize - nFramesDiv2;
00205 for (int j=nFramesDiv2; j<sz; j++)
00206 {
00207 sum += simTable->Get1(j+nFramesDiv2);
00208 sum -= simTable->Get1(j-nFramesDiv2);
00209 avgVector->push_back((float)(sum/nFrames));
00210 }
00211
00212 mAverages.push_back(avgVector);
00213
00214
00215 float max = 0.f, val;
00216 sum = 0;
00217 for (int m=nFramesDiv2; m<tableSize-nFramesDiv2; m++)
00218 {
00219 sum += (val = (*avgVector)[m]);
00220 if (val > max)
00221 max = val;
00222 }
00223 float mean = (float) (sum/(tableSize-nFrames));
00224 mMeans.push_back(mean);
00225 mMaxima.push_back(max);
00226 }
00227 }
00228
00229 void ShowTitle(strconst videoName)
00230 {
00231 if (!videoName.empty())
00232 {
00233 std::string name = FileNameTail(videoName);
00234 mTitledVideoPlayer->TitleText()->SetText(name);
00235 }
00236 }
00237
00238 TitledWindow*
00239 ExtraTimeLine(Window* parent, int x, int y, int w, int h, strconst str)
00240 {
00241 TitledWindow* TWnd = new TitledWindow(parent, x, y, w, h, str,1);
00242 Window* pane = TWnd->ContentPane();
00243
00244 WindowDocScroller* docScroller =
00245 new WindowDocScroller(pane,0,0,pane->W(),pane->H(),1);
00246 docScroller->ConnectTo(pane);
00247 SimilarityTimeLine* simTL =
00248 new SimilarityTimeLine(docScroller,0,16,pane->W(),pane->H()-16,0);
00249 docScroller->SetDocWindow(simTL,simTL,true);
00250 simTL->SetListener(this, (void *) mVideoPlayer);
00251 simTL->ViewStripShow(false);
00252 simTL->SetBackground(mSimTimeLine->GetBackground());
00253 simTL->SetBorderType(mSimTimeLine->GetBorderType());
00254 simTL->SetBorderBackground(mSimTimeLine->GetBorderBackground());
00255 simTL->SetBorderFillShaded(mSimTimeLine->GetBorderFillShaded());
00256 simTL->SetNeedleColor(mSimTimeLine->GetNeedleColor());
00257 mExtraTimeLines.push_back(simTL);
00258 SetSimilarityTableSet(mSimSet);
00259 HandleFrameSettings();
00260 TWnd->SetCloseWindowListener(this,(void*)simTL);
00261 return TWnd;
00262 }
00263
00264 virtual void DisplayFunc()
00265 {
00266 mTimeLineRuler->DocX(5);
00267 mTimeLineRuler->DocW(mTimeLineRuler->W()-10);
00268 if (mSimTimeLine->H() < mAxisThumb->Y() + 40)
00269 mAxisThumb->SetDimensions(RETAIN,mSimTimeLine->H()-40,RETAIN,RETAIN);
00270 if (mAxisThumb->Y() < 18)
00271 mAxisThumb->SetDimensions(RETAIN,18,RETAIN,RETAIN);
00272 mSimTimeLine->SetAxisY(mAxisThumb->Y()+10);
00273 SyncCheckBoxSimColors();
00274 if (mCenterNeedle)
00275 {
00276 HandleVisibility(mSimTimeLine);
00277 for (int i=0; i<mExtraTimeLines.size(); i++)
00278 HandleVisibility(mExtraTimeLines[i]);
00279 }
00280 Window::DisplayFunc();
00281 }
00282
00283 protected:
00284
00285 void SyncCheckBoxSimColors()
00286 {
00287 if (!mSimSet || !mChBoxValBars)
00288 return;
00289 for (int i=0; i<mSimSet->NrTables(); i++)
00290 {
00291 mSimTimeLine->SetShowSim(i, false);
00292 mSimTimeLine->SetSimColor(i,0);
00293 for (int t=0; t<mExtraTimeLines.size(); t++)
00294 {
00295 mExtraTimeLines[t]->SetShowSim(i, false);
00296 mExtraTimeLines[t]->SetSimColor(i,0);
00297 }
00298 }
00299 for (int i=0; i<mChBoxValBars->NrOfItems(); i++)
00300 {
00301 CheckBoxValueBar* chBoxValB = mChBoxValBars->GetItem(i);
00302 std::string name = chBoxValB->Name();
00303 int idx = mSimSet->GetIndex(name);
00304 if (idx != -1)
00305 {
00306 mSimTimeLine->SetSimColor(idx,chBoxValB->Color());
00307 mSimTimeLine->SetShowSim(idx,chBoxValB->Selected());
00308 for (int t=0; t<mExtraTimeLines.size(); t++)
00309 {
00310 mExtraTimeLines[t]->SetSimColor(idx,chBoxValB->Color());
00311 mExtraTimeLines[t]->SetShowSim(idx,chBoxValB->Selected());
00312 }
00313 }
00314 }
00315 }
00316
00317 void HandleFeedbackControls(int frameNr)
00318 {
00319 int frameErr = mSimTimeLine->FrameError();
00320 char buf[40];
00321 sprintf(buf, "fr: %d", frameNr+frameErr);
00322 mFrameNrTxt->SetText(buf);
00323
00324 if (!mSimSet || !mOptions || !mChBoxValBars)
00325 return;
00326
00327 for (int i=0; i<mChBoxValBars->NrOfItems(); i++)
00328 {
00329 CheckBoxValueBar* chBoxValB = mChBoxValBars->GetItem(i);
00330 std::string name = chBoxValB->Name();
00331
00332 char buf[20];
00333 sprintf(buf,"");
00334 int barW = 4;
00335 int idx = mSimSet->GetIndex(name);
00336 if (idx!=-1)
00337 {
00338 SimTableType* simTable = mSimSet->GetSimTable(idx);
00339 double sim = simTable->Get1(frameNr+frameErr);
00340 sprintf(buf, "%5.5f", sim);
00341 barW = 4+sim*(mChBoxValBars->W()-chBoxValB->ValueBar()->X()-6);
00342
00343 ULONG col = 0;
00344 float maxim = mMaxima[idx];
00345 if (maxim>=0.2 && frameNr<(*mAverages[idx]).size()-1)
00346 {
00347 double avgSim = (*mAverages[idx])[frameNr+frameErr];
00348 if (mSimTimeLine->PassTest(avgSim,maxim,mMeans[idx]))
00349 {
00350 UCHAR a = avgSim/maxim * 255;
00351 col = ARGB2COLOR(a,255,255,255);
00352 }
00353 }
00354 chBoxValB->ValueText()->SetBackground(col);
00355 }
00356 chBoxValB->ValueStr(buf);
00357 chBoxValB->ValueBar()->SetDimensions(RETAIN,RETAIN,barW,RETAIN);
00358
00359 sprintf(buf,"");
00360 if (idx!=-1)
00361 sprintf(buf, "%2.2f %2.2f", mMaxima[idx], mMeans[idx]);
00362 mStatistics[i]->SetText(buf);
00363 }
00364 }
00365
00366 virtual void
00367 CurrentChanged(SimilarityTimeLine *src, long nVal, void* userData)
00368 {
00369 VideoPlayer* vP = (VideoPlayer*) userData;
00370 int nFrame = (int) floor((nVal / 40.)+0.5);
00371 if (nFrame != vP->FrameNr())
00372 vP->GotoFrame(nFrame);
00373 else
00374 {
00375 mSimTimeLine->Current(nFrame*40);
00376 mTimeLineRuler->Current(nFrame*40);
00377 for (int i=0; i<mExtraTimeLines.size(); i++)
00378 mExtraTimeLines[i]->Current(nFrame*40);
00379 }
00380 }
00381
00382 virtual void
00383 OnNewFrame(VideoPlayer *src, int frameNr, void* userData)
00384 {
00385 mTimeLineRuler->Current(frameNr*40);
00386 mSimTimeLine->Current(frameNr*40);
00387 HandleVisibility(mSimTimeLine);
00388
00389 for (int i=0; i<mExtraTimeLines.size(); i++)
00390 {
00391 mExtraTimeLines[i]->Current(frameNr*40);
00392 HandleVisibility(mExtraTimeLines[i]);
00393 }
00394 HandleFeedbackControls(frameNr);
00395 }
00396
00397 void HandleVisibility(SimilarityTimeLine* simTL)
00398 {
00399 if (!simTL->IsDragging() &&
00400 (mCenterNeedle || (mVideoPlayer->Playing() && mCenterNeedleOnPlay)))
00401 simTL->ShowCurrentAt(simTL->W()/2);
00402 else
00403 simTL->MakeCurrentVisible();
00404 }
00405
00406 virtual bool OnCloseWindow(Window *src, void* userData)
00407 {
00408 SimilarityTimeLine* simTL = (SimilarityTimeLine*) userData;
00409 for (int i=0; i<mExtraTimeLines.size(); i++)
00410 {
00411 if (simTL == mExtraTimeLines[i])
00412 {
00413 mExtraTimeLines.erase(mExtraTimeLines.begin() + i);
00414 return true;
00415 }
00416 }
00417 return true;
00418 }
00419
00420 virtual void
00421 CheckBoxEvent(CheckBox *src, bool checked, void* userData)
00422 {
00423 if (src == mShowClassifyCB)
00424 mSimTimeLine->ShowClassify(checked);
00425 else
00426 HandleFeedbackControls(mSimTimeLine->Current()/40);
00427 }
00428
00429 virtual void
00430 ButtonSelectionEvent(Button *src, void* userData)
00431 {
00432 if (src == mCheckAllBtn || src == mClearAllBtn)
00433 {
00434 bool mode = (src == mCheckAllBtn);
00435 for (int i=0; i<mChBoxValBars->NrOfItems(); i++)
00436 mChBoxValBars->GetItem(i)->ChBox()->DoSelect(mode);
00437 }
00438 }
00439
00440 virtual void OnValueChanged(ValueScrollBar *src, int value,void* userData)
00441 {
00442 if (src == mPercMaximVSB)
00443 mSimTimeLine->PercMaxVal(value/100.f);
00444 if (src == mPercMeanVSB)
00445 mSimTimeLine->PercMaxMeanVal(value/100.f);
00446 if (src == mAvgFramesVSB)
00447 {
00448 SetSimilarityTableSet(mSimSet);
00449 SyncCheckBoxSimColors();
00450 }
00451 }
00452
00453
00454 void BuildConceptControl(Window* parent, int x, int y, int w, int h,
00455 SimilarityTableSet* simSet, int options)
00456 {
00457 mTitledControl = new TitledWindow(parent,x,y,w,h,"Concept Control");
00458 Window* pane = mTitledControl->ContentPane();
00459 int paneW = pane->W();
00460 int paneH = pane->H();
00461 ScrollWnd* sWnd = new ScrollWnd(pane,0,96,paneW,paneH-96,true,0,1);
00462 sWnd->ConnectTo(pane);
00463
00464 mChBoxValBars = new CheckBoxValueBars(sWnd->ContentHolder(),0,0,
00465 sWnd->ContentHolder()->W(),20,3);
00466 sWnd->ReplaceContentPane(mChBoxValBars);
00467 mChBoxValBars->ConnectTo(sWnd->ContentHolder(),OglGui::TOLEFTRIGHT);
00468 mChBoxValBars->CheckBoxWidth(160);
00469
00470 mOptions = options;
00471 mChBoxValBars->AddChoice("");
00472 std::vector<std::string> names;
00473 if (simSet)
00474 names = simSet->GetNames();
00475 else
00476 names.push_back("<empty>");
00477 for (int i=0; i<names.size(); i++)
00478 {
00479 CheckBoxValueBar* chBoxValB =
00480 mChBoxValBars->AddItem(names[i],mSimTimeLine->GetSimColor(i));
00481 chBoxValB->ChBox()->SetCheckBoxListener(this,i);
00482 if (i==0)
00483 chBoxValB->Selected(true);
00484 mChBoxValBars->AddChoice(names[i]);
00485 StaticText* stat = new StaticText(chBoxValB,paneW-100,0,60,20,"");
00486 mStatistics.push_back(stat);
00487 }
00488
00489 mCheckAllBtn =
00490 new Button(pane,0,72,68,22,"All",BEV_ETCHED,true);
00491 mClearAllBtn =
00492 new Button(pane,72,72,68,22,"None",BEV_ETCHED,true);
00493
00494 mCheckAllBtn->SetButtonListener(this);
00495 mClearAllBtn->SetButtonListener(this);
00496
00497 mShowClassifyCB = new CheckBox(pane,170,72,160,22,"Show Classification",
00498 true,BEV_ETCHED);
00499 mShowClassifyCB->SetRoundness(0,0,0,0);
00500 mShowClassifyCB->SetCheckBoxListener(this);
00501
00502 (new StaticText(pane,0,48,100,22,"Avg Window"))
00503 ->SetAlign(oglLeftAlign);
00504 mAvgFramesVSB =
00505 new ValueScrollBar(pane,100,48,pane->W()-104,22,2,126,12);
00506 mAvgFramesVSB->SetValueScrollBarListener(this);
00507 (new StaticText(pane,0,24,100,22,"Perc Max"))
00508 ->SetAlign(oglLeftAlign);
00509 mPercMaximVSB =
00510 new ValueScrollBar(pane,100,24,pane->W()-104,22,20,98,66);
00511 mPercMaximVSB->SetValueScrollBarListener(this);
00512 (new StaticText(pane,0,0,100,22,"Perc Max-Avg"))
00513 ->SetAlign(oglLeftAlign);
00514 mPercMeanVSB =
00515 new ValueScrollBar(pane,100,0,pane->W()-104,22,4,98,25);
00516 mPercMeanVSB->SetValueScrollBarListener(this);
00517 }
00518
00519 private:
00520 void Init(int w, int h, int options, SimilarityTableSet* simSet)
00521 {
00522 int vpH = 288 + 32 + 8;
00523
00524 mChBoxValBars = 0;
00525 mAvgFramesVSB = 0;
00526 mPercMaximVSB = 0;
00527 mPercMeanVSB = 0;
00528
00529 mTitledVideoPlayer = new TitledWindow(this,4,4,352+8,vpH+32,"");
00530 Window* pane = mTitledVideoPlayer->ContentPane();
00531 int paneW = pane->W();
00532 int paneH = pane->H();
00533
00534 mVideoPlayerWithButtons =
00535 new VideoPlayerWithButtons(pane,0, 0, paneW, vpH);
00536 mVideoPlayerWithButtons->ConnectTo(pane);
00537 mVideoPlayer = mVideoPlayerWithButtons->Player();
00538 mVideoPlayer->NormalSpeed(true);
00539
00540 Window* videoTitle = mTitledVideoPlayer->TitleText();
00541 mFrameNrTxt = new StaticText(videoTitle,paneW-90,2,60,20, "");
00542 mFrameNrTxt->SetAlign(oglLeftAlign,oglCenterAlign);
00543 mFrameNrTxt->ConnectTo(videoTitle,OglGui::TORIGHT);
00544
00545 mTitledTimeLine = new TitledWindow(this,368,4,w-372,vpH+32,"TimeLine");
00546 pane = mTitledTimeLine->ContentPane();
00547 paneW = pane->W();
00548 paneH = pane->H();
00549
00550 mTimeLineRuler =
00551 new SimilarityTimeLine(pane,0,paneH-32,paneW, 30, 0);
00552 mTimeLineRuler->ConnectTo(pane,OglGui::TOLEFTRIGHT | OglGui::TOTOP);
00553 mTimeLineRuler->SetListener(this, (void*) mVideoPlayer);
00554 mTimeLineRuler->SetBorderType(BEV_ETCHED);
00555 mTimeLineRuler->SetBorderFillShaded(2);
00556 mTimeLineRuler->ShowNeedle(true);
00557 mTimeLineRuler->SetNeedleUpDownHeight(100,100);
00558 mTimeLineRuler->SetNeedleColor(oglRED);
00559 mTimeLineRuler->ViewStripShow(false);
00560
00561 int nViews = (options & 4) ? 600 : 0;
00562 mDocScroller = new WindowDocScroller(pane,0,0,paneW,paneH-34,1);
00563 mDocScroller->ConnectTo(pane);
00564 mSimTimeLine =
00565 new SimilarityTimeLine(mDocScroller,0,16,paneW,paneH-50,nViews);
00566 mDocScroller->SetDocWindow(mSimTimeLine,mSimTimeLine,true);
00567
00568 mSimTimeLine->SetBorderType(-1);
00569 mSimTimeLine->SetBorderBackground(0xe0303030);
00570
00571
00572 mSimTimeLine->SetListener(this, (void *) mVideoPlayer);
00573
00574 mAxisThumb = new SizableWindow(mSimTimeLine,paneW-12,10,8,20);
00575 mAxisThumb->SetBorderType(BEV_ETCHED);
00576 mAxisThumb->SetBorderBackground(oglGREEN);
00577 mAxisThumb->SetBorderFillShaded(2);
00578 mAxisThumb->SetAllowHighlight(false);
00579 mAxisThumb->SetHighLightBorderType(BEV_RIDGE);
00580 mAxisThumb->SetMoveFeedback(true);
00581 mAxisThumb->SetMoveCursor(oglCursorN);
00582
00583 mAxisThumb->ConnectTo(mSimTimeLine,OglGui::TORIGHT);
00584 mAxisThumb->SetAllowSizeDirections(15,false);
00585 mAxisThumb->SetAllowMoveDirections(10,false);
00586
00587 mVideoPlayer->SetVideoPlayerListener(this,0);
00588
00589 mOptions = options;
00590 mCenterNeedle = true;
00591 mCenterNeedleOnPlay = true;
00592
00593
00594
00595 if (!(options & 8))
00596 BuildConceptControl(this,4,vpH+38,360,450,simSet,options);
00597
00598 if (options & 16)
00599 {
00600 OGLVIEW* oglView = mVideoPlayer->OglView();
00601 int y = vpH+430;
00602 int h = H()-y;
00603 mViewAnimator =
00604 new OglGui::TexturedViewAnimator(this,4,vpH+430,h,h,oglView);
00605 view3DSys.SetZoom(mViewAnimator->OglView3D(), 1.6f, 1.6f);
00606 oglSys.OGLStart(mViewAnimator->GetOGLWND());
00607 }
00608
00609
00610 SetSimilarityTableSet(simSet);
00611 }
00612
00613 SimilarityTableSet* mSimSet;
00614
00615 TitledWindow* mTitledTimeLine;
00616 TitledWindow* mTitledVideoPlayer;
00617 TitledWindow* mTitledControl;
00618 SizableWindow* mAxisThumb;
00619 VideoPlayer* mVideoPlayer;
00620 VideoPlayerWithButtons* mVideoPlayerWithButtons;
00621
00622 Window* mFun3DWnd;
00623 Button* mCheckAllBtn;
00624 Button* mClearAllBtn;
00625 StaticText* mFrameNrTxt;
00626 WindowDocScroller* mDocScroller;
00627 CheckBoxValueBars* mChBoxValBars;
00628 SimilarityTimeLine* mSimTimeLine;
00629 SimilarityTimeLine* mTimeLineRuler;
00630 std::vector<SimilarityTimeLine*> mExtraTimeLines;
00631
00632 bool mCenterNeedleOnPlay;
00633 bool mCenterNeedle;
00634 int mOptions;
00635
00636
00637 FloatVector mMaxima;
00638 FloatVector mMeans;
00639 Averages mAverages;
00640 std::vector<StaticText*> mStatistics;
00641 ValueScrollBar* mAvgFramesVSB;
00642 ValueScrollBar* mPercMaximVSB;
00643 ValueScrollBar* mPercMeanVSB;
00644 CheckBox* mShowClassifyCB;
00645
00646 OglGui::TexturedViewAnimator* mViewAnimator;
00647 ILOG_VAR_DEC;
00648 };
00649
00650 ILOG_VAR_INIT(SimilarityTimeLineVideo, Visualization);
00651
00652 }
00653 }
00654
00655 #endif