RDB 2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Friends | List of all members
riegl::rdb::pointcloud::PointAttribute Class Reference

Point attribute description. More...

#include <pointAttribute.hpp>

Public Types

enum  StorageClass { CONSTANT = 1, VARIABLE = 2, DYNAMIC = 3 }
 Data Storage Class. More...
 
enum  CompressionOptions { DEFAULT = 0, DELTA = 1, SHUFFLE = 2, DELTA_SHUFFLE = 3 }
 Data Compression Options. More...
 
typedef std::map< long long
int, std::string > 
NamedValuesMap
 Map of VALUE=NAME pairs. More...
 

Public Member Functions

 ~PointAttribute ()
 
 PointAttribute (const std::string &name="none", const std::string &title="none", const std::string &description="", const std::string &unitSymbol="", const std::uint32_t &length=0, const double &resolution=1.0, const double &minimumValue=0.0, const double &maximumValue=0.0, const double &defaultValue=0.0, const std::uint8_t &storageClass=CONSTANT, const std::uint8_t &compressionOptions=DEFAULT, const double &scaleFactor=1.0, const double &invalidValue=std::numeric_limits< double >::quiet_NaN(), const std::string &lodSettings="default", const std::string &tags="", const std::string &namedValues="")
 Default constructor. More...
 
 PointAttribute (riegl::rdb::Context &context)
 
 PointAttribute (const PointAttribute &attribute)
 Copy constructor. More...
 
PointAttributeoperator= (const PointAttribute &attribute)
 Assignment operator. More...
 
void assign (PointAttribute &target) const
 Copy assignment. More...
 
NamedValuesMap getNamedValues () const
 Get map from named values string. More...
 
void setNamedValues (const NamedValuesMap &map)
 Set named values string from map. More...
 
void load (const std::string &json)
 Load settings from JSON string. More...
 
std::string save () const
 Save settings to JSON string. More...
 
riegl::rdb::pointcloud::DataType dataType () const
 Get buffer data type. More...
 
 operator const std::string & () const
 Get attribute name. More...
 

Static Public Member Functions

static void decodeDescriptor (const std::string &descriptor, std::string &name, std::int32_t &index)
 Get attribute name and vector index from attribute descriptor. More...
 

Public Attributes

std::string name
 unique attribute name (for queries) More...
 
std::string title
 attribute title (for display), string size limits: [1, 100] More...
 
std::string tags
 attribute tags (comma separated, e.g. "position, transform"), string size limits: [0, 5000] More...
 
std::string description
 attribute description (for display), string size limits: [0, 5000] More...
 
std::string unitSymbol
 physical unit symbol (e.g. "m", "rad", "K"), string size limits: [0, 100] More...
 
std::uint32_t length
 number of dimensions/elements (1: scalar, >1: vector, e.g. 3 for point coordinates) More...
 
double resolution
 expected value resolution More...
 
double minimumValue
 theoretical minimum value More...
 
double maximumValue
 theoretical maximum value More...
 
double defaultValue
 default value (minimum <= default <= maximum) More...
 
double invalidValue
 invalid value (minimum <= invalid <= maximum, use "not-a-number" if there is no invalid value) More...
 
std::string namedValues
 list of VALUE=NAME pairs separated by a single line feed character (LF, ASCII 0x0A), string size limits: [0, 1000000] More...
 
std::uint8_t storageClass
 storage class More...
 
std::uint8_t compressionOptions
 options additional to default compression More...
 
std::string lodSettings
 Level of detail settings. More...
 
double scaleFactor
 optional scale factor applied to real numbers (i.e. resolution not equal to 1.0) More...
 

Friends

class PointAttributeWrapper
 

Detailed Description

Point attribute description.

This class describes a point attribute. The database uses this information for internal attribute representation and compression.

While the name is a unique identifier, the description holds some text that client programs might display the user in some way. Also the physical unit is not used by the database but can be presented to the user (see PointAttribute::unitSymbol).

To avoid point attribute name conflicts, the names (not the titles) shall contain a namespace prefix. Namespace and attribute name are separated by a dot (".", e.g. "riegl.xyz"). The default namespace "riegl" is used if no namespace is given.

Remarks

If the attribute is a vector (i.e. length > 1), then you might append a zero-based vector element index to the attribute name when inserting, updating or selecting points. Example: use "rgb[0]" to access the red color component (0), the green (1) and blue (2) components are not read or modified in this case.

Furthermore, the minimum, maximum and default values are applied to all elements of vectors and the vector length must be in the range [1..100000].

PointAttribute::defaultValue is returned when reading a point attribute that has never been written before. The value must be between minimum and maximum (both inclusive).

PointAttribute::invalidValue may be used to define a value that represents an invalid/undefined/unknown value. The value must be between minimum and maximum (both inclusive) and must be a multiple of the resolution value. The value may be equal to the default value and you may use "NaN" (not a number) to signal that there is no "invalid value".

Note

Attribute names may only contain following ASCII characters:

Attribute title, description and unit symbol may contain any UTF-8 character.

