//#####################################################################
// Copyright 2003-2005, Neil Molino, Andrew Selle, Michael Turitzin.
// This file is part of PhysBAM whose distribution is governed by the license contained in the accompanying file PHYSBAM_COPYRIGHT.txt.
//#####################################################################
#include <Core/Meshes/TETRAHEDRALIZED_VOLUME.h>
#include <Core/Meshes/TRIANGULATED_SURFACE.h>
#include <Core/Read_Write/FILE_UTILITIES.h>
#include <cstring>
#include <fstream>
using namespace PhysBAM;
using namespace std;

//#################################################################
// Function main
//#################################################################
int main(int argc,char *argv[])
{
    TETRAHEDRALIZED_VOLUME<float> tet_vol;
    Read_From_File(argv[1],tet_vol);
    std::cout<<"tet_vol.particles.number="<<tet_vol.particles.Size()<<std::endl;
    std::cout<<"tet_vol.mesh.elements.m="<<tet_vol.mesh.elements.m<<std::endl;
    tet_vol.Update_Bounding_Box();
    std::cout<<"bounding_box size:"<<tet_vol.bounding_box->Size()<<std::endl;
    tet_vol.Initialize_Triangulated_Surface();
    tet_vol.triangulated_surface->Discard_Valence_Zero_Particles_And_Renumber();
    cout<<"triangles.m="<<tet_vol.triangulated_surface->mesh.elements.m<<endl;
    cout<<"particles.number="<<tet_vol.particles.Size()<<endl;
    Write_To_File<float>(argv[2],*tet_vol.triangulated_surface);
    return 0;
}
//#################################################################
