Voxvision
1
Creating and manipulating voxel octrees
|
Data reader(s) More...
#include "params.h"
Go to the source code of this file.
Functions | |
VOX_EXPORT struct vox_node * | vox_read_raw_data (const char *filename, unsigned int dim[], unsigned int samplesize, int(^test)(unsigned int sample), const char **error) |
Build a tree from raw density file. More... | |
VOX_EXPORT int | vox_find_data_file (const char *filename, char *fullpath) |
Find a full path of a data file. More... | |
Data reader(s)
VOX_EXPORT int vox_find_data_file | ( | const char * | filename, |
char * | fullpath | ||
) |
Find a full path of a data file.
This function searches for a file in usual locations where data files can be stored. These locations include system-wide voxvision data directory ($INSTALL_PREFIX/share/voxvision/data), user-specific data directory (~/.voxvision) or a directory specified in VOXVISION_DATA environment variable.
filename | a name of the desired file. |
fullpath | a string where result will be stored in case of success. |
VOX_EXPORT struct vox_node* vox_read_raw_data | ( | const char * | filename, |
unsigned int | dim[], | ||
unsigned int | samplesize, | ||
int(^)(unsigned int sample) | test, | ||
const char ** | error | ||
) |
Build a tree from raw density file.
This type of files are common on the internet. It defines a set of voxels as a 3-dimensional array of dim[0] X dim[1] X dim[2] samples. These samples specify density of the material at that point in the space. As voxvision does not understand density (there can be a voxel at this point, or it can not), test function is introduced to determine when we must consider this sample as a solid voxel or not. The datafile's size must be exactly dim[0]*dim[1]*dim[2]*samplesize bytes.
FIXME: The array of samples is stored on disk in row-major order.
filename | a name of data file. |
dim | array dimensions. |
samplesize | size of a sample in bytes |
test | a block which is called with sample value as its argument. It must return non-zero if this voxels is considered solid or 0 otherwise. |
error | pointer to error string. |