/*
 * Pascal - a program to draw Pascal's simplices
 * Copyright (C) 2005 Nicolas Bellm
 *
 * 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.
 *
 */

#include <vector>

using namespace std;

class Triangle
{
  public:
    Triangle() {}
    Triangle(int size) { resize(size); }
    void resize(int size);
    void draw(int space);
    int size() { return m_size; }
    vector<int>& operator[](int i) { return m_triangle[i]; }

  private:
    void center(int c);
    int m_size;
    vector<vector<int> > m_triangle;
};

class Tetrahedron
{
  public:
    Tetrahedron() {}
    Tetrahedron(int size) { resize(size); }
    void resize(int size);
    void draw(int space);
    int size() { return m_size; }  
    Triangle& operator[](int i) { return m_tetrahedron[i]; }

  private:
    int m_size;
    vector<Triangle> m_tetrahedron;
};

class Pentatope
{
  public:
    Pentatope() {}
    Pentatope(int size) { resize(size); }
    void resize(int size);
    void draw();
    int size() { return m_size; }  
    Tetrahedron& operator[](int i) { return m_pentatope[i]; }

  private:
    int m_size;
    vector<Tetrahedron> m_pentatope;
};

class PTriangle : public Triangle
{
  public:
    PTriangle() {}
    PTriangle(int size) : Triangle(size) { calc(); }
    void resize(int size) { Triangle::resize(size); calc(); }

  private:
    void calc();
};

class PTetrahedron : public Tetrahedron
{
  public:
    PTetrahedron() {}
    PTetrahedron(int size) : Tetrahedron(size) { calc(); }
    void resize(int size) { Tetrahedron::resize(size); calc(); }

  private:
    void calc();
};

class PPentatope : public Pentatope
{
  public:
    PPentatope() {}
    PPentatope(int size) : Pentatope(size) { calc(); }
    void resize(int size) { Pentatope::resize(size); calc(); }

  private:
    void calc();
};

