SCENE C++ API  2.0.22
Public Member Functions | List of all members
LSPointDataSource Class Referenceabstract

Interface for the import of unstructured point cloud data. More...

#include <lsimport.h>

+ Inheritance diagram for LSPointDataSource:

Public Member Functions

virtual bool getNextPoint (double position[3], uint32_t &row, uint32_t &column, float normal[3], uint8_t color[3], float &intensity)=0
 Must return the next point each time it is called. More...
 
virtual uint64_t getNumberOfPoints () const =0
 Must return the exact overall number of points. More...
 
virtual bool isStructured () const
 Must return true if the scan data is ordered in rows and columns. More...
 
virtual uint32_t getNumberOfRows () const
 Must return the exact number of rows. More...
 
virtual uint32_t getNumberOfCols () const
 Must return the exact number of cols. More...
 
virtual bool hasNormals () const
 Return true if all the points have valid normals. More...
 
virtual bool hasColors () const
 Return true if all the points are colored. More...
 
virtual bool hasIntensity () const
 Return true if all the points have intensity values. More...
 

Additional Inherited Members

- Protected Member Functions inherited from LSRefType
void ref () const
 Increments the internal reference counter. More...
 
void unref () const
 Decrements the internal reference counter. More...
 

Detailed Description

Interface for the import of unstructured point cloud data.

You have to inherit and implement this interface to be able to call the function importPointData() successfully.

Version
SCENE API Version 2.0.21

Member Function Documentation

◆ getNextPoint()

virtual bool getNextPoint ( double  position[3],
uint32_t &  row,
uint32_t &  column,
float  normal[3],
uint8_t  color[3],
float &  intensity 
)
pure virtual

Must return the next point each time it is called.

This will be called once for every point in the data set. Each time this method is called, it should return the data of the next point. The order of the points is not important. If you provide structured data, the order and position in the 2D grid is determined by the supplied row and column values. If you supply the same row/col combination twice, the first value will be overwritten! Return true if everything is okay, return false to signal an error and abort the import. In this case importPointData() will return asap with an InvalidRequest error. All parameters are output parameters!

Parameters
positionPosition of the scan point. Pointer to three values (X, Y, Z).
rowRow number, starting at zero. Pointer to one value. Will be ignored if isStructured() returned false.
columnColumn number, starting at zero. Pointer to one value. Will be ignored if isStructured() returned false.
normalNormal of the scan point. Pointer to three values (X, Y, Z). Will be ignored if hasNormals() returned false.
colorColor of the scan point. Pointer to three R, G, B bytes. Will be ignored if hasColors() returned false.
intensityIntensity of the scan point. Pointer to one value. The valid range is between 0 and 1, so you may have to convert or scale your intensity/reflection/gray values. Will be ignored if hasIntensity() returned false.
Version
SCENE API Version 2.0.21

◆ getNumberOfPoints()

virtual uint64_t getNumberOfPoints ( ) const
pure virtual

Must return the exact overall number of points.

This is only called once before the points are iterated!

Version
SCENE API Version 2.0.21

◆ isStructured()

virtual bool isStructured ( ) const
inlinevirtual

Must return true if the scan data is ordered in rows and columns.

Structured points are sorted into a 2D grid based on the supplied row and column values. The number of overall points must be <= rows * columns. You do not need to set all points, if you do not set a position, it will stay empty. Return false if you just want to import a unstructured point cloud. This is only called once before the points are iterated!

Version
SCENE API Version 2.0.21

◆ getNumberOfRows()

virtual uint32_t getNumberOfRows ( ) const
inlinevirtual

Must return the exact number of rows.

The returned value must be greater 0 for structured data. It will be only called if isStructured() returns true. This is only called once before the points are iterated!

Version
SCENE API Version 2.0.21

◆ getNumberOfCols()

virtual uint32_t getNumberOfCols ( ) const
inlinevirtual

Must return the exact number of cols.

The returned value must be greater 0 for structured data. It will be only called if isStructured() returns true. This is only called once before the points are iterated!

Version
SCENE API Version 2.0.21

◆ hasNormals()

virtual bool hasNormals ( ) const
inlinevirtual

Return true if all the points have valid normals.

It no normals are supplied, SCENE might estimate them later. Since this process is far from perfect and can take a very long time for big point clouds, you should always supply normals if they are available. Only all or no points can have normals! This is only called once before the points are iterated!

Version
SCENE API Version 2.0.21

◆ hasColors()

virtual bool hasColors ( ) const
inlinevirtual

Return true if all the points are colored.

Partially colored data sets are not supported. Keep in mind that only color OR intensity is supported! This is only called once before the points are iterated!

Version
SCENE API Version 2.0.21

◆ hasIntensity()

virtual bool hasIntensity ( ) const
inlinevirtual

Return true if all the points have intensity values.

Only all or no points can have an intensity value! Keep in mind that only color OR intensity is supported! This is only called once before the points are iterated!

Version
SCENE API Version 2.0.21