pcb 4.1.1
An interactive printed circuit board layout editor.

puller.c File Reference

More...

#include "global.h"
#include <math.h>
#include <memory.h>
#include <limits.h>
#include <setjmp.h>
#include "create.h"
#include "data.h"
#include "draw.h"
#include "misc.h"
#include "move.h"
#include "pcb-printf.h"
#include "remove.h"
#include "rtree.h"
#include "strflags.h"
#include "undo.h"
#include "error.h"
Include dependency graph for puller.c:

Go to the source code of this file.

Data Structures

struct  End
 Extra data we need to temporarily attach to all lines and arcs. More...
struct  Extra
struct  FindPairCallbackStruct

Defines

#define abort1()   fprintf(stderr, "abort at line %d\n", __LINE__), abort()
#define TRACE0   0
#define TRACE1   0
#define SIN1D   0.0174524064372835
#define LINE2EXTRA(l)   ((Extra *)g_hash_table_lookup (lines, l))
#define ARC2EXTRA(a)   ((Extra *)g_hash_table_lookup (arcs, a))
#define EXTRA2LINE(e)   (e->parent.line)
#define EXTRA2ARC(e)   (e->parent.arc)
#define EXTRA_IS_LINE(e)   (e->type == LINE_TYPE)
#define EXTRA_IS_ARC(e)   (e->type == ARC_TYPE)
#define NEAR(a, b)   ((a) <= (b) + 2 && (a) >= (b) - 2)
#define PROP_NEXT(e, n, f)
#define gp_point(x, y, t, e)   gp_point_2(x,y,t,e,0,0,__FUNCTION__)

Typedefs

typedef struct End End
 Extra data we need to temporarily attach to all lines and arcs.
typedef struct Extra Extra

Functions

static Coord within (Coord x1, Coord y1, Coord x2, Coord y2, Coord r)
static int arc_endpoint_is (ArcType *a, int angle, Coord x, Coord y)
static double cross2d (Coord cx, Coord cy, Coord ux, Coord uy, Coord vx, Coord vy)
static double dot2d (Coord cx, Coord cy, Coord ux, Coord uy, Coord vx, Coord vy)
 Likewise, for dot product.
static int same_sign (double a, double b)
static double r2d (double r)
static double d2r (double d)
static double det (double a, double b, double c, double d)
 
static int intersection_of_lines (Coord x1, Coord y1, Coord x2, Coord y2, Coord x3, Coord y3, Coord x4, Coord y4, Coord *xr, Coord *yr)
 
static int intersection_of_linesegs (Coord x1, Coord y1, Coord x2, Coord y2, Coord x3, Coord y3, Coord x4, Coord y4, Coord *xr, Coord *yr)
 Same, for line segments.
static double dist_lp (Coord x1, Coord y1, Coord x2, Coord y2, Coord px, Coord py)
 Distance between a line and a point.
static double dist_lsp (Coord x1, Coord y1, Coord x2, Coord y2, Coord px, Coord py)
 Distance between a line segment and a point.
static int line_callback (const BoxType *b, void *cl)
static int arc_callback (const BoxType *b, void *cl)
static int find_pair (Coord Px, Coord Py)
static int Puller (int argc, char **argv, Coord Ux, Coord Uy)
static void status ()
static void mark_line_for_deletion (LineType *)
static void unlink_end (Extra *x, Extra **e)
static void fix_arc_extra (ArcType *a, Extra *e)
static int find_pair_line_callback (const BoxType *b, void *cl)
static int find_pair_arc_callback (const BoxType *b, void *cl)
static void find_pairs_1 (void *me, Extra **e, Coord x, Coord y)
static int check_point_in_pin (PinType *pin, Coord x, Coord y, End *e)
static int find_pair_pinline_callback (const BoxType *b, void *cl)
static int find_pair_pinarc_callback (const BoxType *b, void *cl)
static int check_point_in_pad (PadType *pad, Coord x, Coord y, End *e)
static int find_pair_padline_callback (const BoxType *b, void *cl)
static int find_pair_padarc_callback (const BoxType *b, void *cl)
static void null_multi_next_ends (AnyObjectType *ptr, Extra *extra, void *userdata)
static Extranew_line_extra (LineType *line)
static Extranew_arc_extra (ArcType *arc)
static void find_pairs ()
static void propogate_ends_at (Extra *e, End *near, End *far)
static void propogate_end_pin (Extra *e, End *near, End *far)
static void propogate_end_step1_cb (AnyObjectType *ptr, Extra *extra, void *userdata)
static void propogate_end_step2_cb (AnyObjectType *ptr, Extra *extra, void *userdata)
static void propogate_end_step3_cb (AnyObjectType *ptr, Extra *extra, void *userdata)
static void propogate_ends ()
static void print_extra (Extra *e, Extra *prev)
static void reverse_line (LineType *line)
static void reverse_arc (ArcType *arc)
static void expand_box (BoxType *b, Coord x, Coord y, Coord t)
static int gp_point_force (Coord x, Coord y, Coord t, End *e, int esa, int eda, int force, const char *name)
static int gp_point_2 (Coord x, Coord y, Coord t, End *e, int esa, int eda, const char *func)
static int gp_line_cb (const BoxType *b, void *cb)
static int gp_arc_cb (const BoxType *b, void *cb)
static int gp_text_cb (const BoxType *b, void *cb)
static int gp_poly_cb (const BoxType *b, void *cb)
static int gp_pin_cb (const BoxType *b, void *cb)
static int gp_pad_cb (const BoxType *b, void *cb)
static LineTypecreate_line (LineType *sample, Coord x1, Coord y1, Coord x2, Coord y2)
static ArcTypecreate_arc (LineType *sample, Coord x, Coord y, Coord r, Coord sa, Coord da)
static void unlink_extras (Extra *e)
static void mark_arc_for_deletion (ArcType *a)
static void maybe_pull_1 (LineType *line)
 
static void maybe_pull (LineType *line, Extra *e)
 Given a line with a end_next, attempt to pull both ends.
static void validate_pair (Extra *e, End *end)
static void validate_pair_cb (AnyObjectType *ptr, Extra *extra, void *userdata)
static void validate_pairs ()
static void FreeExtra (Extra *extra)
static void mark_ends_pending (LineType *line, Extra *extra, void *userdata)
static int GlobalPuller (int argc, char **argv, Coord x, Coord y)

Variables

static jmp_buf abort_buf
static int multi
static int line_exact
static int arc_exact
static LineTypethe_line
static ArcTypethe_arc
static double arc_dist
static Coord x
static Coord y
static Coord cx
static Coord cy
static Coord ex
static Coord ey
static const char puller_syntax [] = "Puller()"
static const char puller_help [] = "Pull an arc-line junction tight."
static const char globalpuller_syntax [] = "GlobalPuller()"
static const char globalpuller_help [] = "Pull all traces tight."
static int nloops
static int npulled
static Extra multi_next
static GHashTable * lines
static GHashTable * arcs
static int did_something
static int current_is_top
static int current_is_bottom
static Extralast_pextra = 0
static ArcTypestart_arc
static LineTypestart_line
static LineTypeend_line
static ArcTypeend_arc
static Extrastart_extra
static Extraend_extra
static Extrasarc_extra
static Extraearc_extra
static void * start_pinpad
static void * end_pinpad
static Coord thickness
static double se_sign
static double sa_sign
static double ea_sign
static double best_angle
static double start_angle
static double end_dist
static Coord sa_r
static Coord ea_r
static Coord sa_x
static Coord sa_y
static Coord fx
static Coord fy
static Coord fr
static int fp
static Endfp_end
static double fa
HID_Action puller_action_list []

Detailed Description

Todo:
Things that need to be fixed before this is "perfect".
Add to this list as we find things.
  • respect the outline layer.
  • don't consider points that are perpendicular to our start_arc. I.e. when we have busses going around corners, we have a *lot* of arcs and endpoints that are all in the same direction and all equally "good", but rounding the arc angles to integers causes all sorts of tiny differences that result in bumps, reversals, and other messes.
  • Store the X,Y values in our shadow struct so we don't fill up the undo buffer with all our line reversals.
  • at least check the other layers in our layer group.

Copyright.


PCB, interactive printed circuit board design

Copyright (C) 2006 DJ Delorie

Copyright (C) 2011 PCB Contributers (See ChangeLog for details)

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.

Contact addresses for paper mail and Email: DJ Delorie, 334 North Road, Deerfield NH 03037-1110, USA dj@delorie.com

Definition in file puller.c.


Define Documentation

#define abort1 ( )    fprintf(stderr, "abort at line %d\n", __LINE__), abort()
#define ARC2EXTRA (   a)    ((Extra *)g_hash_table_lookup (arcs, a))
#define EXTRA2ARC (   e)    (e->parent.arc)

Definition at line 665 of file puller.c.

Referenced by maybe_pull_1(), and print_extra().

#define EXTRA2LINE (   e)    (e->parent.line)

Definition at line 664 of file puller.c.

Referenced by maybe_pull_1(), and print_extra().

#define EXTRA_IS_ARC (   e)    (e->type == ARC_TYPE)

Definition at line 667 of file puller.c.

Referenced by gp_line_cb(), maybe_pull_1(), and print_extra().

#define EXTRA_IS_LINE (   e)    (e->type == LINE_TYPE)

Definition at line 666 of file puller.c.

Referenced by maybe_pull(), and print_extra().

#define gp_point (   x,
  y,
  t,
 
)    gp_point_2(x,y,t,e,0,0,__FUNCTION__)

Definition at line 1440 of file puller.c.

Referenced by gp_arc_cb(), gp_line_cb(), gp_pad_cb(), gp_pin_cb(), gp_poly_cb(), and gp_text_cb().

#define LINE2EXTRA (   l)    ((Extra *)g_hash_table_lookup (lines, l))
#define NEAR (   a,
 
)    ((a) <= (b) + 2 && (a) >= (b) - 2)

Definition at line 733 of file puller.c.

Referenced by find_pair_arc_callback(), and find_pair_line_callback().

#define PROP_NEXT (   e,
  n,
  f 
)
Value:
if (f->next->start.next == e) { \
        e = f->next;                    \
        n = & e->start;                 \
        f = & e->end;                   \
      } else {                          \
        e = f->next;                    \
        n = & e->end;                   \
        f = & e->start; }

