def addCircleIntersectionLoop(circleIntersectionLoop, circleIntersections):
 firstCircleIntersection = circleIntersectionLoop[0]
 circleIntersectionAhead = firstCircleIntersection
 for circleIntersectionIndex in xrange((len(circleIntersections) + 1)):
  circleIntersectionAhead = circleIntersectionAhead.getCircleIntersectionAhead()
  if ((circleIntersectionAhead == firstCircleIntersection) or (circleIntersectionAhead == None)):
   firstCircleIntersection.steppedOn = True
   return
  circleIntersectionAhead.addToList(circleIntersectionLoop)
 firstCircleIntersection.steppedOn = True
 print 'Warning, addCircleIntersectionLoop would have gone into an endless loop.'
 print 'circleIntersectionLoop'
 for circleIntersection in circleIntersectionLoop:
  print circleIntersection
  print circleIntersection.circleNodeAhead
  print circleIntersection.circleNodeBehind
 print 'firstCircleIntersection'
 print firstCircleIntersection
 print 'circleIntersections'
 for circleIntersection in circleIntersections:
  print circleIntersection

def addCircleIntersectionLoop ( circleIntersectionLoop , circleIntersections ) : firstCircleIntersection = circleIntersectionLoop [ 0 ] circleIntersectionAhead = firstCircleIntersection for circleIntersectionIndex in xrange ( ( len ( circleIntersections ) + 1 ) ) : circleIntersectionAhead = circleIntersectionAhead . getCircleIntersectionAhead ( ) if ( ( circleIntersectionAhead == firstCircleIntersection ) or ( circleIntersectionAhead == None ) ) : firstCircleIntersection . steppedOn = True return circleIntersectionAhead . addToList ( circleIntersectionLoop ) firstCircleIntersection . steppedOn = True print 'Warning, addCircleIntersectionLoop would have gone into an endless loop.' print 'circleIntersectionLoop' for circleIntersection in circleIntersectionLoop : print circleIntersection print circleIntersection . circleNodeAhead print circleIntersection . circleNodeBehind print 'firstCircleIntersection' print firstCircleIntersection print 'circleIntersections' for circleIntersection in circleIntersections : print circleIntersection
add a circle intersection loop .