/* $Id: triangA.h,v 1.1.1.1 1996/10/02 10:35:55 roitzsch Exp $ */

#ifndef TRIANGA_H
#define TRIANGA_H

#include "triang.h"

#include "dlist.h"
#include "stack.h"
#include "matrix.h"

class Timer;
class Parser;


//-------------------------------------------------------------------------
//------------------------   1D objects  ---------------------------------


class EDG : public PATCH			// abstract base class for edges 
{
  public:

    virtual Bool equal(const EDG& line) const;
    virtual void print(ostream& os) const;

    virtual int noOfPoints() const { return 2; }
    virtual int noOfEdges()  const { return 1; }
    virtual int noOfNeighbours() const  { return 2; }

    Real volume() const;
    Real lengthSqr() const;

    virtual void centerOfGravity(Vector<Real>& xG) const;

  protected:

    virtual void notImplemented(const char* s) const;
    friend ostream& operator << (ostream& os, const EDG& ed);
    friend Bool	    operator == (const EDG& ed1, const EDG& ed2);
};
//-------------------------------------------------------------------------


class TR : public PATCH			// abstract base class for triangles
{
  public:

    virtual int spaceDim() const = 0;
    virtual int Class() const = 0;

    virtual int noOfPoints() const { return 3; }
    virtual int noOfEdges()  const { return 3; }
    virtual int noOfNeighbours() const { return 3; }

    virtual void centerOfGravity(Vector<Real>& xG) const;

    virtual Bool equal(const TR& tr)  const;
    virtual void print(ostream& os) const;

  protected:

    virtual void notImplemented(const char* s) const;

    friend ostream& operator << (ostream& os, const TR& t);
    friend Bool     operator == (const TR& t1, const TR& t2);
};
//-------------------------------------------------------------------------


class TET : public PATCH	     	// abstract base class for tetrahedra
{
  public:

    virtual int spaceDim() const = 0;
    virtual int Class() const = 0;

    virtual int noOfPoints() const { return 4; }
    virtual int noOfEdges()  const { return 6; }
    virtual int noOfFaces()  const { return 4; }
    virtual int noOfNeighbours() const { return 4; }

    virtual void centerOfGravity(Vector<Real>& xG) const;
    virtual Bool equal(const TET& t)  const;
    virtual void print(ostream& os) const;

  protected:

    friend ostream& operator << (ostream& os, const TET& t);
    friend Bool     operator == (const TET& t1, const TET& t2);
};
//-------------------------------------------------------------------------
	
#endif