Definition at line 1145 of file puller.c.

Referenced by propogate_end_pin(), and propogate_ends_at().

#define SIN1D   0.0174524064372835

Sine of one degree.

Definition at line 82 of file puller.c.

Referenced by maybe_pull_1().

#define TRACE0   0

Definition at line 78 of file puller.c.

#define TRACE1   0

Definition at line 79 of file puller.c.


Typedef Documentation

typedef struct End End

Extra data we need to temporarily attach to all lines and arcs.

typedef struct Extra Extra

Function Documentation

static int arc_callback ( const BoxType b,
void *  cl 
) [static]

Definition at line 360 of file puller.c.

References arc_dist, arc_endpoint_is(), arc_exact, ArcType::Delta, multi, pcb_printf(), ArcType::StartAngle, ArcType::Width, x, ArcType::X, y, and ArcType::Y.

Referenced by find_pair().

Here is the call graph for this function:

static int arc_endpoint_is ( ArcType a,
int  angle,
Coord  x,
Coord  y 
) [static]

Definition at line 106 of file puller.c.

References arc_dist, arc_exact, Distance(), ArcType::Height, M_PI, pcb_printf(), ArcType::Thickness, ArcType::Width, ArcType::X, and ArcType::Y.

Referenced by arc_callback(), and Puller().

Here is the call graph for this function:

static int check_point_in_pad ( PadType pad,
Coord  x,
Coord  y,
End e 
) [static]

Definition at line 901 of file puller.c.

References End::at_pin, Distance(), End::in_pin, End::is_pad, MAX, MIN, pcb_printf(), End::pin, and TEST_FLAG.

Referenced by find_pair_padarc_callback(), and find_pair_padline_callback().

Here is the call graph for this function:

static int check_point_in_pin ( PinType pin,
Coord  x,
Coord  y,
End e 
) [static]

Definition at line 828 of file puller.c.

References End::at_pin, Distance(), End::in_pin, pin, End::pin, PIN_SIZE, TEST_FLAG, X, pin_st::X, Y, and pin_st::Y.

Referenced by find_pair_pinarc_callback(), and find_pair_pinline_callback().

Here is the call graph for this function:

static ArcType* create_arc ( LineType sample,
Coord  x,
Coord  y,
Coord  r,
Coord  sa,
Coord  da 
) [static]

Definition at line 1872 of file puller.c.

References abort_buf, AddObjectToCreateUndoList(), CreateNewArcOnLayer(), CURRENT, fix_arc_extra(), new_arc_extra(), and pcb_printf().

Referenced by maybe_pull_1().

Here is the call graph for this function:

static LineType* create_line ( LineType sample,
Coord  x1,
Coord  y1,
Coord  x2,
Coord  y2 
) [static]

Definition at line 1851 of file puller.c.

References AddObjectToCreateUndoList(), CreateNewLineOnLayer(), CURRENT, line, new_line_extra(), and pcb_printf().

Referenced by maybe_pull_1().

Here is the call graph for this function:

static double cross2d ( Coord  cx,
Coord  cy,
Coord  ux,
Coord  uy,
Coord  vx,
Coord  vy 
) [static]

brief Cross c->u and c->v, return the magnitude.

Definition at line 148 of file puller.c.

References cx, and cy.

Referenced by gp_point_2(), and maybe_pull_1().

static double d2r ( double  d) [static]

Definition at line 216 of file puller.c.

References M_PI.

Referenced by fix_arc_extra(), gp_point_force(), and Puller().

static double dist_lp ( Coord  x1,
Coord  y1,
Coord  x2,
Coord  y2,
Coord  px,
Coord  py 
) [static]

Distance between a line and a point.

Definition at line 297 of file puller.c.

References Distance(), and pcb_printf().

Referenced by gp_point_2(), and gp_point_force().

Here is the call graph for this function:

static double dist_lsp ( Coord  x1,
Coord  y1,
Coord  x2,
Coord  y2,
Coord  px,
Coord  py 
) [static]

Distance between a line segment and a point.

Definition at line 314 of file puller.c.

References Distance(), and dot2d().

Referenced by find_pair_padline_callback(), and find_pair_pinline_callback().

Here is the call graph for this function:

static double dot2d ( Coord  cx,
Coord  cy,
Coord  ux,
Coord  uy,
Coord  vx,
Coord  vy 
) [static]

Likewise, for dot product.

Definition at line 161 of file puller.c.

References cx, and cy.

Referenced by dist_lsp(), and gp_point_2().

static void expand_box ( BoxType b,
Coord  x,
Coord  y,
Coord  t 
) [static]

Definition at line 1396 of file puller.c.

References MAX, MIN, BoxType::X1, BoxType::X2, BoxType::Y1, and BoxType::Y2.

Referenced by maybe_pull_1().

static int find_pair ( Coord  Px,
Coord  Py 
) [static]

Definition at line 399 of file puller.c.

References arc_callback(), arc_exact, CURRENT, line_callback(), line_exact, multi, pcb_printf(), Px(), Py(), r_search(), x, BoxType::X1, BoxType::X2, y, BoxType::Y1, and BoxType::Y2.

