Go to the documentation of this file.
35 #ifndef CHUNK_HASH_GRID_HPP
36 #define CHUNK_HASH_GRID_HPP
44 #include <unordered_map>
58 return mesh->getFloatChannel(
"vertices");
63 return points->getFloatChannel(
"points");
70 using val_type = boost::variant<MeshBufferPtr, PointBufferPtr>;
79 explicit ChunkHashGrid(std::string hdf5Path,
size_t cacheSize,
float chunkSize = 10.0f);
105 template <
typename T>
122 template <
typename T>
123 void setChunk(std::string layer,
int x,
int y,
int z, T data);
140 template <
typename T>
141 boost::optional<T>
getChunk(std::string layer,
int x,
int y,
int z);
212 return maxChunkIndex;
245 template <
typename T>
246 bool loadChunk(std::string layer,
int x,
int y,
int z);
296 std::list<std::pair<std::string, size_t>>
m_items;
299 std::unordered_map<std::string, std::unordered_map<size_t, val_type>>
m_hashGrid;
313 #include "ChunkHashGrid.tcc"
315 #endif // CHUNK_HASH_GRID_HPP
void rehashCache(const BaseVector< std::size_t > &oldChunkAmount, const BaseVector< std::size_t > &oldChunkIndexOffset)
regenerates cache hash grid
void expandBoundingBox(const val_type &data)
void setBoundingBox(const BoundingBox< BaseVector< float >> boundingBox)
sets the bounding box in this container and in persistend storage
boost::optional< T > getChunk(std::string layer, int x, int y, int z)
delivers the content of a chunk
const BoundingBox< BaseVector< float > > & getBoundingBox() const
std::shared_ptr< PointBuffer > PointBufferPtr
std::unordered_map< std::string, std::unordered_map< size_t, val_type > > m_hashGrid
ChunkHashGrid(std::string hdf5Path, size_t cacheSize, float chunkSize=10.0f)
class to load chunks from an HDF5 file
FloatChannelOptional operator()(const PointBufferPtr points) const
std::size_t hashValue(int i, int j, int k) const
Calculates the hash value for the given index triple.
FloatChannel::Optional FloatChannelOptional
boost::variant< MeshBufferPtr, PointBufferPtr > val_type
bool loadChunk(std::string layer, int x, int y, int z)
loads a chunk from persistent storage into cache
visitor that returns the channel that holds geometic information (like vertices-channel for meshes)
float getChunkSize() const
BaseVector< std::size_t > m_chunkAmount
BoundingBox< BaseVector< float > > m_boundingBox
FloatChannelOptional operator()(const MeshBufferPtr mesh) const
const BaseVector< std::size_t > & getChunkAmount() const
std::list< std::pair< std::string, size_t > > m_items
BaseVector< int > getChunkMinChunkIndex() const
returns the minimum chunk ids
void setGeometryChunk(std::string layer, int x, int y, int z, T data)
sets a chunk of a given layer in hashgrid
A dynamic bounding box class.
Hdf5Build< hdf5features::ChunkIO > io
void setChunk(std::string layer, int x, int y, int z, T data)
sets a chunk of a given layer in hashgrid
std::shared_ptr< MeshBuffer > MeshBufferPtr
bool isChunkLoaded(std::string layer, size_t hashValue)
indicates if wether or not a chunk is currently loaded in the local cache
typename Hdf5Construct< Feature >::type Hdf5Build
void setChunkAmountAndOffset(const BaseVector< std::size_t > &chunkAmount, const BaseVector< std::size_t > &chunkIndexOffset)
sets the amount of chunks in x y and z direction in this container and in persistent storage
void setChunkSize(float chunkSize)
sets chunk size in this container and in persistent storage
BaseVector< int > getChunkMaxChunkIndex() const
returns the maximum chunk ids
BaseVector< std::size_t > m_chunkIndexOffset
lvr2
Author(s): Thomas Wiemann
, Sebastian Pütz , Alexander Mock , Lars Kiesow , Lukas Kalbertodt , Tristan Igelbrink , Johan M. von Behren , Dominik Feldschnieders , Alexander Löhr
autogenerated on Wed Mar 2 2022 00:37:23