GEOS 3.14.0dev
QuadEdgeQuartet.h
1/**********************************************************************
2 *
3 * GEOS - Geometry Engine Open Source
4 * http://geos.osgeo.org
5 *
6 * Copyright (C) 2019 Daniel Baston
7 *
8 * This is free software; you can redistribute and/or modify it under
9 * the terms of the GNU Lesser General Licence as published
10 * by the Free Software Foundation.
11 * See the COPYING file for more information.
12 *
13 **********************************************************************/
14
15#pragma once
16
17#include <geos/triangulate/quadedge/QuadEdge.h>
18
19
20namespace geos {
21namespace triangulate {
22namespace quadedge {
23
24class GEOS_DLL QuadEdgeQuartet {
25
26public:
27 QuadEdgeQuartet() : e{{QuadEdge(0), QuadEdge(1), QuadEdge(2), QuadEdge(3)}} {
28 e[0].next = &(e[0]);
29 e[1].next = &(e[3]);
30 e[2].next = &(e[2]);
31 e[3].next = &(e[1]);
32 };
33
34 static QuadEdge& makeEdge(const Vertex& o, const Vertex & d, std::deque<QuadEdgeQuartet> & edges) {
35 edges.emplace_back();
36 auto& qe = edges.back();
37 qe.base().setOrig(o);
38 qe.base().setDest(d);
39
40 return qe.base();
41 }
42
43 QuadEdge& base() {
44 return e[0];
45 }
46
47 const QuadEdge& base() const {
48 return e[0];
49 }
50
51 void setVisited(bool status) {
52 for (auto& edge : e) {
53 edge.setVisited(status);
54 }
55 }
56
57private:
58 std::array<QuadEdge, 4> e;
59};
60
61}
62}
63}
64
Basic namespace for all GEOS functionalities.
Definition geos.h:39