Referenced by Puller().

Here is the call graph for this function:

static int find_pair_arc_callback ( const BoxType b,
void *  cl 
) [static]
static int find_pair_line_callback ( const BoxType b,
void *  cl 
) [static]

Definition at line 736 of file puller.c.

References abort1, FindPairCallbackStruct::extra_ptr, line, LINE2EXTRA, FindPairCallbackStruct::me, multi_next, NEAR, pcb_printf(), FindPairCallbackStruct::x, and FindPairCallbackStruct::y.

Referenced by find_pairs_1().

Here is the call graph for this function:

static int find_pair_padarc_callback ( const BoxType b,
void *  cl 
) [static]

Definition at line 1027 of file puller.c.

References ARC2EXTRA, check_point_in_pad(), Extra::end, Extra::start, TEST_FLAG, End::x, and End::y.

Referenced by find_pairs().

Here is the call graph for this function:

static int find_pair_padline_callback ( const BoxType b,
void *  cl 
) [static]

Todo:
This is for round pads. Good enough for now, but add square pad support later.
Todo:
We should split the line.

Definition at line 956 of file puller.c.

References abort1, check_point_in_pad(), dist_lsp(), Extra::end, intersect(), intersection_of_linesegs(), line, LINE2EXTRA, End::next, pcb_printf(), Extra::start, TEST_FLAG, and unlink_end().

Referenced by find_pairs().

Here is the call graph for this function:

static int find_pair_pinarc_callback ( const BoxType b,
void *  cl 
) [static]

Definition at line 888 of file puller.c.

References ARC2EXTRA, check_point_in_pin(), Extra::end, pin, Extra::start, End::x, and End::y.

Referenced by find_pairs().

Here is the call graph for this function:

static int find_pair_pinline_callback ( const BoxType b,
void *  cl 
) [static]

Todo:
This assumes round pads, but it's good enough for square ones for now.

Definition at line 850 of file puller.c.

References abort1, check_point_in_pin(), dist_lsp(), Extra::end, line, LINE2EXTRA, End::next, pcb_printf(), pin, PIN_SIZE, Extra::start, unlink_end(), pin_st::X, and pin_st::Y.

Referenced by find_pairs().

Here is the call graph for this function:

static void find_pairs_1 ( void *  me,
Extra **  e,
Coord  x,
Coord  y 
) [static]
static void fix_arc_extra ( ArcType a,
Extra e 
) [static]

Definition at line 712 of file puller.c.

References d2r(), ArcType::Delta, Extra::end, ArcType::Height, pcb_printf(), Extra::start, ArcType::StartAngle, ArcType::Width, ArcType::X, End::x, ArcType::Y, and End::y.

Referenced by create_arc(), find_pairs(), and maybe_pull_1().

Here is the call graph for this function:

static void FreeExtra ( Extra extra) [static]

Definition at line 2553 of file puller.c.

Referenced by GlobalPuller().

static int gp_arc_cb ( const BoxType b,
void *  cb 
) [static]
static int gp_line_cb ( const BoxType b,
void *  cb 
) [static]

Definition at line 1702 of file puller.c.

References abort1, Extra::deleted, Extra::end, EXTRA_IS_ARC, gp_point, LINE2EXTRA, End::next, and Extra::start.

Referenced by maybe_pull_1().

static int gp_pad_cb ( const BoxType b,
void *  cb 
) [static]

Todo:
We lump octagonal pads in with square; safe, but not optimal. I don't think we even support octagonal pads.

Definition at line 1798 of file puller.c.

References gp_point, MAX, MIN, and TEST_FLAG.

Referenced by maybe_pull_1().

static int gp_pin_cb ( const BoxType b,
void *  cb 
) [static]

Todo:
We lump octagonal pins in with square; safe, but not optimal.

Definition at line 1773 of file puller.c.

References gp_point, PIN_SIZE, TEST_FLAG, pin_st::X, and pin_st::Y.

Referenced by maybe_pull_1().

static int gp_point_2 ( Coord  x,
Coord  y,
Coord  t,
End e,
int  esa,
int  eda,
const char *  func 
) [static]

Definition at line 1612 of file puller.c.

References cross2d(), dist_lp(), dot2d(), gp_point_force(), pcb_printf(), and same_sign().

Referenced by gp_arc_cb().

Here is the call graph for this function:

static int gp_point_force ( Coord  x,
Coord  y,
Coord  t,
End e,
int  esa,
int  eda,
int  force,
const char *  name 
) [static]

Definition at line 1443 of file puller.c.

References __FUNCTION__, d2r(), dist_lp(), Distance(), M_PI, pcb_printf(), End::pending, r2d(), start_angle, thickness, ArcType::Width, x, ArcType::X, y, and ArcType::Y.

Referenced by gp_point_2(), and maybe_pull_1().

Here is the call graph for this function:

static int gp_poly_cb ( const BoxType b,
void *  cb 
) [static]

Definition at line 1763 of file puller.c.

References gp_point, polygon_st::PointN, polygon_st::Points, PointType::X, and PointType::Y.

Referenced by maybe_pull_1().

