SCENE C++ API  2.0.27
Public Types | Public Member Functions | List of all members
LSScan Class Reference

Interface to access information and functionality of scans. More...

#include <lsscan.h>

+ Inheritance diagram for LSScan:

Public Types

enum  ExportFormat {
  DXF = 0, E57 = 1, FLS = 2,
  IGS = 3, POD = 4, PTS = 5,
  PTX = 6, WRL = 7, XYB = 8,
  XYZ = 9, CPE = 10, BMP = 11,
  JPG = 12, PNG = 13, TIF = 14,
  LAS = 15
}
 The different export formats that are supported. More...
 
enum  DataFormat { COLOR, REFLECTION, AUTO }
 The different data formats that are supported by FARO scans. More...
 

Public Member Functions

bool dataAvailable (DataFormat format=AUTO) const
 Determines whether data is available in the specified format. More...
 
bool dataLoaded (DataFormat format=AUTO) const
 Determines whether data is loaded in the specified format. More...
 
LSResult::Result loadData (DataFormat format=AUTO)
 Load the scan data in the specified format. More...
 
void unloadData ()
 Unloads the scan data. More...
 
LSResult::Result exportData (LSString filePath, ExportFormat format)
 Exports the scan data in the defined format. More...
 
LSScanIterator< LSPointXYZRGBgetScanIterator ()
 Gets a scan iterator which allows to iterate over the available scan data. More...
 
LSScanIterator< LSPointXYZIgetScanReflectionIterator ()
 Gets a scan iterator which allows to iterate over the available scan data. More...
 
bool spatialDataAvailable () const
 Determines whether spatial scan data is available for this scan. More...
 
LSResult::Result exportSpatialData (LSString filePath, ExportFormat format)
 Exports the spatial scan data in the defined format. More...
 
LSIterator< LSPointXYZRGBgetSpatialScanIterator ()
 Gets a scan iterator which allows to iterate over the available scan data. More...
 
ref_ptr< const LSAttributeContainergetScannerParameters ()
 Gets the scanner parameters which were used to take the scan. More...
 
ref_ptr< const LSAttributeContainergetScannerParameters () const
 Gets the scanner parameters which were used to take the scan. More...
 
int getNumCols () const
 Gets the number of available columns. More...
 
int getNumRows () const
 Gets the number of available rows. More...
 
void setPointColor (int col, int row, uint8_t r, uint8_t g, uint8_t b)
 Sets the RGB color value of the point at the specified col/row position. More...
 
void setPointReflection (int col, int row, float reflection)
 Sets the reflection value of the point at the specified col/row position. More...
 
void deletePoint (int col, int row)
 Deletes the point at the specified its col/row position. More...
 
void select2d (int colLeft, int colRight, int rowTop, int rowBottom)
 Creates a rectangular selection on the scan. More...
 
LSResult::Result getOverlap (int &startColumn1, int &columns1, int &startColumn2, int &columns2) const
 Get overlap areas of the scan. More...
 
bool isUnstructured () const
 Check if a scan contains unstructured data. More...
 
bool getPointColor (int col, int row, uint8_t &r, uint8_t &g, uint8_t &b) const
 Gets the RGB color value of the point at the specified col/row position. More...
 
bool getPointReflection (int col, int row, float &reflection) const
 Gets the reflection value of the point at the specified col/row position. More...
 
LSScanIterator< LSPointXYZNgetScanNormalsIterator ()
 Gets a scan iterator which allows to iterate over the available scan data. More...
 
bool getPointNormal (int col, int row, float &nX, float &nY, float &nZ) const
 Gets the normal vector components of the point at the specified col/row position. More...
 
LSIterator< LSPointXYZNgetSpatialScanNormalsIterator ()
 Gets a scan iterator which allows to iterate over the available scan data and extract its corresponding normals. More...
 
- Public Member Functions inherited from LSObject
Eigen::Matrix4d getTransformationToGlobal () const
 Calculates the transformation matrix which transforms local object coordinates to global coordinates. More...
 
void select ()
 Selects this object. More...
 
LSIterator< ref_ptr< LSObject > > getChildIterator () const
 Gets an iterator which can be used for a breadth-first iteration over all objects below the object in the object hierarchy. More...
 
ref_ptr< LSObjectgetParent () const
 Returns the parent of this object. More...
 
unsigned int getNumChildren () const
 Returns the number of children of this object. More...
 
ref_ptr< LSObjectgetChild (unsigned int n) const
 Returns the n-th child of this object. More...
 
