vpResult
int
If you have declared the layout of a voxel using a C structure then you can use the sizeof operator and the vpFieldOffset macro to compute the field sizes and offsets. vpFieldOffset returns the number of bytes from the beginning of a C structure to the beginning of a particular field in the structure. For example, the following code shows how to declare the size and offset for one voxel field:
struct voxel {
char field0;
char field1;
short field2;
} *dummy_voxel;
#define SIZE_0 sizeof(char)
#define OFFSET_0 vpFieldOffset(dummy_voxel, field0)
#define MAX_0 127
vpSetVoxelField(vpc, 0, SIZE_0, OFFSET_0, MAX_0);