static int gp_text_cb ( const BoxType b,
void *  cb 
) [static]

Definition at line 1751 of file puller.c.

References gp_point.

Referenced by maybe_pull_1().

static int intersection_of_lines ( Coord  x1,
Coord  y1,
Coord  x2,
Coord  y2,
Coord  x3,
Coord  y3,
Coord  x4,
Coord  y4,
Coord xr,
Coord yr 
) [static]

The lines are $ x_1y_1-x_2y_2 $ and $ x_3y_3-x_4y_4 $.

Returns:
True if they intersect.

Definition at line 242 of file puller.c.

References det(), x, and y.

Referenced by maybe_pull_1().

Here is the call graph for this function:

static int intersection_of_linesegs ( Coord  x1,
Coord  y1,
Coord  x2,
Coord  y2,
Coord  x3,
Coord  y3,
Coord  x4,
Coord  y4,
Coord xr,
Coord yr 
) [static]

Same, for line segments.

Returns:
True if they intersect.

For this function, xr and yr may be NULL if you don't need the values.

Definition at line 268 of file puller.c.

References det(), MAX, MIN, x, and y.

Referenced by find_pair_padline_callback().

Here is the call graph for this function:

static int line_callback ( const BoxType b,
void *  cl 
) [static]

Definition at line 330 of file puller.c.

References Distance(), line_exact, multi, pcb_printf(), x, and y.

Referenced by find_pair().

Here is the call graph for this function:

static void mark_arc_for_deletion ( ArcType a) [static]

Definition at line 1995 of file puller.c.

References ARC2EXTRA, Extra::deleted, ArcType::Delta, ArcType::StartAngle, and unlink_extras().

Referenced by maybe_pull_1().

Here is the call graph for this function:

static void mark_ends_pending ( LineType line,
Extra extra,
void *  userdata 
) [static]

Definition at line 2559 of file puller.c.

References Extra::end, End::pending, Extra::start, and TEST_FLAGS.

Referenced by GlobalPuller().

static void mark_line_for_deletion ( LineType l) [static]

Definition at line 1965 of file puller.c.

References CURRENT, Extra::deleted, LINE2EXTRA, MoveObject(), pcb_printf(), and unlink_extras().

Referenced by maybe_pull_1(), and propogate_end_step1_cb().

Here is the call graph for this function:

static void maybe_pull ( LineType line,
Extra e 
) [static]

Given a line with a end_next, attempt to pull both ends.

Definition at line 2497 of file puller.c.

References Extra::end, EXTRA_IS_LINE, maybe_pull_1(), End::next, End::pending, print_extra(), reverse_line(), and Extra::start.

Referenced by GlobalPuller().

Here is the call graph for this function:

static void maybe_pull_1 ( LineType line) [static]

Given a starting line, which may be attached to an arc, and which intersects with an ending line, which also may be attached to an arc, maybe pull them.
We assume start_line is attached to the arc via Point1, and attached to the end line via Point2.
Likewise, we make end_line attach to the start_line via Point1 and the arc via Point 2.
We also make the arcs attach on the Delta end, not the Start end.
Here's a picture:

     S            S+D  P1            P2   P1          P2  S+D          S
--- start_arc ---*--- start_line ---*--- end_line ---*--- end_arc ---*
     S             E   S              E   S            E   E           S
 

Definition at line 2025 of file puller.c.

References abort_buf, ARC2EXTRA, PCBType::Bloat, box, ChangeArcAngles(), hid_st::confirm_dialog, create_arc(), create_line(), cross2d(), CURRENT, PCBType::Data, Extra::deleted, Delta, ArcType::Delta, Distance(), Extra::end, end_extra, ex, expand_box(), EXTRA2ARC, EXTRA2LINE, EXTRA_IS_ARC, ey, fix_arc_extra(), fp_end, gp_arc_cb(), gp_line_cb(), gp_pad_cb(), gp_pin_cb(), gp_point_force(), gp_poly_cb(), gp_text_cb(), gui, IncrementUndoSerialNumber(), intersection_of_lines(), line, LINE2EXTRA, M_PI, mark_arc_for_deletion(), mark_line_for_deletion(), MoveObject(), new_line(), End::next, DataType::pad_tree, PCB, pcb_fprintf(), pcb_printf(), End::pending, End::pin, DataType::pin_tree, print_extra(), r2d(), r_search(), reverse_arc(), reverse_line(), same_sign(), se_sign, SET_FLAG, SIN1D, Extra::start, start_angle, start_extra, ArcType::StartAngle, status(), ArcType::Thickness, DataType::via_tree, End::waiting_for, ArcType::Width, ArcType::X, End::x, BoxType::X1, BoxType::X2, ArcType::Y, End::y, BoxType::Y1, and BoxType::Y2.

Referenced by maybe_pull().

Here is the call graph for this function:

static Extra* new_arc_extra ( ArcType arc) [static]

Definition at line 1071 of file puller.c.

References Extra::arc, Extra::parent, and Extra::type.

Referenced by create_arc(), and find_pairs().

static Extra* new_line_extra ( LineType line) [static]

Definition at line 1061 of file puller.c.

References line, Extra::line, Extra::parent, and Extra::type.

Referenced by create_line(), and find_pairs().

static void null_multi_next_ends ( AnyObjectType ptr,
Extra extra,
void *  userdata 
) [static]

Definition at line 1051 of file puller.c.

References Extra::end, End::next, and Extra::start.

Referenced by find_pairs().

static void print_extra ( Extra e,
Extra prev 
) [static]
static void propogate_end_pin ( Extra e,
End near,
End far 
) [static]

Definition at line 1169 of file puller.c.

References End::is_pad, End::next, End::pin, and PROP_NEXT.

Referenced by propogate_end_step3_cb().

static void propogate_end_step1_cb ( AnyObjectType ptr,
Extra extra,
void *  userdata 
) [static]

Definition at line 1184 of file puller.c.

References End::at_pin, Extra::end, mark_line_for_deletion(), End::next, propogate_ends_at(), and Extra::start.

Referenced by propogate_ends().

Here is the call graph for this function:

static void propogate_end_step2_cb ( AnyObjectType ptr,
Extra extra,
void *  userdata 
) [static]

Definition at line 1201 of file puller.c.

References Extra::end, End::in_pin, End::next, and Extra::start.

Referenced by propogate_ends().

static void propogate_end_step3_cb ( AnyObjectType ptr,
Extra extra,
void *  userdata 
) [static]

Definition at line 1220 of file puller.c.

References Extra::end, End::next, propogate_end_pin(), and Extra::start.

Referenced by propogate_ends().

Here is the call graph for this function:

static void propogate_ends ( ) [static]

Definition at line 1229 of file puller.c.

References propogate_end_step1_cb(), propogate_end_step2_cb(), and propogate_end_step3_cb().

Referenced by GlobalPuller().

Here is the call graph for this function:

static void propogate_ends_at ( Extra e,
End near,
End far 
) [static]

Definition at line 1156 of file puller.c.

References End::in_pin, End::next, End::pin, and PROP_NEXT.

Referenced by propogate_end_step1_cb().

static int Puller ( int  argc,
char **  argv,
Coord  Ux,
Coord  Uy 
) [static]
static double r2d ( double  r) [static]

Definition at line 210 of file puller.c.

References M_PI.

Referenced by gp_point_force(), maybe_pull_1(), and Puller().

static void reverse_arc ( ArcType arc) [static]

Definition at line 1377 of file puller.c.

References ARC2EXTRA, ChangeArcAngles(), CURRENT, ArcType::Delta, Extra::end, Extra::start, and ArcType::StartAngle.

Referenced by maybe_pull_1().

Here is the call graph for this function:

static void reverse_line ( LineType line) [static]

Definition at line 1349 of file puller.c.

References CURRENT, Extra::end, LINE2EXTRA, MoveObject(), Extra::start, x, and y.

Referenced by maybe_pull(), and maybe_pull_1().

Here is the call graph for this function:

static int same_sign ( double  a,
double  b 
) [static]

Definition at line 204 of file puller.c.

Referenced by gp_point_2(), and maybe_pull_1().

static void status ( ) [static]

Definition at line 614 of file puller.c.

References Message().

Referenced by ghid_listener_cb(), GlobalPuller(), and maybe_pull_1().

Here is the call graph for this function:

static void unlink_end ( Extra x,
Extra **  e 
) [static]

Definition at line 670 of file puller.c.

References multi_next.

Referenced by find_pair_padline_callback(), and find_pair_pinline_callback().

static void unlink_extras ( Extra e) [static]

Definition at line 1905 of file puller.c.

References Extra::end, End::next, print_extra(), and Extra::start.

Referenced by mark_arc_for_deletion(), and mark_line_for_deletion().

Here is the call graph for this function:

static void validate_pair ( Extra e,
End end 
) [static]

Definition at line 2521 of file puller.c.

References Extra::end, End::next, print_extra(), and Extra::start.

Referenced by validate_pair_cb().

Here is the call graph for this function:

static void validate_pair_cb ( AnyObjectType ptr,
Extra extra,
void *  userdata 
) [static]

Definition at line 2536 of file puller.c.

References Extra::end, Extra::start, and validate_pair().

Referenced by validate_pairs().

Here is the call graph for this function:

static void validate_pairs ( ) [static]

Definition at line 2543 of file puller.c.

References validate_pair_cb().

Referenced by GlobalPuller().

Here is the call graph for this function:

static Coord within ( Coord  x1,
Coord  y1,
Coord  x2,
Coord  y2,
Coord  r 
) [static]

Definition at line 100 of file puller.c.

References Distance().

Referenced by do_via_search(), and Puller().

Here is the call graph for this function:


Variable Documentation

jmp_buf abort_buf [static]

Definition at line 84 of file puller.c.

Referenced by create_arc(), GlobalPuller(), and maybe_pull_1().

double arc_dist [static]

Definition at line 88 of file puller.c.

Referenced by arc_callback(), and arc_endpoint_is().

int arc_exact

Definition at line 85 of file puller.c.

Referenced by arc_callback(), arc_endpoint_is(), and find_pair().

GHashTable* arcs [static]

Definition at line 650 of file puller.c.

Referenced by export_oproutes(), oproute_calculate_tof(), and oproute_rubberband_segment().

