/*
 * scenenode.h
 * base class for scenegraph nodes
 *
 */

#ifndef SCENENODE_H_
#define SCENENODE_H_

#include <vector>
#include "glm/glm.hpp"

using namespace std;

// enum to denote the shader used to render a node
// non-renderable nodes (e.g., transformation) get SH_NONE
enum shader_type {SH_NONE, SH_MINIMAL, SH_SMOOTH, SH_TOON, SH_TEXTURE, SH_PARTICLE, SH_SNOW, SH_NORMTEXTURE, SH_TERRAIN};

class scene_node {

private:

protected:
	int _shader_type;

public:
	//members
	glm::mat4 transformation_matrix;
	vector< scene_node* > children;

	//functions
	scene_node() { _shader_type = SH_NONE; transformation_matrix = glm::mat4(1.0f); }
	virtual ~scene_node() {}
	//prepare for rendering
	virtual void pre_render() {}
	//get the normal information set up
	virtual void pre_normal() {}
	//render the object associated with the node
	virtual void render() {}
	//do stuff after rendering
	virtual void post_render() {}
	//access shader type (cannot be changed in base scenenode)
	int shader_type() { return _shader_type; }
	//add a child node
	virtual void add_child(scene_node& s) {
		children.push_back(&s);
	}
	//dimension of the node, used for bounding sphere
	//returns (0,0,0) for non-draw nodes
	virtual glm::vec3 get_dimension() const {return glm::vec3(0.0f);}

};


#endif /* SCENENODE_H_ */
