/*
   model/primitives.h
   This file is part of the Osirion project and is distributed under
   the terms of the GNU General Public License version 2
*/

#ifndef __INCLUDED_MODEL_PRIMITIVES_H__
#define __INCLUDED_MODEL_PRIMITIVES_H__

#include <list>

#include "math/vector3f.h"
#include "model/material.h"
#include "model/triangle.h"
#include "model/quad.h"

namespace model
{

/// a list of Triangle and Quad primitives with the same material, to be parsed into fragments
class Primitives
{
public:
	/// type definition for a list of triangles
	typedef std::list<Triangle *> Triangles;

	/// type definition for a list of quads
	typedef std::list<Quad *> Quads;

	Primitives(Material *material);
	~Primitives();

	/// the material to be used for these primitives
	inline const Material *material() const {
		return primitives_material;
	}

	/// list of triangles
	inline Triangles & triangles() {
		return primitives_triangles;
	}

	/// list of quads
	inline Quads & quads() {
		return primitives_quads;
	}

	/// add a Triangle primitive
	void add_triangle(Triangle *triangle);

	/// add a Quad primitive
	void add_quad(Quad *quad);

private:
	Triangles		primitives_triangles;
	Quads			primitives_quads;

	Material *		primitives_material;
};

}
#endif