Beispiel #1
0
 /**
  * Get a list of all items having a connection point at p_point on the layer of this trace. If
  * p_ignore_net is false, only contacts to items sharing a net with this trace are calculated.
  * This is the normal case.
  *
  * @param p_point a {@link geometry.planar.Point} object.
  * @param p_ignore_net a boolean.
  * @return a {@link java.util.Set} object.
  */
 public Set<Item> get_normal_contacts(Point p_point, boolean p_ignore_net) {
   if (p_point == null
       || !(p_point.equals(this.first_corner()) || p_point.equals(this.last_corner()))) {
     return new TreeSet<Item>();
   }
   TileShape search_shape = TileShape.get_instance(p_point);
   Set<SearchTreeObject> overlaps = board.overlapping_objects(search_shape, this.layer);
   Set<Item> result = new TreeSet<Item>();
   for (SearchTreeObject curr_ob : overlaps) {
     if (!(curr_ob instanceof Item)) {
       continue;
     }
     Item curr_item = (Item) curr_ob;
     if (curr_item != this
         && curr_item.shares_layer(this)
         && (p_ignore_net || curr_item.shares_net(this))) {
       if (curr_item instanceof Trace) {
         Trace curr_trace = (Trace) curr_item;
         if (p_point.equals(curr_trace.first_corner())
             || p_point.equals(curr_trace.last_corner())) {
           result.add(curr_item);
         }
       } else if (curr_item instanceof DrillItem) {
         DrillItem curr_drill_item = (DrillItem) curr_item;
         if (p_point.equals(curr_drill_item.get_center())) {
           result.add(curr_item);
         }
       } else if (curr_item instanceof ConductionArea) {
         ConductionArea curr_area = (ConductionArea) curr_item;
         if (curr_area.get_area().contains(p_point)) {
           result.add(curr_item);
         }
       }
     }
   }
   return result;
 }
Beispiel #2
0
 Point normal_contact_point(DrillItem p_drill_item) {
   return p_drill_item.normal_contact_point(this);
 }