ref_ptr< LSObjectgetChild (LSString name) const
 Returns the child of this object with a given name. More...
 
bool rmChild (unsigned int n)
 Removes a child from this object. More...
 
bool rmChild (LSString name)
 Removes a child from this object. More...
 
LSResult::Result addChild (LSString name, LSString typeName, ref_ptr< LSObject > &childOut)
 Creates a new child of the given type. More...
 
LSResult::Result generateUniqueChildName (const LSString &baseName, LSString &nameOut) const
 Generates a valid and unique name for a new child of this object based on the provided base name. More...
 
LSResult::Result setParent (ref_ptr< LSObject > newParent)
 Changes the parent of this object. More...
 
- Public Member Functions inherited from LSAttributeContainer
LSString getTypeName () const
 Gets the type name of this instance. More...
 
LSString getName () const
 Gets the name of the container. More...
 
LSResult::Result setName (LSString name)
 Sets the name of the container. More...
 
LSString getUuid () const
 Returns the unique id of the container. More...
 
LSString assignUuid ()
 Assigns a unique id to the container if the container does not not yet have a unique id. More...
 
unsigned int getNumAttributes () const
 Get the number of attributes in the container. More...
 
LSString getAttributeName (unsigned int index) const
 Get the name of an attribute in the container. More...
 
unsigned int getAttributeIndex (LSString name) const
 Get the index of an attribute in the container. More...
 
LSAttribute getAttribute (unsigned int index) const
 Get an attribute based on its index. More...
 
LSAttribute getAttribute (LSString name) const
 Get an attribute based on its name. More...
 
LSResult::Result setAttribute (unsigned int index, const LSAttribute &attribute)
 Set an attribute based on its index. More...
 
LSResult::Result setAttribute (LSString name, const LSAttribute &attribute)
 Set an attribute based on its name. More...
 
LSResult::Result addCustomAttribute (LSString name, const LSAttribute &attribute)
 Add a new custom attribute to the container. More...
 
bool removeCustomAttribute (LSString name)
 Remove a custom attribute from the container. More...
 
unsigned int getNumFields () const
 Returns the number of fields in the container. More...
 
ref_ptr< LSAttributeContainergetField (unsigned int index) const
 Returns the field at position n in the container. More...
 
ref_ptr< LSAttributeContainergetField (const LSString &name) const
 Returns the field with the given name. More...
 
LSResult::Result addField (const LSString &name, const LSString &typeName, ref_ptr< LSAttributeContainer > &fieldOut)
 Add a field to the container. More...
 
bool rmField (const LSString &name)
 Removes the field with a given name from the container. 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 to access information and functionality of scans.

Version
SCENE API version 2.0.0.

Member Enumeration Documentation

◆ ExportFormat

The different export formats that are supported.

Version
SCENE API version 2.0.10
Enumerator
DXF 

Drawing Interchange Format (.dxf)

E57 

ASTM E57 3D File Format (.e57)

FLS 

FARO Laser Scan Format (.fls)

IGS 

Initial Graphics Exchange Specification Format (.iges)

POD 

Pointools POD File Format (.pod)

PTS 

Leica PTS File Format (.pts)

PTX 

Leica PTX File Format (.ptx)

WRL 

Virtual Reality Modeling Language File Format (.vrml)

XYB 

Binary XYZ File Format (.xyb)

XYZ 

ASCII XYZ File Format (.xyz)

CPE 

CPE File Format (.cpe)

BMP 

Bitmap Image File Format (.bmp)

JPG 

JPEG Image File Format (.jpg)

PNG 

PNG Image File Format (.png)

TIF 

TIFF Image File Format (.tif)

LAS 

LAS File Format (.las, .laz)

◆ DataFormat

enum DataFormat

The different data formats that are supported by FARO scans.

Version
SCENE API Version 2.0.0.
Enumerator
COLOR 

Color (RGB) information.

REFLECTION 

Reflection (Intensity) information.

AUTO 

Automatic selection of the color format.

Member Function Documentation

◆ dataAvailable()

bool dataAvailable ( DataFormat  format = AUTO) const

Determines whether data is available in the specified format.

Parameters
formatThe data format to check the availability for.
Returns
true if the data is available in the specified format, false otherwise.
Version
SCENE API Version 2.0.0.

◆ dataLoaded()

bool dataLoaded ( DataFormat  format = AUTO) const

Determines whether data is loaded in the specified format.

Parameters
formatThe data format to check the load state for.
Returns
true if the data is loaded in the specified format, false otherwise.
Version
SCENE API Version 2.0.0.

