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

#include "MVertex.h"
#include <iostream>
using namespace std;
namespace FM
{
  class gmshElement;

  class gmshNode
  {
  public:
    gmshNode ( MVertex*v ) :gmshv ( v ) {}
    gmshNode() :gmshv ( ( MVertex* ) 0 ) {}

    virtual void GetPos ( double& x,double &y,double &z ) const
    {
      x=gmshv->point() [ 0 ];
      y=gmshv->point() [ 1 ];
      z=gmshv->point() [ 2 ];
    }

    virtual void Print ( void )
    {
//      gmshv->print();
    }

    virtual bool operator < ( const gmshNode& other ) const
    {
      return ( ( void* ) gmshv < ( void* ) other.gmshv );
    }

    virtual bool operator == ( const gmshNode& other ) const
    {
      return ( ( void* ) gmshv == ( void* ) other.gmshv );
    }

    MVertex* GetVertex ( void ) const
    {
      return gmshv;
    }

    virtual void GetNeighbors ( int dim,vector<gmshElement> &tab ) const;

  private :
    MVertex *gmshv;
  };

}
#endif //FM_gmshNODE_H
 
