void EraseObject (int type, void *lptr, void *ptr) { switch (type) { case VIA_TYPE: case PIN_TYPE: ErasePin ((PinType *) ptr); break; case TEXT_TYPE: case ELEMENTNAME_TYPE: EraseText ((LayerType *)lptr, (TextType *) ptr); break; case POLYGON_TYPE: ErasePolygon ((PolygonType *) ptr); break; case ELEMENT_TYPE: EraseElement ((ElementType *) ptr); break; case LINE_TYPE: case ELEMENTLINE_TYPE: case RATLINE_TYPE: EraseLine ((LineType *) ptr); break; case PAD_TYPE: ErasePad ((PadType *) ptr); break; case ARC_TYPE: case ELEMENTARC_TYPE: EraseArc ((ArcType *) ptr); break; default: Message ("hace: Internal ERROR, trying to erase an unknown type\n"); } }
/* --------------------------------------------------------------------------- * moves an arc between layers */ static void * MoveArcToLayer (LayerType *Layer, ArcType *Arc) { ArcTypePtr newone; if (TEST_FLAG (LOCKFLAG, Arc)) { Message (_("Sorry, the object is locked\n")); return NULL; } if (Dest == Layer && Layer->On) { DrawArc (Layer, Arc); Draw (); } if (((long int) Dest == -1) || Dest == Layer) return (Arc); AddObjectToMoveToLayerUndoList (ARC_TYPE, Layer, Arc, Arc); RestoreToPolygon (PCB->Data, ARC_TYPE, Layer, Arc); if (Layer->On) EraseArc (Arc); newone = (ArcTypePtr)MoveArcToLayerLowLevel (Layer, Arc, Dest); ClearFromPolygon (PCB->Data, ARC_TYPE, Dest, Arc); if (Dest->On) DrawArc (Dest, newone); Draw (); return (newone); }
void *ChangeArcClearSize( LayerTypePtr Layer, ArcTypePtr Arc ) { int eax; int edx; int ebx; int esi; BDimension value = Absolute; if ( ( Arc->Flags.f & 8224 ) != 32 || Arc->Clearance == ( ( value < ( PCB->Bloat + 1 ) * 2 ? value : ( PCB->Bloat + 1 ) * 2 ) <= 0x989680 ? 10000000 : value < ( PCB->Bloat + 1 ) * 2 ? value : ( PCB->Bloat + 1 ) * 2 ) ) { } AddObjectToClearSizeUndoList( 16384, (void*)Layer, (void*)Arc, (void*)Arc ); EraseArc( Arc ); r_delete_entry( &Layer->arc_tree, (int)( &Arc->BoundingBox ) ); RestoreToPolygon( &PCB->Data, 16384, (void*)Layer, (void*)Arc ); Arc->Clearance = value; if ( value == 0 ) { Arc->Flags.f &= -33; Arc->Clearance = 1000; } SetArcBoundingBox( Arc ); r_insert_entry( &Layer->arc_tree, (int)( &Arc->BoundingBox ), 0 ); ClearFromPolygon( &PCB->Data, 16384, (void*)Layer, (void*)Arc ); DrawArc( Layer, Arc, 0 ); return (void*)Arc; }
/* --------------------------------------------------------------------------- * removes an arc from a layer */ void * RemoveArc (LayerTypePtr Layer, ArcTypePtr Arc) { /* erase from screen */ if (Layer->On) { EraseArc (Arc); if (!Bulk) Draw (); } MoveObjectToRemoveUndoList (ARC_TYPE, Layer, Arc, Arc); return NULL; }
void *ChangeArcJoin( LayerTypePtr Layer, ArcTypePtr Arc ) { int esi; EraseArc( Arc ); RestoreToPolygon( &PCB->Data, 16384, (void*)Layer, (void*)Arc ); AddObjectToClearPolyUndoList( 16384, (void*)Layer, (void*)Arc, (void*)Arc, 0 ); AddObjectToFlagUndoList( 16384, (void*)Layer, (void*)Arc, (void*)Arc ); Arc->Flags.f ^= 32; ClearFromPolygon( &PCB->Data, 16384, (void*)Layer, (void*)Arc ); AddObjectToClearPolyUndoList( 16384, (void*)Layer, (void*)Arc, (void*)Arc, 1 ); DrawArc( Layer, Arc, 0 ); return (void*)Arc; }
/* --------------------------------------------------------------------------- * erases an element */ void EraseElement (ElementType *Element) { ELEMENTLINE_LOOP (Element); { EraseLine (line); } END_LOOP; ARC_LOOP (Element); { EraseArc (arc); } END_LOOP; EraseElementName (Element); EraseElementPinsAndPads (Element); }
/* --------------------------------------------------------------------------- * 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); }
void *ChangeArcSize( LayerTypePtr Layer, ArcTypePtr Arc ) { int eax; int ebx; int esi; int edi; BDimension value = Absolute; if ( value + -1 <= 0x98967f && Arc->Thickness != value ) { AddObjectToSizeUndoList( 16384, (void*)Layer, (void*)Arc, (void*)Arc ); EraseArc( Arc ); r_delete_entry( &Layer->arc_tree, (int)( &Arc->BoundingBox ) ); RestoreToPolygon( &PCB->Data, 16384, (void*)Layer, (void*)Arc ); Arc->Thickness = value; SetArcBoundingBox( Arc ); r_insert_entry( &Layer->arc_tree, (int)( &Arc->BoundingBox ), 0 ); ClearFromPolygon( &PCB->Data, 16384, (void*)Layer, (void*)Arc ); DrawArc( Layer, Arc, 0 ); return (void*)Arc; } }
void _HYPlatformGraphicPane::_EraseArc (_HYRect rectDesc, int s, int f) { Rect r= HYRect2Rect (rectDesc); EraseArc (&r,s,f); }