Exemplo n.º 1
0
void *ChangeViaSize( PinTypePtr Via )
{
  int eax;
  int ebx;
  int esi;
  BDimension value = Absolute;
  if ( value > 0x989680 || ( ( Via->Flags.f & 8 ) & 255 ) || value <= 1999 || value <= Via->DrillingHole + 399 || Via->Thickness == value )
  {
  }
  AddObjectToSizeUndoList( 1, (void*)Via, (void*)Via, (void*)Via );
  EraseVia( Via );
  r_delete_entry( &PCB->Data->via_tree, (int)( &Via->BoundingBox ) );
  RestoreToPolygon( &PCB->Data, 256, (void*)Via, (void*)Via );
  if ( Via->Mask )
  {
    AddObjectToMaskSizeUndoList( 1, (void*)Via, (void*)Via, (void*)Via );
    Via->Mask = ( Via->Mask + value ) - Via->Thickness;
  }
  Via->Thickness = value;
  SetPinBoundingBox( Via );
  r_insert_entry( &PCB->Data->via_tree, (int)( &Via->BoundingBox ), 0 );
  ClearFromPolygon( &PCB->Data, 1, (void*)Via, (void*)Via );
  DrawVia( Via, 0 );
  return (void*)Via;
}
Exemplo n.º 2
0
void *ChangeLineClearSize( LayerTypePtr Layer, LineTypePtr Line )
{
  int eax;
  int edx;
  int ebx;
  int esi;
  BDimension value = Absolute;
  if ( ( Line->Flags.f & 8224 ) != 32 || Line->Clearance == ( ( value < ( PCB->Bloat + 1 ) * 2 ? value : ( PCB->Bloat + 1 ) * 2 ) <= 0x989680 ? 10000000 : value < ( PCB->Bloat + 1 ) * 2 ? value : ( PCB->Bloat + 1 ) * 2 ) )
  {
  }
  AddObjectToClearSizeUndoList( 4, (void*)Layer, (void*)Line, (void*)Line );
  RestoreToPolygon( &PCB->Data, 4, (void*)Layer, (void*)Line );
  EraseLine( Line );
  r_delete_entry( &Layer->line_tree, (int)( &Line->BoundingBox ) );
  Line->Clearance = value;
  if ( value == 0 )
  {
    Line->Flags.f &= -33;
    Line->Clearance = 1000;
  }
  SetLineBoundingBox( Line );
  r_insert_entry( &Layer->line_tree, (int)( &Line->BoundingBox ), 0 );
  ClearFromPolygon( &PCB->Data, 4, (void*)Layer, (void*)Line );
  DrawLine( Layer, Line, 0 );
  return (void*)Line;
}
Exemplo n.º 3
0
void *ChangeViaClearSize( PinTypePtr Via )
{
  int eax;
  int ecx;
  int ebx;
  int esi;
  BDimension value = Absolute;
  if ( ( Via->Flags.f & 8192 ) == 0 )
  {
    value = ( value <= 0x989680 ? 0x989680 : value ) < 0 ? value <= 0x989680 ? 10000000 : value : Via->Flags.f & 8192;
    if ( Delta < 0 )
      value = value < ( PCB->Bloat * 2 ) ? value : Via->Flags.f & 8192;
    else
    if ( !1 )
      value = value < ( PCB->Bloat * 2 ) ? value : ( PCB->Bloat + 1 ) * 2;
      if ( Via->Clearance != value )
      {
        RestoreToPolygon( &PCB->Data, 1, (void*)Via, (void*)Via );
        AddObjectToClearSizeUndoList( 1, (void*)Via, (void*)Via, (void*)Via );
        EraseVia( Via );
        r_delete_entry( &PCB->Data->via_tree, (int)( &Via->BoundingBox ) );
        Via->Clearance = value;
        SetPinBoundingBox( Via );
        r_insert_entry( &PCB->Data->via_tree, (int)( &Via->BoundingBox ), 0 );
        ClearFromPolygon( &PCB->Data, 1, (void*)Via, (void*)Via );
        DrawVia( Via, 0 );
        Via->Element = 0;
        return (void*)Via;
      }
  }
  return 0;
}
Exemplo n.º 4
0
/* ---------------------------------------------------------------------------
 * 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);
}
Exemplo n.º 5
0
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;
}
Exemplo n.º 6
0
/* ---------------------------------------------------------------------------
 * moves a text object between layers; lowlevel routines
 */
static void *
MoveTextToLayerLowLevel (LayerType *Source, TextType *text,
			 LayerType *Destination)
{
  RestoreToPolygon (PCB->Data, TEXT_TYPE, Source, text);
  r_delete_entry (Source->text_tree, (BoxType *)text);

  Source->Text = g_list_remove (Source->Text, text);
  Source->TextN --;
  Destination->Text = g_list_append (Destination->Text, text);
  Destination->TextN ++;

  if (GetLayerGroupNumberByNumber (solder_silk_layer) ==
      GetLayerGroupNumberByPointer (Destination))
    SET_FLAG (ONSOLDERFLAG, text);
  else
    CLEAR_FLAG (ONSOLDERFLAG, text);

  /* re-calculate the bounding box (it could be mirrored now) */
  SetTextBoundingBox (&PCB->Font, text);
  if (!Destination->text_tree)
    Destination->text_tree = r_create_tree (NULL, 0, 0);
  r_insert_entry (Destination->text_tree, (BoxType *)text, 0);
  ClearFromPolygon (PCB->Data, TEXT_TYPE, Destination, text);

  return text;
}
Exemplo n.º 7
0
void
FreeRotateElementLowLevel (DataType *Data, ElementType *Element,
			   Coord X, Coord Y,
			   double cosa, double sina, Angle angle)
{
  /* solder side objects need a different orientation */

  /* the text subroutine decides by itself if the direction
   * is to be corrected
   */
#if 0
  ELEMENTTEXT_LOOP (Element);
  {
    if (Data && Data->name_tree[n])
      r_delete_entry (Data->name_tree[n], (BoxType *)text);
    RotateTextLowLevel (text, X, Y, Number);
  }
  END_LOOP;
#endif
  ELEMENTLINE_LOOP (Element);
  {
    free_rotate (&line->Point1.X, &line->Point1.Y, X, Y, cosa, sina);
    free_rotate (&line->Point2.X, &line->Point2.Y, X, Y, cosa, sina);
    SetLineBoundingBox (line);
  }
  END_LOOP;
  PIN_LOOP (Element);
  {
    /* pre-delete the pins from the pin-tree before their coordinates change */
    if (Data)
      r_delete_entry (Data->pin_tree, (BoxType *)pin);
    RestoreToPolygon (Data, PIN_TYPE, Element, pin);
    free_rotate (&pin->X, &pin->Y, X, Y, cosa, sina);
    SetPinBoundingBox (pin);
  }
  END_LOOP;
  PAD_LOOP (Element);
  {
    /* pre-delete the pads before their coordinates change */
    if (Data)
      r_delete_entry (Data->pad_tree, (BoxType *)pad);
    RestoreToPolygon (Data, PAD_TYPE, Element, pad);
    free_rotate (&pad->Point1.X, &pad->Point1.Y, X, Y, cosa, sina);
    free_rotate (&pad->Point2.X, &pad->Point2.Y, X, Y, cosa, sina);
    SetLineBoundingBox ((LineType *) pad);
  }
  END_LOOP;
  ARC_LOOP (Element);
  {
    free_rotate (&arc->X, &arc->Y, X, Y, cosa, sina);
    arc->StartAngle = NormalizeAngle (arc->StartAngle + angle);
  }
  END_LOOP;

  free_rotate (&Element->MarkX, &Element->MarkY, X, Y, cosa, sina);
  SetElementBoundingBox (Data, Element, &PCB->Font);
  ClearFromPolygon (Data, ELEMENT_TYPE, Element, Element);
}
Exemplo n.º 8
0
/* ---------------------------------------------------------------------------
 * moves a element to buffer without allocating memory for pins/names
 */
