pcb 4.1.1
An interactive printed circuit board layout editor.
|
Functions used to copy pins, elements ... More...
#include <stdlib.h>
#include "global.h"
#include "copy.h"
#include "create.h"
#include "data.h"
#include "draw.h"
#include "mymem.h"
#include "mirror.h"
#include "misc.h"
#include "move.h"
#include "polygon.h"
#include "rats.h"
#include "rtree.h"
#include "select.h"
#include "undo.h"
Go to the source code of this file.
Functions | |
static void * | CopyVia (PinType *Via) |
Copies a via. | |
static void * | CopyLine (LayerType *Layer, LineType *Line) |
Copies a line. | |
static void * | CopyArc (LayerType *Layer, ArcType *Arc) |
Copies an arc. | |
static void * | CopyText (LayerType *Layer, TextType *Text) |
Copies a text. | |
static void * | CopyPolygon (LayerType *Layer, PolygonType *Polygon) |
Copies a polygon. | |
static void * | CopyElement (ElementType *Element) |
Copies an element onto the PCB, then does a draw. | |
PolygonType * | CopyPolygonLowLevel (PolygonType *Dest, PolygonType *Src) |
Copies data from one polygon to another. | |
ElementType * | CopyElementLowLevel (DataType *Data, ElementType *Src, bool uniqueName, Coord dx, Coord dy, int mask_flags) |
Copies data from one element to another and creates the destination if necessary. | |
bool | CopyPastebufferToLayout (Coord X, Coord Y) |
Pastes the contents of the buffer to the layout. | |
void * | CopyObject (int Type, void *Ptr1, void *Ptr2, void *Ptr3, Coord DX, Coord DY) |
Copies the object identified by its data pointers and the type the new objects is moved by DX,DY. | |
Variables | |
static Coord | DeltaX |
static Coord | DeltaY |
static ObjectFunctionType | CopyFunctions |
Functions used to copy pins, elements ...
It's necessary to copy data by calling create... since the base pointer may change cause of dynamic memory allocation.
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 copy.c.
Copies an arc.
Definition at line 231 of file copy.c.
References AddObjectToCreateUndoList(), ArcType::Clearance, CreateNewArcOnLayer(), ArcType::Delta, DeltaX, DeltaY, DrawArc(), ArcType::Height, MaskFlags(), ArcType::StartAngle, ArcType::Thickness, ArcType::Width, ArcType::X, and ArcType::Y.
Referenced by CopyPastebufferToLayout().
static void * CopyElement | ( | ElementType * | Element | ) | [static] |
Copies an element onto the PCB, then does a draw.
Definition at line 287 of file copy.c.
References AddObjectToCreateUndoList(), CopyElementLowLevel(), PCBType::Data, DeltaX, DeltaY, DrawElementName(), DrawElementPackage(), DrawElementPinsAndPads(), PCBType::ElementOn, FRONT, PCBType::InvisibleObjectsOn, ElementType::Name, PCB, PCBType::PinOn, TEST_FLAG, and TextType::TextString.
Referenced by CopyPastebufferToLayout().
ElementType* CopyElementLowLevel | ( | DataType * | Data, |
ElementType * | Src, | ||
bool | uniqueName, | ||
Coord | dx, | ||
Coord | dy, | ||
int | mask_flags | ||
) |
Copies data from one element to another and creates the destination if necessary.
Definition at line 122 of file copy.c.
References ARC_LOOP, ElementType::Attributes, pin_st::Clearance, CreateNewArcInElement(), CreateNewAttribute(), CreateNewElement(), CreateNewLineInElement(), CreateNewPad(), CreateNewPin(), DESCRIPTION_NAME, DESCRIPTION_TEXT, Dest, pin_st::DrillingHole, ELEMENTLINE_LOOP, END_LOOP, PCBType::Font, line, AttributeListType::List, ElementType::MarkX, ElementType::MarkY, pin_st::Mask, MaskFlags(), AttributeType::name, ElementType::Name, pin_st::Name, NAMEONPCB_NAME, AttributeListType::Number, pin_st::Number, PAD_LOOP, PCB, pin, PIN_LOOP, SetElementBoundingBox(), pin_st::Thickness, AttributeType::value, VALUE_NAME, pin_st::X, X, pin_st::Y, and Y.
Referenced by AddElementToBuffer(), CopyElement(), and pinout_set_data().
Copies a line.
Definition at line 208 of file copy.c.
References AddObjectToCreateUndoList(), CreateDrawnLineOnLayer(), DeltaX, DeltaY, DrawLine(), line, MaskFlags(), and LineType::Number.
Referenced by CopyPastebufferToLayout().
Copies the object identified by its data pointers and the type the new objects is moved by DX,DY.
Definition at line 418 of file copy.c.
References DeltaX, DeltaY, IncrementUndoSerialNumber(), ObjectOperation(), and ptr.
Referenced by NotifyMode().
Pastes the contents of the buffer to the layout.
Definition at line 322 of file copy.c.
References ARC_LOOP, LayerType::ArcN, CopyArc(), CopyElement(), CopyLine(), CopyPolygon(), CopyText(), CopyVia(), DeltaX, DeltaY, Draw(), ELEMENT_LOOP, PCBType::ElementOn, END_LOOP, FRONT, IncrementUndoSerialNumber(), PCBType::InvisibleObjectsOn, LAYER_PTR, line, LINE_LOOP, LayerType::LineN, max_copper_layer, LayerType::On, PASTEBUFFER, PCB, PCBType::PinOn, POLYGON_LOOP, LayerType::PolygonN, SILK_LAYER, TEXT_LOOP, LayerType::TextN, VIA_LOOP, and PCBType::ViaOn.
Referenced by ActionElementList(), ActionPasteBuffer(), ActionRipUp(), ActionSelect(), and NotifyMode().
static void * CopyPolygon | ( | LayerType * | Layer, |
PolygonType * | Polygon | ||
) | [static] |
Copies a polygon.
Definition at line 267 of file copy.c.
References AddObjectToCreateUndoList(), CopyPolygonLowLevel(), CreateNewPolygon(), PCBType::Data, DeltaX, DeltaY, DrawPolygon(), InitClip(), MovePolygonLowLevel(), NoFlags, PCB, LayerType::polygon_tree, r_create_tree(), and r_insert_entry().
Referenced by CopyPastebufferToLayout().
PolygonType* CopyPolygonLowLevel | ( | PolygonType * | Dest, |
PolygonType * | Src | ||
) |
Copies data from one polygon to another.
'Dest' has to exist.
Definition at line 97 of file copy.c.
References CLEAR_FLAG, CreateNewHoleInPolygon(), CreateNewPointInPolygon(), polygon_st::HoleIndex, n, polygon_st::PointN, polygon_st::Points, SetPolygonBoundingBox(), PointType::X, and PointType::Y.
Referenced by AddPolygonToBuffer(), and CopyPolygon().
Copies a text.
Definition at line 250 of file copy.c.
References AddObjectToCreateUndoList(), CreateNewText(), DeltaX, DeltaY, TextType::Direction, DrawText(), PCBType::Font, MaskFlags(), PCB, TextType::Scale, TextType::TextString, TextType::X, and TextType::Y.
Referenced by CopyPastebufferToLayout().
static void * CopyVia | ( | PinType * | Via | ) | [static] |
Copies a via.
Definition at line 189 of file copy.c.
References AddObjectToCreateUndoList(), pin_st::BuriedFrom, pin_st::BuriedTo, pin_st::Clearance, CreateNewViaEx(), PCBType::Data, DeltaX, DeltaY, DrawVia(), pin_st::DrillingHole, pin_st::Mask, MaskFlags(), pin_st::Name, PCB, pin_st::Thickness, pin_st::X, and pin_st::Y.
Referenced by CopyPastebufferToLayout().
ObjectFunctionType CopyFunctions [static] |
{ CopyLine, CopyText, CopyPolygon, CopyVia, CopyElement, NULL, NULL, NULL, NULL, NULL, CopyArc, NULL }
Definition at line 75 of file copy.c.
Referenced by CopyArc(), CopyElement(), CopyLine(), CopyObject(), CopyPastebufferToLayout(), CopyPolygon(), CopyText(), and CopyVia().
Definition at line 75 of file copy.c.
Referenced by CopyArc(), CopyElement(), CopyLine(), CopyObject(), CopyPastebufferToLayout(), CopyPolygon(), CopyText(), CopyVia(), MoveArc(), MoveElement(), MoveElementName(), MoveLine(), MoveLinePoint(), MoveObject(), MoveObjectAndRubberband(), MovePolygon(), MovePolygonPoint(), MoveText(), and MoveVia().