◆ loadData()

LSResult::Result loadData ( DataFormat  format = AUTO)

Load the scan data in the specified format.

Parameters
formatThe data format to load.
Returns
LSResult::Ok Loading was successful. LSResult::InvalidRequest The supplied parameters are wrong or the project needs to be saved first. LSResult::Unauthorized You do not have the API key required to load this scan.
Version
SCENE API Version 2.0.0.

◆ unloadData()

void unloadData ( )

Unloads the scan data.

Version
SCENE API Version 2.0.0.

◆ exportData()

LSResult::Result exportData ( LSString  filePath,
ExportFormat  format 
)

Exports the scan data in the defined format.

ATTENTION: Make sure that the data is available and loaded in any format before calling this method!

Parameters
filePathThe path to the export destination.
formatThe format to be used for the export. Supported formats are DXF, E57, FLS, IGS, POD, PTS, PTX, WRL, XYB, XYZ, CPE, LAS, BMP, JPG, PNG and TIF.
Version
SCENE API Version 2.0.4.

◆ getScanIterator()

LSScanIterator<LSPointXYZRGB> getScanIterator ( )

Gets a scan iterator which allows to iterate over the available scan data.

The returned points are in global coordinates. ATTENTION: Make sure that the data is available and loaded in any format before calling this method! If this iterator is used to iterate over reflection data, the intensity values will be mapped to RGB values using a contrast enhancement algorithm.

Returns
The iterator instance.
Version
SCENE API Version 2.0.0.

◆ getScanReflectionIterator()

LSScanIterator<LSPointXYZI> getScanReflectionIterator ( )

Gets a scan iterator which allows to iterate over the available scan data.

The returned points are in global coordinates. ATTENTION: Make sure that reflection data is available and loaded before calling this method!

Returns
The iterator instance.
Version
SCENE API Version 2.0.0.

◆ spatialDataAvailable()

bool spatialDataAvailable ( ) const

Determines whether spatial scan data is available for this scan.

Returns
true if spatial data is available, false otherwise.
Version
SCENE API Version 2.0.0.

◆ exportSpatialData()

LSResult::Result exportSpatialData ( LSString  filePath,
ExportFormat  format 
)

Exports the spatial scan data in the defined format.

Parameters
filePathThe path to the export destination.
formatThe format to be used for the export. Supported formats are DXF, E57, IGS, POD, PTS, WRL, XYB, XYZ, CPE and LAS.
Version
SCENE API Version 2.0.4.

◆ getSpatialScanIterator()

LSIterator<LSPointXYZRGB> getSpatialScanIterator ( )

Gets a scan iterator which allows to iterate over the available scan data.

The returned points are in global coordinates.

Returns
The iterator instance.
Version
SCENE API Version 2.0.0.

◆ getScannerParameters() [1/2]

ref_ptr<const LSAttributeContainer> getScannerParameters ( )

Gets the scanner parameters which were used to take the scan.

Will return a null pointer for non-FARO-scans, for example imported E57 files!

Returns
The attribute container containing the scanner parameters.
Version
SCENE API Version 2.0.0.

◆ getScannerParameters() [2/2]

ref_ptr<const LSAttributeContainer> getScannerParameters ( ) const

Gets the scanner parameters which were used to take the scan.

Will return a null pointer for non-FARO-scans, for example imported E57 files!

Returns
The attribute container containing the scanner parameters.
Version
SCENE API Version 2.0.22.

◆ getNumCols()

int getNumCols ( ) const

Gets the number of available columns.

Returns
The number of available columns.
Version
SCENE API Version 2.0.5

◆ getNumRows()

int getNumRows ( ) const

Gets the number of available rows.

Returns
The number of available rows.
Version
SCENE API Version 2.0.5

◆ setPointColor()

void setPointColor ( int  col,
int  row,
uint8_t  r,
uint8_t  g,
uint8_t  b 
)

Sets the RGB color value of the point at the specified col/row position.

Make sure that the scan is loaded with color data before calling this method!

Parameters
colThe points column position.
rowThe points row position.
rThe points red value will be set to this. Allowed range is [0,255].
gThe points green value will be set to this. Allowed range is [0,255].
bThe points blue value will be set to this. Allowed range is [0,255].
Version
SCENE API Version 2.0.0.

◆ setPointReflection()

void setPointReflection ( int  col,
int  row,
float  reflection 
)

Sets the reflection value of the point at the specified col/row position.

Make sure that the scan is loaded with reflection data before calling this method!

