/* Draws a line connecting the two specified locations. */
static void highlightConnection(Loc from, Loc to) {
  double srcX, srcY, dstX, dstY;
  findMidpoint(from, srcX, srcY);
  findMidpoint(to, dstX, dstY);
  
  GLine* connection = new GLine(srcX, srcY, dstX, dstY);
  connection->setColor(kPathColor);
  connection->setLineWidth(3.0);
  gWindow->add(connection);
  gHighlightedPath.add(connection);
}
/*
 * Given a path, draws that path on the screen.
 */
static void drawPath(Vector<TBLoc>& path) {
    for (int i = 1; i < path.size(); i++) {
        // highlight connection between path[i - 1] and path[i]
        double srcX, srcY, dstX, dstY;
        findMidpoint(path[i - 1], srcX, srcY);
        findMidpoint(path[i], dstX, dstY);

        GLine* connection = new GLine(srcX, srcY, dstX, dstY);
        connection->setColor(kPathColor);
        connection->setLineWidth(3.0);
        gWindow->add(connection);
        gHighlightedPath.add(connection);
    }
}