volmetrics
view src/volume.h @ 13:77a376198d38
foo
author | Eleni Maria Stea <elene.mst@gmail.com> |
---|---|
date | Sun, 02 Feb 2014 02:32:00 +0200 |
parents | 40febfed6cff |
children | add30e2d5253 |
line source
1 #ifndef VOLUME_H_
2 #define VOLUME_H_
4 #include <vector>
5 #include "image.h"
7 class Mesh;
9 class Volume {
10 private:
11 std::vector<Image> slices;
13 int width;
14 int height;
15 float zaspect;
17 unsigned int vol_tex;
18 mutable bool vol_tex_valid;
20 void create_vol_tex() const;
22 public:
23 Volume();
24 ~Volume();
26 bool load(const char *fname);
28 bool push_slice(Image &&slice);
29 const Image *get_slice(int num_slice) const;
31 // z must be in [0, 1]
32 const Image *get_slice_by_z(float z) const;
34 int get_slice_count() const;
36 // z must be in [0, 1]
37 int get_slice_idx_by_z(float z) const;
39 unsigned int get_texture() const;
41 void create_mesh(Mesh *mesh, float tmin, float tmax, int xres, int yres, int zres);
43 void draw() const;
44 };
46 #endif // VOLUME_H_