#ifndef PROJECT_VOLUMES_H
#define PROJECT_VOLUMES_H

#include "math_vector3D.h"

enum {VGEN_EMPTY, VGEN_PLASMA, VGEN_SPHERE};
enum {VRND_OPENCL};

#define default_width 128
#define default_height 128
#define default_depth 128

#define default_iso_depth 128

void ClearBorders(int width, int height, int depth, unsigned char *voldata);

class Cvolume
{
public:
	Cvolume(int width = default_width, int height = default_height, int depth = default_depth);
	~Cvolume();

	int GetWidth();
	int GetHeight();
	int GetDepth();

	unsigned char* GetDataPointer();

	int GetIsoDepth();
	void SetIsoDepth(int iso_depth);

	void GenVolume(int way);
	void LoadVolume(char *filename);
	void RenderVolume(int way, Cvector pos, Cvector dir, Cvector up, Cvector right);

protected:
	int width;
	int height;
	int depth;

	int iso_depth;

	unsigned char *data;

	void ZeroMemory();

	void GenVolumePlasma();
	void GenVolumeSphere();

	void RenderVolumeOpenCL(Cvector pos, Cvector dir, Cvector up, Cvector right);

	void FadeByDistanceFromCenter(float radius);
};

#endif
