libLAS API Reference  1.8.1
Public Types | Public Member Functions | Static Public Attributes | List of all members
liblas::Classification Class Reference

Class definition to manipulate properties of point record classification. More...

#include <classification.hpp>

Collaboration diagram for liblas::Classification:
Collaboration graph

Public Types

enum  BitPosition { eClassBit = 0, eSyntheticBit = 5, eKeyPointBit = 6, eWithheldBit = 7 }
 Values of indexes in the set of bit flags. More...
 
typedef std::bitset< 8 > bitset_type
 Alias on std::bitset<8> used as collection of flags. More...
 

Public Member Functions

 Classification ()
 Default initialization constructor. More...
 
 Classification (bitset_type const &flags)
 Initializes classification flags using given set of 8 bits. More...
 
 Classification (uint8_t const &flags)
 Initializes classification flags using 8 bits of integral type. More...
 
 Classification (uint32_t cls, bool s, bool k, bool w)
 Initializes classification with values of given compounds. More...
 
 Classification (Classification const &other)
 Copy constructor. More...
 
Classificationoperator= (Classification const &rhs)
 Assignment operator. More...
 
 operator bitset_type () const
 Conversion operator. More...
 
bitset_type GetFlags () const
 Named accessor converting Classification to std::bitset<8>. More...
 
std::string GetClassName () const
 Raturns name of class as defined in LAS 1.1+ Finds class name in lookup table based on class index as defined in classification object. More...
 
uint8_t GetClass () const
 Returns index of ASPRS classification as defined in the lookup table. More...
 
void SetClass (uint32_t index)
 Updates index of ASPRS classification as defined in the lookup table. More...
 
void SetSynthetic (bool flag)
 Sets if this point was created by a technique other than LIDAR collection such as digitized from a photogrammetric stereo model. More...
 
bool IsSynthetic () const
 Tests if this point was created by a technique other than LIDAR collection. More...
 
void SetKeyPoint (bool flag)
 Sets if this point is considered to be a model keypoint and thus generally should not be withheld in a thinning algorithm. More...
 
bool IsKeyPoint () const
 Tests if this point is considered to be a model keypoint. More...
 
void SetWithheld (bool flag)
 SetTests if this point should excluded from processing. More...
 
bool IsWithheld () const
 Tests if this point should excluded from processing. More...
 
bool equal (Classification const &other) const
 Compares this classification object with other one. More...
 

Static Public Attributes

static uint32_t const class_table_size
 Number of classes in lookup table as defined in ASPRS LAS 1.1+. More...
 

Detailed Description

Class definition to manipulate properties of point record classification.

Member Typedef Documentation

typedef std::bitset<8> liblas::Classification::bitset_type

Alias on std::bitset<8> used as collection of flags.

Member Enumeration Documentation

Values of indexes in the set of bit flags.

Enumerator
eClassBit 

First bit position of 0:4 range.

eSyntheticBit 

Synthetic flag.

eKeyPointBit 

Key-point flag.

eWithheldBit 

Withheld flag.

Constructor & Destructor Documentation

liblas::Classification::Classification ( )
inline

Default initialization constructor.

Initializes all flags of classification as set to 0. Operation semantic is equivalent to bitset_type::reset().

liblas::Classification::Classification ( bitset_type const &  flags)
inlineexplicit

Initializes classification flags using given set of 8 bits.

Parameters
flags[in] - contains 8 bits representing classification flags.
liblas::Classification::Classification ( uint8_t const &  flags)
inlineexplicit

Initializes classification flags using 8 bits of integral type.

Parameters
flags[in] - contains 8 bits representing classification flags.
liblas::Classification::Classification ( uint32_t  cls,
bool  s,
bool  k,
bool  w 
)
inline

Initializes classification with values of given compounds.

Parameters
cls[in] - index of Standard ASPRS classification as defined in the lookup table, from 0 to class_table_size - 1.
s[in] - If set then this point was created by a technique other than LIDAR collection such as digitized from a photogrammetric stereo model.
k[in] - If set, this point is considered to be a model keypoint and thus generally should not be withheld in a thinning algorithm.
w[in] - If set, this point should not be included in processing.
liblas::Classification::Classification ( Classification const &  other)
inline

Copy constructor.

Member Function Documentation

bool liblas::Classification::equal ( Classification const &  other) const
inline

Compares this classification object with other one.

Comparison is preformed against set of bit flags stored in both objects.

Referenced by liblas::operator==().

uint8_t liblas::Classification::GetClass ( ) const

Returns index of ASPRS classification as defined in the lookup table.

std::string liblas::Classification::GetClassName ( ) const

Raturns name of class as defined in LAS 1.1+ Finds class name in lookup table based on class index as defined in classification object.

bitset_type liblas::Classification::GetFlags ( ) const
inline

Named accessor converting Classification to std::bitset<8>.

bool liblas::Classification::IsKeyPoint ( ) const
inline

Tests if this point is considered to be a model keypoint.

bool liblas::Classification::IsSynthetic ( ) const
inline

Tests if this point was created by a technique other than LIDAR collection.

bool liblas::Classification::IsWithheld ( ) const
inline

Tests if this point should excluded from processing.

liblas::Classification::operator bitset_type ( ) const
inline

Conversion operator.

Returns classification object as in form of std::bitset<8>.

Classification& liblas::Classification::operator= ( Classification const &  rhs)
inline

Assignment operator.

void liblas::Classification::SetClass ( uint32_t  index)

Updates index of ASPRS classification as defined in the lookup table.

Valid index is in range from 0 to class_table_size - 1. For LAS 1.0, this static number may be invalid and extend up to 255 classes stored in variable-length records.

Note
Currently, libLAS does not support classification based on table stored in variable-length record. Only Standard ASPRS classification table is supported.
Exceptions
Theoretically,maythrow std::out_of_range in case index value is not in range between 0 and class_table_size - 1.
void liblas::Classification::SetKeyPoint ( bool  flag)
inline

Sets if this point is considered to be a model keypoint and thus generally should not be withheld in a thinning algorithm.

void liblas::Classification::SetSynthetic ( bool  flag)
inline

Sets if this point was created by a technique other than LIDAR collection such as digitized from a photogrammetric stereo model.

void liblas::Classification::SetWithheld ( bool  flag)
inline

SetTests if this point should excluded from processing.

Member Data Documentation

uint32_t const liblas::Classification::class_table_size
static

Number of classes in lookup table as defined in ASPRS LAS 1.1+.

For LAS 1.0, this static number may be invalid and extend up to 255 classes stored in variable-length records.

Note
Currently, libLAS does not support classification based on table stored in variable-length record. Only Standard ASPRS classification table is supported.

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