![]() |
My Project
|
Generic container to store any information in 3D (features, photos, ...) More...
#include <Container3d.h>
Classes | |
class | Iterator |
Iterator for going through the items in Container3d in the specified order. More... | |
Public Types | |
typedef std::pair< cv::Point3f, T > | node_type |
node_type for storing data. 3D-position is paired with the data content. | |
Public Member Functions | |
void | Add (const cv::Point3f &_pos, const T &_data) |
Add _data in the container and associate it with 3D position _pos. | |
void | Clear () |
Clear the container. | |
void | ResetSearchSpace () |
Reset the search space to contain whole data. | |
void | Erase (size_t index) |
Erase item in the container. | |
template<typename Compare > | |
int | Sort (Compare comp) |
Sort using external Compare method. | |
template<typename Test > | |
int | Limit (Test test) |
Limit the search space with external limitation. | |
Iterator | begin () |
Provides an iterator pointing to the beginning of the limited/sorted 3D content. | |
Iterator | end () |
Provides an iterator pointing to the end of the limited/sorted 3D content. | |
size_t | size () const |
Get number of items that can be referenced using operator[]() | |
size_t | GetIndex (Iterator &iter) |
Get absolute reference usable with operator[]() based on the iterator. | |
node_type & | operator[] (size_t index) |
Instead of Iterator we can use also absolute references for data with operator[]() | |
size_t | GetIndex (T *p) |
Get absolute reference usable with operator[]() based on the content. | |
Protected Attributes | |
std::vector< node_type > | data |
the actual data in using node_type: pair<cv::Point3f, T> | |
std::vector< size_t > | search_space |
Possibly limited set of indices for data in somehow "optimal" search order. | |
Generic container to store any information in 3D (features, photos, ...)
You can store any information in 3D using this container. Each element in the container has an unique id that it can be referenced with using operator[](). The indices are from 0 to size(). You can find specific index using GetIndex(Iterator &iter) or GetIndex(T *p) .
In addition the Container3d contains also a 'search space' that can be iterated through using begin() and end(). This 'search space' can be limited using Limit() , sorted using Sort() and reseted using ResetSearchSpace(). You specify what to limit/sort using specified functors. In ALVAR there exists functors Container3dLimitDist , Container3dSortSize and Container3dSortDist . But you can quite well make your own versions (see example below).
The implementation is optimized for a situation where there are a lot of searches between every time the search space is limited/ordered. This is the reason we use vector containers internally. The idea is that later we will improve the class by providing more ways for limiting and sorting the search space; for example Frustum culling.
Usage:
Definition at line 185 of file Container3d.h.