glviewvol

view src/renderer.h @ 5:5417c25cb238

moving to a simpler transfer function
author John Tsiombikas <nuclear@member.fsf.org>
date Mon, 29 Dec 2014 15:59:55 +0200
parents 04330eb80b36
children f22be47a3572
line source
1 #ifndef RENDERER_H_
2 #define RENDERER_H_
4 #include "volume.h"
5 #include "curve.h"
7 #define MAX_CLIP_PLANES 4
9 class Renderer {
10 protected:
11 int view_width, view_height;
12 Volume *vol;
14 float clip_plane[MAX_CLIP_PLANES][4]; // nx,ny,nz,dist
16 Curve xfer[3]; // rgb transfer function
17 float xfer_low, xfer_high; // simple transfer function bounds
19 public:
20 Renderer();
21 virtual ~Renderer();
23 virtual bool init();
24 virtual void destroy();
26 virtual void set_volume(Volume *vol);
27 virtual Volume *get_volume() const;
29 virtual Curve &transfer_curve(int color);
30 virtual const Curve &transfer_curve(int color) const;
32 virtual void set_simple_transfer(float low, float high);
33 virtual void get_simple_transfer(float *low, float *high) const;
35 virtual void set_clipping_plane(int idx, float nx, float ny, float nz, float dist);
36 virtual void disable_clipping_plane(int idx);
38 virtual void reshape(int x, int y);
40 virtual void update(unsigned int msec);
41 virtual void render() const = 0;
42 };
44 #endif // RENDERER_H_