00001
00002
00003
00004
00005
00006
00007
00008
00010
00011
00012 #ifndef __LIDAR_TXT_POINT_READER_H__
00013 #define __LIDAR_TXT_POINT_READER_H__
00014
00015 #include "lidar/PointReader.h"
00016 #include "lidar/IO.h"
00017
00018 LT_BEGIN_LIDAR_NAMESPACE
00019
00026 class TXTPointReader : public PointReader
00027 {
00028 CONCRETE_OBJECT(TXTPointReader);
00029 public:
00030
00042 void init(const char *path, const char *format,
00043 size_t header, bool doFullInit);
00055 void init(IO *io, const char *format,
00056 size_t header, bool doFullInit);
00057
00070 void init(const char *path, const PointInfo &fieldInfo,
00071 size_t header, bool doFullInit);
00084 void init(IO *io, const PointInfo &fieldInfo,
00085 size_t header, bool doFullInit);
00086
00095 void initBoundsAndNumPoints(void);
00096
00097 const char *getFileFormatString(void) const;
00098
00099 void loadMetadata(Metadata &metadata, bool sanitize) const;
00100
00101 double getTotalWork(const Bounds &bounds, double fraction) const;
00102
00103 PointIterator *createIterator(const Bounds &bounds,
00104 double fraction,
00105 const PointInfo &pointInfo,
00106 ProgressDelegate *delegate) const;
00107
00135 static void parseFormat(const char *format,
00136 PointInfo &fieldInfo);
00147 static void parseFormat(const char *format,
00148 PointInfo &fieldInfo,
00149 const PointInfo &pointInfo);
00150
00151 protected:
00152 void setBoundsAndNumPoints(bool doFullInit);
00153
00154 IO *m_io;
00155 size_t m_header;
00156 PointInfo m_fieldInfo;
00157 double m_totalWork;
00158
00159 class Iterator;
00160 };
00161
00162 LT_END_LIDAR_NAMESPACE
00163 #endif // __LIDAR_TXT_POINT_READER_H__