/* model/primitives.cc This file is part of the Osirion project and is distributed under the terms of the GNU General Public License version 2 */ #include "model/primitives.h" namespace model { Primitives::Primitives(Material *material) { primitives_material = material; } Primitives::~Primitives() { // clear list of triangles for (std::list::iterator tris_it = primitives_triangles.begin(); tris_it != primitives_triangles.end(); tris_it++) delete(*tris_it); primitives_triangles.clear(); // clear list of quads for (std::list::iterator quad_it = primitives_quads.begin(); quad_it != primitives_quads.end(); quad_it++) delete(*quad_it); primitives_quads.clear(); } void Primitives::add_triangle(math::Vector3f const &v0, math::Vector3f const &v1, math::Vector3f const &v2, math::Vector3f const &normal, math::Color const &color, bool detail) { Triangle *triangle = new Triangle(v0, v1, v2, normal, color, detail); primitives_triangles.push_back(triangle); } void Primitives::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) { Quad *quad = new Quad(v0, v1, v2, v3, normal, color, detail); primitives_quads.push_back(quad); } }