pcb 4.1.1
An interactive printed circuit board layout editor.
|
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"
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 LayerType * | Dest |
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 [] |
Functions used to move pins, elements ...
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
Definition in file move.c.
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().
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().
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().
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().
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.
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().
static void * MoveElement | ( | ElementType * | Element | ) | [static] |
Moves an element.
Definition at line 213 of file move.c.
References PCBType::Data, DeltaX, DeltaY, Draw(), DrawElementName(), DrawElementPackage(), DrawElementPinsAndPads(), PCBType::ElementOn, EraseElement(), EraseElementPinsAndPads(), FRONT, PCBType::InvisibleObjectsOn, MoveElementLowLevel(), PCB, and PCBType::PinOn.
void MoveElementLowLevel | ( | DataType * | Data, |
ElementType * | Element, | ||
Coord | DX, | ||
Coord | DY | ||
) |
Moves a element by +-X and +-Y.
Definition at line 112 of file move.c.
References ARC_LOOP, ClearFromPolygon(), PCBType::Data, DataType::element_tree, ELEMENTLINE_LOOP, ELEMENTTEXT_LOOP, END_LOOP, line, MOVE, MOVE_ARC_LOWLEVEL, MOVE_BOX_LOWLEVEL, MOVE_LINE_LOWLEVEL, MOVE_PAD_LOWLEVEL, MOVE_PIN_LOWLEVEL, MOVE_TEXT_LOWLEVEL, n, DataType::name_tree, PAD_LOOP, DataType::pad_tree, PCB, pin, PIN_LOOP, DataType::pin_tree, r_delete_entry(), r_insert_entry(), and RestoreToPolygon().
Referenced by ActionDisperseElements(), doPerturb(), MoveElement(), pinout_set_data(), place(), and relocate().
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().
int MoveLayer | ( | int | old_index, |
int | new_index | ||
) |
Moves the selected layers to a new index in the layer list.
index is 0..MAX_ALL_LAYER-1. If old_index is -1, a new layer is inserted at that index. If new_index is -1, the specified layer is deleted.
Definition at line 943 of file move.c.
References AddLayerChangeToUndoList(), BOTTOM_SIDE, ChangeBuriedViasAfterLayerCreate(), ChangeBuriedViasAfterLayerDelete(), ChangeBuriedViasAfterLayerMove(), LayerType::Color, hid_st::confirm_dialog, PCBType::Data, LayerGroupType::Entries, gui, hid_action(), IncrementUndoSerialNumber(), hid_st::invalidate_all, LastNormalLayerInSideGroup(), DataType::Layer, SettingType::LayerColor, PCBType::LayerGroups, SettingType::LayerSelectedColor, LayerStack, MAX_ALL_LAYER, max_copper_layer, Message(), move_all_thermals(), LayerType::Name, LayerGroupType::Number, LayerType::On, PCB, LayerType::SelectedColor, Settings, SILK_LAYER, TOP_SIDE, and Undoing().
Referenced by FontEdit(), MoveLayerAction(), and UndoLayerChange().
Definition at line 1156 of file move.c.
References ChangeGroupVisibility(), INDEXOFCURRENT, max_copper_layer, Message(), and MoveLayer().
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().
static int moveline_callback | ( | const BoxType * | b, |
void * | cl | ||
) | [static] |
Definition at line 546 of file move.c.
References AddObjectToCreateUndoList(), CreateNewViaEx(), PCBType::Data, DrawVia(), via_info::env, SettingType::Keepaway, via_info::layer_from, via_info::layer_to, NoFlags, PCB, Settings, SettingType::ViaDrillingHole, SettingType::ViaThickness, via_info::X, and via_info::Y.
Referenced by MoveLineToLayer().
Moves one end of a line.
Definition at line 369 of file move.c.
References ClearFromPolygon(), PCBType::Data, DeltaX, DeltaY, Draw(), DrawLine(), DrawRat(), EraseLine(), EraseRat(), LayerType::line_tree, MOVE, LayerType::On, PCB, r_delete_entry(), r_insert_entry(), DataType::rat_tree, PCBType::RatOn, RestoreToPolygon(), SetLineBoundingBox(), PointType::X, and PointType::Y.
Referenced by MoveObjectAndRubberband().
Definition at line 564 of file move.c.
References _, AddObjectToMoveToLayerUndoList(), ClearFromPolygon(), PCBType::Data, Draw(), DrawLine(), via_info::env, EraseLine(), GetLayerGroupNumberByPointer(), GetLayerNumber(), via_info::layer_from, via_info::layer_to, LayerType::line_tree, Message(), MoreToCome, moveline_callback(), MoveLineToLayerLowLevel(), LayerType::On, PCB, ptr1, ptr2, ptr3, r_search(), RestoreToPolygon(), SearchObjectByLocation(), Settings, TEST_FLAG, TEST_SILK_LAYER, PCBType::ViaOn, SettingType::ViaThickness, via_info::X, and via_info::Y.
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().
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().
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().
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().
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().
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] |
Moves a polygon-point.
Definition at line 409 of file move.c.
References PCBType::Data, DeltaX, DeltaY, Draw(), DrawPolygon(), ErasePolygon(), InitClip(), MOVE, LayerType::On, PCB, LayerType::polygon_tree, r_delete_entry(), r_insert_entry(), RemoveExcessPolygonPoints(), SetPolygonBoundingBox(), PointType::X, and PointType::Y.
static void * MovePolygonToLayer | ( | LayerType * | Layer, |
PolygonType * | Polygon | ||
) | [static] |
Moves a polygon between layers.
Definition at line 749 of file move.c.
References _, AddObjectToMoveToLayerUndoList(), PCBType::Data, mptlc::dnum, Draw(), DrawPolygon(), ErasePolygon(), GetLayerNumber(), InitClip(), Message(), MovePolygonToLayerLowLevel(), mptl_pin_callback(), LayerType::On, PCB, DataType::pin_tree, Polygon, mptlc::polygon, r_search(), mptlc::snum, TEST_FLAG, mptlc::type, and DataType::via_tree.
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().
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.
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().
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.
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.
static void* MoveTextToLayerLowLevel | ( | LayerType * | Source, |
TextType * | text, | ||
LayerType * | Destination | ||
) | [static] |
Moves a text object between layers; lowlevel routines.
Definition at line 647 of file move.c.
References BOTTOM_SIDE, CLEAR_FLAG, ClearFromPolygon(), PCBType::Data, PCBType::Font, GetLayerGroupNumberByPointer(), GetLayerGroupNumberBySide(), PCB, r_create_tree(), r_delete_entry(), r_insert_entry(), RestoreToPolygon(), SET_FLAG, SetTextBoundingBox(), LayerType::Text, LayerType::text_tree, and LayerType::TextN.
Referenced by MoveTextToLayer().
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.
int mptl_pin_callback | ( | const BoxType * | b, |
void * | cl | ||
) |
Definition at line 728 of file move.c.
References AddObjectToFlagUndoList(), ASSIGN_THERM, CLEAR_THERM, pin_st::Clearance, mptlc::dnum, pin_st::Element, GET_THERM, IsPointInPolygon(), pin, mptlc::polygon, mptlc::snum, TEST_THERM, pin_st::Thickness, mptlc::type, pin_st::X, and pin_st::Y.
Referenced by MovePolygonToLayer().
Definition at line 84 of file move.c.
Referenced by MoveArc(), MoveElement(), MoveElementName(), MoveLine(), MoveLinePoint(), MoveObject(), MoveObjectAndRubberband(), MovePolygon(), MovePolygonPoint(), MoveText(), and MoveVia().
bool MoreToCome [static] |
Definition at line 86 of file move.c.
Referenced by MoveLineToLayer(), MoveObjectToLayer(), and MoveSelectedObjectsToLayer().
{ {"MoveLayer", 0, MoveLayerAction, movelayer_help, movelayer_syntax} }
ObjectFunctionType MoveFunctions [static] |
{ MoveLine, MoveText, MovePolygon, MoveVia, MoveElement, MoveElementName, NULL, NULL, MoveLinePoint, MovePolygonPoint, MoveArc, NULL }
const char movelayer_help[] = "Moves/Creates/Deletes Layers." [static] |
const char movelayer_syntax[] = "MoveLayer(old,new)" [static] |
{ 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().