 //#####################################################################
// Copyright 2006, Geoffrey Irving, Andrew Selle, Tamar Shinar, Eftychios Sifakis.
// This file is part of PhysBAM whose distribution is governed by the license contained in the accompanying file PHYSBAM_COPYRIGHT.txt.
//#####################################################################
// Class EMBEDDING
//#####################################################################
#ifndef __EMBEDDING__
#define __EMBEDDING__

#include <Core/Meshes/STRUCTURE.h>
#include <Core/Meshes/TRIANGULATED_AREA.h>
#include <Core/Meshes/TRIANGULATED_SURFACE.h>
namespace PhysBAM{

template<class TV> class BINDING_LIST;

template<class TV>
class EMBEDDING:public STRUCTURE<TV>
{
    static_assert((TV::m>1));

    typedef typename TV::SCALAR T;
public:
    GEOMETRY_PARTICLES<TV>& particles;
    TRIANGLE_MESH material_surface_mesh;
    MESH_OBJECT<TV,2> material_surface;
private:
    bool need_destroy_particles;
public:
    EMBEDDING(GEOMETRY_PARTICLES<TV>& particles_input);
    virtual ~EMBEDDING();

    static EMBEDDING<TV>* Create();
    static EMBEDDING<TV>* Create(GEOMETRY_PARTICLES<TV>& new_particles);
    virtual std::string Name() const override;
    static std::string Static_Name();
    void Update_Number_Nodes() override;
    void Mark_Nodes_Referenced(ARRAY<int>& marks,const int mark) const override;
    void Read(TYPED_ISTREAM& input) override;
    void Write(TYPED_OSTREAM& output) const override;
//#####################################################################
};

template<class T>
class EMBEDDING<VECTOR<T,1> >:public STRUCTURE<VECTOR<T,1> >
{
    typedef VECTOR<T,1> TV;
public:
    TRIANGLE_MESH material_surface_mesh;
    int material_surface; // was MESH_OBJECT<TV,2>
//#####################################################################
};
}
#endif
