geda-pcb/pcjc2/v2.git
12 years agopopold_idea.stgit
Peter Clifton [Tue, 16 Feb 2010 13:33:41 +0000 (16 13:33 +0000)]
pop

12 years agopop
Peter Clifton [Tue, 16 Feb 2010 13:33:41 +0000 (16 13:33 +0000)]
pop

12 years agopop
Peter Clifton [Tue, 16 Feb 2010 13:33:39 +0000 (16 13:33 +0000)]
pop

12 years agopop
Peter Clifton [Tue, 16 Feb 2010 13:33:39 +0000 (16 13:33 +0000)]
pop

12 years agorebase
Peter Clifton [Tue, 16 Feb 2010 13:33:37 +0000 (16 13:33 +0000)]
rebase

12 years agorebase
Peter Clifton [Tue, 16 Feb 2010 13:33:37 +0000 (16 13:33 +0000)]
rebase

12 years agoundo 1
Peter Clifton [Tue, 16 Feb 2010 13:32:29 +0000 (16 13:32 +0000)]
undo 1

12 years agoundo 1
Peter Clifton [Tue, 16 Feb 2010 13:32:29 +0000 (16 13:32 +0000)]
undo 1

12 years agorebase (CONFLICT)
Peter Clifton [Tue, 16 Feb 2010 13:31:59 +0000 (16 13:31 +0000)]
rebase (CONFLICT)

12 years agorebase (CONFLICT)
Peter Clifton [Tue, 16 Feb 2010 13:31:59 +0000 (16 13:31 +0000)]
rebase (CONFLICT)

12 years agorebase
Peter Clifton [Tue, 16 Feb 2010 13:31:59 +0000 (16 13:31 +0000)]
rebase

12 years agorebase
Peter Clifton [Tue, 16 Feb 2010 13:31:59 +0000 (16 13:31 +0000)]
rebase

12 years agoKeep all pieces of a divided polygon.
Peter Clifton [Tue, 16 Feb 2010 13:31:58 +0000 (16 13:31 +0000)]
Keep all pieces of a divided polygon.

12 years agoWorkaround crash where contour is passed as NULL to poly_PreContour
Peter Clifton [Tue, 16 Feb 2010 13:30:01 +0000 (16 13:30 +0000)]
Workaround crash where contour is passed as NULL to poly_PreContour

12 years agoAllow polygons with CLEARLINEFLAG set to cut out other polygons
Peter Clifton [Tue, 16 Feb 2010 13:30:01 +0000 (16 13:30 +0000)]
Allow polygons with CLEARLINEFLAG set to cut out other polygons

Gives the possibility to mask out regions which are to be free of
polygon fill.

12 years agoAllow zero clearance pads and pins to touch polygons
Peter Clifton [Tue, 16 Feb 2010 13:20:00 +0000 (16 13:20 +0000)]
Allow zero clearance pads and pins to touch polygons

This was already supported for vias, lets be consistent.

12 years agoBoard outline polygon generation
Peter Clifton [Tue, 16 Feb 2010 13:20:00 +0000 (16 13:20 +0000)]
Board outline polygon generation

FIXME: Make this work with the GL masking polygon drawing routines, rather
       than relying on the dicer.

12 years agoFixup depth for layers and element marks
Peter Clifton [Tue, 16 Feb 2010 13:19:59 +0000 (16 13:19 +0000)]
Fixup depth for layers and element marks

12 years agoLayer fixes
Peter Clifton [Tue, 16 Feb 2010 13:19:58 +0000 (16 13:19 +0000)]
Layer fixes

** SHOULD MERGE SOME OF THIS COMMIT DOWN INTO OTHER PATCHES? **

Fix mask display in 3D (Allow both side masks to display at once)
Fix rendering depths for silk and mask layers

12 years agoAdd routines to render just a single contour
Peter Clifton [Tue, 16 Feb 2010 13:19:58 +0000 (16 13:19 +0000)]
Add routines to render just a single contour

Use them rather than the GLU tessellator

12 years agoRemove unused intersection routines from cairo-bentley-ottman.c
Peter Clifton [Tue, 16 Feb 2010 13:19:57 +0000 (16 13:19 +0000)]
Remove unused intersection routines from cairo-bentley-ottman.c

Our polygons are (supposed to be) free from intersections!

12 years agoBentley-Ottann test implementation
Peter Clifton [Tue, 16 Feb 2010 13:19:57 +0000 (16 13:19 +0000)]
Bentley-Ottann test implementation

