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

MakeDirQuidLookup.h

Go to the documentation of this file.
00001 #ifndef Impala_Core_ImageSet_MakeDirQuidLookup_h
00002 #define Impala_Core_ImageSet_MakeDirQuidLookup_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 MakeDirQuidLookup : 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     MakeDirQuidLookup(Reporter* reporter, CmdOptions& options)
00038     {
00039         mReporter = reporter;
00040     }
00041 
00042     virtual
00043     ~MakeDirQuidLookup()
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         //std::string sectionName = is->GetSectionOfFile(fileId);
00058         std::string dirName = is->GetDirOfFile(fileId);
00059         Quid quid = is->GetQuidImage(fileId);
00060         mTable->Add(quid, dirName);
00061     }
00062 
00063     virtual void
00064     HandleDoneWalk(ImageSet* is)
00065     {
00066         String filename = is->GetDatabase()->GetFilePath(".","dirquidlookup.tab", true, false);
00067         Write(mTable, filename, is->GetDatabase(), true);
00068         delete mTable;
00069     }
00070 
00071 private:
00072 
00073     Reporter* mReporter;
00074     QuidLookupTable* mTable;
00075 
00076     ILOG_VAR_DEC;
00077 };
00078 
00079 ILOG_VAR_INIT(MakeDirQuidLookup, Core.ImageSet);
00080 
00081 } // namespace ImageSet
00082 } // namespace Core
00083 } // namespace Impala
00084 
00085 #endif

Generated on Thu Jan 13 09:04:31 2011 for ImpalaSrc by  doxygen 1.5.1