nuclear@1: #ifndef VOLUME_H_ nuclear@1: #define VOLUME_H_ nuclear@1: nuclear@1: #include "vmath/vmath.h" nuclear@1: nuclear@1: class Volume { nuclear@1: private: nuclear@1: int xsz, ysz, zsz; nuclear@1: int slice_size; nuclear@1: Vector4 *voxels; nuclear@1: nuclear@1: Vector4 **slices; nuclear@1: nuclear@1: public: nuclear@1: inline Volume(int xsz, int ysz, int zsz); nuclear@1: inline ~Volume(); nuclear@1: nuclear@1: inline int get_size(int idx = -1) const; nuclear@1: nuclear@1: // access to the voxel data based on voxel coordinates nuclear@1: inline void set_voxel(int x, int y, int z, const Vector4 &val); nuclear@1: inline void set_voxel_color(int x, int y, int z, const Vector3 &col); nuclear@1: inline void set_voxel_alpha(int x, int y, int z, float alpha); nuclear@1: nuclear@1: inline const Vector4 &get_voxel(int x, int y, int z) const; nuclear@1: inline const Vector3 get_voxel_color(int x, int y, int z) const; nuclear@1: inline float get_voxel_alpha(int x, int y, int z) const; nuclear@1: nuclear@1: // linear access to the voxel data nuclear@1: inline Vector4 &operator [](int idx); nuclear@1: inline const Vector4 &operator [](int idx) const; nuclear@1: nuclear@1: // raw access to the voxel data for building the OpenGL texture directly nuclear@1: inline const Vector4 *get_data_ptr() const; nuclear@1: }; nuclear@1: nuclear@1: #include "volume.inl" nuclear@1: nuclear@1: #endif // VOLUME_H_