#ifndef VIRTUALTETRAHEDRON_H
#define VIRTUALTETRAHEDRON_H

#include <iostream>
using namespace std;

typedef unsigned int uint;
typedef unsigned int const uintc;

class virtualtetrahedron
{
public:

  // Indexes to points.  The order is important.
  // The first 3 points are seen as clockwise
  // from the perspective of the 4th point.
  uint v[4];

  virtualtetrahedron();

  // Each of the tetrahedrons verticies refers to a point. 
  void set(uintc a, uintc b, uintc c, uintc d)
    { v[0]=a; v[1]=b; v[2]=c; v[3]=d; }

  // v[0..2] anticlockwise, v[3]=base
  void set(uintc base);

  // Rotate the base triangle.
  void clockwise();
  
  // Rotate the base triangle.
  void anticlockwise();

  // Move the base triangle on tetrahedron surface.
  void left();

  // Move the base triangle on tetrahedron surface.
  void right();

  // Move the base triangle on tetrahedron surface. 
  void down();

  // v[] has 0,1,2,3 in any order.
  bool const validstate() const;

};

ostream & operator << (ostream& os, virtualtetrahedron const & x);

#endif


