pcb 4.1.1
An interactive printed circuit board layout editor.

remove.c File Reference

Functions used to remove vias, pins ... More...

#include <setjmp.h>
#include <memory.h>
#include "global.h"
#include "data.h"
#include "draw.h"
#include "error.h"
#include "misc.h"
#include "move.h"
#include "mymem.h"
#include "polygon.h"
#include "rats.h"
#include "remove.h"
#include "rtree.h"
#include "search.h"
#include "select.h"
#include "set.h"
#include "undo.h"
Include dependency graph for remove.c:

Go to the source code of this file.

Data Structures

struct  rlp_info

Functions

static void * DestroyVia (PinType *Via)
 Destroys a via.
static void * DestroyRat (RatType *Rat)
 Destroys a rat.
static void * DestroyLine (LayerType *Layer, LineType *Line)
 Destroys a line from a layer.
static void * DestroyArc (LayerType *Layer, ArcType *Arc)
 Destroys an arc from a layer.
static void * DestroyText (LayerType *Layer, TextType *Text)
 Destroys a text from a layer.
static void * DestroyPolygon (LayerType *Layer, PolygonType *Polygon)
 Destroys a polygon from a layer.
static void * DestroyElement (ElementType *)
static void * RemoveVia (PinType *Via)
 Removes a via.
static void * RemoveRat (RatType *Rat)
 Removes a rat.
static void * DestroyPolygonPoint (LayerType *Layer, PolygonType *Polygon, PointType *Point)
 Removes a polygon-point from a polygon and destroys the data.
static void * RemovePolygonContour (LayerType *Layer, PolygonType *Polygon, Cardinal contour)
 Removes a contour from a polygon.
static void * RemovePolygonPoint (LayerType *Layer, PolygonType *Polygon, PointType *Point)
 Removes a polygon-point from a polygon.
static void * RemoveLinePoint (LayerType *Layer, LineType *Line, PointType *Point)
 Removes a line point, or a line if the selected point is the end.
void RemovePCB (PCBType *Ptr)
 Remove PCB.
static int remove_point (const BoxType *b, void *cl)
void * RemoveLine (LayerType *Layer, LineType *Line)
 Removes a line from a layer.
void * RemoveArc (LayerType *Layer, ArcType *Arc)
 Removes an arc from a layer.
void * RemoveText (LayerType *Layer, TextType *Text)
 Removes a text from a layer.
void * RemovePolygon (LayerType *Layer, PolygonType *Polygon)
 Removes a polygon from a layer.
void * RemoveElement (ElementType *Element)
 Removes an element.
bool RemoveSelected (void)
 Removes all selected and visible objects.
void RemoveDegradedVias (void)
void * RemoveObject (int Type, void *Ptr1, void *Ptr2, void *Ptr3)
 Remove object as referred by pointers and type, allocated memory is passed to the 'remove undo' list.
bool DeleteRats (bool selected)
 Deletes rat lines only.
void * DestroyObject (DataType *Target, int Type, void *Ptr1, void *Ptr2, void *Ptr3)
 Remove object as referred by pointers and type.

Variables

static ObjectFunctionType RemoveFunctions
static ObjectFunctionType DestroyFunctions
static DataTypeDestroyTarget
static bool Bulk = false

Detailed Description

Functions used to remove vias, pins ...


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


Function Documentation

bool DeleteRats ( bool  selected)

Deletes rat lines only.

Can delete all rat lines, or only selected one.

Definition at line 643 of file remove.c.

References Bulk, PCBType::Data, Draw(), END_LOOP, IncrementUndoSerialNumber(), line, PCB, RAT_LOOP, RemoveRat(), and TEST_FLAG.

Referenced by ActionDelete(), ActionDeleteRats(), ActionImport(), AutoPlaceSelected(), AutoRoute(), and toporouter().

Here is the call graph for this function:

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

Destroys an arc from a layer.

Definition at line 164 of file remove.c.

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

Here is the call graph for this function:

static void * DestroyElement ( ElementType Element) [static]
static void * DestroyLine ( LayerType Layer,
LineType Line 
) [static]

Destroys a line from a layer.

Definition at line 147 of file remove.c.

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

Here is the call graph for this function:

void* DestroyObject ( DataType Target,
int  Type,
void *  Ptr1,
void *  Ptr2,
void *  Ptr3 
)

Remove object as referred by pointers and type.

Allocated memory is destroyed assumed to already be erased.

Definition at line 671 of file remove.c.

References ObjectOperation().

Referenced by ConvertBufferToElement(), GetUndoSlot(), ripout_livedraw_obj(), and UndoInsertPoint().

Here is the call graph for this function:

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

Destroys a polygon from a layer.

Definition at line 180 of file remove.c.

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

Here is the call graph for this function:

static void * DestroyPolygonPoint ( LayerType Layer,
PolygonType Polygon,
PointType Point 
) [static]

Removes a polygon-point from a polygon and destroys the data.

Definition at line 197 of file remove.c.

References PCBType::Data, polygon_st::HoleIndex, polygon_st::HoleIndexN, InitClip(), PCB, polygon_st::PointN, polygon_point_contour(), polygon_point_idx(), LayerType::polygon_tree, r_delete_entry(), r_insert_entry(), RemovePolygonContour(), and SetPolygonBoundingBox().

Here is the call graph for this function:

static void * DestroyRat ( RatType Rat) [static]

Destroys a rat.

Definition at line 294 of file remove.c.

References r_delete_entry(), DataType::Rat, DataType::rat_tree, and DataType::RatN.

Here is the call graph for this function:

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

Destroys a text from a layer.

Definition at line 237 of file remove.c.

