![]() |
RDB 2
|
Point select query. More...
#include <querySelect.hpp>
Public Member Functions | |
QuerySelect () | |
Default constructor. More... | |
QuerySelect (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 | bind (const std::string &attribute, const DataType dataType, void *buffer, const std::int32_t stride=0) |
Bind attribute buffer. More... | |
template<typename ValueType > | |
void | bindBuffer (const std::string &attribute, ValueType &buffer, const std::int32_t stride=0) |
Bind attribute buffer. More... | |
template<typename ValueType > | |
void | bindBuffer (const std::string &attribute, ValueType *buffer, const std::int32_t stride=0) |
Bind attribute buffer. More... | |
template<typename ObjectType , typename MemberPointer > | |
void | bindMember (const std::string &attribute, ObjectType &object, const MemberPointer member) |
Bind attribute buffer. More... | |
template<typename ObjectType , typename MemberPointer > | |
void | bindMember (const std::string &attribute, ObjectType &object, const MemberPointer member, const std::size_t index) |
Bind attribute buffer. More... | |
std::uint32_t | next (std::uint32_t count) |
Select points. More... | |
std::uint32_t | progress () const |
Progress. More... | |
Point select query.
This class can be used to select (read) attributes of existing points.
Definition at line 69 of file querySelect.hpp.
|
explicit |
Default constructor.
Creates a null query - i.e. the query cannot be used to read points.
|
explicit |
Constructor.
Creates a query prepared for reading points.
void riegl::rdb::pointcloud::QuerySelect::bind | ( | const std::string & | attribute, |
const DataType | dataType, | ||
void * | buffer, | ||
const std::int32_t | stride = 0 |
||
) |
Bind attribute buffer.
Use this function to define a target buffer for a point attribute. Exactly one buffer can be defined for an attribute (i.e. only the most recently defined buffer will be used).
The buffer is expected to be n*s*d bytes large, where n is the number of points defined in next(), s is the size of one element as defined by 'dataType' and d is the number of attribute dimensions (elements).
[in] | attribute | attribute name |
[in] | dataType | buffer data type |
[in] | buffer | buffer location |
[in] | stride | bytes between beginnings of successive elements (0: auto) |
|
inline |
Bind attribute buffer.
Use this function to define a target buffer for a point attribute. Exactly one buffer can be defined for an attribute (i.e. only the most recently defined buffer will be used).
The buffer is expected to be n*s*d bytes large, where n is the number of points defined in next(), s is the size of one element as defined by 'dataType' and d is the number of attribute dimensions (elements).
[in] | attribute | attribute name |
[in] | buffer | buffer (data, pointer to data, std::array or std::vector) |
[in] | stride | bytes between beginnings of successive elements (0: auto) |
Definition at line 142 of file querySelect.hpp.
|
inline |
Bind attribute buffer.
Use this function to define a target buffer for a point attribute. Exactly one buffer can be defined for an attribute (i.e. only the most recently defined buffer will be used).
The buffer is expected to be n*s*d bytes large, where n is the number of points defined in next(), s is the size of one element as defined by 'dataType' and d is the number of attribute dimensions (elements).
[in] | attribute | attribute name |
[in] | buffer | buffer (data, pointer to data, std::array or std::vector) |
[in] | stride | bytes between beginnings of successive elements (0: auto) |
Definition at line 153 of file querySelect.hpp.
|
inline |
Bind attribute buffer.
This is a variant of bindBuffer() that allows to bind a member variable of an object as attribute buffer. The object can be part of a container that stores the objects contiguously (e.g. std::vector, std::array) and the stride is automatically derived from the object size.
[in] | attribute | attribute name |
[in] | object | e.g. first object of container |
[in] | member | object member variable pointer |
Definition at line 173 of file querySelect.hpp.
|
inline |
Bind attribute buffer.
This is a variant of bindBuffer() that allows to bind a member variable of an object as attribute buffer. The object can be part of a container that stores the objects contiguously (e.g. std::vector, std::array) and the stride is automatically derived from the object size.
[in] | attribute | attribute name |
[in] | object | e.g. first object of container |
[in] | member | object member variable pointer |
[in] | index | index for array-like object members |
Definition at line 187 of file querySelect.hpp.
void riegl::rdb::pointcloud::QuerySelect::close | ( | ) |
Finish query.
Call this function when done with reading points.
std::uint32_t riegl::rdb::pointcloud::QuerySelect::next | ( | std::uint32_t | count | ) |
Select points.
Use this function to actually read the selected points from database and copy the attributes to the defined buffers.
Afterwards you may re-use the buffers or define new buffers with bind() and call next() again until all points have been read (i.e. next() returns zero).
If no buffers were bound, calling next() is still valid. This can be used for counting points - either all or just those that meet some filter criteria. If no filter is specified the total point count is equal to what you get with riegl::rdb::Pointcloud::stat().
[in] | count | size of target buffers in terms of points |
riegl::rdb::pointcloud::QuerySelect::operator bool | ( | ) | const |
Check if query is not null.
std::uint32_t riegl::rdb::pointcloud::QuerySelect::progress | ( | ) | const |
Progress.
This function returns a coarse progress information in percent (0..100%). Since the total number of returned points is not known in advance, this value just reflects the progress of the (internal) index traversal.
bool riegl::rdb::pointcloud::QuerySelect::valid | ( | ) | const |
Check if query is not null.
A null query cannot be used to read points.