RDB 2
Public Member Functions | List of all members
riegl::rdb::pointcloud::QueryInvert Class Reference

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...
 

Detailed Description

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.

See also
riegl::rdb::Pointcloud::invert()
Note
You either must delete the query object or call close() before the parent Pointcloud instance is closed/deleted!
Examples:
rdb-example-08-invert-points.cpp.

Definition at line 77 of file queryInvert.hpp.

Constructor & Destructor Documentation

riegl::rdb::pointcloud::QueryInvert::QueryInvert ( )
explicit

Default constructor.

Creates a null query - i.e. the query cannot be used to modify points.

See also
riegl::rdb::Pointcloud::invert()
riegl::rdb::pointcloud::QueryInvert::QueryInvert ( riegl::rdb::PointcloudData *  pointcloud,
const std::vector< GraphNode::ID > *  nodes,
const std::string &  filter 
)
explicit

Constructor.

Creates a query prepared for modifying points.

Note
You cannot create new QueryInvert objects this way, use riegl::rdb::Pointcloud::invert() instead.

Member Function Documentation

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.

Note
Point attributes having a length greater than 1 (vectors like the true color attribute "riegl.rgba") can only be inverted as a whole, i.e. you cannot invert particular vector elements (e.g. using "riegl.rgba[0]" will not work).
See also
riegl::rdb::pointcloud::PointAttributes
Parameters
[in]nameattribute name
Examples:
rdb-example-08-invert-points.cpp.
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.

Returns
the number of points processed
Parameters
[in]countnumber of points to process
Examples:
rdb-example-08-invert-points.cpp.
riegl::rdb::pointcloud::QueryInvert::operator bool ( ) const

Check if query is not null.

See also
valid()
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.

Examples:
rdb-example-08-invert-points.cpp.
bool riegl::rdb::pointcloud::QueryInvert::valid ( ) const

Check if query is not null.

A null query cannot be used to read points.


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