Emergency 20 Dokumentation  4.2.0
qsf::ai::voronoi::SegmentCollection Class Reference

#include <SegmentCollection.h>

Public Member Functions

std::size_t addSegment (const std::vector< SegmentNode > &nodes)
std::size_t getNumSegments () const
std::size_t getTotalNumberOfContainedNodes () const
const SegmentgetSegment (unsigned int index, std::deque< SegmentNode >::const_iterator &begin, unsigned int &numNodes) const
unsigned int getFreeSpaceSquaredForNode (unsigned int nodeIndex) const

Static Public Member Functions

static unsigned int getSegmentIdFromAnyEndNode (unsigned int endNodeId)
static unsigned int getFirstNodeIdFromSegment (unsigned int segmentId)
static unsigned int getLastNodeIdFromSegment (unsigned int segmentId)
static bool isFirstNodeId (unsigned int nodeId)

Detailed Description

A segment collection is an intermediate data structure during the creation process of the Voronoi graph. It contains raw versions of the final traffic lanes and therefore shares a similar structure like a LaneCollection. Most importantly the individual coordinates making up a segment are stored in one linear memory structure that is shared by all segments. Unlike the lane collection it still holds only 2D elements with coordinates defined by the grid cell length and not real world coordinates. TODO(vs) Very ugly code copying from LaneCollection - unify the code structure or avoid the duplication altogether

Member Function Documentation

std::size_t qsf::ai::voronoi::SegmentCollection::addSegment ( const std::vector< SegmentNode > &  nodes)
unsigned int qsf::ai::voronoi::SegmentCollection::getFirstNodeIdFromSegment ( unsigned int  segmentId)
unsigned int qsf::ai::voronoi::SegmentCollection::getFreeSpaceSquaredForNode ( unsigned int  nodeIndex) const
unsigned int qsf::ai::voronoi::SegmentCollection::getLastNodeIdFromSegment ( unsigned int  segmentId)
std::size_t qsf::ai::voronoi::SegmentCollection::getNumSegments ( ) const
const Segment & qsf::ai::voronoi::SegmentCollection::getSegment ( unsigned int  index,
std::deque< SegmentNode >::const_iterator &  begin,
unsigned int &  numNodes 
) const
unsigned int qsf::ai::voronoi::SegmentCollection::getSegmentIdFromAnyEndNode ( unsigned int  endNodeId)
std::size_t qsf::ai::voronoi::SegmentCollection::getTotalNumberOfContainedNodes ( ) const
bool qsf::ai::voronoi::SegmentCollection::isFirstNodeId ( unsigned int  nodeId)

The documentation for this class was generated from the following files: