From 018b0800011a3832898573325e1112d889cad985 Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Fri, 13 Jul 2012 20:55:29 +0200 Subject: [PATCH] Pcbnew: Add keepout areas (Copper zones without tracks or/and vias). This is *a work in progress*, so some features are missing, and/or could be modified. Mainly keepout zones are not yet exported to autorouters, and pads are not taken in account. Some code cleanup in polygon.* --- bitmaps_png/CMakeLists.txt | 1 + bitmaps_png/cpp_26/add_keepout_area.cpp | 82 + bitmaps_png/sources/add_keepout_area.svg | 178 + common/pcb.keywords | 6 + include/bitmaps.h | 1 + pcbnew/CMakeLists.txt | 2 + pcbnew/class_drc_item.cpp | 15 +- pcbnew/class_zone.cpp | 27 +- pcbnew/class_zone.h | 59 +- pcbnew/class_zone_settings.cpp | 25 +- pcbnew/class_zone_settings.h | 43 +- pcbnew/controle.cpp | 1 + pcbnew/dialogs/dialog_copper_zones.cpp | 18 +- pcbnew/dialogs/dialog_copper_zones_base.cpp | 14 +- pcbnew/dialogs/dialog_copper_zones_base.fbp | 7047 +++++++++-------- pcbnew/dialogs/dialog_copper_zones_base.h | 7 +- pcbnew/dialogs/dialog_drc.cpp | 14 +- .../dialog_keepout_area_properties.cpp | 277 + .../dialog_keepout_area_properties_base.cpp | 103 + .../dialog_keepout_area_properties_base.fbp | 897 +++ .../dialog_keepout_area_properties_base.h | 70 + ...ialog_non_copper_zones_properties_base.cpp | 191 +- ...ialog_non_copper_zones_properties_base.fbp | 1714 ++-- .../dialog_non_copper_zones_properties_base.h | 136 +- pcbnew/drc.cpp | 121 + pcbnew/drc_stuff.h | 30 +- pcbnew/edit.cpp | 4 + pcbnew/kicad_plugin.cpp | 10 +- pcbnew/legacy_plugin.cpp | 40 +- pcbnew/menubar_pcbframe.cpp | 4 + pcbnew/onleftclick.cpp | 29 +- pcbnew/onrightclick.cpp | 15 +- pcbnew/pcb_parser.cpp | 43 + pcbnew/pcbnew_id.h | 1 + pcbnew/tool_pcb.cpp | 4 + pcbnew/zone_filling_algorithm.cpp | 30 +- pcbnew/zones.h | 11 + pcbnew/zones_by_polygon.cpp | 47 +- pcbnew/zones_by_polygon_fill_functions.cpp | 12 +- ...nvert_brd_items_to_polygons_with_Boost.cpp | 9 +- pcbnew/zones_functions_for_undo_redo.cpp | 28 +- pcbnew/zones_non_copper_type_functions.cpp | 10 +- pcbnew/zones_test_and_combine_areas.cpp | 103 +- polygon/PolyLine.cpp | 221 +- polygon/PolyLine.h | 42 +- 45 files changed, 6968 insertions(+), 4774 deletions(-) create mode 100644 bitmaps_png/cpp_26/add_keepout_area.cpp create mode 100644 bitmaps_png/sources/add_keepout_area.svg create mode 100644 pcbnew/dialogs/dialog_keepout_area_properties.cpp create mode 100644 pcbnew/dialogs/dialog_keepout_area_properties_base.cpp create mode 100644 pcbnew/dialogs/dialog_keepout_area_properties_base.fbp create mode 100644 pcbnew/dialogs/dialog_keepout_area_properties_base.h diff --git a/bitmaps_png/CMakeLists.txt b/bitmaps_png/CMakeLists.txt index b9371a7ad5..3347843124 100644 --- a/bitmaps_png/CMakeLists.txt +++ b/bitmaps_png/CMakeLists.txt @@ -129,6 +129,7 @@ set( BMAPS_MID add_hierar_pin add_hierarchical_subsheet add_junction + add_keepout_area add_line2bus add_line_label add_line diff --git a/bitmaps_png/cpp_26/add_keepout_area.cpp b/bitmaps_png/cpp_26/add_keepout_area.cpp new file mode 100644 index 0000000000..cd8d4d0c19 --- /dev/null +++ b/bitmaps_png/cpp_26/add_keepout_area.cpp @@ -0,0 +1,82 @@ + +/* Do not modify this file, it was automatically generated by the + * PNG2cpp CMake script, using a *.png file as input. + */ + +#include + +static const unsigned char png[] = { + 0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, 0x49, 0x48, 0x44, 0x52, + 0x00, 0x00, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x1a, 0x08, 0x06, 0x00, 0x00, 0x00, 0xa9, 0x4a, 0x4c, + 0xce, 0x00, 0x00, 0x04, 0x0b, 0x49, 0x44, 0x41, 0x54, 0x48, 0xc7, 0xbd, 0xd6, 0x5f, 0x4c, 0x53, + 0x57, 0x1c, 0x07, 0xf0, 0x5b, 0x4a, 0x59, 0x41, 0x18, 0xcc, 0x44, 0xd4, 0x42, 0x81, 0xd2, 0xd6, + 0x21, 0xd3, 0x0d, 0xc7, 0xc0, 0xc4, 0xd0, 0x0c, 0x1a, 0x61, 0xe8, 0x58, 0x04, 0x16, 0x15, 0x87, + 0x32, 0x08, 0x43, 0x83, 0xcc, 0x4c, 0x37, 0x56, 0xa0, 0x02, 0x86, 0xe0, 0xa4, 0x30, 0x81, 0xc1, + 0x1c, 0x6a, 0x41, 0xf9, 0x53, 0x6a, 0xe5, 0x6f, 0x0b, 0x88, 0x80, 0xe0, 0xda, 0x52, 0xda, 0x42, + 0xf4, 0x61, 0xcf, 0x4b, 0x7c, 0x59, 0x32, 0x93, 0xbd, 0x2c, 0xf1, 0xdf, 0x93, 0x8c, 0xef, 0x7a, + 0x6f, 0xd3, 0xd3, 0x15, 0xda, 0x72, 0xb7, 0x87, 0x3d, 0x7c, 0xdb, 0xdb, 0x7b, 0xcf, 0xf9, 0x7d, + 0xee, 0x39, 0x3d, 0xf7, 0x0f, 0x05, 0x80, 0xfa, 0x3f, 0xc2, 0x7c, 0xc4, 0xbe, 0x1d, 0xf4, 0x4b, + 0x94, 0x24, 0xe0, 0x35, 0x9d, 0xb4, 0x0c, 0xce, 0x6a, 0xe1, 0x29, 0xce, 0x5a, 0x45, 0x05, 0xb5, + 0x76, 0xfe, 0x3c, 0x85, 0xa2, 0x62, 0xce, 0x5a, 0xd6, 0x61, 0xce, 0x5f, 0xd1, 0x52, 0xe7, 0xf1, + 0xff, 0x90, 0x17, 0x04, 0x12, 0xef, 0x09, 0x7d, 0xd2, 0xa0, 0x56, 0xe1, 0x72, 0x6b, 0x2a, 0x6a, + 0xaa, 0x29, 0xaf, 0x69, 0xb8, 0x22, 0x85, 0xfa, 0x7e, 0x3f, 0x7a, 0x8d, 0x73, 0xac, 0x73, 0x7d, + 0x7a, 0x0c, 0x51, 0x52, 0xee, 0x6b, 0x0f, 0xe8, 0x92, 0x6a, 0x3d, 0xc2, 0xc1, 0xc5, 0xda, 0x10, + 0x8f, 0x7d, 0x8d, 0xcd, 0x89, 0xd0, 0x2d, 0x5b, 0x70, 0x77, 0xc5, 0xca, 0x2a, 0x34, 0xe6, 0x01, + 0xa5, 0x65, 0xf0, 0x9f, 0xba, 0x8a, 0x29, 0x6b, 0xb8, 0x68, 0xef, 0x2d, 0xc2, 0x80, 0x71, 0xd4, + 0xd1, 0x78, 0x09, 0x3d, 0xd3, 0xd7, 0x50, 0xdf, 0x10, 0x49, 0x30, 0x65, 0xf7, 0x51, 0xd4, 0x4c, + 0xb4, 0x42, 0x61, 0x68, 0xc1, 0x80, 0xed, 0xe7, 0x7f, 0x07, 0xe5, 0x1d, 0xe3, 0xfd, 0xe9, 0x2a, + 0xa4, 0xea, 0x90, 0x6d, 0xe8, 0xd0, 0x35, 0x5c, 0x43, 0xa0, 0xfc, 0x2a, 0x0a, 0x5c, 0x85, 0x33, + 0x1f, 0xb4, 0x1d, 0x80, 0x76, 0x79, 0x91, 0x3d, 0x54, 0x52, 0xca, 0x7d, 0xe5, 0x2a, 0x74, 0xd3, + 0xd0, 0xb4, 0xa1, 0xc3, 0x1d, 0xc7, 0x99, 0x2b, 0x95, 0x3c, 0xe6, 0xf8, 0x99, 0x6a, 0x37, 0x44, + 0x47, 0xf6, 0x63, 0x16, 0x74, 0x8e, 0x91, 0xb3, 0x82, 0x0a, 0x0a, 0x03, 0x9f, 0xb9, 0xa0, 0x1f, + 0xfa, 0x4a, 0x36, 0x74, 0x18, 0x5c, 0x9c, 0x22, 0x23, 0x3a, 0xb9, 0x0e, 0xa2, 0x93, 0x7d, 0x33, + 0x9f, 0x1d, 0x74, 0xf0, 0xd0, 0x1b, 0x7f, 0xd4, 0x56, 0x52, 0x68, 0xfa, 0x82, 0x83, 0xba, 0x4b, + 0x6f, 0x41, 0x63, 0x9e, 0x20, 0x8d, 0x75, 0x76, 0x13, 0x5a, 0xba, 0xb2, 0x09, 0x54, 0xd6, 0x24, + 0xc5, 0xc7, 0xea, 0x63, 0x4c, 0xc2, 0x6b, 0xc3, 0x09, 0xf6, 0xe9, 0xed, 0xe2, 0xcd, 0x21, 0xc9, + 0xde, 0xd0, 0x27, 0x5a, 0xf9, 0x56, 0x98, 0xb7, 0x71, 0x61, 0xd8, 0xcb, 0x45, 0xc7, 0x09, 0x2e, + 0x9a, 0x3b, 0xe5, 0x68, 0xeb, 0x39, 0x8e, 0xba, 0xfa, 0x70, 0xf7, 0x42, 0x70, 0x4c, 0x5f, 0xdf, + 0x82, 0x96, 0x14, 0xba, 0x7a, 0xa7, 0x15, 0x29, 0xc5, 0x7c, 0x82, 0x15, 0x0d, 0x9e, 0xf3, 0x0f, + 0xe5, 0x8a, 0x42, 0x7e, 0xb7, 0x08, 0x22, 0x61, 0x8e, 0x0c, 0x62, 0x30, 0x3a, 0x33, 0x62, 0x2e, + 0x5a, 0x4a, 0x38, 0x1e, 0xcb, 0xbb, 0x53, 0x53, 0xce, 0x14, 0x98, 0xe8, 0xbe, 0x01, 0x53, 0xce, + 0x61, 0x2c, 0x8b, 0xe2, 0x60, 0x16, 0xee, 0x40, 0xe1, 0x47, 0x3c, 0x06, 0x0a, 0x54, 0x70, 0x50, + 0x3e, 0xa4, 0xf4, 0x0d, 0xc9, 0xa4, 0x21, 0xbf, 0x8d, 0xe6, 0xe5, 0xc0, 0x26, 0x15, 0xc3, 0xb2, + 0x63, 0x0b, 0xc1, 0x4c, 0x91, 0x5c, 0xdc, 0xca, 0x0a, 0x40, 0x7d, 0x7d, 0x04, 0x6e, 0x8c, 0x37, + 0x62, 0xb2, 0xb3, 0x1d, 0x66, 0x79, 0x3a, 0x03, 0xd0, 0x59, 0x4c, 0xff, 0x10, 0xe3, 0x43, 0x5a, + 0x5c, 0x18, 0x6b, 0x44, 0x60, 0x55, 0x00, 0x83, 0xf1, 0x1c, 0xdf, 0x95, 0xfa, 0x2b, 0xde, 0x21, + 0xfa, 0x82, 0x6d, 0x1e, 0x54, 0x63, 0x78, 0x61, 0x0e, 0x33, 0xca, 0x2a, 0x2c, 0xbd, 0x93, 0x00, + 0xab, 0x70, 0x3b, 0xac, 0xd1, 0xdb, 0x60, 0x8b, 0x11, 0xc0, 0x94, 0x99, 0x81, 0x87, 0xc7, 0x8f, + 0x12, 0xc0, 0x2e, 0x11, 0x63, 0x56, 0xf1, 0x0d, 0x86, 0x6c, 0xee, 0xa5, 0x7d, 0xfa, 0xae, 0x82, + 0x4c, 0x21, 0xbf, 0x9a, 0x87, 0xba, 0xa9, 0x0e, 0xdf, 0x90, 0xab, 0xd3, 0xc8, 0x83, 0xfb, 0xee, + 0xc2, 0x31, 0x42, 0x3c, 0x0a, 0x0b, 0x73, 0x24, 0x14, 0xcb, 0xb1, 0x31, 0x58, 0x7a, 0x7f, 0x1f, + 0xc6, 0x47, 0x74, 0x5e, 0x57, 0xd9, 0x89, 0xfe, 0x33, 0x04, 0xdb, 0xa2, 0x0c, 0x46, 0xbd, 0xa1, + 0xd3, 0x3f, 0xe4, 0xca, 0x6c, 0xe5, 0xd7, 0x0c, 0xf2, 0x98, 0xcf, 0x67, 0xf2, 0x28, 0x22, 0x02, + 0xfa, 0x81, 0x5e, 0xbf, 0x77, 0x83, 0x4f, 0xba, 0x0b, 0x08, 0xf6, 0xe6, 0xc5, 0x30, 0x6c, 0x4f, + 0x0e, 0x58, 0xf5, 0x0b, 0xdd, 0x53, 0x7d, 0x07, 0xbb, 0x54, 0x82, 0x95, 0xe8, 0x28, 0x3c, 0x0e, + 0x09, 0x61, 0xb2, 0x22, 0x8c, 0x86, 0xf9, 0xa0, 0x1c, 0x43, 0x56, 0xb3, 0x4f, 0x88, 0xbe, 0x78, + 0xd3, 0x7f, 0x3a, 0x44, 0xb0, 0xa0, 0x2f, 0x69, 0xc2, 0x07, 0x34, 0x79, 0xad, 0xc3, 0x31, 0x6d, + 0x22, 0xf7, 0x7f, 0xe2, 0x00, 0xed, 0x12, 0x09, 0xf9, 0x3d, 0x5f, 0x56, 0xea, 0x77, 0x54, 0xf4, + 0x6d, 0x29, 0xa5, 0x3d, 0xcd, 0x89, 0x55, 0xfa, 0x80, 0xe8, 0xf9, 0xb7, 0xed, 0x4e, 0x20, 0x45, + 0x6d, 0x89, 0xbb, 0x31, 0xae, 0xd3, 0x40, 0xaf, 0xed, 0x67, 0xb6, 0x5d, 0xfb, 0xa7, 0xda, 0xbe, + 0xf7, 0x8b, 0x69, 0x6c, 0x46, 0x24, 0xaa, 0xde, 0x05, 0xf7, 0x5b, 0x2f, 0x10, 0xbd, 0xea, 0x96, + 0x52, 0x53, 0x48, 0x31, 0x3a, 0xf7, 0xae, 0x36, 0x93, 0xce, 0x7a, 0x4d, 0x1f, 0x39, 0x09, 0x6b, + 0xd2, 0x7b, 0x18, 0x36, 0x2d, 0xf8, 0xc5, 0xba, 0xe6, 0xf5, 0xe0, 0x9f, 0xe6, 0xac, 0x6d, 0x80, + 0x16, 0x8a, 0x8b, 0x3c, 0x10, 0x63, 0xee, 0x91, 0x0d, 0x9d, 0x0d, 0xbd, 0x3d, 0xb0, 0xc7, 0x3b, + 0xa7, 0x75, 0xee, 0xdc, 0xd9, 0x4d, 0x1f, 0x13, 0x3b, 0xf7, 0xac, 0x5b, 0x75, 0xd7, 0x2f, 0xd7, + 0x7a, 0xfc, 0x2f, 0xf4, 0x99, 0x8f, 0x4e, 0x4f, 0x7a, 0x2d, 0xf0, 0xa0, 0xa2, 0x9c, 0x5c, 0x4f, + 0x63, 0x86, 0x51, 0xf6, 0x8f, 0x09, 0xa9, 0x03, 0x9a, 0x4b, 0x4e, 0xf2, 0x18, 0xcd, 0x4c, 0xb5, + 0xc2, 0x67, 0x81, 0xa1, 0x45, 0x23, 0x2c, 0xfb, 0x53, 0x9d, 0xa3, 0xce, 0x3b, 0xc2, 0x1e, 0xca, + 0x8f, 0x0b, 0x7e, 0x6a, 0x89, 0x12, 0xfc, 0x63, 0x01, 0x24, 0x62, 0xd8, 0x38, 0xef, 0x77, 0x5a, + 0x0c, 0xb7, 0xd4, 0xa4, 0xbd, 0xbe, 0xff, 0x36, 0x3b, 0x88, 0x9e, 0xba, 0x81, 0xb3, 0xa5, 0xb0, + 0x8b, 0xe3, 0x99, 0x8e, 0xb3, 0x17, 0xbe, 0x62, 0xf5, 0x4e, 0xb0, 0xf0, 0xf9, 0x29, 0xa6, 0xfd, + 0xc3, 0xcf, 0x0a, 0xd8, 0x41, 0xa2, 0xc4, 0xe0, 0x5f, 0x93, 0x64, 0xb1, 0x2f, 0x4f, 0xa6, 0xc4, + 0xbe, 0x1c, 0xd9, 0x1a, 0xba, 0x2a, 0x4f, 0xdf, 0xf5, 0x7c, 0x7f, 0x66, 0xc2, 0xb3, 0xcd, 0x92, + 0x2d, 0x93, 0xbc, 0xa0, 0xdb, 0x97, 0xed, 0x13, 0xbe, 0xf2, 0x76, 0x3c, 0x55, 0xbe, 0xeb, 0x39, + 0xfd, 0xca, 0x45, 0x20, 0x81, 0x98, 0x3a, 0xb0, 0x53, 0x4c, 0x65, 0xd3, 0x49, 0x8e, 0xa3, 0x72, + 0x5d, 0xdb, 0x6c, 0x22, 0x8d, 0xa7, 0x72, 0xfc, 0x1d, 0x17, 0x88, 0xa8, 0x4c, 0xda, 0xf8, 0x1b, + 0x60, 0x76, 0x60, 0xa1, 0x4e, 0x22, 0xae, 0x5d, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e, 0x44, + 0xae, 0x42, 0x60, 0x82, +}; + +const BITMAP_OPAQUE add_keepout_area_xpm[1] = {{ png, sizeof( png ), "add_keepout_area_xpm" }}; + +//EOF diff --git a/bitmaps_png/sources/add_keepout_area.svg b/bitmaps_png/sources/add_keepout_area.svg new file mode 100644 index 0000000000..cefa8a3720 --- /dev/null +++ b/bitmaps_png/sources/add_keepout_area.svg @@ -0,0 +1,178 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/common/pcb.keywords b/common/pcb.keywords index 5e0f9a7b43..90767b1437 100644 --- a/common/pcb.keywords +++ b/common/pcb.keywords @@ -24,6 +24,7 @@ # These are the keywords for the Pcbnew s-expression file format. add_net +allowed angle arc arc_segments @@ -84,6 +85,7 @@ hatch hide italic justify +keepout kicad_pcb last_trace_width layer @@ -107,10 +109,12 @@ nets no no_connects none +not_allowed np_thru_hole offset oval pad +pads pad_drill pad_size pad_to_mask_clearance @@ -178,6 +182,7 @@ uvias_allowed value version via +vias via_dia via_drill via_min_drill @@ -194,4 +199,5 @@ zone zone_45_only zone_clearance zone_connect +zone_type zones diff --git a/include/bitmaps.h b/include/bitmaps.h index 0f8dd57e9b..a9c6331d81 100644 --- a/include/bitmaps.h +++ b/include/bitmaps.h @@ -62,6 +62,7 @@ EXTERN_BITMAP( add_hierarchical_label_xpm ) EXTERN_BITMAP( add_hierarchical_subsheet_xpm ) EXTERN_BITMAP( add_hierar_pin_xpm ) EXTERN_BITMAP( add_junction_xpm ) +EXTERN_BITMAP( add_keepout_area_xpm ) EXTERN_BITMAP( add_line2bus_xpm ) EXTERN_BITMAP( add_line_label_xpm ) EXTERN_BITMAP( add_line_xpm ) diff --git a/pcbnew/CMakeLists.txt b/pcbnew/CMakeLists.txt index 8aed49b338..b944320db3 100644 --- a/pcbnew/CMakeLists.txt +++ b/pcbnew/CMakeLists.txt @@ -61,6 +61,8 @@ set(PCBNEW_DIALOGS dialogs/dialog_graphic_item_properties_for_Modedit.cpp dialogs/dialog_global_deletion.cpp dialogs/dialog_global_deletion_base.cpp + dialogs/dialog_keepout_area_properties.cpp + dialogs/dialog_keepout_area_properties_base.cpp dialogs/dialog_layers_setup.cpp dialogs/dialog_layers_setup_base.cpp dialogs/dialog_netlist.cpp diff --git a/pcbnew/class_drc_item.cpp b/pcbnew/class_drc_item.cpp index 402e3643af..edbdf94308 100644 --- a/pcbnew/class_drc_item.cpp +++ b/pcbnew/class_drc_item.cpp @@ -102,8 +102,21 @@ wxString DRC_ITEM::GetErrorText() const case DRCE_NETCLASS_uVIADRILLSIZE: return wxString( _("NetClass uVia Drill < global limit")); + case DRCE_VIA_INSIDE_KEEPOUT: + return wxString( _("Via inside a keepout area")); + + case DRCE_TRACK_INSIDE_KEEPOUT: + return wxString( _("Track inside a keepout area")); + + case DRCE_PAD_INSIDE_KEEPOUT: + return wxString( _("Pad inside a keepout area")); + default: - return wxString( wxT("PROGRAM BUG, PLEASE LEAVE THE ROOM.") ); + { + wxString msg; + msg.Printf( wxT( "Unknown DRC error code %d" ), m_ErrorCode ); + return ( msg ); + } } } diff --git a/pcbnew/class_zone.cpp b/pcbnew/class_zone.cpp index d23a58cce2..bebae50f0e 100644 --- a/pcbnew/class_zone.cpp +++ b/pcbnew/class_zone.cpp @@ -56,9 +56,13 @@ ZONE_CONTAINER::ZONE_CONTAINER( BOARD* aBoard ) : m_IsFilled = false; // fill status : true when the zone is filled m_FillMode = 0; // How to fill areas: 0 = use filled polygons, != 0 fill with segments m_priority = 0; - smoothedPoly = NULL; - cornerSmoothingType = ZONE_SETTINGS::SMOOTHING_NONE; - cornerRadius = 0; + m_smoothedPoly = NULL; + m_cornerSmoothingType = ZONE_SETTINGS::SMOOTHING_NONE; + m_isKeepout = false; + m_doNotAllowPads = true; // has meaning only if m_isKeepout == true + m_doNotAllowVias = true; // has meaning only if m_isKeepout == true + m_doNotAllowTracks = true; // has meaning only if m_isKeepout == true + m_cornerRadius = 0; utility = 0; // flags used in polygon calculations utility2 = 0; // flags used in polygon calculations m_Poly = new CPolyLine(); // Outlines @@ -87,8 +91,15 @@ ZONE_CONTAINER::ZONE_CONTAINER( const ZONE_CONTAINER& aZone ) : m_FilledPolysList = aZone.m_FilledPolysList; m_FillSegmList = aZone.m_FillSegmList; - cornerSmoothingType = aZone.cornerSmoothingType; - cornerRadius = aZone.cornerRadius; + m_isKeepout = aZone.m_isKeepout; + m_doNotAllowPads = aZone.m_doNotAllowPads; + m_doNotAllowVias = aZone.m_doNotAllowVias; + m_doNotAllowTracks = aZone.m_doNotAllowTracks; + + m_cornerSmoothingType = aZone.m_cornerSmoothingType; + m_cornerRadius = aZone.m_cornerRadius; + + utility = aZone.utility; utility2 = aZone.utility; } @@ -221,10 +232,8 @@ void ZONE_CONTAINER::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, int aDrawMode, const for( unsigned ic = 0; ic < m_Poly->m_HatchLines.size(); ic++ ) { - seg_start.x = m_Poly->m_HatchLines[ic].xi + offset.x; - seg_start.y = m_Poly->m_HatchLines[ic].yi + offset.y; - seg_end.x = m_Poly->m_HatchLines[ic].xf + offset.x; - seg_end.y = m_Poly->m_HatchLines[ic].yf + offset.y; + seg_start = m_Poly->m_HatchLines[ic].m_Start + offset; + seg_end = m_Poly->m_HatchLines[ic].m_End + offset; lines.push_back( seg_start ); lines.push_back( seg_end ); } diff --git a/pcbnew/class_zone.h b/pcbnew/class_zone.h index 2a2c9099a8..c3b715ae45 100644 --- a/pcbnew/class_zone.h +++ b/pcbnew/class_zone.h @@ -498,24 +498,24 @@ public: */ CPolyLine* GetSmoothedPoly() const { - if( smoothedPoly ) - return smoothedPoly; + if( m_smoothedPoly ) + return m_smoothedPoly; else return m_Poly; }; - void SetCornerSmoothingType( int aType ) { cornerSmoothingType = aType; }; + void SetCornerSmoothingType( int aType ) { m_cornerSmoothingType = aType; }; - int GetCornerSmoothingType() const { return cornerSmoothingType; }; + int GetCornerSmoothingType() const { return m_cornerSmoothingType; }; void SetCornerRadius( unsigned int aRadius ) { - cornerRadius = aRadius; - if( cornerRadius > (unsigned int) Mils2iu( MAX_ZONE_CORNER_RADIUS_MILS ) ) - cornerRadius = Mils2iu( MAX_ZONE_CORNER_RADIUS_MILS ); + m_cornerRadius = aRadius; + if( m_cornerRadius > (unsigned int) Mils2iu( MAX_ZONE_CORNER_RADIUS_MILS ) ) + m_cornerRadius = Mils2iu( MAX_ZONE_CORNER_RADIUS_MILS ); }; - unsigned int GetCornerRadius() const { return cornerRadius; }; + unsigned int GetCornerRadius() const { return m_cornerRadius; }; void AddPolygon( std::vector< wxPoint >& aPolygon ); @@ -535,6 +535,20 @@ public: virtual EDA_ITEM* Clone() const; + /** + * Accessors to parameters used in Keepout zones: + */ + bool GetIsKeepout() const { return m_isKeepout; } + bool GetDoNotAllowPads() const { return m_doNotAllowPads; } + bool GetDoNotAllowVias() const { return m_doNotAllowVias; } + bool GetDoNotAllowTracks() const { return m_doNotAllowTracks; } + + void SetIsKeepout( bool aEnable ) { m_isKeepout = aEnable; } + void SetDoNotAllowPads( bool aEnable ) { m_doNotAllowPads = aEnable; } + void SetDoNotAllowVias( bool aEnable ) { m_doNotAllowVias = aEnable; } + void SetDoNotAllowTracks( bool aEnable ) { m_doNotAllowTracks = aEnable; } + + #if defined(DEBUG) void Show( int nestLevel, std::ostream& os ) const { ShowDummy( os ); } // override #endif @@ -572,14 +586,29 @@ public: private: - wxString m_Netname; // Net Name - CPolyLine* smoothedPoly; // Corner-smoothed version of m_Poly - int cornerSmoothingType; - unsigned int cornerRadius; - // Priority: when a zone outline is inside and other zone, if its priority is higher - // the other zone priority, it will be created inside. - // if priorities are equal, a DRC error is set + wxString m_Netname; // Net Name + CPolyLine* m_smoothedPoly; // Corner-smoothed version of m_Poly + int m_cornerSmoothingType; + unsigned int m_cornerRadius; + + /* Priority: when a zone outline is inside and other zone, if its priority is higher + * the other zone priority, it will be created inside. + * if priorities are equal, a DRC error is set + */ unsigned m_priority; + + /* A zone outline can be a keepout zone. + * It will be never filled, and DRC should test for pads, tracks and vias + */ + bool m_isKeepout; + + /* For keepout zones only: + * what is not allowed inside the keepout ( pads, tracks and vias ) + */ + bool m_doNotAllowPads; + bool m_doNotAllowVias; + bool m_doNotAllowTracks; + ZoneConnection m_PadConnection; /* set of filled polygons used to draw a zone as a filled area. diff --git a/pcbnew/class_zone_settings.cpp b/pcbnew/class_zone_settings.cpp index 174033d77f..b4ff1340fd 100644 --- a/pcbnew/class_zone_settings.cpp +++ b/pcbnew/class_zone_settings.cpp @@ -60,8 +60,13 @@ ZONE_SETTINGS::ZONE_SETTINGS() m_Zone_45_Only = false; - cornerSmoothingType = SMOOTHING_NONE; - cornerRadius = 0; + m_cornerSmoothingType = SMOOTHING_NONE; + m_cornerRadius = 0; + + SetIsKeepout( false ); + SetDoNotAllowPads( false ); + SetDoNotAllowVias( true ); + SetDoNotAllowTracks( true ); } @@ -78,8 +83,12 @@ ZONE_SETTINGS& ZONE_SETTINGS::operator << ( const ZONE_CONTAINER& aSource ) m_ThermalReliefGap = aSource.m_ThermalReliefGap; m_ThermalReliefCopperBridge = aSource.m_ThermalReliefCopperBridge; m_PadConnection = aSource.GetPadConnection(); - cornerSmoothingType = aSource.GetCornerSmoothingType(); - cornerRadius = aSource.GetCornerRadius(); + m_cornerSmoothingType = aSource.GetCornerSmoothingType(); + m_cornerRadius = aSource.GetCornerRadius(); + m_isKeepout = aSource.GetIsKeepout(); + m_keepoutDoNotAllowPads = aSource.GetDoNotAllowPads(); + m_keepoutDoNotAllowVias = aSource.GetDoNotAllowVias(); + m_keepoutDoNotAllowTracks = aSource.GetDoNotAllowTracks(); return *this; } @@ -95,8 +104,12 @@ void ZONE_SETTINGS::ExportSetting( ZONE_CONTAINER& aTarget, bool aFullExport ) c aTarget.m_ThermalReliefGap = m_ThermalReliefGap; aTarget.m_ThermalReliefCopperBridge = m_ThermalReliefCopperBridge; aTarget.SetPadConnection( m_PadConnection ); - aTarget.SetCornerSmoothingType( cornerSmoothingType ); - aTarget.SetCornerRadius( cornerRadius ); + aTarget.SetCornerSmoothingType( m_cornerSmoothingType ); + aTarget.SetCornerRadius( m_cornerRadius ); + aTarget.SetIsKeepout( GetIsKeepout() ); + aTarget.SetDoNotAllowPads( GetDoNotAllowPads() ); + aTarget.SetDoNotAllowVias( GetDoNotAllowVias() ); + aTarget.SetDoNotAllowTracks( GetDoNotAllowTracks() ); if( aFullExport ) { diff --git a/pcbnew/class_zone_settings.h b/pcbnew/class_zone_settings.h index 2b2760d462..6808885a9f 100644 --- a/pcbnew/class_zone_settings.h +++ b/pcbnew/class_zone_settings.h @@ -18,6 +18,8 @@ class ZONE_CONTAINER; /** * Class ZONE_SETTINGS * handles zones parameters. + * Because a zone can be on copper or non copper layers, and can be also + * a keepout area, some parameters are irrelevant depending on the type of zone */ class ZONE_SETTINGS { @@ -51,10 +53,23 @@ public: bool m_Zone_45_Only; private: - int cornerSmoothingType; ///< Corner smoothing type - unsigned int cornerRadius; ///< Corner chamfer distance / fillet radius + int m_cornerSmoothingType; ///< Corner smoothing type + unsigned int m_cornerRadius; ///< Corner chamfer distance / fillet radius ZoneConnection m_PadConnection; + /* A zone outline can be a keepout zone. + * It will be never filled, and DRC should test for pads, tracks and vias + */ + bool m_isKeepout; + + /* For keepout zones only: + * what is not allowed inside the keepout ( pads, tracks and vias ) + */ + bool m_keepoutDoNotAllowPads; + bool m_keepoutDoNotAllowVias; + bool m_keepoutDoNotAllowTracks; + + public: ZONE_SETTINGS(); @@ -77,25 +92,37 @@ public: */ void ExportSetting( ZONE_CONTAINER& aTarget, bool aFullExport = true ) const; - void SetCornerSmoothingType( int aType) { cornerSmoothingType = aType; } + void SetCornerSmoothingType( int aType) { m_cornerSmoothingType = aType; } - int GetCornerSmoothingType() const { return cornerSmoothingType; } + int GetCornerSmoothingType() const { return m_cornerSmoothingType; } void SetCornerRadius( int aRadius ) { if( aRadius > Mils2iu( MAX_ZONE_CORNER_RADIUS_MILS ) ) - cornerRadius = Mils2iu( MAX_ZONE_CORNER_RADIUS_MILS ); + m_cornerRadius = Mils2iu( MAX_ZONE_CORNER_RADIUS_MILS ); else if( aRadius < 0 ) - cornerRadius = 0; + m_cornerRadius = 0; else - cornerRadius = aRadius; + m_cornerRadius = aRadius; }; - unsigned int GetCornerRadius() const { return cornerRadius; } + unsigned int GetCornerRadius() const { return m_cornerRadius; } ZoneConnection GetPadConnection() const { return m_PadConnection; } void SetPadConnection( ZoneConnection aPadConnection ) { m_PadConnection = aPadConnection; } + /** + * Accessors to parameters used in Keepout zones: + */ + const bool GetIsKeepout() const { return m_isKeepout; } + const bool GetDoNotAllowPads() const { return m_keepoutDoNotAllowPads; } + const bool GetDoNotAllowVias() const { return m_keepoutDoNotAllowVias; } + const bool GetDoNotAllowTracks() const { return m_keepoutDoNotAllowTracks; } + + void SetIsKeepout( bool aEnable ) { m_isKeepout = aEnable; } + void SetDoNotAllowPads( bool aEnable ) { m_keepoutDoNotAllowPads = aEnable; } + void SetDoNotAllowVias( bool aEnable ) { m_keepoutDoNotAllowVias = aEnable; } + void SetDoNotAllowTracks( bool aEnable ) { m_keepoutDoNotAllowTracks = aEnable; } }; diff --git a/pcbnew/controle.cpp b/pcbnew/controle.cpp index 74f697e8e0..69bc0550f2 100644 --- a/pcbnew/controle.cpp +++ b/pcbnew/controle.cpp @@ -133,6 +133,7 @@ BOARD_ITEM* PCB_BASE_FRAME::PcbGeneralLocateAndDisplay( int aHotKeyCode ) break; case ID_PCB_ZONES_BUTT: + case ID_PCB_KEEPOUT_AREA_BUTT: scanList = GENERAL_COLLECTOR::Zones; break; diff --git a/pcbnew/dialogs/dialog_copper_zones.cpp b/pcbnew/dialogs/dialog_copper_zones.cpp index 0bf5e95949..1cb1b13588 100644 --- a/pcbnew/dialogs/dialog_copper_zones.cpp +++ b/pcbnew/dialogs/dialog_copper_zones.cpp @@ -76,8 +76,6 @@ private: static wxString m_netNameShowFilter; ///< the filter to show nets (default * "*"). ///< static to keep this pattern for an entire pcbnew session - wxListView* m_LayerSelectionCtrl; - /** * Function initDialog * fills in the dialog controls using the current settings. @@ -155,16 +153,6 @@ DIALOG_COPPER_ZONE::DIALOG_COPPER_ZONE( PCB_BASE_FRAME* aParent, ZONE_SETTINGS* SetReturnCode( ZONE_ABORT ); // Will be changed on buttons click - m_LayerSelectionCtrl = new wxListView( this, wxID_ANY, - wxDefaultPosition, wxDefaultSize, - wxLC_NO_HEADER | wxLC_REPORT - | wxLC_SINGLE_SEL | wxRAISED_BORDER ); - wxListItem col0; - col0.SetId( 0 ); - m_LayerSelectionCtrl->InsertColumn( 0, col0 ); - m_layerSizer->Add( m_LayerSelectionCtrl, 1, - wxGROW | wxLEFT | wxRIGHT | wxBOTTOM, 5 ); - // Fix static text widget minimum width to a suitable value so that // resizing the dialog is not necessary when changing the corner smoothing type. // Depends on the default text in the widget. @@ -173,8 +161,6 @@ DIALOG_COPPER_ZONE::DIALOG_COPPER_ZONE( PCB_BASE_FRAME* aParent, ZONE_SETTINGS* initDialog(); GetSizer()->SetSizeHints( this ); - - Center(); } @@ -259,6 +245,10 @@ void DIALOG_COPPER_ZONE::initDialog() m_ArcApproximationOpt->SetSelection( m_settings.m_ArcToSegmentsCount == ARC_APPROX_SEGMENTS_COUNT_HIGHT_DEF ? 1 : 0 ); + // Create one column in m_LayerSelectionCtrl + wxListItem col0; + col0.SetId( 0 ); + m_LayerSelectionCtrl->InsertColumn( 0, col0 ); // Build copper layer list and append to layer widget int layerCount = board->GetCopperLayerCount(); int layerNumber, itemIndex, layerColor; diff --git a/pcbnew/dialogs/dialog_copper_zones_base.cpp b/pcbnew/dialogs/dialog_copper_zones_base.cpp index 4bd894adb9..3c36d7b185 100644 --- a/pcbnew/dialogs/dialog_copper_zones_base.cpp +++ b/pcbnew/dialogs/dialog_copper_zones_base.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Apr 10 2012) +// C++ code generated with wxFormBuilder (version Mar 17 2012) // http://www.wxformbuilder.org/ // // PLEASE DO "NOT" EDIT THIS FILE! @@ -32,12 +32,16 @@ DIALOG_COPPER_ZONE_BASE::DIALOG_COPPER_ZONE_BASE( wxWindow* parent, wxWindowID i wxBoxSizer* m_OptionsBoxSizer; m_OptionsBoxSizer = new wxBoxSizer( wxHORIZONTAL ); + wxBoxSizer* m_layerSizer; m_layerSizer = new wxBoxSizer( wxVERTICAL ); m_staticText17 = new wxStaticText( this, wxID_ANY, _("Layer:"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticText17->Wrap( -1 ); m_layerSizer->Add( m_staticText17, 0, wxLEFT|wxRIGHT|wxTOP, 5 ); + m_LayerSelectionCtrl = new wxListView( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_ALIGN_LEFT|wxLC_NO_HEADER|wxLC_REPORT|wxLC_SINGLE_SEL|wxLC_SMALL_ICON ); + m_layerSizer->Add( m_LayerSelectionCtrl, 1, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); + m_OptionsBoxSizer->Add( m_layerSizer, 1, wxEXPAND, 5 ); @@ -128,7 +132,7 @@ DIALOG_COPPER_ZONE_BASE::DIALOG_COPPER_ZONE_BASE( wxWindow* parent, wxWindowID i m_cornerSmoothingTitle = new wxStaticText( this, wxID_ANY, _("Chamfer distance (mm):"), wxDefaultPosition, wxDefaultSize, 0 ); m_cornerSmoothingTitle->Wrap( -1 ); - bSizer9->Add( m_cornerSmoothingTitle, 0, wxLEFT|wxRIGHT|wxTOP, 5 ); + bSizer9->Add( m_cornerSmoothingTitle, 0, wxRIGHT|wxLEFT, 5 ); m_cornerSmoothingCtrl = new wxTextCtrl( this, ID_M_CORNERSMOOTHINGCTRL, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); bSizer9->Add( m_cornerSmoothingCtrl, 0, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT, 5 ); @@ -143,7 +147,7 @@ DIALOG_COPPER_ZONE_BASE::DIALOG_COPPER_ZONE_BASE( wxWindow* parent, wxWindowID i m_staticText13->Wrap( -1 ); m_LeftBox->Add( m_staticText13, 0, wxLEFT|wxRIGHT|wxTOP, 5 ); - wxString m_PadInZoneOptChoices[] = { _("Solid"), _("Thermal relief"), _("THT Thermal"), _("None") }; + wxString m_PadInZoneOptChoices[] = { _("Solid"), _("Thermal relief"), _("THT thermal"), _("None") }; int m_PadInZoneOptNChoices = sizeof( m_PadInZoneOptChoices ) / sizeof( wxString ); m_PadInZoneOpt = new wxChoice( this, ID_M_PADINZONEOPT, wxDefaultPosition, wxDefaultSize, m_PadInZoneOptNChoices, m_PadInZoneOptChoices, 0 ); m_PadInZoneOpt->SetSelection( 0 ); @@ -183,7 +187,7 @@ DIALOG_COPPER_ZONE_BASE::DIALOG_COPPER_ZONE_BASE( wxWindow* parent, wxWindowID i m_staticText171->Wrap( -1 ); m_staticText171->SetToolTip( _("On each copper layer, zones are filled by priority order.\nSo when a zone is inside an other zone:\n* If its priority is highter: its outlines are removed from the other layer.\n* If its priority is equal: a DRC error is set.") ); - m_MiddleBox->Add( m_staticText171, 0, wxRIGHT|wxLEFT, 5 ); + m_MiddleBox->Add( m_staticText171, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); m_PriorityLevelCtrl = new wxSpinCtrl( this, ID_M_PRIORITYLEVELCTRL, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 0, 100, 0 ); m_MiddleBox->Add( m_PriorityLevelCtrl, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 ); @@ -238,7 +242,7 @@ DIALOG_COPPER_ZONE_BASE::DIALOG_COPPER_ZONE_BASE( wxWindow* parent, wxWindowID i m_ExportableSetupSizer->Add( bSizer81, 0, wxEXPAND, 5 ); - m_MainBoxSizer->Add( m_ExportableSetupSizer, 1, wxALL|wxEXPAND, 5 ); + m_MainBoxSizer->Add( m_ExportableSetupSizer, 0, wxALL|wxEXPAND, 5 ); wxBoxSizer* bSizer10; bSizer10 = new wxBoxSizer( wxHORIZONTAL ); diff --git a/pcbnew/dialogs/dialog_copper_zones_base.fbp b/pcbnew/dialogs/dialog_copper_zones_base.fbp index 078e126f50..9d9ded4636 100644 --- a/pcbnew/dialogs/dialog_copper_zones_base.fbp +++ b/pcbnew/dialogs/dialog_copper_zones_base.fbp @@ -1,3418 +1,3629 @@ - - - - - - C++ - 1 - source_name - 0 - 0 - res - UTF-8 - table - dialog_copper_zones_base - 1000 - none - 1 - dialog_copper_zones_base - - . - - 1 - 1 - 1 - 1 - 0 - - 0 - wxAUI_MGR_DEFAULT - - - - 1 - 1 - impl_virtual - - - - 0 - ID_DIALOG_COPPER_ZONE_BASE - - - DIALOG_COPPER_ZONE_BASE - - 550,500 - wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER - DIALOG_SHIM; dialog_shim.h - Zone Properties - - - - - - - - - - - - - - OnClose - - - - - - - - - - - - - - - - - - - - - - - - - OnSize - - - - m_MainBoxSizer - wxVERTICAL - protected - - 5 - wxALL|wxEXPAND - 1 - - - m_OptionsBoxSizer - wxHORIZONTAL - none - - 5 - wxEXPAND - 1 - - - m_layerSizer - wxVERTICAL - protected - - 5 - wxLEFT|wxRIGHT|wxTOP - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Layer: - - 0 - - - 0 - - 1 - m_staticText17 - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - - - -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxEXPAND - 1 - - - bSizer7 - wxVERTICAL - none - - 5 - wxTOP|wxRIGHT|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Net: - - 0 - - - 0 - - 1 - m_staticText2 - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - - - -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT - 1 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - ID_NETNAME_SELECTION - - 0 - - - 0 - -1,-1 - 1 - m_ListNetNameSelection - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL - 0 - - wxID_ANY - Net Filtering - - m_NetSortOptSizer - wxVERTICAL - none - - - 5 - wxLEFT|wxRIGHT|wxTOP - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Display: - - 0 - - - 0 - - 1 - m_staticText16 - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - - - -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - "Show all (alphabetical)" "Show all (advanced)" "Filtered (alphabetical)" "Filtered (advanced)" - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - ID_M_NETDISPLAYOPTION - - 0 - - - 0 - - 1 - m_NetDisplayOption - 1 - - - protected - 1 - - Resizable - 0 - 1 - - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - OnNetSortingOptionSelected - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxTOP|wxRIGHT|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Hidden net filter: - - 0 - - - 0 - - 1 - m_staticText5 - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - - - -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - ID_TEXTCTRL_NETNAMES_FILTER - - 0 - - 0 - - 0 - - 1 - m_DoNotShowNetNameFilter - 1 - - - protected - 1 - - Resizable - 1 - - wxTE_PROCESS_ENTER - - 0 - Pattern to filter net names in filtered list. Net names matching this pattern are not displayed. - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - OnRunFiltersButtonClick - - - - - - - 5 - wxTOP|wxRIGHT|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Visible net filter: - - 0 - - - 0 - - 1 - m_staticText51 - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - - - -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - ID_TEXTCTRL_NETNAMES_FILTER - - 0 - - 0 - - 0 - - 1 - m_ShowNetNameFilter - 1 - - - protected - 1 - - Resizable - 1 - - wxTE_PROCESS_ENTER - - 0 - Pattern to filter net names in filtered list. Only net names matching this pattern are displayed. - - wxFILTER_NONE - wxDefaultValidator - - * - - - - - - - - - - - - - - - - - - - - - - - - - - - OnRunFiltersButtonClick - - - - - - - 5 - wxALL|wxEXPAND - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_APPLY_FILTERS - Apply Filters - - 0 - - - 0 - - 1 - m_buttonRunFilter - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - OnRunFiltersButtonClick - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL|wxEXPAND - 1 - - wxID_ANY - Settings - - m_ExportableSetupSizer - wxHORIZONTAL - none - - - 5 - wxEXPAND - 0 - - - bSizer9 - wxVERTICAL - none - - 5 - wxTOP|wxRIGHT|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Clearance - - 0 - - - 0 - - 1 - m_ClearanceValueTitle - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - - - -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - 0 - - 0 - - 1 - m_ZoneClearanceCtrl - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxTOP|wxRIGHT|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Minimum width - - 0 - - - 0 - - 1 - m_MinThicknessValueTitle - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - Minimun thickness of filled areas. - - - - -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - 0 - - 0 - - 1 - m_ZoneMinThicknessCtrl - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxLEFT|wxRIGHT|wxTOP - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Corner smoothing: - - 0 - - - 0 - - 1 - m_staticText151 - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - - - -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - "None" "Chamfer" "Fillet" - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - ID_CORNER_SMOOTHING - - 0 - - - 0 - - 1 - m_cornerSmoothingChoice - 1 - - - protected - 1 - - Resizable - 0 - 1 - - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - OnCornerSmoothingModeChoice - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxLEFT|wxRIGHT|wxTOP - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Chamfer distance (mm): - - 0 - - - 0 - - 1 - m_cornerSmoothingTitle - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - - - -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - ID_M_CORNERSMOOTHINGCTRL - - 0 - - 0 - - 0 - - 1 - m_cornerSmoothingCtrl - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxEXPAND - 0 - - - m_LeftBox - wxVERTICAL - none - - 5 - wxLEFT|wxRIGHT|wxTOP - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Pad connection: - - 0 - - - 0 - - 1 - m_staticText13 - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - - - -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - "Solid" "Thermal relief" "THT Thermal" "None" - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - ID_M_PADINZONEOPT - - 0 - - - 0 - - 1 - m_PadInZoneOpt - 1 - - - protected - 1 - - Resizable - 0 - 1 - - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - OnPadsInZoneClick - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL|wxEXPAND - 0 - - wxID_ANY - Thermal Reliefs - - m_ThermalShapesParamsSizer - wxVERTICAL - none - - - 5 - wxLEFT|wxRIGHT|wxTOP - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Antipad clearance - - 0 - - - 0 - - 1 - m_AntipadSizeText - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - - - -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANTIPAD_SIZE - - 0 - - 0 - - 0 - - 1 - m_AntipadSizeValue - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - Clearance between pads in the same net and filled areas. - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxTOP|wxRIGHT|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Spoke width - - 0 - - - 0 - - 1 - m_CopperBridgeWidthText - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - - - -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_COPPER_BRIDGE_VALUE - - 0 - - 0 - - 0 - - 1 - m_CopperWidthValue - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - Width of copper in thermal reliefs. - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxEXPAND - 0 - - - m_MiddleBox - wxVERTICAL - none - - 5 - wxRIGHT|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Priority level: - - 0 - - - 0 - - 1 - m_staticText171 - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - On each copper layer, zones are filled by priority order. So when a zone is inside an other zone: * If its priority is highter: its outlines are removed from the other layer. * If its priority is equal: a DRC error is set. - - - - -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxBOTTOM|wxRIGHT|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - ID_M_PRIORITYLEVELCTRL - 0 - 100 - - 0 - - 0 - - 0 - - 1 - m_PriorityLevelCtrl - 1 - - - protected - 1 - - Resizable - 1 - - wxSP_ARROW_KEYS - - 0 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxLEFT|wxRIGHT|wxTOP - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Fill mode: - - 0 - - - 0 - - 1 - m_staticText11 - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - - - -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - "Polygon" "Segment" - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - ID_M_FILLMODECTRL - - 0 - - - 0 - - 1 - m_FillModeCtrl - 1 - - - protected - 1 - - Resizable - 0 - 1 - - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxLEFT|wxRIGHT|wxTOP - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Segments / 360 deg: - - 0 - - - 0 - - 1 - m_staticText12 - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - - - -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - "16" "32" - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - ID_M_ARCAPPROXIMATIONOPT - - 0 - - - 0 - - 1 - m_ArcApproximationOpt - 1 - - - protected - 1 - - Resizable - 0 - 1 - - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxEXPAND - 0 - - - bSizer81 - wxVERTICAL - none - - 5 - wxLEFT|wxRIGHT|wxTOP - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Outline slope: - - 0 - - - 0 - - 1 - m_staticText14 - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - - - -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - "Arbitrary" "H, V, and 45 deg only" - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - ID_M_ORIENTEDGESOPT - - 0 - - - 0 - - 1 - m_OrientEdgesOpt - 1 - - - protected - 1 - - Resizable - 0 - 1 - - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxLEFT|wxRIGHT|wxTOP - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Outline style: - - 0 - - - 0 - - 1 - m_staticText15 - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - - - -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - "Line" "Hatched" "Fully hatched" - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - ID_M_OUTLINEAPPEARANCECTRL - - 0 - - - 0 - - 1 - m_OutlineAppearanceCtrl - 1 - - - protected - 1 - - Resizable - 0 - 1 - - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALIGN_RIGHT|wxALL - 0 - - - bSizer10 - wxHORIZONTAL - none - - 5 - wxALL|wxEXPAND - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_BUTTON_EXPORT - Export Settings to Other Zones - - 0 - - - 0 - - 1 - m_ExportSetupButton - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - Export this zone setup (excluding layer and net selection) to all other copper zones. - - wxFILTER_NONE - wxDefaultValidator - - - - - ExportSetupToOtherCopperZones - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL|wxEXPAND - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_OK - Ok - - 0 - - - 0 - - 1 - m_OkButton - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - OnButtonOkClick - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL|wxEXPAND - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_CANCEL - Cancel - - 0 - - - 0 - - 1 - m_ButtonCancel - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - OnButtonCancelClick - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + C++ + 1 + source_name + 0 + 0 + res + UTF-8 + table + dialog_copper_zones_base + 1000 + none + 1 + dialog_copper_zones_base + + . + + 1 + 1 + 1 + 1 + 0 + + 1 + 1 + 1 + 1 + + 0 + + + + + + + 1 + + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + impl_virtual + + + 1 + + 0 + 0 + ID_DIALOG_COPPER_ZONE_BASE + + 0 + + + 0 + + 1 + DIALOG_COPPER_ZONE_BASE + 1 + + + 1 + + Resizable + 1 + 567,500 + wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER + DIALOG_SHIM; dialog_shim.h + Zone Properties + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + OnClose + + + + + + + + + + + + + + + + + + + + + + + + + OnSize + + + + m_MainBoxSizer + wxVERTICAL + protected + + 5 + wxALL|wxEXPAND + 1 + + + m_OptionsBoxSizer + wxHORIZONTAL + none + + 5 + wxEXPAND + 1 + + + m_layerSizer + wxVERTICAL + none + + 5 + wxLEFT|wxRIGHT|wxTOP + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Layer: + + 0 + + + 0 + + 1 + m_staticText17 + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + + 1 + m_LayerSelectionCtrl + 1 + + + protected + 1 + + Resizable + 1 + + wxLC_ALIGN_LEFT|wxLC_NO_HEADER|wxLC_REPORT|wxLC_SINGLE_SEL|wxLC_SMALL_ICON + wxListView; + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND + 1 + + + bSizer7 + wxVERTICAL + none + + 5 + wxTOP|wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Net: + + 0 + + + 0 + + 1 + m_staticText2 + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + ID_NETNAME_SELECTION + + 0 + + + 0 + -1,-1 + 1 + m_ListNetNameSelection + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL + 0 + + wxID_ANY + Net Filtering + + m_NetSortOptSizer + wxVERTICAL + none + + + 5 + wxLEFT|wxRIGHT|wxTOP + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Display: + + 0 + + + 0 + + 1 + m_staticText16 + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + "Show all (alphabetical)" "Show all (advanced)" "Filtered (alphabetical)" "Filtered (advanced)" + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + ID_M_NETDISPLAYOPTION + + 0 + + + 0 + + 1 + m_NetDisplayOption + 1 + + + protected + 1 + + Resizable + 0 + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + OnNetSortingOptionSelected + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxTOP|wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Hidden net filter: + + 0 + + + 0 + + 1 + m_staticText5 + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + ID_TEXTCTRL_NETNAMES_FILTER + + 0 + + 0 + + 0 + + 1 + m_DoNotShowNetNameFilter + 1 + + + protected + 1 + + Resizable + 1 + + wxTE_PROCESS_ENTER + + 0 + Pattern to filter net names in filtered list. Net names matching this pattern are not displayed. + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + OnRunFiltersButtonClick + + + + + + + 5 + wxTOP|wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Visible net filter: + + 0 + + + 0 + + 1 + m_staticText51 + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + ID_TEXTCTRL_NETNAMES_FILTER + + 0 + + 0 + + 0 + + 1 + m_ShowNetNameFilter + 1 + + + protected + 1 + + Resizable + 1 + + wxTE_PROCESS_ENTER + + 0 + Pattern to filter net names in filtered list. Only net names matching this pattern are displayed. + + wxFILTER_NONE + wxDefaultValidator + + * + + + + + + + + + + + + + + + + + + + + + + + + + + + OnRunFiltersButtonClick + + + + + + + 5 + wxALL|wxEXPAND + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_APPLY_FILTERS + Apply Filters + + 0 + + + 0 + + 1 + m_buttonRunFilter + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + OnRunFiltersButtonClick + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL|wxEXPAND + 0 + + wxID_ANY + Settings + + m_ExportableSetupSizer + wxHORIZONTAL + none + + + 5 + wxEXPAND + 0 + + + bSizer9 + wxVERTICAL + none + + 5 + wxTOP|wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Clearance + + 0 + + + 0 + + 1 + m_ClearanceValueTitle + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + 0 + + 0 + + 1 + m_ZoneClearanceCtrl + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxTOP|wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Minimum width + + 0 + + + 0 + + 1 + m_MinThicknessValueTitle + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + Minimun thickness of filled areas. + + wxFILTER_NONE + wxDefaultValidator + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + 0 + + 0 + + 1 + m_ZoneMinThicknessCtrl + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxLEFT|wxRIGHT|wxTOP + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Corner smoothing: + + 0 + + + 0 + + 1 + m_staticText151 + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + "None" "Chamfer" "Fillet" + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + ID_CORNER_SMOOTHING + + 0 + + + 0 + + 1 + m_cornerSmoothingChoice + 1 + + + protected + 1 + + Resizable + 0 + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + OnCornerSmoothingModeChoice + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Chamfer distance (mm): + + 0 + + + 0 + + 1 + m_cornerSmoothingTitle + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + ID_M_CORNERSMOOTHINGCTRL + + 0 + + 0 + + 0 + + 1 + m_cornerSmoothingCtrl + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND + 0 + + + m_LeftBox + wxVERTICAL + none + + 5 + wxLEFT|wxRIGHT|wxTOP + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Pad connection: + + 0 + + + 0 + + 1 + m_staticText13 + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + "Solid" "Thermal relief" "THT thermal" "None" + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + ID_M_PADINZONEOPT + + 0 + + + 0 + + 1 + m_PadInZoneOpt + 1 + + + protected + 1 + + Resizable + 0 + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + OnPadsInZoneClick + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL|wxEXPAND + 0 + + wxID_ANY + Thermal Reliefs + + m_ThermalShapesParamsSizer + wxVERTICAL + none + + + 5 + wxLEFT|wxRIGHT|wxTOP + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Antipad clearance + + 0 + + + 0 + + 1 + m_AntipadSizeText + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANTIPAD_SIZE + + 0 + + 0 + + 0 + + 1 + m_AntipadSizeValue + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + Clearance between pads in the same net and filled areas. + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxTOP|wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Spoke width + + 0 + + + 0 + + 1 + m_CopperBridgeWidthText + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_COPPER_BRIDGE_VALUE + + 0 + + 0 + + 0 + + 1 + m_CopperWidthValue + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + Width of copper in thermal reliefs. + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND + 0 + + + m_MiddleBox + wxVERTICAL + none + + 5 + wxTOP|wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Priority level: + + 0 + + + 0 + + 1 + m_staticText171 + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + On each copper layer, zones are filled by priority order. So when a zone is inside an other zone: * If its priority is highter: its outlines are removed from the other layer. * If its priority is equal: a DRC error is set. + + wxFILTER_NONE + wxDefaultValidator + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxBOTTOM|wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + ID_M_PRIORITYLEVELCTRL + 0 + 100 + + 0 + + 0 + + 0 + + 1 + m_PriorityLevelCtrl + 1 + + + protected + 1 + + Resizable + 1 + + wxSP_ARROW_KEYS + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxLEFT|wxRIGHT|wxTOP + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Fill mode: + + 0 + + + 0 + + 1 + m_staticText11 + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + "Polygon" "Segment" + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + ID_M_FILLMODECTRL + + 0 + + + 0 + + 1 + m_FillModeCtrl + 1 + + + protected + 1 + + Resizable + 0 + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxLEFT|wxRIGHT|wxTOP + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Segments / 360 deg: + + 0 + + + 0 + + 1 + m_staticText12 + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + "16" "32" + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + ID_M_ARCAPPROXIMATIONOPT + + 0 + + + 0 + + 1 + m_ArcApproximationOpt + 1 + + + protected + 1 + + Resizable + 0 + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND + 0 + + + bSizer81 + wxVERTICAL + none + + 5 + wxLEFT|wxRIGHT|wxTOP + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Outline slope: + + 0 + + + 0 + + 1 + m_staticText14 + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + "Arbitrary" "H, V, and 45 deg only" + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + ID_M_ORIENTEDGESOPT + + 0 + + + 0 + + 1 + m_OrientEdgesOpt + 1 + + + protected + 1 + + Resizable + 0 + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxLEFT|wxRIGHT|wxTOP + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Outline style: + + 0 + + + 0 + + 1 + m_staticText15 + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + "Line" "Hatched" "Fully hatched" + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + ID_M_OUTLINEAPPEARANCECTRL + + 0 + + + 0 + + 1 + m_OutlineAppearanceCtrl + 1 + + + protected + 1 + + Resizable + 0 + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALIGN_RIGHT|wxALL + 0 + + + bSizer10 + wxHORIZONTAL + none + + 5 + wxALL|wxEXPAND + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_BUTTON_EXPORT + Export Settings to Other Zones + + 0 + + + 0 + + 1 + m_ExportSetupButton + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + Export this zone setup (excluding layer and net selection) to all other copper zones. + + wxFILTER_NONE + wxDefaultValidator + + + + + ExportSetupToOtherCopperZones + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL|wxEXPAND + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_OK + Ok + + 0 + + + 0 + + 1 + m_OkButton + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + OnButtonOkClick + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL|wxEXPAND + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_CANCEL + Cancel + + 0 + + + 0 + + 1 + m_ButtonCancel + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + OnButtonCancelClick + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/pcbnew/dialogs/dialog_copper_zones_base.h b/pcbnew/dialogs/dialog_copper_zones_base.h index b48bfc2c77..ec77cbeb36 100644 --- a/pcbnew/dialogs/dialog_copper_zones_base.h +++ b/pcbnew/dialogs/dialog_copper_zones_base.h @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Apr 10 2012) +// C++ code generated with wxFormBuilder (version Mar 17 2012) // http://www.wxformbuilder.org/ // // PLEASE DO "NOT" EDIT THIS FILE! @@ -18,6 +18,7 @@ #include #include #include +#include #include #include #include @@ -71,8 +72,8 @@ class DIALOG_COPPER_ZONE_BASE : public DIALOG_SHIM }; wxBoxSizer* m_MainBoxSizer; - wxBoxSizer* m_layerSizer; wxStaticText* m_staticText17; + wxListView* m_LayerSelectionCtrl; wxStaticText* m_staticText2; wxListBox* m_ListNetNameSelection; wxStaticText* m_staticText16; @@ -124,7 +125,7 @@ class DIALOG_COPPER_ZONE_BASE : public DIALOG_SHIM public: - DIALOG_COPPER_ZONE_BASE( wxWindow* parent, wxWindowID id = ID_DIALOG_COPPER_ZONE_BASE, const wxString& title = _("Zone Properties"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 550,500 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); + DIALOG_COPPER_ZONE_BASE( wxWindow* parent, wxWindowID id = ID_DIALOG_COPPER_ZONE_BASE, const wxString& title = _("Zone Properties"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 567,500 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); ~DIALOG_COPPER_ZONE_BASE(); }; diff --git a/pcbnew/dialogs/dialog_drc.cpp b/pcbnew/dialogs/dialog_drc.cpp index d32cc939a8..a8d7690caf 100644 --- a/pcbnew/dialogs/dialog_drc.cpp +++ b/pcbnew/dialogs/dialog_drc.cpp @@ -163,9 +163,10 @@ void DIALOG_DRC_CONTROL::OnStartdrcClick( wxCommandEvent& event ) SetDrcParmeters(); m_tester->SetSettings( true, // Pad to pad DRC test enabled - true, // unconnected pdas DRC test enabled - true, // DRC test for zones enabled - reportName, m_CreateRptCtrl->IsChecked() ); + true, // unconnected pdas DRC test enabled + true, // DRC test for zones enabled + true, // DRC test for keepout areas enabled + reportName, m_CreateRptCtrl->IsChecked() ); DelDRCMarkers(); @@ -241,9 +242,10 @@ void DIALOG_DRC_CONTROL::OnListUnconnectedClick( wxCommandEvent& event ) SetDrcParmeters(); m_tester->SetSettings( true, // Pad to pad DRC test enabled - true, // unconnected pdas DRC test enabled - true, // DRC test for zones enabled - reportName, m_CreateRptCtrl->IsChecked() ); + true, // unconnected pdas DRC test enabled + true, // DRC test for zones enabled + true, // DRC test for keepout areas enabled + reportName, m_CreateRptCtrl->IsChecked() ); DelDRCMarkers(); diff --git a/pcbnew/dialogs/dialog_keepout_area_properties.cpp b/pcbnew/dialogs/dialog_keepout_area_properties.cpp new file mode 100644 index 0000000000..8a04849cdc --- /dev/null +++ b/pcbnew/dialogs/dialog_keepout_area_properties.cpp @@ -0,0 +1,277 @@ +/** + * @file dialog_keepout_area_properties.cpp + */ + +/* + * This program source code file is part of KiCad, a free EDA CAD application. + * + * Copyright (C) 2012 Jean-Pierre Charras, jean-pierre.charras@ujf-grenoble.fr + * Copyright (C) 2012 SoftPLC Corporation, Dick Hollenbeck + * Copyright (C) 1992-2012 KiCad Developers, see AUTHORS.txt for contributors. + * + * 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, you may find one here: + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * or you may search the http://www.gnu.org website for the version 2 license, + * or you may write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include // needed for wx/listctrl.h, in wxGTK 2.8.12 +#include + + + +/** + * Class DIALOG_KEEPOUT_AREA_PROPERTIES + * is the derived class from dialog_copper_zone_frame created by wxFormBuilder + */ +class DIALOG_KEEPOUT_AREA_PROPERTIES : public DIALOG_KEEPOUT_AREA_PROPERTIES_BASE +{ +public: + DIALOG_KEEPOUT_AREA_PROPERTIES( PCB_BASE_FRAME* aParent, ZONE_SETTINGS* aSettings ); + +private: + PCB_BASE_FRAME* m_Parent; + wxConfig* m_Config; ///< Current config + ZONE_SETTINGS m_zonesettings; + ZONE_SETTINGS* m_ptr; + + std::vector m_LayerId; ///< Handle the real layer number from layer + ///< name position in m_LayerSelectionCtrl + + /** + * Function initDialog + * fills in the dialog controls using the current settings. + */ + void initDialog(); + + void OnOkClick( wxCommandEvent& event ); + void OnCancelClick( wxCommandEvent& event ); + void OnSize( wxSizeEvent& event ); + + /** + * Function AcceptOptionsForKeepOut + * Test validity of options, and copy options in m_zonesettings, for keepout zones + * @return bool - false if incorrect options, true if ok. + */ + bool AcceptOptionsForKeepOut(); + + /** + * Function makeLayerBitmap + * creates the colored rectangle bitmaps used in the layer selection widget. + * @param aColor is the color to fill the rectangle with. + */ + wxBitmap makeLayerBitmap( int aColor ); +}; + + +#define LAYER_BITMAP_SIZE_X 20 +#define LAYER_BITMAP_SIZE_Y 10 + +ZONE_EDIT_T InvokeKeepoutAreaEditor( PCB_BASE_FRAME* aCaller, ZONE_SETTINGS* aSettings ) +{ + DIALOG_KEEPOUT_AREA_PROPERTIES dlg( aCaller, aSettings ); + + ZONE_EDIT_T result = ZONE_EDIT_T( dlg.ShowModal() ); + + return result; +} + + +DIALOG_KEEPOUT_AREA_PROPERTIES::DIALOG_KEEPOUT_AREA_PROPERTIES( PCB_BASE_FRAME* aParent, ZONE_SETTINGS* aSettings ) : + DIALOG_KEEPOUT_AREA_PROPERTIES_BASE( aParent ) +{ + m_Parent = aParent; + m_Config = wxGetApp().GetSettings(); + + m_ptr = aSettings; + m_zonesettings = *aSettings; + + SetReturnCode( ZONE_ABORT ); // Will be changed on button OK ckick + + initDialog(); + + GetSizer()->SetSizeHints( this ); +} + + +void DIALOG_KEEPOUT_AREA_PROPERTIES::initDialog() +{ + BOARD* board = m_Parent->GetBoard(); + + wxString msg; + + if( m_zonesettings.m_Zone_45_Only ) + m_OrientEdgesOpt->SetSelection( 1 ); + + switch( m_zonesettings.m_Zone_HatchingStyle ) + { + case CPolyLine::NO_HATCH: + m_OutlineAppearanceCtrl->SetSelection( 0 ); + break; + + case CPolyLine::DIAGONAL_EDGE: + m_OutlineAppearanceCtrl->SetSelection( 1 ); + break; + + case CPolyLine::DIAGONAL_FULL: + m_OutlineAppearanceCtrl->SetSelection( 2 ); + break; + } + + // Create one column in m_LayerSelectionCtrl + wxListItem col0; + col0.SetId( 0 ); + m_LayerSelectionCtrl->InsertColumn( 0, col0 ); + // Build copper layer list and append to layer widget + int layerCount = board->GetCopperLayerCount(); + int layerNumber, itemIndex, layerColor; + wxImageList* imageList = new wxImageList( LAYER_BITMAP_SIZE_X, LAYER_BITMAP_SIZE_Y ); + m_LayerSelectionCtrl->AssignImageList( imageList, wxIMAGE_LIST_SMALL ); + for( int ii = 0; ii < layerCount; ii++ ) + { + layerNumber = LAYER_N_BACK; + + if( layerCount <= 1 || ii < layerCount - 1 ) + layerNumber = ii; + else if( ii == layerCount - 1 ) + layerNumber = LAYER_N_FRONT; + + m_LayerId.insert( m_LayerId.begin(), layerNumber ); + + msg = board->GetLayerName( layerNumber ); + layerColor = board->GetLayerColor( layerNumber ); + imageList->Add( makeLayerBitmap( layerColor ) ); + itemIndex = m_LayerSelectionCtrl->InsertItem( 0, msg, ii ); + + if( m_zonesettings.m_CurrentZone_Layer == layerNumber ) + m_LayerSelectionCtrl->Select( itemIndex ); + } + + // Init keepout parameters: + m_cbTracksCtrl->SetValue( m_zonesettings.GetDoNotAllowTracks() ); + m_cbViasCtrl->SetValue( m_zonesettings.GetDoNotAllowVias() ); + m_cbPadsCtrl->SetValue( m_zonesettings.GetDoNotAllowPads() ); +} + +void DIALOG_KEEPOUT_AREA_PROPERTIES::OnCancelClick( wxCommandEvent& event ) +{ + EndModal( ZONE_ABORT ); +} + +void DIALOG_KEEPOUT_AREA_PROPERTIES::OnOkClick( wxCommandEvent& event ) +{ + if( AcceptOptionsForKeepOut() ) + { + *m_ptr = m_zonesettings; + EndModal( ZONE_OK ); + } +} + + +void DIALOG_KEEPOUT_AREA_PROPERTIES::OnSize( wxSizeEvent& event ) +{ + Layout(); + + // Set layer list column width to widget width minus a few pixels + m_LayerSelectionCtrl->SetColumnWidth( 0, m_LayerSelectionCtrl->GetSize().x - 5 ); + event.Skip(); +} + +bool DIALOG_KEEPOUT_AREA_PROPERTIES::AcceptOptionsForKeepOut() +{ + // Init keepout parameters: + m_zonesettings.SetIsKeepout( true ); + m_zonesettings.SetDoNotAllowTracks( m_cbTracksCtrl->GetValue() ); + m_zonesettings.SetDoNotAllowVias( m_cbViasCtrl->GetValue() ); + m_zonesettings.SetDoNotAllowPads( m_cbPadsCtrl->GetValue() ); + + // Test for not allowed items: should have at least one item not allowed: + if( ! m_zonesettings.GetDoNotAllowTracks() && + ! m_zonesettings.GetDoNotAllowVias() && + ! m_zonesettings.GetDoNotAllowPads() ) + { + DisplayError( NULL, + _("Tracks, vias and pads are allowed. The keepout is useless" ) ); + return false; + } + + // Get the layer selection for this zone + int ii = m_LayerSelectionCtrl->GetFirstSelected(); + + if( ii < 0 ) + { + DisplayError( NULL, _( "No layer selected." ) ); + return false; + } + + m_zonesettings.m_CurrentZone_Layer = m_LayerId[ii]; + switch( m_OutlineAppearanceCtrl->GetSelection() ) + { + case 0: + m_zonesettings.m_Zone_HatchingStyle = CPolyLine::NO_HATCH; + break; + + case 1: + m_zonesettings.m_Zone_HatchingStyle = CPolyLine::DIAGONAL_EDGE; + break; + + case 2: + m_zonesettings.m_Zone_HatchingStyle = CPolyLine::DIAGONAL_FULL; + break; + } + + if( m_Config ) + { + m_Config->Write( ZONE_NET_OUTLINES_HATCH_OPTION_KEY, + (long) m_zonesettings.m_Zone_HatchingStyle ); + } + + if( m_OrientEdgesOpt->GetSelection() == 0 ) + m_zonesettings.m_Zone_45_Only = false; + else + m_zonesettings.m_Zone_45_Only = true; + + m_zonesettings.m_ZonePriority = 0; //m_PriorityLevelCtrl->GetValue(); + + return true; +} + +wxBitmap DIALOG_KEEPOUT_AREA_PROPERTIES::makeLayerBitmap( int aColor ) +{ + wxBitmap bitmap( LAYER_BITMAP_SIZE_X, LAYER_BITMAP_SIZE_Y ); + wxBrush brush; + wxMemoryDC iconDC; + + iconDC.SelectObject( bitmap ); + brush.SetColour( MakeColour( aColor ) ); + brush.SetStyle( wxSOLID ); + iconDC.SetBrush( brush ); + iconDC.DrawRectangle( 0, 0, LAYER_BITMAP_SIZE_X, LAYER_BITMAP_SIZE_Y ); + + return bitmap; +} diff --git a/pcbnew/dialogs/dialog_keepout_area_properties_base.cpp b/pcbnew/dialogs/dialog_keepout_area_properties_base.cpp new file mode 100644 index 0000000000..01340b0856 --- /dev/null +++ b/pcbnew/dialogs/dialog_keepout_area_properties_base.cpp @@ -0,0 +1,103 @@ +/////////////////////////////////////////////////////////////////////////// +// C++ code generated with wxFormBuilder (version Apr 10 2012) +// http://www.wxformbuilder.org/ +// +// PLEASE DO "NOT" EDIT THIS FILE! +/////////////////////////////////////////////////////////////////////////// + +#include "dialog_keepout_area_properties_base.h" + +/////////////////////////////////////////////////////////////////////////// + +BEGIN_EVENT_TABLE( DIALOG_KEEPOUT_AREA_PROPERTIES_BASE, DIALOG_SHIM ) + EVT_BUTTON( wxID_CANCEL, DIALOG_KEEPOUT_AREA_PROPERTIES_BASE::_wxFB_OnCancelClick ) + EVT_BUTTON( wxID_OK, DIALOG_KEEPOUT_AREA_PROPERTIES_BASE::_wxFB_OnOkClick ) +END_EVENT_TABLE() + +DIALOG_KEEPOUT_AREA_PROPERTIES_BASE::DIALOG_KEEPOUT_AREA_PROPERTIES_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : DIALOG_SHIM( parent, id, title, pos, size, style ) +{ + this->SetSizeHints( wxDefaultSize, wxDefaultSize ); + + wxBoxSizer* m_MainSizer; + m_MainSizer = new wxBoxSizer( wxVERTICAL ); + + wxBoxSizer* m_UpperSizer; + m_UpperSizer = new wxBoxSizer( wxHORIZONTAL ); + + wxBoxSizer* m_layersListSizer; + m_layersListSizer = new wxBoxSizer( wxVERTICAL ); + + m_staticTextLayerSelection = new wxStaticText( this, wxID_ANY, _("Layer selection:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextLayerSelection->Wrap( -1 ); + m_layersListSizer->Add( m_staticTextLayerSelection, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); + + m_LayerSelectionCtrl = new wxListView( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_ALIGN_LEFT|wxLC_ICON|wxLC_NO_HEADER|wxLC_REPORT|wxLC_SINGLE_SEL|wxLC_SMALL_ICON ); + m_layersListSizer->Add( m_LayerSelectionCtrl, 1, wxALL|wxEXPAND, 5 ); + + + m_UpperSizer->Add( m_layersListSizer, 1, wxEXPAND, 5 ); + + wxBoxSizer* bSizerRight; + bSizerRight = new wxBoxSizer( wxVERTICAL ); + + wxStaticBoxSizer* m_OutilinesBoxOpt; + m_OutilinesBoxOpt = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Outlines Options:") ), wxVERTICAL ); + + wxString m_OrientEdgesOptChoices[] = { _("Any"), _("H, V and 45 deg") }; + int m_OrientEdgesOptNChoices = sizeof( m_OrientEdgesOptChoices ) / sizeof( wxString ); + m_OrientEdgesOpt = new wxRadioBox( this, wxID_ANY, _("Zone Edges Orient"), wxDefaultPosition, wxDefaultSize, m_OrientEdgesOptNChoices, m_OrientEdgesOptChoices, 1, wxRA_SPECIFY_COLS ); + m_OrientEdgesOpt->SetSelection( 0 ); + m_OutilinesBoxOpt->Add( m_OrientEdgesOpt, 0, wxALL|wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); + + wxString m_OutlineAppearanceCtrlChoices[] = { _("Line"), _("Hatched Outline"), _("Full Hatched") }; + int m_OutlineAppearanceCtrlNChoices = sizeof( m_OutlineAppearanceCtrlChoices ) / sizeof( wxString ); + m_OutlineAppearanceCtrl = new wxRadioBox( this, wxID_ANY, _("Outlines Appearence"), wxDefaultPosition, wxDefaultSize, m_OutlineAppearanceCtrlNChoices, m_OutlineAppearanceCtrlChoices, 1, wxRA_SPECIFY_COLS ); + m_OutlineAppearanceCtrl->SetSelection( 1 ); + m_OutilinesBoxOpt->Add( m_OutlineAppearanceCtrl, 0, wxALL|wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); + + + bSizerRight->Add( m_OutilinesBoxOpt, 0, wxEXPAND|wxALL, 5 ); + + wxStaticBoxSizer* sbSizerCutoutOpts; + sbSizerCutoutOpts = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Keepout Options:") ), wxVERTICAL ); + + m_cbTracksCtrl = new wxCheckBox( this, wxID_ANY, _("No Tracks"), wxDefaultPosition, wxDefaultSize, 0 ); + sbSizerCutoutOpts->Add( m_cbTracksCtrl, 0, wxTOP|wxRIGHT|wxLEFT|wxEXPAND, 5 ); + + m_cbViasCtrl = new wxCheckBox( this, wxID_ANY, _("No Vias"), wxDefaultPosition, wxDefaultSize, 0 ); + sbSizerCutoutOpts->Add( m_cbViasCtrl, 0, wxTOP|wxRIGHT|wxLEFT|wxEXPAND, 5 ); + + m_cbPadsCtrl = new wxCheckBox( this, wxID_ANY, _("No Pads"), wxDefaultPosition, wxDefaultSize, 0 ); + sbSizerCutoutOpts->Add( m_cbPadsCtrl, 0, wxALL|wxEXPAND, 5 ); + + + bSizerRight->Add( sbSizerCutoutOpts, 0, wxEXPAND|wxALL, 5 ); + + + m_UpperSizer->Add( bSizerRight, 0, wxEXPAND, 5 ); + + + m_MainSizer->Add( m_UpperSizer, 1, wxEXPAND|wxALIGN_CENTER_HORIZONTAL, 5 ); + + m_staticline1 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); + m_MainSizer->Add( m_staticline1, 0, wxEXPAND | wxALL, 5 ); + + m_sdbSizerButtons = new wxStdDialogButtonSizer(); + m_sdbSizerButtonsOK = new wxButton( this, wxID_OK ); + m_sdbSizerButtons->AddButton( m_sdbSizerButtonsOK ); + m_sdbSizerButtonsCancel = new wxButton( this, wxID_CANCEL ); + m_sdbSizerButtons->AddButton( m_sdbSizerButtonsCancel ); + m_sdbSizerButtons->Realize(); + + m_MainSizer->Add( m_sdbSizerButtons, 0, wxEXPAND, 5 ); + + + this->SetSizer( m_MainSizer ); + this->Layout(); + + this->Centre( wxBOTH ); +} + +DIALOG_KEEPOUT_AREA_PROPERTIES_BASE::~DIALOG_KEEPOUT_AREA_PROPERTIES_BASE() +{ +} diff --git a/pcbnew/dialogs/dialog_keepout_area_properties_base.fbp b/pcbnew/dialogs/dialog_keepout_area_properties_base.fbp new file mode 100644 index 0000000000..93aefed21e --- /dev/null +++ b/pcbnew/dialogs/dialog_keepout_area_properties_base.fbp @@ -0,0 +1,897 @@ + + + + + + C++ + 1 + source_name + 0 + 0 + res + UTF-8 + table + dialog_keepout_area_properties_base + 1000 + none + 1 + dialog_keepout_areas_properties_base + + . + + 1 + 1 + 1 + 1 + 0 + + 0 + wxAUI_MGR_DEFAULT + + wxBOTH + + 1 + 1 + impl_virtual + + + + 0 + wxID_ANY + + + DIALOG_KEEPOUT_AREA_PROPERTIES_BASE + + 308,355 + wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER + DIALOG_SHIM; dialog_shim.h + Keepout Area Properties + + + + wxFULL_REPAINT_ON_RESIZE|wxSUNKEN_BORDER + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + m_MainSizer + wxVERTICAL + none + + 5 + wxEXPAND|wxALIGN_CENTER_HORIZONTAL + 1 + + + m_UpperSizer + wxHORIZONTAL + none + + 5 + wxEXPAND + 1 + + + m_layersListSizer + wxVERTICAL + none + + 5 + wxTOP|wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Layer selection: + + 0 + + + 0 + + 1 + m_staticTextLayerSelection + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL|wxEXPAND + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + + 1 + m_LayerSelectionCtrl + 1 + + + protected + 1 + + Resizable + 1 + + wxLC_ALIGN_LEFT|wxLC_ICON|wxLC_NO_HEADER|wxLC_REPORT|wxLC_SINGLE_SEL|wxLC_SMALL_ICON + wxListView; + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND + 0 + + + bSizerRight + wxVERTICAL + none + + 5 + wxEXPAND|wxALL + 0 + + wxID_ANY + Outlines Options: + + m_OutilinesBoxOpt + wxVERTICAL + none + + + 5 + wxALL|wxALIGN_CENTER_VERTICAL|wxEXPAND + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + "Any" "H, V and 45 deg" + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Zone Edges Orient + 1 + + 0 + + + 0 + + 1 + m_OrientEdgesOpt + 1 + + + protected + 1 + + Resizable + 0 + 1 + + wxRA_SPECIFY_COLS + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL|wxALIGN_CENTER_VERTICAL|wxEXPAND + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + "Line" "Hatched Outline" "Full Hatched" + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Outlines Appearence + 1 + + 0 + + + 0 + + 1 + m_OutlineAppearanceCtrl + 1 + + + protected + 1 + + Resizable + 1 + 1 + + wxRA_SPECIFY_COLS + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND|wxALL + 0 + + wxID_ANY + Keepout Options: + + sbSizerCutoutOpts + wxVERTICAL + none + + + 5 + wxTOP|wxRIGHT|wxLEFT|wxEXPAND + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + No Tracks + + 0 + + + 0 + + 1 + m_cbTracksCtrl + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxTOP|wxRIGHT|wxLEFT|wxEXPAND + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + No Vias + + 0 + + + 0 + + 1 + m_cbViasCtrl + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL|wxEXPAND + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + No Pads + + 0 + + + 0 + + 1 + m_cbPadsCtrl + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND | wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + + 1 + m_staticline1 + 1 + + + protected + 1 + + Resizable + 1 + + wxLI_HORIZONTAL + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND + 0 + + 0 + 1 + 0 + 0 + 0 + 1 + 0 + 0 + + m_sdbSizerButtons + protected + + OnCancelClick + + + + OnOkClick + + + + + + + + diff --git a/pcbnew/dialogs/dialog_keepout_area_properties_base.h b/pcbnew/dialogs/dialog_keepout_area_properties_base.h new file mode 100644 index 0000000000..ac1aa7c18e --- /dev/null +++ b/pcbnew/dialogs/dialog_keepout_area_properties_base.h @@ -0,0 +1,70 @@ +/////////////////////////////////////////////////////////////////////////// +// C++ code generated with wxFormBuilder (version Apr 10 2012) +// http://www.wxformbuilder.org/ +// +// PLEASE DO "NOT" EDIT THIS FILE! +/////////////////////////////////////////////////////////////////////////// + +#ifndef __DIALOG_KEEPOUT_AREA_PROPERTIES_BASE_H__ +#define __DIALOG_KEEPOUT_AREA_PROPERTIES_BASE_H__ + +#include +#include +#include +#include "dialog_shim.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/////////////////////////////////////////////////////////////////////////// + +/////////////////////////////////////////////////////////////////////////////// +/// Class DIALOG_KEEPOUT_AREA_PROPERTIES_BASE +/////////////////////////////////////////////////////////////////////////////// +class DIALOG_KEEPOUT_AREA_PROPERTIES_BASE : public DIALOG_SHIM +{ + DECLARE_EVENT_TABLE() + private: + + // Private event handlers + void _wxFB_OnCancelClick( wxCommandEvent& event ){ OnCancelClick( event ); } + void _wxFB_OnOkClick( wxCommandEvent& event ){ OnOkClick( event ); } + + + protected: + wxStaticText* m_staticTextLayerSelection; + wxListView* m_LayerSelectionCtrl; + wxRadioBox* m_OrientEdgesOpt; + wxRadioBox* m_OutlineAppearanceCtrl; + wxCheckBox* m_cbTracksCtrl; + wxCheckBox* m_cbViasCtrl; + wxCheckBox* m_cbPadsCtrl; + wxStaticLine* m_staticline1; + wxStdDialogButtonSizer* m_sdbSizerButtons; + wxButton* m_sdbSizerButtonsOK; + wxButton* m_sdbSizerButtonsCancel; + + // Virtual event handlers, overide them in your derived class + virtual void OnCancelClick( wxCommandEvent& event ) { event.Skip(); } + virtual void OnOkClick( wxCommandEvent& event ) { event.Skip(); } + + + public: + + DIALOG_KEEPOUT_AREA_PROPERTIES_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Keepout Area Properties"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 308,355 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER|wxFULL_REPAINT_ON_RESIZE|wxSUNKEN_BORDER ); + ~DIALOG_KEEPOUT_AREA_PROPERTIES_BASE(); + +}; + +#endif //__DIALOG_KEEPOUT_AREA_PROPERTIES_BASE_H__ diff --git a/pcbnew/dialogs/dialog_non_copper_zones_properties_base.cpp b/pcbnew/dialogs/dialog_non_copper_zones_properties_base.cpp index a27b59790a..58e8edd011 100644 --- a/pcbnew/dialogs/dialog_non_copper_zones_properties_base.cpp +++ b/pcbnew/dialogs/dialog_non_copper_zones_properties_base.cpp @@ -1,96 +1,95 @@ -/////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Apr 11 2012) -// http://www.wxformbuilder.org/ -// -// PLEASE DO "NOT" EDIT THIS FILE! -/////////////////////////////////////////////////////////////////////////// - -#include "dialog_non_copper_zones_properties_base.h" - -/////////////////////////////////////////////////////////////////////////// - -BEGIN_EVENT_TABLE( DialogNonCopperZonesPropertiesBase, DIALOG_SHIM ) - EVT_BUTTON( wxID_OK, DialogNonCopperZonesPropertiesBase::_wxFB_OnOkClick ) - EVT_BUTTON( wxID_CANCEL, DialogNonCopperZonesPropertiesBase::_wxFB_OnCancelClick ) -END_EVENT_TABLE() - -DialogNonCopperZonesPropertiesBase::DialogNonCopperZonesPropertiesBase( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : DIALOG_SHIM( parent, id, title, pos, size, style ) -{ - this->SetSizeHints( wxDefaultSize, wxDefaultSize ); - - wxBoxSizer* m_MainSizer; - m_MainSizer = new wxBoxSizer( wxVERTICAL ); - - wxBoxSizer* m_UpperSizer; - m_UpperSizer = new wxBoxSizer( wxHORIZONTAL ); - - wxStaticBoxSizer* sbLeftSizer_; - sbLeftSizer_ = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Zone Fill Options:") ), wxVERTICAL ); - - wxString m_FillModeCtrlChoices[] = { _("Use polygons"), _("Use segments") }; - int m_FillModeCtrlNChoices = sizeof( m_FillModeCtrlChoices ) / sizeof( wxString ); - m_FillModeCtrl = new wxRadioBox( this, wxID_ANY, _("Filling Mode:"), wxDefaultPosition, wxDefaultSize, m_FillModeCtrlNChoices, m_FillModeCtrlChoices, 1, wxRA_SPECIFY_COLS ); - m_FillModeCtrl->SetSelection( 0 ); - sbLeftSizer_->Add( m_FillModeCtrl, 0, wxALL|wxEXPAND, 5 ); - - m_MinThicknessValueTitle = new wxStaticText( this, wxID_ANY, _("Zone min thickness value"), wxDefaultPosition, wxDefaultSize, 0 ); - m_MinThicknessValueTitle->Wrap( -1 ); - sbLeftSizer_->Add( m_MinThicknessValueTitle, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); - - m_ZoneMinThicknessCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); - sbLeftSizer_->Add( m_ZoneMinThicknessCtrl, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); - - - m_UpperSizer->Add( sbLeftSizer_, 0, 0, 5 ); - - wxStaticBoxSizer* m_OutilinesBoxOpt; - m_OutilinesBoxOpt = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Outlines Options:") ), wxVERTICAL ); - - wxString m_OrientEdgesOptChoices[] = { _("Any"), _("H, V and 45 deg") }; - int m_OrientEdgesOptNChoices = sizeof( m_OrientEdgesOptChoices ) / sizeof( wxString ); - m_OrientEdgesOpt = new wxRadioBox( this, wxID_ANY, _("Zone Edges Orient"), wxDefaultPosition, wxDefaultSize, m_OrientEdgesOptNChoices, m_OrientEdgesOptChoices, 1, wxRA_SPECIFY_COLS ); - m_OrientEdgesOpt->SetSelection( 0 ); - m_OutilinesBoxOpt->Add( m_OrientEdgesOpt, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); - - wxString m_OutlineAppearanceCtrlChoices[] = { _("Line"), _("Hatched Outline"), _("Full Hatched") }; - int m_OutlineAppearanceCtrlNChoices = sizeof( m_OutlineAppearanceCtrlChoices ) / sizeof( wxString ); - m_OutlineAppearanceCtrl = new wxRadioBox( this, wxID_ANY, _("Outlines Appearence"), wxDefaultPosition, wxDefaultSize, m_OutlineAppearanceCtrlNChoices, m_OutlineAppearanceCtrlChoices, 1, wxRA_SPECIFY_COLS ); - m_OutlineAppearanceCtrl->SetSelection( 1 ); - m_OutilinesBoxOpt->Add( m_OutlineAppearanceCtrl, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); - - - m_UpperSizer->Add( m_OutilinesBoxOpt, 0, 0, 5 ); - - wxBoxSizer* m_ButtonsSizer; - m_ButtonsSizer = new wxBoxSizer( wxVERTICAL ); - - m_buttonOk = new wxButton( this, wxID_OK, _("OK"), wxDefaultPosition, wxDefaultSize, 0 ); - m_buttonOk->SetDefault(); - m_ButtonsSizer->Add( m_buttonOk, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 ); - - m_buttonCancel = new wxButton( this, wxID_CANCEL, _("Cancel"), wxDefaultPosition, wxDefaultSize, 0 ); - m_ButtonsSizer->Add( m_buttonCancel, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 ); - - - m_UpperSizer->Add( m_ButtonsSizer, 1, wxALIGN_CENTER_VERTICAL, 5 ); - - - m_MainSizer->Add( m_UpperSizer, 1, wxEXPAND|wxALIGN_CENTER_HORIZONTAL, 5 ); - - m_staticTextLayerSelection = new wxStaticText( this, wxID_ANY, _("Layer selection:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticTextLayerSelection->Wrap( -1 ); - m_MainSizer->Add( m_staticTextLayerSelection, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); - - m_LayerSelectionCtrl = new wxListBox( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0, NULL, 0 ); - m_MainSizer->Add( m_LayerSelectionCtrl, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); - - - this->SetSizer( m_MainSizer ); - this->Layout(); - - this->Centre( wxBOTH ); -} - -DialogNonCopperZonesPropertiesBase::~DialogNonCopperZonesPropertiesBase() -{ -} +/////////////////////////////////////////////////////////////////////////// +// C++ code generated with wxFormBuilder (version Apr 10 2012) +// http://www.wxformbuilder.org/ +// +// PLEASE DO "NOT" EDIT THIS FILE! +/////////////////////////////////////////////////////////////////////////// + +#include "dialog_non_copper_zones_properties_base.h" + +/////////////////////////////////////////////////////////////////////////// + +BEGIN_EVENT_TABLE( DialogNonCopperZonesPropertiesBase, DIALOG_SHIM ) + EVT_BUTTON( wxID_CANCEL, DialogNonCopperZonesPropertiesBase::_wxFB_OnCancelClick ) + EVT_BUTTON( wxID_OK, DialogNonCopperZonesPropertiesBase::_wxFB_OnOkClick ) +END_EVENT_TABLE() + +DialogNonCopperZonesPropertiesBase::DialogNonCopperZonesPropertiesBase( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : DIALOG_SHIM( parent, id, title, pos, size, style ) +{ + this->SetSizeHints( wxDefaultSize, wxDefaultSize ); + + wxBoxSizer* m_MainSizer; + m_MainSizer = new wxBoxSizer( wxVERTICAL ); + + wxBoxSizer* m_UpperSizer; + m_UpperSizer = new wxBoxSizer( wxHORIZONTAL ); + + wxBoxSizer* bSizerLeft; + bSizerLeft = new wxBoxSizer( wxVERTICAL ); + + m_staticTextLayerSelection = new wxStaticText( this, wxID_ANY, _("Layer selection:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextLayerSelection->Wrap( -1 ); + bSizerLeft->Add( m_staticTextLayerSelection, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); + + m_LayerSelectionCtrl = new wxListBox( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0, NULL, 0 ); + bSizerLeft->Add( m_LayerSelectionCtrl, 1, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); + + + m_UpperSizer->Add( bSizerLeft, 1, wxEXPAND, 5 ); + + wxBoxSizer* bSizerRight; + bSizerRight = new wxBoxSizer( wxVERTICAL ); + + wxStaticBoxSizer* m_OutilinesBoxOpt; + m_OutilinesBoxOpt = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Outlines Options:") ), wxVERTICAL ); + + wxString m_OrientEdgesOptChoices[] = { _("Any"), _("H, V and 45 deg") }; + int m_OrientEdgesOptNChoices = sizeof( m_OrientEdgesOptChoices ) / sizeof( wxString ); + m_OrientEdgesOpt = new wxRadioBox( this, wxID_ANY, _("Zone Edges Orient"), wxDefaultPosition, wxDefaultSize, m_OrientEdgesOptNChoices, m_OrientEdgesOptChoices, 1, wxRA_SPECIFY_COLS ); + m_OrientEdgesOpt->SetSelection( 0 ); + m_OutilinesBoxOpt->Add( m_OrientEdgesOpt, 0, wxALL|wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); + + wxString m_OutlineAppearanceCtrlChoices[] = { _("Line"), _("Hatched Outline"), _("Full Hatched") }; + int m_OutlineAppearanceCtrlNChoices = sizeof( m_OutlineAppearanceCtrlChoices ) / sizeof( wxString ); + m_OutlineAppearanceCtrl = new wxRadioBox( this, wxID_ANY, _("Outlines Appearence"), wxDefaultPosition, wxDefaultSize, m_OutlineAppearanceCtrlNChoices, m_OutlineAppearanceCtrlChoices, 1, wxRA_SPECIFY_COLS ); + m_OutlineAppearanceCtrl->SetSelection( 1 ); + m_OutilinesBoxOpt->Add( m_OutlineAppearanceCtrl, 0, wxALL|wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); + + + bSizerRight->Add( m_OutilinesBoxOpt, 0, wxEXPAND|wxALL, 5 ); + + m_MinThicknessValueTitle = new wxStaticText( this, wxID_ANY, _("Zone min thickness value"), wxDefaultPosition, wxDefaultSize, 0 ); + m_MinThicknessValueTitle->Wrap( -1 ); + bSizerRight->Add( m_MinThicknessValueTitle, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); + + m_ZoneMinThicknessCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + bSizerRight->Add( m_ZoneMinThicknessCtrl, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); + + + m_UpperSizer->Add( bSizerRight, 0, wxEXPAND, 5 ); + + + m_MainSizer->Add( m_UpperSizer, 1, wxEXPAND|wxALIGN_CENTER_HORIZONTAL, 5 ); + + m_staticline1 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); + m_MainSizer->Add( m_staticline1, 0, wxEXPAND | wxALL, 5 ); + + m_sdbSizerButtons = new wxStdDialogButtonSizer(); + m_sdbSizerButtonsOK = new wxButton( this, wxID_OK ); + m_sdbSizerButtons->AddButton( m_sdbSizerButtonsOK ); + m_sdbSizerButtonsCancel = new wxButton( this, wxID_CANCEL ); + m_sdbSizerButtons->AddButton( m_sdbSizerButtonsCancel ); + m_sdbSizerButtons->Realize(); + + m_MainSizer->Add( m_sdbSizerButtons, 0, wxEXPAND, 5 ); + + + this->SetSizer( m_MainSizer ); + this->Layout(); + + this->Centre( wxBOTH ); +} + +DialogNonCopperZonesPropertiesBase::~DialogNonCopperZonesPropertiesBase() +{ +} diff --git a/pcbnew/dialogs/dialog_non_copper_zones_properties_base.fbp b/pcbnew/dialogs/dialog_non_copper_zones_properties_base.fbp index 6562e17508..2e0cdbdb28 100644 --- a/pcbnew/dialogs/dialog_non_copper_zones_properties_base.fbp +++ b/pcbnew/dialogs/dialog_non_copper_zones_properties_base.fbp @@ -1,938 +1,776 @@ - - - - - - C++ - 1 - source_name - 0 - 0 - res - UTF-8 - table - dialog_non_copper_zones_properties_base - 1000 - none - 1 - dialog_non_copper_zones_properties_base - - . - - 1 - 1 - 1 - 1 - 0 - - 0 - wxAUI_MGR_DEFAULT - - wxBOTH - - 1 - 1 - impl_virtual - - - - 0 - wxID_ANY - - - DialogNonCopperZonesPropertiesBase - - 416,287 - wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER - DIALOG_SHIM; dialog_shim.h - Non Copper Zones Properties - - - - wxFULL_REPAINT_ON_RESIZE|wxSUNKEN_BORDER - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - m_MainSizer - wxVERTICAL - none - - 5 - wxEXPAND|wxALIGN_CENTER_HORIZONTAL - 1 - - - m_UpperSizer - wxHORIZONTAL - none - - 5 - - 0 - - wxID_ANY - Zone Fill Options: - - sbLeftSizer_ - wxVERTICAL - none - - - 5 - wxALL|wxEXPAND - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - "Use polygons" "Use segments" - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Filling Mode: - 1 - - 0 - - - 0 - - 1 - m_FillModeCtrl - 1 - - - protected - 1 - - Resizable - 0 - 1 - - wxRA_SPECIFY_COLS - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxTOP|wxRIGHT|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Zone min thickness value - - 0 - - - 0 - - 1 - m_MinThicknessValueTitle - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - - - -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - 0 - - 0 - - 1 - m_ZoneMinThicknessCtrl - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - - 0 - - wxID_ANY - Outlines Options: - - m_OutilinesBoxOpt - wxVERTICAL - none - - - 5 - wxALL|wxALIGN_CENTER_VERTICAL - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - "Any" "H, V and 45 deg" - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Zone Edges Orient - 1 - - 0 - - - 0 - - 1 - m_OrientEdgesOpt - 1 - - - protected - 1 - - Resizable - 0 - 1 - - wxRA_SPECIFY_COLS - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL|wxALIGN_CENTER_VERTICAL - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - "Line" "Hatched Outline" "Full Hatched" - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Outlines Appearence - 1 - - 0 - - - 0 - - 1 - m_OutlineAppearanceCtrl - 1 - - - protected - 1 - - Resizable - 1 - 1 - - wxRA_SPECIFY_COLS - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALIGN_CENTER_VERTICAL - 1 - - - m_ButtonsSizer - wxVERTICAL - none - - 5 - wxALL|wxALIGN_CENTER_HORIZONTAL - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_OK - OK - - 0 - - - 0 - - 1 - m_buttonOk - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - OnOkClick - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL|wxALIGN_CENTER_HORIZONTAL - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_CANCEL - Cancel - - 0 - - - 0 - - 1 - m_buttonCancel - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - OnCancelClick - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxTOP|wxRIGHT|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Layer selection: - - 0 - - - 0 - - 1 - m_staticTextLayerSelection - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - - - -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - - 0 - - 1 - m_LayerSelectionCtrl - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + C++ + 1 + source_name + 0 + 0 + res + UTF-8 + table + dialog_non_copper_zones_properties_base + 1000 + none + 1 + dialog_non_copper_zones_properties_base + + . + + 1 + 1 + 1 + 1 + 0 + + 0 + wxAUI_MGR_DEFAULT + + wxBOTH + + 1 + 1 + impl_virtual + + + + 0 + wxID_ANY + + + DialogNonCopperZonesPropertiesBase + + 369,317 + wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER + DIALOG_SHIM; dialog_shim.h + Non Copper Zones Properties + + + + wxFULL_REPAINT_ON_RESIZE|wxSUNKEN_BORDER + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + m_MainSizer + wxVERTICAL + none + + 5 + wxEXPAND|wxALIGN_CENTER_HORIZONTAL + 1 + + + m_UpperSizer + wxHORIZONTAL + none + + 5 + wxEXPAND + 1 + + + bSizerLeft + wxVERTICAL + none + + 5 + wxTOP|wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Layer selection: + + 0 + + + 0 + + 1 + m_staticTextLayerSelection + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + + 1 + m_LayerSelectionCtrl + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND + 0 + + + bSizerRight + wxVERTICAL + none + + 5 + wxEXPAND|wxALL + 0 + + wxID_ANY + Outlines Options: + + m_OutilinesBoxOpt + wxVERTICAL + none + + + 5 + wxALL|wxALIGN_CENTER_VERTICAL|wxEXPAND + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + "Any" "H, V and 45 deg" + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Zone Edges Orient + 1 + + 0 + + + 0 + + 1 + m_OrientEdgesOpt + 1 + + + protected + 1 + + Resizable + 0 + 1 + + wxRA_SPECIFY_COLS + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL|wxALIGN_CENTER_VERTICAL|wxEXPAND + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + "Line" "Hatched Outline" "Full Hatched" + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Outlines Appearence + 1 + + 0 + + + 0 + + 1 + m_OutlineAppearanceCtrl + 1 + + + protected + 1 + + Resizable + 1 + 1 + + wxRA_SPECIFY_COLS + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxTOP|wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Zone min thickness value + + 0 + + + 0 + + 1 + m_MinThicknessValueTitle + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + 0 + + 0 + + 1 + m_ZoneMinThicknessCtrl + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND | wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + + 1 + m_staticline1 + 1 + + + protected + 1 + + Resizable + 1 + + wxLI_HORIZONTAL + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND + 0 + + 0 + 1 + 0 + 0 + 0 + 1 + 0 + 0 + + m_sdbSizerButtons + protected + + OnCancelClick + + + + OnOkClick + + + + + + + + diff --git a/pcbnew/dialogs/dialog_non_copper_zones_properties_base.h b/pcbnew/dialogs/dialog_non_copper_zones_properties_base.h index d0aba70995..89b206fb8f 100644 --- a/pcbnew/dialogs/dialog_non_copper_zones_properties_base.h +++ b/pcbnew/dialogs/dialog_non_copper_zones_properties_base.h @@ -1,67 +1,69 @@ -/////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Apr 11 2012) -// http://www.wxformbuilder.org/ -// -// PLEASE DO "NOT" EDIT THIS FILE! -/////////////////////////////////////////////////////////////////////////// - -#ifndef __DIALOG_NON_COPPER_ZONES_PROPERTIES_BASE_H__ -#define __DIALOG_NON_COPPER_ZONES_PROPERTIES_BASE_H__ - -#include -#include -#include -#include "dialog_shim.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -/////////////////////////////////////////////////////////////////////////// - -/////////////////////////////////////////////////////////////////////////////// -/// Class DialogNonCopperZonesPropertiesBase -/////////////////////////////////////////////////////////////////////////////// -class DialogNonCopperZonesPropertiesBase : public DIALOG_SHIM -{ - DECLARE_EVENT_TABLE() - private: - - // Private event handlers - void _wxFB_OnOkClick( wxCommandEvent& event ){ OnOkClick( event ); } - void _wxFB_OnCancelClick( wxCommandEvent& event ){ OnCancelClick( event ); } - - - protected: - wxRadioBox* m_FillModeCtrl; - wxStaticText* m_MinThicknessValueTitle; - wxTextCtrl* m_ZoneMinThicknessCtrl; - wxRadioBox* m_OrientEdgesOpt; - wxRadioBox* m_OutlineAppearanceCtrl; - wxButton* m_buttonOk; - wxButton* m_buttonCancel; - wxStaticText* m_staticTextLayerSelection; - wxListBox* m_LayerSelectionCtrl; - - // Virtual event handlers, overide them in your derived class - virtual void OnOkClick( wxCommandEvent& event ) { event.Skip(); } - virtual void OnCancelClick( wxCommandEvent& event ) { event.Skip(); } - - - public: - - DialogNonCopperZonesPropertiesBase( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Non Copper Zones Properties"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 416,287 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER|wxFULL_REPAINT_ON_RESIZE|wxSUNKEN_BORDER ); - ~DialogNonCopperZonesPropertiesBase(); - -}; - -#endif //__DIALOG_NON_COPPER_ZONES_PROPERTIES_BASE_H__ +/////////////////////////////////////////////////////////////////////////// +// C++ code generated with wxFormBuilder (version Apr 10 2012) +// http://www.wxformbuilder.org/ +// +// PLEASE DO "NOT" EDIT THIS FILE! +/////////////////////////////////////////////////////////////////////////// + +#ifndef __DIALOG_NON_COPPER_ZONES_PROPERTIES_BASE_H__ +#define __DIALOG_NON_COPPER_ZONES_PROPERTIES_BASE_H__ + +#include +#include +#include +#include "dialog_shim.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/////////////////////////////////////////////////////////////////////////// + +/////////////////////////////////////////////////////////////////////////////// +/// Class DialogNonCopperZonesPropertiesBase +/////////////////////////////////////////////////////////////////////////////// +class DialogNonCopperZonesPropertiesBase : public DIALOG_SHIM +{ + DECLARE_EVENT_TABLE() + private: + + // Private event handlers + void _wxFB_OnCancelClick( wxCommandEvent& event ){ OnCancelClick( event ); } + void _wxFB_OnOkClick( wxCommandEvent& event ){ OnOkClick( event ); } + + + protected: + wxStaticText* m_staticTextLayerSelection; + wxListBox* m_LayerSelectionCtrl; + wxRadioBox* m_OrientEdgesOpt; + wxRadioBox* m_OutlineAppearanceCtrl; + wxStaticText* m_MinThicknessValueTitle; + wxTextCtrl* m_ZoneMinThicknessCtrl; + wxStaticLine* m_staticline1; + wxStdDialogButtonSizer* m_sdbSizerButtons; + wxButton* m_sdbSizerButtonsOK; + wxButton* m_sdbSizerButtonsCancel; + + // Virtual event handlers, overide them in your derived class + virtual void OnCancelClick( wxCommandEvent& event ) { event.Skip(); } + virtual void OnOkClick( wxCommandEvent& event ) { event.Skip(); } + + + public: + + DialogNonCopperZonesPropertiesBase( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Non Copper Zones Properties"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 369,317 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER|wxFULL_REPAINT_ON_RESIZE|wxSUNKEN_BORDER ); + ~DialogNonCopperZonesPropertiesBase(); + +}; + +#endif //__DIALOG_NON_COPPER_ZONES_PROPERTIES_BASE_H__ diff --git a/pcbnew/drc.cpp b/pcbnew/drc.cpp index f9a4b421c7..c690c2c70e 100644 --- a/pcbnew/drc.cpp +++ b/pcbnew/drc.cpp @@ -136,6 +136,14 @@ int DRC::Drc( TRACK* aRefSegm, TRACK* aList ) return BAD_DRC; } + if( !doTrackKeepoutDrc( aRefSegm ) ) + { + wxASSERT( m_currentMarker ); + + m_currentMarker->DisplayInfo( m_mainWindow ); + return BAD_DRC; + } + return OK_DRC; } @@ -252,6 +260,18 @@ void DRC::RunTests( wxTextCtrl* aMessages ) testUnconnected(); } + // find and gather vias, tracks, pads inside keepout areas. + if( m_doKeepoutTest ) + { + if( aMessages ) + { + aMessages->AppendText( _( "Keepout areas ...\n" ) ); + aMessages->Refresh(); + } + + testKeepoutAreas(); + } + // update the m_ui listboxes updatePointers(); @@ -556,6 +576,107 @@ void DRC::testZones() } +void DRC::testKeepoutAreas() +{ + // Test keepout areas for vias, tracks and pads inside keepout areas + for( int ii = 0; ii < m_pcb->GetAreaCount(); ii++ ) + { + ZONE_CONTAINER* area = m_pcb->GetArea( ii ); + + if( !area->GetIsKeepout() ) + continue; + + for( TRACK* segm = m_pcb->m_Track; segm != NULL; segm = segm->Next() ) + { + if( segm->Type() == PCB_TRACE_T ) + { + if( ! area->GetDoNotAllowTracks() ) + continue; + + if( segm->GetLayer() != area->GetLayer() ) + continue; + + if( area->m_Poly->Distance( segm->GetStart(), segm->GetEnd(), segm->GetWidth() ) == 0 ) + { + m_currentMarker = fillMarker( segm, NULL, + DRCE_TRACK_INSIDE_KEEPOUT, m_currentMarker ); + m_pcb->Add( m_currentMarker ); + m_currentMarker = 0; + } + } + else if( segm->Type() == PCB_VIA_T ) + { + if( ! area->GetDoNotAllowVias() ) + continue; + + if( ! ((SEGVIA*)segm)->IsOnLayer( area->GetLayer() ) ) + continue; + + if( area->m_Poly->Distance( segm->GetPosition() ) < segm->GetWidth()/2 ) + { + m_currentMarker = fillMarker( segm, NULL, + DRCE_VIA_INSIDE_KEEPOUT, m_currentMarker ); + m_pcb->Add( m_currentMarker ); + m_currentMarker = 0; + } + } + } + // Test pads: TODO + } +} + +/* + * Function doTrackKeepoutDrc + * tests the current segment or via. + * aRefSeg is the segment to test + * return true if no DRC err + */ +bool DRC::doTrackKeepoutDrc( TRACK* aRefSeg ) +{ + // Test keepout areas for vias, tracks and pads inside keepout areas + for( int ii = 0; ii < m_pcb->GetAreaCount(); ii++ ) + { + ZONE_CONTAINER* area = m_pcb->GetArea( ii ); + + if( !area->GetIsKeepout() ) + continue; + + if( aRefSeg->Type() == PCB_TRACE_T ) + { + if( ! area->GetDoNotAllowTracks() ) + continue; + + if( aRefSeg->GetLayer() != area->GetLayer() ) + continue; + + if( area->m_Poly->Distance( aRefSeg->GetStart(), aRefSeg->GetEnd(), aRefSeg->GetWidth() ) == 0 ) + { + m_currentMarker = fillMarker( aRefSeg, NULL, + DRCE_TRACK_INSIDE_KEEPOUT, m_currentMarker ); + return false; + } + } + else if( aRefSeg->Type() == PCB_VIA_T ) + { + if( ! area->GetDoNotAllowVias() ) + continue; + + if( ! ((SEGVIA*)aRefSeg)->IsOnLayer( area->GetLayer() ) ) + continue; + + if( area->m_Poly->Distance( aRefSeg->GetPosition() ) < aRefSeg->GetWidth()/2 ) + { + m_currentMarker = fillMarker( aRefSeg, NULL, + DRCE_VIA_INSIDE_KEEPOUT, m_currentMarker ); + return false; + } + } + } + + return true; +} + + bool DRC::doPadToPadsDrc( D_PAD* aRefPad, D_PAD** aStart, D_PAD** aEnd, int x_limit ) { int layerMask = aRefPad->GetLayerMask() & ALL_CU_LAYERS; diff --git a/pcbnew/drc_stuff.h b/pcbnew/drc_stuff.h index 086ce4be25..65eec4d0d9 100644 --- a/pcbnew/drc_stuff.h +++ b/pcbnew/drc_stuff.h @@ -32,7 +32,6 @@ #include - #define OK_DRC 0 #define BAD_DRC 1 @@ -73,6 +72,9 @@ #define DRCE_NETCLASS_VIADRILLSIZE 33 ///< netclass has ViaDrillSize < board.m_designSettings->m_ViasMinDrill #define DRCE_NETCLASS_uVIASIZE 34 ///< netclass has ViaSize < board.m_designSettings->m_MicroViasMinSize #define DRCE_NETCLASS_uVIADRILLSIZE 35 ///< netclass has ViaSize < board.m_designSettings->m_MicroViasMinDrill +#define DRCE_VIA_INSIDE_KEEPOUT 36 ///< Via in inside a keepout area +#define DRCE_TRACK_INSIDE_KEEPOUT 37 ///< Track in inside a keepout area +#define DRCE_PAD_INSIDE_KEEPOUT 38 ///< Pad in inside a keepout area class EDA_DRAW_PANEL; @@ -155,15 +157,14 @@ private: bool m_doPad2PadTest; bool m_doUnconnectedTest; bool m_doZonesTest; + bool m_doKeepoutTest; bool m_doCreateRptFile; wxString m_rptFilename; - // int m_errorCount; - MARKER_PCB* m_currentMarker; - bool m_aboartDRC; + bool m_abortDRC; bool m_drcInProgress; /* In DRC functions, many calculations are using coordinates relative @@ -182,7 +183,7 @@ private: int m_segmLength; // length of the reference segment /* variables used in checkLine to test DRC segm to segm: - * define the area relative to the ref segment that does not contains anu other segment + * define the area relative to the ref segment that does not contains any other segment */ int m_xcliplo; int m_ycliplo; @@ -278,6 +279,7 @@ private: void testZones(); + void testKeepoutAreas(); //---------------------------------------------- @@ -305,6 +307,15 @@ private: */ bool doTrackDrc( TRACK* aRefSeg, TRACK* aStart, bool doPads = true ); + /** + * Function doTrackKeepoutDrc + * tests the current segment or via. + * @param aRefSeg The segment to test + * @return bool - true if no poblems, else false and m_currentMarker is + * filled in with the problem information. + */ + bool doTrackKeepoutDrc( TRACK* aRefSeg ); + /** * Function doEdgeZoneDrc @@ -412,7 +423,10 @@ public: { updatePointers(); - return doTrackDrc( aRefSeg, aList ) ? OK_DRC : BAD_DRC; + if( ! doTrackDrc( aRefSeg, aList ) ) + return BAD_DRC; + + return doTrackKeepoutDrc( aRefSeg ) ? OK_DRC : BAD_DRC; } @@ -443,11 +457,13 @@ public: * @param aSaveReport A boolean telling whether to generate disk file report. */ void SetSettings( bool aPad2PadTest, bool aUnconnectedTest, - bool aZonesTest, const wxString& aReportName, bool aSaveReport ) + bool aZonesTest, bool aKeepoutTest, + const wxString& aReportName, bool aSaveReport ) { m_doPad2PadTest = aPad2PadTest; m_doUnconnectedTest = aUnconnectedTest; m_doZonesTest = aZonesTest; + m_doKeepoutTest = aKeepoutTest; m_rptFilename = aReportName; m_doCreateRptFile = aSaveReport; } diff --git a/pcbnew/edit.cpp b/pcbnew/edit.cpp index fa57f44f08..b6adee5749 100644 --- a/pcbnew/edit.cpp +++ b/pcbnew/edit.cpp @@ -1343,6 +1343,10 @@ void PCB_EDIT_FRAME::OnSelectTool( wxCommandEvent& aEvent ) break; + case ID_PCB_KEEPOUT_AREA_BUTT: + SetToolID( id, wxCURSOR_PENCIL, _( "Add keepout" ) ); + break; + case ID_PCB_MIRE_BUTT: SetToolID( id, wxCURSOR_PENCIL, _( "Add layer alignment target" ) ); break; diff --git a/pcbnew/kicad_plugin.cpp b/pcbnew/kicad_plugin.cpp index 42ff20c0a3..cd8ec788da 100644 --- a/pcbnew/kicad_plugin.cpp +++ b/pcbnew/kicad_plugin.cpp @@ -980,7 +980,7 @@ void PCB_IO::format( ZONE_CONTAINER* aZone, int aNestLevel ) const FMT_IU( aZone->m_Poly->GetHatchPitch() ).c_str() ); if( aZone->GetPriority() > 0 ) - m_out->Print( aNestLevel+1, " (priority %d)\n", aZone->GetPriority() ); + m_out->Print( aNestLevel+1, "(priority %d)\n", aZone->GetPriority() ); m_out->Print( aNestLevel+1, "(connect_pads" ); @@ -1009,6 +1009,14 @@ void PCB_IO::format( ZONE_CONTAINER* aZone, int aNestLevel ) const m_out->Print( aNestLevel+1, "(min_thickness %s)\n", FMT_IU( aZone->GetMinThickness() ).c_str() ); + if( aZone->GetIsKeepout() ) + { + m_out->Print( aNestLevel+1, "(keepout (tracks %s) (vias %s) (pads %s))\n", + aZone->GetDoNotAllowTracks() ? "not_allowed" : "allowed", + aZone->GetDoNotAllowVias() ? "not_allowed" : "allowed", + aZone->GetDoNotAllowPads() ? "not_allowed" : "allowed" ); + } + m_out->Print( aNestLevel+1, "(fill" ); // Default is not filled. diff --git a/pcbnew/legacy_plugin.cpp b/pcbnew/legacy_plugin.cpp index c3c83ff1a5..1407a0fbf2 100644 --- a/pcbnew/legacy_plugin.cpp +++ b/pcbnew/legacy_plugin.cpp @@ -3,8 +3,8 @@ * This program source code file is part of KiCad, a free EDA CAD application. * * Copyright (C) 2007-2012 SoftPLC Corporation, Dick Hollenbeck - * Copyright (C) 2004 Jean-Pierre Charras, jean-pierre.charras@gipsa-lab.inpg.fr - * Copyright (C) 1992-2011 KiCad Developers, see change_log.txt for contributors. + * Copyright (C) 2004 Jean-Pierre Charras, jp.charras@wanadoo.fr + * Copyright (C) 1992-2012 KiCad Developers, see change_log.txt for contributors. * * This program is free software; you can redistribute it and/or @@ -2205,6 +2205,34 @@ void LEGACY_PLUGIN::loadZONE_CONTAINER() zc->SetCornerRadius( cornerRadius ); } + else if( TESTLINE( "ZKeepout" ) ) + { + zc->SetIsKeepout( true ); + // e.g. "ZKeepout tracks N vias N pads Y" + data = strtok( line + SZ( "ZKeepout" ), delims ); + + while( data ) + { + if( !strcmp( data, "tracks" ) ) + { + data = strtok( NULL, delims ); + zc->SetDoNotAllowTracks( data && *data == 'N' ); + } + else if( !strcmp( data, "vias" ) ) + { + data = strtok( NULL, delims ); + zc->SetDoNotAllowVias( data && *data == 'N' ); + } + else if( !strcmp( data, "pads" ) ) + { + data = strtok( NULL, delims ); + zc->SetDoNotAllowPads( data && *data == 'N' ); + } + + data = strtok( NULL, delims ); + } + } + else if( TESTLINE( "ZOptions" ) ) { // e.g. "ZOptions 0 32 F 200 200" @@ -3566,6 +3594,14 @@ void LEGACY_PLUGIN::saveZONE_CONTAINER( const ZONE_CONTAINER* me ) const fmtBIU( me->GetThermalReliefGap() ).c_str(), fmtBIU( me->GetThermalReliefCopperBridge() ).c_str() ); + if( me->GetIsKeepout() ) + { + fprintf( m_fp, "ZKeepout tracks %c vias %c pads %c\n", + me->GetDoNotAllowTracks() ? 'N' : 'Y', + me->GetDoNotAllowVias() ? 'N' : 'Y', + me->GetDoNotAllowPads() ? 'N' : 'Y' ); + } + fprintf( m_fp, "ZSmoothing %d %s\n", me->GetCornerSmoothingType(), fmtBIU( me->GetCornerRadius() ).c_str() ); diff --git a/pcbnew/menubar_pcbframe.cpp b/pcbnew/menubar_pcbframe.cpp index 64389263e0..1be09ce1cc 100644 --- a/pcbnew/menubar_pcbframe.cpp +++ b/pcbnew/menubar_pcbframe.cpp @@ -370,6 +370,10 @@ void PCB_EDIT_FRAME::ReCreateMenuBar() AddMenuItem( placeMenu, ID_PCB_ZONES_BUTT, _( "&Zone" ), _( "Add filled zones" ), KiBitmap( add_zone_xpm ) ); + // Keepout areas + AddMenuItem( placeMenu, ID_PCB_KEEPOUT_AREA_BUTT, + _( "&Zone" ), _( "Add keepout areas" ), KiBitmap( add_keepout_area_xpm ) ); + // Text AddMenuItem( placeMenu, ID_PCB_ADD_TEXT_BUTT, _( "Te&xt" ), _( "Add text on copper layers or graphic text" ), diff --git a/pcbnew/onleftclick.cpp b/pcbnew/onleftclick.cpp index f037e987b2..65c21b087e 100644 --- a/pcbnew/onleftclick.cpp +++ b/pcbnew/onleftclick.cpp @@ -291,37 +291,13 @@ void PCB_EDIT_FRAME::OnLeftClick( wxDC* aDC, const wxPoint& aPosition ) break; case ID_PCB_ZONES_BUTT: - - /* ZONE Tool is selected. Determine action for a left click: + case ID_PCB_KEEPOUT_AREA_BUTT: + /* ZONE or KEEPOUT Tool is selected. Determine action for a left click: * this can be start a new zone or select and move an existing zone outline corner * if found near the mouse cursor */ if( (DrawStruct == NULL) || (DrawStruct->GetFlags() == 0) ) { -#if 0 // Set to 1 to automatically edit a zone found under the mouse - // there is no current item, try to find something under the mouse cursor - DrawStruct = PcbGeneralLocateAndDisplay(); - bool hit_on_corner = false; - - if( DrawStruct && (DrawStruct->Type() == PCB_ZONE_AREA_T) ) - { - // We have a hit under mouse (a zone outline corner or segment) - // test for a corner only because want to move corners only. - ZONE_CONTAINER* edge_zone = (ZONE_CONTAINER*) DrawStruct; - - if( edge_zone->HitTestForCorner( GetScreen()->RefPos( true ) ) ) // corner located! - hit_on_corner = true; - } - - if( hit_on_corner ) - { - m_canvas->MoveCursorToCrossHair(); - ZONE_CONTAINER* zone_cont = (ZONE_CONTAINER*) GetCurItem(); - m_canvas->SetAutoPanRequest( true ); - Start_Move_Zone_Corner( aDC, zone_cont, zone_cont->m_CornerSelection, false ); - } - else -#endif if( Begin_Zone( aDC ) ) { m_canvas->SetAutoPanRequest( true ); @@ -521,6 +497,7 @@ void PCB_EDIT_FRAME::OnLeftDClick( wxDC* aDC, const wxPoint& aPosition ) break; case ID_PCB_ZONES_BUTT: + case ID_PCB_KEEPOUT_AREA_BUTT: if( End_Zone( aDC ) ) { m_canvas->SetAutoPanRequest( false ); diff --git a/pcbnew/onrightclick.cpp b/pcbnew/onrightclick.cpp index 49098f3cd2..9d2111589a 100644 --- a/pcbnew/onrightclick.cpp +++ b/pcbnew/onrightclick.cpp @@ -329,6 +329,12 @@ bool PCB_EDIT_FRAME::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu ) aPopMenu->AppendSeparator(); break; + case ID_PCB_KEEPOUT_AREA_BUTT: + AddMenuItem( aPopMenu, ID_POPUP_PCB_SELECT_LAYER, + _( "Select Working Layer" ), KiBitmap( select_w_layer_xpm ) ); + aPopMenu->AppendSeparator(); + break; + case ID_TRACK_BUTT: if ( ! locate_track ) // This menu is already added when a track is located AddMenuItem( aPopMenu, Append_Track_Width_List( GetBoard() ), @@ -601,7 +607,9 @@ void PCB_EDIT_FRAME::createPopUpMenuForZones( ZONE_CONTAINER* edge_zone, wxMenu* { wxMenu* zones_menu = new wxMenu(); - AddMenuItem( aPopMenu, zones_menu, -1, _( "Zones" ), KiBitmap( add_zone_xpm ) ); + AddMenuItem( aPopMenu, zones_menu, -1, + edge_zone->GetIsKeepout() ? _("Keepout Area") : _( "Zones" ), + KiBitmap( add_zone_xpm ) ); if( edge_zone->HitTestForCorner( GetScreen()->RefPos( true ) ) ) { @@ -632,8 +640,9 @@ void PCB_EDIT_FRAME::createPopUpMenuForZones( ZONE_CONTAINER* edge_zone, wxMenu* zones_menu->AppendSeparator(); - AddMenuItem( zones_menu, ID_POPUP_PCB_FILL_ZONE, _( "Fill Zone" ), - KiBitmap( fill_zone_xpm ) ); + if( ! edge_zone->GetIsKeepout() ) + AddMenuItem( zones_menu, ID_POPUP_PCB_FILL_ZONE, _( "Fill Zone" ), + KiBitmap( fill_zone_xpm ) ); if( edge_zone->GetFilledPolysList().size() > 0 ) { diff --git a/pcbnew/pcb_parser.cpp b/pcbnew/pcb_parser.cpp index 7e78a61f80..c438041333 100644 --- a/pcbnew/pcb_parser.cpp +++ b/pcbnew/pcb_parser.cpp @@ -2464,6 +2464,49 @@ ZONE_CONTAINER* PCB_PARSER::parseZONE_CONTAINER() throw( IO_ERROR, PARSE_ERROR ) break; + case T_keepout: + zone->SetIsKeepout( true ); + + for( token = NextTok(); token != T_RIGHT; token = NextTok() ) + { + if( token == T_LEFT ) + token = NextTok(); + + switch( token ) + { + case T_tracks: + token = NextTok(); + + if( token != T_allowed && token != T_not_allowed ) + Expecting( "allowed or not_allowed" ); + zone->SetDoNotAllowTracks( token == T_not_allowed ); + break; + + case T_vias: + token = NextTok(); + + if( token != T_allowed && token != T_not_allowed ) + Expecting( "allowed or not_allowed" ); + zone->SetDoNotAllowVias( token == T_not_allowed ); + break; + + case T_pads: + token = NextTok(); + + if( token != T_allowed && token != T_not_allowed ) + Expecting( "allowed or not_allowed" ); + zone->SetDoNotAllowPads( token == T_not_allowed ); + break; + + default: + Expecting( "tracks, vias or pads" ); + } + + NeedRIGHT(); + } + + break; + case T_polygon: { std::vector< wxPoint > corners; diff --git a/pcbnew/pcbnew_id.h b/pcbnew/pcbnew_id.h index 527bac274f..cb35fc1931 100644 --- a/pcbnew/pcbnew_id.h +++ b/pcbnew/pcbnew_id.h @@ -26,6 +26,7 @@ enum pcbnew_ids ID_PCB_MODULE_BUTT, ID_TRACK_BUTT, ID_PCB_ZONES_BUTT, + ID_PCB_KEEPOUT_AREA_BUTT, ID_PCB_ADD_LINE_BUTT, ID_PCB_CIRCLE_BUTT, ID_PCB_ARC_BUTT, diff --git a/pcbnew/tool_pcb.cpp b/pcbnew/tool_pcb.cpp index 5d0c5a60d1..4c4b8ff73f 100644 --- a/pcbnew/tool_pcb.cpp +++ b/pcbnew/tool_pcb.cpp @@ -429,6 +429,10 @@ void PCB_EDIT_FRAME::ReCreateVToolbar() m_drawToolBar->AddTool( ID_PCB_ZONES_BUTT, wxEmptyString, KiBitmap( add_zone_xpm ), _( "Add filled zones" ), wxITEM_CHECK ); + m_drawToolBar->AddTool( ID_PCB_KEEPOUT_AREA_BUTT, wxEmptyString, + KiBitmap( add_keepout_area_xpm ), + _( "Add keepout areas" ), wxITEM_CHECK ); + m_drawToolBar->AddSeparator(); m_drawToolBar->AddTool( ID_PCB_ADD_LINE_BUTT, wxEmptyString, KiBitmap( add_dashed_line_xpm ), _( "Add graphic line or polygon" ), wxITEM_CHECK ); diff --git a/pcbnew/zone_filling_algorithm.cpp b/pcbnew/zone_filling_algorithm.cpp index aadd43472c..539d6a0f0c 100644 --- a/pcbnew/zone_filling_algorithm.cpp +++ b/pcbnew/zone_filling_algorithm.cpp @@ -69,35 +69,35 @@ int ZONE_CONTAINER::BuildFilledPolysListData( BOARD* aPcb, std::vector return 0; // Make a smoothed polygon out of the user-drawn polygon if required - if( smoothedPoly ) + if( m_smoothedPoly ) { - delete smoothedPoly; - smoothedPoly = NULL; + delete m_smoothedPoly; + m_smoothedPoly = NULL; } - switch( cornerSmoothingType ) + switch( m_cornerSmoothingType ) { case ZONE_SETTINGS::SMOOTHING_CHAMFER: - smoothedPoly = m_Poly->Chamfer( cornerRadius ); + m_smoothedPoly = m_Poly->Chamfer( m_cornerRadius ); break; case ZONE_SETTINGS::SMOOTHING_FILLET: - smoothedPoly = m_Poly->Fillet( cornerRadius, m_ArcToSegmentsCount ); + m_smoothedPoly = m_Poly->Fillet( m_cornerRadius, m_ArcToSegmentsCount ); break; default: - smoothedPoly = new CPolyLine; - smoothedPoly->Copy( m_Poly ); + m_smoothedPoly = new CPolyLine; + m_smoothedPoly->Copy( m_Poly ); break; } - smoothedPoly->MakeKboolPoly( -1, -1, NULL, true ); + m_smoothedPoly->MakeKboolPoly( -1, -1, NULL, true ); int count = 0; - while( smoothedPoly->GetKboolEngine()->StartPolygonGet() ) + while( m_smoothedPoly->GetKboolEngine()->StartPolygonGet() ) { CPolyPt corner( 0, 0, false ); - while( smoothedPoly->GetKboolEngine()->PolygonHasMorePoints() ) + while( m_smoothedPoly->GetKboolEngine()->PolygonHasMorePoints() ) { - corner.x = (int) smoothedPoly->GetKboolEngine()->GetPolygonXPoint(); - corner.y = (int) smoothedPoly->GetKboolEngine()->GetPolygonYPoint(); + corner.x = (int) m_smoothedPoly->GetKboolEngine()->GetPolygonXPoint(); + corner.y = (int) m_smoothedPoly->GetKboolEngine()->GetPolygonYPoint(); corner.end_contour = false; if( aCornerBuffer ) aCornerBuffer->push_back( corner ); @@ -117,10 +117,10 @@ int ZONE_CONTAINER::BuildFilledPolysListData( BOARD* aPcb, std::vector m_FilledPolysList.pop_back(); m_FilledPolysList.push_back( corner ); } - smoothedPoly->GetKboolEngine()->EndPolygonGet(); + m_smoothedPoly->GetKboolEngine()->EndPolygonGet(); } - smoothedPoly->FreeKboolEngine(); + m_smoothedPoly->FreeKboolEngine(); /* For copper layers, we now must add holes in the Polygon list. * holes are pads and tracks with their clearance area diff --git a/pcbnew/zones.h b/pcbnew/zones.h index 4c6b6c3e54..3ac9331da9 100644 --- a/pcbnew/zones.h +++ b/pcbnew/zones.h @@ -68,4 +68,15 @@ ZONE_EDIT_T InvokeNonCopperZonesEditor( PCB_BASE_FRAME* aParent, ZONE_CONTAINER* */ ZONE_EDIT_T InvokeCopperZonesEditor( PCB_BASE_FRAME* aCaller, ZONE_SETTINGS* aSettings ); +/** + * Function InvokeKeepoutAreaEditor + * invokes up a modal dialog window for copper zone editing. + * + * @param aCaller is the PCB_BASE_FRAME calling parent window for the modal dialog, + * and it gives access to the BOARD through PCB_BASE_FRAME::GetBoard(). + * @param aSettings points to the ZONE_SETTINGS to edit. + * @return ZONE_EDIT_T - tells if user aborted, changed only one zone, or all of them. + */ +ZONE_EDIT_T InvokeKeepoutAreaEditor( PCB_BASE_FRAME* aCaller, ZONE_SETTINGS* aSettings ); + #endif // ZONES_H_ diff --git a/pcbnew/zones_by_polygon.cpp b/pcbnew/zones_by_polygon.cpp index 0d5dcf999f..12462939a7 100644 --- a/pcbnew/zones_by_polygon.cpp +++ b/pcbnew/zones_by_polygon.cpp @@ -83,7 +83,7 @@ void PCB_EDIT_FRAME::Add_Similar_Zone( wxDC* DC, ZONE_CONTAINER* aZone ) // Use the general event handler to set others params (like toolbar) wxCommandEvent evt; - evt.SetId( ID_PCB_ZONES_BUTT ); + evt.SetId( aZone->GetIsKeepout() ? ID_PCB_KEEPOUT_AREA_BUTT : ID_PCB_ZONES_BUTT ); OnSelectTool( evt ); } @@ -103,7 +103,7 @@ void PCB_EDIT_FRAME::Add_Zone_Cutout( wxDC* DC, ZONE_CONTAINER* aZone ) // Use the general event handle to set others params (like toolbar) wxCommandEvent evt; - evt.SetId( ID_PCB_ZONES_BUTT ); + evt.SetId( aZone->GetIsKeepout() ? ID_PCB_KEEPOUT_AREA_BUTT : ID_PCB_ZONES_BUTT ); OnSelectTool( evt ); } @@ -116,7 +116,16 @@ void PCB_EDIT_FRAME::duplicateZone( wxDC* aDC, ZONE_CONTAINER* aZone ) ZONE_SETTINGS zoneSettings; zoneSettings << *aZone; - if( InvokeCopperZonesEditor( this, &zoneSettings ) ) + bool success; + + if( aZone->GetIsKeepout() ) + success = InvokeKeepoutAreaEditor( this, &zoneSettings ); + else if( aZone->IsOnCopperLayer() ) + success = InvokeCopperZonesEditor( this, &zoneSettings ); + else + success = InvokeNonCopperZonesEditor( this, aZone, &zoneSettings ); + + if( success ) { zoneSettings.ExportSetting( *newZone ); newZone->m_Poly->Hatch(); @@ -510,7 +519,17 @@ int PCB_EDIT_FRAME::Begin_Zone( wxDC* DC ) // If no zone contour in progress, a new zone is being created: if( !GetBoard()->m_CurrentZoneContour ) - GetBoard()->m_CurrentZoneContour = new ZONE_CONTAINER( GetBoard() ); + { + if( GetToolId() == ID_PCB_KEEPOUT_AREA_BUTT && + getActiveLayer() >= FIRST_NON_COPPER_LAYER ) + { + DisplayError( this, + _( "Error: a keepout area is allowed only on copper layers" ) ); + return 0; + } + else + GetBoard()->m_CurrentZoneContour = new ZONE_CONTAINER( GetBoard() ); + } ZONE_CONTAINER* zone = GetBoard()->m_CurrentZoneContour; @@ -557,12 +576,17 @@ int PCB_EDIT_FRAME::Begin_Zone( wxDC* DC ) zoneInfo.m_CurrentZone_Layer = zone->GetLayer(); - edited = InvokeCopperZonesEditor( this, &zoneInfo ); + if( GetToolId() == ID_PCB_KEEPOUT_AREA_BUTT ) + { + zoneInfo.SetIsKeepout( true ); + edited = InvokeKeepoutAreaEditor( this, &zoneInfo ); + } + else + edited = InvokeCopperZonesEditor( this, &zoneInfo ); } else // Put a zone on a non copper layer (technical layer) { zoneInfo.m_NetcodeSelection = 0; // No net for non copper zones - edited = InvokeNonCopperZonesEditor( this, zone, &zoneInfo ); } @@ -591,7 +615,8 @@ int PCB_EDIT_FRAME::Begin_Zone( wxDC* DC ) } // Show the Net for zones on copper layers - if( zoneInfo.m_CurrentZone_Layer < FIRST_NO_COPPER_LAYER ) + if( zoneInfo.m_CurrentZone_Layer < FIRST_NO_COPPER_LAYER && + ! zoneInfo.GetIsKeepout() ) { if( s_CurrentZone ) { @@ -815,7 +840,13 @@ void PCB_EDIT_FRAME::Edit_Zone_Params( wxDC* DC, ZONE_CONTAINER* aZone ) s_PickedList.ClearListAndDeleteItems(); SaveCopyOfZones(s_PickedList, GetBoard(), -1, -1 ); - if( aZone->GetLayer() < FIRST_NO_COPPER_LAYER ) + if( aZone->GetIsKeepout() ) + { + // edit a keepout area on a copper layer + zoneInfo << *aZone; + edited = InvokeKeepoutAreaEditor( this, &zoneInfo ); + } + else if( aZone->GetLayer() < FIRST_NO_COPPER_LAYER ) { // edit a zone on a copper layer diff --git a/pcbnew/zones_by_polygon_fill_functions.cpp b/pcbnew/zones_by_polygon_fill_functions.cpp index 88126a0c4a..4fe1adc89b 100644 --- a/pcbnew/zones_by_polygon_fill_functions.cpp +++ b/pcbnew/zones_by_polygon_fill_functions.cpp @@ -87,6 +87,13 @@ void PCB_EDIT_FRAME::Delete_OldZone_Fill( SEGZONE* aZone, time_t aTimestamp ) int PCB_EDIT_FRAME::Fill_Zone( ZONE_CONTAINER* aZone ) { + aZone->ClearFilledPolysList(); + aZone->UnFill(); + + // Cannot fill keepout zones: + if( aZone->GetIsKeepout() ) + return 1; + wxString msg; ClearMsgPanel(); @@ -105,8 +112,6 @@ int PCB_EDIT_FRAME::Fill_Zone( ZONE_CONTAINER* aZone ) wxBusyCursor dummy; // Shows an hourglass cursor (removed by its destructor) - aZone->ClearFilledPolysList(); - aZone->UnFill(); aZone->BuildFilledPolysListData( GetBoard() ); OnModify(); @@ -142,6 +147,9 @@ int PCB_EDIT_FRAME::Fill_All_Zones( wxWindow * aActiveWindow, bool aVerbose ) for( ii = 0; ii < areaCount; ii++ ) { ZONE_CONTAINER* zoneContainer = GetBoard()->GetArea( ii ); + if( zoneContainer->GetIsKeepout() ) + continue; + msg.Printf( FORMAT_STRING, ii+1, areaCount, GetChars( zoneContainer->GetNetName() ) ); if( progressDialog ) diff --git a/pcbnew/zones_convert_brd_items_to_polygons_with_Boost.cpp b/pcbnew/zones_convert_brd_items_to_polygons_with_Boost.cpp index e6de77f223..282234a7a2 100644 --- a/pcbnew/zones_convert_brd_items_to_polygons_with_Boost.cpp +++ b/pcbnew/zones_convert_brd_items_to_polygons_with_Boost.cpp @@ -360,6 +360,9 @@ void ZONE_CONTAINER::AddClearanceAreasPolygonsToPolysList( BOARD* aPcb ) if( zone->GetLayer() != GetLayer() ) continue; + if( zone->GetIsKeepout() ) + continue; + if( zone->GetPriority() <= GetPriority() ) continue; @@ -372,8 +375,12 @@ void ZONE_CONTAINER::AddClearanceAreasPolygonsToPolysList( BOARD* aPcb ) // However if the zone has the same net as the current zone, // do not add clearance. // the zone will be connected to the current zone, but filled areas - // will use different parameters (clearnce, thermal shapes ) + // will use different parameters (clearance, thermal shapes ) bool addclearance = GetNet() != zone->GetNet(); + + if( zone->GetIsKeepout() ) + addclearance = false; + zone->TransformShapeWithClearanceToPolygon( cornerBufferPolysToSubstract, zone_clearance, s_CircleToSegmentsCount, diff --git a/pcbnew/zones_functions_for_undo_redo.cpp b/pcbnew/zones_functions_for_undo_redo.cpp index 8dc105be0b..6d546d7874 100644 --- a/pcbnew/zones_functions_for_undo_redo.cpp +++ b/pcbnew/zones_functions_for_undo_redo.cpp @@ -70,7 +70,28 @@ bool ZONE_CONTAINER::IsSame( const ZONE_CONTAINER& aZoneToCompare ) if( m_Netname != aZoneToCompare.m_Netname ) return false; - // Compare zone specfic parameters + if( GetPriority() != aZoneToCompare.GetPriority() ) + return false; + + // Compare zone specific parameters + if( GetIsKeepout() != aZoneToCompare.GetIsKeepout() ) + return false; + + if( GetIsKeepout() ) + { + if( GetDoNotAllowPads() != aZoneToCompare.GetDoNotAllowPads() ) + return false; + + if( GetDoNotAllowVias() != aZoneToCompare.GetDoNotAllowVias() ) + return false; + + if( GetDoNotAllowTracks() != aZoneToCompare.GetDoNotAllowTracks() ) + return false; + } + + if( m_ArcToSegmentsCount != aZoneToCompare.m_ArcToSegmentsCount ) + return false; + if( m_ZoneClearance != aZoneToCompare.m_ZoneClearance ) return false; @@ -80,9 +101,6 @@ bool ZONE_CONTAINER::IsSame( const ZONE_CONTAINER& aZoneToCompare ) if( m_FillMode != aZoneToCompare.m_FillMode ) return false; - if( m_ArcToSegmentsCount != aZoneToCompare.m_ArcToSegmentsCount ) - return false; - if( m_PadConnection != aZoneToCompare.m_PadConnection ) return false; @@ -92,8 +110,6 @@ bool ZONE_CONTAINER::IsSame( const ZONE_CONTAINER& aZoneToCompare ) if( m_ThermalReliefCopperBridge != aZoneToCompare.m_ThermalReliefCopperBridge ) return false; - if( GetPriority() != aZoneToCompare.GetPriority() ) - return false; // Compare outlines wxASSERT( m_Poly ); // m_Poly == NULL Should never happen diff --git a/pcbnew/zones_non_copper_type_functions.cpp b/pcbnew/zones_non_copper_type_functions.cpp index 28af1f3fdb..5305c4e137 100644 --- a/pcbnew/zones_non_copper_type_functions.cpp +++ b/pcbnew/zones_non_copper_type_functions.cpp @@ -29,7 +29,7 @@ private: PCB_BASE_FRAME* m_Parent; ZONE_CONTAINER* m_zone; ZONE_SETTINGS* m_ptr; - ZONE_SETTINGS m_settings; + ZONE_SETTINGS m_settings; // working copy of zone settings void OnOkClick( wxCommandEvent& event ); void OnCancelClick( wxCommandEvent& event ); @@ -76,8 +76,6 @@ void DIALOG_NON_COPPER_ZONES_EDITOR::Init() { SetReturnCode( ZONE_ABORT ); // Will be changed on button click - m_FillModeCtrl->SetSelection( m_settings.m_FillMode ? 1 : 0 ); - AddUnitSymbol( *m_MinThicknessValueTitle, g_UserUnit ); wxString msg = ReturnStringFromValue( g_UserUnit, m_settings.m_ZoneMinThickness ); m_ZoneMinThicknessCtrl->SetValue( msg ); @@ -125,18 +123,18 @@ void DIALOG_NON_COPPER_ZONES_EDITOR::Init() void DIALOG_NON_COPPER_ZONES_EDITOR::OnOkClick( wxCommandEvent& event ) { - wxString txtvalue = m_ZoneMinThicknessCtrl->GetValue(); + wxString txtvalue = m_ZoneMinThicknessCtrl->GetValue(); m_settings.m_ZoneMinThickness = ReturnValueFromString( g_UserUnit, txtvalue ); if( m_settings.m_ZoneMinThickness < 10 ) { DisplayError( this, - _( "Error :\nyou must choose a copper min thickness value bigger than 0.001 inch (or 0.0254 mm)" ) ); + _( "Error :\nyou must choose a min thickness value bigger than 0.001 inch (or 0.0254 mm)" ) ); return; } - m_settings.m_FillMode = (m_FillModeCtrl->GetSelection() == 0) ? 0 : 1; + m_settings.m_FillMode = 0; // Use always polygon fill mode switch( m_OutlineAppearanceCtrl->GetSelection() ) { diff --git a/pcbnew/zones_test_and_combine_areas.cpp b/pcbnew/zones_test_and_combine_areas.cpp index c06e96feac..d790a8eb9e 100644 --- a/pcbnew/zones_test_and_combine_areas.cpp +++ b/pcbnew/zones_test_and_combine_areas.cpp @@ -261,7 +261,7 @@ int BOARD::TestAreaPolygon( ZONE_CONTAINER* CurrArea ) * @param bMessageBoxInt == true, shows message when clipping occurs. * @param bMessageBoxArc == true, shows message when clipping can't be done due to arcs. * @param bRetainArcs = true to handle arcs (not really used in KiCad) - * @return: + * @return * -1 if arcs intersect other sides, so polygon can't be clipped * 0 if no intersecting sides * 1 if intersecting sides @@ -454,9 +454,13 @@ int BOARD::CombineAllAreasInNet( PICKED_ITEMS_LIST* aDeletedList, int aNetCode, if( area2->GetNet() != aNetCode ) continue; + if( curr_area->GetPriority() != area2->GetPriority() ) continue; + if( curr_area->GetIsKeepout() != area2->GetIsKeepout() ) + continue; + if( curr_area->GetLayer() == area2->GetLayer() && curr_area->utility2 != -1 && area2->utility2 != -1 ) { @@ -525,9 +529,14 @@ bool BOARD::TestAreaIntersections( ZONE_CONTAINER* area_to_test ) if( area_to_test->GetLayer() != area2->GetLayer() ) continue; + // test for different priorities if( area_to_test->GetPriority() != area2->GetPriority() ) continue; + // test for different types + if( area_to_test->GetIsKeepout() != area2->GetIsKeepout() ) + continue; + CPolyLine* poly2 = area2->m_Poly; // test bounding rects @@ -912,6 +921,10 @@ int BOARD::CombineAreas( PICKED_ITEMS_LIST* aDeletedList, ZONE_CONTAINER* area_r } +/* Tests area outlines for DRC: areas inside other areas or too close. + * aArea_To_Examine: area to compare with other areas, + * or if NULL then all areas are compared to all others. + */ int BOARD::Test_Drc_Areas_Outlines_To_Areas_Outlines( ZONE_CONTAINER* aArea_To_Examine, bool aCreate_Markers ) { @@ -927,38 +940,42 @@ int BOARD::Test_Drc_Areas_Outlines_To_Areas_Outlines( ZONE_CONTAINER* aArea_To_E if( !Area_Ref->IsOnCopperLayer() ) continue; - // If testing only a single area, then skip all others + // When testing only a single area, skip all others if( aArea_To_Examine && (aArea_To_Examine != Area_Ref) ) continue; for( int ia2 = 0; ia2 < GetAreaCount(); ia2++ ) { - ZONE_CONTAINER* Area_To_Test = GetArea( ia2 ); - CPolyLine* testSmoothedPoly = Area_To_Test->GetSmoothedPoly(); + ZONE_CONTAINER* area_to_test = GetArea( ia2 ); + CPolyLine* testSmoothedPoly = area_to_test->GetSmoothedPoly(); - if( Area_Ref == Area_To_Test ) + if( Area_Ref == area_to_test ) continue; // test for same layer - if( Area_Ref->GetLayer() != Area_To_Test->GetLayer() ) + if( Area_Ref->GetLayer() != area_to_test->GetLayer() ) continue; // Test for same net - if( Area_Ref->GetNet() == Area_To_Test->GetNet() && Area_Ref->GetNet() >= 0 ) + if( Area_Ref->GetNet() == area_to_test->GetNet() && Area_Ref->GetNet() >= 0 ) continue; // test for different priorities - if( Area_Ref->GetPriority() != Area_To_Test->GetPriority() ) + if( Area_Ref->GetPriority() != area_to_test->GetPriority() ) continue; - // Examine a candidate zone: compare Area_To_Test to Area_Ref + // test for different types + if( Area_Ref->GetIsKeepout() != area_to_test->GetIsKeepout() ) + continue; + + // Examine a candidate zone: compare area_to_test to Area_Ref // Get clearance used in zone to zone test. The policy used to // obtain that value is now part of the zone object itself by way of // ZONE_CONTAINER::GetClearance(). - int zone2zoneClearance = Area_Ref->GetClearance( Area_To_Test ); + int zone2zoneClearance = Area_Ref->GetClearance( area_to_test ); - // test for some corners of Area_Ref inside Area_To_Test + // test for some corners of Area_Ref inside area_to_test for( int ic = 0; ic < refSmoothedPoly->GetNumCorners(); ic++ ) { int x = refSmoothedPoly->GetX( ic ); @@ -970,7 +987,7 @@ int BOARD::Test_Drc_Areas_Outlines_To_Areas_Outlines( ZONE_CONTAINER* aArea_To_E if( aCreate_Markers ) { wxString msg1 = Area_Ref->GetSelectMenuText(); - wxString msg2 = Area_To_Test->GetSelectMenuText(); + wxString msg2 = area_to_test->GetSelectMenuText(); MARKER_PCB* marker = new MARKER_PCB( COPPERAREA_INSIDE_COPPERAREA, wxPoint( x, y ), msg1, wxPoint( x, y ), @@ -982,7 +999,7 @@ int BOARD::Test_Drc_Areas_Outlines_To_Areas_Outlines( ZONE_CONTAINER* aArea_To_E } } - // test for some corners of Area_To_Test inside Area_Ref + // test for some corners of area_to_test inside Area_Ref for( int ic2 = 0; ic2 < testSmoothedPoly->GetNumCorners(); ic2++ ) { int x = testSmoothedPoly->GetX( ic2 ); @@ -993,7 +1010,7 @@ int BOARD::Test_Drc_Areas_Outlines_To_Areas_Outlines( ZONE_CONTAINER* aArea_To_E // COPPERAREA_COPPERAREA error: copper area corner inside copper area ref if( aCreate_Markers ) { - wxString msg1 = Area_To_Test->GetSelectMenuText(); + wxString msg1 = area_to_test->GetSelectMenuText(); wxString msg2 = Area_Ref->GetSelectMenuText(); MARKER_PCB* marker = new MARKER_PCB( COPPERAREA_INSIDE_COPPERAREA, wxPoint( x, y ), @@ -1070,7 +1087,7 @@ int BOARD::Test_Drc_Areas_Outlines_To_Areas_Outlines( ZONE_CONTAINER* aArea_To_E if( aCreate_Markers ) { wxString msg1 = Area_Ref->GetSelectMenuText(); - wxString msg2 = Area_To_Test->GetSelectMenuText(); + wxString msg2 = area_to_test->GetSelectMenuText(); MARKER_PCB* marker = new MARKER_PCB( COPPERAREA_CLOSE_TO_COPPERAREA, wxPoint( x, y ), msg1, wxPoint( x, y ), @@ -1091,14 +1108,13 @@ int BOARD::Test_Drc_Areas_Outlines_To_Areas_Outlines( ZONE_CONTAINER* aArea_To_E } -/** - * Function doEdgeZoneDrc - * tests a segment in ZONE_CONTAINER * aArea: +/* tests a segment in ZONE_CONTAINER * aArea: * Test Edge inside other areas * Test Edge too close other areas - * @param aArea The current area. - * @param aCornerIndex The first corner of the segment to test. - * @return bool - false if DRC error or true if OK + * aArea is the current area. + * aCornerIndex is the index of the first corner (starting point) + * of the edge segment to test. + * return false if DRC error or true if OK */ bool DRC::doEdgeZoneDrc( ZONE_CONTAINER* aArea, int aCornerIndex ) @@ -1136,30 +1152,31 @@ bool DRC::doEdgeZoneDrc( ZONE_CONTAINER* aArea, int aCornerIndex ) // iterate through all areas for( int ia2 = 0; ia2 < m_pcb->GetAreaCount(); ia2++ ) { - ZONE_CONTAINER* Area_To_Test = m_pcb->GetArea( ia2 ); - int zone_clearance = max( Area_To_Test->m_ZoneClearance, + ZONE_CONTAINER* area_to_test = m_pcb->GetArea( ia2 ); + int zone_clearance = max( area_to_test->m_ZoneClearance, aArea->m_ZoneClearance ); // test for same layer - if( Area_To_Test->GetLayer() != aArea->GetLayer() ) + if( area_to_test->GetLayer() != aArea->GetLayer() ) continue; // Test for same net - if( ( aArea->GetNet() == Area_To_Test->GetNet() ) && (aArea->GetNet() >= 0) ) + if( ( aArea->GetNet() == area_to_test->GetNet() ) && (aArea->GetNet() >= 0) ) continue; // test for same priority - if( Area_To_Test->GetPriority() != aArea->GetPriority() ) + if( area_to_test->GetPriority() != aArea->GetPriority() ) continue; - // test for ending line inside Area_To_Test - int x = end.x; - int y = end.y; + // test for same type + if( area_to_test->GetIsKeepout() != aArea->GetIsKeepout() ) + continue; - if( Area_To_Test->m_Poly->TestPointInside( x, y ) ) + // test for ending line inside area_to_test + if( area_to_test->m_Poly->TestPointInside( end.x, end.y ) ) { // COPPERAREA_COPPERAREA error: corner inside copper area - m_currentMarker = fillMarker( aArea, wxPoint( x, y ), + m_currentMarker = fillMarker( aArea, end, COPPERAREA_INSIDE_COPPERAREA, m_currentMarker ); return false; @@ -1172,35 +1189,35 @@ bool DRC::doEdgeZoneDrc( ZONE_CONTAINER* aArea, int aCornerIndex ) int ax2 = end.x; int ay2 = end.y; - for( int icont2 = 0; icont2 < Area_To_Test->m_Poly->GetNumContours(); icont2++ ) + for( int icont2 = 0; icont2 < area_to_test->m_Poly->GetNumContours(); icont2++ ) { - int ic_start2 = Area_To_Test->m_Poly->GetContourStart( icont2 ); - int ic_end2 = Area_To_Test->m_Poly->GetContourEnd( icont2 ); + int ic_start2 = area_to_test->m_Poly->GetContourStart( icont2 ); + int ic_end2 = area_to_test->m_Poly->GetContourEnd( icont2 ); for( int ic2 = ic_start2; ic2<=ic_end2; ic2++ ) { - int bx1 = Area_To_Test->m_Poly->GetX( ic2 ); - int by1 = Area_To_Test->m_Poly->GetY( ic2 ); + int bx1 = area_to_test->m_Poly->GetX( ic2 ); + int by1 = area_to_test->m_Poly->GetY( ic2 ); int bx2, by2; if( ic2 == ic_end2 ) { - bx2 = Area_To_Test->m_Poly->GetX( ic_start2 ); - by2 = Area_To_Test->m_Poly->GetY( ic_start2 ); + bx2 = area_to_test->m_Poly->GetX( ic_start2 ); + by2 = area_to_test->m_Poly->GetY( ic_start2 ); } else { - bx2 = Area_To_Test->m_Poly->GetX( ic2 + 1 ); - by2 = Area_To_Test->m_Poly->GetY( ic2 + 1 ); + bx2 = area_to_test->m_Poly->GetX( ic2 + 1 ); + by2 = area_to_test->m_Poly->GetY( ic2 + 1 ); } - int bstyle = Area_To_Test->m_Poly->GetSideStyle( ic2 ); - int x, y; + int bstyle = area_to_test->m_Poly->GetSideStyle( ic2 ); + int x, y; // variables containing the intersecting point coordinates int d = GetClearanceBetweenSegments( bx1, by1, bx2, by2, bstyle, 0, ax1, ay1, ax2, ay2, astyle, 0, - zone_clearance, + 0, &x, &y ); if( d < zone_clearance ) diff --git a/polygon/PolyLine.cpp b/polygon/PolyLine.cpp index 58cc8f5f48..4630e9dbbc 100644 --- a/polygon/PolyLine.cpp +++ b/polygon/PolyLine.cpp @@ -14,18 +14,6 @@ #include #include - -#define to_int( x ) KiROUND( (x) ) - -#ifndef MIN -#define MIN( x1, x2 ) ( (x1) > (x2) ? (x2) : (x1) ) -#endif -#ifndef MAX -#define MAX( x1, x2 ) ( (x1) > (x2) ? (x1) : (x2) ) -#endif - -#define pi M_PI - CPolyLine::CPolyLine() { m_hatchStyle = NO_HATCH; @@ -282,7 +270,10 @@ int CPolyLine::MakeKboolPoly( int aStart_contour, int aEnd_contour, std::vector< delete m_Kbool_Poly_Engine; m_Kbool_Poly_Engine = NULL; } - if( !GetClosed() && (aStart_contour == (GetNumContours() - 1) || aStart_contour == -1) ) + + int polycount = GetNumContours(); + + if( !GetClosed() && (aStart_contour == (polycount - 1) || aStart_contour == -1) ) return 1; // error int n_arcs = 0; @@ -292,11 +283,11 @@ int CPolyLine::MakeKboolPoly( int aStart_contour, int aEnd_contour, std::vector< if( aStart_contour == -1 ) { first_contour = 0; - last_contour = GetNumContours() - 1; + last_contour = polycount - 1; } if( aEnd_contour == -1 ) { - last_contour = GetNumContours() - 1; + last_contour = polycount - 1; } if( arc_array ) arc_array->clear(); @@ -389,30 +380,30 @@ int CPolyLine::MakeKboolPoly( int aStart_contour, int aEnd_contour, std::vector< // first quadrant, draw second quadrant of ellipse xo = x2; yo = y1; - theta1 = pi; - theta2 = pi / 2.0; + theta1 = M_PI; + theta2 = M_PI / 2.0; } else if( x2 < x1 && y2 > y1 ) { // second quadrant, draw third quadrant of ellipse xo = x1; yo = y2; - theta1 = 3.0 * pi / 2.0; - theta2 = pi; + theta1 = 3.0 * M_PI / 2.0; + theta2 = M_PI; } else if( x2 < x1 && y2 < y1 ) { // third quadrant, draw fourth quadrant of ellipse xo = x2; yo = y1; - theta1 = 2.0 * pi; - theta2 = 3.0 * pi / 2.0; + theta1 = 2.0 * M_PI; + theta2 = 3.0 * M_PI / 2.0; } else { xo = x1; // fourth quadrant, draw first quadrant of ellipse yo = y2; - theta1 = pi / 2.0; + theta1 = M_PI / 2.0; theta2 = 0.0; } } @@ -423,29 +414,29 @@ int CPolyLine::MakeKboolPoly( int aStart_contour, int aEnd_contour, std::vector< { xo = x1; // first quadrant, draw fourth quadrant of ellipse yo = y2; - theta1 = 3.0 * pi / 2.0; - theta2 = 2.0 * pi; + theta1 = 3.0 * M_PI / 2.0; + theta2 = 2.0 * M_PI; } else if( x2 < x1 && y2 > y1 ) { xo = x2; // second quadrant yo = y1; theta1 = 0.0; - theta2 = pi / 2.0; + theta2 = M_PI / 2.0; } else if( x2 < x1 && y2 < y1 ) { xo = x1; // third quadrant yo = y2; - theta1 = pi / 2.0; - theta2 = pi; + theta1 = M_PI / 2.0; + theta2 = M_PI; } else { xo = x2; // fourth quadrant yo = y1; - theta1 = pi; - theta2 = 3.0 * pi / 2.0; + theta1 = M_PI; + theta2 = 3.0 * M_PI / 2.0; } } @@ -658,7 +649,8 @@ int CPolyLine::RestoreArcs( std::vector * arc_array, std::vectorGetNumContours(); icont++ ) + int polycount = poly->GetNumContours(); + for( int icont = 0; icont < polycount; icont++ ) { int ic_start = poly->GetContourStart( icont ); int ic_end = poly->GetContourEnd( icont ); @@ -877,12 +869,13 @@ void CPolyLine::RemoveContour( int icont ) int istart = GetContourStart( icont ); int iend = GetContourEnd( icont ); - if( icont == 0 && GetNumContours() == 1 ) + int polycount = GetNumContours(); + if( icont == 0 && polycount == 1 ) { // remove the only contour wxASSERT( 0 ); } - else if( icont == GetNumContours() - 1 ) + else if( icont == polycount - 1 ) { // remove last contour corner.erase( corner.begin() + istart, corner.end() ); @@ -911,7 +904,8 @@ CPolyLine* CPolyLine::Chamfer( unsigned int aDistance ) return newPoly; } - for( int contour = 0; contour < GetNumContours(); contour++ ) + int polycount = GetNumContours(); + for( int contour = 0; contour < polycount; contour++ ) { unsigned int startIndex = GetContourStart( contour ); unsigned int endIndex = GetContourEnd( contour ); @@ -986,7 +980,8 @@ CPolyLine* CPolyLine::Fillet( unsigned int aRadius, unsigned int aSegments ) return newPoly; } - for( int contour = 0; contour < GetNumContours(); contour++ ) + int polycount = GetNumContours(); + for( int contour = 0; contour < polycount; contour++ ) { unsigned int startIndex = GetContourStart( contour ); unsigned int endIndex = GetContourEnd( contour ); @@ -1199,10 +1194,10 @@ CRect CPolyLine::GetCornerBounds( int icont ) int iend = GetContourEnd( icont ); for( int i = istart; i<=iend; i++ ) { - r.left = MIN( r.left, corner[i].x ); - r.right = MAX( r.right, corner[i].x ); - r.bottom = MIN( r.bottom, corner[i].y ); - r.top = MAX( r.top, corner[i].y ); + r.left = min( r.left, corner[i].x ); + r.right = max( r.right, corner[i].x ); + r.bottom = min( r.bottom, corner[i].y ); + r.top = max( r.top, corner[i].y ); } return r; @@ -1309,7 +1304,7 @@ int CPolyLine::GetContourSize( int icont ) void CPolyLine::SetSideStyle( int is, int style ) { UnHatch(); - CPoint p1, p2; + wxPoint p1, p2; if( is == (int) (corner.size() - 1) ) { p1.x = corner[corner.size() - 1].x; @@ -1349,8 +1344,8 @@ int CPolyLine::GetClosed() // Creates hatch lines inside the outline of the complex polygon // -// sort function used in ::Hatch to sort points by descending CPoint.x values -bool sort_ends_by_descending_X( const CPoint& ref, const CPoint& tst ) +// sort function used in ::Hatch to sort points by descending wxPoint.x values +bool sort_ends_by_descending_X( const wxPoint& ref, const wxPoint& tst ) { return tst.x < ref.x; } @@ -1420,7 +1415,7 @@ void CPolyLine::Hatch() #define MAXPTS 200 // Usually we store only few values per one hatch line // depending on the compexity of the zone outline - static std::vector pointbuffer; + static std::vector pointbuffer; pointbuffer.clear(); pointbuffer.reserve(MAXPTS+2); @@ -1458,12 +1453,12 @@ void CPolyLine::Hatch() } if( ok ) { - CPoint point( (int) x, (int) y); + wxPoint point( (int) x, (int) y); pointbuffer.push_back( point ); } if( ok == 2 ) { - CPoint point( (int) x2, (int) y2); + wxPoint point( (int) x2, (int) y2); pointbuffer.push_back( point ); } if( pointbuffer.size() >= MAXPTS ) // overflow @@ -1495,10 +1490,7 @@ void CPolyLine::Hatch() // else push 2 small lines if( m_hatchStyle == DIAGONAL_FULL || fabs( dx ) < 2 * hatch_line_len ) { - m_HatchLines.push_back( CSegment( pointbuffer[ip].x, - pointbuffer[ip].y, - pointbuffer[ip + 1].x, - pointbuffer[ip + 1].y ) ); + m_HatchLines.push_back( CSegment( pointbuffer[ip], pointbuffer[ip + 1] ) ); } else { @@ -1517,11 +1509,11 @@ void CPolyLine::Hatch() m_HatchLines.push_back( CSegment( pointbuffer[ip].x, pointbuffer[ip].y, - to_int( x1 ), to_int( y1 ) ) ); + KiROUND( x1 ), KiROUND( y1 ) ) ); m_HatchLines.push_back( CSegment( pointbuffer[ip + 1].x, pointbuffer[ip + 1].y, - to_int( x2 ), to_int( y2 ) ) ); + KiROUND( x2 ), KiROUND( y2 ) ) ); } } } @@ -1538,7 +1530,7 @@ bool CPolyLine::TestPointInside( int px, int py ) } // Test all polygons. - // Since the first is the main outline, and other are hole, + // Since the first is the main outline, and other are holes, // if the tested point is inside only one contour, it is inside the whole polygon // (in fact inside the main outline, and outside all holes). // if inside 2 contours (the main outline + an hole), it is outside the poly. @@ -1636,8 +1628,8 @@ void CPolyLine::AppendArc( int xi, int yi, int xf, int yf, int xc, int yc, int n // generate arc for( int ic = 0; ic bezier_points; bezier_points = Bezier2Poly(x1,y1,x2,y2,x3,y3); @@ -1654,10 +1647,128 @@ void CPolyLine::AppendBezier(int x1, int y1, int x2, int y2, int x3, int y3) { AppendCorner( bezier_points[i].x, bezier_points[i].y); } -void CPolyLine::AppendBezier(int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4){ +void CPolyLine::AppendBezier(int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4) +{ std::vector bezier_points; bezier_points = Bezier2Poly(x1,y1,x2,y2,x3,y3,x4,y4); for( unsigned int i = 0; i < bezier_points.size() ; i++) AppendCorner( bezier_points[i].x, bezier_points[i].y); } + + +/* + * Function Distance + * Calculates the distance between a segment and a polygon (with holes): + * param aStart is the starting point of the segment. + * param aEnd is the ending point of the segment. + * param aWidth is the width of the segment. + * return distance between the segment and outline. + * 0 if segment intersects or is inside + */ +int CPolyLine::Distance( wxPoint aStart, wxPoint aEnd, int aWidth ) +{ + // We calculate the min dist between the segment and each outline segment + // However, if the segment to test is inside the outline, and does not cross + // any edge, it can be seen outside the polygon. + // Therefore test if a segment end is inside ( testing only one end is enough ) + if( TestPointInside( aStart.x, aStart.y ) ) + return 0; + + int distance = INT_MAX; + int polycount = GetNumContours(); + + for( int icont = 0; icont < polycount; icont++ ) + { + int ic_start = GetContourStart( icont ); + int ic_end = GetContourEnd( icont ); + + // now test spacing between area outline and segment + for( int ic2 = ic_start; ic2 <= ic_end; ic2++ ) + { + int bx1 = GetX( ic2 ); + int by1 = GetY( ic2 ); + int bx2, by2; + + if( ic2 == ic_end ) + { + bx2 = GetX( ic_start ); + by2 = GetY( ic_start ); + } + else + { + bx2 = GetX( ic2 + 1 ); + by2 = GetY( ic2 + 1 ); + } + + int bstyle = GetSideStyle( ic2 ); + int d = GetClearanceBetweenSegments( bx1, by1, bx2, by2, bstyle, 0, + aStart.x, aStart.y, aEnd.x, aEnd.y, + CPolyLine::STRAIGHT, aWidth, + 1, // min clearance, should be > 0 + NULL, NULL ); + if( distance > d ) + distance = d; + if( distance <= 0 ) + return 0; + } + } + + return distance; +} + +/* + * Function Distance + * Calculates the distance between a point and polygon (with holes): + * param aPoint is the coordinate of the point. + * return distance between the point and outline. + * 0 if the point is inside + */ +int CPolyLine::Distance( const wxPoint& aPoint ) +{ + // We calculate the dist between the point and each outline segment + // If the point is inside the outline, the dist is 0. + if( TestPointInside( aPoint.x, aPoint.y ) ) + return 0; + + int distance = INT_MAX; + int polycount = GetNumContours(); + + for( int icont = 0; icont < polycount; icont++ ) + { + int ic_start = GetContourStart( icont ); + int ic_end = GetContourEnd( icont ); + + // now test spacing between area outline and segment + for( int ic2 = ic_start; ic2 <= ic_end; ic2++ ) + { + int bx1 = GetX( ic2 ); + int by1 = GetY( ic2 ); + int bx2, by2; + + if( ic2 == ic_end ) + { + bx2 = GetX( ic_start ); + by2 = GetY( ic_start ); + } + else + { + bx2 = GetX( ic2 + 1 ); + by2 = GetY( ic2 + 1 ); + } + + // Here we expect only straight lines for vertices + // (no arcs, not yet supported in Pcbnew) + int d = KiROUND( GetPointToLineSegmentDistance( aPoint.x, aPoint.y, + bx1, by1, bx2, by2 ) ); + + + if( distance > d ) + distance = d; + if( distance <= 0 ) + return 0; + } + } + + return distance; +} diff --git a/polygon/PolyLine.h b/polygon/PolyLine.h index 2a6ac81220..a27478dae4 100644 --- a/polygon/PolyLine.h +++ b/polygon/PolyLine.h @@ -49,25 +49,22 @@ public: int left, right, top, bottom; }; - -class CPoint -{ -public: - int x, y; -public: - CPoint( void ) { x = y = 0; }; - CPoint( int i, int j ) { x = i; y = j; }; -}; - - class CSegment { public: - int xi, yi, xf, yf; + wxPoint m_Start; + wxPoint m_End; + CSegment() { }; + CSegment( const wxPoint & aStart, const wxPoint & aEnd ) + { + m_Start = aStart; + m_End = aEnd; + } CSegment( int x0, int y0, int x1, int y1 ) { - xi = x0; yi = y0; xf = x1; yf = y1; + m_Start.x = x0; m_Start.y = y0; + m_End.x = x1; m_End.y = y1; } }; @@ -282,6 +279,25 @@ public: void AppendBezier(int x1, int y1, int x2, int y2, int x3, int y3); void AppendBezier(int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4); + /** + * Function Distance + * Calculates the distance between a point and the zone: + * @param aPoint the coordinate of the point. + * @return int = distance between the point and outline. + * 0 if the point is inside + */ + int Distance( const wxPoint& aPoint ); + + /** + * Function Distance + * Calculates the distance between a segment and the zone: + * @param aStart the starting point of the segment. + * @param aEnd the ending point of the segment. + * @param aWidth the width of the segment. + * @return int = distance between the segment and outline. + * 0 if segment intersects or is inside + */ + int Distance( wxPoint aStart, wxPoint aEnd, int aWidth ); private: int m_layer; // layer to draw on