pcb 4.1.1
An interactive printed circuit board layout editor.

line.c File Reference

Routines for inserting points into objects. More...

#include <math.h>
#include <setjmp.h>
#include <stdlib.h>
#include "global.h"
#include "data.h"
#include "crosshair.h"
#include "find.h"
#include "line.h"
#include "misc.h"
#include "rtree.h"
Include dependency graph for line.c:

Go to the source code of this file.

Data Structures

struct  drc_info

Functions

static double drc_lines (PointType *end, bool way)
 drc_lines() checks for intersectors against two lines and adjusts the end point until there is no intersection or it winds up back at the start.
void AdjustAttachedLine (void)
 Adjust the attached line to 45 degrees if necessary.
void FortyFiveLine (AttachedLineType *Line)
 Makes the attached line fit into a 45 degree direction.
void AdjustTwoLine (bool way)
 Adjusts the insert lines to make them 45 degrees as necessary.
static int drcVia_callback (const BoxType *b, void *cl)
static int drcPad_callback (const BoxType *b, void *cl)
static int drcLine_callback (const BoxType *b, void *cl)
static int drcArc_callback (const BoxType *b, void *cl)
void EnforceLineDRC (void)

Detailed Description

Routines for inserting points into objects.


Copyright.


PCB, interactive printed circuit board design

Copyright (C) 1994,1995,1996 Thomas Nau

Copyright (C) 2004 harry eaton

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: Thomas Nau, Schlehenweg 15, 88471 Baustetten, Germany Thomas.Nau@rz.uni-ulm.de

Definition in file line.c.


Function Documentation

void AdjustAttachedLine ( void  )
static double drc_lines ( PointType end,
bool  way 
) [static]

drc_lines() checks for intersectors against two lines and adjusts the end point until there is no intersection or it winds up back at the start.

If way is false it checks straight start, 45 end lines, otherwise it checks 45 start, straight end.

It returns the straight-line length of the best answer, and changes the position of the input point to the best answer.

Definition at line 301 of file line.c.

References abs, CrosshairType::AttachedLine, PCBType::Bloat, BOTTOM_SIDE, drc_info::bottom_side, Crosshair, PCBType::Data, drcArc_callback(), drcLine_callback(), drcPad_callback(), drcVia_callback(), END_LOOP, drc_info::env, f, GetLayerGroupNumberByNumber(), GetLayerGroupNumberBySide(), GROUP_LOOP, INDEXOFCURRENT, layer, len, drc_info::line, SettingType::LineThickness, MIN, NoFlags, DataType::pad_tree, PCB, DataType::pin_tree, AttachedLineType::Point1, r_search(), s, SetLineBoundingBox(), Settings, SGN, TOP_SIDE, drc_info::top_side, DataType::via_tree, PointType::X, and PointType::Y.

Referenced by EnforceLineDRC().

Here is the call graph for this function:

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

Definition at line 279 of file line.c.

References drc_info::env, drc_info::line, LineArcIntersect(), and TEST_FLAG.

Referenced by drc_lines().

Here is the call graph for this function:

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

Definition at line 268 of file line.c.

References drc_info::env, drc_info::line, line, LineLineIntersect(), and TEST_FLAG.

Referenced by drc_lines().

Here is the call graph for this function:

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

Definition at line 256 of file line.c.

References drc_info::bottom_side, drc_info::env, drc_info::line, LinePadIntersect(), and TEST_FLAG.

Referenced by drc_lines().

Here is the call graph for this function:

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

Definition at line 245 of file line.c.

References drc_info::env, drc_info::line, PinLineIntersect(), and TEST_FLAG.

Referenced by drc_lines().

Here is the call graph for this function:

void FortyFiveLine ( AttachedLineType Line)

Makes the attached line fit into a 45 degree direction.

Directions:

           4
          5 3
         6   2
          7 1
           0

Definition at line 100 of file line.c.

References abs, Crosshair, m, MAX, max, MIN, min, AttachedLineType::Point1, AttachedLineType::Point2, TAN_30_DEGREE, TAN_60_DEGREE, PointType::X, CrosshairType::X, PointType::Y, and CrosshairType::Y.

Referenced by AdjustAttachedLine(), and AdjustInsertPoint().