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

Point insert query. More...

#include <queryInsert.hpp>

Public Member Functions

 QueryInsert ()
 Default constructor. More...
 
 QueryInsert (riegl::rdb::PointcloudData *pointcloud)
 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, const void *buffer, const std::int32_t stride=0)
 Bind attribute buffer. More...
 
void bindId (const DataType dataType, void *buffer, const std::int32_t stride=0)
 Bind point id buffer. More...
 
template<typename ValueType >
void bindBuffer (const std::string &attribute, const ValueType &buffer, const std::int32_t stride=0)
 Bind attribute buffer. More...
 
template<typename ValueType >
void bindIdBuffer (ValueType &buffer, const std::int32_t stride=0)
 Bind point id buffer. More...
 
template<typename ValueType >
void bindIdBuffer (ValueType *buffer, const std::int32_t stride=0)
 Bind point id buffer. More...
 
template<typename ObjectType , typename MemberPointer >
void bindMember (const std::string &attribute, const ObjectType &object, const MemberPointer member)
 Bind attribute buffer. More...
 
template<typename ObjectType , typename MemberPointer >
void bindIdMember (ObjectType &object, MemberPointer member)
 Bind point id buffer. More...
 
template<typename ObjectType , typename MemberPointer >
void bindMember (const std::string &attribute, const ObjectType &object, const MemberPointer member, const std::size_t index)
 Bind attribute buffer. More...
 
template<typename ObjectType , typename MemberPointer >
void bindIdMember (ObjectType &object, MemberPointer member, const std::size_t index)
 Bind point id buffer. More...
 
std::uint32_t next (std::uint32_t count)
 Insert points. More...
 

Detailed Description

Point insert query.

This class can be used to insert (new) points into the database.

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

Definition at line 67 of file queryInsert.hpp.

Constructor & Destructor Documentation

riegl::rdb::pointcloud::QueryInsert::QueryInsert ( )
explicit

Default constructor.

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

See Also
riegl::rdb::Pointcloud::insert()
riegl::rdb::pointcloud::QueryInsert::QueryInsert ( riegl::rdb::PointcloudData *  pointcloud)
explicit

Constructor.

Creates a query prepared for inserting points.

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

Member Function Documentation

void riegl::rdb::pointcloud::QueryInsert::bind ( const std::string &  attribute,
const DataType  dataType,
const void *  buffer,
const std::int32_t  stride = 0 
)

Bind attribute buffer.

Use this function to define a source 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).

You can but don't need to define a buffer for each attribute. If no buffer is defined for an attribute, the attribute's default value will be used instead.

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

Note
This function just stores the buffer pointer - it does NOT copy the data contained in the buffer. So make sure that the buffer remains valid until you call next().
See Also
riegl::rdb::pointcloud::PointAttributes
Parameters
[in]attributeattribute name
[in]dataTypebuffer data type
[in]bufferbuffer location
[in]stridebytes between beginnings of successive elements (0: auto)
template<typename ValueType >
void riegl::rdb::pointcloud::QueryInsert::bindBuffer ( const std::string &  attribute,
const ValueType &  buffer,
const std::int32_t  stride = 0 
)
inline

Bind attribute buffer.

Use this function to define a source 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).

You can but don't need to define a buffer for each attribute. If no buffer is defined for an attribute, the attribute's default value will be used instead.

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

Note
This function just stores the buffer pointer - it does NOT copy the data contained in the buffer. So make sure that the buffer remains valid until you call next().
See Also
riegl::rdb::pointcloud::PointAttributes
Parameters
[in]attributeattribute name
[in]bufferbuffer (data, pointer to data, std::array or std::vector)
[in]stridebytes between beginnings of successive elements (0: auto)
Examples:
rdb-example-02-insert-points.cpp.

Definition at line 159 of file queryInsert.hpp.

void riegl::rdb::pointcloud::QueryInsert::bindId ( const DataType  dataType,
void *  buffer,
const std::int32_t  stride = 0 
)

Bind point id buffer.

If you provide a buffer for the point identifier attribute ("riegl.id"), then it will receive the identifiers of the inserted points (PID). Each point is assigned a unique PID on insertion. The PID starts at 1 for the first point and is incremented by 1 for each subsequent point (so that the PID reflects the insertion order of the points, but only as long as riegl::rdb::pointcloud::CreateSettings::optimizePointID is set to false).

See Also
bind()
Parameters
[in]dataTypebuffer data type
[in]bufferbuffer location
[in]stridebytes between beginnings of successive elements (0: auto)
template<typename ValueType >
void riegl::rdb::pointcloud::QueryInsert::bindIdBuffer ( ValueType &  buffer,
const std::int32_t  stride = 0 
)
inline

Bind point id buffer.

If you provide a buffer for the point identifier attribute ("riegl.id"), then it will receive the identifiers of the inserted points (PID). Each point is assigned a unique PID on insertion. The PID starts at 1 for the first point and is incremented by 1 for each subsequent point (so that the PID reflects the insertion order of the points, but only as long as riegl::rdb::pointcloud::CreateSettings::optimizePointID is set to false).