static void *
MoveElementToBuffer (ElementType *element)
{
  /*
   * Delete the element from the source (remove it from trees,
   * restore to polygons)
   */
  r_delete_element (Source, element);

  Source->Element = g_list_remove (Source->Element, element);
  Source->ElementN --;
  Dest->Element = g_list_append (Dest->Element, element);
  Dest->ElementN ++;

  PIN_LOOP (element);
  {
    RestoreToPolygon(Source, PIN_TYPE, element, pin);
    CLEAR_FLAG (WARNFLAG | NOCOPY_FLAGS, pin);
  }
  END_LOOP;
  PAD_LOOP (element);
  {
    RestoreToPolygon(Source, PAD_TYPE, element, pad);
    CLEAR_FLAG (WARNFLAG | NOCOPY_FLAGS, pad);
  }
  END_LOOP;
  SetElementBoundingBox (Dest, element, &PCB->Font);
  /*
   * Now clear the from the polygons in the destination
   */
  PIN_LOOP (element);
  {
    ClearFromPolygon (Dest, PIN_TYPE, element, pin);
  }
  END_LOOP;
  PAD_LOOP (element);
  {
    ClearFromPolygon (Dest, PAD_TYPE, element, pad);
  }
  END_LOOP;

  return element;
}
Exemplo n.º 9
0
/* ---------------------------------------------------------------------------
 * mirrors the coordinates of an element
 * an additional offset is passed
 */