12 years agoPlay with display lists
Peter Clifton [Tue, 16 Feb 2010 13:19:56 +0000 (16 13:19 +0000)]
Play with display lists

12 years agoPlaying with stack rendering
Peter Clifton [Tue, 16 Feb 2010 13:19:56 +0000 (16 13:19 +0000)]
Playing with stack rendering

12 years agoFrom 22f4d1dd450f218172b8ee0edf9a2aaef6c20f2f Mon Sep 17 00:00:00 2001
Bert Timmerman [Tue, 16 Feb 2010 13:19:55 +0000 (16 13:19 +0000)]
From 22f4d1dd450f218172b8ee0edf9a2aaef6c20f2f Mon Sep 17 00:00:00 2001
Subject: [PATCH] Additional defines for a 3D joystick for (older) linux versions which do not have these defines in <linux/input.h>

12 years agoSilly space navigator interface to allow funky views
Peter Clifton [Tue, 16 Feb 2010 13:19:54 +0000 (16 13:19 +0000)]
Silly space navigator interface to allow funky views

12 years agoMajor re-write to drawing routines
Peter Clifton [Tue, 16 Feb 2010 13:19:54 +0000 (16 13:19 +0000)]
Major re-write to drawing routines

12 years agoFix grid extents in 3D view
Peter Clifton [Tue, 16 Feb 2010 13:19:53 +0000 (16 13:19 +0000)]
Fix grid extents in 3D view

12 years agoShiny 3D eye-candy
Peter Clifton [Tue, 16 Feb 2010 13:19:53 +0000 (16 13:19 +0000)]
Shiny 3D eye-candy

Experiments in progress - don't expect this to work yet!

12 years agoAdd support for depth to triangle rendering routines.
Peter Clifton [Tue, 16 Feb 2010 13:19:52 +0000 (16 13:19 +0000)]
Add support for depth to triangle rendering routines.

Nasty global depth_state variable should be replaced!

12 years agoUse trackball to allow rotation of 3D view
Peter Clifton [Tue, 16 Feb 2010 13:19:52 +0000 (16 13:19 +0000)]
Use trackball to allow rotation of 3D view

12 years agoAdd virtual trackball code
Peter Clifton [Tue, 16 Feb 2010 13:19:51 +0000 (16 13:19 +0000)]
Add virtual trackball code

12 years agoHack to make pretty translucent polygons in thindraw-poly mode
Peter Clifton [Tue, 16 Feb 2010 13:19:50 +0000 (16 13:19 +0000)]
Hack to make pretty translucent polygons in thindraw-poly mode

TODO: Perhaps need some way to configure this.. it might be nice in
non-thindraw mode too. If people want thin-draw to gain extra speed,
rather than have it actually slower (due to fill + outline), then a
way to turn it off would also be useful.

12 years agoUse tags on circular contours to render them faster
Peter Clifton [Tue, 16 Feb 2010 13:19:50 +0000 (16 13:19 +0000)]
Use tags on circular contours to render them faster

12 years agoWork in progress on subcompositing / stencil buffers
Peter Clifton [Tue, 16 Feb 2010 13:19:49 +0000 (16 13:19 +0000)]
Work in progress on subcompositing / stencil buffers

If we have many stencil buffer bits, we may as well use all of them before
resorting to a costly clear and re-using the same bit-planes over.

12 years agoAdd raw polygons support for the GTK HID, bypassing the no-holes dicer
Peter Clifton [Tue, 16 Feb 2010 13:19:48 +0000 (16 13:19 +0000)]
Add raw polygons support for the GTK HID, bypassing the no-holes dicer

Uses the OpenGL stencil buffer to make drawing polygons with holes faster.

1. Turn Stenciling on, updates to colour buffer off
2. Clear stencil buffer to 0
3. Paint polygon holes, setting those areas of the stencil buffer to 1
4. Switch on stencil test (== 0), turn on updates to colour buffer
5. Paint outer polygon through areas of the stencil buffer still 0
6. Clear stencil buffer, switch off stencilling.

** BUGS? **

Probably throws up if the function is used whilst drawing the mask,
since that uses stenciling as well, and they don't know to co-operate.

For now, we don't use polygons on the mask, so its not a a problem (?).
(OR do we.. for some pins?)

12 years agoCure crosshair lagging on screen
Peter Clifton [Tue, 16 Feb 2010 13:19:47 +0000 (16 13:19 +0000)]
Cure crosshair lagging on screen

