![]() |
RDB 2
|
Point invert query. More...
#include <queryInvert.hpp>
Public Member Functions | |
QueryInvert () | |
Default constructor. More... | |
QueryInvert (riegl::rdb::PointcloudData *pointcloud, const std::vector< GraphNode::ID > *nodes, const std::string &filter) | |
Constructor. More... | |
operator bool () const | |
Check if query is not null. More... | |
bool | valid () const |
Check if query is not null. More... | |
void | close () |
Finish query. More... | |
void | attribute (const std::string &name) |
Define attribute. More... | |
std::uint32_t | next (std::uint32_t count) |
Invert points. More... | |
std::uint32_t | progress () const |
Progress. More... | |
Point invert query.
This class can be used to invert point attributes for all points or just those that meet some filter criteria. Calculating the inverted value (v') from the original value (v) and the attribute limits (min and max) is done as follows:
v' = max - (v - min)
For dynamic point attributes (bits/flags) this simply means to flip the bit (e.g. set "riegl.selected" to 1 if it was 0, otherwise set it to 0).
This query is similar to using select() and update() and manually inverting the point attributes except that it might be faster (less processing time) and easier to use.
Definition at line 77 of file queryInvert.hpp.
|
explicit |
Default constructor.
Creates a null query - i.e. the query cannot be used to modify points.
|
explicit |
Constructor.
Creates a query prepared for modifying points.
void riegl::rdb::pointcloud::QueryInvert::attribute | ( | const std::string & | name | ) |
Define attribute.
Use this function to define the point attribute to be inverted. To define multiple attributes, simply call this function once for each.
[in] | name | attribute name |
void riegl::rdb::pointcloud::QueryInvert::close | ( | ) |
Finish query.
Call this function when done with modifying points.
std::uint32_t riegl::rdb::pointcloud::QueryInvert::next | ( | std::uint32_t | count | ) |
Invert points.
Use this function to actually invert the point attribute(s).
To process all points, you need to repeatedly call next() until it returns 0 (zero, see example 8). The number of points to process in one step is defined by 'count'. Please note that the actual number of processed points may be slightly different. To cancel processing just stop calling next() and cancel (rollback) the transaction.
[in] | count | number of points to process |
riegl::rdb::pointcloud::QueryInvert::operator bool | ( | ) | const |
Check if query is not null.
std::uint32_t riegl::rdb::pointcloud::QueryInvert::progress | ( | ) | const |
Progress.
This function returns a coarse progress information in percent (0..100%). Since the total number of modified points is not known in advance, this value just reflects the progress of the (internal) index traversal.
bool riegl::rdb::pointcloud::QueryInvert::valid | ( | ) | const |
Check if query is not null.
A null query cannot be used to read points.