#ifndef BLOCK_H

#define BLOCK_H


#include <ads/adsinc.h>

#include <ads/algebra3.h>

#include <ads/adsstrng.h>


class block : public ADS_ENT_OBJ
{
protected:
  ads_name entname;
  ADS_STRING _handle;
  ADS_STRING _name;
  vec3 center;

public:
  block( struct resbuf *_rb );
  block() : ADS_ENT_OBJ(NULL){};
  vec3 origin() const {return center;};
  ADS_STRING name() const
    {return _name;}
  ADS_STRING handle() const
    {return _handle;}
  operator == (const block &b)
    { return (entname[0] == b.entname[0]); }

private:
    BASIC_CPP_STUFF( block )
};


class cblock 
{
  ADS_STRING _handle;
  ADS_STRING _name;
  vec3 center;

public:
  cblock(block &b)
    {
      center = b.origin();
      _handle = b.handle();
      _name = b.name();
    }
  cblock(){};
  cblock & operator = (const cblock &b)
    {
      _handle = b._handle;
      _name = b._name;
      center = b.center;
      return *this;
   }
  operator == (const cblock &b)
    { return _handle == b._handle; }

  vec3 origin() const {return center;};
  ADS_STRING name() const
    {return _name;}
  ADS_STRING handle() const
    {return _handle;}

};

#endif // BLOCK_H




syntax highlighted by Code2HTML, v. 0.9.1