/* 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 #include "math/vector3f.h" #include "math/color.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 Triangles; /// type definition for a list of quads typedef std::list 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(math::Vector3f const &v0, math::Vector3f const &v1, math::Vector3f const &v2, math::Vector3f const &normal, math::Color const &color, bool detail); /// add a Quad primitive void add_quad(math::Vector3f const &v0, math::Vector3f const &v1, math::Vector3f const &v2, math::Vector3f const &v3, math::Vector3f const &normal, math::Color const &color, bool detail); private: Triangles primitives_triangles; Quads primitives_quads; Material * primitives_material; }; } #endif