/*
    C++ Mesh Generation Library
    Copyright (c) 2000echet <eric at bechet dot ca>

    This file is part of the C++ Mesh Generation Library.

    See the NOTICE & LICENSE files for conditions.
*/

//---------------------------------------------------------------------------
#ifndef ENTITY_H
#define ENTITY_H
//---------------------------------------------------------------------------


#include "mesh_const.h"



/** Entity base class. It is used as a common base class for all entities.
Its only purposes is automatic numbering and to keep track on boundary conditions info. */
class Entity
{
///ID of the entity
  unsigned long ID;
///boundary condition info
  int b_condition;
///current ID for uniqueness
  static unsigned long MAX_ID;

public :

///static to reset the automated ID counter (common to all classes)
  static void Reset_ID_counter ( unsigned long ID )
  {
    MAX_ID=ID;
  }

///constructor initialize the ID and b_condition
  Entity ( void )
  {
    ID=0;
    b_condition=0;
  }

///gets the BC info
  int boundary_condition ( void ) const
  {
    return b_condition;
  }

///sets the BC info
  void set_boundary_condition ( int bc )
  {
    b_condition=bc;
  }

///returns the actual ID
  unsigned long GetID ( void ) const
  {
    return ID;
  }

///sets a USER ID to the entity
  void SetID ( unsigned long I )
  {
    ID=I;
  }

///sets a UNIQUE ID to the entity
  unsigned long SetUniqueID ( void )
  {
    ID=MAX_ID++;
    return ID;
  }

};



#endif  // ENTITY_H

 
