pcb 4.1.1
An interactive printed circuit board layout editor.

const.h File Reference

Global source constants. More...

#include <limits.h>
#include <math.h>
#include "globalconst.h"
Include dependency graph for const.h:
This graph shows which files directly or indirectly include this file:

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

Detailed Description

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 Documentation

#define BOTTOM_SILK_LAYER   0

Definition at line 88 of file const.h.

Referenced by FontEdit(), and ParseGroupString().

#define COORD_TO_INCH (   n)    (COORD_TO_MIL(n) / 1000.0)
#define COORD_TO_MIL (   n)    ((n) / 25400.0)
#define COORD_TO_MM (   n)    ((n) / 1000000.0)

Definition at line 123 of file const.h.

Referenced by coord_to_unit(), CoordsToString(), DrawPaste(), and gcode_do_export().

#define COPY_MODE   105
#define COS_22_5_DEGREE   0.923879533

cos(22.5)

Definition at line 115 of file const.h.

Referenced by fprintAperture().

#define INCH_TO_COORD (   n)    (MIL_TO_COORD(n) * 1000.0)
#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 LN_2_OVER_2   0.346573590

Definition at line 118 of file const.h.

#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_SQRT1_2   0.707106781

1/sqrt(2)

Definition at line 110 of file const.h.

Referenced by diag_line(), and square_therm().

#define MARK_SIZE   MIL_TO_COORD(50)

relative marker size

Definition at line 99 of file const.h.

Referenced by DrawMark().

#define MM_TO_COORD (   n)    ((n) * 1000000.0)
#define NO_MODE   0
#define PAN_MODE   0

same as no mode

Definition at line 152 of file const.h.

#define POLYGON_MODE   4
#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
#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.

Note:
Position on the layer stack does not decide whether a layer is on the top side, on the bottom side or in between. Each layer is part of a layer group, and this group represents the physical layer, like top, inner or bottom.

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_SILK_LAYER   1

Definition at line 89 of file const.h.

Referenced by FontEdit(), and ParseGroupString().

#define UNDO_WARNING_SIZE   (1024*1024)

warning limit of undo

Definition at line 100 of file const.h.

Referenced by GetUndoSlot().

#define UNSCALE_TEXT (   COORD,
  TEXTSCALE 
)    ((Coord)((COORD) * (100.0 / (double)(TEXTSCALE))))

Definition at line 131 of file const.h.

Referenced by SetTextBoundingBox().

#define USERMEDIANAME   "user defined"

label of default media

Definition at line 101 of file const.h.

#define VIA_MODE   1