pcb 4.1.1
An interactive printed circuit board layout editor.
|
Global source constants. More...
#include <limits.h>
#include <math.h>
#include "globalconst.h"
Go to the source code of this file.
Defines | |
#define | BOTTOM_SIDE 0 |
#define | TOP_SIDE 1 |
#define | SILK_LAYER 2 |
#define | BOTTOM_SILK_LAYER 0 |
#define | TOP_SILK_LAYER 1 |
#define | MAX_ALL_LAYER (MAX_LAYER + SILK_LAYER) |
#define | MARK_SIZE MIL_TO_COORD(50) |
#define | UNDO_WARNING_SIZE (1024*1024) |
#define | USERMEDIANAME "user defined" |
#define | M_PI 3.14159265358979323846 |
#define | M_SQRT1_2 0.707106781 |
#define | M180 (M_PI/180.0) |
#define | RAD_TO_DEG (180.0/M_PI) |
#define | TAN_22_5_DEGREE_2 0.207106781 |
#define | COS_22_5_DEGREE 0.923879533 |
#define | TAN_30_DEGREE 0.577350269 |
#define | TAN_60_DEGREE 1.732050808 |
#define | LN_2_OVER_2 0.346573590 |
#define | COORD_TO_MIL(n) ((n) / 25400.0) |
#define | MIL_TO_COORD(n) ((n) * 25400.0) |
#define | COORD_TO_MM(n) ((n) / 1000000.0) |
#define | MM_TO_COORD(n) ((n) * 1000000.0) |
#define | COORD_TO_INCH(n) (COORD_TO_MIL(n) / 1000.0) |
#define | INCH_TO_COORD(n) (MIL_TO_COORD(n) * 1000.0) |
#define | SCALE_TEXT(COORD, TEXTSCALE) ((Coord)((COORD) * ((double)(TEXTSCALE) / 100.0))) |
#define | UNSCALE_TEXT(COORD, TEXTSCALE) ((Coord)((COORD) * (100.0 / (double)(TEXTSCALE)))) |
#define | NO_MODE 0 |
#define | VIA_MODE 1 |
#define | LINE_MODE 2 |
#define | RECTANGLE_MODE 3 |
#define | POLYGON_MODE 4 |
#define | PASTEBUFFER_MODE 5 |
#define | TEXT_MODE 6 |
#define | ROTATE_MODE 102 |
#define | REMOVE_MODE 103 |
#define | MOVE_MODE 104 |
#define | COPY_MODE 105 |
#define | INSERTPOINT_MODE 106 |
#define | RUBBERBANDMOVE_MODE 107 |
#define | THERMAL_MODE 108 |
#define | ARC_MODE 109 |
#define | ARROW_MODE 110 |
#define | PAN_MODE 0 |
#define | LOCK_MODE 111 |
#define | POLYGONHOLE_MODE 112 |
Global source constants.
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 const.h.
#define ARC_MODE 109 |
draw arcs
Definition at line 150 of file const.h.
Referenced by ActionMode(), ActionSetSame(), ActionUndo(), AdjustAttachedBox(), AdjustAttachedObjects(), DrawAttached(), FitCrosshairIntoGrid(), ghid_mode_cursor(), idle_proc(), lesstif_update_status_line(), NotifyMode(), and SetMode().
#define ARROW_MODE 110 |
selection with arrow mode
Definition at line 151 of file const.h.
Referenced by ActionMode(), AdjustAttachedObjects(), FinishStroke(), FitCrosshairIntoGrid(), ghid_create_pcb_widgets(), ghid_idle_cb(), ghid_mode_cursor(), idle_proc(), lesstif_update_status_line(), main(), NotifyMode(), and ReleaseMode().
#define BOTTOM_SIDE 0 |
Definition at line 42 of file const.h.
Referenced by AddNet(), assign_eagle_file_suffix(), assign_hackvana_file_suffix(), assign_oshpark_file_suffix(), CheckPadForRat(), CheckPadForRubberbandConnection(), ConvertBufferToElement(), CreateRouteData(), DrawEverything(), DrawPPV(), drc_lines(), eps_hid_export_to_file(), FitCrosshairIntoGrid(), gcode_do_export(), gerber_do_export(), GetMaxBottomLayer(), GlobalPuller(), gsvit_do_export(), info(), InitComponentLookup(), layer_type_to_file_name(), ListStart(), LOCtoArcPad_callback(), LOCtoLinePad_callback(), LOCtoPad_callback(), LOCtoPadPad_callback(), LOCtoPolyPad_callback(), LOCtoPVpad_callback(), MoveLayer(), MoveTextToLayerLowLevel(), NotifyMode(), png_hid_export_to_file(), PrintAndSelectUnusedPinsAndPadsOfElement(), PrintElementConnections(), ProcNetlist(), ps_hid_export_to_file(), ps_set_layer(), read_pads(), SmashBufferElement(), SwapBuffer(), SwapSides(), and UpdateXY().
#define BOTTOM_SILK_LAYER 0 |
Definition at line 88 of file const.h.
Referenced by FontEdit(), and ParseGroupString().
Definition at line 125 of file const.h.
Referenced by gcode_do_export(), gcode_fill_circle(), gsvit_fill_circle(), pcb_to_gsvit(), PrintFab(), REGISTER_ATTRIBUTES(), and toporouter_export().
Definition at line 121 of file const.h.
Referenced by ComputeCost(), coord_to_unit(), CoordsToString(), PrintFab(), text_at(), and WritePCBDataHeader().
Definition at line 123 of file const.h.
Referenced by coord_to_unit(), CoordsToString(), DrawPaste(), and gcode_do_export().
#define COPY_MODE 105 |
copy objects
Definition at line 146 of file const.h.
Referenced by ActionMode(), AttachForCopy(), click_cb(), DrawAttached(), ghid_mode_cursor(), idle_proc(), lesstif_update_status_line(), and NotifyMode().
#define COS_22_5_DEGREE 0.923879533 |
Definition at line 126 of file const.h.
Referenced by ActionLoadVendorFrom(), AutoPlaceSelected(), gcode_do_export(), InitAutoRouteParameters(), and png_do_export().
#define INSERTPOINT_MODE 106 |
insert point into line/polygon
Definition at line 147 of file const.h.
Referenced by ActionMode(), AdjustAttachedObjects(), DrawAttached(), ghid_mode_cursor(), idle_proc(), lesstif_update_status_line(), NotifyMode(), and SetMode().
#define LINE_MODE 2 |
draw lines
Definition at line 138 of file const.h.
Referenced by ActionDisplay(), ActionMode(), ActionRedo(), ActionSetSame(), ActionUndo(), AdjustAttachedLine(), AdjustAttachedObjects(), check_snap_offgrid_line(), DrawAttached(), FinishStroke(), FitCrosshairIntoGrid(), ghid_mode_cursor(), idle_proc(), lesstif_update_status_line(), NotifyLine(), NotifyMode(), and SetMode().
#define LOCK_MODE 111 |
lock/unlock objects
Definition at line 153 of file const.h.
Referenced by ActionMode(), ghid_mode_cursor(), idle_proc(), lesstif_update_status_line(), and NotifyMode().
#define M180 (M_PI/180.0) |
Definition at line 112 of file const.h.
Referenced by ArcPolyNoIntersect(), get_arc_ends(), GetArcEnds(), and SetArcBoundingBox().
#define M_PI 3.14159265358979323846 |
Definition at line 107 of file const.h.
Referenced by angle_span(), arc_endpoint_is(), ArcPoly(), ArcPolyNoIntersect(), calculate_serpintine(), check_line_callback(), common_thindraw_pcb_pad(), d2r(), draw_cap(), eps_draw_line(), export_pcb_drawarc(), FreeRotateBuffer(), gcode_do_export(), gerber_draw_arc(), gerber_draw_line(), ghid_trackball_expose(), gp_point_force(), gsvit_write_xcentroids(), gts_triangles_angle(), gts_vertex_gaussian_curvature(), hidgl_draw_arc(), hidgl_draw_line(), hidgl_fill_circle(), lesstif_draw_arc(), mark_delta_to_widget(), maybe_pull_1(), png_draw_arc(), polygon_init(), PrintBOM(), r2d(), SetPadBoundingBox(), tesselate_contour(), ThermPoly(), toporouter_draw_surface(), toporouter_draw_vertex(), xyToAngle(), and XYtoNetLength().
#define M_SQRT1_2 0.707106781 |
#define MARK_SIZE MIL_TO_COORD(50) |
#define MAX_ALL_LAYER (MAX_LAYER + SILK_LAYER) |
Definition at line 94 of file const.h.
Referenced by EditLayerGroups(), eps_do_export(), FreeDataMemory(), gcode_do_export(), gerber_do_export(), GetLayerNumber(), gsvit_do_export(), LayerGroupsToString(), lesstif_update_layer_groups(), MoveLayer(), nelma_do_export(), ParseGroupString(), png_do_export(), ps_do_export(), and REGISTER_ATTRIBUTES().
Definition at line 122 of file const.h.
Referenced by ActionLoadVendorFrom(), AutoPlaceSelected(), ChangeArcClearSize(), ChangeLineClearSize(), check_non_intersect_vertex(), corner(), createPerturbation(), FitCrosshairIntoGrid(), FontEdit(), new_units(), old_units(), oproute_rubberband(), ParseRouteString(), PrintFab(), ps_set_layer(), REGISTER_ATTRIBUTES(), text_at(), toporouter_draw_surface(), toporouter_draw_vertex(), and unit_to_coord().
Definition at line 124 of file const.h.
Referenced by ActionLoadVendorFrom(), draw_lead_user(), gcode_do_export(), ghid_lead_user_to_location(), lead_user_cb(), and unit_to_coord().
#define MOVE_MODE 104 |
move objects
Definition at line 145 of file const.h.
Referenced by ActionMode(), check_snap_offgrid_line(), click_cb(), DrawAttached(), FitCrosshairIntoGrid(), ghid_mode_cursor(), idle_proc(), lesstif_update_status_line(), NotifyMode(), and SetMode().
#define NO_MODE 0 |
no mode selected
Definition at line 136 of file const.h.
Referenced by ActionMode(), AdjustAttachedObjects(), ghid_idle_cb(), ghid_mode_cursor(), idle_proc(), lesstif_update_status_line(), and SetMode().
#define PASTEBUFFER_MODE 5 |
paste objects from buffer
Definition at line 141 of file const.h.
Referenced by ActionLoadFrom(), ActionMode(), click_cb(), crosshair_update_range(), DrawAttached(), ghid_mode_cursor(), idle_proc(), lesstif_update_status_line(), libnode_select(), library_window_callback_tree_selection_changed(), and NotifyMode().
#define POLYGON_MODE 4 |
draw filled polygons
Definition at line 140 of file const.h.
Referenced by ActionMode(), ActionPolygon(), ActionRedo(), ActionUndo(), AdjustAttachedObjects(), DrawAttached(), ghid_mode_cursor(), idle_proc(), lesstif_update_status_line(), NotifyMode(), and SetMode().
#define POLYGONHOLE_MODE 112 |
cut holes in filled polygons
Definition at line 154 of file const.h.
Referenced by ActionMode(), ActionRedo(), ActionUndo(), AdjustAttachedObjects(), DrawAttached(), ghid_mode_cursor(), idle_proc(), NotifyMode(), and SetMode().
#define RAD_TO_DEG (180.0/M_PI) |
Definition at line 113 of file const.h.
Referenced by ghid_set_cursor_position_labels(), IsPointOnArc(), and radius_crosses_arc().
#define RECTANGLE_MODE 3 |
create rectangles
Definition at line 139 of file const.h.
Referenced by ActionMode(), AdjustAttachedObjects(), ghid_mode_cursor(), idle_proc(), lesstif_update_status_line(), NotifyMode(), and SetMode().
#define REMOVE_MODE 103 |
remove objects
Definition at line 144 of file const.h.
Referenced by ActionDelete(), ActionMode(), ghid_mode_cursor(), idle_proc(), lesstif_update_status_line(), and NotifyMode().
#define ROTATE_MODE 102 |
rotate objects
Definition at line 143 of file const.h.
Referenced by ActionMode(), AdjustAttachedObjects(), ghid_mode_cursor(), idle_proc(), lesstif_update_status_line(), and NotifyMode().
#define RUBBERBANDMOVE_MODE 107 |
move objects and attached lines
Definition at line 148 of file const.h.
Referenced by ActionMode(), idle_proc(), and lesstif_update_status_line().
#define SCALE_TEXT | ( | COORD, | |
TEXTSCALE | |||
) | ((Coord)((COORD) * ((double)(TEXTSCALE) / 100.0))) |
Definition at line 130 of file const.h.
Referenced by common_draw_pcb_text(), ReportDialog(), SetTextBoundingBox(), and text_at().
#define SILK_LAYER 2 |
Layer Stack.
The situation is not ideal, because on top of the ordinary layer stack there are two (both) silk layers. It was a hack to separate these and probably done to easier iterate through non-silk layers, only. As we have layer types now, iterating through any kind of distinct layer type has become simple, see LAYER_TYPE_LOOP() in macro.h.
Accordingly, the separation of these two silk layers should go away, they should return to be "normal" layers. One might want to have more than two silk layers, after all.
Anyways, here's the current setup:
Copper layer 0 \ Copper layer 1 | Outline layer >- in unspecified order Routing layer | (...additional layers...) / <== max_copper_layer Bottom silk layer Top silk layer <== max_copper_layer + SILK_LAYER (...unused layers...) (last layer - 2) <== MAX_LAYER (last layer - 1) (last layer) <== MAX_ALL_LAYER ( == MAX_LAYER + SILK_LAYER)
With all layers in use (rarely the case), max_copper_layer == MAX_LAYER.
Definition at line 87 of file const.h.
Referenced by ActionSetLayertype(), config_layers_apply(), CopyPastebufferToLayout(), Debug(), EditLayerGroups(), extents_set_layer(), ghid_config_groups_changed(), ghid_set_layer(), hid_restore_layer_ons(), hid_save_and_show_layer_ons(), IsDataEmpty(), LayerStringToLayerStack(), lesstif_set_layer(), lesstif_update_layer_groups(), lgbutton_expose(), lgbutton_input(), lgbutton_resize(), MirrorBuffer(), MoveLayer(), ResetStackAndVisibility(), RestoreStackAndVisibility(), SaveStackAndVisibility(), SelectBlock(), ToggleView(), WriteBuffer(), WritePCB(), and XORDrawBuffer().
#define TAN_22_5_DEGREE_2 0.207106781 |
0.5*tan(22.5)
Definition at line 114 of file const.h.
Referenced by draw_octagon_poly(), and OctagonPoly().
#define TAN_30_DEGREE 0.577350269 |
tan(30)
Definition at line 116 of file const.h.
Referenced by AdjustInsertPoint(), and FortyFiveLine().
#define TAN_60_DEGREE 1.732050808 |
tan(60)
Definition at line 117 of file const.h.
Referenced by AdjustInsertPoint(), and FortyFiveLine().
#define TEXT_MODE 6 |
create text objects
Definition at line 142 of file const.h.
Referenced by ActionMode(), ghid_mode_cursor(), idle_proc(), lesstif_update_status_line(), NotifyMode(), and SetMode().
#define THERMAL_MODE 108 |
toggle thermal layer flag
Definition at line 149 of file const.h.
Referenced by ActionMode(), ghid_mode_cursor(), idle_proc(), lesstif_update_status_line(), NotifyMode(), and SetMode().
#define TOP_SIDE 1 |
Definition at line 43 of file const.h.
Referenced by AddNet(), assign_eagle_file_suffix(), assign_hackvana_file_suffix(), assign_oshpark_file_suffix(), CheckPadForRat(), CheckPadForRubberbandConnection(), ConvertBufferToElement(), CreateRouteData(), DrawEverything(), DrawPPV(), drc_lines(), eps_hid_export_to_file(), FitCrosshairIntoGrid(), gerber_do_export(), GetLayerGroupNumberBySide(), GlobalPuller(), info(), InitComponentLookup(), layer_type_to_file_name(), ListStart(), LOCtoArcPad_callback(), LOCtoLinePad_callback(), LOCtoPad_callback(), LOCtoPadPad_callback(), LOCtoPolyPad_callback(), LOCtoPVpad_callback(), MoveLayer(), png_hid_export_to_file(), PrintAndSelectUnusedPinsAndPadsOfElement(), PrintElementConnections(), ProcNetlist(), ps_hid_export_to_file(), read_pads(), ResetStackAndVisibility(), SmashBufferElement(), SwapBuffer(), SwapSides(), and UpdateXY().
#define TOP_SILK_LAYER 1 |
Definition at line 89 of file const.h.
Referenced by FontEdit(), and ParseGroupString().
#define UNDO_WARNING_SIZE (1024*1024) |
#define UNSCALE_TEXT | ( | COORD, | |
TEXTSCALE | |||
) | ((Coord)((COORD) * (100.0 / (double)(TEXTSCALE)))) |
Definition at line 131 of file const.h.
Referenced by SetTextBoundingBox().
#define VIA_MODE 1 |
draw vias
Definition at line 137 of file const.h.
Referenced by ActionMode(), ActionSetSame(), DrawAttached(), FinishStroke(), ghid_mode_cursor(), idle_proc(), lesstif_update_status_line(), NotifyMode(), and SetMode().