/*! * \brief Checks all visible lines. * * If one of the endpoints of the line lays inside the pin, the line is * added to the 'rubberband' list. * * Square pins are handled as if they were round. * * Speed and readability is more important then the few % of failures * that are immediately recognized. */ static void CheckPinForRubberbandConnection (PinType *Pin) { struct rubber_info info; Cardinal n; Coord t = Pin->Thickness / 2; info.box.X1 = Pin->X - t; info.box.X2 = Pin->X + t; info.box.Y1 = Pin->Y - t; info.box.Y2 = Pin->Y + t; info.line = NULL; if (TEST_FLAG (SQUAREFLAG, Pin)) info.radius = 0; else { info.radius = t; info.X = Pin->X; info.Y = Pin->Y; } for (n = 0; n < max_copper_layer; n++) { info.layer = LAYER_PTR (n); r_search (info.layer->line_tree, &info.box, NULL, rubber_callback, &info); } }
void DrawSilk (int side, const BoxType * drawn_area) { #if 0 /* This code is used when you want to mask silk to avoid exposed pins and pads. We decided it was a bad idea to do this unconditionally, but the code remains. */ #endif #if 0 if (gui->poly_before) { gui->graphics->use_mask (HID_MASK_BEFORE); #endif DrawLayer (LAYER_PTR (max_copper_layer + side), drawn_area); /* draw package */ r_search (PCB->Data->element_tree, drawn_area, NULL, element_callback, &side); r_search (PCB->Data->name_tree[NAME_INDEX (PCB)], drawn_area, NULL, name_callback, &side); #if 0 } gui->graphics->use_mask (HID_MASK_CLEAR); r_search (PCB->Data->pin_tree, drawn_area, NULL, clearPin_callback, NULL); r_search (PCB->Data->via_tree, drawn_area, NULL, clearPin_callback, NULL); r_search (PCB->Data->pad_tree, drawn_area, NULL, clearPad_callback, &side); if (gui->poly_after) { gui->graphics->use_mask (HID_MASK_AFTER); DrawLayer (LAYER_PTR (max_copper_layer + layer), drawn_area); /* draw package */ r_search (PCB->Data->element_tree, drawn_area, NULL, element_callback, &side); r_search (PCB->Data->name_tree[NAME_INDEX (PCB)], drawn_area, NULL, name_callback, &side); } gui->graphics->use_mask (HID_MASK_OFF); #endif }
/* --------------------------------------------------------------------------- * pastes the contents of the buffer to the layout. Only visible objects * are handled by the routine. */ bool CopyPastebufferToLayout (Coord X, Coord Y) { Cardinal i; bool changed = false; #ifdef DEBUG printf("Entering CopyPastebufferToLayout.....\n"); #endif /* set movement vector */ DeltaX = X - PASTEBUFFER->X, DeltaY = Y - PASTEBUFFER->Y; /* paste all layers */ for (i = 0; i < max_copper_layer + 2; i++) { LayerType *sourcelayer = &PASTEBUFFER->Data->Layer[i]; LayerType *destlayer = LAYER_PTR (i); if (destlayer->On) { changed = changed || (sourcelayer->LineN != 0) || (sourcelayer->ArcN != 0) || (sourcelayer->PolygonN != 0) || (sourcelayer->TextN != 0); LINE_LOOP (sourcelayer); { CopyLine (destlayer, line); } END_LOOP; ARC_LOOP (sourcelayer); { CopyArc (destlayer, arc); } END_LOOP; TEXT_LOOP (sourcelayer); { CopyText (destlayer, text); } END_LOOP; POLYGON_LOOP (sourcelayer); { CopyPolygon (destlayer, polygon); } END_LOOP; } } /* paste elements */ if (PCB->PinOn && PCB->ElementOn) { ELEMENT_LOOP (PASTEBUFFER->Data); { #ifdef DEBUG printf("In CopyPastebufferToLayout, pasting element %s\n", element->Name[1].TextString); #endif if (FRONT (element) || PCB->InvisibleObjectsOn) { CopyElement (element); changed = true; } } END_LOOP; } /* finally the vias */ if (PCB->ViaOn) { changed |= (PASTEBUFFER->Data->ViaN != 0); VIA_LOOP (PASTEBUFFER->Data); { CopyVia (via); } END_LOOP; } if (changed) { Draw (); IncrementUndoSerialNumber (); } #ifdef DEBUG printf(" .... Leaving CopyPastebufferToLayout.\n"); #endif return (changed); }