bloboland
view src/volume.h @ 1:cfe68befb7cc
some progress
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Sat, 15 Dec 2012 23:43:03 +0200 |
parents | |
children |
line source
1 #ifndef VOLUME_H_
2 #define VOLUME_H_
4 #include "vmath/vmath.h"
6 class Volume {
7 private:
8 int xsz, ysz, zsz;
9 int slice_size;
10 Vector4 *voxels;
12 Vector4 **slices;
14 public:
15 inline Volume(int xsz, int ysz, int zsz);
16 inline ~Volume();
18 inline int get_size(int idx = -1) const;
20 // access to the voxel data based on voxel coordinates
21 inline void set_voxel(int x, int y, int z, const Vector4 &val);
22 inline void set_voxel_color(int x, int y, int z, const Vector3 &col);
23 inline void set_voxel_alpha(int x, int y, int z, float alpha);
25 inline const Vector4 &get_voxel(int x, int y, int z) const;
26 inline const Vector3 get_voxel_color(int x, int y, int z) const;
27 inline float get_voxel_alpha(int x, int y, int z) const;
29 // linear access to the voxel data
30 inline Vector4 &operator [](int idx);
31 inline const Vector4 &operator [](int idx) const;
33 // raw access to the voxel data for building the OpenGL texture directly
34 inline const Vector4 *get_data_ptr() const;
35 };
37 #include "volume.inl"
39 #endif // VOLUME_H_