#ifndef CPSPHERE_H
#define CPSPHERE_H

#include <vector>
using namespace std;

#include <gobj.h>
#include <point.h>
#include <typedefs.h>

/*!
\brief Current pointer to a tetrahedron as a sphere through its points.
*/
class cpsphere
{
public:

  /** The array of points. */
  vector< point3<double> > const & pts;
  /** Represent a tetrahedron as 4 indexes to the array of points. */
  vector< point4<uint> > const & vi;

  /** The graphics. */
  gobjContainer * current;

  /** The state indexes into vi. */
  uint state;
  /** The current state is incremented and the 
      graphics is updated.  */
  void stateinc();
  /** The current state is decremented and the 
     graphics is updated.  */
  void statedec();

  /** Initialize this classes data structures with conditions
      such that the points and indexed tet vectors must exist. */ 
  cpsphere
  (
    vector< point3<double> > const & pts_,
    vector< point4<uint> > const & vi_
  );

  /** Memory cleanup. */
  ~cpsphere();

  /** The current graphics are re-written so that a sphere through
      the current tet's 4 points is drawn. */ 
  void update();

};

#endif



