19 #include <agx/config/AGX_USE_AGXTERRAIN.h> 127 void setShouldStoreCompaction(
bool shouldStoreCompaction);
132 bool getShouldStoreCompaction()
const;
134 void setMaximumCompactionDepth(
size_t maximumCompactionDepth);
143 void setEmbedCacheFilesInArchive(
bool embed );
149 bool getEmbedCacheFilesInArhive()
const;
193 bool haveReadyTile();
225 void handleStagedTerrain();
237 void pauseBackgroundThread();
239 void resumeBackgroundThread();
254 size_t numberOfModifiedVoxels;
257 size_t numberOfInhomogeneousVoxels;
270 void backgroundOperations();
279 bool writeCacheFile(
agx::String filename,
const CachedTile& tile );
281 bool readCacheFile(
agx::String filename, CachedTile& output );
319 std::thread m_backgroundThread;
322 std::mutex m_createTerrainMutex;
324 std::condition_variable m_producerCondition;
326 std::condition_variable m_consumerCondition;
328 std::condition_variable m_clearCondition;
330 bool m_backgroundThreadPaused;
334 bool m_shutdownThread;
338 bool m_shouldStoreCompaction;
339 bool m_shouldEmbedCachedFiles;
341 size_t m_maximumCompactionDepth;
348 std::deque< std::pair<agxTerrain::TileSpecification, agxTerrain::TileId> > m_loadRequests;
350 std::deque< agxTerrain::TerrainTile > m_unloadRequests;
352 std::queue< agxTerrain::TerrainTile > m_readyTiles;
359 m_shouldStoreCompaction = shouldStoreCompaction;
364 return m_shouldStoreCompaction;
369 m_maximumCompactionDepth = maximumCompactionDepth;
374 return &m_compressedIndices;
379 return m_terrainDataSource;
384 return m_templateTerrain;
389 m_templateTerrain = templateTerrain;
395 return m_fileCacheDir;
401 m_shouldEmbedCachedFiles = embed;
406 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...
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...
The agxTerrain namespace contains a 3D model for a dynamic deformable Terrain and related classes...
Tile is loaded and ready to be used by the TerrainPager.
bool getShouldStoreCompaction() const
Returns whether the terrain pager should store compaction data for tiles that are paged out...
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.
The agx namespace contains the dynamics/math part of the AGX Dynamics API.
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...
#define AGXTERRAIN_EXPORT
void setMaximumCompactionDepth(size_t maximumCompactionDepth)
agx::HashTable< agxTerrain::TileId, agx::Vec2iVector > * getCompressedIndices()
TerrainDataSource * getTerrainDataSource() const
Returns the data source used for height data.
Abstract interface for requesting height data for a Terrain tile.
Class for writing serialized data in binary format to a stream.
agx::String getFileCacheDirectory() const
void setShouldStoreCompaction(bool shouldStoreCompaction)
Sets if the terrain pager should store compaction data for tiles that are paged out.
This namespace contain classes for streaming classes into archives, ASCII, binary for storage (serial...
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()
bool getEmbedCacheFilesInArhive() const
Returns if cached files should be embedded in AGX Archives used for serialization.
#define DOXYGEN_START_INTERNAL_BLOCK()