FIXME: SHOULD NOT RE-WRITE THE GTK HID

12 years agoDrop in PCB+GL code + various mess. Needs splitting up?
Peter Clifton [Tue, 16 Feb 2010 13:19:47 +0000 (16 13:19 +0000)]
Drop in PCB+GL code + various mess. Needs splitting up?

Credits:

  Algorithm to calculate number of segments to use in circular
  curve approximation suggested by DJ Delorie.

FIXME: SHOULD NOT RE-WRITE THE GTK HID!

12 years agoAdd configure checks for GtkGLEext, add to CFLAGS and LIBS
Peter Clifton [Tue, 16 Feb 2010 13:19:46 +0000 (16 13:19 +0000)]
Add configure checks for GtkGLEext, add to CFLAGS and LIBS

*** TODO: Need separate tests for libgl and libglut etc.. ***

12 years agoOnly snap to pads on the active layer
Peter Clifton [Tue, 16 Feb 2010 13:19:46 +0000 (16 13:19 +0000)]
Only snap to pads on the active layer

12 years agoImprove grid snapping heuristics
Peter Clifton [Tue, 16 Feb 2010 13:19:45 +0000 (16 13:19 +0000)]
Improve grid snapping heuristics

12 years agoAvoid re-starting the intersection routine when we don't have to
Peter Clifton [Tue, 16 Feb 2010 13:18:32 +0000 (16 13:18 +0000)]
Avoid re-starting the intersection routine when we don't have to

Apparently this has a nice performance win for the NoHoles dicer.

12 years agoWe can just delete kicked out holes
Peter Clifton [Tue, 16 Feb 2010 13:18:32 +0000 (16 13:18 +0000)]
We can just delete kicked out holes

Since we don't keep holes from broken contours, if a contour is
kicked out, we know it is destined for the bin.

12 years agoVarious speedups to the polygon code.
Peter Clifton [Tue, 16 Feb 2010 13:18:31 +0000 (16 13:18 +0000)]
Various speedups to the polygon code.

Attempt to fix polygon slowness by avoiding the need to create a
completely new polygon for each boolean operation. This mostly relies
upon r-tree searches to find contours to operate on - rather than
searching each in turn.

We avoid labelling all of the "A" polygon's contours, use the contour
r-trees to dynamically search the required data.

Added code to reparent holes which end up in the wrong polygon piece
after inserting a new hole in InsertHoles. This means we don't have
to dump every potental hole we encounter in the holes insersion queue,
hopefully leading to better dynamic update performance.

At this point, polygon performance has finally seen a net gain.

HOWEVER: Due to differences in the order of polygon operations, the
         data-structures resulting from a boolean polygon operation
         may be sorted differently.

         In certain contrived cases, where a polygon is clipped into
         identically sized pieces, the resulting piece of polygon
         which PCB will keep and use on the board is different after
         this commit.

12 years agoUse heap structure to insert holes quicker in InsertHoles()
Peter Clifton [Tue, 16 Feb 2010 13:18:31 +0000 (16 13:18 +0000)]
Use heap structure to insert holes quicker in InsertHoles()

12 years agoOptimise polygon operations by keeping an rtree of POLYAREA contours
Peter Clifton [Tue, 16 Feb 2010 13:18:30 +0000 (16 13:18 +0000)]
Optimise polygon operations by keeping an rtree of POLYAREA contours

Attempt to speed up the intersect() routine using this rtree rather
than generating a new one at each call.

Due to the increased overheads of keeping an r-tree up to date, there
is a significant overall slow-down at this point in the patch series.

12 years agoUse rtree of countours when computing an intersection
Peter Clifton [Tue, 16 Feb 2010 13:18:30 +0000 (16 13:18 +0000)]
Use rtree of countours when computing an intersection

NOTE: This is more complex than the existing code, and on its own,
      actually slows things down a little.

      The intention is that the r-tree should be maintained continually,
      so it doesn't need to be recreated with each call to intersect().

12 years agopolygon.c: Accumulate vias and lines into batches before subtracting them
Peter Clifton [Tue, 16 Feb 2010 13:18:30 +0000 (16 13:18 +0000)]
polygon.c: Accumulate vias and lines into batches before subtracting them

Accumulate polygons to clear from lines and pins in batches, then
clear from the polygon. Not quite sure why, but this _really_ seems to
speed up loading very complex boards. (e.g. 50sec -> 10sec for one example).

Possibly this is because withing the assembled batches, it is cheaper to
produce a more unified contour (touching lines), and the complex contours
of the main polygon are broken less frequently.

It isn't quite clear why this helps so much for pins / vias (which won't
usually touch each-other), however it changes a 50sec load time to 10 sec.
This could perhaps be because any contours which are smashed by clearance
of closely spaced vias / pins now only incurr the penalty of breaking the
main contour once every batch (100 vias / pins).

Batch sizes (20 for lines, 100 for pins / vias) aren't necessarily optimal!

Also, clear pins and vias last...

There is a chance these objects are simpler, and just end up as holes in
the main polygon, rather than causing a contour intersection. This means
it is cheaper to add them last.

If we add them first, and make the polygon complex, objects (usually
lines) which pierce the polygon's outer contour cause all the holes to
be removed and queued for re-insersion after the new contour is
constructed.

12 years agoFix broken build due to missing struct members
Peter Clifton [Tue, 16 Feb 2010 13:17:34 +0000 (16 13:17 +0000)]
Fix broken build due to missing struct members

Pointed out by Ineiev

12 years agoFix bugs in the arc intersection routine. Bug #2942582
Ineiev [Sun, 7 Feb 2010 11:47:14 +0000 (7 11:47 +0000)]
Fix bugs in the arc intersection routine. Bug #2942582

This bug resulted in various false identificaton of connectivity
between arcs and other object. Notes from Ineiev's emails:

So I built a montecarlo; fixed some ugly unrealistic cases like thin
arc merged in bloat and arc->Delta<-360; ran the test program (aat.c)
several hours on different machins; that discovered no errors, though
the number of points was not very high (a thousand or slightly more):
the reference functions are really slow.

That resulted in arc.bis.patch. I tested it also with already mentioned
teardropped OSDCU.pcb and t1.pcb. Then, eliminate two precision losses.

I feel I ought to stop here: the patch fixes many more bugs than
originally reported.

12 years agoMerge branch 'master' of ssh://dan@git.gpleda.org/home/git/pcb
Dan McMahill [Sat, 13 Feb 2010 17:43:34 +0000 (13 12:43 -0500)]
Merge branch 'master' of ssh://dan@git.gpleda.org/home/git/pcb

12 years agoDon't hardcode 'make' and 'gnetlist'. Rather look for settings
Dan McMahill [Sat, 13 Feb 2010 17:41:35 +0000 (13 12:41 -0500)]
Don't hardcode 'make' and 'gnetlist'.  Rather look for settings
PCB_MAKE_PROGRAM, PCB_GNETLIST environment variables or command line
values.  This should help those who may need a different 'make' (say
gmake or bmake) or gnetlist.

12 years agoFix pcb forward annotation bugs
DJ Delorie [Fri, 12 Feb 2010 03:20:58 +0000 (11 22:20 -0500)]
Fix pcb forward annotation bugs

Finish rename of pcblf -> pcbfwd, handle pcb-has-no-name case.

12 years agoWhen mkdtemp() is available use it instead of tmpnam() for creating
Dan McMahill [Wed, 10 Feb 2010 03:00:24 +0000 (9 22:00 -0500)]
When mkdtemp() is available use it instead of tmpnam() for creating
temp file names to be used by gnetlist or make.

12 years agoRemove some gcc warnings about unitialized variables.
Dan McMahill [Sun, 7 Feb 2010 01:30:30 +0000 (6 20:30 -0500)]
Remove some gcc warnings about unitialized variables.

Remove some gcc warnings about uninitialized variables.  The
logic was such that if the variables weren't ever assigned to somethign
then they also would not have been accessed but by getting rid
of this warning, we increase the chances of paying attention to
other warnings which may indicate real bugs.

12 years agoAdd missing return on an action function which is supposed to return an int.
Dan McMahill [Sun, 7 Feb 2010 01:27:29 +0000 (6 20:27 -0500)]
Add missing return on an action function which is supposed to return an int.

12 years agoRemove some gcc warnings.
Dan McMahill [Sun, 7 Feb 2010 01:20:53 +0000 (6 20:20 -0500)]
Remove some gcc warnings.

Use GPOINTER_TO_INT(), GINT_TO_POINTER() and remove a couple of
unused variables to eliminate some gcc warnings.

12 years agoIn functions returning non-void, give a return value for returns.
Dan McMahill [Sat, 6 Feb 2010 19:58:16 +0000 (6 14:58 -0500)]
In functions returning non-void, give a return value for returns.

12 years agoAdd missing prototype for sort_netlist() which is called in netlist.c.
Dan McMahill [Sat, 6 Feb 2010 19:57:56 +0000 (6 14:57 -0500)]
Add missing prototype for sort_netlist() which is called in netlist.c.

12 years agoRemove some gcc warnings.
Dan McMahill [Sat, 6 Feb 2010 19:53:36 +0000 (6 14:53 -0500)]
Remove some gcc warnings.

Add missing headers for fork(), execvp(), wait().  Also remove
a couple of unused variables.

12 years agoRename NetlistChanged() to avoid conflicts
DJ Delorie [Mon, 1 Feb 2010 23:51:28 +0000 (1 18:51 -0500)]
Rename NetlistChanged() to avoid conflicts

Rename the existing static NetlistChanged() functions in
the Gtk and Lesstif HIDs to avoid conflicts with the core global
NetlistChanged() function.

12 years agoswap png bloat too
DJ Delorie [Mon, 1 Feb 2010 17:54:18 +0000 (1 12:54 -0500)]
swap png bloat too

When computing the bloat offsets for filled rectangles, apply the bloat
after sorting the Y coordinates but before swapping them if we're
printing the solder side.

12 years agoFix drawn circles
DJ Delorie [Mon, 1 Feb 2010 17:48:21 +0000 (1 12:48 -0500)]
Fix drawn circles

When drawing a "line" that's zero length, check for rounded ends (circle)
vs square ends (square).

12 years agoChanged element/netlist syntax as follows:
DJ Delorie [Sun, 31 Jan 2010 21:21:18 +0000 (31 16:21 -0500)]
Changed element/netlist syntax as follows:

ElementList(start)
ElementList(need,...)
ElementList(done)

Netlist(freeze)
Netlist(add,...)
Netlist(thaw)

Hooked all NetlistChanged() actions into a wrapper that checks for frozen.

12 years agoAdd import to gtk menu, change lesstif menu to match.
DJ Delorie [Fri, 29 Jan 2010 17:58:10 +0000 (29 12:58 -0500)]
Add import to gtk menu, change lesstif menu to match.

12 years agoAdd the new netlister.
DJ Delorie [Fri, 29 Jan 2010 17:45:43 +0000 (29 12:45 -0500)]
Add the new netlister.

Adds the new script-based netlister and the install rules.  Note
that this installs PCB's netlister in gEDA's data directory.
Unusual, but it's the best way to keep pcb in sync with its own netlister.

12 years agoAdd attribute editor GUI to gtk and lesstif.
DJ Delorie [Sat, 2 Jan 2010 03:21:48 +0000 (1 22:21 -0500)]
Add attribute editor GUI to gtk and lesstif.

Attributes(Layout|Layer|Element)
Attributes(Layer,layername)

Let the user edit the attributes of the layout, current or given
layer, or selected element.

12 years agoAdd Import() action
DJ Delorie [Mon, 28 Dec 2009 04:24:11 +0000 (27 23:24 -0500)]
Add Import() action

Add an action to import schematics into the pcb.  It allows for a
list of schematics to be specified in the action or in the pcb,
as well as supporting using a Makfile instead of gnetlist.

12 years agoUndo an accidental change.
DJ Delorie [Mon, 28 Dec 2009 04:23:03 +0000 (27 23:23 -0500)]
Undo an accidental change.

12 years agoWork-in-progress for LF: netlist importing
DJ Delorie [Wed, 22 Apr 2009 02:58:49 +0000 (21 22:58 -0400)]
Work-in-progress for LF: netlist importing

12 years agoCheck for empty layers.
DJ Delorie [Sat, 2 Jan 2010 04:11:28 +0000 (1 23:11 -0500)]
Check for empty layers.

If you have a four-layer board but the inner layers are empty, photo
mode dies.  This checks for at least the more common case, but
further work to protect against *any* empty layer is warranted.

12 years agoFix photo-mode mask layer.
DJ Delorie [Sat, 2 Jan 2010 00:45:28 +0000 (1 19:45 -0500)]
Fix photo-mode mask layer.

The addition of mask support to PNG export broke photo mode; this patch
undoes the mask support when photo mode is enabled.

12 years agoAdd support for specifying soldermask and solderside from the command line
DJ Delorie [Mon, 28 Dec 2009 02:11:36 +0000 (27 21:11 -0500)]
Add support for specifying soldermask and solderside from the command line

Added "solderside" and "mask" as valid layers for --layer-stack.  Also
added "silk" as an alias for "elements".  Added mask support to the PNG
exporter so that it draws soldermask properly.  Also added support to
PNG for showing the board from the solder side, and removed some leftover
cruft from when it was copied from the PS hid.

12 years agoToporouter: Removed superfluous debug function
anthonix [Mon, 21 Dec 2009 16:11:58 +0000 (22 05:11 +1300)]
Toporouter: Removed superfluous debug function

12 years agoToporouter: A few fixes
anthonix [Mon, 21 Dec 2009 15:57:19 +0000 (22 04:57 +1300)]
Toporouter: A few fixes

The main fix is in the 'special cut' code, which had a tricky corner case to
deal with. The special cut code has also been commented in the critical spots.

There are a few other minor fixes, and a couple of heuristic changes.

12 years agoHandle NULL strings when replacing elements.
DJ Delorie [Mon, 14 Dec 2009 00:32:41 +0000 (13 19:32 -0500)]
Handle NULL strings when replacing elements.

Sometimes, when you're building a board from the library,
elements won't have values for their strings.  When replacing those
elements, replicate the NULL pointer rather than trying to strup it.

12 years agoUpdate the quick reference
Chitlesh GOORAH [Mon, 7 Dec 2009 19:18:48 +0000 (7 14:18 -0500)]
Update the quick reference

From: Chitlesh GOORAH <chitlesh.goorah@gmail.com>
To: gEDA user mailing list

Hello there,

The current layout of the PCB command reference PDF document (the one
currently being shipped) is broken. It looks like it on life support.
http://chitlesh.fedorapeople.org/pcb/refcard_old.pdf

I've updated only the layout of refcard.tex
http://chitlesh.fedorapeople.org/pcb/refcard.tex to give
http://chitlesh.fedorapeople.org/pcb/refcard.pdf . Unfortunately, I
don't have enough time currently to update it to the latest key
shortcuts. Can you guys please apply it to the next release ? I hope
someone will update it in the meantime, else I'll dig into it next
year.

Chitlesh

12 years agoIn the -h (help) output, mention which gui the gui options are for.
Dan McMahill [Wed, 25 Nov 2009 22:22:44 +0000 (25 17:22 -0500)]
In the -h (help) output, mention which gui the gui options are for.

12 years agoRather than having @code{Pcb} all over, refer to the program name with @pcb{}.
Dan McMahill [Wed, 25 Nov 2009 22:20:03 +0000 (25 17:20 -0500)]
Rather than having @code{Pcb} all over, refer to the program name with @pcb{}.

To help keep how we refer to and mark up the name of the program, define a
macro at the start and use it all over.

Also change some of the "for X11" text since pcb really runs on what ever
windowing system gtk (X11 or windows) or lesstif (X11 for this one) runs on.

12 years agoMerge branch 'master' of ssh://dan@git.gpleda.org/home/git/pcb
Dan McMahill [Tue, 24 Nov 2009 02:18:45 +0000 (23 21:18 -0500)]
Merge branch 'master' of ssh://dan@git.gpleda.org/home/git/pcb

12 years agoTry to be smarter about figuring out when we need to regenerate
Dan McMahill [Tue, 24 Nov 2009 02:16:36 +0000 (23 21:16 -0500)]
Try to be smarter about figuring out when we need to regenerate
pcblib-newlib.  In particular, if we are building from a tarball
then look in the stamp file to make sure that whoever built the tarball
used the correct options for building pcblib-newlib to match what has
been requested here.  Should address issues noted on geda-user.

12 years agohid/gtk: Add a guard against GC's being passed from another HID
Peter Clifton [Sun, 15 Nov 2009 19:42:27 +0000 (15 19:42 +0000)]
hid/gtk: Add a guard against GC's being passed from another HID

Various other HIDs have this check.

12 years agohid/gtk: Move definition of the device context inside gtkhid-gdk.c
Peter Clifton [Sun, 15 Nov 2009 19:41:44 +0000 (15 19:41 +0000)]
hid/gtk: Move definition of the device context inside gtkhid-gdk.c

Keep it private to the drawing routines.

12 years agohid/gtk: Remove unused HID "ghid_extents"
Peter Clifton [Sun, 15 Nov 2009 19:19:28 +0000 (15 19:19 +0000)]
hid/gtk: Remove unused HID "ghid_extents"

12 years agohid/gtk: Move various gdk drawing routines into a new file gtkhid-gdk.c
Peter Clifton [Sun, 15 Nov 2009 19:04:18 +0000 (15 19:04 +0000)]
hid/gtk: Move various gdk drawing routines into a new file gtkhid-gdk.c

This separates some of the drawing code so it could be replaced
more easily.

Pretty much a straight move at this point, but renamed the static
function "draw_grid()" to ghid_draw_grid() now it is no longer
local to gtkhid-main.

Removed all #include not required to build in gtkhid-main.c and
gtkhid-gdk.c

12 years agoAdd SL_RATS layer ID to tell the GUI we're drawing rats
Peter Clifton [Sun, 15 Nov 2009 02:27:20 +0000 (15 02:27 +0000)]
Add SL_RATS layer ID to tell the GUI we're drawing rats

Also, let the GUI decide whether it wants to draw rats or not,
rather than have the core test PCB->RatsOn directly.

12 years agodraw.c: Apply const qualifier to DrawLayer and DrawSilk bounds
Peter Clifton [Sun, 15 Nov 2009 02:27:17 +0000 (15 02:27 +0000)]
draw.c: Apply const qualifier to DrawLayer and DrawSilk bounds

This keeps the compiler happier.

12 years agoBy popular(*) request, Make the cross-hair snap to the center of pads
Peter Clifton [Sun, 15 Nov 2009 00:23:18 +0000 (15 00:23 +0000)]
By popular(*) request, Make the cross-hair snap to the center of pads

* Popular.. or vocal?, I'm not sure.

If more people don't like the new behaviour, there is always git revert.

There was of course, a third possibility - adding support to snap to pad
end-points _and_ their centers. I rejected this because of "nearly" square
pads - it becomes difficult to know if you've picked up the center of the
pad, and many of those asking for snap-to-center wanted it in order to
pick up and align components by their pads.

NB: Optimised rat-lines still go to the edge of pads, as this can often
    look less cluttered. Rat-lines drawn to the center of a pad will
    work correctly, and remain on the pad center until the next time
    "optimise" is run on the rats-nest.

12 years agoAdd support for rat-lines ending at the center of pads
Peter Clifton [Sun, 15 Nov 2009 00:11:59 +0000 (15 00:11 +0000)]
Add support for rat-lines ending at the center of pads

Optimised rats are still located at the edges of pads, but the rat connection
checking code will now also accept rats ending at the center of a pad.

12 years agodraw.h: Remove ClearPin prototype missed in last commit
Peter Clifton [Sat, 14 Nov 2009 18:41:13 +0000 (14 18:41 +0000)]
draw.h: Remove ClearPin prototype missed in last commit

12 years agodraw.c: Don't clear pins / vias from polygons... it is already done!
Peter Clifton [Sat, 14 Nov 2009 18:38:24 +0000 (14 18:38 +0000)]
draw.c: Don't clear pins / vias from polygons... it is already done!

Our polygons already the required holes for pins, vias, pads etc..
so don't waste drawing clearances twice. This looks to be a legacy
from the way PCB used to draw polygons.

12 years agopolygons: Tag circular contours so they can be special-cased when drawing.
Peter Clifton [Sat, 14 Nov 2009 02:12:30 +0000 (14 02:12 +0000)]
polygons: Tag circular contours so they can be special-cased when drawing.

Tagging circular contours allows GUIs (if they wish) to draw circular
holes in polygons more accurately, and potentially faster - depending
on whether they use mask based rendering or rely on the dicer.

When zoomed far out (and using a mask based scheme), the drawing routine
can use a lower vertex count approximation to the contour - leading to
rendering speed improvements. This is used to reasonable effect in the
experimental OpenGL branch.

Modify hid/common/draw_helpers.c to use these tags when thin-drawing
polygon contours with common_thindraw_pcb_polygon(). This allows the
GUI to change the level of detail rendered with zoom, and serves to
test this feature.

DRC checking and output are still done using the fixed resolution
approximation present in the polygon contour, so in this respect -
it makes rendering somewhat unfaithful to the final output.

12 years agodraw.c: Draw all vias, pins and pads under the mask layer
Peter Clifton [Fri, 13 Nov 2009 20:00:29 +0000 (13 20:00 +0000)]
draw.c: Draw all vias, pins and pads under the mask layer

