#pragma once #include #include #include namespace hpr::mesh { class Vertex; class Edge; class Cell; class Face : public darray { friend class Mesh; using edge_pointer = Edge*; using vertex_pointer = Vertex*; using base = darray; protected: darray p_refCells; public: Face() : base{} {} Face(std::initializer_list edges) : base{edges} {} ~Face() override { for (auto& c: p_refCells) c = nullptr; } darray& refCells() { return p_refCells; } void addRefCell(Cell* cell) { p_refCells.push(cell); } darray& edges() { return *this; } edge_pointer edge(size_type n) { return (*this)[n]; } darray vertices() { darray vertices_ {size(), nullptr}; for (auto n = 0; n < size(); ++n) vertices_[n] = edge(n)->vertex(0); return vertices_; } }; }