#include <array>
#include <vector>
#include <iomanip>
#include <iostream>
#include <exception>
int main()
{
try
{
{
throw std::runtime_error("This is not a RDB 2 database file!");
}
rdb.
open(
"pointcloud.rdbx", settings);
std::cout << std::endl << "POINT ATTRIBUTES:" << std::endl;
{
for (auto it = attributes.begin(); it != attributes.end(); it++)
{
std::cout <<
" Name: " << attribute.
name << std::endl;
std::cout << " Title: " << attribute.title << std::endl;
std::cout << " Description: " << attribute.description << std::endl;
std::cout << " Unit: " << attribute.unitSymbol << std::endl;
std::cout << " Length: " << attribute.length << std::endl;
std::cout << " Resolution: " << attribute.resolution << std::endl;
std::cout << " MinimumValue: " << attribute.minimumValue << std::endl;
std::cout << " MaximumValue: " << attribute.maximumValue << std::endl;
std::cout << " DefaultValue: " << attribute.defaultValue << std::endl;
std::cout << "------------------------------------------" << std::endl;
}
}
std::cout << std::endl << "POINT CLOUD STATISTICS:" << std::endl;
{
using namespace riegl::rdb::pointcloud;
std::array<double, 3> minimum, maximum;
stat.
minimum(root, RDB_RIEGL_XYZ, minimum);
stat.
maximum(root, RDB_RIEGL_XYZ, maximum);
std::cout << std::fixed << std::setprecision(3);
std::cout << " Minimum X, Y, Z: " << minimum[0] << ", " << minimum[1] << ", " << minimum[2] << std::endl;
std::cout << " Maximum X, Y, Z: " << maximum[0] << ", " << maximum[1] << ", " << maximum[2] << std::endl;
}
return 0;
}
{
std::cerr << error.
what() <<
" (" << error.
details() <<
")" << std::endl;
return 1;
}
catch(const std::exception &error)
{
std::cerr << error.what() << std::endl;
return 1;
}
}