Example #1
0
 /**
  * Returns the list of items on the board, whose shape on layer p_layer contains the point at
  * p_location. If p_layer < 0, the layer is ignored. If p_item_selection_filter != null, only
  * items of types selected by the filter are picked.
  */
 public Set<Item> pick_items(Point p_location, int p_layer, ItemSelectionFilter p_filter) {
   TileShape point_shape = TileShape.get_instance(p_location);
   Collection<SearchTreeObject> overlaps = overlapping_objects(point_shape, p_layer);
   Set<Item> result = new TreeSet<Item>();
   for (SearchTreeObject curr_object : overlaps) {
     if (curr_object instanceof Item) {
       result.add((Item) curr_object);
     }
   }
   if (p_filter != null) {
     result = p_filter.filter(result);
   }
   return result;
 }
Example #2
0
 /** {@inheritDoc} */
 public boolean is_selected_by_filter(ItemSelectionFilter p_filter) {
   if (!this.is_selected_by_fixed_filter(p_filter)) {
     return false;
   }
   return p_filter.is_selected(ItemSelectionFilter.SelectableChoices.TRACES);
 }