pcb 4.1.1
An interactive printed circuit board layout editor.
|
Prototypes for drawing routines. More...
#include "global.h"
Go to the source code of this file.
Functions | |
void | Draw (void) |
Initiate the actual redrawing of the updated area. | |
void | Redraw (void) |
Redraws all the data by the event handlers. | |
void | DrawVia (PinType *) |
Draw a via object. | |
void | DrawRat (RatType *) |
Draws a ratline. | |
void | DrawViaName (PinType *) |
Draws the name of a via. | |
void | DrawPin (PinType *) |
Draw a pin object. | |
void | DrawPinName (PinType *) |
Draws the name of a pin. | |
void | DrawPad (PadType *) |
Draw a pad object. | |
void | DrawPadName (PadType *) |
Draws the name of a pad. | |
void | DrawLine (LayerType *, LineType *) |
Draws a line on a layer. | |
void | DrawArc (LayerType *, ArcType *) |
Draws an arc on a layer. | |
void | DrawText (LayerType *, TextType *) |
Draws a text on a layer. | |
void | DrawPolygon (LayerType *, PolygonType *) |
Draws a polygon on a layer. | |
void | DrawElement (ElementType *) |
Draws an element. | |
void | DrawElementName (ElementType *) |
Draws the name of an element. | |
void | DrawElementPackage (ElementType *) |
Draws the package of an element. | |
void | DrawElementPinsAndPads (ElementType *) |
Draw pins of an element. | |
void | DrawObject (int, void *, void *) |
void | DrawLayer (LayerType *, const BoxType *) |
void | EraseVia (PinType *) |
Erase a via. | |
void | EraseRat (RatType *) |
Erase a ratline. | |
void | EraseViaName (PinType *) |
Erase a via name. | |
void | ErasePad (PadType *) |
Erase a pad object. | |
void | ErasePadName (PadType *) |
Erase a pad name. | |
void | ErasePin (PinType *) |
Erase a pin object. | |
void | ErasePinName (PinType *) |
Erase a pin name. | |
void | EraseLine (LineType *) |
Erases a line on a layer. | |
void | EraseArc (ArcType *) |
Erases an arc on a layer. | |
void | EraseText (LayerType *, TextType *) |
Erases a text on a layer. | |
void | ErasePolygon (PolygonType *) |
Erases a polygon on a layer. | |
void | EraseElement (ElementType *) |
Erases an element. | |
void | EraseElementPinsAndPads (ElementType *) |
Erases all pins and pads of an element. | |
void | EraseElementName (ElementType *) |
Erases the name of an element. | |
void | EraseObject (int, void *, void *) |
void | DrawLayerGroup (int side, const BoxType *drawn_area) |
Draws one layer group. | |
void | DrawPaste (int side, const BoxType *drawn_area) |
Draws solder paste layer for a given side of the board. | |
void | DrawSilk (int side, const BoxType *drawn_area) |
Draws silk layer. | |
void | DrawMask (int side, const BoxType *drawn_area) |
Draws solder mask layer - this will cover nearly everything. | |
void | DrawHoles (bool draw_plated, bool draw_unplated, const BoxType *drawn_area, Cardinal g_from, Cardinal g_to) |
void | PrintAssembly (int side, const BoxType *drawn_area) |
Prints assembly drawing. |
Prototypes for drawing routines.
PCB, interactive printed circuit board design
Copyright (C) 1994,1995,1996, 2004 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 draw.h.
void Draw | ( | void | ) |
Initiate the actual redrawing of the updated area.
Definition at line 130 of file draw.c.
References gui, hid_st::invalidate_lr, MAXINT, BoxType::X1, BoxType::X2, BoxType::Y1, and BoxType::Y2.
Referenced by ActionAddRats(), ActionChangeName(), ActionConnection(), ActionDisplay(), ActionFlip(), ActionMorphPolygon(), ActionSelect(), ActionSetThermal(), ActionToggleHideName(), ActionUnselect(), AddAllRats(), ChangeHole(), ChangeObject2ndSize(), ChangeObjectClearSize(), ChangeObjectJoin(), ChangeObjectMaskSize(), ChangeObjectName(), ChangeObjectOctagon(), ChangeObjectSize(), ChangeObjectSquare(), ChangeObjectThermal(), ChangeObjectViaLayers(), ChangePaste(), ChangeSelected2ndSize(), ChangeSelectedClearSize(), ChangeSelectedElementSide(), ChangeSelectedHole(), ChangeSelectedJoin(), ChangeSelectedOctagon(), ChangeSelectedPaste(), ChangeSelectedSize(), ChangeSelectedSquare(), ChangeSelectedThermals(), ChangeSelectedViaLayers(), ClearWarnings(), ClosePolygon(), ClrObjectJoin(), ClrObjectOctagon(), ClrObjectSquare(), ClrSelectedJoin(), ClrSelectedOctagon(), ClrSelectedSquare(), CopyPastebufferToLayout(), DeleteRats(), DoIt(), DRCAll(), escape(), InsertPointIntoLine(), InsertPointIntoPolygon(), InsertPointIntoRat(), LookupConnection(), LookupElementConnections(), LookupUnusedPins(), MoveArc(), MoveArcToLayer(), MoveElement(), MoveElementName(), MoveLine(), MoveLinePoint(), MoveLineToLayer(), MovePolygon(), MovePolygonPoint(), MovePolygonToLayer(), MoveRatToLayer(), MoveText(), MoveTextToLayer(), MoveVia(), nbcb_select_common(), netlist_select_cb(), NotifyMode(), QueryInputAndChangeObjectName(), Redo(), RemoveArc(), RemoveElement(), RemoveLine(), RemovePolygon(), RemovePolygonContour(), RemovePolygonPoint(), RemoveRat(), RemoveSelected(), RemoveText(), RemoveVia(), RotateArc(), RotateElement(), RotateElementName(), RotateLinePoint(), RotateObject(), RotateText(), RouteAll(), SelectBlock(), selection_changed_cb(), SelectObject(), SetMode(), SetObjectJoin(), SetObjectOctagon(), SetObjectSquare(), SetSelectedJoin(), SetSelectedOctagon(), SetSelectedSquare(), TracePath(), and Undo().
Draws an arc on a layer.
Definition at line 1314 of file draw.c.
References AddPart().
Referenced by ChangeArcClearSize(), ChangeArcJoin(), ChangeArcSize(), ClearFlagOnLinesAndPolygons(), CopyArc(), DrawElementPackage(), DrawNewConnections(), DrawObject(), DRCAll(), MoveArc(), MoveArcToLayer(), NotifyMode(), RotateArc(), SelectBlock(), SelectByFlag(), and SelectObject().
void DrawElement | ( | ElementType * | ) |
Draws an element.
Definition at line 1342 of file draw.c.
References DrawElementName(), DrawElementPackage(), and DrawElementPinsAndPads().
Referenced by ChangeElementSide(), ChangeElementSize(), DrawObject(), DRCAll(), NotifyMode(), RotateElement(), SelectBlock(), and UndoMirror().
void DrawElementName | ( | ElementType * | ) |
Draws the name of an element.
Definition at line 1353 of file draw.c.
References DrawText(), ELEMENT_TEXT, PCB, and TEST_FLAG.
Referenced by ActionDisplay(), ActionToggleHideName(), ChangeElementNameSize(), ChangeElementText(), CopyElement(), DrawElement(), DrawObject(), MoveElement(), MoveElementName(), NotifyMode(), RotateElementName(), SelectBlock(), and SelectObject().
void DrawElementPackage | ( | ElementType * | ) |
Draws the package of an element.
Definition at line 1364 of file draw.c.
References ARC_LOOP, DrawArc(), DrawLine(), ELEMENTLINE_LOOP, END_LOOP, and line.
Referenced by CopyElement(), DrawElement(), MoveElement(), and SelectObject().
void DrawElementPinsAndPads | ( | ElementType * | ) |
Draw pins of an element.
Definition at line 1382 of file draw.c.
References doing_assy, doing_pinout, DrawPad(), DrawPin(), END_LOOP, FRONT, PCBType::InvisibleObjectsOn, PAD_LOOP, PCB, pin, and PIN_LOOP.
Referenced by CopyElement(), DrawElement(), MoveElement(), and SelectObject().
void DrawHoles | ( | bool | draw_plated, |
bool | draw_unplated, | ||
const BoxType * | drawn_area, | ||
Cardinal | g_from, | ||
Cardinal | g_to | ||
) |
Definition at line 498 of file draw.c.
References current_layergroup, PCBType::Data, hole_callback(), PCB, DataType::pin_tree, hole_info::plated, r_search(), and DataType::via_tree.
Referenced by DrawEverything().
Definition at line 1087 of file draw.c.
References arc_callback(), LayerType::arc_tree, LayerType::Color, hid_draw_st::draw_rect, OutputType::fgGC, hid_st::graphics, gui, IsLayerEmpty(), line_callback(), LayerType::line_tree, PCBType::MaxHeight, PCBType::MaxWidth, PCBType::minWid, LayerType::Name, Output, PCB, poly_callback(), LayerType::polygon_tree, r_search(), screen, hid_draw_st::set_color, hid_draw_st::set_line_width, TEST_FLAG, text_callback(), and LayerType::text_tree.
Referenced by DrawEverything(), DrawLayerGroup(), DrawSilk(), gerber_set_layer(), and ps_set_layer().
void DrawLayerGroup | ( | int | group, |
const BoxType * | drawn_area | ||
) |
Draws one layer group.
If the exporter is not a GUI, also draws the pins / pads / vias in this layer group.
Definition at line 1128 of file draw.c.
References PCBType::Data, DrawLayer(), DrawPPV(), LayerGroupType::Entries, hid_st::gui, gui, DataType::Layer, Layer, PCBType::LayerGroups, layers, LayerType::Name, LayerGroupType::Number, and PCB.
Referenced by DrawEverything(), and PrintAssembly().
Draws a line on a layer.
Definition at line 1280 of file draw.c.
References AddPart().
Referenced by ActionUndo(), ChangeLineClearSize(), ChangeLineJoin(), ChangeLineSize(), ClearFlagOnLinesAndPolygons(), CopyLine(), DrawElementPackage(), DrawNewConnections(), DrawObject(), DrawRat(), DRCAll(), escape(), InsertPointIntoLine(), InsertPointIntoRat(), MoveLine(), MoveLinePoint(), MoveLineToLayer(), MoveRatToLayer(), NotifyMode(), RD_DrawLine(), RotateLinePoint(), RotateObject(), SelectBlock(), SelectByFlag(), and SelectObject().
void DrawMask | ( | int | side, |
const BoxType * | drawn_area | ||
) |
Draws solder mask layer - this will cover nearly everything.
Definition at line 986 of file draw.c.
References clearPad_callback(), clearPin_callback(), PCBType::Data, DrawMaskBoardArea(), hid_st::graphics, gui, HID_MASK_AFTER, HID_MASK_BEFORE, HID_MASK_CLEAR, HID_MASK_OFF, PCBType::MaskColor, Output, DataType::pad_tree, PCB, DataType::pin_tree, OutputType::pmGC, r_search(), hid_draw_st::set_color, TEST_FLAG, hid_draw_st::use_mask, and DataType::via_tree.
Referenced by DrawEverything().
void DrawObject | ( | int | , |
void * | , | ||
void * | |||
) |
Definition at line 1609 of file draw.c.
References DrawArc(), DrawElement(), DrawElementName(), DrawLine(), DrawPad(), DrawPin(), DrawPolygon(), DrawRat(), DrawText(), DrawVia(), PCBType::ElementOn, FRONT, PCBType::InvisibleObjectsOn, PCB, PCBType::PinOn, PCBType::RatOn, and PCBType::ViaOn.
Referenced by DrawRecoveredObject(), drc_callback(), NotifyMode(), selection_changed_cb(), toggle_pin_selected(), UndoChange2ndSize(), UndoChangeAngles(), UndoChangeClearSize(), UndoChangeMaskSize(), UndoChangeSize(), UndoFlag(), and UndoSetViaLayers().
void DrawPad | ( | PadType * | ) |
Draw a pad object.
Definition at line 1260 of file draw.c.
References AddPart(), doing_pinout, DrawPadName(), and TEST_FLAG.
Referenced by ChangePadClearSize(), ChangePadMaskSize(), ChangePadSize(), ChangePadSquare(), ChangePaste(), ClearFlagOnPinsViasAndPads(), ClearWarnings(), DrawElementPinsAndPads(), DrawNewConnections(), DrawObject(), DRCAll(), PrintAndSelectUnusedPinsAndPadsOfElement(), SelectBlock(), SelectByFlag(), and SelectObject().
void DrawPadName | ( | PadType * | ) |
Draws the name of a pad.
Definition at line 1271 of file draw.c.
References GatherPadName().
Referenced by ActionDisplay(), ChangePadName(), and DrawPad().
void DrawPaste | ( | int | side, |
const BoxType * | drawn_area | ||
) |
Draws solder paste layer for a given side of the board.
Definition at line 1015 of file draw.c.
References _draw_pad(), ALLPAD_LOOP, COORD_TO_MM, PCBType::Data, PCBType::ElementColor, ENDALL_LOOP, OutputType::fgGC, hid_st::graphics, gui, ON_SIDE, Output, SettingType::PasteAdjust, PCB, hid_draw_st::set_color, Settings, and TEST_FLAG.
Referenced by DrawEverything().
void DrawPin | ( | PinType * | ) |
Draw a pin object.
Definition at line 1239 of file draw.c.
References AddPart(), doing_pinout, DrawPinName(), and TEST_FLAG.
Referenced by ChangeElement2ndSize(), ChangePin2ndSize(), ChangePinClearSize(), ChangePinMaskSize(), ChangePinOctagon(), ChangePinSize(), ChangePinSquare(), ChangePinThermal(), ClearFlagOnPinsViasAndPads(), ClearWarnings(), DrawElementPinsAndPads(), DrawNewConnections(), DrawObject(), DRCAll(), PrintAndSelectUnusedPinsAndPadsOfElement(), SelectBlock(), SelectByFlag(), and SelectObject().
void DrawPinName | ( | PinType * | ) |
Draws the name of a pin.
Definition at line 1251 of file draw.c.
References GatherPVName().
Referenced by ActionDisplay(), ChangePinName(), ChangeViaName(), and DrawPin().
void DrawPolygon | ( | LayerType * | , |
PolygonType * | |||
) |
Draws a polygon on a layer.
Definition at line 1333 of file draw.c.
References AddPart().
Referenced by ChangePolyClear(), ClearFlagOnLinesAndPolygons(), CopyAttachedPolygonToLayer(), CopyPolygon(), DrawNewConnections(), DrawObject(), drc_callback(), InsertPointIntoPolygon(), MorphPolygon(), MovePolygon(), MovePolygonPoint(), MovePolygonToLayer(), NotifyMode(), PolyToPolygonsOnLayer(), RemovePolygonContour(), RemovePolygonPoint(), SelectBlock(), SelectByFlag(), SelectObject(), UndoInsertPoint(), and UndoRemovePoint().
void DrawRat | ( | RatType * | ) |
Draws a ratline.
Definition at line 1289 of file draw.c.
References AddPart(), DrawLine(), pixel_slop, SettingType::RatThickness, Settings, TEST_FLAG, BoxType::X1, BoxType::X2, BoxType::Y1, and BoxType::Y2.
Referenced by ActionAddRats(), AutoRoute(), ClearFlagOnLinesAndPolygons(), DrawNewConnections(), DrawObject(), DrawShortestRats(), MoveLinePoint(), NotifyMode(), RotateLinePoint(), RotateObject(), SelectBlock(), SelectByFlag(), and SelectObject().
void DrawSilk | ( | int | side, |
const BoxType * | drawn_area | ||
) |
Draws silk layer.
Definition at line 927 of file draw.c.
References clearPad_callback(), clearPin_callback(), PCBType::Data, DrawLayer(), element_callback(), DataType::element_tree, hid_st::graphics, gui, HID_MASK_AFTER, HID_MASK_BEFORE, HID_MASK_CLEAR, HID_MASK_OFF, layer, LAYER_PTR, max_copper_layer, name_callback(), NAME_INDEX, DataType::name_tree, DataType::pad_tree, PCB, DataType::pin_tree, hid_st::poly_after, hid_st::poly_before, r_search(), hid_draw_st::use_mask, and DataType::via_tree.
Referenced by DrawEverything(), and PrintAssembly().
Draws a text on a layer.
Definition at line 1323 of file draw.c.
References AddPart().
Referenced by ChangeTextJoin(), ChangeTextName(), ChangeTextSize(), CopyText(), DrawElementName(), DrawObject(), MoveText(), MoveTextToLayer(), NotifyMode(), RotateText(), SelectBlock(), and SelectObject().
void DrawVia | ( | PinType * | ) |
Draw a via object.
Definition at line 1219 of file draw.c.
References AddPart(), DrawViaName(), and TEST_FLAG.
Referenced by ChangeHole(), ChangeObjectViaLayers(), ChangeSelectedViaLayers(), ChangeVia2ndSize(), ChangeViaClearSize(), ChangeViaMaskSize(), ChangeViaOctagon(), ChangeViaSize(), ChangeViaThermal(), ClearFlagOnPinsViasAndPads(), CopyVia(), DrawNewConnections(), DrawObject(), DRCAll(), escape(), moveline_callback(), MoveVia(), NotifyMode(), RD_DrawVia(), SelectBlock(), SelectByFlag(), and SelectObject().
void DrawViaName | ( | PinType * | ) |
Draws the name of a via.
Definition at line 1230 of file draw.c.
References GatherPVName().
Referenced by ActionDisplay(), and DrawVia().
void EraseArc | ( | ArcType * | ) |
Erases an arc on a layer.
Definition at line 1493 of file draw.c.
References AddPart(), and ArcType::Thickness.
Referenced by ChangeArcClearSize(), ChangeArcJoin(), ChangeArcSize(), EraseElement(), EraseObject(), MoveArc(), MoveArcToLayer(), RemoveArc(), and RotateArc().
void EraseElement | ( | ElementType * | ) |
Erases an element.
Definition at line 1523 of file draw.c.
References ARC_LOOP, ELEMENTLINE_LOOP, END_LOOP, EraseArc(), EraseElementName(), EraseElementPinsAndPads(), EraseLine(), and line.
Referenced by ChangeElementSide(), ChangeElementSize(), EraseObject(), MoveElement(), RemoveElement(), RotateElement(), and UndoMirror().
void EraseElementName | ( | ElementType * | ) |
Erases the name of an element.
Definition at line 1561 of file draw.c.
References ELEMENT_TEXT, EraseText(), PCB, and TEST_FLAG.
Referenced by ActionDisplay(), ActionToggleHideName(), ChangeElementNameSize(), ChangeElementText(), EraseElement(), EraseObject(), MoveElementName(), NotifyMode(), and RotateElementName().
void EraseElementPinsAndPads | ( | ElementType * | ) |
Erases all pins and pads of an element.
Definition at line 1543 of file draw.c.
References END_LOOP, ErasePad(), ErasePin(), PAD_LOOP, pin, and PIN_LOOP.
Referenced by EraseElement(), and MoveElement().
void EraseLine | ( | LineType * | ) |
Erases a line on a layer.
Definition at line 1484 of file draw.c.
References AddPart().
Referenced by ChangeLineClearSize(), ChangeLineJoin(), ChangeLineSize(), EraseElement(), EraseObject(), EraseRat(), InsertPointIntoLine(), MoveLine(), MoveLinePoint(), MoveLineToLayer(), RemoveLine(), ripout_livedraw_obj(), RotateLinePoint(), and RotateObject().
void EraseObject | ( | int | , |
void * | , | ||
void * | |||
) |
Definition at line 1569 of file draw.c.
References EraseArc(), EraseElement(), EraseElementName(), EraseLine(), ErasePad(), ErasePin(), ErasePolygon(), EraseText(), and Message().
Referenced by ActionRipUp(), UndoChange2ndSize(), UndoChangeAngles(), UndoChangeClearSize(), UndoChangeMaskSize(), UndoChangeSize(), UndoCopyOrCreate(), UndoFlag(), and UndoSetViaLayers().
void ErasePad | ( | PadType * | ) |
Erase a pad object.
Definition at line 1444 of file draw.c.
References AddPart(), ErasePadName(), and TEST_FLAG.
Referenced by ChangePadClearSize(), ChangePadMaskSize(), ChangePadSize(), ChangePadSquare(), ChangePaste(), EraseElementPinsAndPads(), and EraseObject().
void ErasePadName | ( | PadType * | ) |
Erase a pad name.
Definition at line 1455 of file draw.c.
References GatherPadName().
Referenced by ActionDisplay(), ChangePadName(), and ErasePad().
void ErasePin | ( | PinType * | ) |
Erase a pin object.
Definition at line 1464 of file draw.c.
References AddPart(), ErasePinName(), and TEST_FLAG.
Referenced by ChangeElement2ndSize(), ChangePin2ndSize(), ChangePinClearSize(), ChangePinMaskSize(), ChangePinOctagon(), ChangePinSize(), ChangePinSquare(), EraseElementPinsAndPads(), and EraseObject().
void ErasePinName | ( | PinType * | ) |
Erase a pin name.
Definition at line 1475 of file draw.c.
References GatherPVName().
Referenced by ActionDisplay(), ChangePinName(), ChangeViaName(), and ErasePin().
void ErasePolygon | ( | PolygonType * | ) |
Erases a polygon on a layer.
Definition at line 1514 of file draw.c.
References AddPart().
Referenced by EraseObject(), InsertPointIntoPolygon(), MorphPolygon(), MovePolygon(), MovePolygonPoint(), MovePolygonToLayer(), RemovePolygon(), RemovePolygonContour(), RemovePolygonPoint(), UndoInsertPoint(), and UndoRemovePoint().
void EraseRat | ( | RatType * | ) |
Erase a ratline.
Definition at line 1412 of file draw.c.
References AddPart(), EraseLine(), TEST_FLAG, BoxType::X1, BoxType::X2, BoxType::Y1, and BoxType::Y2.
Referenced by ActionChangeName(), InsertPointIntoRat(), MoveLinePoint(), MoveRatToLayer(), NotifyMode(), and RemoveRat().
Erases a text on a layer.
Definition at line 1504 of file draw.c.
References AddPart().
Referenced by ChangeTextJoin(), ChangeTextName(), ChangeTextSize(), EraseElementName(), EraseObject(), MoveText(), MoveTextToLayer(), RemoveText(), and RotateText().
void EraseVia | ( | PinType * | ) |
Erase a via.
Definition at line 1401 of file draw.c.
References AddPart(), EraseViaName(), and TEST_FLAG.
Referenced by ChangeHole(), ChangeVia2ndSize(), ChangeViaClearSize(), ChangeViaMaskSize(), ChangeViaOctagon(), ChangeViaSize(), MoveVia(), RemoveVia(), and ripout_livedraw_obj().
void EraseViaName | ( | PinType * | ) |
Erase a via name.
Definition at line 1435 of file draw.c.
References GatherPVName().
Referenced by ActionDisplay(), and EraseVia().
void PrintAssembly | ( | int | side, |
const BoxType * | drawn_area | ||
) |
Prints assembly drawing.
Definition at line 603 of file draw.c.
References doing_assy, DrawLayerGroup(), DrawSilk(), OutputType::fgGC, GetLayerGroupNumberBySide(), hid_st::graphics, gui, Output, and hid_draw_st::set_draw_faded.
Referenced by DrawEverything().
void Redraw | ( | void | ) |
Redraws all the data by the event handlers.
Definition at line 144 of file draw.c.
References gui, and hid_st::invalidate_all.
Referenced by ActionDisperseElements(), ActionDisplay(), ActionNew(), ActionSetSame(), apply_vendor_map(), AutoPlaceSelected(), AutoRoute(), LookupConnectionsToAllElements(), relocate(), SetGrid(), smartdisperse(), and toporouter().