double best_angle [static]

Definition at line 1428 of file puller.c.

Definition at line 652 of file puller.c.

int current_is_top [static]

Definition at line 652 of file puller.c.

int did_something [static]

Definition at line 651 of file puller.c.

Referenced by GlobalPuller().

Definition at line 1431 of file puller.c.

double ea_sign

Definition at line 1426 of file puller.c.

Definition at line 1414 of file puller.c.

ArcType* end_arc [static]

Definition at line 1412 of file puller.c.

double end_dist

Definition at line 1428 of file puller.c.

Definition at line 1413 of file puller.c.

Referenced by maybe_pull_1().

LineType* end_line [static]

Definition at line 1411 of file puller.c.

void * end_pinpad

Definition at line 1415 of file puller.c.

Coord ex [static]

Definition at line 95 of file puller.c.

Referenced by connect_corners(), maybe_pull_1(), penalty3(), and Puller().

Definition at line 95 of file puller.c.

Referenced by maybe_pull_1(), penalty3(), and Puller().

double fa [static]

Definition at line 1438 of file puller.c.

End* fp_end [static]

Definition at line 1437 of file puller.c.

Referenced by maybe_pull_1().

Definition at line 1435 of file puller.c.

Referenced by gts_point_locate().

Coord fx [static]

Definition at line 1435 of file puller.c.

Definition at line 1435 of file puller.c.

const char globalpuller_help[] = "Pull all traces tight." [static]

Definition at line 563 of file puller.c.

const char globalpuller_syntax[] = "GlobalPuller()" [static]

Definition at line 560 of file puller.c.

Extra* last_pextra = 0 [static]

Definition at line 1242 of file puller.c.

Definition at line 85 of file puller.c.

Referenced by find_pair(), and line_callback().

GHashTable* lines [static]

Definition at line 649 of file puller.c.

int multi [static]

Definition at line 85 of file puller.c.

Referenced by arc_callback(), find_pair(), and line_callback().

Extra multi_next [static]

Definition at line 648 of file puller.c.

Referenced by find_pair_arc_callback(), find_pair_line_callback(), and unlink_end().

int nloops [static]

Definition at line 611 of file puller.c.

int npulled

Definition at line 611 of file puller.c.

Initial value:
 {
  {"Puller", "Click on a line-arc intersection or line segment", Puller,
   puller_help, puller_syntax},
  {"GlobalPuller", 0, GlobalPuller,
   globalpuller_help, globalpuller_syntax}
}

Definition at line 2705 of file puller.c.

const char puller_help[] = "Pull an arc-line junction tight." [static]

Definition at line 429 of file puller.c.

const char puller_syntax[] = "Puller()" [static]

Definition at line 427 of file puller.c.

Coord sa_r [static]

Definition at line 1431 of file puller.c.

double sa_sign

Definition at line 1426 of file puller.c.

Coord sa_x [static]

Definition at line 1432 of file puller.c.

Definition at line 1432 of file puller.c.

Extra* sarc_extra [static]

Definition at line 1414 of file puller.c.

double se_sign [static]

Definition at line 1426 of file puller.c.

Referenced by maybe_pull_1().

ArcType* start_arc [static]

Definition at line 1409 of file puller.c.

Extra* start_extra [static]

Definition at line 1413 of file puller.c.

Referenced by maybe_pull_1().

LineType* start_line [static]

Definition at line 1410 of file puller.c.

void* start_pinpad [static]

Definition at line 1415 of file puller.c.

ArcType* the_arc [static]

Definition at line 87 of file puller.c.

LineType* the_line [static]

Definition at line 86 of file puller.c.

Coord thickness [static]

Definition at line 1416 of file puller.c.

Referenced by ActionMinMaskGap(), ComputeCost(), export_oproutes(), and gp_point_force().

Coord x [static]

Definition at line 93 of file puller.c.

