127 void setShouldStoreCompaction(
bool shouldStoreCompaction);
132 bool getShouldStoreCompaction()
const;
134 void setMaximumCompactionDepth(
size_t maximumCompactionDepth);
143 void setEmbedCacheFilesInArchive(
bool embed );
149 bool getEmbedCacheFilesInArhive()
const;
167 TileStatus getTileStatus(
TileId id )
const;
193 bool haveReadyTile();
225 void handleStagedTerrain();
231 void store( agxStream::OutputArchive&
out );
232 void restore( agxStream::InputArchive&
in, const agxTerrain::
TileSpecification& tileSpec );
237 void pauseBackgroundThread();
239 void resumeBackgroundThread();
246 agx::
HashTable <
TileId, std::pair<
size_t,
size_t>> m_restoreDataTileIdTable;
254 size_t numberOfModifiedVoxels;
266 void backgroundOperations();
271 void performUnloadTile( TerrainTile tile );
275 bool writeCacheFile(
agx::String filename,
const CachedTile& tile );
277 bool readCacheFile(
agx::String filename, CachedTile& output );
301 agxTerrain::TerrainRefVector m_terrainPool;
304 agxTerrain::TerrainRefVector m_terrainStaging;
315 std::thread m_backgroundThread;
318 std::mutex m_createTerrainMutex;
320 std::condition_variable m_producerCondition;
322 std::condition_variable m_consumerCondition;
324 std::condition_variable m_clearCondition;
326 bool m_backgroundThreadPaused;
330 bool m_shutdownThread;
334 bool m_shouldStoreCompaction;
335 bool m_shouldEmbedCachedFiles;
337 size_t m_maximumCompactionDepth;
344 std::deque< std::pair<agxTerrain::TileSpecification, agxTerrain::TileId> > m_loadRequests;
346 std::deque< agxTerrain::TerrainTile > m_unloadRequests;
348 std::queue< agxTerrain::TerrainTile > m_readyTiles;
355 m_shouldStoreCompaction = shouldStoreCompaction;
360 return m_shouldStoreCompaction;
365 m_maximumCompactionDepth = maximumCompactionDepth;
370 return &m_compressedIndices;
375 return m_terrainDataSource;
380 return m_templateTerrain;
385 m_templateTerrain = templateTerrain;
391 return m_fileCacheDir;
397 m_shouldEmbedCachedFiles = embed;
402 return m_shouldEmbedCachedFiles;
std::pair< Real, Real > RealPair
Struct with data to describe a terrain tile.
InputRef< T > in(const char *name, T &obj)
Create an object with a name and a reference to the object that should be restored (usually a pointer...
bool getShouldStoreCompaction() const
Returns whether the terrain pager should store compaction data for tiles that are paged out...
A TileSpecification determines where in the world a 2D TileId is located and contains utility methods...
OutputRef< Serializable > out(const char *name, const Serializable *obj)
Return an object that contain the name and the object that should be serialized to an archive...
A terrain model based a 3D grid model with overlapping height field that can be deformed by interacti...
Tile is loaded and ready to be used by the TerrainPager.
agxTerrain::TerrainRef getTemplateTerrain()
Returns the template terrain used for properties of new terrain tiles.
agx::VectorPOD< agx::RealVector > modifiedCompactionVector
Tile has been fetched by the TerrainPager.
Tile has been returned to the Cache by the TerrainPager.
Vector containing 'raw' data.
Tile not seen before, must be loaded from data source.
void setTemplateTerrain(agxTerrain::TerrainRef templateTerrain)
Sets the template terrain used for properties of new terrain tiles.
The TerrainCache is used internally by the TerrainPager to provide requested terrain tiles...
void setEmbedCacheFilesInArchive(bool embed)
Sets if cached files written out to disk should be embeded in AGX Archives when store is called...
agx::String getFileCacheDirectory() const
agx::Vec2i32 TileId
A TileId is a 2D-coordinate that specifies where a in grid a tile is located.
typedef void(GLAD_API_PTR *GLDEBUGPROC)(GLenum source
#define AGXTERRAIN_EXPORT
void setMaximumCompactionDepth(size_t maximumCompactionDepth)
agx::HashTable< agxTerrain::TileId, agx::Vec2iVector > * getCompressedIndices()
Abstract interface for requesting height data for a Terrain tile.
Class for writing serialized data in binary format to a stream.
TerrainDataSource * getTerrainDataSource() const
Returns the data source used for height data.
bool getEmbedCacheFilesInArhive() const
Returns if cached files should be embedded in AGX Archives used for serialization.
void setShouldStoreCompaction(bool shouldStoreCompaction)
Sets if the terrain pager should store compaction data for tiles that are paged out.
Inheritance with partial specialization due to bug with ref_ptr containers.
LinearProbingHashTable< KeyT, DataT, HashT, AllocatorT > HashTable
agxTerrain::TerrainRef terrain
#define DOXYGEN_END_INTERNAL_BLOCK()
#define DOXYGEN_START_INTERNAL_BLOCK()