#include <areastore.h>
Classes | |
class | VectorResultVisitor |
Public Member Functions | |
SpatialAreaStore () | |
virtual | ~SpatialAreaStore () |
virtual bool | insertArea (Area *a) |
Add an area to the store. | |
virtual bool | removeArea (u32 id) |
Removes an area from the store by ID. | |
virtual void | getAreasInArea (std::vector< Area * > *result, v3s16 minedge, v3s16 maxedge, bool accept_overlap) |
Finds areas that are completely contained inside the area defined by the passed edges. | |
Public Member Functions inherited from AreaStore | |
AreaStore () | |
virtual | ~AreaStore ()=default |
virtual void | reserve (size_t count) |
size_t | size () const |
void | getAreasForPos (std::vector< Area * > *result, v3s16 pos) |
Finds areas that the passed position is contained in. | |
void | setCacheParams (bool enabled, u8 block_radius, size_t limit) |
Sets cache parameters. | |
const Area * | getArea (u32 id) const |
Returns a pointer to the area coresponding to the passed ID, or NULL if it doesn't exist. | |
void | serialize (std::ostream &is) const |
Serializes the store's areas to a binary ostream. | |
void | deserialize (std::istream &is) |
Deserializes the Areas from a binary istream. | |
Protected Member Functions | |
virtual void | getAreasForPosImpl (std::vector< Area * > *result, v3s16 pos) |
Implementation of getAreasForPos. | |
Protected Member Functions inherited from AreaStore | |
void | invalidateCache () |
Invalidates the getAreasForPos cache. | |
u32 | getNextId () const |
Returns the next area ID and increments it. | |
Private Attributes | |
SpatialIndex::ISpatialIndex * | m_tree = nullptr |
SpatialIndex::IStorageManager * | m_storagemanager = nullptr |
Additional Inherited Members | |
Static Public Member Functions inherited from AreaStore | |
static AreaStore * | getOptimalImplementation () |
Protected Types inherited from AreaStore | |
typedef std::map< u32, Area > | AreaMap |
Protected Attributes inherited from AreaStore | |
AreaMap | areas_map |
SpatialAreaStore::SpatialAreaStore | ( | ) |
References m_storagemanager, and m_tree.
|
virtual |
References m_storagemanager, and m_tree.
|
protectedvirtual |
Implementation of getAreasForPos.
getAreasForPos calls this if the cache is disabled.
Implements AreaStore.
References get_spatial_point(), and m_tree.
|
virtual |
Finds areas that are completely contained inside the area defined by the passed edges.
If accept_overlap
is true this finds any areas that intersect with the passed area at any point.
Implements AreaStore.
References get_spatial_region(), and m_tree.
|
virtual |
Add an area to the store.
Updates the area's ID if it hasn't already been set.
Implements AreaStore.
References AreaStore::areas_map, get_spatial_region(), AreaStore::getNextId(), Area::id, AreaStore::invalidateCache(), m_tree, Area::maxedge, Area::minedge, and U32_MAX.
|
virtual |
Removes an area from the store by ID.
Implements AreaStore.
References AreaStore::areas_map, get_spatial_region(), AreaStore::invalidateCache(), m_tree, Area::maxedge, and Area::minedge.
|
private |
Referenced by SpatialAreaStore(), and ~SpatialAreaStore().
|
private |
Referenced by SpatialAreaStore(), ~SpatialAreaStore(), getAreasForPosImpl(), getAreasInArea(), insertArea(), and removeArea().