102 static_assert(N > 2u,
"Not enough nodes to make a cycle!");
103 for (
auto i = 2u; i < Cycle.size(); ++i) {
104 AddNode(Cycle[i], Nodes.back());
106 ConnectNodes(Nodes.front(), Nodes.back());
123 Node &AddNode(
const Position &NodePosition, Node &OtherNode);
142 Face &ConnectNodes(Node &Node0, Node &Node1);
158 return HalfEdges.size();
214 check(halfEdge.
Source !=
nullptr);
220 check(halfEdge.
Source !=
nullptr);
226 check(halfEdge.
Target !=
nullptr);
232 check(halfEdge.
Target !=
nullptr);
238 check(halfEdge.
Pair !=
nullptr);
239 return *halfEdge.
Pair;
244 check(halfEdge.
Pair !=
nullptr);
245 return *halfEdge.
Pair;
250 check(halfEdge.
Face !=
nullptr);
251 return *halfEdge.
Face;
256 check(halfEdge.
Face !=
nullptr);
257 return *halfEdge.
Face;
288 check(halfEdge.
Next !=
nullptr);
289 return *halfEdge.
Next;
294 check(halfEdge.
Next !=
nullptr);
295 return *halfEdge.
Next;
300 return GetNextInFace(GetPair(halfEdge));
305 return GetNextInFace(GetPair(halfEdge));
316 static float GetAngle(
const HalfEdge &halfEdge);
318#ifdef CARLA_ROAD_GENERATOR_EXTRA_LOG
319 void PrintToLog()
const;
Simple doubly-connected edge list structure.
typename HalfEdgeContainer::const_iterator ConstHalfEdgeIterator
ListView< FaceIterator > GetFaces()
typename HalfEdgeContainer::iterator HalfEdgeIterator
ListView< HalfEdgeIterator > GetHalfEdges()
ListView< ConstFaceIterator > GetFaces() const
static const Face & GetFace(const HalfEdge &halfEdge)
HalfEdgeContainer HalfEdges
ListView< ConstHalfEdgeIterator > GetHalfEdges() const
static const Node & GetSource(const HalfEdge &halfEdge)
ListView< NodeIterator > GetNodes()
static HalfEdge & GetHalfEdge(Face &face)
static Node & GetTarget(HalfEdge &halfEdge)
typename NodeContainer::const_iterator ConstNodeIterator
ListView< ConstNodeIterator > GetNodes() const
static HalfEdge & GetLeavingHalfEdge(Node &node)
static HalfEdge & GetPair(HalfEdge &halfEdge)
static const Node & GetTarget(const HalfEdge &halfEdge)
static Face & GetFace(HalfEdge &halfEdge)
static const HalfEdge & GetPair(const HalfEdge &halfEdge)
static Node & GetSource(HalfEdge &halfEdge)
std::list< HalfEdge > HalfEdgeContainer
size_t CountNodes() const
typename FaceContainer::iterator FaceIterator
static HalfEdge & GetNextInNode(HalfEdge &halfEdge)
typename NodeContainer::iterator NodeIterator
std::list< Node > NodeContainer
static const HalfEdge & GetHalfEdge(const Face &face)
static HalfEdge & GetNextInFace(HalfEdge &halfEdge)
static const HalfEdge & GetNextInFace(const HalfEdge &halfEdge)
static const HalfEdge & GetNextInNode(const HalfEdge &halfEdge)
size_t CountHalfEdges() const
static const HalfEdge & GetLeavingHalfEdge(const Node &node)
typename FaceContainer::const_iterator ConstFaceIterator
DoublyConnectedEdgeList(const std::array< Position, N > &Cycle)
Create a DoublyConnectedEdgeList consisting of a cycle of N nodes.
std::list< Face > FaceContainer
size_t CountFaces() const
friend DoublyConnectedEdgeList
Face & operator=(const Face &)=delete
HalfEdge & operator=(const HalfEdge &)=delete
friend DoublyConnectedEdgeList
DoublyConnectedEdgeList::Position Position
const DoublyConnectedEdgeList::Position & GetPosition() const
Node(const Position &Pos)
HalfEdge * LeavingHalfEdge
friend DoublyConnectedEdgeList
Node & operator=(const Node &)=delete