void
MirrorElementCoordinates (DataTypePtr Data, ElementTypePtr Element,
			  Coord yoff)
{
  r_delete_element (Data, Element);
  ELEMENTLINE_LOOP (Element);
  {
    line->Point1.X = SWAP_X (line->Point1.X);
    line->Point1.Y = SWAP_Y (line->Point1.Y) + yoff;
    line->Point2.X = SWAP_X (line->Point2.X);
    line->Point2.Y = SWAP_Y (line->Point2.Y) + yoff;
  }
  END_LOOP;
  PIN_LOOP (Element);
  {
    RestoreToPolygon (Data, PIN_TYPE, Element, pin);
    pin->X = SWAP_X (pin->X);
    pin->Y = SWAP_Y (pin->Y) + yoff;
  }
  END_LOOP;
  PAD_LOOP (Element);
  {
    RestoreToPolygon (Data, PAD_TYPE, Element, pad);
    pad->Point1.X = SWAP_X (pad->Point1.X);
    pad->Point1.Y = SWAP_Y (pad->Point1.Y) + yoff;
    pad->Point2.X = SWAP_X (pad->Point2.X);
    pad->Point2.Y = SWAP_Y (pad->Point2.Y) + yoff;
    TOGGLE_FLAG (ONSOLDERFLAG, pad);
  }
  END_LOOP;
  ARC_LOOP (Element);
  {
    arc->X = SWAP_X (arc->X);
    arc->Y = SWAP_Y (arc->Y) + yoff;
    arc->StartAngle = SWAP_ANGLE (arc->StartAngle);
    arc->Delta = SWAP_DELTA (arc->Delta);
  }
  END_LOOP;
  ELEMENTTEXT_LOOP (Element);
  {
    text->X = SWAP_X (text->X);
    text->Y = SWAP_Y (text->Y) + yoff;
    TOGGLE_FLAG (ONSOLDERFLAG, text);
  }
  END_LOOP;
  Element->MarkX = SWAP_X (Element->MarkX);
  Element->MarkY = SWAP_Y (Element->MarkY) + yoff;

  /* now toggle the solder-side flag */
  TOGGLE_FLAG (ONSOLDERFLAG, Element);
  /* this inserts all of the rtree data too */
  SetElementBoundingBox (Data, Element, &PCB->Font);
  ClearFromPolygon (Data, ELEMENT_TYPE, Element, Element);
}
Exemplo n.º 10
0
void *ChangeTextJoin( LayerTypePtr Layer, TextTypePtr Text )
{
  int esi;
  EraseText( Layer, Text );
  AddObjectToClearPolyUndoList( 16, (void*)Layer, (void*)Text, (void*)Text, 0 );
  RestoreToPolygon( &PCB->Data, 16, (void*)Layer, (void*)Text );
  AddObjectToFlagUndoList( 4, (void*)Layer, (void*)Text, (void*)Text );
  Text->Flags.f ^= 32;
  AddObjectToClearPolyUndoList( 16, (void*)Layer, (void*)Text, (void*)Text, 1 );
  ClearFromPolygon( &PCB->Data, 16, (void*)Layer, (void*)Text );
  DrawText( Layer, Text, 0 );
  return (void*)Text;
}
Exemplo n.º 11
0
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;
}
Exemplo n.º 12
0
void *ChangeLineJoin( LayerTypePtr Layer, LineTypePtr Line )
{
  int esi;
  EraseLine( Line );
  AddObjectToClearPolyUndoList( 4, (void*)Layer, (void*)Line, (void*)Line, 0 );
  RestoreToPolygon( &PCB->Data, 4, (void*)Layer, (void*)Line );
  AddObjectToFlagUndoList( 4, (void*)Layer, (void*)Line, (void*)Line );
  Line->Flags.f ^= 32;
  AddObjectToClearPolyUndoList( 4, (void*)Layer, (void*)Line, (void*)Line, 1 );
  ClearFromPolygon( &PCB->Data, 4, (void*)Layer, (void*)Line );
  DrawLine( Layer, Line, 0 );
  return (void*)Line;
}
Exemplo n.º 13
0
void *ChangeElement2ndSize( ElementTypePtr Element )
{
  int eax;
  int edx;
  int ebx;
  int edi;
  Boolean changed;
  BDimension value;
{
  Cardinal n;
  Cardinal sn = Element->PinN;
  PinTypePtr pin;
  if ( Element->PinN )
  {
    n = 0;
    changed = 0;
    while ( 1 )
    {
      if ( value + -400 <= 0x9894f0 && ( ( ( pin->Flags.f/*.1_1of4*/ & 8 ) & 255 ) || value < pin->Thickness + -399 ) && pin->DrillingHole != value )
      {
        AddObjectTo2ndSizeUndoList( 256, (void*)Element, (void*)pin, (void*)pin );
        ErasePin( pin );
        pin->DrillingHole = value;
        DrawPin( pin, 0 );
        if ( ( pin->Flags.f/*.1_1of4*/ & 8 ) & 255 )
        {
          RestoreToPolygon( &PCB->Data, 256, (void*)Element, (void*)pin );
          AddObjectToSizeUndoList( 256, (void*)Element, (void*)pin, (void*)pin );
          pin->Thickness = value;
          ClearFromPolygon( &PCB->Data, 256, (void*)Element, (void*)pin );
          changed = 1;
          sn = Element->PinN;
        }
        else
        {
          sn = *(int*)(ebp_36 + 224);
          changed = 1;
        }
      }
      if ( sn == 0 || sn <= ( sn + n + 1 ) - Element->PinN )
        break;
      else
      {
      }
    }
    return ebp_36;
  }
  return 0;
}
}
Exemplo n.º 14
0
static void *
MyMoveLineLowLevel (DataType *Data, LayerType *Layer, LineType *Line, Coord dx, Coord dy)
{
  if (Data)
  {
    RestoreToPolygon (Data, LINE_TYPE, Layer, Line);
    r_delete_entry (Layer->line_tree, (BoxType *) Line);
  }
  MOVE_LINE_LOWLEVEL (Line, dx, dy);
  if (Data)
  {
    r_insert_entry (Layer->line_tree, (BoxType *) Line, 0);
    ClearFromPolygon (Data, LINE_TYPE, Layer, Line);
  }
  return Line;
}
Exemplo n.º 15
0
static void *
MyMoveViaLowLevel (DataType *Data, PinType *Via, Coord dx, Coord dy)
{
  if (Data)
  {
    RestoreToPolygon (Data, VIA_TYPE, Via, Via);
    r_delete_entry (Data->via_tree, (BoxType *) Via);
  }
  MOVE_VIA_LOWLEVEL (Via, dx, dy);
  if (Data)
  {
    r_insert_entry (Data->via_tree, (BoxType *) Via, 0);
    ClearFromPolygon (Data, VIA_TYPE, Via, Via);
  }
  return Via;
}
Exemplo n.º 16
0
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;
}
Exemplo n.º 17
0
/* ---------------------------------------------------------------------------
 * moves a via
 */