See Also
riegl::rdb::pointcloud::PointAttributes
Examples:
rdb-example-01-create-database.cpp, rdb-example-02-insert-points.cpp, rdb-example-06-database-stat.cpp, and rdb-example-10-attribute-groups.cpp.

Definition at line 120 of file pointAttribute.hpp.

Member Typedef Documentation

typedef std::map<long long int, std::string> riegl::rdb::pointcloud::PointAttribute::NamedValuesMap

Map of VALUE=NAME pairs.

See Also
namedValues
getNamedValues()
setNamedValues()

Definition at line 195 of file pointAttribute.hpp.

Member Enumeration Documentation

Data Compression Options.

The data of all point attributes is compressed with the settings defined during the database creation (see class CreateSettings). Additionally, the data may be pre-processed using one or more of the following methods:

Enumerator
DEFAULT 

nothing special, just use default compression algorithm

DELTA 

calculate differences between two consecutive values

SHUFFLE 

shuffle bytes of point attribute values

DELTA_SHUFFLE 

calculate differences and shuffle bytes

Definition at line 144 of file pointAttribute.hpp.

Data Storage Class.

The storage class gives a hint about how often a point attribute is expected to change. This might be helpful for the database to optimize data structures for speed or file size.

Enumerator
CONSTANT 

value cannot be changed

VARIABLE 

value can change from time to time

DYNAMIC 

value is likely to be changed often

Definition at line 130 of file pointAttribute.hpp.

Constructor & Destructor Documentation

riegl::rdb::pointcloud::PointAttribute::~PointAttribute ( )
riegl::rdb::pointcloud::PointAttribute::PointAttribute ( const std::string &  name = "none",
const std::string &  title = "none",
const std::string &  description = "",
const std::string &  unitSymbol = "",
const std::uint32_t &  length = 0,
const double &  resolution = 1.0,
const double &  minimumValue = 0.0,
const double &  maximumValue = 0.0,
const double &  defaultValue = 0.0,
const std::uint8_t &  storageClass = CONSTANT,
const std::uint8_t &  compressionOptions = DEFAULT,
const double &  scaleFactor = 1.0,
const double &  invalidValue = std::numeric_limits< double >::quiet_NaN(),
const std::string &  lodSettings = "default",
const std::string &  tags = "",
const std::string &  namedValues = "" 
)
explicit

Default constructor.

All properties are set to default values.

riegl::rdb::pointcloud::PointAttribute::PointAttribute ( riegl::rdb::Context context)
explicit
Deprecated:
since 2.2.3 - use the context-free constructors instead
riegl::rdb::pointcloud::PointAttribute::PointAttribute ( const PointAttribute attribute)

Copy constructor.

All properties are copied from the given attribute object.

Member Function Documentation

void riegl::rdb::pointcloud::PointAttribute::assign ( PointAttribute target) const
inline

Copy assignment.

This function is mainly for backward compatibility reasons. You may also use the copy constructor or copy assignment operator instead.

Definition at line 248 of file pointAttribute.hpp.

riegl::rdb::pointcloud::DataType riegl::rdb::pointcloud::PointAttribute::dataType ( ) const

Get buffer data type.

This function suggests a data type that is suitable to construct a buffer for storing values of this attribute.

The suggestion is based on the resolution, minimumValue and maximumValue properties, all others are ignored.

static void riegl::rdb::pointcloud::PointAttribute::decodeDescriptor ( const std::string &  descriptor,
std::string &  name,
std::int32_t &  index 
)
static

Get attribute name and vector index from attribute descriptor.

This function decodes the given attribute descriptor into attribute name and attribute vector index. The optional vector index is enclosed in square brackets and follows the point attribute name. If no vector index is given, then index -1 is returned. If the vector index cannot be interpreted as a single positive integer value, then an empty name and index -2 is returned.

Examples:

descriptor name index
"xyz" "xyz" -1
"xyz[0]" "xyz" 0
"rgb[1]" "rgb" 1
Parameters
[in]descriptorattribute descriptor, e.g. "xyz", "rgb[1]"
[out]nameattribute name, e.g. "xyz", "rgb"
[out]indexattribute vector index, e.g. -1, 1
NamedValuesMap riegl::rdb::pointcloud::PointAttribute::getNamedValues ( ) const

Get map from named values string.

This function decodes the namedValues string into a map.

See Also
namedValues
NamedValuesMap
setNamedValues()
void riegl::rdb::pointcloud::PointAttribute::load ( const std::string &  json)

Load settings from JSON string.

This function parses the given JSON string and applies all available properties - missing properties are silently ignored (i.e. the value remains unchanged). When parsing the JSON string fails, an exception is thrown.

Example JSON string:

