public boolean check_trace(ShapeTile p_shape,int p_layer,NetNosList p_net_no_arr,int p_cl_class,Set<BrdAbitPin> p_contact_pins){
  if (!p_shape.is_contained_in(bounding_box))   return false;
  AwtreeShapeSearch default_tree=search_tree_manager.get_default_tree();
  Collection<AwtreeFindEntry> tree_entries=default_tree.find_overlap_tree_entries_with_clearance(p_shape,p_layer,NetNosList.EMPTY,p_cl_class);
  for (  AwtreeFindEntry curr_tree_entry : tree_entries) {
    if (!(curr_tree_entry.object instanceof BrdItem))     continue;
    BrdItem curr_item=(BrdItem)curr_tree_entry.object;
    if (p_contact_pins != null) {
      if (p_contact_pins.contains(curr_item))       continue;
      if (curr_item instanceof BrdAbitPin) {
        return false;
      }
    }
    boolean is_obstacle=p_net_no_arr.is_trace_obstacle(curr_item);
    if (is_obstacle && (curr_item instanceof BrdTracep) && p_contact_pins != null) {
      ShapeTile intersection=null;
      for (      BrdAbitPin curr_contact_pin : p_contact_pins) {
        if (curr_contact_pin.net_count() <= 1 || !curr_contact_pin.shares_net(curr_item))         continue;
        if (intersection == null) {
          ShapeTile obstacle_trace_shape=curr_item.tile_shape_get(curr_tree_entry.shape_index_in_object);
          intersection=p_shape.intersection(obstacle_trace_shape);
        }
        ShapeTile pin_shape=curr_contact_pin.get_tile_shape_on_layer(p_layer);
        if (pin_shape.contains_approx(intersection)) {
          is_obstacle=false;
          break;
        }
      }
    }
    if (is_obstacle)     return false;
  }
  return true;
}

public boolean check_trace ( ShapeTile p_shape , int p_layer , NetNosList p_net_no_arr , int p_cl_class , Set < BrdAbitPin > p_contact_pins ) { if ( ! p_shape . is_contained_in ( bounding_box ) ) return false ; AwtreeShapeSearch default_tree = search_tree_manager . get_default_tree ( ) ; Collection < AwtreeFindEntry > tree_entries = default_tree . find_overlap_tree_entries_with_clearance ( p_shape , p_layer , NetNosList . EMPTY , p_cl_class ) ; for ( AwtreeFindEntry curr_tree_entry : tree_entries ) { if ( ! ( curr_tree_entry . object instanceof BrdItem ) ) continue ; BrdItem curr_item = ( BrdItem ) curr_tree_entry . object ; if ( p_contact_pins != null ) { if ( p_contact_pins . contains ( curr_item ) ) continue ; if ( curr_item instanceof BrdAbitPin ) { return false ; } } boolean is_obstacle = p_net_no_arr . is_trace_obstacle ( curr_item ) ; if ( is_obstacle && ( curr_item instanceof BrdTracep ) && p_contact_pins != null ) { ShapeTile intersection = null ; for ( BrdAbitPin curr_contact_pin : p_contact_pins ) { if ( curr_contact_pin . net_count ( ) <= 1 || ! curr_contact_pin . shares_net ( curr_item ) ) continue ; if ( intersection == null ) { ShapeTile obstacle_trace_shape = curr_item . tile_shape_get ( curr_tree_entry . shape_index_in_object ) ; intersection = p_shape . intersection ( obstacle_trace_shape ) ; } ShapeTile pin_shape = curr_contact_pin . get_tile_shape_on_layer ( p_layer ) ; if ( pin_shape . contains_approx ( intersection ) ) { is_obstacle = false ; break ; } } } if ( is_obstacle ) return false ; } return true ; }
checks , if the a trace line with shape p_shape and net numbers p_net_no_arr and clearance class p_cl_class can be inserted on layer p_layer without clearance violation . if p_contact_pins ! = null , all pins not contained in p_contact_pins are regarded as obstacles , even if they are of the own net .