This fixes an issue where the rendering of a partially masked via is
inaccurate. The down-side is that partially, or completely masked vias
become obscured by the mask drawn above them.

If the user is previewing the mask rendering, it is probably best that
they see an accurate representation - even if this means hiding vias.

12 years agoFix thindraw mask drawing for pins, including octagonal ones
Peter Clifton [Fri, 13 Nov 2009 19:58:16 +0000 (13 19:58 +0000)]
Fix thindraw mask drawing for pins, including octagonal ones

We need to set the line-width for round pins when in thin-draw and
clearing the mask.

We need to tell DrawSpecialPolygon() whether we need thin-draw or
not depending on whether we're clearing the mask or not. We don't
need to set the line-width outside of DrawSpecialPolygon(), since
it sets it its-self.

Fix DrawSpecialPolygon() to set the line width and cap style on the
correct GC.

12 years agohid/common: Control update of NoHoles cache based on clip region
Peter Clifton [Fri, 13 Nov 2009 01:14:08 +0000 (13 01:14 +0000)]
hid/common: Control update of NoHoles cache based on clip region

If at least 50% of the bounding box of a polygon is within the
clip region, compute the whole NoHoles polygon and cache it for
later rendering.

If less of the polygon is within the clip region, just compute
what we need to draw the piece we've been asked for.

12 years agohid/common: Fix memory leak in polygon NoHoles clipping routine
Peter Clifton [Fri, 13 Nov 2009 01:05:27 +0000 (13 01:05 +0000)]
hid/common: Fix memory leak in polygon NoHoles clipping routine

poly_CopyContour creates the edge tree, as does ContourToPoly(),
which overwrite the one created in poly_CopyContour().

Replace call to ContourToPoly() with a discrete alternative without
the poly_PreContour() call.

Also, don't try to poly_Free() the output of poly_Boolean_free() in
an error condition. poly_Boolean_free() re-uses the A input polygon
for its output, so attempting to free that might be dangerous.

poly_Boolean_free() should free its inputs (and any partial output)
if it encounters an error.

12 years agohid/common: Clip no-holes polygon pieces before calling fill_contour
Peter Clifton [Thu, 12 Nov 2009 23:54:07 +0000 (12 23:54 +0000)]
hid/common: Clip no-holes polygon pieces before calling fill_contour

This avoids integer overflow in some HIDs (GTK, Lesstif?) when
drawing at high zoom level. Such overflow would lead to incorrectly
drawn polygons.

It is possible that a similar bug could effect thin-drawn polygons,
but that has not manifested its-self so far. If we were to clip these
in the future, we need to be careful to extend the clip region
slightly off-screen, so the outlines are not drawn.

Ideally we would clip these vertices using a Sutherland-Hodgman
clipping algorithm, then we could simply discard edges which are
clipped completely.

12 years agoUse strcmp() for special layer names, rather than strcasecmp()
Peter Clifton [Thu, 12 Nov 2009 14:04:14 +0000 (12 14:04 +0000)]
Use strcmp() for special layer names, rather than strcasecmp()

Before commit 086aa491fae18f1ec72da047b772fa3510f72d0b, we were using
strcmp() and strcasecmp() in different places. That commit changed to
strcasecmp(). Lets choose to keep the more restrictive option for now,
which reduces the number of "magic" layer names PCB supports.

12 years agohid/gtk: Fix strncat length when building accelerator string. (CODE!)
Patrick Bernaud [Thu, 12 Nov 2009 13:55:20 +0000 (12 13:55 +0000)]
hid/gtk: Fix strncat length when building accelerator string. (CODE!)

(Oops, I pushed an empty patch last time - Peter Clifton)

Commit d6b396c4a34bb619c8e91da1e9cd9bd27ff54657 was not enough:
strncat() must be given the remaining length of buffer to ensure it
does not overflow. Plus it now emits a message in the unlikely case
of a too small buffer for an accelerator.

12 years agohid/gtk: Fix strncat length when building accelerator string.
Patrick Bernaud [Thu, 12 Nov 2009 13:51:08 +0000 (12 13:51 +0000)]
hid/gtk: Fix strncat length when building accelerator string.

Commit d6b396c4a34bb619c8e91da1e9cd9bd27ff54657 was not enough:
strncat() must be given the remaining length of buffer to ensure it
does not overflow. Plus it now emits a message in the unlikely case
of a too small buffer for an accelerator.