#include "LineMesh.h"

#include "Edge.h"

LineMesh::~LineMesh()
{

}

void LineMesh::populate(VecNodes& nodes, VecEdges& edges)
{
    mNodes = std::move(nodes);
    mEdges = std::move(edges);
}

std::unique_ptr<AbstractMesh> LineMesh::copy() const
{
    return nullptr;
}

LineMesh::MeshType LineMesh::getType() const
{
    return LineMesh::MeshType::LINE;
}

std::vector<std::size_t> LineMesh::getEdgeNodeIds() const
{
    std::vector<std::size_t> ids(2*mEdges.size());
    for(std::size_t idx=0; idx<mEdges.size(); idx++)
    {
        ids[2*idx] = mEdges[idx]->getNode0Id();
        ids[2*idx + 1] = mEdges[idx]->getNode1Id();
    }
    return ids;
}
