GEOS  3.9.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 #ifndef GEOS_TRIANGULATE_QUADEDGE_QUADEDGEQUARTET_H
16 #define GEOS_TRIANGULATE_QUADEDGE_QUADEDGEQUARTET_H
17 
18 #include <geos/triangulate/quadedge/QuadEdge.h>
19 
20 
21 namespace geos {
22 namespace triangulate {
23 namespace quadedge {
24 
25 class GEOS_DLL QuadEdgeQuartet {
26 
27 public:
28  QuadEdgeQuartet() : e{QuadEdge(0), QuadEdge(1), QuadEdge(2), QuadEdge(3)} {
29  e[0].next = &(e[0]);
30  e[1].next = &(e[3]);
31  e[2].next = &(e[2]);
32  e[3].next = &(e[1]);
33  };
34 
35  static QuadEdge& makeEdge(const Vertex& o, const Vertex & d, std::deque<QuadEdgeQuartet> & edges) {
36  edges.emplace_back();
37  auto& qe = edges.back();
38  qe.base().setOrig(o);
39  qe.base().setDest(d);
40 
41  return qe.base();
42  }
43 
44  QuadEdge& base() {
45  return e[0];
46  }
47 
48  const QuadEdge& base() const {
49  return e[0];
50  }
51 
52  void setVisited(bool status) {
53  for (auto& edge : e) {
54  edge.setVisited(status);
55  }
56  }
57 
58 private:
59  std::array<QuadEdge, 4> e;
60 };
61 
62 }
63 }
64 }
65 
66 
67 #endif
Basic namespace for all GEOS functionalities.
Definition: IndexedNestedRingTester.h:26