Class AsciiIO

Inheritance Relationships

Base Type

Class Documentation

class AsciiIO : public lvr2::ModelIOBase

A import / export class for point cloud data in plain text formats. Currently the file extensions .xyz, .txt, .3d and .pts are supported.

Public Functions

inline AsciiIO()

Default constructor.

virtual ModelPtr read(string filename)

Reads the given file and stores point and color information in the given parameters.

Parameters:

filename – The file to read

virtual ModelPtr read(string filename, const int &x, const int &y, const int &z, const int &r = -1, const int &g = -1, const int &b = -1, const int &i = -1)

read Parses the given file and stores point and color attribute information in the returned model pointer. It is assumed that the each line in the file (except the first one which may be a header line) contains point coordinates (x, y, z) and optional color and intensity information. The position (columns) of the supported attritbutes within each line are define by the respective parameters given to this function. Each line may consist of more attributes, but only the ones specified are parsed. Not existing attributes are indicated by -1.

Parameters:
  • filename – The file to parse

  • x – The colum number containing the x-coordinate of a point

  • y – The colum number containing the y-coordinate of a point

  • z – The colum number containing the z-coordinate of a point

  • r – The colum number containing the r color component (or -1)

  • g – The colum number containing the g color component (or -1)

  • b – The colum number containing the b color component (or -1)

  • i – The colum number containing the intensity value (or -1)

Returns:

virtual void save(string filename)

Todo:

: Implement save method for ASCII Files…

Parameters:

filename

Public Static Functions

static size_t countLines(string filename)

TODO: Coordinate mapping for ascii files.

static int getEntriesInLine(string filename)

Helper method. Returns the number of columns in the given file.