route from point to point and describe points

This commit is contained in:
Laura Klünder 2016-12-21 00:24:56 +01:00
parent 8a9406275b
commit bbfca9f318
9 changed files with 127 additions and 19 deletions

View file

@ -294,5 +294,15 @@ class GraphRoom():
return GraphConnection(self.graph.points[self.points[from_i]], self.graph.points[self.points[to_i]],
distance=distance, ctype=ctype)
def contains_point(self, point):
return self.mpl_clear.contains_point(point)
def connected_points(self, point, mode):
connections = {}
for area in self.areas:
if area.contains_point(point):
connections.update(area.connected_points(point, mode))
return connections
RoomRouter = namedtuple('RoomRouter', ('shortest_paths', 'predecessors', ))