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


#include "mesh_const.h"

#include <list>

#include "geometry_vertex.h"
#include "simplex.h"
//#include "simple_mesh.h"

using namespace std;


template<int nbn,int dim,class Element_Type> class Simple_Mesh;


/** class used to hold a geometry
 typically, dim_geometry=1 or 2, and dim_space = 2 or 3 ...*/
template<int dim_geometry,int dim_space> class Geometry

{

public:

/// associated types
  typedef Geometry_Vertex<dim_space> Vertex_Type;
///
  typedef Simplex<dim_geometry+1,dim_space,Vertex<dim_space> > Element_Type;

  /** tesselates the geometry (uses simplexes to cover it "at any price")
  this is used as a starting point for mesh generation */
  virtual void Tessellate ( Simple_Mesh<dim_geometry+1,dim_space,Element_Type>& M ) =0;

  /** projects a node "V" on the geometry
   the projected node is VP, the direction is dir,
  Hint is a list of patches that could possibly contain the node (can be empty),
  dist_max is the maximum distance of the projection. Distance is the actual one.*/
  virtual Geometry_Patch<dim_space,Vertex_Type>* Project_Point_On_Geometry ( const Vertex_Type &V,Vertex_Type &VP,Vector &dir,list<Geometry_Patch<dim_space,Vertex_Type>*> Hint,double dist_max, double& distance ) =0;
};

#endif // GEOMETRY_H

 
