/*
    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 GEOMETRY_VERTEX_H
#define GEOMETRY_VERTEX_H
//---------------------------------------------------------------------------



#include "mesh_const.h"

#ifdef USE_HASH_TABLE
#include <hash_set>
#endif

#include <list>
#include <set>

#include "vertex_base.h"
#include "comparators.h"

using namespace std;

/// class used to store geometry nodes
template<int dimspace> class Geometry_Vertex : public Vertex_Base<dimspace>
{


public :

/// containers types
  typedef list<Geometry_Vertex<dimspace> > Container_Type;
///
  typedef typename Container_Type::iterator Iterator;

/// classification types
#ifndef USE_HASH_TABLE
///
  typedef set<Iterator,Less_Ptr_Type<Iterator> > Classification_Type;
#endif

#ifdef USE_HASH_TABLE
///
  typedef hash_set<Iterator,Hash_Ptr_Type<Iterator>,Equ_Ptr_Type<Iterator> > Classification_Type;
#endif

///
  typedef typename Classification_Type::iterator Classification_Iterator;


protected:
/// back pointer to classification (fast delete)
  Classification_Iterator I;


public:

/// sets classification iterator
  void Set_Classification_Iterator ( Classification_Iterator It )
  {
    I=It;
  }

/// gets classification iterator
  Classification_Iterator Get_Classification_Iterator() const
  {
    return I;
  }

/// constructor (initializes the vertex to zero)
  Geometry_Vertex ( void )
  {
    for ( int i=0; i<dimspace; ++i )
    {
      this->coord[i]=0;
    }
  }

/// constructor (initializes the coordinates to the value passed by an array)
  Geometry_Vertex ( double xx[] )
  {
    for ( int i=0; i<dimspace; ++i )
    {
      this->coord[i]=xx[i];
    }
  }

};

#endif // GEOMETRY_VERTEX_H

 
