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

ImageSetIdxGridScroller.h

Go to the documentation of this file.
00001 //345678901234567890123456789012345678901234567890123456789012345678901234567890
00002 // Convenience class creating a ImageSetIdxGrid inside a WindowDocScroller
00003 // Author: Richard van Balen
00004 #ifndef Impala_Visualization_ImageSetIdxGridScroller_h
00005 #define Impala_Visualization_ImageSetIdxGridScroller_h
00006 
00007 #include "OglGui/WindowDocScroller.h"
00008 #include "Visualization/ImageSetIdxGrid.h"
00009 
00010 namespace Impala {
00011 namespace Visualization {
00012 
00013 class ImageSetIdxGridScroller : public OglGui::WindowDocScroller
00014 {
00015 public:
00016     typedef Core::ImageSet::ImageSet    ImageSet;
00017     typedef OglGui::WindowDocScroller   WindowDocScroller;
00018 
00019     ImageSetIdxGridScroller(int x, int y, int w, int h, int nrRow=5) :
00020         WindowDocScroller(x, y, w, h, 2+0)
00021     {
00022         Init(nrRow);
00023     }
00024 
00025     ImageSetIdxGridScroller(Window* parent, int w, int h, int nrRow=5) :
00026         WindowDocScroller(parent, w, h, 2+0)
00027     {
00028         Init(nrRow);
00029     }
00030 
00031     ImageSetIdxGridScroller(Window* parent,int x,int y,int w,int h,int nrRow=5):
00032         WindowDocScroller(parent, x, y, w, h, 2+0)
00033     {
00034         Init(nrRow);
00035     }
00036 
00037 
00038     void AddImageSetIdxs(ImageSet* imSet, int startIdx=0, int endIdx=-1)
00039     {
00040         mImageSetIdxGrid->AddImageSetIdxs(imSet,startIdx,endIdx);
00041     }
00042 
00043     void AddImageSetIdx(ImageSet* imSet, int idx)
00044     {
00045         mImageSetIdxGrid->AddImageSetIdx(imSet, idx);
00046     }
00047 
00048     void Clear()
00049     {
00050         mImageSetIdxGrid->Clear();
00051     }
00052 
00053     void UpdateLayout(bool reset=false)
00054     {
00055         mImageSetIdxGrid->UpdateLayout(reset);
00056     }
00057 
00058     void PageUpDownExtra(int x)     { mPageDeltaExtra = x; }
00059     void NrOfImOnRow(int n)         { mImageSetIdxGrid->NrOfImOnRow(n); }
00060     void ShowNames(bool mode)       { mImageSetIdxGrid->ShowNames(mode); }
00061     void ShowDims(bool mode)        { mImageSetIdxGrid->ShowDims(mode); }
00062     void FixedCellWidth(int w)      { mImageSetIdxGrid->FixedCellWidth(w); }
00063 
00064     ImageSetIdxGrid* ImSetIdxGrid()
00065     {
00066         return mImageSetIdxGrid;
00067     }
00068 
00069     virtual void DisplayFunc()
00070     {
00071         OglGui::WindowDocScroller::DisplayFunc();
00072         int hH = mHolder->H();
00073         int dif = hH % mImageSetIdxGrid->CellHeight();
00074         SetPageDeltas(RETAIN, dif + mPageDeltaExtra);
00075     }
00076 
00077 private:
00078     void Init(int nrRow)
00079     {
00080         VerticalScrollBar()->SetLineIncrement(10);
00081         mImageSetIdxGrid = new ImageSetIdxGrid(this,0,0,100,100,nrRow);
00082         SetDocWindow(mImageSetIdxGrid,mImageSetIdxGrid,2);
00083         ReshapeFollowMode(0);
00084         mPageDeltaExtra = 0;
00085     }
00086 
00087     ImageSetIdxGrid*    mImageSetIdxGrid;
00088     int                 mPageDeltaExtra;
00089 };
00090 
00091 } // Namespace Visualization
00092 } // Namespace Impala
00093 #endif
00094 

Generated on Fri Mar 19 09:31:50 2010 for ImpalaSrc by  doxygen 1.5.1