#ifndef __OBJECT_H__
#define __OBJECT_H__

#include <set>
#include <string>
#include <fstream>

class object
{
 public:
  object();
  ~object();
  int clear();
  int addpixel( int x, int y, int z );
  //  int delpixel( int x, int y, int z );
  int count( int x, int y, int z );
  int expand();
  int errode();

  int xmlprint( std::string file );

  int size()
  {
    return pointset.size();
  }

 private:
  struct point3d
  {
    int x, y, z;
    bool operator()( point3d a, point3d b ) const
    {
      if( a.x < b.x )
        return true;
      else if( a.x > b.x )
        return false;
      else
        {
          if( a.y < b.y )
            return true;
          else if( a.y > b.y )
            return false;
          else
            {
              if( a.z < b.z )
                return true;
              else
                return false;
            }
        }
      return false;
    }
  };

  std::set< point3d, point3d > pointset;
};

#endif