Referenced by ActionDisplay(), ActionImport(), ActionMoveObject(), ActionPasteBuffer(), ActionSelect(), adjust_vertices(), AdjustInsertPoint(), arc_callback(), ArcArcIntersect(), bm_to_pathlist(), calc_lon(), calc_sums(), candidate_vertices(), canonicalize_line(), check_intersect_vertex(), check_line_callback(), check_non_intersect_vertex(), check_snap_object(), CirclePoly(), common_draw_pcb_text(), common_fill_pcb_pad(), copy_to_bounded(), create_board_edge(), detrand(), djabs(), draw_cap(), draw_crosshair(), draw_dozen_cross(), draw_slanted_cross(), DrawBackgroundImage(), drc_callback(), DRCAll(), DRCFind(), EnableAutosave(), fill_clipped_contour(), fill_contour(), find_clusters(), find_corner(), find_pair(), find_pairs_1(), findnext(), findpath(), FlagMode(), FontEdit(), free_slice(), gerber_draw_line(), gerber_fill_rect(), gerber_set_layer(), get_vertex(), ghid_confirm_dialog(), ghid_dialog_confirm(), ghid_draw_bg_image(), ghid_draw_grid(), ghid_lead_user_to_location(), ghid_set_crosshair(), ghid_unproject_to_z_plane(), ghid_watch(), gp_point_force(), GridFit(), gsvit_write_xcentroids(), gts_bb_tree_triangle_distance(), gts_bbox_diagonal2(), gts_bbox_point_distance2(), gts_delaunay_add_vertex_to_face(), gts_iso_slice_fill(), gts_iso_slice_fill_cartesian(), gts_point_new(), gts_point_orientation_3d_sos(), gts_point_orientation_sos(), gts_point_segment_distance2(), gts_point_set(), gts_point_transform(), gts_point_triangle_distance2(), gts_triangle_area(), gts_triangle_interpolate_height(), gts_vertex_principal_directions(), gts_vertices_merge(), hid_actionv(), hidgl_draw_arc(), hidgl_draw_grid(), hidgl_fill_circle(), intersection_of_lines(), intersection_of_linesegs(), isects(), iso_slice_evaluate(), iso_slice_evaluate_bcl(), iso_sub(), IsPointInPad(), IsPointInQuadrangle(), lesstif_draw_grid(), lesstif_set_crosshair(), lesstif_watch_cb(), line_callback(), miter(), move_corner(), nelma_write_object(), netlist_find(), netlist_select(), netnode_browse(), new_slice(), node_selection_changed_cb(), OctagonPoly(), orthopull_1(), Pan(), pcb_drc_violation_new(), penalty3(), plotpolygon(), png_do_export(), png_draw_arc(), png_use_mask(), pointslope(), PrintBOM(), Puller(), Px(), read_pads(), read_points(), reverse_line(), rubber_callback(), setbbox_path(), slice_init(), sort_drill(), space_edge(), split_edge(), split_path(), spread_edge(), square(), Subtract(), text_at(), thindraw_moved_pv(), toporouter_draw_surface(), toporouter_serpintine_new(), triangle_interior_capacity(), triangulate_face(), ts_bs(), ts_bs_sm(), unit_sphere_arc_midvertex(), Unsubtract(), vertex_move_towards_vertex(), vset(), xor_path(), and XORDrawBuffer().

Definition at line 93 of file puller.c.

Referenced by ActionDisplay(), ActionImport(), ActionMoveObject(), ActionPasteBuffer(), ActionSelect(), adjust_vertices(), AdjustInsertPoint(), arc_callback(), ArcArcIntersect(), bm_clearexcess(), bm_to_pathlist(), calc_lon(), calc_sums(), candidate_vertices(), canonicalize_line(), check_intersect_vertex(), check_non_intersect_vertex(), check_snap_object(), CirclePoly(), clear_bm_with_bbox(), common_fill_pcb_pad(), copy_to_bounded(), create_board_edge(), djmax(), djmin(), doPerturb(), draw_cap(), draw_crosshair(), draw_dozen_cross(), draw_slanted_cross(), DrawBackgroundImage(), drc_callback(), DRCAll(), DRCFind(), fill_contour(), find_clusters(), find_corner(), find_pair(), find_pairs_1(), findnext(), findpath(), FontEdit(), gerber_draw_line(), gerber_fill_rect(), gerber_set_layer(), get_vertex(), ghid_confirm_dialog(), ghid_dialog_confirm(), ghid_draw_bg_image(), ghid_draw_grid(), ghid_lead_user_to_location(), ghid_set_crosshair(), ghid_unproject_to_z_plane(), gp_point_force(), gsvit_write_xcentroids(), gts_bb_tree_triangle_distance(), gts_bbox_diagonal2(), gts_bbox_point_distance2(), gts_delaunay_add_vertex_to_face(), gts_iso_slice_fill(), gts_iso_slice_fill_cartesian(), gts_point_new(), gts_point_orientation_3d_sos(), gts_point_orientation_sos(), gts_point_segment_distance2(), gts_point_set(), gts_point_transform(), gts_point_triangle_distance2(), gts_triangle_area(), gts_triangle_interpolate_height(), gts_vertex_principal_directions(), gts_vertices_merge(), hid_actionv(), hidgl_draw_arc(), hidgl_draw_grid(), hidgl_fill_circle(), intersection_of_lines(), intersection_of_linesegs(), iso_slice_evaluate(), iso_slice_evaluate_bcl(), iso_sub(), IsPointInQuadrangle(), lesstif_draw_grid(), lesstif_set_crosshair(), line_callback(), miter(), move_corner(), nelma_write_object(), netlist_find(), netlist_select(), netnode_browse(), node_selection_changed_cb(), OctagonPoly(), orthopull_1(), Pan(), pcb_drc_violation_new(), penalty3(), plotpolygon(), png_do_export(), png_draw_arc(), png_use_mask(), pointslope(), PrintBOM(), Puller(), Py(), read_pads(), read_points(), reverse_line(), rubber_callback(), setbbox_path(), slice_init(), sort_drill(), space_edge(), split_edge(), split_path(), spread_edge(), text_at(), thindraw_moved_pv(), toporouter_draw_surface(), toporouter_serpintine_new(), triangle_interior_capacity(), triangulate_face(), ts_bs(), ts_bs_sm(), unit_sphere_arc_midvertex(), vertex_move_towards_vertex(), vset(), xor_path(), and XORDrawBuffer().