/* This file is part of the Neper software package. */
/* Copyright (C) 2003-2014, Romain Quey. */
/* See the COPYING file in the top-level directory. */

#include"net_flatten_face_.h"

void
net_flatten_face (struct MTESS MTess, struct TESS *Tess,
		  struct TESS *pFTess, struct TESSE **pTessE,
		  struct FLATTEN *pFlatten)
{
  int i;

  (*pFTess).FaceQty = 0;

  for (i = 1; i <= MTess.TessQty; i++)
  {
    (*pTessE)[i].FaceFFaceQty = ut_alloc_1d_int (Tess[i].FaceQty + 1);
    (*pTessE)[i].FaceFFaceNb = ut_alloc_1d_pint (Tess[i].FaceQty + 1);
    (*pTessE)[i].FaceFFaceOri = ut_alloc_1d_pint (Tess[i].FaceQty + 1);
  }

  net_flatten_face_body (MTess, Tess, pFTess, pTessE, pFlatten);

  net_flatten_face_domface (MTess, Tess, pFTess, pTessE, pFlatten);

  neut_tess_init_edgeface (pFTess);

  return;
}