static void *
MoveVia (PinTypePtr Via)
{
  r_delete_entry (PCB->Data->via_tree, (BoxType *)Via);
  RestoreToPolygon (PCB->Data, VIA_TYPE, Via, Via);
  MOVE_VIA_LOWLEVEL (Via, DeltaX, DeltaY);
  if (PCB->ViaOn)
    EraseVia (Via);
  r_insert_entry (PCB->Data->via_tree, (BoxType *)Via, 0);
  ClearFromPolygon (PCB->Data, VIA_TYPE, Via, Via);
  if (PCB->ViaOn)
    {
      DrawVia (Via);
      Draw ();
    }
  return (Via);
}
Exemplo n.º 18
0
/* ---------------------------------------------------------------------------
 * moves a line
 */
static void *
MoveLine (LayerTypePtr Layer, LineTypePtr Line)
{
  if (Layer->On)
    EraseLine (Line);
  RestoreToPolygon (PCB->Data, LINE_TYPE, Layer, Line);
  r_delete_entry (Layer->line_tree, (BoxType *)Line);
  MOVE_LINE_LOWLEVEL (Line, DeltaX, DeltaY);
  r_insert_entry (Layer->line_tree, (BoxType *)Line, 0);
  ClearFromPolygon (PCB->Data, LINE_TYPE, Layer, Line);
  if (Layer->On)
    {
      DrawLine (Layer, Line);
      Draw ();
    }
  return (Line);
}
Exemplo n.º 19
0
void *ChangePinThermal( ElementTypePtr element, PinTypePtr Pin )
{
  int ecx;
  int edx;
  AddObjectToClearPolyUndoList( 256, (void*)element, (void*)Pin, (void*)Pin, 0 );
  RestoreToPolygon( &PCB->ID, 1, PCB->SilkActive == 0 ? *(int*)(PCB + 8716) + ( LayerStack[0] * 92 ) + 76 : PCB->Data + ( ( PCB->Data->LayerN + ( Settings.ShowSolderSide == 0 ) ) * 92 ) + 76, (void*)Pin );
  AddObjectToFlagUndoList( 256, (void*)element, (void*)Pin, (void*)Pin );
  if ( Delta == 0 )
  {
  }
  else
  {
  }
  AddObjectToClearPolyUndoList( 256, (void*)element, (void*)Pin, (void*)Pin, 1 );
  ClearFromPolygon( &PCB->Data, 1, PCB->Data[5].name_tree[0] + ( LayerStack[0] * 92 ) + 76, (void*)Pin );
  DrawPin( Pin, 0 );
  return (void*)Pin;
}
Exemplo n.º 20
0
void *ChangeViaThermal( PinTypePtr Via )
{
  int ecx;
  int edx;
  AddObjectToClearPolyUndoList( 1, (void*)Via, (void*)Via, (void*)Via, 0 );
  RestoreToPolygon( &PCB->ID, 1, PCB->SilkActive == 0 ? *(int*)(PCB + 8716) + ( LayerStack[0] * 92 ) + 76 : PCB->Data + ( ( PCB->Data->LayerN + ( Settings.ShowSolderSide == 0 ) ) * 92 ) + 76, (void*)Via );
  AddObjectToFlagUndoList( 1, (void*)Via, (void*)Via, (void*)Via );
  if ( Delta == 0 )
  {
  }
  else
  {
  }
  AddObjectToClearPolyUndoList( 1, (void*)Via, (void*)Via, (void*)Via, 1 );
  ClearFromPolygon( &PCB->Data, 1, PCB->Data[5].name_tree[0] + ( LayerStack[0] * 92 ) + 76, (void*)Via );
  DrawVia( Via, 0 );
  return (void*)Via;
}
Exemplo n.º 21
0
/* ---------------------------------------------------------------------------
 * moves a text object
 */
static void *
MoveText (LayerTypePtr Layer, TextTypePtr Text)
{
  RestoreToPolygon (PCB->Data, TEXT_TYPE, Layer, Text);
  r_delete_entry (Layer->text_tree, (BoxType *)Text);
  if (Layer->On)
    {
      EraseText (Layer, Text);
      MOVE_TEXT_LOWLEVEL (Text, DeltaX, DeltaY);
      DrawText (Layer, Text);
      Draw ();
    }
  else
    MOVE_TEXT_LOWLEVEL (Text, DeltaX, DeltaY);
  r_insert_entry (Layer->text_tree, (BoxType *)Text, 0);
  ClearFromPolygon (PCB->Data, TEXT_TYPE, Layer, Text);
  return (Text);
}
Exemplo n.º 22
0
/* ---------------------------------------------------------------------------
 * moves a via to paste buffer without allocating memory for the name
 */
static void *
MoveViaToBuffer (PinType *via)
{
  RestoreToPolygon (Source, VIA_TYPE, via, via);

  r_delete_entry (Source->via_tree, (BoxType *) via);
  Source->Via = g_list_remove (Source->Via, via);
  Source->ViaN --;
  Dest->Via = g_list_append (Dest->Via, via);
  Dest->ViaN ++;

  CLEAR_FLAG (WARNFLAG | NOCOPY_FLAGS, via);

  if (!Dest->via_tree)
    Dest->via_tree = r_create_tree (NULL, 0, 0);
  r_insert_entry (Dest->via_tree, (BoxType *)via, 0);
  ClearFromPolygon (Dest, VIA_TYPE, via, via);
  return via;
}
Exemplo n.º 23
0
/* ---------------------------------------------------------------------------
 * moves a text to buffer without allocating memory for the name
 */
static void *
MoveTextToBuffer (LayerType *layer, TextType *text)
{
  LayerType *lay = &Dest->Layer[GetLayerNumber (Source, layer)];

  r_delete_entry (layer->text_tree, (BoxType *)text);
  RestoreToPolygon (Source, TEXT_TYPE, layer, text);

  layer->Text = g_list_remove (layer->Text, text);
  layer->TextN --;
  lay->Text = g_list_append (lay->Text, text);
  lay->TextN ++;

  if (!lay->text_tree)
    lay->text_tree = r_create_tree (NULL, 0, 0);
  r_insert_entry (lay->text_tree, (BoxType *)text, 0);
  ClearFromPolygon (Dest, TEXT_TYPE, lay, text);
  return (text);
}
Exemplo n.º 24
0
/* ---------------------------------------------------------------------------
 * 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);
}
Exemplo n.º 25
0
void *ChangePinClearSize( ElementTypePtr Element, PinTypePtr Pin )
{
  int eax;
  int ebx;
  int esi;
  BDimension value = Absolute;
  value = ( Pin->Clearance + Delta < ( PCB->Bloat + 1 ) * 2 ? Pin->Clearance + Delta : ( PCB->Bloat + 1 ) * 2 ) <= 0x989680 ? 0x989680 : Pin->Clearance + Delta < ( PCB->Bloat + 1 ) * 2 ? Pin->Clearance + Delta : ( PCB->Bloat + 1 ) * 2;
  if ( Pin->Clearance != ( ( Pin->Clearance + Delta < ( PCB->Bloat + 1 ) * 2 ? Pin->Clearance + Delta : ( PCB->Bloat + 1 ) * 2 ) <= 0x989680 ? 10000000 : Pin->Clearance + Delta < ( PCB->Bloat + 1 ) * 2 ? Pin->Clearance + Delta : ( PCB->Bloat + 1 ) * 2 ) )
  {
    RestoreToPolygon( &PCB->Data, 256, (void*)Element, (void*)Pin );
    AddObjectToClearSizeUndoList( 256, (void*)Element, (void*)Pin, (void*)Pin );
    ErasePin( Pin );
    r_delete_entry( &PCB->Data->pin_tree, (int)( &Pin->BoundingBox ) );
    Pin->Clearance = value;
    SetElementBoundingBox( &PCB->Data, Element, &PCB->Font );
    ClearFromPolygon( &PCB->Data, 256, (void*)Element, (void*)Pin );
    DrawPin( Pin, 0 );
    return (void*)Pin;
  }
}
Exemplo n.º 26
0
void *ChangePadClearSize( ElementTypePtr Element, PadTypePtr Pad )
{
  int eax;
  int ebx;
  int esi;
  BDimension value = Absolute;
  value = ( Pad->Clearance + Delta < ( PCB->Bloat + 1 ) * 2 ? Pad->Clearance + Delta : ( PCB->Bloat + 1 ) * 2 ) <= 0x989680 ? 0x989680 : Pad->Clearance + Delta < ( PCB->Bloat + 1 ) * 2 ? Pad->Clearance + Delta : ( PCB->Bloat + 1 ) * 2;
  if ( value + -100 <= 0x98961c && Pad->Clearance != value )
  {
    AddObjectToClearSizeUndoList( 512, (void*)Element, (void*)Pad, (void*)Pad );
    RestoreToPolygon( &PCB->Data, 512, (void*)Element, (void*)Pad );
    ErasePad( Pad );
    r_delete_entry( &PCB->Data->pad_tree, (int)( &Pad->BoundingBox ) );
    Pad->Clearance = value;
    SetElementBoundingBox( &PCB->Data, Element, &PCB->Font );
    ClearFromPolygon( &PCB->Data, 512, (void*)Element, (void*)Pad );
    DrawPad( Pad, 0 );
    return (void*)Pad;
  }
}
Exemplo n.º 27
0
/* ---------------------------------------------------------------------------
 * moves a line to buffer  
 */
