pcb 4.1.1
An interactive printed circuit board layout editor.

rubberband.c File Reference

Functions used by 'rubberband moves'. More...

#include <stdlib.h>
#include <memory.h>
#include <math.h>
#include "global.h"
#include "create.h"
#include "data.h"
#include "error.h"
#include "misc.h"
#include "polygon.h"
#include "rubberband.h"
#include "rtree.h"
#include "search.h"
Include dependency graph for rubberband.c:

Go to the source code of this file.

Data Structures

struct  rubber_info
struct  rinfo

Functions

static void CheckPadForRubberbandConnection (PadType *Pad)
 Checks all visible lines which belong to the same layergroup as the passed pad.
static void CheckPinForRubberbandConnection (PinType *Pin)
 Checks all visible lines.
static void CheckLinePointForRubberbandConnection (LayerType *Layer, LineType *Line, PointType *LinePoint, bool Exact)
 Checks all visible lines which belong to the same group as the passed line.
static void CheckArcPointForRubberbandConnection (LayerType *Layer, ArcType *Arc, PointType *ArcPoint, bool Exact)
 Checks all visible lines which belong to the same group as the passed arc.
static void CheckPolygonForRubberbandConnection (LayerType *, PolygonType *)
static void CheckLinePointForRat (LayerType *, PointType *)
static int rubber_callback (const BoxType *b, void *cl)
static int rat_callback (const BoxType *box, void *cl)
static void CheckPadForRat (PadType *Pad)
static void CheckPinForRat (PinType *Pin)
void LookupRubberbandLines (int Type, void *Ptr1, void *Ptr2, void *Ptr3)
 Lookup all lines that are connected to an object and save the data to 'Crosshair.AttachedObject.Rubberband'.
void LookupRatLines (int Type, void *Ptr1, void *Ptr2, void *Ptr3)

Detailed Description

Functions used by 'rubberband moves'.


Copyright.


PCB, interactive printed circuit board design

Copyright (C) 1994,1995,1996 Thomas Nau

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 rubberband.c.


Function Documentation

static void CheckArcPointForRubberbandConnection ( LayerType Layer,
ArcType Arc,
PointType ArcPoint,
bool  Exact 
) [static]

Checks all visible lines which belong to the same group as the passed arc.

If one of the endpoints of the line lays inside the passed arc, the scanned line is added to the 'rubberband' list

Definition at line 456 of file rubberband.c.

References rubber_info::box, PCBType::Data, END_LOOP, GetLayerGroupNumberByPointer(), GROUP_LOOP, rubber_info::layer, layer, rubber_info::line, MAX, PCB, r_search(), rubber_info::radius, rubber_callback(), ArcType::Thickness, rubber_info::X, PointType::X, BoxType::X1, BoxType::X2, rubber_info::Y, PointType::Y, BoxType::Y1, and BoxType::Y2.

Referenced by LookupRubberbandLines().

Here is the call graph for this function:

static void CheckLinePointForRat ( LayerType Layer,
PointType Point 
) [static]

Definition at line 358 of file rubberband.c.

References PCBType::Data, GetLayerGroupNumberByPointer(), rinfo::group, PCB, rinfo::point, r_search(), rat_callback(), DataType::rat_tree, and rinfo::type.

Referenced by LookupRatLines().

Here is the call graph for this function:

static void CheckLinePointForRubberbandConnection ( LayerType Layer,
LineType Line,
PointType LinePoint,
bool  Exact 
) [static]

Checks all visible lines which belong to the same group as the passed line.

If one of the endpoints of the line lays * inside the passed line, the scanned line is added to the 'rubberband' list.

Definition at line 417 of file rubberband.c.

References rubber_info::box, PCBType::Data, END_LOOP, GetLayerGroupNumberByPointer(), GROUP_LOOP, rubber_info::layer, layer, rubber_info::line, MAX, PCB, r_search(), rubber_info::radius, rubber_callback(), rubber_info::X, PointType::X, BoxType::X1, BoxType::X2, rubber_info::Y, PointType::Y, BoxType::Y1, and BoxType::Y2.

Referenced by LookupRubberbandLines().

Here is the call graph for this function:

static void CheckPadForRat ( PadType Pad) [static]

Definition at line 333 of file rubberband.c.

References BOTTOM_SIDE, PCBType::Data, GetLayerGroupNumberBySide(), rinfo::group, rinfo::pad, PCB, r_search(), rat_callback(), DataType::rat_tree, TEST_FLAG, TOP_SIDE, and rinfo::type.

Referenced by LookupRatLines().

Here is the call graph for this function:

static void CheckPadForRubberbandConnection ( PadType Pad) [static]

Checks all visible lines which belong to the same layergroup as the passed pad.

If one of the endpoints of the line lays inside the pad, the line is added to the 'rubberband' list.

Definition at line 238 of file rubberband.c.

References BOTTOM_SIDE, rubber_info::box, PCBType::Data, END_LOOP, GetLayerGroupNumberBySide(), GROUP_LOOP, layer, rubber_info::layer, rubber_info::line, LayerType::line_tree, MAX, MIN, LayerType::On, PCB, r_search(), rubber_info::radius, rubber_callback(), TEST_FLAG, TOP_SIDE, BoxType::X1, BoxType::X2, BoxType::Y1, and BoxType::Y2.

Referenced by LookupRubberbandLines().

Here is the call graph for this function:

static void CheckPinForRat ( PinType Pin) [static]

Definition at line 347 of file rubberband.c.

References PCBType::Data, PCB, rinfo::pin, r_search(), rat_callback(), DataType::rat_tree, and rinfo::type.

Referenced by LookupRatLines().

Here is the call graph for this function:

static void CheckPinForRubberbandConnection ( PinType Pin) [static]

Checks all visible lines.

If one of the endpoints of the line lays inside the pin, the line is added to the 'rubberband' list.

Square pins are handled as if they were round.

Speed and readability is more important then the few % of failures that are immediately recognized.

Definition at line 381 of file rubberband.c.

References rubber_info::box, rubber_info::layer, LAYER_PTR, rubber_info::line, LayerType::line_tree, max_copper_layer, n, r_search(), rubber_info::radius, rubber_callback(), TEST_FLAG, pin_st::Thickness, rubber_info::X, pin_st::X, BoxType::X1, BoxType::X2, rubber_info::Y, pin_st::Y, BoxType::Y1, and BoxType::Y2.

Referenced by LookupRubberbandLines().

Here is the call graph for this function:

static void CheckPolygonForRubberbandConnection ( LayerType Layer,
PolygonType Polygon 
) [static]

Definition at line 493 of file rubberband.c.

References CreateNewRubberbandEntry(), PCBType::Data, END_LOOP, GetLayerGroupNumberByPointer(), GROUP_LOOP, IsPointInPolygon(), layer, line, LINE_LOOP, PCB, and TEST_FLAG.

Referenced by LookupRubberbandLines().

Here is the call graph for this function:

void LookupRatLines ( int  Type,
void *  Ptr1,
void *  Ptr2,
void *  Ptr3 
)

Definition at line 615 of file rubberband.c.

References CheckLinePointForRat(), CheckPadForRat(), CheckPinForRat(), END_LOOP, layer, line, PAD_LOOP, pin, and PIN_LOOP.

Referenced by ActionChangeName(), ActionMoveObject(), AttachForCopy(), NotifyMode(), and RotateScreenObject().

Here is the call graph for this function:

void LookupRubberbandLines ( int  Type,
void *  Ptr1,
void *  Ptr2,
void *  Ptr3 
)

Lookup all lines that are connected to an object and save the data to 'Crosshair.AttachedObject.Rubberband'.

Lookup is only done for visible layers.

Definition at line 536 of file rubberband.c.

References CheckArcPointForRubberbandConnection(), CheckLinePointForRubberbandConnection(), CheckPadForRubberbandConnection(), CheckPinForRubberbandConnection(), CheckPolygonForRubberbandConnection(), PCBType::Data, END_LOOP, GetLayerNumber(), layer, line, max_copper_layer, PAD_LOOP, PCB, pin, PIN_LOOP, ArcType::Point1, and ArcType::Point2.

Referenced by ActionMoveObject(), AttachForCopy(), and RotateScreenObject().

Here is the call graph for this function:

static int rat_callback ( const BoxType box,
void *  cl 
) [static]

Definition at line 277 of file rubberband.c.

References CreateNewRubberbandEntry(), rinfo::group, Message(), rinfo::pad, rinfo::pin, rinfo::point, rinfo::type, PointType::X, pin_st::X, PointType::Y, and pin_st::Y.

Referenced by CheckLinePointForRat(), CheckPadForRat(), and CheckPinForRat().

Here is the call graph for this function: