[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

gEDA-cvs: pcb.git: branch: master updated (9f72cd4f9766f938cf7c44beab1929bef23ada5e)



The branch, master has been updated
       via  9f72cd4f9766f938cf7c44beab1929bef23ada5e (commit)
       via  308071436ff71da2a9df7ec88fae28175c87cf82 (commit)
       via  294494e56695251e63c0da9f243d6f59447f1c9f (commit)
       via  f7d4910676be74e3aa2096d2807ba00090a6fa4e (commit)
       via  94bf4a283f8b0561b14c6fdbe2b13e118430855f (commit)
      from  9a20f7e1ecc6d8451347f5fdb6f3f32927811555 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


=========
 Summary
=========

 src/draw.c              |   54 +++++++++++++++++++++++-----------------------
 src/hid/gerber/gerber.c |   23 +++++++++----------
 src/hid/ps/ps.c         |   17 ++++++--------
 src/misc.c              |   25 +++++++++++++++++++++
 src/misc.h              |    3 ++
 5 files changed, 73 insertions(+), 49 deletions(-)


=================
 Commit Messages
=================

commit 9f72cd4f9766f938cf7c44beab1929bef23ada5e
Author: DJ Delorie <dj@xxxxxxxxxxx>
Commit: DJ Delorie <dj@xxxxxxxxxxx>

    Remove (now) unused variable.

:100644 100644 b3e39c7... bc00a7e... M	src/draw.c

commit 308071436ff71da2a9df7ec88fae28175c87cf82
Author: DJ Delorie <dj@xxxxxxxxxxx>
Commit: DJ Delorie <dj@xxxxxxxxxxx>

    Don't draw an empty outline layer.
    
    If the design has an outline layer, and it's empty, draw an outline
    anyway - around the whole work area.

:100644 100644 6091ef3... b3e39c7... M	src/draw.c

commit 294494e56695251e63c0da9f243d6f59447f1c9f
Author: DJ Delorie <dj@xxxxxxxxxxx>
Commit: DJ Delorie <dj@xxxxxxxxxxx>

    Fix PS rect/outline logic
    
    PS's draw_rect was actually doing a fill_rect.  Fixed.
    
    If the design has an outline layer, draw it in more of the cases where
    we would draw the synthetic outline.

:100644 100644 7c286cc... 86c3156... M	src/hid/ps/ps.c

commit f7d4910676be74e3aa2096d2807ba00090a6fa4e
Author: DJ Delorie <dj@xxxxxxxxxxx>
Commit: DJ Delorie <dj@xxxxxxxxxxx>

    Add IsEmpty functions
    
    Add functions to test if a given layer or layer group is "empty" -
    i.e. has none of its own drawing items on it.

:100644 100644 a7704f4... 2391d26... M	src/misc.c
:100644 100644 ac3d442... b46cad4... M	src/misc.h

commit 94bf4a283f8b0561b14c6fdbe2b13e118430855f
Author: DJ Delorie <dj@xxxxxxxxxxx>
Commit: DJ Delorie <dj@xxxxxxxxxxx>

    Fix gerber output
    
    Use the correct DRC minimums for drawn outlines on silk and copper
    layers.
    
    Draw rectangles as unfilled, not filled.

:100644 100644 8f04180... 868c2b1... M	src/hid/gerber/gerber.c

=========
 Changes
=========

commit 9f72cd4f9766f938cf7c44beab1929bef23ada5e
Author: DJ Delorie <dj@xxxxxxxxxxx>
Commit: DJ Delorie <dj@xxxxxxxxxxx>

    Remove (now) unused variable.

diff --git a/src/draw.c b/src/draw.c
index b3e39c7..bc00a7e 100644
--- a/src/draw.c
+++ b/src/draw.c
@@ -880,7 +880,6 @@ DrawLayerGroup (int group, const BoxType * screen)
 {
   int i, rv = 1;
   int layernum;
-  struct pin_info info;
   LayerTypePtr Layer;
   int n_entries = PCB->LayerGroups.Number[group];
   Cardinal *layers = PCB->LayerGroups.Entries[group];

commit 308071436ff71da2a9df7ec88fae28175c87cf82
Author: DJ Delorie <dj@xxxxxxxxxxx>
Commit: DJ Delorie <dj@xxxxxxxxxxx>

    Don't draw an empty outline layer.
    
    If the design has an outline layer, and it's empty, draw an outline
    anyway - around the whole work area.

diff --git a/src/draw.c b/src/draw.c
index 6091ef3..b3e39c7 100644
--- a/src/draw.c
+++ b/src/draw.c
@@ -826,16 +826,19 @@ text_callback (const BoxType * b, void *cl)
  * draws one non-copper layer
  */
 void
-DrawLayer (LayerTypePtr Layer, const BoxType * screen)
+DrawLayerCommon (LayerTypePtr Layer, const BoxType * screen, bool clear_pins)
 {
   struct pin_info info;
 
   /* print the non-clearing polys */
   info.Layer = Layer;
-  info.arg = false;
+  info.arg = clear_pins;
   clip_box = screen;
   r_search (Layer->polygon_tree, screen, NULL, poly_callback, &info);
 
+  if (clear_pins && TEST_FLAG (CHECKPLANESFLAG, PCB))
+    return;
+
   /* draw all visible lines this layer */
   r_search (Layer->line_tree, screen, NULL, line_callback, Layer);
 
@@ -844,9 +847,30 @@ DrawLayer (LayerTypePtr Layer, const BoxType * screen)
 
   /* draw the layer text on screen */
   r_search (Layer->text_tree, screen, NULL, text_callback, Layer);
+
+  /* We should check for gui->gui here, but it's kinda cool seeing the
+     auto-outline magically disappear when you first add something to
+     the "outline" layer.  */
+  if (IsLayerEmpty (Layer)
+      && (strcmp (Layer->Name, "outline") == 0
+	  || strcmp (Layer->Name, "route") == 0))
+    {
+      gui->set_color (Output.fgGC, Layer->Color);
+      gui->set_line_width (Output.fgGC, PCB->minWid);
+      gui->draw_rect (Output.fgGC,
+		      0, 0,
+		      PCB->MaxWidth, PCB->MaxHeight);
+    }
+
   clip_box = NULL;
 }
 
+void
+DrawLayer (LayerTypePtr Layer, const BoxType * screen)
+{
+  DrawLayerCommon (Layer, screen, false);
+}
+
 /* ---------------------------------------------------------------------------
  * draws one layer group.  Returns non-zero if pins and pads should be
  * drawn with this group.
@@ -870,30 +894,7 @@ DrawLayerGroup (int group, const BoxType * screen)
 	  strcmp (Layer->Name, "route") == 0)
 	rv = 0;
       if (layernum < max_copper_layer && Layer->On)
-	{
-	  /* draw all polygons on this layer */
-	  if (Layer->PolygonN)
-	    {
-	      info.Layer = Layer;
-	      info.arg = true;
-	      r_search (Layer->polygon_tree, screen, NULL, poly_callback,
-			&info);
-	      info.arg = false;
-	    }
-
-	  if (TEST_FLAG (CHECKPLANESFLAG, PCB))
-	    continue;
-
-	  /* draw all visible lines this layer */
-	  r_search (Layer->line_tree, screen, NULL, line_callback, Layer);
-
-	  /* draw the layer arcs on screen */
-	  r_search (Layer->arc_tree, screen, NULL, arc_callback, Layer);
-
-	  /* draw the layer text on screen */
-	  r_search (Layer->text_tree, screen, NULL, text_callback, Layer);
-
-	}
+	DrawLayerCommon (Layer, screen, true);
     }
   if (n_entries > 1)
     rv = 1;

