#pragma once #include #include #include namespace hpr::mesh { class Vertex; class Face; class Edge : public sarray { friend class Mesh; using vertex_pointer = Vertex*; using base = sarray; protected: darray p_refFaces; public: Edge() : base{} {} Edge(vertex_pointer v1, vertex_pointer v2) : base{v1, v2} {} ~Edge() override { for (auto& f: p_refFaces) f = nullptr; } darray& refFaces() { return p_refFaces; } void addRefFace(Face* face) { p_refFaces.push(face); } sarray& vertices() { return *this; } vertex_pointer vertex(size_type n) { return (*this)[n]; } bool isValid() { return *front() != *back(); } }; }