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

DatabaseReadIxRectangle.h

Go to the documentation of this file.
00001 #ifndef Impala_Core_Geometry_DatabaseReadIxRectangle_h
00002 #define Impala_Core_Geometry_DatabaseReadIxRectangle_h
00003 
00004 #include "Core/Geometry/IxRectangle.h"
00005 #include "Util/Database.h"
00006 #include "Util/StringParser.h"
00007 
00008 namespace Impala
00009 {
00010 namespace Core
00011 {
00012 namespace Geometry
00013 {
00014 
00015 
00016 template <class BackInsertIterator>
00017 inline void
00018 DatabaseReadIxRectangle(BackInsertIterator bi, String fileName,
00019                         Util::Database* db)
00020 {
00021     Util::IOBuffer* buf = db->GetIOBuffer(fileName, true, true, "");
00022     if (! buf)
00023         return;
00024 
00025     while (buf->Available())
00026     {
00027         String line = buf->ReadLine();
00028         if (! line[0])
00029             continue;
00030         Util::StringParser p(line);
00031         if (p.At("#"))
00032             continue;
00033         IxRectangle vr;
00034         vr.mImageName = p.GetString();
00035         vr.mAnno = p.GetString();
00036         vr.mRect = p.GetRectangle();
00037         vr.mSection = p.GetString();
00038         vr.mDir = p.GetString();
00039         if (! p.TheEnd())
00040             vr.mExtra = p.GetString();
00041         *bi++ = vr;
00042     }
00043 }
00044 
00045 } // namespace Geometry
00046 } // namespace Core
00047 } // namespace Impala
00048 
00049 #endif

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