bloboland

view src/volume.h @ 4:9021a906c5d3

lots of stuff
author John Tsiombikas <nuclear@member.fsf.org>
date Tue, 18 Dec 2012 06:13:09 +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_