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

#ifndef TRIANG2TR_H
#define TRIANG2TR_H

#include "triang2.h"

//-------------------------------------------------------------------------


class TR2TR : public TR2
{
  public:

    PATCH* partner;

    TR2TR() { partner = 0; }
    virtual void reset() { partner = 0; TR2::reset(); }

    virtual PATCH* Partner() const { return partner; }
    virtual void setPartner(PATCH* pt) { partner = pt; }
};
//-------------------------------------------------------------------------


class MESH2Trans : public MESH2
{
  public:

    MESH2Trans(const char* inFileName, MESH2* prevMesh);

    virtual const PATCH* findPatch(const Vector<Real>& x, Vector<Real>& xUnit,
				   const PATCH* newPatch) const;
    virtual void Refine();
    
  protected:

    MESH2* prevMesh;

    Allocator<TR2TR> trTrAlloc;

    virtual TR2* getTR2() 	    { return trTrAlloc.Get(); }
    virtual void returnTR2(TR2* tr) { trTrAlloc.Return((TR2TR*) tr); }
};

#endif


