Public Member Functions | Static Public Member Functions | List of all members
lvr2::AsciiIO Class Reference

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

#include <AsciiIO.hpp>

Inheritance diagram for lvr2::AsciiIO:
Inheritance graph
[legend]

Public Member Functions

 AsciiIO ()
 Default constructor. More...
 
virtual ModelPtr read (string filename)
 Reads the given file and stores point and color information in the given parameters. More...
 
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. More...
 
virtual void save (string filename)
 
- Public Member Functions inherited from lvr2::BaseIO
 BaseIO ()
 
virtual ModelPtr getModel ()
 Get the model for io operations. More...
 
virtual ModelPtr read (std::string filename)=0
 Parse the given file and load supported elements. More...
 
virtual void save (ModelPtr model, std::string filename)
 Set the model and save the loaded elements to the given file. More...
 
virtual void save (std::string filename)=0
 Save the loaded elements to the given file. More...
 
virtual void setModel (ModelPtr m)
 Set the model for io operations to use. More...
 
virtual ~BaseIO ()
 

Static Public Member Functions

static size_t countLines (string filename)
 TODO: Coordinate mapping for ascii files. More...
 
static int getEntriesInLine (string filename)
 Helper method. Returns the number of columns in the given file. More...
 

Additional Inherited Members

- Protected Attributes inherited from lvr2::BaseIO
ModelPtr m_model
 

Detailed Description

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

Definition at line 55 of file AsciiIO.hpp.

Constructor & Destructor Documentation

◆ AsciiIO()

lvr2::AsciiIO::AsciiIO ( )
inline

Default constructor.

Definition at line 62 of file AsciiIO.hpp.

Member Function Documentation

◆ countLines()

size_t lvr2::AsciiIO::countLines ( string  filename)
static

TODO: Coordinate mapping for ascii files.

Definition at line 386 of file AsciiIO.cpp.

◆ getEntriesInLine()

int lvr2::AsciiIO::getEntriesInLine ( string  filename)
static

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

Definition at line 404 of file AsciiIO.cpp.

◆ read() [1/2]

ModelPtr lvr2::AsciiIO::read ( string  filename)
virtual

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

Parameters
filenameThe file to read

Definition at line 227 of file AsciiIO.cpp.

◆ read() [2/2]

ModelPtr lvr2::AsciiIO::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 
)
virtual

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
filenameThe file to parse
xThe colum number containing the x-coordinate of a point
yThe colum number containing the y-coordinate of a point
zThe colum number containing the z-coordinate of a point
rThe colum number containing the r color component (or -1)
gThe colum number containing the g color component (or -1)
bThe colum number containing the b color component (or -1)
iThe colum number containing the intensity value (or -1)
Returns

Definition at line 51 of file AsciiIO.cpp.

◆ save()

void lvr2::AsciiIO::save ( string  filename)
virtual
Todo:
: Implement save method for ASCII Files...
Parameters
filename

Definition at line 300 of file AsciiIO.cpp.


The documentation for this class was generated from the following files:


lvr2
Author(s): Thomas Wiemann , Sebastian Pütz , Alexander Mock , Lars Kiesow , Lukas Kalbertodt , Tristan Igelbrink , Johan M. von Behren , Dominik Feldschnieders , Alexander Löhr
autogenerated on Wed Mar 2 2022 00:37:27