11#ifndef JAU_GAMP_GRAPH_TESS_IMPL_GRAPHVERTEX_HPP_
12#define JAU_GAMP_GRAPH_TESS_IMPL_GRAPHVERTEX_HPP_
23namespace gamp::graph::tess::impl {
25 using namespace jau::math;
26 using namespace jau::math::geom;
27 using namespace gamp::graph;
28 using namespace gamp::graph::tess;
35 class GraphVertex :
public std::enable_shared_from_this<GraphVertex> {
39 bool m_boundaryContained =
false;
41 struct Private{
explicit Private() =
default; };
44 GraphVertex(Private, Vertex& point) noexcept
48 static GraphVertexRef create(Vertex& point)
noexcept {
49 return std::make_shared<GraphVertex>(Private(), point);
52 constexpr Vertex& vertex() const noexcept {
return m_vertex; }
53 constexpr Vec3f& coord() const noexcept {
return m_vertex.coord(); }
55 constexpr const HEdgePtrList& getEdges() const noexcept {
return m_edges; }
56 constexpr HEdgePtrList& getEdges() noexcept {
return m_edges; }
58 void addEdge(HEdgePtr edge) {
59 m_edges.push_back(edge);
61 void removeEdge(
const HEdgePtr& edge)
noexcept {
62 std::erase(m_edges, edge);
64 HEdgePtr findNextEdge(
const GraphVertexRef& nextVert)
const noexcept {
65 for(HEdgePtr e : m_edges) {
66 if(e->getNext()->getGraphPoint() == nextVert) {
72 HEdgePtr findBoundEdge() const noexcept {
73 for(HEdgePtr e : m_edges) {
74 if((e->getType() == HEdge::BOUNDARY) || (e->getType() == HEdge::HOLE)) {
80 HEdgePtr findPrevEdge(
const GraphVertexRef& prevVert)
const noexcept {
81 for(HEdgePtr e : m_edges) {
82 if(e->getPrev()->getGraphPoint() == prevVert) {
89 constexpr bool isBoundaryContained() const noexcept {
return m_boundaryContained; }
91 void setBoundaryContained(
bool boundaryContained)
noexcept {
92 m_boundaryContained = boundaryContained;
95 std::string toString() noexcept {
96 return std::string(
"GraphVertex[contained[")
98 .append(m_vertex.toString()).append(
"]");
102 inline bool HEdge::vertexOnCurveVertex() const noexcept {
103 return m_vert->vertex().onCurve();
std::string_view to_string(const endian_t v) noexcept
Return std::string representation of the given endian.