12#ifndef JAU_GAMP_GRAPH_TESS_IMPL_HEDGE_HPP_
13#define JAU_GAMP_GRAPH_TESS_IMPL_HEDGE_HPP_
25namespace gamp::graph::tess::impl {
27 using namespace jau::math;
28 using namespace jau::math::geom;
29 using namespace gamp::graph;
30 using namespace gamp::graph::tess;
38 typedef std::shared_ptr<GraphVertex> GraphVertexRef;
39 typedef std::vector<GraphVertexRef> GraphVertexRefList;
42 typedef std::unique_ptr<HEdge> HEdgeRef;
43 typedef HEdge* HEdgePtr;
44 typedef std::vector<HEdgePtr> HEdgePtrList;
48 constexpr static int BOUNDARY = 3;
49 constexpr static int INNER = 1;
50 constexpr static int HOLE = 2;
53 GraphVertexRef m_vert;
60 HEdge(GraphVertexRef vert,
int type)
61 : m_vert(
std::
move(vert)), m_prev(nullptr), m_next(nullptr), m_sibling(nullptr),
65 HEdge(GraphVertexRef vert, HEdgePtr prev, HEdgePtr next, HEdgePtr sibling,
int type)
67 m_prev(prev), m_next(next), m_sibling(sibling),
72 static HEdgeRef create(
const GraphVertexRef& vert,
int type) {
73 return std::make_unique<HEdge>(vert, type);
75 static HEdgeRef create(
const GraphVertexRef& vert, HEdgePtr prev, HEdgePtr next, HEdgePtr sibling,
int type) {
76 return std::make_unique<HEdge>(vert, prev, next, sibling, type);
78 constexpr const GraphVertexRef& getGraphPoint() const noexcept {
return m_vert; }
79 void setVert(
const GraphVertexRef& vert)
noexcept { m_vert = vert; }
81 constexpr HEdgePtr getPrev() noexcept {
return m_prev; }
82 void setPrev(HEdgePtr prev)
noexcept { m_prev = prev; }
84 constexpr HEdgePtr getNext() noexcept {
return m_next; }
85 void setNext(HEdgePtr next)
noexcept { m_next = next; }
87 constexpr HEdgePtr getSibling() noexcept {
return m_sibling; }
88 void setSibling(HEdgePtr sibling)
noexcept { m_sibling = sibling; }
90 constexpr int getType() const noexcept {
return m_type; }
92 void setType(
int type)
noexcept { m_type = type; }
94 static void connect(HEdgePtr first, HEdgePtr next)
noexcept {
99 static void makeSiblings(HEdgePtr first, HEdgePtr second)
noexcept {
100 first->setSibling(second);
101 second->setSibling(first);
104 std::string toString() {
109 HEdgePtr current =
this;
110 HEdgePtr next = getNext();
113 jau_PLAIN_PRINT(
true,
"HEdge[%d: current %p, next %p]", i, current, next); ++i;
118 next = current->getNext();
120 }
while(current !=
this);
123 bool vertexOnCurveVertex() const noexcept ;
#define jau_PLAIN_PRINT(printPrefix, fmt,...)
Use for unconditional plain messages, prefix '[elapsed_time] ' if printPrefix == true.
@ std
Denotes a func::std_target_t.
std::string toHexString(const void *data, const nsize_t length, const lb_endian_t byteOrder=lb_endian_t::big, const LoUpCase capitalization=LoUpCase::lower, const PrefixOpt prefix=PrefixOpt::prefix) noexcept
Produce a hexadecimal string representation of the given lsb-first byte values.