private ArtLocateResult calculate_next_trace(boolean p_layer_changed,boolean p_at_fanout_end){
  Collection<PlaPointFloat> corner_list=new LinkedList<PlaPointFloat>();
  corner_list.add(current_from_point);
  if (!p_at_fanout_end) {
    PlaPointFloat adjusted_start_corner=adjust_start_corner();
    if (adjusted_start_corner != current_from_point) {
      PlaPointFloat add_corner=calculate_additional_corner(current_from_point,adjusted_start_corner,true,angle_restriction);
      corner_list.add(add_corner);
      corner_list.add(adjusted_start_corner);
      previous_from_point=current_from_point;
      current_from_point=adjusted_start_corner;
    }
  }
  PlaPointFloat prev_corner=current_from_point;
  for (int c_limit=0; c_limit < 1000; c_limit++) {
    Collection<PlaPointFloat> next_corners=calculate_next_trace_corners();
    if (next_corners.isEmpty())     break;
    for (    PlaPointFloat curr_next_corner : next_corners) {
      if (curr_next_corner == prev_corner)       continue;
      corner_list.add(curr_next_corner);
      previous_from_point=current_from_point;
      current_from_point=curr_next_corner;
      prev_corner=curr_next_corner;
    }
  }
  int next_layer=current_trace_layer;
  if (p_layer_changed) {
    current_from_door_index=current_target_door_index + 1;
    ExpandRoomComplete next_room=backtrack_array[current_from_door_index].next_room;
    if (next_room != null) {
      next_layer=next_room.get_layer();
    }
  }
  PlaPointIntAlist rounded_corner_list=new PlaPointIntAlist(corner_list.size());
  PlaPointInt prev_point=null;
  for (  PlaPointFloat a_float : corner_list) {
    PlaPointInt curr_point=a_float.round();
    if (curr_point.equals(prev_point))     continue;
    rounded_corner_list.add(curr_point);
    prev_point=curr_point;
  }
  ArtLocateResult result=new ArtLocateResult(rounded_corner_list,current_trace_layer);
  current_trace_layer=next_layer;
  return result;
}

private ArtLocateResult calculate_next_trace ( boolean p_layer_changed , boolean p_at_fanout_end ) { Collection < PlaPointFloat > corner_list = new LinkedList < PlaPointFloat > ( ) ; corner_list . add ( current_from_point ) ; if ( ! p_at_fanout_end ) { PlaPointFloat adjusted_start_corner = adjust_start_corner ( ) ; if ( adjusted_start_corner != current_from_point ) { PlaPointFloat add_corner = calculate_additional_corner ( current_from_point , adjusted_start_corner , true , angle_restriction ) ; corner_list . add ( add_corner ) ; corner_list . add ( adjusted_start_corner ) ; previous_from_point = current_from_point ; current_from_point = adjusted_start_corner ; } } PlaPointFloat prev_corner = current_from_point ; for ( int c_limit = 0 ; c_limit < 1000 ; c_limit ++ ) { Collection < PlaPointFloat > next_corners = calculate_next_trace_corners ( ) ; if ( next_corners . isEmpty ( ) ) break ; for ( PlaPointFloat curr_next_corner : next_corners ) { if ( curr_next_corner == prev_corner ) continue ; corner_list . add ( curr_next_corner ) ; previous_from_point = current_from_point ; current_from_point = curr_next_corner ; prev_corner = curr_next_corner ; } } int next_layer = current_trace_layer ; if ( p_layer_changed ) { current_from_door_index = current_target_door_index + 1 ; ExpandRoomComplete next_room = backtrack_array [ current_from_door_index ] . next_room ; if ( next_room != null ) { next_layer = next_room . get_layer ( ) ; } } PlaPointIntAlist rounded_corner_list = new PlaPointIntAlist ( corner_list . size ( ) ) ; PlaPointInt prev_point = null ; for ( PlaPointFloat a_float : corner_list ) { PlaPointInt curr_point = a_float . round ( ) ; if ( curr_point . equals ( prev_point ) ) continue ; rounded_corner_list . add ( curr_point ) ; prev_point = curr_point ; } ArtLocateResult result = new ArtLocateResult ( rounded_corner_list , current_trace_layer ) ; current_trace_layer = next_layer ; return result ; }
calculates the next trace trace of the connection under construction .