commit 294494e56695251e63c0da9f243d6f59447f1c9f
Author: DJ Delorie <dj@xxxxxxxxxxx>
Commit: DJ Delorie <dj@xxxxxxxxxxx>

    Fix PS rect/outline logic
    
    PS's draw_rect was actually doing a fill_rect.  Fixed.
    
    If the design has an outline layer, draw it in more of the cases where
    we would draw the synthetic outline.

diff --git a/src/hid/ps/ps.c b/src/hid/ps/ps.c
index 7c286cc..86c3156 100644
--- a/src/hid/ps/ps.c
+++ b/src/hid/ps/ps.c
@@ -830,16 +830,14 @@ ps_set_layer (const char *name, int group, int empty)
       lastcolor = -1;
 
       fprintf (f, "/ts 10000 def\n");
-      fprintf (f,
-	       "/ty ts neg def /tx 0 def /Helvetica findfont ts scalefont setfont\n");
+      fprintf (f, "/ty ts neg def /tx 0 def /Helvetica findfont ts scalefont setfont\n");
       fprintf (f, "/t { moveto lineto stroke } bind def\n");
-      fprintf (f,
-	       "/r { /y2 exch def /x2 exch def /y1 exch def /x1 exch def\n");
-      fprintf (f,
-	       "     x1 y1 moveto x1 y2 lineto x2 y2 lineto x2 y1 lineto closepath fill } bind def\n");
+      fprintf (f, "/dr { /y2 exch def /x2 exch def /y1 exch def /x1 exch def\n");
+      fprintf (f, "      x1 y1 moveto x1 y2 lineto x2 y2 lineto x2 y1 lineto closepath stroke } bind def\n");
+      fprintf (f, "/r { /y2 exch def /x2 exch def /y1 exch def /x1 exch def\n");
+      fprintf (f, "     x1 y1 moveto x1 y2 lineto x2 y2 lineto x2 y1 lineto closepath fill } bind def\n");
       fprintf (f, "/c { 0 360 arc fill } bind def\n");
-      fprintf (f,
-	       "/a { gsave setlinewidth translate scale 0 0 1 5 3 roll arc stroke grestore} bind def\n");
+      fprintf (f, "/a { gsave setlinewidth translate scale 0 0 1 5 3 roll arc stroke grestore} bind def\n");
       if (drill_helper)
 	fprintf (f,
 		 "/dh { gsave %d setlinewidth 0 gray %d 0 360 arc stroke grestore} bind def\n",
@@ -862,7 +860,6 @@ ps_set_layer (const char *name, int group, int empty)
   if (outline
       && outline_layer
       && outline_layer != PCB->Data->Layer+idx
-      && SL_TYPE (idx) == 0 /* copper */
       && strcmp (name, "outline")
       && strcmp (name, "route"))
     {
@@ -1011,7 +1008,7 @@ static void
 ps_draw_rect (hidGC gc, int x1, int y1, int x2, int y2)
 {
   use_gc (gc);
-  fprintf (f, "%d %d %d %d r\n", x1, y1, x2, y2);
+  fprintf (f, "%d %d %d %d dr\n", x1, y1, x2, y2);
 }
 
 static void ps_fill_rect (hidGC gc, int x1, int y1, int x2, int y2);

commit f7d4910676be74e3aa2096d2807ba00090a6fa4e
Author: DJ Delorie <dj@xxxxxxxxxxx>
Commit: DJ Delorie <dj@xxxxxxxxxxx>

    Add IsEmpty functions
    
    Add functions to test if a given layer or layer group is "empty" -
    i.e. has none of its own drawing items on it.

diff --git a/src/misc.c b/src/misc.c
index a7704f4..2391d26 100644
--- a/src/misc.c
+++ b/src/misc.c
@@ -565,6 +565,31 @@ FlagIsDataEmpty (int parm)
 /* FLAG(DataEmpty,FlagIsDataEmpty,0) */
 /* FLAG(DataNonEmpty,FlagIsDataEmpty,1) */
 
+bool
+IsLayerEmpty (LayerTypePtr layer)
+{
+  return (layer->LineN == 0
+	  && layer->TextN == 0
+	  && layer->PolygonN == 0
+	  && layer->ArcN == 0);
+}
+
+bool
+IsLayerNumEmpty (int num)
+{
+  return IsLayerEmpty (PCB->Data->Layer+num);
+}
+
+bool
+IsLayerGroupEmpty (int num)
+{
+  int i;
+  for (i=0; i<PCB->LayerGroups.Number[num]; i++)
+    if (!IsLayerNumEmpty (PCB->LayerGroups.Entries[num][i]))
+      return false;
+  return true;
+}
+
 /* ---------------------------------------------------------------------------
  * gets minimum and maximum coordinates
  * returns NULL if layout is empty
diff --git a/src/misc.h b/src/misc.h
index ac3d442..b46cad4 100644
--- a/src/misc.h
+++ b/src/misc.h
@@ -44,6 +44,9 @@ void SetPadBoundingBox (PadTypePtr);
 void SetPolygonBoundingBox (PolygonTypePtr);
 void SetElementBoundingBox (DataTypePtr, ElementTypePtr, FontTypePtr);
 bool IsDataEmpty (DataTypePtr);
+bool IsLayerEmpty (LayerTypePtr);
+bool IsLayerNumEmpty (int);
+bool IsLayerGroupEmpty (int);
 BoxTypePtr GetDataBoundingBox (DataTypePtr);
 void CenterDisplay (LocationType, LocationType, bool);
 void SetFontInfo (FontTypePtr);

commit 94bf4a283f8b0561b14c6fdbe2b13e118430855f
Author: DJ Delorie <dj@xxxxxxxxxxx>
Commit: DJ Delorie <dj@xxxxxxxxxxx>

    Fix gerber output
    
    Use the correct DRC minimums for drawn outlines on silk and copper
    layers.
    
    Draw rectangles as unfilled, not filled.

diff --git a/src/hid/gerber/gerber.c b/src/hid/gerber/gerber.c
index 8f04180..868c2b1 100644
--- a/src/hid/gerber/gerber.c
+++ b/src/hid/gerber/gerber.c
@@ -776,7 +776,13 @@ gerber_set_layer (const char *name, int group, int empty)
       else if (!outline_layer)
 	{
 	  hidGC gc = gui->make_gc ();
-	  gui->set_line_width (gc, AUTO_OUTLINE_WIDTH);
+	  printf("name %s idx %d\n", name, idx);
+	  if (SL_TYPE (idx) == SL_SILK)
+	    gui->set_line_width (gc, PCB->minSlk);
+	  else if (group >= 0)
+	    gui->set_line_width (gc, PCB->minWid);
+	  else
+	    gui->set_line_width (gc, AUTO_OUTLINE_WIDTH);
 	  gui->draw_line (gc, 0, 0, PCB->MaxWidth, 0);
 	  gui->draw_line (gc, 0, 0, 0, PCB->MaxHeight);
 	  gui->draw_line (gc, PCB->MaxWidth, 0, PCB->MaxWidth, PCB->MaxHeight);
@@ -937,17 +943,10 @@ use_gc (hidGC gc, int radius)
 static void
 gerber_draw_rect (hidGC gc, int x1, int y1, int x2, int y2)
 {
-  int x[5];
-  int y[5];
-  x[0] = x[4] = x1;
-  y[0] = y[4] = y1;
-  x[1] = x1;
-  y[1] = y2;
-  x[2] = x2;
-  y[2] = y2;
-  x[3] = x2;
-  y[3] = y1;
-  gerber_fill_polygon (gc, 5, x, y);
+  gerber_draw_line (gc, x1, y1, x1, y2);
+  gerber_draw_line (gc, x1, y1, x2, y1);
+  gerber_draw_line (gc, x1, y2, x2, y2);
+  gerber_draw_line (gc, x2, y1, x2, y2);
 }
 
 static void




_______________________________________________
geda-cvs mailing list
geda-cvs@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-cvs