volmetrics

view src/volume.h @ 9:40febfed6cff

rendering isosurfaces / added simple gui
author Eleni Maria Stea <elene.mst@gmail.com>
date Sun, 26 Jan 2014 23:13:37 +0200
parents 928954bfefd7
children 1272e3335608
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 threshold);
43 void draw() const;
44 };
46 #endif // VOLUME_H_