/* --------------------------------------------------------------------------- * moves an arc */ static void * MoveArc (LayerTypePtr Layer, ArcTypePtr Arc) { RestoreToPolygon (PCB->Data, ARC_TYPE, Layer, Arc); r_delete_entry (Layer->arc_tree, (BoxType *)Arc); if (Layer->On) { EraseArc (Arc); MOVE_ARC_LOWLEVEL (Arc, DeltaX, DeltaY); DrawArc (Layer, Arc); Draw (); } else { MOVE_ARC_LOWLEVEL (Arc, DeltaX, DeltaY); } r_insert_entry (Layer->arc_tree, (BoxType *)Arc, 0); ClearFromPolygon (PCB->Data, ARC_TYPE, Layer, Arc); return (Arc); }
static void * MyMoveArcLowLevel (DataType *Data, LayerType *Layer, ArcType *Arc, Coord dx, Coord dy) { if (Data) { RestoreToPolygon (Data, ARC_TYPE, Layer, Arc); r_delete_entry(Layer->arc_tree, (BoxType *) Arc); } MOVE_ARC_LOWLEVEL (Arc, dx, dy); if (Data) { r_insert_entry (Layer->arc_tree, (BoxType *) Arc, 0); ClearFromPolygon (Data, ARC_TYPE, Layer, Arc); } return Arc; }
/* --------------------------------------------------------------------------- * moves a element by +-X and +-Y */ void MoveElementLowLevel (DataTypePtr Data, ElementTypePtr Element, Coord DX, Coord DY) { if (Data) r_delete_entry (Data->element_tree, (BoxType *)Element); ELEMENTLINE_LOOP (Element); { MOVE_LINE_LOWLEVEL (line, DX, DY); } END_LOOP; PIN_LOOP (Element); { if (Data) { r_delete_entry (Data->pin_tree, (BoxType *)pin); RestoreToPolygon (Data, PIN_TYPE, Element, pin); } MOVE_PIN_LOWLEVEL (pin, DX, DY); if (Data) { r_insert_entry (Data->pin_tree, (BoxType *)pin, 0); ClearFromPolygon (Data, PIN_TYPE, Element, pin); } } END_LOOP; PAD_LOOP (Element); { if (Data) { r_delete_entry (Data->pad_tree, (BoxType *)pad); RestoreToPolygon (Data, PAD_TYPE, Element, pad); } MOVE_PAD_LOWLEVEL (pad, DX, DY); if (Data) { r_insert_entry (Data->pad_tree, (BoxType *)pad, 0); ClearFromPolygon (Data, PAD_TYPE, Element, pad); } } END_LOOP; ARC_LOOP (Element); { MOVE_ARC_LOWLEVEL (arc, DX, DY); } END_LOOP; ELEMENTTEXT_LOOP (Element); { if (Data && Data->name_tree[n]) r_delete_entry (PCB->Data->name_tree[n], (BoxType *)text); MOVE_TEXT_LOWLEVEL (text, DX, DY); if (Data && Data->name_tree[n]) r_insert_entry (PCB->Data->name_tree[n], (BoxType *)text, 0); } END_LOOP; MOVE_BOX_LOWLEVEL (&Element->BoundingBox, DX, DY); MOVE_BOX_LOWLEVEL (&Element->VBox, DX, DY); MOVE (Element->MarkX, Element->MarkY, DX, DY); if (Data) r_insert_entry (Data->element_tree, (BoxType *)Element, 0); }