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

void Impala::Application::TagsLife::TagsWeekPlot::ShowHistogram (  )  [inline, protected]

Definition at line 198 of file TagsWeekPlot.h.

References AXIS_X, AXIS_Y, OglGui::OglWindow::H(), mBarBgColor, mBarBorderColor, mBarFillColor, mFills, mFirstVisible, mHistogram, mLastVisible, mMaxFreq, mMinViewSize, mStep, NrVisible(), ShowLabel(), ShowWeekNr(), and OglGui::OglWindow::W().

Referenced by DisplayFunc().

00199     {
00200         float slotSz = (W() - AXIS_X) / (float) NrVisible();
00201         float binSz  = (slotSz >= 2) ? slotSz / 2 : 1;
00202         float viewH  = (slotSz >= mMinViewSize) ? slotSz : 0;
00203         bool  oneCol = mBarBgColor == mBarFillColor &&
00204                        mBarBgColor == mBarBorderColor;
00205 
00206         int yHeight = H()-AXIS_Y-viewH-7;
00207 
00208         for (int i=mFirstVisible; i<=mLastVisible; i++)
00209         {
00210             int x    = AXIS_X + (i-mFirstVisible) * slotSz;
00211             int barH = (mHistogram[i]/(float) mMaxFreq) * yHeight;
00212 
00213             if (barH >= 1)
00214             {
00215                 SetSolidFillColor(mBarBgColor);
00216                 FillRectangle(x+slotSz/4,AXIS_Y+viewH,binSz,barH);
00217             }
00218             if (!oneCol && mFills[i] * barH >= 1)
00219             {
00220                 SetSolidFillColor(mBarFillColor);
00221                 FillRectangle(x+slotSz/4,AXIS_Y+viewH,binSz,mFills[i]*barH);
00222             }
00223             if (!oneCol && barH >= 1)
00224             {
00225                 SetSolidLineColor(mBarBorderColor);
00226                 DrawRectangle(x+slotSz/4,AXIS_Y+viewH,binSz,barH);
00227             }
00228             ShowWeekNr(i, x, slotSz);
00229         }
00230 
00231         SetSolidLineColor(mBarBorderColor);
00232         DrawRectangle(AXIS_X+1, AXIS_Y+viewH, 0, yHeight);
00233         for(long i=0; i <= mMaxFreq; i+= mStep) {
00234                 //ILOG_INFO("i=" << i << "; mMaxFreq=" << mMaxFreq);
00235                 int y = (i/(float) mMaxFreq) * yHeight+AXIS_Y+viewH;
00236             DrawRectangle(AXIS_X, y, -3, 0);
00237             ShowLabel(i, y);
00238         }
00239     }

Here is the call graph for this function:


Generated on Fri Mar 19 10:51:55 2010 for ImpalaSrc by  doxygen 1.5.1