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

MakeQuidLookup.h

Go to the documentation of this file.
00001 #ifndef Impala_Core_ImageSet_MakeQuidLookup_h
00002 #define Impala_Core_ImageSet_MakeQuidLookup_h
00003 
00004 #include "Core/ImageSet/Reporter.h"
00005 #include "Core/ImageSet/MakeImageSet.h"
00006 #include "Core/Table/Write.h"
00007 
00008 namespace Impala
00009 {
00010 namespace Core
00011 {
00012 namespace ImageSet
00013 {
00014 
00015 class MakeQuidLookup : public Listener
00016 {
00017     typedef Table::TableTem<Column::ColumnTem<Quid>,
00018                             Column::ColumnTem<std::string> >
00019             QuidLookupTableBaseType;
00020 
00021     class QuidLookupTable : public QuidLookupTableBaseType
00022     {
00023         typedef Column::ColumnTem<Quid> ColumnQuid;
00024         typedef Column::ColumnTem<std::string> ColumnString;
00025     public:
00026         QuidLookupTable() :
00027             QuidLookupTableBaseType(ColumnQuid(0), ColumnString(0))
00028         {
00029             SetInfo("QuidLookupTable");
00030             SetColName(1, "quid");
00031             SetColName(2, "string");
00032         }
00033     };
00034 
00035 public:
00036 
00037     MakeQuidLookup(Reporter* reporter, CmdOptions& options)
00038     {
00039         mReporter = reporter;
00040     }
00041 
00042     virtual
00043     ~MakeQuidLookup()
00044     {
00045     }
00046 
00047     virtual void
00048     HandleNewWalk(ImageSet* is)
00049     {
00050         mTable = new QuidLookupTable();
00051     }
00052 
00053     virtual void
00054     HandleNewFile(ImageSet* is, int fileId, Array::Array2dVec3UInt8* im)
00055     {
00056         std::string fileName = is->GetFile(fileId);
00057         Quid quid = is->GetQuidImage(fileId);
00058         mTable->Add(quid, fileName);
00059     }
00060 
00061     virtual void
00062     HandleDoneWalk(ImageSet* is)
00063     {
00064         String filename = is->GetDatabase()->GetFilePath(".","quidlookup.tab", true, false);
00065         Write(mTable, filename, is->GetDatabase(), true);
00066         delete mTable;
00067     }
00068 
00069 private:
00070 
00071     Reporter* mReporter;
00072     QuidLookupTable* mTable;
00073 
00074     ILOG_VAR_DEC;
00075 };
00076 
00077 ILOG_VAR_INIT(MakeQuidLookup, Core.ImageSet);
00078 
00079 } // namespace ImageSet
00080 } // namespace Core
00081 } // namespace Impala
00082 
00083 #endif

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