See Also
bind()
bindBuffer()
Parameters
[in]bufferbuffer (data, pointer to data, std::array or std::vector)
[in]stridebytes between beginnings of successive elements (0: auto)

Definition at line 173 of file queryInsert.hpp.

template<typename ValueType >
void riegl::rdb::pointcloud::QueryInsert::bindIdBuffer ( ValueType *  buffer,
const std::int32_t  stride = 0 
)
inline

Bind point id buffer.

If you provide a buffer for the point identifier attribute ("riegl.id"), then it will receive the identifiers of the inserted points (PID). Each point is assigned a unique PID on insertion. The PID starts at 1 for the first point and is incremented by 1 for each subsequent point (so that the PID reflects the insertion order of the points, but only as long as riegl::rdb::pointcloud::CreateSettings::optimizePointID is set to false).

See Also
bind()
bindBuffer()
Parameters
[in]bufferbuffer (data, pointer to data, std::array or std::vector)
[in]stridebytes between beginnings of successive elements (0: auto)

Definition at line 186 of file queryInsert.hpp.

template<typename ObjectType , typename MemberPointer >
void riegl::rdb::pointcloud::QueryInsert::bindIdMember ( ObjectType &  object,
MemberPointer  member 
)
inline

Bind point id buffer.

If you provide a buffer for the point identifier attribute ("riegl.id"), then it will receive the identifiers of the inserted points (PID). Each point is assigned a unique PID on insertion. The PID starts at 1 for the first point and is incremented by 1 for each subsequent point (so that the PID reflects the insertion order of the points, but only as long as riegl::rdb::pointcloud::CreateSettings::optimizePointID is set to false).

See Also
bind()
bindMember()
Parameters
[in]objecte.g. first object of container
[in]memberobject member variable pointer

Definition at line 222 of file queryInsert.hpp.

template<typename ObjectType , typename MemberPointer >
void riegl::rdb::pointcloud::QueryInsert::bindIdMember ( ObjectType &  object,
MemberPointer  member,
const std::size_t  index 
)
inline

Bind point id buffer.

If you provide a buffer for the point identifier attribute ("riegl.id"), then it will receive the identifiers of the inserted points (PID). Each point is assigned a unique PID on insertion. The PID starts at 1 for the first point and is incremented by 1 for each subsequent point (so that the PID reflects the insertion order of the points, but only as long as riegl::rdb::pointcloud::CreateSettings::optimizePointID is set to false).

See Also
bind()
bindMember()
Parameters
[in]objecte.g. first object of container
[in]memberobject member variable pointer
[in]indexindex for array-like object members

Definition at line 253 of file queryInsert.hpp.

template<typename ObjectType , typename MemberPointer >
void riegl::rdb::pointcloud::QueryInsert::bindMember ( const std::string &  attribute,
const ObjectType &  object,
const MemberPointer  member 
)
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.

See Also
bindBuffer()
Parameters
[in]attributeattribute name
[in]objecte.g. first object of container
[in]memberobject member variable pointer

Definition at line 205 of file queryInsert.hpp.

template<typename ObjectType , typename MemberPointer >
void riegl::rdb::pointcloud::QueryInsert::bindMember ( const std::string &  attribute,
const ObjectType &  object,
const MemberPointer  member,
const std::size_t  index 
)
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.

See Also
bindBuffer()
Parameters
[in]attributeattribute name
[in]objecte.g. first object of container
[in]memberobject member variable pointer
[in]indexindex for array-like object members

Definition at line 235 of file queryInsert.hpp.

void riegl::rdb::pointcloud::QueryInsert::close ( )

Finish query.

Call this function when done with inserting points.

std::uint32_t riegl::rdb::pointcloud::QueryInsert::next ( std::uint32_t  count)

Insert points.

Use this function to actually read the point attributes from all defined buffers and insert the points into the database.

Afterwards you may re-fill the buffers or define new buffers with bind() and call next() again until all points have been inserted.

Note
IEEE-754 "NaN" values contained in floating point source buffers are ignored and the attribute's default value is used instead. Furthermore IEEE-754 "Infinity" values will always cause next() to fail with error code 10414, i.e. riegl::rdb::Error::QueryAttributeValueOutOfRange.
Since version 2.4.2, unit vector point attributes (e.g. "riegl.direction") are automatically normalized (divided by the vector length) on insertion. This is done for all point attributes that meet the following requirements: length is 3, minimumValue is -1, maximumValue is 1, resolution is not 1, scaleFactor is 1, unitSymbol is empty, invalidValue is undefined and tags contains the "direction" tag but not the "do-not-normalize" tag.
Returns
the number of points inserted
Parameters
[in]countsize of source buffers in terms of points
Examples:
rdb-example-02-insert-points.cpp.
riegl::rdb::pointcloud::QueryInsert::operator bool ( ) const

Check if query is not null.

See Also
valid()
bool riegl::rdb::pointcloud::QueryInsert::valid ( ) const

Check if query is not null.

A null query cannot be used to insert points.


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