/** Normalizes the traces of this net */ public boolean normalize_traces(int p_net_no) { boolean result = false; boolean something_changed = true; Item curr_item = null; while (something_changed) { something_changed = false; Iterator<UndoableObjects.UndoableObjectNode> it = item_list.start_read_object(); for (; ; ) { try { curr_item = (Item) item_list.read_object(it); } catch (java.util.ConcurrentModificationException e) { something_changed = true; break; } if (curr_item == null) { break; } if (curr_item.contains_net(p_net_no) && curr_item instanceof PolylineTrace && curr_item.is_on_the_board()) { PolylineTrace curr_trace = (PolylineTrace) curr_item; if (curr_trace.normalize(null)) { something_changed = true; result = true; } else if (!curr_trace.is_user_fixed() && this.remove_if_cycle(curr_trace)) { something_changed = true; result = true; } } } } return result; }
/** * Inserts a trace into the board, whose geometry is described by a Polyline. p_clearance_class is * the index in the clearance_matix, which describes the required clearance restrictions to other * items. */ public void insert_trace( Polyline p_polyline, int p_layer, int p_half_width, int[] p_net_no_arr, int p_clearance_class, FixedState p_fixed_state) { PolylineTrace new_trace = insert_trace_without_cleaning( p_polyline, p_layer, p_half_width, p_net_no_arr, p_clearance_class, p_fixed_state); if (new_trace == null) { return; } IntOctagon clip_shape = null; if (this instanceof RoutingBoard) { ChangedArea changed_area = ((RoutingBoard) this).changed_area; if (changed_area != null) { clip_shape = changed_area.get_area(p_layer); } } new_trace.normalize(clip_shape); }