49 lines
692 B
C++
49 lines
692 B
C++
|
#pragma once
|
||
|
|
||
|
#include "../hyplib/scalar/scalar.hpp"
|
||
|
#include "../hyplib/array/array.hpp"
|
||
|
#include "../hyplib/vector/vector.hpp"
|
||
|
|
||
|
|
||
|
namespace hpr::mesh
|
||
|
{
|
||
|
|
||
|
class Edge;
|
||
|
|
||
|
class Vertex : public vec<scalar, 3>
|
||
|
{
|
||
|
friend class Mesh;
|
||
|
|
||
|
using base = vec<scalar, 3>;
|
||
|
|
||
|
protected:
|
||
|
darray<Edge*> p_refEdges;
|
||
|
|
||
|
public:
|
||
|
Vertex() :
|
||
|
base{}
|
||
|
{}
|
||
|
|
||
|
Vertex(const scalar& x, const scalar& y, const scalar& z) :
|
||
|
base{x, y, z}
|
||
|
{}
|
||
|
|
||
|
~Vertex() override
|
||
|
{
|
||
|
for (auto& e: p_refEdges)
|
||
|
e = nullptr;
|
||
|
}
|
||
|
|
||
|
darray<Edge*>& refEdges()
|
||
|
{
|
||
|
return p_refEdges;
|
||
|
}
|
||
|
|
||
|
void addRefEdge(Edge* edge)
|
||
|
{
|
||
|
p_refEdges.push(edge);
|
||
|
}
|
||
|
|
||
|
};
|
||
|
|
||
|
}
|