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

void Impala::Visualization::GUI::KeyframeResultBar::DoRankPlot ( int  wndW,
int  wndH 
) [inline, protected]

Definition at line 70 of file KeyframeResultBar.h.

References OglGui::B2T, OglGui::OglWindow::ConnectTo(), OglGui::OglWindow::GetOGLWND(), mKeyResults, mSimPlotView, Impala::Application::DemoCamera2d::oglWnd, OglGui::R2R, OglGui::OglWindow::SetBackground(), Impala::Core::Array::Array2dTem< StorT, elemSize, ArithT >::SetValue(), OglGui::T2T, and OglGui::Window::Window().

Referenced by Init().

00071     {
00072         int plotW   = mKeyResults.size() * 2;
00073         int plotH   = 16;
00074 
00075         OglGui::Window* simPlotWin = new Window(this,wndW-plotW-4, wndH-plotH-3,
00076                                                 plotW, plotH, true);
00077         simPlotWin->SetBackground(oglLIGHTGREEN);
00078         simPlotWin->ConnectTo(this, R2R|T2T|B2T);
00079 
00080         OGLWND *oglWnd = simPlotWin->GetOGLWND();
00081         mSimPlotView = new Visualization::View(oglWnd, 0, 0, plotW, plotH, 1.0,
00082                                                false, false, true, NULL);
00083         KeyframeResultList::reverse_iterator lastResult = mKeyResults.rbegin();
00084         // RvB: Next line caused crash
00085         // lastResult++; // SK: Shouldn't need this, but MSVC++ appears to do...
00086         double maxScore = lastResult->score;
00087 
00088         static Core::Array::Element::Vec3Int32 colorCanvas(40, 40, 40);
00089         static Core::Array::Element::Vec3Int32 colorPlot(255, 255, 0);
00090 
00091         Core::Array::Array2dVec3UInt8* im =
00092             new Core::Array::Array2dVec3UInt8(plotW, plotH, 0, 0);
00093 
00094         int xCoord = 0;
00095         KeyframeResultList::iterator res = mKeyResults.begin();
00096         while (res != mKeyResults.end())
00097         {
00098             int valueToPlot = (int)((res->score / maxScore) * (plotH-1.0)+0.5);
00099             for (int yCoord = 0; yCoord < plotH; yCoord++)
00100             {
00101                 Core::Array::Element::Vec3Int32& pixel =
00102                     (plotH-1-yCoord == valueToPlot ? colorPlot : colorCanvas);
00103                 im->SetValue(pixel, xCoord, yCoord);
00104                 im->SetValue(pixel, xCoord + 1, yCoord);
00105             }
00106             xCoord += 2;
00107             res++;
00108         }
00109         mSimPlotView->UpdateImage(im, "Direct");
00110         // RvB: 2-2-2009 I think this needs deleting
00111         delete im;
00112     }

Here is the call graph for this function:


Generated on Fri Mar 19 11:52:00 2010 for ImpalaSrc by  doxygen 1.5.1