{
    "name": "riegl.reflectance",
    "title": "Reflectance",
    "tags": "",
    "description": "Target surface reflectance",
    "unit_symbol": "dB",
    "length": 1,
    "resolution": 0.01,
    "minimum_value": -327.68,
    "maximum_value": 327.67,
    "default_value": 0.0,
    "invalid_value": null,
    "named_values": {},
    "storage_class": "variable",
    "compression_options": "shuffle",
    "lod_settings": "default",
    "scale_factor": 1.0
riegl::rdb::pointcloud::PointAttribute::operator const std::string & ( ) const
inline

Get attribute name.

Definition at line 349 of file pointAttribute.hpp.

PointAttribute& riegl::rdb::pointcloud::PointAttribute::operator= ( const PointAttribute attribute)

Assignment operator.

All properties are copied from the given attribute object.

std::string riegl::rdb::pointcloud::PointAttribute::save ( ) const

Save settings to JSON string.

See Also
load()
void riegl::rdb::pointcloud::PointAttribute::setNamedValues ( const NamedValuesMap map)

Set named values string from map.

This function generates the namedValues string from a map.

See Also
namedValues
NamedValuesMap
getNamedValues()

Friends And Related Function Documentation

friend class PointAttributeWrapper
friend

Definition at line 352 of file pointAttribute.hpp.

Member Data Documentation

std::uint8_t riegl::rdb::pointcloud::PointAttribute::compressionOptions

options additional to default compression

Definition at line 165 of file pointAttribute.hpp.

double riegl::rdb::pointcloud::PointAttribute::defaultValue

default value (minimum <= default <= maximum)

Examples:
rdb-example-01-create-database.cpp.

Definition at line 161 of file pointAttribute.hpp.

std::string riegl::rdb::pointcloud::PointAttribute::description

attribute description (for display), string size limits: [0, 5000]

Examples:
rdb-example-01-create-database.cpp.

Definition at line 155 of file pointAttribute.hpp.

double riegl::rdb::pointcloud::PointAttribute::invalidValue

invalid value (minimum <= invalid <= maximum, use "not-a-number" if there is no invalid value)

Definition at line 162 of file pointAttribute.hpp.

std::uint32_t riegl::rdb::pointcloud::PointAttribute::length

number of dimensions/elements (1: scalar, >1: vector, e.g. 3 for point coordinates)

Examples:
rdb-example-01-create-database.cpp.

Definition at line 157 of file pointAttribute.hpp.

std::string riegl::rdb::pointcloud::PointAttribute::lodSettings

Level of detail settings.

This field defines the method to be used to generate level of detail data (LOD) for this point attribute. Depending on the LOD mode defined during database creation (see CreateSettings::LodMode), several LOD methods are available. A list of all methods and their settings can be found in file "/manual/riegl_rdb_lod_methods.json" in the RDB SDK.

String size limits: [0, 50000]

Definition at line 178 of file pointAttribute.hpp.

double riegl::rdb::pointcloud::PointAttribute::maximumValue

theoretical maximum value

Examples:
rdb-example-01-create-database.cpp.

Definition at line 160 of file pointAttribute.hpp.

double riegl::rdb::pointcloud::PointAttribute::minimumValue

theoretical minimum value

Examples:
rdb-example-01-create-database.cpp.

Definition at line 159 of file pointAttribute.hpp.

std::string riegl::rdb::pointcloud::PointAttribute::name

unique attribute name (for queries)

See Also
details of class PointAttribute, string size limits: [1, 100]
Examples:
rdb-example-01-create-database.cpp, and rdb-example-06-database-stat.cpp.

Definition at line 152 of file pointAttribute.hpp.

std::string riegl::rdb::pointcloud::PointAttribute::namedValues

list of VALUE=NAME pairs separated by a single line feed character (LF, ASCII 0x0A), string size limits: [0, 1000000]

Definition at line 163 of file pointAttribute.hpp.

double riegl::rdb::pointcloud::PointAttribute::resolution

expected value resolution

Examples:
rdb-example-01-create-database.cpp.

Definition at line 158 of file pointAttribute.hpp.

double riegl::rdb::pointcloud::PointAttribute::scaleFactor

optional scale factor applied to real numbers (i.e. resolution not equal to 1.0)

  • reading points: resultValue = originalValue * scaleFactor
  • writing points: storedValue = givenValue / scaleFactor

Definition at line 186 of file pointAttribute.hpp.

std::uint8_t riegl::rdb::pointcloud::PointAttribute::storageClass

storage class

See Also
enum StorageClass
Examples:
rdb-example-01-create-database.cpp.

Definition at line 164 of file pointAttribute.hpp.

std::string riegl::rdb::pointcloud::PointAttribute::tags

attribute tags (comma separated, e.g. "position, transform"), string size limits: [0, 5000]

Definition at line 154 of file pointAttribute.hpp.

std::string riegl::rdb::pointcloud::PointAttribute::title

attribute title (for display), string size limits: [1, 100]

Examples:
rdb-example-01-create-database.cpp, and rdb-example-10-attribute-groups.cpp.

Definition at line 153 of file pointAttribute.hpp.

std::string riegl::rdb::pointcloud::PointAttribute::unitSymbol

physical unit symbol (e.g. "m", "rad", "K"), string size limits: [0, 100]

Examples:
rdb-example-01-create-database.cpp.

Definition at line 156 of file pointAttribute.hpp.


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