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



#include "mesh_const.h"

#include "entity.h"
#include "linear_algebra.h"


/** abstract class used to store a geometry patch (of any kind). Cannot be instantiated.
 base class for derivations */
template<int dim,class V> class Geometry_Patch : public Entity
{
public:

///
  typedef V Vertex_Type;

/// adds a connected patch (neighbor)
  virtual void Add_Connected_Geometry_Patch ( Geometry_Patch<dim,Vertex_Type>* E ) =0;
/// gets the number of connected patches
  virtual int Get_Number_Connected_Geometry_Patch() const =0;
/// get the connected patches onto an user allocated array
  virtual void Get_Connected_Geometry_Patch ( Geometry_Patch<dim,Vertex_Type> *EE[] ) const =0;
/// get then normal of the surface if possible , and locaton given by the node Vertex
  virtual void Get_Normal ( V &Vertex,Vector &T ) const =0;

  /** project a node Vin on the surface. Vp is the resulting node, dir is the vector for the projection
   returns true if it can be done (is on the patch)*/
  virtual bool Project_Point ( const Vertex_Type &Vin,Vertex_Type &VP,Vector &dir,double &t ) const =0;
};

#endif // GEOMETRY_PATCH_H

 
