TXTPointReader Class Reference
TXTPointReader reads LiDAR-based Text files.
More...
#include <TXTPointReader.h>
List of all members.
Public Member Functions |
void | init (const char *path, const char *format, size_t header, bool doFullInit) |
| Initialize with filename and format string.
|
void | init (IO *io, const char *format, size_t header, bool doFullInit) |
| Initialize with IO object and format string.
|
void | init (const char *path, const PointInfo &fieldInfo, size_t header, bool doFullInit) |
| Initialize with filename and field list.
|
void | init (IO *io, const PointInfo &fieldInfo, size_t header, bool doFullInit) |
| Initialize with IO object and field list.
|
void | initBoundsAndNumPoints (void) |
| Setup the bounds and number of points.
|
const char * | getFileFormatString (void) const |
| Get the file type and version.
|
void | loadMetadata (Metadata &metadata, bool sanitize) const |
| Load the point clouds metadata.
|
double | getTotalWork (const Bounds &bounds, double fraction) const |
| Get the amount of work needed to decode bounds.
|
PointIterator * | createIterator (const Bounds &bounds, double fraction, const PointInfo &pointInfo, ProgressDelegate *delegate) const |
| Get a PointIterator for a given bounds.
|
Static Public Member Functions |
static TXTPointReader * | create (void) |
static void | parseFormat (const char *format, PointInfo &fieldInfo) |
| Build a ChannelInfo array form a format string.
|
static void | parseFormat (const char *format, PointInfo &fieldInfo, const PointInfo &pointInfo) |
| Build a ChannelInfo array form a format string.
|
Protected Member Functions |
| TXTPointReader (void) |
virtual | ~TXTPointReader (void) |
void | setBoundsAndNumPoints (bool doFullInit) |
Protected Attributes |
IO * | m_io |
size_t | m_header |
PointInfo | m_fieldInfo |
double | m_totalWork |
Detailed Description
The TXTPointReader class reads point clouds from text files. Each line of the text file is point with the fields delimited by white space.
Definition at line 26 of file TXTPointReader.h.
Constructor & Destructor Documentation
TXTPointReader::TXTPointReader |
( |
void |
|
) |
[protected] |
virtual TXTPointReader::~TXTPointReader |
( |
void |
|
) |
[protected, virtual] |
Member Function Documentation
This methods returns a PointIterator for the given bounds.
- Parameters:
-
| bounds | the region of interest (HUGE_VAL are handled) |
| fraction | the fraction of the points you want (use 1.0 for all the points and use 0.1 to keep every tenth point) |
| channelInfo | the list of channels to be extracted |
| numChannels | the number of channels to be extracted |
| delegate | a ProgressDelegate for feedback (can be NULL) |
Implements PointSource.
const char* TXTPointReader::getFileFormatString |
( |
void |
|
) |
const [virtual] |
This method returns a string the contains the File Type and version of the PointReader. For example for a MrSID file this will will return "MG4 4.0.0.1".
Implements PointReader.
double TXTPointReader::getTotalWork |
( |
const Bounds & |
bounds, |
|
|
double |
fraction | |
|
) |
| | const [virtual] |
This method returns the amount of work needed to decode the points in bounds. getTotalWork() is used with ProgressDelegate to track the progress of a decode or encode.
- Parameters:
-
| bounds | the region of interest |
| fraction | the fraction of the points you want (use 1.0 for all the points and use 0.1 to keep every tenth point) |
- Returns:
- the work needed to decode bounds
Reimplemented from PointReader.
void TXTPointReader::init |
( |
IO * |
io, |
|
|
const PointInfo & |
fieldInfo, |
|
|
size_t |
header, |
|
|
bool |
doFullInit | |
|
) |
| | |
This method initializes the reader with IO object and field list.
- Parameters:
-
- Note:
- Use CHANNEL_NAME_Skip to skip a column.
void TXTPointReader::init |
( |
const char * |
path, |
|
|
const PointInfo & |
fieldInfo, |
|
|
size_t |
header, |
|
|
bool |
doFullInit | |
|
) |
| | |
This method initializes the reader with a filename and field list.
- Parameters:
-
- Note:
- Use CHANNEL_NAME_Skip to skip a column.
void TXTPointReader::init |
( |
IO * |
io, |
|
|
const char * |
format, |
|
|
size_t |
header, |
|
|
bool |
doFullInit | |
|
) |
| | |
This method initializes the reader with a IO object and format string.
- Parameters:
-
| io | the data source |
| format | the channel layout format string, see TXTPointReader::parseString(). |
| header | the number of header lines to skip |
| doFullInit | if true call initBoundsAndNumPoints() |
void TXTPointReader::init |
( |
const char * |
path, |
|
|
const char * |
format, |
|
|
size_t |
header, |
|
|
bool |
doFullInit | |
|
) |
| | |
This method initializes the reader with a filename and format string.
- Parameters:
-
| path | the filename |
| format | the channel layout format string, see TXTPointReader::parseString(). |
| header | the number of header lines to skip |
| doFullInit | if true call initBoundsAndNumPoints() |
void TXTPointReader::initBoundsAndNumPoints |
( |
void |
|
) |
|
This method reads the input text file to figures out the number of points and the bounding box. This method can take some time. If the method has not be called getBounds() will return Bounds::Huge() and getNumPoints() will return 2**64 - 1.
void TXTPointReader::loadMetadata |
( |
Metadata & |
metadata, |
|
|
bool |
sanitize | |
|
) |
| | const [virtual] |
This method loads the metadata for the point cloud. PointSource only load metadata on demand to reduce memory usage.
- Parameters:
-
| metadata | The metadata object to fill. |
| sanitize | If true remove vendor-specific metadata that we don't understand for example, Merrick::102 ("Index to page of point records") |
Implements PointSource.
static void TXTPointReader::parseFormat |
( |
const char * |
format, |
|
|
PointInfo & |
fieldInfo, |
|
|
const PointInfo & |
pointInfo | |
|
) |
| | [static] |
The function builds a ChannelInfo array based on the format string and the use the given ChannelInfo array's data types.
- Parameters:
-
static void TXTPointReader::parseFormat |
( |
const char * |
format, |
|
|
PointInfo & |
fieldInfo | |
|
) |
| | [static] |
The function builds a ChannelInfo array based on the format string.
Format syntax:
- 'x' => CHANNEL_NAME_X, DATATYPE_FLOAT64
- 'y' => CHANNEL_NAME_Y, DATATYPE_FLOAT64
- 'z' => CHANNEL_NAME_Z, DATATYPE_FLOAT64
- 'i' => CHANNEL_NAME_Intensity, DATATYPE_UINT16
- 'r' => CHANNEL_NAME_ReturnNum, DATATYPE_UINT8
- 'n' => CHANNEL_NAME_NumReturns, DATATYPE_UINT8
- 'd' => CHANNEL_NAME_ScanDir, DATATYPE_UINT8
- 'e' => CHANNEL_NAME_EdgeFlightLine, DATATYPE_UINT8
- 'c' => CHANNEL_NAME_ClassId, DATATYPE_UINT8
- 'a' => CHANNEL_NAME_ScanAngle, DATATYPE_SINT8
- 'u' => CHANNEL_NAME_UserData, DATATYPE_UINT8
- 'p' => CHANNEL_NAME_SourceId, DATATYPE_UINT16
- 't' => CHANNEL_NAME_GPSTime, DATATYPE_FLOAT64
- 'R' => CHANNEL_NAME_Red, DATATYPE_UINT16
- 'G' => CHANNEL_NAME_Green, DATATYPE_UINT16
- 'B' => CHANNEL_NAME_Blue, DATATYPE_UINT16
- 's' => CHANNEL_NAME_Skip, Skip this field
- Parameters:
-
| format | the format string |
| fieldInfo | the ouptut ChannelInfo array |
void TXTPointReader::setBoundsAndNumPoints |
( |
bool |
doFullInit |
) |
[protected] |
Member Data Documentation
The documentation for this class was generated from the following file: