#include <Volume.h>
Collaboration diagram for Volume:Public Types | |
| enum | CheckCause { CHECK_CAUSE_UNUSED, CHECK_CAUSE_MODIFIED } |
Public Member Functions | |
| Volume (const vmanVolumeParameters *parameters) | |
| ~Volume () | |
| int | getChunkEdgeLength () const |
| int | getVoxelsPerChunk () const |
| int | getMaxLayerVoxelSize () const |
| int | getLayerCount () const |
| const vmanLayer * | getLayer (int index) const |
| int | getLayerIndexByName (const char *name) const |
| const char * | getBaseDir () const |
| std::string | getChunkFileName (int chunkX, int chunkY, int chunkZ) const |
| void | voxelToChunkCoordinates (const int voxelX, const int voxelY, const int voxelZ, int *chunkX, int *chunkY, int *chunkZ) |
| void | voxelToChunkSelection (const vmanSelection *voxelSelection, vmanSelection *chunkSelection) |
| void | getSelection (const vmanSelection *chunkSelection, Chunk **chunksOut, int priority) |
| void | setUnusedChunkTimeout (int seconds) |
| int | getUnusedChunkTimeout () const |
| void | setModifiedChunkTimeout (int seconds) |
| int | getModifiedChunkTimeout () const |
| void | saveModifiedChunks () |
| void | scheduleCheck (CheckCause cause, Chunk *chunk) |
| void | log (vmanLogLevel level, const char *format,...) const |
| void | resetStatistics () |
| void | incStatistic (Statistic statistic, int amount=1) |
| void | decStatistic (Statistic statistic, int amount=1) |
| void | minStatistic (Statistic statistic, int value) |
| void | maxStatistic (Statistic statistic, int value) |
| bool | getStatistics (vmanStatistics *statisticsDestination) const |
| tthread::mutex * | getMutex () |
Static Public Member Functions | |
| static void | PanicExit () |
| enum CheckCause |
| Volume | ( | const vmanVolumeParameters * | parameters | ) |
Definition at line 18 of file Volume.cpp.
Here is the call graph for this function:| ~Volume | ( | ) |
| int getChunkEdgeLength | ( | ) | const |
Is thread safe.
Definition at line 207 of file Volume.cpp.
Here is the caller graph for this function:| int getVoxelsPerChunk | ( | ) | const |
Is thread safe.
edgeLength^3 Definition at line 187 of file Volume.cpp.
Here is the caller graph for this function:| int getMaxLayerVoxelSize | ( | ) | const |
Is thread safe.
Definition at line 182 of file Volume.cpp.
Here is the caller graph for this function:| int getLayerCount | ( | ) | const |
Is thread safe.
Definition at line 177 of file Volume.cpp.
Here is the caller graph for this function:| const vmanLayer * getLayer | ( | int | index | ) | const |
Is thread safe.
NULL when something went wrong. (e.g. out of bounds) Definition at line 192 of file Volume.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:| int getLayerIndexByName | ( | const char * | name | ) | const |
Searches for a layer with the given name and returns its index.
Is thread safe.
-1 on failure. Definition at line 199 of file Volume.cpp.
Here is the caller graph for this function:| const char * getBaseDir | ( | ) | const |
Directory where the chunks are stored.
Is thread safe.
NULL if saving to disk has been disabled. Definition at line 212 of file Volume.cpp.
Here is the caller graph for this function:| std::string getChunkFileName | ( | int | chunkX, |
| int | chunkY, | ||
| int | chunkZ | ||
| ) | const |
Generates the file name where a specific chunk could be stored.
Note that if the base dir is NULL the file name will be empty. Is thread safe.
Definition at line 220 of file Volume.cpp.
Here is the caller graph for this function:| void voxelToChunkCoordinates | ( | const int | voxelX, |
| const int | voxelY, | ||
| const int | voxelZ, | ||
| int * | chunkX, | ||
| int * | chunkY, | ||
| int * | chunkZ | ||
| ) |
Converts voxel to chunk coordinates.
Is thread safe.
Definition at line 343 of file Volume.cpp.
Here is the caller graph for this function:| void voxelToChunkSelection | ( | const vmanSelection * | voxelSelection, |
| vmanSelection * | chunkSelection | ||
| ) |
Converts a voxel selection to an chunk selection.
I.e. the chunks that include the given voxels. Is thread safe.
Definition at line 350 of file Volume.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:| void getSelection | ( | const vmanSelection * | chunkSelection, |
| Chunk ** | chunksOut, | ||
| int | priority | ||
| ) |
Get the chunks of the given coordinates.
Creates a chunk if it doesn't exists yet. Chunks that need to be loaded from disk are locked.
| chunksOut | This array must have the size of the chunkSelection. It is filled with the appropriate chunk pointers. Access them with the Index3D() function. |
| chunkSelection | The selection that shall be retrieved. |
| chunksOut | An array where the chunk pointers are copied to. Should obviously have enough space for alle chunks of chunkSelection. |
| priority | Parameter used to sort the resulting io jobs. TODO |
Definition at line 378 of file Volume.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:| void setUnusedChunkTimeout | ( | int | seconds | ) |
Timeout after that unreferenced chunks are unloaded.
Negative values disable this behaviour.
Definition at line 523 of file Volume.cpp.
| int getUnusedChunkTimeout | ( | ) | const |
Timeout after that unreferenced chunks are unloaded.
-1 if disabled. Definition at line 528 of file Volume.cpp.
Here is the caller graph for this function:| void setModifiedChunkTimeout | ( | int | seconds | ) |
Timeout after that modified chunks are saved to disk.
Negative values disable this behaviour.
Definition at line 533 of file Volume.cpp.
| int getModifiedChunkTimeout | ( | ) | const |
Timeout after that modified chunks are saved to disk.
-1 if disabled. Definition at line 538 of file Volume.cpp.
Here is the caller graph for this function:| void saveModifiedChunks | ( | ) |
Writes all modified chunks to disk.
Is a no-op if saving to disk has been disabled.
Definition at line 499 of file Volume.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:| void scheduleCheck | ( | CheckCause | cause, |
| Chunk * | chunk | ||
| ) |
Schedules tasks that will be run in the future.
scheduled_time = now + wait_duration While the duration is defined by the tasks type. E.g. for the CHECK_CAUSE_UNUSED it uses getUnusedChunkTimeout().
Definition at line 543 of file Volume.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:| void log | ( | vmanLogLevel | level, |
| const char * | format, | ||
| ... | |||
| ) | const |
For logging vman specific messages.
Is thread safe.
Definition at line 234 of file Volume.cpp.
Here is the caller graph for this function:| void resetStatistics | ( | ) |
Resets all statistics to zero.
Is thread safe.
Definition at line 285 of file Volume.cpp.
Here is the caller graph for this function:| void incStatistic | ( | Statistic | statistic, |
| int | amount = 1 |
||
| ) |
Increments a statistic.
Is thread safe.
Definition at line 292 of file Volume.cpp.
Here is the caller graph for this function:| void decStatistic | ( | Statistic | statistic, |
| int | amount = 1 |
||
| ) |
| void minStatistic | ( | Statistic | statistic, |
| int | value | ||
| ) |
Sets the value if its greater than the current one.
Is thread safe.
Definition at line 311 of file Volume.cpp.
| void maxStatistic | ( | Statistic | statistic, |
| int | value | ||
| ) |
Sets the value if its lower than the current one.
Is thread safe.
Definition at line 304 of file Volume.cpp.
| bool getStatistics | ( | vmanStatistics * | statisticsDestination | ) | const |
Writes the current statistics to statisticsDestination.
| statisticsDestination | Statistics are written to this structure. |
false even if statistics were enabled. Definition at line 318 of file Volume.cpp.
| tthread::mutex * getMutex | ( | ) |
Use this to lock the object while using methods that aren't thread safe.
Definition at line 801 of file Volume.cpp.
Here is the caller graph for this function:
|
static |
Call this function on abnormal or abprupt program termination.
Definition at line 139 of file Volume.cpp.
Here is the caller graph for this function: