pcb 4.1.1
An interactive printed circuit board layout editor.

move.c File Reference

Functions used to move pins, elements ... More...

#include <setjmp.h>
#include <stdlib.h>
#include "global.h"
#include "create.h"
#include "crosshair.h"
#include "data.h"
#include "draw.h"
#include "error.h"
#include "misc.h"
#include "move.h"
#include "mymem.h"
#include "polygon.h"
#include "rtree.h"
#include "search.h"
#include "select.h"
#include "thermal.h"
#include "undo.h"
Include dependency graph for move.c:

Go to the source code of this file.

Data Structures

struct  via_info
 Moves a line between layers. More...
struct  mptlc

Functions

static void * MoveElementName (ElementType *Element)
 Moves all names of an element to a new position.
static void * MoveElement (ElementType *Element)
 Moves an element.
static void * MoveVia (PinType *Via)
 Moves a via.
static void * MoveLine (LayerType *Layer, LineType *Line)
 Moves a line.
static void * MoveArc (LayerType *Layer, ArcType *Arc)
 Moves an arc.
static void * MoveText (LayerType *Layer, TextType *Text)
 Moves a text object.
static void * MovePolygon (LayerType *Layer, PolygonType *Polygon)
 Moves a polygon.
static void * MoveLinePoint (LayerType *Layer, LineType *Line, PointType *Point)
 Moves one end of a line.
static void * MovePolygonPoint (LayerType *Layer, PolygonType *Polygon, PointType *Point)
 Moves a polygon-point.
static void * MoveLineToLayer (LayerType *, LineType *)
static void * MoveArcToLayer (LayerType *Layer, ArcType *Arc)
 Moves an arc between layers.
static void * MoveRatToLayer (RatType *Rat)
 Moves a line between layers.
static void * MoveTextToLayer (LayerType *layer, TextType *text)
 Moves a text object between layers.
static void * MovePolygonToLayer (LayerType *Layer, PolygonType *Polygon)
 Moves a polygon between layers.
void MoveElementLowLevel (DataType *Data, ElementType *Element, Coord DX, Coord DY)
 Moves a element by +-X and +-Y.
void MovePolygonLowLevel (PolygonType *Polygon, Coord DeltaX, Coord DeltaY)
 Low level routine to move a polygon.
static void * MoveLineToLayerLowLevel (LayerType *Source, LineType *line, LayerType *Destination)
 Moves a line between layers; lowlevel routines.
static void * MoveArcToLayerLowLevel (LayerType *Source, ArcType *arc, LayerType *Destination)
 Moves an arc between layers; lowlevel routines.
static int moveline_callback (const BoxType *b, void *cl)
static void * MoveTextToLayerLowLevel (LayerType *Source, TextType *text, LayerType *Destination)
 Moves a text object between layers; lowlevel routines.
static void * MovePolygonToLayerLowLevel (LayerType *Source, PolygonType *polygon, LayerType *Destination)
 Moves a polygon between layers; lowlevel routines.
int mptl_pin_callback (const BoxType *b, void *cl)
void * MoveObject (int Type, void *Ptr1, void *Ptr2, void *Ptr3, Coord DX, Coord DY)
 Moves the object identified by its data pointers and the type not we don't bump the undo serial number.
void * MoveObjectAndRubberband (int Type, void *Ptr1, void *Ptr2, void *Ptr3, Coord DX, Coord DY)
 Moves the object identified by its data pointers and the type as well as all attached rubberband lines.
void * MoveObjectToLayer (int Type, void *Ptr1, void *Ptr2, void *Ptr3, LayerType *Target, bool enmasse)
 Moves the object identified by its data pointers and the type to a new layer without changing it's position.
bool MoveSelectedObjectsToLayer (LayerType *Target)
 Moves the selected objects to a new layer without changing their positions.
static void move_one_thermal (int old_index, int new_index, PinType *pin)
static void move_all_thermals (int old_index, int new_index)
static int LastNormalLayerInSideGroup (int side, int layer)
int MoveLayer (int old_index, int new_index)
 Moves the selected layers to a new index in the layer list.
int MoveLayerAction (int argc, char **argv, Coord x, Coord y)

Variables

static Coord DeltaX
static Coord DeltaY
static LayerTypeDest
static bool MoreToCome
static ObjectFunctionType MoveFunctions
static ObjectFunctionType MoveToLayerFunctions
struct mptlc mptlc
static const char movelayer_syntax [] = "MoveLayer(old,new)"
static const char movelayer_help [] = "Moves/Creates/Deletes Layers."
HID_Action move_action_list []

Detailed Description

Functions used to move pins, elements ...


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


Function Documentation

static int LastNormalLayerInSideGroup ( int  side,
int  layer 
) [static]

Definition at line 923 of file move.c.

References GetLayerGroupNumberByNumber(), GetLayerGroupNumberBySide(), PCBType::LayerGroups, LayerGroupType::Number, and PCB.

Referenced by MoveLayer().

Here is the call graph for this function:

static void move_all_thermals ( int  old_index,
int  new_index 
) [static]

Definition at line 907 of file move.c.

References ALLPIN_LOOP, PCBType::Data, END_LOOP, ENDALL_LOOP, move_one_thermal(), PCB, pin, and VIA_LOOP.

Referenced by MoveLayer().

Here is the call graph for this function:

static void move_one_thermal ( int  old_index,
int  new_index,
PinType pin 
) [static]

Definition at line 876 of file move.c.

References ASSIGN_THERM, and GET_THERM.

Referenced by move_all_thermals().

static void * MoveArc ( LayerType Layer,
ArcType Arc 
) [static]

Moves an arc.

Definition at line 287 of file move.c.

References LayerType::arc_tree, ClearFromPolygon(), PCBType::Data, DeltaX, DeltaY, Draw(), DrawArc(), EraseArc(), MOVE_ARC_LOWLEVEL, LayerType::On, PCB, r_delete_entry(), r_insert_entry(), and RestoreToPolygon().

Here is the call graph for this function:

static void * MoveArcToLayer ( LayerType Layer,
ArcType Arc 
) [static]

Moves an arc between layers.

Definition at line 475 of file move.c.

References _, AddObjectToMoveToLayerUndoList(), ClearFromPolygon(), PCBType::Data, Draw(), DrawArc(), EraseArc(), Message(), MoveArcToLayerLowLevel(), LayerType::On, PCB, RestoreToPolygon(), and TEST_FLAG.

Here is the call graph for this function:

static void* MoveArcToLayerLowLevel ( LayerType Source,
ArcType arc,
LayerType Destination 
) [static]

Moves an arc between layers; lowlevel routines.

Definition at line 454 of file move.c.

References LayerType::Arc, LayerType::arc_tree, LayerType::ArcN, r_create_tree(), r_delete_entry(), and r_insert_entry().

Referenced by MoveArcToLayer().

Here is the call graph for this function:

static void * MoveElement ( ElementType Element) [static]
static void * MoveElementName ( ElementType Element) [static]

Moves all names of an element to a new position.

Definition at line 177 of file move.c.

References PCBType::Data, DeltaX, DeltaY, Draw(), DrawElementName(), PCBType::ElementOn, ELEMENTTEXT_LOOP, END_LOOP, EraseElementName(), FRONT, PCBType::InvisibleObjectsOn, MOVE_TEXT_LOWLEVEL, n, DataType::name_tree, PCB, r_delete_entry(), and r_insert_entry().

Here is the call graph for this function:

int MoveLayer ( int  old_index,
int  new_index 
)
int MoveLayerAction ( int  argc,
char **  argv,
Coord  x,
Coord  y 
)

Definition at line 1156 of file move.c.

References ChangeGroupVisibility(), INDEXOFCURRENT, max_copper_layer, Message(), and MoveLayer().

Here is the call graph for this function:

static void * MoveLine ( LayerType Layer,
LineType Line 
) [static]

Moves a line.

Definition at line 266 of file move.c.

References ClearFromPolygon(), PCBType::Data, DeltaX, DeltaY, Draw(), DrawLine(), EraseLine(), LayerType::line_tree, MOVE_LINE_LOWLEVEL, LayerType::On, PCB, r_delete_entry(), r_insert_entry(), and RestoreToPolygon().

Here is the call graph for this function:

static int moveline_callback ( const BoxType b,
void *  cl 
) [static]
static void * MoveLinePoint ( LayerType Layer,
LineType Line,
PointType Point 
) [static]
static void* MoveLineToLayerLowLevel ( LayerType Source,
LineType line,
LayerType Destination 
) [static]

Moves a line between layers; lowlevel routines.

Definition at line 434 of file move.c.

References line, LayerType::Line, LayerType::line_tree, LayerType::LineN, r_create_tree(), r_delete_entry(), and r_insert_entry().

Referenced by MoveLineToLayer().

Here is the call graph for this function:

void* MoveObject ( int  Type,
void *  Ptr1,
void *  Ptr2,
void *  Ptr3,
Coord  DX,
Coord  DY 
)

Moves the object identified by its data pointers and the type not we don't bump the undo serial number.

Definition at line 787 of file move.c.

References AddObjectToMoveUndoList(), DeltaX, DeltaY, and ObjectOperation().

Referenced by mark_line_for_deletion(), maybe_pull_1(), move_corner(), Puller(), RemoveLinePoint(), reverse_line(), split_line(), and UndoMove().

Here is the call graph for this function:

void* MoveObjectAndRubberband ( int  Type,
void *  Ptr1,
void *  Ptr2,
void *  Ptr3,
Coord  DX,
Coord  DY 
)

Moves the object identified by its data pointers and the type as well as all attached rubberband lines.

Definition at line 803 of file move.c.

References AddObjectToMoveUndoList(), CrosshairType::AttachedObject, CLEAR_FLAG, Crosshair, DeltaX, DeltaY, IncrementUndoSerialNumber(), RubberbandType::Layer, RubberbandType::Line, RubberbandType::MovedPoint, MoveLinePoint(), ObjectOperation(), ptr, ptr2, AttachedObjectType::Rubberband, and AttachedObjectType::RubberbandN.

Referenced by ActionMoveObject(), NotifyMode(), and SetMode().

Here is the call graph for this function:

void* MoveObjectToLayer ( int  Type,
void *  Ptr1,
void *  Ptr2,
void *  Ptr3,
LayerType Target,
bool  enmasse 
)

Moves the object identified by its data pointers and the type to a new layer without changing it's position.

Definition at line 845 of file move.c.

References IncrementUndoSerialNumber(), MoreToCome, MoveToLayerFunctions, and ObjectOperation().

Referenced by ActionMoveToCurrentLayer(), move_line_to_layer(), and UndoMoveToLayer().

Here is the call graph for this function:

static void * MovePolygon ( LayerType Layer,
PolygonType Polygon 
) [static]

Moves a polygon.

Definition at line 347 of file move.c.

References PCBType::Data, DeltaX, DeltaY, Draw(), DrawPolygon(), ErasePolygon(), InitClip(), MovePolygonLowLevel(), LayerType::On, PCB, LayerType::polygon_tree, r_delete_entry(), and r_insert_entry().

Here is the call graph for this function:

void MovePolygonLowLevel ( PolygonType Polygon,
Coord  DeltaX,
Coord  DeltaY 
)

Low level routine to move a polygon.

Definition at line 333 of file move.c.

References END_LOOP, MOVE, MOVE_BOX_LOWLEVEL, and POLYGONPOINT_LOOP.

Referenced by CopyPolygon(), and MovePolygon().

static void * MovePolygonPoint ( LayerType Layer,
PolygonType Polygon,
PointType Point 
) [static]
static void * MovePolygonToLayer ( LayerType Layer,
PolygonType Polygon 
) [static]
static void* MovePolygonToLayerLowLevel ( LayerType Source,
PolygonType polygon,
LayerType Destination 
) [static]

Moves a polygon between layers; lowlevel routines.

Definition at line 703 of file move.c.

References LayerType::Polygon, LayerType::polygon_tree, LayerType::PolygonN, r_create_tree(), r_delete_entry(), and r_insert_entry().

Referenced by MovePolygonToLayer().

Here is the call graph for this function:

static void * MoveRatToLayer ( RatType Rat) [static]

Moves a line between layers.

Definition at line 507 of file move.c.

References AddObjectToCreateUndoList(), CreateNewLineOnLayer(), Draw(), DrawLine(), EraseRat(), SettingType::Keepaway, SettingType::LineThickness, MoveObjectToRemoveUndoList(), PCB, PCBType::RatOn, SET_FLAG, Settings, and TEST_FLAG.

Here is the call graph for this function:

bool MoveSelectedObjectsToLayer ( LayerType Target)

Moves the selected objects to a new layer without changing their positions.

Definition at line 863 of file move.c.

References MoreToCome, MoveToLayerFunctions, and SelectedOperation().

Referenced by ActionMoveToCurrentLayer().

Here is the call graph for this function:

static void * MoveText ( LayerType Layer,
TextType Text 
) [static]

Moves a text object.

Definition at line 311 of file move.c.

References ClearFromPolygon(), PCBType::Data, DeltaX, DeltaY, Draw(), DrawText(), EraseText(), MOVE_TEXT_LOWLEVEL, LayerType::On, PCB, r_delete_entry(), r_insert_entry(), RestoreToPolygon(), and LayerType::text_tree.

Here is the call graph for this function:

static void * MoveTextToLayer ( LayerType layer,
TextType text 
) [static]

Moves a text object between layers.

Definition at line 678 of file move.c.

References _, AddObjectToMoveToLayerUndoList(), Draw(), DrawText(), EraseText(), Message(), MoveTextToLayerLowLevel(), LayerType::On, and TEST_FLAG.

Here is the call graph for this function:

static void* MoveTextToLayerLowLevel ( LayerType Source,
TextType text,
LayerType Destination 
) [static]
static void * MoveVia ( PinType Via) [static]

Moves a via.

Definition at line 245 of file move.c.

References ClearFromPolygon(), PCBType::Data, DeltaX, DeltaY, Draw(), DrawVia(), EraseVia(), MOVE_VIA_LOWLEVEL, PCB, r_delete_entry(), r_insert_entry(), RestoreToPolygon(), DataType::via_tree, and PCBType::ViaOn.

Here is the call graph for this function:

int mptl_pin_callback ( const BoxType b,
void *  cl 
)

Variable Documentation

Definition at line 84 of file move.c.

LayerType* Dest [static]

Definition at line 85 of file move.c.

bool MoreToCome [static]

Definition at line 86 of file move.c.

Referenced by MoveLineToLayer(), MoveObjectToLayer(), and MoveSelectedObjectsToLayer().

Initial value:

Definition at line 1214 of file move.c.

Initial value:

Definition at line 87 of file move.c.

const char movelayer_help[] = "Moves/Creates/Deletes Layers." [static]

Definition at line 1111 of file move.c.

const char movelayer_syntax[] = "MoveLayer(old,new)" [static]

Definition at line 1109 of file move.c.

Initial value:

{
MoveLineToLayer,
    MoveTextToLayer,
    MovePolygonToLayer,
    NULL, NULL, NULL, NULL, NULL, NULL, NULL, MoveArcToLayer, MoveRatToLayer}

Definition at line 100 of file move.c.

Referenced by MoveObjectToLayer(), and MoveSelectedObjectsToLayer().

struct mptlc mptlc