1
0
mirror of git://projects.qi-hardware.com/fped.git synced 2024-10-02 16:30:43 +03:00
fped/layer.c
werner 8df866ab2f - the set of layers of a pad is now maintained in the instance, so that we can
make adjustments when removing layers provided by specialized pads
- gui_inst.c: moved gc construction from gui_draw_pad and gui_draw_rpad to
  shared pad_gc
- layer.h: new home of all definitions related to pads and layers
- layer.c: 
- overlap.c: functions to test for overlaps of pad shapes (in progress)



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5634 99fdad57-331a-0410-800a-d7fa5415bdb3
2009-09-13 09:58:30 +00:00

57 lines
1.0 KiB
C

/*
* layer.c - PCB layers on a pad
*
* Written 2009 by Werner Almesberger
* Copyright 2009 by Werner Almesberger
*
* 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.
*/
#include <stdlib.h>
#include "layer.h"
layer_type pad_type_to_layers(enum pad_type type)
{
layer_type layers = 0;
switch (type) {
case pt_normal:
layers = LAYER_PASTE;
/* fall through */
case pt_bare:
layers |= LAYER_COPPER | LAYER_MASK;
break;
case pt_paste:
layers = LAYER_PASTE;
break;
case pt_mask:
layers = LAYER_MASK;
break;
default:
abort();
}
return layers;
}
enum pad_type layers_to_pad_type(layer_type layers)
{
if (layers & LAYER_COPPER) {
if (layers & LAYER_PASTE)
return pt_normal;
return pt_bare;
} else {
if (layers & LAYER_PASTE)
return pt_paste;
if (layers & LAYER_MASK)
return pt_mask;
abort();
}
}