Grove of KDTrees. It supports both static and dynamic KDTrees, handling each accordingly.
More...
|
| KDGrove () |
| Default constructor for KDGrove.
|
|
void | addSubject (KDGroveSubject *subject, std::shared_ptr< GroveKDTreeRaycaster > tree) |
| Workaround to redirect calls from KDGrove::addSubject(KDGroveSubject *, shared_ptr<GroveKDTreeRaycaster>) to BasicDynGrove::addSubject. More...
|
|
void | removeSubject (KDGroveSubject *subject) |
| Workaround to redirect calls from KDGrove::removeSubject(KDGroveSubject *) to BasicDynGrove::removeSubject. More...
|
|
virtual std::shared_ptr< KDGrove > | makeTemporalClone () const |
| Make a temporal clone of the KDGrove. More...
|
|
virtual std::shared_ptr< KDGroveStats > | getStats () |
| Obtain the KDGrove stats. More...
|
|
virtual void | setStats (std::shared_ptr< KDGroveStats > stats) |
| Set the KDGrove stats. More...
|
|
| BasicDynGrove () |
| Default constructor for BasicDynGrove.
|
|
void | update (DynMovingObject &s) override |
|
virtual void | addSubject (BasicDynGroveSubject< GroveKDTreeRaycaster, DynMovingObject > *subject, std::shared_ptr< GroveKDTreeRaycaster > tree) |
| Add a new subject which identifier is automatically and internally computed. More...
|
|
virtual void | removeSubject (BasicDynGroveSubject< GroveKDTreeRaycaster, DynMovingObject > *subject) |
| Remove subject with given identifier from the grove. More...
|
|
virtual std::vector< BasicDynGroveSubject< GroveKDTreeRaycaster, DynMovingObject > * > const & | getSubjects () const |
| Obtain a read-only reference to vector of subjects. More...
|
|
| BasicStaticGrove ()=default |
| Default constructor for BasicStaticGrove.
|
|
bool | hasTrees () const override |
|
size_t | getNumTrees () const override |
|
void | addTree (std::shared_ptr< Tree > tree) override |
|
void | removeTree (size_t const index) override |
|
void | removeTrees (size_t const startIndex, size_t const endIndex) override |
|
void | removeAll () override |
|
void | replaceTree (size_t const index, std::shared_ptr< Tree > tree) override |
| Replace tree at given index by given tree. More...
|
|
Tree & | getTreeReference (size_t const index) const override |
|
std::shared_ptr< Tree > | getTreeShared (size_t const index) const override |
|
Tree * | getTreePointer (size_t const index) const override |
|
void | toZeroTree () override |
|
bool | hasNextTree () const override |
|
Tree & | nextTreeReference () override |
|
std::shared_ptr< Tree > | nextTreeShared () override |
|
Tree * | nextTreePointer () override |
|
void | clear () |
| Alias for StaticGrove::removeAll method. More...
|
|
void | setTree (size_t const index, std::shared_ptr< Tree > tree) |
| Alias for StaticGrove::replaceTree. More...
|
|
std::shared_ptr< Tree > | operator[] (size_t const index) const |
| Obtain a shared pointer to the tree at given index. More...
|
|
virtual GroveTreeWrapper< Tree > | begin () |
| Obtain the first element of a for-each loop over trees. More...
|
|
virtual GroveTreeWrapper< Tree > | end () |
| Obtaint the last element of a for-each loop over trees. More...
|
|
virtual void | update (Subject &s)=0 |
| The update method. It is expected that always that a subject must notify that it has been updated, it calls this method so the observer can act as corresponds. More...
|
|
Grove of KDTrees. It supports both static and dynamic KDTrees, handling each accordingly.
- Author
- Alberto M. Esmoris Pena
- Version
- 1.0
- See also
- BasicDynGrove
std::shared_ptr< KDGrove > KDGrove::makeTemporalClone |
( |
| ) |
const |
|
virtual |
Make a temporal clone of the KDGrove.
The temporal clone preserves all static trees but holds its own copy for each dynamic tree. Therefore, source KDGrove can be updated, which means its dynamic trees can change, while the dynamic trees at the temporal clone are not affected by those changes.
It is called a temporal clone because it clones the KDGrove at a certain time. Considering the KDGrove mutates over time. It is not a typical clone because it avoids cloning whatever components that do not change over time.
Notice stats are not cloned. Only the main components, it is the trees. The subjects are neither updated. The temporal clone should not be updated. It must be understood simply as a way of holding the state of a KDGrove at a certain time, not as a new fully operating KDGrove.
- Returns
- Temporal clone of the KDGrove
- See also
- GroveKDTreeRaycaster::makeTemporalClone
-
KDGroveRaycaster::makeTemporalClone