References r_delete_entry(), LayerType::Text, LayerType::text_tree, LayerType::TextN, and TextType::TextString.

Here is the call graph for this function:

static void * DestroyVia ( PinType Via) [static]

Destroys a via.

Definition at line 130 of file remove.c.

References r_delete_entry(), DataType::Via, DataType::via_tree, and DataType::ViaN.

Here is the call graph for this function:

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

Definition at line 349 of file remove.c.

References rlp_info::env, rlp_info::line, line, rlp_info::point, PointType::X, and PointType::Y.

Referenced by RemoveLinePoint().

void* RemoveArc ( LayerType Layer,
ArcType Arc 
)

Removes an arc from a layer.

Definition at line 420 of file remove.c.

References Bulk, Draw(), EraseArc(), MoveObjectToRemoveUndoList(), and LayerType::On.

Referenced by GlobalPuller().

Here is the call graph for this function:

void RemoveDegradedVias ( void  )

Definition at line 613 of file remove.c.

References Bulk, PCBType::Data, END_LOOP, PCB, RemoveVia(), VIA_IS_BURIED, and VIA_LOOP.

Referenced by ChangeBuriedViasAfterLayerDelete(), and ChangeBuriedViasAfterLayerMove().

Here is the call graph for this function:

void* RemoveElement ( ElementType Element)

Removes an element.

Definition at line 578 of file remove.c.

References Bulk, Draw(), PCBType::ElementOn, EraseElement(), FRONT, PCBType::InvisibleObjectsOn, MoveObjectToRemoveUndoList(), PCB, and PCBType::PinOn.

Referenced by ActionElementList(), and NotifyMode().

Here is the call graph for this function:

void* RemoveLine ( LayerType Layer,
LineType Line 
)

Removes a line from a layer.

Definition at line 403 of file remove.c.

References Bulk, Draw(), EraseLine(), MoveObjectToRemoveUndoList(), and LayerType::On.

Referenced by ActionDJopt(), GlobalPuller(), remove_line(), and RemoveLinePoint().

Here is the call graph for this function:

static void * RemoveLinePoint ( LayerType Layer,
LineType Line,
PointType Point 
) [static]

Removes a line point, or a line if the selected point is the end.

Definition at line 378 of file remove.c.

References rlp_info::env, rlp_info::line, LayerType::line_tree, MoveObject(), rlp_info::point, r_search(), remove_point(), RemoveLine(), PointType::X, and PointType::Y.

Here is the call graph for this function:

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

Remove object as referred by pointers and type, allocated memory is passed to the 'remove undo' list.

Definition at line 631 of file remove.c.

References ObjectOperation(), and ptr.

Referenced by ActionRipUp(), nbcb_ripup(), netlist_rip_up_cb(), NotifyMode(), remove_via_at(), and RemoveExcessPolygonPoints().

Here is the call graph for this function:

void RemovePCB ( PCBType Ptr)

Remove PCB.

Definition at line 119 of file remove.c.

References ClearUndoList(), and FreePCBMemory().

Referenced by ActionNew(), LoadLayoutToBuffer(), and real_load_pcb().

Here is the call graph for this function:

void* RemovePolygon ( LayerType Layer,
PolygonType Polygon 
)

Removes a polygon from a layer.

Definition at line 455 of file remove.c.

References Bulk, Draw(), ErasePolygon(), MoveObjectToRemoveUndoList(), and LayerType::On.

Referenced by MorphPolygon(), and RemovePolygonContour().

Here is the call graph for this function:

static void * RemovePolygonContour ( LayerType Layer,
PolygonType Polygon,
Cardinal  contour 
) [static]

Removes a contour from a polygon.

If removing the outer contour, it removes the whole polygon.

Definition at line 474 of file remove.c.

References AddObjectToRemoveContourUndoList(), Bulk, PCBType::Data, Draw(), DrawPolygon(), ErasePolygon(), polygon_st::HoleIndex, polygon_st::HoleIndexN, InitClip(), LayerType::On, PCB, polygon_st::PointN, polygon_st::Points, and RemovePolygon().

Referenced by DestroyPolygonPoint(), and RemovePolygonPoint().

Here is the call graph for this function:

static void * RemovePolygonPoint ( LayerType Layer,
PolygonType Polygon,
PointType Point 
) [static]
static void * RemoveRat ( RatType Rat) [static]

Removes a rat.

Definition at line 329 of file remove.c.

References Bulk, Draw(), EraseRat(), MoveObjectToRemoveUndoList(), PCB, and PCBType::RatOn.

Referenced by DeleteRats().

Here is the call graph for this function:

bool RemoveSelected ( void  )

Removes all selected and visible objects.

Returns:
true if any objects have been removed.

Definition at line 598 of file remove.c.

References Bulk, Draw(), IncrementUndoSerialNumber(), and SelectedOperation().

Referenced by ActionDelete(), ActionRemoveSelected(), ActionSelect(), and click_cb().

Here is the call graph for this function:

void* RemoveText ( LayerType Layer,
TextType Text 
)

Removes a text from a layer.

Definition at line 437 of file remove.c.

References Bulk, Draw(), EraseText(), MoveObjectToRemoveUndoList(), LayerType::On, r_delete_entry(), and LayerType::text_tree.

Here is the call graph for this function:

static void * RemoveVia ( PinType Via) [static]

Removes a via.

Definition at line 312 of file remove.c.

References Bulk, Draw(), EraseVia(), MoveObjectToRemoveUndoList(), PCB, and PCBType::ViaOn.

Referenced by RemoveDegradedVias().

Here is the call graph for this function:


Variable Documentation

Initial value:

Definition at line 98 of file remove.c.

Definition at line 112 of file remove.c.