volmetrics

view src/volume.h @ 6:e6485ef45e6e

visualize volume
author Eleni Maria Stea <elene.mst@gmail.com>
date Sat, 18 Jan 2014 01:57:52 +0200
parents 92c163c939be
children 928954bfefd7
line source
1 #ifndef VOLUME_H_
2 #define VOLUME_H_
4 #include <vector>
5 #include "image.h"
7 class Volume {
8 private:
9 std::vector<Image> slices;
11 int width;
12 int height;
13 float zaspect;
15 unsigned int vol_tex;
16 mutable bool vol_tex_valid;
18 void create_vol_tex() const;
20 public:
21 Volume();
22 ~Volume();
24 bool load(const char *fname);
26 bool push_slice(Image &&slice);
27 const Image *get_slice(int num_slice) const;
28 const Image *get_slice_by_z(float z) const;
29 int get_slice_count() const;
31 int get_slice_idx_by_z(float z) const;
33 unsigned int get_texture() const;
35 void draw();
36 };
38 #endif // VOLUME_H_