/** * \file polyeder.h * * \brief Ein Polyeder (eine gruppe von Polygonen) * * Ein Polyeder organisier die Vertexliste und Anordnung von Polygonen * die zu einem Körper gehören. * * \author Georg Steffers [gs] * * \date 19.12.2003 * * \version ..2002 [gs]: erste Implementation * \version 19.12.2003 [gs]: */ /* * Copyright (C)2003 Georg Steffers * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef __polyeder_h__ #define __polyeder_h__ #include "../helper/container.h" #include "../math/Mmn.h" #include "polygon.h" #include "vertex.h" #include "movable.h" class polyeder : public container { public: vertex_list vl; public: polyeder() : container() {} polyeder(const polygon&, const vertex_list&); polyeder(const polygon*, unsigned, const vertex_list&); polyeder(const polyeder&); ~polyeder() {} const polyeder& operator=(const polyeder&); const polygon& operator[](unsigned index) const { return content[index]; } polygon& operator[](unsigned index) { return content[index]; } virtual void transform(const Mmn&, int=0); virtual void transform_normals(const Mmn&, int=0); void trans_poly(unsigned, const Mmn&, int=0); virtual void reset(void); /** * \param lcx (lens coverage(x)) = Sichtfeld(x) * \param sw (screen width) = Breite des Projektionsfensters * \param sh (screen height) = Hoehe des Projektionsfensters * \param ph_ar (physical aspect ratio) = Seitenverhaeltnis des * Anzeigegeraets * \param sy (scale y) = Wenn Anzeigegeraet und Projektionfenster die * selbe Groesse haben 1, ansonsten der Wert um y proportional * zu x zu projezieren. * \param p Transformationsstufe */ void project_2d(double lcx, double sw, double sh, double ph_ar, double sy=1, int p=0); }; class polyeder_movable : public polyeder, public movable { public: polyeder_movable() : polyeder(), movable() {} polyeder_movable(const polygon& p, const vertex_list& vl) : polyeder(p, vl) {} polyeder_movable(const polygon* p, unsigned c, const vertex_list& vl) : polyeder(p, c, vl) {} polyeder_movable(const polyeder& p) : polyeder(p) {} void transform(int transstage) { polyeder::transform(t_mat, transstage); movable::transform(transstage); } void transform_normals(int p) { polyeder::transform_normals(t_mat, p); } void reset(void) { polyeder::reset(); movable::reset(); } }; #endif