Parameters
colThe points column position.
rowThe points row position.
reflectionThe points reflection will be set to this value; range [0,1].
Version
SCENE API Version 2.0.9.

◆ deletePoint()

void deletePoint ( int  col,
int  row 
)

Deletes the point at the specified its col/row position.

This will only mark the 3D and depth information for this point as deleted. The color and reflection values remain unchanged. Make sure that the scan data is loaded before calling this method!

Version
SCENE API Version 2.0.0.

◆ select2d()

void select2d ( int  colLeft,
int  colRight,
int  rowTop,
int  rowBottom 
)

Creates a rectangular selection on the scan.

Parameters
colLeftThe left points column position.
colRightThe right points column position.
rowTopThe top points row position.
rowBottomThe bottom points row position.
Version
SCENE API Version 2.0.9.

◆ getOverlap()

LSResult::Result getOverlap ( int &  startColumn1,
int &  columns1,
int &  startColumn2,
int &  columns2 
) const

Get overlap areas of the scan.

This method requires the scan to be loaded. FARO scans can contain areas with overlap where the scanner recorded more than 180 degrees for a scan half. Scans without overlap, for example imported unstructured scans, return 0 for all output parameters.

Parameters
startColumn1Output parameter with the starting column of the first overlap area.
columns1Output parameter with size of the first overlap area in columns.
startColumn2Output parameter with the starting column of the second overlap area.
columns2Output parameter with size of the second overlap area in columns.
Returns
InvalidRequest if the scan was not loaded, Ok if the request was successful.
Version
SCENE API Version 2.0.20.

◆ isUnstructured()

bool isUnstructured ( ) const

Check if a scan contains unstructured data.

Structured data is organized in rows and columns. Unstructured scans are just a list of 3D points in no meaningful order. Do NOT use their row and column indices to determine the neighboring points! A typical example for structured data are Focus laser scans with proper rows and columns. A typical example for unstructured data are Freestyle scans or imported CPE files.

Returns
True, if the scan contains unstructured data.
Version
SCENE API Version 2.0.21.

◆ getPointColor()

bool getPointColor ( int  col,
int  row,
uint8_t &  r,
uint8_t &  g,
uint8_t &  b 
) const

Gets the RGB color value of the point at the specified col/row position.

Make sure that the scan is loaded with color data before calling this method!

Parameters
colThe points column position.
rowThe points row position.
rRed output parameter, will be set to a value in the range [0,255].
gGreen output parameter, will be set to a value in the range [0,255].
bBlue output parameter, will be set to a value in the range [0,255].
Returns
True, if the color was extracted and copied to the output parameters.
Version
SCENE API Version 2.0.22.

◆ getPointReflection()

bool getPointReflection ( int  col,
int  row,
float &  reflection 
) const

Gets the reflection value of the point at the specified col/row position.

Make sure that the scan is loaded with reflection data before calling this method!

Parameters
colThe points column position.
rowThe points row position.
reflectionThis output parameter will be set to a value in the range [0,1].
Returns
True, if the reflection was extracted and copied to the output parameter.
Version
SCENE API Version 2.0.22.

◆ getScanNormalsIterator()

LSScanIterator<LSPointXYZN> getScanNormalsIterator ( )

Gets a scan iterator which allows to iterate over the available scan data.

The returned points are in global coordinates. ATTENTION: Make sure that the data is available and loaded in any format before calling this method! Further, this method should be called on the processed data for getting accurate values of the components of the normal vector.

Returns
The iterator instance.
Version
SCENE API Version 2.0.25.

◆ getPointNormal()

bool getPointNormal ( int  col,
int  row,
float &  nX,
float &  nY,
float &  nZ 
) const

Gets the normal vector components of the point at the specified col/row position.

Make sure that the scan is loaded with any data format before calling this method! Further, this method should be called on the scan which is processed for getting accurate values of the components of the normal vector

Parameters
colThe points column position.
rowThe points row position.
nXX component of the normal vector.
nYY component of the normal vector.
nZZ component of the normal vector.
Returns
True, if the components of the normal vector were extracted and copied to the output parameters.
Version
SCENE API Version 2.0.25.

◆ getSpatialScanNormalsIterator()

LSIterator<LSPointXYZN> getSpatialScanNormalsIterator ( )

Gets a scan iterator which allows to iterate over the available scan data and extract its corresponding normals.

The returned points are in global coordinates. ATTENTION: Make sure that the spatial data is available before calling this method! Further, this method should be called on the processed data for getting accurate values of the components of the normal vector.

Returns
The iterator instance.
Version
SCENE API Version 2.0.26.