static void *
MoveLineToBuffer (LayerType *layer, LineType *line)
{
  LayerType *lay = &Dest->Layer[GetLayerNumber (Source, layer)];

  RestoreToPolygon (Source, LINE_TYPE, layer, line);
  r_delete_entry (layer->line_tree, (BoxType *)line);

  layer->Line = g_list_remove (layer->Line, line);
  layer->LineN --;
  lay->Line = g_list_append (lay->Line, line);
  lay->LineN ++;

  CLEAR_FLAG (NOCOPY_FLAGS, line);

  if (!lay->line_tree)
    lay->line_tree = r_create_tree (NULL, 0, 0);
  r_insert_entry (lay->line_tree, (BoxType *)line, 0);
  ClearFromPolygon (Dest, LINE_TYPE, lay, line);
  return (line);
}
Exemplo n.º 28
0
void *ChangeLineSize( LayerTypePtr Layer, LineTypePtr Line )
{
  int eax;
  int ebx;
  int esi;
  int edi;
  BDimension value = Absolute;
  if ( value + -1 <= 0x98967f && Line->Thickness != value )
  {
    AddObjectToSizeUndoList( 4, (void*)Layer, (void*)Line, (void*)Line );
    EraseLine( Line );
    r_delete_entry( &Layer->line_tree, (int)( &Line->BoundingBox ) );
    RestoreToPolygon( &PCB->Data, 4, (void*)Layer, (void*)Line );
    Line->Thickness = value;
    SetLineBoundingBox( Line );
    r_insert_entry( &Layer->line_tree, (int)( &Line->BoundingBox ), 0 );
    ClearFromPolygon( &PCB->Data, 4, (void*)Layer, (void*)Line );
    DrawLine( Layer, Line, 0 );
    return (void*)Line;
  }
}
Exemplo n.º 29
0
/* ---------------------------------------------------------------------------
 * moves an arc to buffer  
 */
static void *
MoveArcToBuffer (LayerType *layer, ArcType *arc)
{
  LayerType *lay = &Dest->Layer[GetLayerNumber (Source, layer)];

  RestoreToPolygon (Source, ARC_TYPE, layer, arc);
  r_delete_entry (layer->arc_tree, (BoxType *)arc);

  layer->Arc = g_list_remove (layer->Arc, arc);
  layer->ArcN --;
  lay->Arc = g_list_append (lay->Arc, arc);
  lay->ArcN ++;

  CLEAR_FLAG (NOCOPY_FLAGS, arc);

  if (!lay->arc_tree)
    lay->arc_tree = r_create_tree (NULL, 0, 0);
  r_insert_entry (lay->arc_tree, (BoxType *)arc, 0);
  ClearFromPolygon (Dest, ARC_TYPE, lay, arc);
  return (arc);
}
Exemplo n.º 30
0
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;
  }
}