glviewvol

diff src/renderer.cc @ 6:f22be47a3572

moved to TransferFuncs completely
author John Tsiombikas <nuclear@member.fsf.org>
date Tue, 30 Dec 2014 06:22:54 +0200
parents 5417c25cb238
children 89efc666105c
line diff
     1.1 --- a/src/renderer.cc	Mon Dec 29 15:59:55 2014 +0200
     1.2 +++ b/src/renderer.cc	Tue Dec 30 06:22:54 2014 +0200
     1.3 @@ -7,14 +7,6 @@
     1.4  	view_width = 512;
     1.5  	view_height = 512;
     1.6  
     1.7 -	for(int i=0; i<3; i++) {
     1.8 -		xfer[i].set_point(0, 0);
     1.9 -		xfer[i].set_point(1, 1);
    1.10 -	}
    1.11 -
    1.12 -	xfer_low = 0.0;
    1.13 -	xfer_high = 1.0;
    1.14 -
    1.15  	for(int i=0; i<MAX_CLIP_PLANES; i++) {
    1.16  		disable_clipping_plane(i);
    1.17  	}
    1.18 @@ -44,26 +36,14 @@
    1.19  	return vol;
    1.20  }
    1.21  
    1.22 -Curve &Renderer::transfer_curve(int color)
    1.23 +void Renderer::set_transfer_function(TransferFunc *xfer)
    1.24  {
    1.25 -	return xfer[color];
    1.26 +	this->xfer = xfer;
    1.27  }
    1.28  
    1.29 -const Curve &Renderer::transfer_curve(int color) const
    1.30 +TransferFunc *Renderer::get_transfer_function() const
    1.31  {
    1.32 -	return xfer[color];
    1.33 -}
    1.34 -
    1.35 -void Renderer::set_simple_transfer(float low, float high)
    1.36 -{
    1.37 -	xfer_low = std::min(low, high);
    1.38 -	xfer_high = std::max(low, high);
    1.39 -}
    1.40 -
    1.41 -void Renderer::get_simple_transfer(float *low, float *high) const
    1.42 -{
    1.43 -	*low = xfer_low;
    1.44 -	*high = xfer_high;
    1.45 +	return xfer;
    1.46  }
    1.47  
    1.48  void Renderer::set_clipping_plane(int idx, float nx, float ny, float nz, float dist)