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