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

FileReadIxRectangle.h

Go to the documentation of this file.
00001 #ifndef Impala_Core_Geometry_FileReadIxRectangle_h
00002 #define Impala_Core_Geometry_FileReadIxRectangle_h
00003 
00004 #include "Core/Geometry/IxRectangle.h"
00005 #include "Basis/File.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 FileReadIxRectangle(BackInsertIterator bi, std::string fileName)
00019 {
00020     File f(fileName, "r");
00021     if (! f.Valid())
00022         return;
00023     while (! f.Eof())
00024     {
00025         std::string line = f.ReadLine(true);
00026         if (! line[0])
00027             continue;
00028         Util::StringParser p(line);
00029         IxRectangle vr;
00030         vr.mImageName = p.GetString();
00031         vr.mAnno = p.GetString();
00032         vr.mRect = p.GetRectangle();
00033         vr.mSection = p.GetString();
00034         vr.mDir = p.GetString();
00035         if (! p.TheEnd())
00036             vr.mExtra = p.GetString();
00037         *bi++ = vr;
00038     }
00039 }
00040 
00041 } // namespace Geometry
00042 } // namespace Core
00043 } // namespace Impala
00044 
00045 #endif

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