From 7a4900b8dcce4ac75114c25fd3dc1ab5e597aed6 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Sun, 4 Oct 2020 15:19:33 +0100 Subject: [PATCH] PCB_LINE_T -> PCB_SHAPE_T and PCB_MODULE_EDGE_T -> PCB_FP_SHAPE_T Also updated footprint text and zone types for consistencey. --- .../3d_canvas/create_3Dgraphic_brd_items.cpp | 6 +- 3d-viewer/3d_canvas/create_layer_items.cpp | 8 +- 3d-viewer/3d_canvas/create_layer_poly.cpp | 2 +- common/base_struct.cpp | 6 +- common/hash_eda.cpp | 4 +- include/class_board_item.h | 12 +- include/core/typeinfo.h | 8 +- include/preview_items/two_point_assistant.h | 2 +- pcbnew/array_creator.cpp | 2 +- pcbnew/autorouter/ar_autoplacer.cpp | 2 +- pcbnew/board_commit.cpp | 22 +- ...board_items_to_polygon_shape_transform.cpp | 8 +- pcbnew/class_board.cpp | 24 +- pcbnew/class_board_item.cpp | 2 +- pcbnew/class_drawsegment.cpp | 19 +- pcbnew/class_drawsegment.h | 28 +- pcbnew/class_edge_mod.cpp | 4 +- pcbnew/class_edge_mod.h | 4 +- pcbnew/class_module.cpp | 60 ++-- pcbnew/class_text_mod.cpp | 2 +- pcbnew/class_text_mod.h | 2 +- pcbnew/class_zone.cpp | 2 +- pcbnew/class_zone.h | 2 +- pcbnew/collectors.cpp | 38 +-- .../convert_drawsegment_list_to_polygon.cpp | 4 +- pcbnew/cross-probing.cpp | 2 +- pcbnew/dialogs/dialog_global_deletion.cpp | 2 +- .../dialog_global_edit_text_and_graphics.cpp | 6 +- pcbnew/dialogs/dialog_pad_properties.cpp | 2 +- pcbnew/dialogs/dialog_text_properties.cpp | 4 +- pcbnew/drc/drc_test_provider.cpp | 10 +- .../drc_test_provider_copper_clearance.cpp | 6 +- .../drc/drc_test_provider_edge_clearance.cpp | 2 +- pcbnew/drc/drc_test_provider_misc.cpp | 2 +- pcbnew/drc/drc_test_provider_silk_to_mask.cpp | 12 +- pcbnew/drc/drc_test_provider_silk_to_silk.cpp | 10 +- pcbnew/edit.cpp | 4 +- pcbnew/exporters/export_gencad.cpp | 6 +- pcbnew/exporters/export_idf.cpp | 4 +- pcbnew/exporters/export_vrml.cpp | 6 +- pcbnew/exporters/gen_drill_report_files.cpp | 2 +- pcbnew/exporters/gerber_placefile_writer.cpp | 4 +- pcbnew/files.cpp | 2 +- pcbnew/footprint_edit_frame.cpp | 2 +- pcbnew/footprint_editor_utils.cpp | 6 +- pcbnew/footprint_libraries_utils.cpp | 2 +- pcbnew/graphics_cleaner.cpp | 4 +- .../import_gfx/graphics_importer_pcbnew.cpp | 12 +- pcbnew/kicad_clipboard.cpp | 8 +- pcbnew/kicad_plugin.cpp | 12 +- pcbnew/legacy_plugin.cpp | 6 +- pcbnew/pcb_painter.cpp | 10 +- pcbnew/plot_board_layers.cpp | 2 +- pcbnew/plot_brditems_plotter.cpp | 15 +- pcbnew/plugins/altium/altium_pcb.cpp | 302 +++++++----------- .../cadstar/cadstar_pcb_archive_loader.cpp | 26 +- .../cadstar/cadstar_pcb_archive_loader.h | 3 +- pcbnew/router/pns_kicad_iface.cpp | 16 +- pcbnew/router/router_tool.cpp | 2 +- .../specctra_export.cpp | 2 +- pcbnew/tools/convert_tool.cpp | 30 +- pcbnew/tools/drawing_tool.cpp | 10 +- pcbnew/tools/drawing_tool.h | 2 +- pcbnew/tools/edit_tool.cpp | 20 +- pcbnew/tools/grid_helper.cpp | 6 +- pcbnew/tools/pcb_selection_conditions.cpp | 8 +- pcbnew/tools/pcb_selection_conditions.h | 8 +- pcbnew/tools/pcb_viewer_tools.cpp | 6 +- pcbnew/tools/pcbnew_control.cpp | 10 +- pcbnew/tools/point_editor.cpp | 75 +++-- pcbnew/tools/selection_tool.cpp | 26 +- pcbnew/zone_filler.cpp | 6 +- .../drc_test_provider_silk_to_pad.cpp | 2 +- qa/pcbnew_utils/board_construction_utils.cpp | 4 +- 74 files changed, 466 insertions(+), 536 deletions(-) diff --git a/3d-viewer/3d_canvas/create_3Dgraphic_brd_items.cpp b/3d-viewer/3d_canvas/create_3Dgraphic_brd_items.cpp index ce5675e457..8f5cbc03e4 100644 --- a/3d-viewer/3d_canvas/create_3Dgraphic_brd_items.cpp +++ b/3d-viewer/3d_canvas/create_3Dgraphic_brd_items.cpp @@ -197,7 +197,7 @@ void BOARD_ADAPTER::AddGraphicsShapesWithClearanceToContainer( const MODULE* aMo { switch( item->Type() ) { - case PCB_MODULE_TEXT_T: + case PCB_FP_TEXT_T: { TEXTE_MODULE* text = static_cast( item ); @@ -207,7 +207,7 @@ void BOARD_ADAPTER::AddGraphicsShapesWithClearanceToContainer( const MODULE* aMo break; - case PCB_MODULE_EDGE_T: + case PCB_FP_SHAPE_T: { outline = (EDGE_MODULE*) item; @@ -751,7 +751,7 @@ void BOARD_ADAPTER::AddShapeWithClearanceToContainer( const DRAWSEGMENT* aDrawSe default: wxFAIL_MSG( "BOARD_ADAPTER::AddShapeWithClearanceToContainer no implementation for " - + STROKE_T_asString( aDrawSegment->GetShape() ) ); + + PCB_SHAPE_TYPE_T_asString( aDrawSegment->GetShape()) ); break; } } diff --git a/3d-viewer/3d_canvas/create_layer_items.cpp b/3d-viewer/3d_canvas/create_layer_items.cpp index ee5bf39b32..5596a78a55 100644 --- a/3d-viewer/3d_canvas/create_layer_items.cpp +++ b/3d-viewer/3d_canvas/create_layer_items.cpp @@ -634,7 +634,7 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter ) switch( item->Type() ) { - case PCB_LINE_T: + case PCB_SHAPE_T: { AddShapeWithClearanceToContainer( (DRAWSEGMENT*)item, layerContainer, @@ -687,7 +687,7 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter ) switch( item->Type() ) { - case PCB_LINE_T: + case PCB_SHAPE_T: ( (DRAWSEGMENT*) item )->TransformShapeWithClearanceToPolygon( *layerPoly, cur_layer_id, 0 ); break; @@ -932,7 +932,7 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter ) switch( item->Type() ) { - case PCB_LINE_T: + case PCB_SHAPE_T: AddShapeWithClearanceToContainer( (DRAWSEGMENT*)item, layerContainer, curr_layer_id, @@ -970,7 +970,7 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter ) switch( item->Type() ) { - case PCB_LINE_T: + case PCB_SHAPE_T: ( (DRAWSEGMENT*) item )->TransformShapeWithClearanceToPolygon( *layerPoly, curr_layer_id, 0 ); break; diff --git a/3d-viewer/3d_canvas/create_layer_poly.cpp b/3d-viewer/3d_canvas/create_layer_poly.cpp index c08a2e7267..cfadf74f24 100644 --- a/3d-viewer/3d_canvas/create_layer_poly.cpp +++ b/3d-viewer/3d_canvas/create_layer_poly.cpp @@ -65,7 +65,7 @@ void BOARD_ADAPTER::transformGraphicModuleEdgeToPolygonSet( const MODULE *aModul { for( BOARD_ITEM* item : aModule->GraphicalItems() ) { - if( item->Type() == PCB_MODULE_EDGE_T ) + if( item->Type() == PCB_FP_SHAPE_T ) { EDGE_MODULE* outline = (EDGE_MODULE*) item; diff --git a/common/base_struct.cpp b/common/base_struct.cpp index 5751d8f0b5..4d202d20e8 100644 --- a/common/base_struct.cpp +++ b/common/base_struct.cpp @@ -781,10 +781,10 @@ static struct EDA_ITEM_DESC .Map( PCB_MODULE_T, _( "Footprint" ) ) .Map( PCB_PAD_T, _( "Pad" ) ) - .Map( PCB_LINE_T, _( "Line" ) ) + .Map( PCB_SHAPE_T, _( "Graphic Shape" ) ) .Map( PCB_TEXT_T, _( "Board Text" ) ) - .Map( PCB_MODULE_TEXT_T, _( "Footprint Text" ) ) - .Map( PCB_MODULE_EDGE_T, _( "Footprint Graphics" ) ) + .Map( PCB_FP_TEXT_T, _( "Footprint Text" ) ) + .Map( PCB_FP_SHAPE_T, _( "Graphic Shape" ) ) .Map( PCB_TRACE_T, _( "Track" ) ) .Map( PCB_VIA_T, _( "Via" ) ) .Map( PCB_MARKER_T, _( "Board Marker" ) ) diff --git a/common/hash_eda.cpp b/common/hash_eda.cpp index 2baef805a6..f8c97d23d4 100644 --- a/common/hash_eda.cpp +++ b/common/hash_eda.cpp @@ -103,7 +103,7 @@ size_t hash_eda( const EDA_ITEM* aItem, int aFlags ) } break; - case PCB_MODULE_TEXT_T: + case PCB_FP_TEXT_T: { const TEXTE_MODULE* text = static_cast( aItem ); @@ -136,7 +136,7 @@ size_t hash_eda( const EDA_ITEM* aItem, int aFlags ) } break; - case PCB_MODULE_EDGE_T: + case PCB_FP_SHAPE_T: { const EDGE_MODULE* segment = static_cast( aItem ); ret = hash_board_item( segment, aFlags ); diff --git a/include/class_board_item.h b/include/class_board_item.h index 99f688a868..c910b597be 100644 --- a/include/class_board_item.h +++ b/include/class_board_item.h @@ -46,11 +46,11 @@ class SHAPE; class PCB_GROUP; /** - * Enum STROKE_T - * is the set of shapes for segments (graphic segments and tracks) which are often + * Enum PCB_SHAPE_TYPE_T + * is the set of shapes for PCB graphics and tracks and footprint graphics * in the .m_Shape member */ -enum STROKE_T +enum PCB_SHAPE_TYPE_T { S_SEGMENT = 0, ///< usual segment : line with rounded ends S_RECT, ///< segment with non rounded ends @@ -61,7 +61,7 @@ enum STROKE_T S_LAST ///< last value for this list }; -static inline wxString STROKE_T_asString( STROKE_T a ) +static inline wxString PCB_SHAPE_TYPE_T_asString( PCB_SHAPE_TYPE_T a ) { switch( a ) { @@ -281,9 +281,9 @@ public: /** * Function ShowShape - * converts the enum STROKE_T integer value to a wxString. + * converts the enum PCB_SHAPE_TYPE_T integer value to a wxString. */ - static wxString ShowShape( STROKE_T aShape ); + static wxString ShowShape( PCB_SHAPE_TYPE_T aShape ); // Some geometric transforms, that must be rewritten for derived classes /** diff --git a/include/core/typeinfo.h b/include/core/typeinfo.h index e97d5d33f1..b175921712 100644 --- a/include/core/typeinfo.h +++ b/include/core/typeinfo.h @@ -88,11 +88,11 @@ enum KICAD_T // Items in pcb PCB_MODULE_T, ///< class MODULE, a footprint PCB_PAD_T, ///< class D_PAD, a pad in a footprint - PCB_LINE_T, ///< class DRAWSEGMENT, a segment not on copper layers + PCB_SHAPE_T, ///< class DRAWSEGMENT, a segment not on copper layers PCB_TEXT_T, ///< class TEXTE_PCB, text on a layer - PCB_MODULE_TEXT_T, ///< class TEXTE_MODULE, text in a footprint - PCB_MODULE_EDGE_T, ///< class EDGE_MODULE, a footprint edge - PCB_MODULE_ZONE_AREA_T, ///< class ZONE_CONTAINER, managed by a footprint + PCB_FP_TEXT_T, ///< class TEXTE_MODULE, text in a footprint + PCB_FP_SHAPE_T, ///< class EDGE_MODULE, a footprint edge + PCB_FP_ZONE_AREA_T, ///< class ZONE_CONTAINER, managed by a footprint PCB_TRACE_T, ///< class TRACK, a track segment (segment on a copper layer) PCB_VIA_T, ///< class VIA, a via (like a track segment on a copper layer) PCB_ARC_T, ///< class ARC, an arc track segment on a copper layer diff --git a/include/preview_items/two_point_assistant.h b/include/preview_items/two_point_assistant.h index 6361197f2e..ebae53238e 100644 --- a/include/preview_items/two_point_assistant.h +++ b/include/preview_items/two_point_assistant.h @@ -33,7 +33,7 @@ namespace KIGFX namespace PREVIEW { - // TODO: required until STROKE_T is either moved into commons or a better approach is found + // TODO: required until PCB_SHAPE_TYPE_T is moved into commons or a better approach is found enum class GEOM_SHAPE { SEGMENT = 0, diff --git a/pcbnew/array_creator.cpp b/pcbnew/array_creator.cpp index 9e97337fed..5ec1adc72d 100644 --- a/pcbnew/array_creator.cpp +++ b/pcbnew/array_creator.cpp @@ -108,7 +108,7 @@ void ARRAY_CREATOR::Invoke() { case PCB_MODULE_T: case PCB_TEXT_T: - case PCB_LINE_T: + case PCB_SHAPE_T: case PCB_TRACE_T: case PCB_VIA_T: case PCB_ZONE_AREA_T: diff --git a/pcbnew/autorouter/ar_autoplacer.cpp b/pcbnew/autorouter/ar_autoplacer.cpp index 1021286498..8be9955740 100644 --- a/pcbnew/autorouter/ar_autoplacer.cpp +++ b/pcbnew/autorouter/ar_autoplacer.cpp @@ -133,7 +133,7 @@ int AR_AUTOPLACER::genPlacementRoutingMatrix() { switch( drawing->Type() ) { - case PCB_LINE_T: + case PCB_SHAPE_T: if( drawing->GetLayer() != Edge_Cuts ) { m_matrix.TraceSegmentPcb( (DRAWSEGMENT*)drawing, CELL_IS_HOLE | CELL_IS_EDGE, diff --git a/pcbnew/board_commit.cpp b/pcbnew/board_commit.cpp index 17f5fd05fd..29b21ebf78 100644 --- a/pcbnew/board_commit.cpp +++ b/pcbnew/board_commit.cpp @@ -148,9 +148,9 @@ void BOARD_COMMIT::Push( const wxString& aMessage, bool aCreateUndoEntry, bool a if( !( changeFlags & CHT_DONE ) ) board->Modules().front()->Add( boardItem ); } - else if( boardItem->Type() == PCB_MODULE_TEXT_T || - boardItem->Type() == PCB_MODULE_EDGE_T || - boardItem->Type() == PCB_MODULE_ZONE_AREA_T ) + else if( boardItem->Type() == PCB_FP_TEXT_T || + boardItem->Type() == PCB_FP_SHAPE_T || + boardItem->Type() == PCB_FP_ZONE_AREA_T ) { wxASSERT( boardItem->GetParent() && boardItem->GetParent()->Type() == PCB_MODULE_T ); @@ -185,13 +185,13 @@ void BOARD_COMMIT::Push( const wxString& aMessage, bool aCreateUndoEntry, bool a { // Module items case PCB_PAD_T: - case PCB_MODULE_EDGE_T: - case PCB_MODULE_TEXT_T: - case PCB_MODULE_ZONE_AREA_T: + case PCB_FP_SHAPE_T: + case PCB_FP_TEXT_T: + case PCB_FP_ZONE_AREA_T: // This level can only handle module items when editing modules wxASSERT( m_editModules ); - if( boardItem->Type() == PCB_MODULE_TEXT_T ) + if( boardItem->Type() == PCB_FP_TEXT_T ) { TEXTE_MODULE* text = static_cast( boardItem ); @@ -212,7 +212,7 @@ void BOARD_COMMIT::Push( const wxString& aMessage, bool aCreateUndoEntry, bool a break; // Board items - case PCB_LINE_T: // a segment not on copper layers + case PCB_SHAPE_T: // a shape (normally not on copper layers) case PCB_TEXT_T: // a text on a layer case PCB_TRACE_T: // a track segment (segment on a copper layer) case PCB_ARC_T: // an arced track segment (segment on a copper layer) @@ -348,9 +348,9 @@ EDA_ITEM* BOARD_COMMIT::parentObject( EDA_ITEM* aItem ) const switch( aItem->Type() ) { case PCB_PAD_T: - case PCB_MODULE_EDGE_T: - case PCB_MODULE_TEXT_T: - case PCB_MODULE_ZONE_AREA_T: + case PCB_FP_SHAPE_T: + case PCB_FP_TEXT_T: + case PCB_FP_ZONE_AREA_T: return aItem->GetParent(); case PCB_ZONE_AREA_T: diff --git a/pcbnew/board_items_to_polygon_shape_transform.cpp b/pcbnew/board_items_to_polygon_shape_transform.cpp index 973cdffdc6..d83138fd50 100644 --- a/pcbnew/board_items_to_polygon_shape_transform.cpp +++ b/pcbnew/board_items_to_polygon_shape_transform.cpp @@ -97,7 +97,7 @@ void BOARD::ConvertBrdLayerToPolygonalContours( PCB_LAYER_ID aLayer, SHAPE_POLY_ switch( item->Type() ) { - case PCB_LINE_T: + case PCB_SHAPE_T: ( (DRAWSEGMENT*) item )->TransformShapeWithClearanceToPolygon( aOutlines, aLayer, 0 ); break; @@ -220,7 +220,7 @@ void MODULE::TransformGraphicShapesWithClearanceToPolygonSet( PCB_LAYER_ID aLaye for( auto item : GraphicalItems() ) { - if( item->Type() == PCB_MODULE_TEXT_T && aIncludeText ) + if( item->Type() == PCB_FP_TEXT_T && aIncludeText ) { TEXTE_MODULE* text = static_cast( item ); @@ -228,7 +228,7 @@ void MODULE::TransformGraphicShapesWithClearanceToPolygonSet( PCB_LAYER_ID aLaye texts.push_back( text ); } - if( item->Type() == PCB_MODULE_EDGE_T && aIncludeEdges ) + if( item->Type() == PCB_FP_SHAPE_T && aIncludeEdges ) { EDGE_MODULE* outline = (EDGE_MODULE*) item; @@ -495,7 +495,7 @@ void DRAWSEGMENT::TransformShapeWithClearanceToPolygon( SHAPE_POLY_SET& aCornerB default: wxFAIL_MSG( "DRAWSEGMENT::TransformShapeWithClearanceToPolygon no implementation for " - + STROKE_T_asString( m_Shape ) ); + + PCB_SHAPE_TYPE_T_asString( m_Shape ) ); break; } } diff --git a/pcbnew/class_board.cpp b/pcbnew/class_board.cpp index 1a9f00525f..562facf3c4 100644 --- a/pcbnew/class_board.cpp +++ b/pcbnew/class_board.cpp @@ -245,7 +245,7 @@ void BOARD::Move( const wxPoint& aMoveVector ) // overload static const KICAD_T top_level_board_stuff[] = { PCB_MARKER_T, PCB_TEXT_T, - PCB_LINE_T, + PCB_SHAPE_T, PCB_DIM_ALIGNED_T, PCB_DIM_LEADER_T, PCB_TARGET_T, @@ -253,7 +253,7 @@ void BOARD::Move( const wxPoint& aMoveVector ) // overload PCB_TRACE_T, PCB_ARC_T, // PCB_PAD_T, Can't be at board level - // PCB_MODULE_TEXT_T, Can't be at board level + // PCB_FP_TEXT_T, Can't be at board level PCB_MODULE_T, PCB_ZONE_AREA_T, EOT @@ -609,7 +609,7 @@ void BOARD::Add( BOARD_ITEM* aBoardItem, ADD_MODE aMode ) case PCB_DIM_CENTER_T: case PCB_DIM_ORTHOGONAL_T: case PCB_DIM_LEADER_T: - case PCB_LINE_T: + case PCB_SHAPE_T: case PCB_TEXT_T: case PCB_TARGET_T: if( aMode == ADD_MODE::APPEND ) @@ -699,7 +699,7 @@ void BOARD::Remove( BOARD_ITEM* aBoardItem ) case PCB_DIM_CENTER_T: case PCB_DIM_ORTHOGONAL_T: case PCB_DIM_LEADER_T: - case PCB_LINE_T: + case PCB_SHAPE_T: case PCB_TEXT_T: case PCB_TARGET_T: m_drawings.erase( std::remove_if( m_drawings.begin(), m_drawings.end(), @@ -1119,9 +1119,9 @@ SEARCH_RESULT BOARD::Visit( INSPECTOR inspector, void* testData, const KICAD_T s case PCB_MODULE_T: case PCB_PAD_T: - case PCB_MODULE_TEXT_T: - case PCB_MODULE_EDGE_T: - case PCB_MODULE_ZONE_AREA_T: + case PCB_FP_TEXT_T: + case PCB_FP_SHAPE_T: + case PCB_FP_ZONE_AREA_T: // this calls MODULE::Visit() on each module. result = IterateForward( m_modules, inspector, testData, p ); @@ -1133,9 +1133,9 @@ SEARCH_RESULT BOARD::Visit( INSPECTOR inspector, void* testData, const KICAD_T s { case PCB_MODULE_T: case PCB_PAD_T: - case PCB_MODULE_TEXT_T: - case PCB_MODULE_EDGE_T: - case PCB_MODULE_ZONE_AREA_T: + case PCB_FP_TEXT_T: + case PCB_FP_SHAPE_T: + case PCB_FP_ZONE_AREA_T: continue; default: @@ -1147,7 +1147,7 @@ SEARCH_RESULT BOARD::Visit( INSPECTOR inspector, void* testData, const KICAD_T s break; - case PCB_LINE_T: + case PCB_SHAPE_T: case PCB_TEXT_T: case PCB_DIM_ALIGNED_T: case PCB_DIM_CENTER_T: @@ -1161,7 +1161,7 @@ SEARCH_RESULT BOARD::Visit( INSPECTOR inspector, void* testData, const KICAD_T s { switch( stype = *++p ) { - case PCB_LINE_T: + case PCB_SHAPE_T: case PCB_TEXT_T: case PCB_DIM_ALIGNED_T: case PCB_DIM_CENTER_T: diff --git a/pcbnew/class_board_item.cpp b/pcbnew/class_board_item.cpp index 8785710bc9..6d2b3a96fb 100644 --- a/pcbnew/class_board_item.cpp +++ b/pcbnew/class_board_item.cpp @@ -29,7 +29,7 @@ #include #include -wxString BOARD_ITEM::ShowShape( STROKE_T aShape ) +wxString BOARD_ITEM::ShowShape( PCB_SHAPE_TYPE_T aShape ) { switch( aShape ) { diff --git a/pcbnew/class_drawsegment.cpp b/pcbnew/class_drawsegment.cpp index 6eef603555..062868f99c 100644 --- a/pcbnew/class_drawsegment.cpp +++ b/pcbnew/class_drawsegment.cpp @@ -237,7 +237,8 @@ void DRAWSEGMENT::Rotate( const wxPoint& aRotCentre, double aAngle ) break; default: - wxFAIL_MSG( "DRAWSEGMENT::Rotate not implemented for " + STROKE_T_asString( m_Shape ) ); + wxFAIL_MSG( "DRAWSEGMENT::Rotate not implemented for " + + PCB_SHAPE_TYPE_T_asString( m_Shape ) ); break; } } @@ -292,7 +293,8 @@ void DRAWSEGMENT::Flip( const wxPoint& aCentre, bool aFlipLeftRight ) break; default: - wxFAIL_MSG( "DRAWSEGMENT::Flip not implemented for " + STROKE_T_asString( m_Shape ) ); + wxFAIL_MSG( "DRAWSEGMENT::Flip not implemented for " + + PCB_SHAPE_TYPE_T_asString( m_Shape ) ); break; } @@ -351,7 +353,8 @@ wxPoint DRAWSEGMENT::GetCenter() const break; default: - wxFAIL_MSG( "DRAWSEGMENT::GetCentre not implemented for " + STROKE_T_asString( m_Shape ) ); + wxFAIL_MSG( "DRAWSEGMENT::GetCentre not implemented for " + + PCB_SHAPE_TYPE_T_asString( m_Shape ) ); break; } @@ -614,7 +617,7 @@ const EDA_RECT DRAWSEGMENT::GetBoundingBox() const default: wxFAIL_MSG( "DRAWSEGMENT::GetBoundingBox not implemented for " - + STROKE_T_asString( m_Shape ) ); + + PCB_SHAPE_TYPE_T_asString( m_Shape ) ); break; } @@ -746,7 +749,7 @@ bool DRAWSEGMENT::HitTest( const wxPoint& aPosition, int aAccuracy ) const default: wxFAIL_MSG( "DRAWSEGMENT::HitTest (point) not implemented for " - + STROKE_T_asString( m_Shape ) ); + + PCB_SHAPE_TYPE_T_asString( m_Shape ) ); break; } @@ -903,7 +906,7 @@ bool DRAWSEGMENT::HitTest( const EDA_RECT& aRect, bool aContained, int aAccuracy default: wxFAIL_MSG( "DRAWSEGMENT::HitTest (rect) not implemented for " - + STROKE_T_asString( m_Shape ) ); + + PCB_SHAPE_TYPE_T_asString( m_Shape ) ); break; } @@ -1156,7 +1159,7 @@ std::vector DRAWSEGMENT::MakeEffectiveShapes() const default: wxFAIL_MSG( "DRAWSEGMENT::MakeEffectiveShapes unsupported DRAWSEGMENT shape: " - + STROKE_T_asString( m_Shape ) ); + + PCB_SHAPE_TYPE_T_asString( m_Shape ) ); break; } @@ -1242,7 +1245,7 @@ bool DRAWSEGMENT::cmp_drawings::operator()( const BOARD_ITEM* aFirst, const BOAR if( aFirst->GetLayer() != aSecond->GetLayer() ) return aFirst->GetLayer() < aSecond->GetLayer(); - if( aFirst->Type() == PCB_LINE_T ) + if( aFirst->Type() == PCB_SHAPE_T ) { const DRAWSEGMENT* dwgA = static_cast( aFirst ); const DRAWSEGMENT* dwgB = static_cast( aSecond ); diff --git a/pcbnew/class_drawsegment.h b/pcbnew/class_drawsegment.h index aa0ebabfb7..f231871624 100644 --- a/pcbnew/class_drawsegment.h +++ b/pcbnew/class_drawsegment.h @@ -48,19 +48,19 @@ class MSG_PANEL_ITEM; class DRAWSEGMENT : public BOARD_ITEM { protected: - int m_Width; ///< thickness of lines ... - wxPoint m_Start; ///< Line start point or Circle and Arc center - wxPoint m_End; ///< Line end point or circle and arc start point - wxPoint m_ThirdPoint; ///< Used only for Arcs: arc end point + int m_Width; // thickness of lines ... + wxPoint m_Start; // Line start point or Circle and Arc center + wxPoint m_End; // Line end point or circle and arc start point + wxPoint m_ThirdPoint; // Used only for Arcs: arc end point - STROKE_T m_Shape; ///< Shape: line, Circle, Arc - int m_Type; ///< Used in complex associations ( Dimensions.. ) - double m_Angle; ///< Used only for Arcs: Arc angle in 1/10 deg - wxPoint m_BezierC1; ///< Bezier Control Point 1 - wxPoint m_BezierC2; ///< Bezier Control Point 2 + PCB_SHAPE_TYPE_T m_Shape; // Shape: line, Circle, Arc + int m_Type; // Used in complex associations ( Dimensions.. ) + double m_Angle; // Used only for Arcs: Arc angle in 1/10 deg + wxPoint m_BezierC1; // Bezier Control Point 1 + wxPoint m_BezierC2; // Bezier Control Point 2 std::vector m_BezierPoints; - SHAPE_POLY_SET m_Poly; ///< Stores the S_POLYGON shape + SHAPE_POLY_SET m_Poly; // Stores the S_POLYGON shape // Computes the bounding box for an arc void computeArcBBox( EDA_RECT& aBBox ) const; @@ -68,7 +68,7 @@ protected: const std::vector buildBezierToSegmentsPointsList( int aMinSegLen ) const; public: - DRAWSEGMENT( BOARD_ITEM* aParent = NULL, KICAD_T idtype = PCB_LINE_T ); + DRAWSEGMENT( BOARD_ITEM* aParent = NULL, KICAD_T idtype = PCB_SHAPE_T ); // Do not create a copy constructor & operator=. // The ones generated by the compiler are adequate. @@ -77,7 +77,7 @@ public: static inline bool ClassOf( const EDA_ITEM* aItem ) { - return aItem && PCB_LINE_T == aItem->Type(); + return aItem && PCB_SHAPE_T == aItem->Type(); } bool IsType( const KICAD_T aScanTypes[] ) const override @@ -115,8 +115,8 @@ public: void SetType( int aType ) { m_Type = aType; } int GetType() const { return m_Type; } - void SetShape( STROKE_T aShape ) { m_Shape = aShape; } - STROKE_T GetShape() const { return m_Shape; } + void SetShape( PCB_SHAPE_TYPE_T aShape ) { m_Shape = aShape; } + PCB_SHAPE_TYPE_T GetShape() const { return m_Shape; } void SetBezControl1( const wxPoint& aPoint ) { m_BezierC1 = aPoint; } const wxPoint& GetBezControl1() const { return m_BezierC1; } diff --git a/pcbnew/class_edge_mod.cpp b/pcbnew/class_edge_mod.cpp index 175ba7c03b..48593c20d1 100644 --- a/pcbnew/class_edge_mod.cpp +++ b/pcbnew/class_edge_mod.cpp @@ -35,8 +35,8 @@ #include -EDGE_MODULE::EDGE_MODULE( MODULE* parent, STROKE_T aShape ) : - DRAWSEGMENT( parent, PCB_MODULE_EDGE_T ) +EDGE_MODULE::EDGE_MODULE( MODULE* parent, PCB_SHAPE_TYPE_T aShape ) : + DRAWSEGMENT( parent, PCB_FP_SHAPE_T ) { m_Shape = aShape; m_Angle = 0; diff --git a/pcbnew/class_edge_mod.h b/pcbnew/class_edge_mod.h index 66e684322d..cbdb6e106f 100644 --- a/pcbnew/class_edge_mod.h +++ b/pcbnew/class_edge_mod.h @@ -44,7 +44,7 @@ class MSG_PANEL_ITEM; class EDGE_MODULE : public DRAWSEGMENT { public: - EDGE_MODULE( MODULE* parent, STROKE_T aShape = S_SEGMENT ); + EDGE_MODULE( MODULE* parent, PCB_SHAPE_TYPE_T aShape = S_SEGMENT ); // Do not create a copy constructor & operator=. // The ones generated by the compiler are adequate. @@ -53,7 +53,7 @@ public: static inline bool ClassOf( const EDA_ITEM* aItem ) { - return aItem && PCB_MODULE_EDGE_T == aItem->Type(); + return aItem && PCB_FP_SHAPE_T == aItem->Type(); } bool IsType( const KICAD_T aScanTypes[] ) const override diff --git a/pcbnew/class_module.cpp b/pcbnew/class_module.cpp index 549610d4ca..5dfe23f923 100644 --- a/pcbnew/class_module.cpp +++ b/pcbnew/class_module.cpp @@ -431,12 +431,12 @@ void MODULE::Add( BOARD_ITEM* aBoardItem, ADD_MODE aMode ) { switch( aBoardItem->Type() ) { - case PCB_MODULE_TEXT_T: + case PCB_FP_TEXT_T: // Only user text can be added this way. assert( static_cast( aBoardItem )->GetType() == TEXTE_MODULE::TEXT_is_DIVERS ); KI_FALLTHROUGH; - case PCB_MODULE_EDGE_T: + case PCB_FP_SHAPE_T: if( aMode == ADD_MODE::APPEND ) m_drawings.push_back( aBoardItem ); else @@ -450,7 +450,7 @@ void MODULE::Add( BOARD_ITEM* aBoardItem, ADD_MODE aMode ) m_pads.push_front( static_cast( aBoardItem ) ); break; - case PCB_MODULE_ZONE_AREA_T: + case PCB_FP_ZONE_AREA_T: if( aMode == ADD_MODE::APPEND ) m_fp_zones.push_back( static_cast( aBoardItem ) ); else @@ -484,14 +484,14 @@ void MODULE::Remove( BOARD_ITEM* aBoardItem ) { switch( aBoardItem->Type() ) { - case PCB_MODULE_TEXT_T: + case PCB_FP_TEXT_T: // Only user text can be removed this way. wxCHECK_RET( static_cast( aBoardItem )->GetType() == TEXTE_MODULE::TEXT_is_DIVERS, "Please report this bug: Invalid remove operation on required text" ); KI_FALLTHROUGH; - case PCB_MODULE_EDGE_T: + case PCB_FP_SHAPE_T: for( auto it = m_drawings.begin(); it != m_drawings.end(); ++it ) { if( *it == aBoardItem ) @@ -515,7 +515,7 @@ void MODULE::Remove( BOARD_ITEM* aBoardItem ) break; - case PCB_MODULE_ZONE_AREA_T: + case PCB_FP_ZONE_AREA_T: for( auto it = m_fp_zones.begin(); it != m_fp_zones.end(); ++it ) { if( *it == static_cast( aBoardItem ) ) @@ -574,7 +574,7 @@ EDA_RECT MODULE::GetFootprintRect() const for( BOARD_ITEM* item : m_drawings ) { - if( item->Type() == PCB_MODULE_EDGE_T ) + if( item->Type() == PCB_FP_SHAPE_T ) area.Merge( item->GetBoundingBox() ); } @@ -625,7 +625,7 @@ const EDA_RECT MODULE::GetBoundingBox( bool aIncludeInvisibleText ) const // Add in items not collected by GetFootprintRect(): for( BOARD_ITEM* item : m_drawings ) { - if( item->Type() != PCB_MODULE_EDGE_T ) + if( item->Type() != PCB_FP_SHAPE_T ) area.Merge( item->GetBoundingBox() ); } @@ -971,12 +971,12 @@ SEARCH_RESULT MODULE::Visit( INSPECTOR inspector, void* testData, const KICAD_T ++p; break; - case PCB_MODULE_ZONE_AREA_T: + case PCB_FP_ZONE_AREA_T: result = IterateForward( m_fp_zones, inspector, testData, p ); ++p; break; - case PCB_MODULE_TEXT_T: + case PCB_FP_TEXT_T: result = inspector( m_Reference, testData ); if( result == SEARCH_RESULT::QUIT ) @@ -990,7 +990,7 @@ SEARCH_RESULT MODULE::Visit( INSPECTOR inspector, void* testData, const KICAD_T // Intentionally fall through since m_Drawings can hold TYPETEXTMODULE also KI_FALLTHROUGH; - case PCB_MODULE_EDGE_T: + case PCB_FP_SHAPE_T: result = IterateForward( m_drawings, inspector, testData, p ); // skip over any types handled in the above call. @@ -998,8 +998,8 @@ SEARCH_RESULT MODULE::Visit( INSPECTOR inspector, void* testData, const KICAD_T { switch( stype = *++p ) { - case PCB_MODULE_TEXT_T: - case PCB_MODULE_EDGE_T: + case PCB_FP_TEXT_T: + case PCB_FP_SHAPE_T: continue; default: @@ -1235,7 +1235,7 @@ void MODULE::Rotate( const wxPoint& aRotCentre, double aAngle ) for( BOARD_ITEM* item : m_drawings ) { - if( item->Type() == PCB_MODULE_TEXT_T ) + if( item->Type() == PCB_FP_TEXT_T ) static_cast( item )->KeepUpright( orientation, newOrientation ); } } @@ -1285,11 +1285,11 @@ void MODULE::Flip( const wxPoint& aCentre, bool aFlipLeftRight ) { switch( item->Type() ) { - case PCB_MODULE_EDGE_T: + case PCB_FP_SHAPE_T: static_cast( item )->Flip( m_Pos, false ); break; - case PCB_MODULE_TEXT_T: + case PCB_FP_TEXT_T: static_cast( item )->Flip( m_Pos, false ); break; @@ -1328,14 +1328,14 @@ void MODULE::SetPosition( const wxPoint& aPos ) { switch( item->Type() ) { - case PCB_MODULE_EDGE_T: + case PCB_FP_SHAPE_T: { EDGE_MODULE* pt_edgmod = (EDGE_MODULE*) item; pt_edgmod->SetDrawCoord(); break; } - case PCB_MODULE_TEXT_T: + case PCB_FP_TEXT_T: { TEXTE_MODULE* text = static_cast( item ); text->EDA_TEXT::Offset( delta ); @@ -1385,14 +1385,14 @@ void MODULE::MoveAnchorPosition( const wxPoint& aMoveVector ) { switch( item->Type() ) { - case PCB_MODULE_EDGE_T: + case PCB_FP_SHAPE_T: { EDGE_MODULE* edge = static_cast( item ); edge->Move( moveVector ); } break; - case PCB_MODULE_TEXT_T: + case PCB_FP_TEXT_T: { TEXTE_MODULE* text = static_cast( item ); text->SetPos0( text->GetPos0() + moveVector ); @@ -1435,11 +1435,11 @@ void MODULE::SetOrientation( double aNewAngle ) // Displace contours and text of the footprint. for( BOARD_ITEM* item : m_drawings ) { - if( item->Type() == PCB_MODULE_EDGE_T ) + if( item->Type() == PCB_FP_SHAPE_T ) { static_cast( item )->SetDrawCoord(); } - else if( item->Type() == PCB_MODULE_TEXT_T ) + else if( item->Type() == PCB_FP_TEXT_T ) { static_cast( item )->SetDrawCoord(); } @@ -1480,7 +1480,7 @@ BOARD_ITEM* MODULE::DuplicateItem( const BOARD_ITEM* aItem, bool aAddToModule ) break; } - case PCB_MODULE_ZONE_AREA_T: + case PCB_FP_ZONE_AREA_T: { new_zone = new MODULE_ZONE_CONTAINER( *static_cast( aItem ) ); const_cast( new_zone->m_Uuid ) = KIID(); @@ -1492,7 +1492,7 @@ BOARD_ITEM* MODULE::DuplicateItem( const BOARD_ITEM* aItem, bool aAddToModule ) break; } - case PCB_MODULE_TEXT_T: + case PCB_FP_TEXT_T: { TEXTE_MODULE* new_text = new TEXTE_MODULE( *static_cast( aItem ) ); const_cast( new_text->m_Uuid ) = KIID(); @@ -1516,7 +1516,7 @@ BOARD_ITEM* MODULE::DuplicateItem( const BOARD_ITEM* aItem, bool aAddToModule ) break; } - case PCB_MODULE_EDGE_T: + case PCB_FP_SHAPE_T: { EDGE_MODULE* new_edge = new EDGE_MODULE( *static_cast( aItem ) ); const_cast( new_edge->m_Uuid ) = KIID(); @@ -1622,7 +1622,7 @@ double MODULE::CoverageRatio( const GENERAL_COLLECTOR& aCollector ) const switch( item->Type() ) { case PCB_TEXT_T: - case PCB_MODULE_TEXT_T: + case PCB_FP_TEXT_T: case PCB_TRACE_T: case PCB_ARC_T: case PCB_VIA_T: @@ -1673,17 +1673,17 @@ bool MODULE::BuildPolyCourtyard() m_poly_courtyard_front.RemoveAllContours(); m_poly_courtyard_back.RemoveAllContours(); // Build the courtyard area from graphic items on the courtyard. - // Only PCB_MODULE_EDGE_T have meaning, graphic texts are ignored. + // Only PCB_FP_SHAPE_T have meaning, graphic texts are ignored. // Collect items: std::vector< DRAWSEGMENT* > list_front; std::vector< DRAWSEGMENT* > list_back; for( BOARD_ITEM* item : GraphicalItems() ) { - if( item->GetLayer() == B_CrtYd && item->Type() == PCB_MODULE_EDGE_T ) + if( item->GetLayer() == B_CrtYd && item->Type() == PCB_FP_SHAPE_T ) list_back.push_back( static_cast< DRAWSEGMENT* > ( item ) ); - if( item->GetLayer() == F_CrtYd && item->Type() == PCB_MODULE_EDGE_T ) + if( item->GetLayer() == F_CrtYd && item->Type() == PCB_FP_SHAPE_T ) list_front.push_back( static_cast< DRAWSEGMENT* > ( item ) ); } @@ -1746,7 +1746,7 @@ bool MODULE::cmp_drawings::operator()( const BOARD_ITEM* aFirst, const BOARD_ITE if( aFirst->GetLayer() != aSecond->GetLayer() ) return aFirst->GetLayer() < aSecond->GetLayer(); - if( aFirst->Type() == PCB_MODULE_EDGE_T ) + if( aFirst->Type() == PCB_FP_SHAPE_T ) { const EDGE_MODULE* dwgA = static_cast( aFirst ); const EDGE_MODULE* dwgB = static_cast( aSecond ); diff --git a/pcbnew/class_text_mod.cpp b/pcbnew/class_text_mod.cpp index 9198026bd7..84b7308da2 100644 --- a/pcbnew/class_text_mod.cpp +++ b/pcbnew/class_text_mod.cpp @@ -31,7 +31,7 @@ #include TEXTE_MODULE::TEXTE_MODULE( MODULE* parent, TEXT_TYPE text_type ) : - BOARD_ITEM( parent, PCB_MODULE_TEXT_T ), + BOARD_ITEM( parent, PCB_FP_TEXT_T ), EDA_TEXT() { MODULE* module = static_cast( m_Parent ); diff --git a/pcbnew/class_text_mod.h b/pcbnew/class_text_mod.h index dbf4ddbe9c..9ba4f41f27 100644 --- a/pcbnew/class_text_mod.h +++ b/pcbnew/class_text_mod.h @@ -71,7 +71,7 @@ public: static inline bool ClassOf( const EDA_ITEM* aItem ) { - return aItem && PCB_MODULE_TEXT_T == aItem->Type(); + return aItem && aItem->Type() == PCB_FP_TEXT_T; } bool IsType( const KICAD_T aScanTypes[] ) const override diff --git a/pcbnew/class_zone.cpp b/pcbnew/class_zone.cpp index faef0e0220..79fe385be6 100644 --- a/pcbnew/class_zone.cpp +++ b/pcbnew/class_zone.cpp @@ -37,7 +37,7 @@ #include ZONE_CONTAINER::ZONE_CONTAINER( BOARD_ITEM_CONTAINER* aParent, bool aInModule ) - : BOARD_CONNECTED_ITEM( aParent, aInModule ? PCB_MODULE_ZONE_AREA_T : PCB_ZONE_AREA_T ), + : BOARD_CONNECTED_ITEM( aParent, aInModule ? PCB_FP_ZONE_AREA_T : PCB_ZONE_AREA_T ), m_area( 0.0 ) { m_CornerSelection = nullptr; // no corner is selected diff --git a/pcbnew/class_zone.h b/pcbnew/class_zone.h index e2dedb934e..a25008f6d4 100644 --- a/pcbnew/class_zone.h +++ b/pcbnew/class_zone.h @@ -68,7 +68,7 @@ public: * if aInModule is true, a MODULE_ZONE_CONTAINER is actually built * (same item, but with a specific type id: * The type is PCB_ZONE_AREA_T for a ZONE_CONTAINER - * The type is PCB_MODULE_ZONE_AREA_T for a MODULE_ZONE_CONTAINER + * The type is PCB_FP_ZONE_AREA_T for a MODULE_ZONE_CONTAINER */ ZONE_CONTAINER( BOARD_ITEM_CONTAINER* parent, bool aInModule = false ); diff --git a/pcbnew/collectors.cpp b/pcbnew/collectors.cpp index 28c2280715..bc806371d3 100644 --- a/pcbnew/collectors.cpp +++ b/pcbnew/collectors.cpp @@ -48,7 +48,7 @@ const KICAD_T GENERAL_COLLECTOR::AllBoardItems[] = { // *** all items in a same list (shown here) must be contiguous **** PCB_MARKER_T, // in m_markers PCB_TEXT_T, // in m_drawings - PCB_LINE_T, // in m_drawings + PCB_SHAPE_T, // in m_drawings PCB_DIM_ALIGNED_T, // in m_drawings PCB_DIM_CENTER_T, // in m_drawings PCB_DIM_ORTHOGONAL_T, // in m_drawings @@ -58,7 +58,7 @@ const KICAD_T GENERAL_COLLECTOR::AllBoardItems[] = { PCB_TRACE_T, // in m_tracks PCB_ARC_T, // in m_tracks PCB_PAD_T, // in modules - PCB_MODULE_TEXT_T, // in modules + PCB_FP_TEXT_T, // in modules PCB_MODULE_T, // in m_modules PCB_GROUP_T, // in m_groups PCB_ZONE_AREA_T, // in m_zones @@ -69,7 +69,7 @@ const KICAD_T GENERAL_COLLECTOR::AllBoardItems[] = { const KICAD_T GENERAL_COLLECTOR::BoardLevelItems[] = { PCB_MARKER_T, PCB_TEXT_T, - PCB_LINE_T, + PCB_SHAPE_T, PCB_DIM_ALIGNED_T, PCB_DIM_ORTHOGONAL_T, PCB_DIM_CENTER_T, @@ -88,7 +88,7 @@ const KICAD_T GENERAL_COLLECTOR::BoardLevelItems[] = { const KICAD_T GENERAL_COLLECTOR::AllButZones[] = { PCB_MARKER_T, PCB_TEXT_T, - PCB_LINE_T, + PCB_SHAPE_T, PCB_DIM_ALIGNED_T, PCB_DIM_ORTHOGONAL_T, PCB_DIM_CENTER_T, @@ -98,7 +98,7 @@ const KICAD_T GENERAL_COLLECTOR::AllButZones[] = { PCB_TRACE_T, PCB_ARC_T, PCB_PAD_T, - PCB_MODULE_TEXT_T, + PCB_FP_TEXT_T, PCB_MODULE_T, PCB_GROUP_T, PCB_ZONE_AREA_T, // if it is visible on screen, it should be selectable @@ -130,20 +130,20 @@ const KICAD_T GENERAL_COLLECTOR::PadsOrTracks[] = { const KICAD_T GENERAL_COLLECTOR::ModulesAndTheirItems[] = { PCB_MODULE_T, - PCB_MODULE_TEXT_T, - PCB_MODULE_EDGE_T, + PCB_FP_TEXT_T, + PCB_FP_SHAPE_T, PCB_PAD_T, - PCB_MODULE_ZONE_AREA_T, + PCB_FP_ZONE_AREA_T, PCB_GROUP_T, EOT }; const KICAD_T GENERAL_COLLECTOR::ModuleItems[] = { - PCB_MODULE_TEXT_T, - PCB_MODULE_EDGE_T, + PCB_FP_TEXT_T, + PCB_FP_SHAPE_T, PCB_PAD_T, - PCB_MODULE_ZONE_AREA_T, + PCB_FP_ZONE_AREA_T, PCB_GROUP_T, EOT }; @@ -169,7 +169,7 @@ const KICAD_T GENERAL_COLLECTOR::LockableItems[] = { const KICAD_T GENERAL_COLLECTOR::Zones[] = { PCB_ZONE_AREA_T, - PCB_MODULE_ZONE_AREA_T, + PCB_FP_ZONE_AREA_T, EOT }; @@ -226,7 +226,7 @@ SEARCH_RESULT GENERAL_COLLECTOR::Inspect( EDA_ITEM* testItem, void* testData ) breakhere++; break; - case PCB_LINE_T: + case PCB_SHAPE_T: breakhere++; break; @@ -234,7 +234,7 @@ SEARCH_RESULT GENERAL_COLLECTOR::Inspect( EDA_ITEM* testItem, void* testData ) breakhere++; break; - case PCB_MODULE_TEXT_T: + case PCB_FP_TEXT_T: { TEXTE_MODULE* tm = (TEXTE_MODULE*) item; @@ -303,7 +303,7 @@ SEARCH_RESULT GENERAL_COLLECTOR::Inspect( EDA_ITEM* testItem, void* testData ) goto exit; break; - case PCB_MODULE_ZONE_AREA_T: + case PCB_FP_ZONE_AREA_T: module = static_cast( item->GetParent() ); // Fallthrough to get the zone as well @@ -316,7 +316,7 @@ SEARCH_RESULT GENERAL_COLLECTOR::Inspect( EDA_ITEM* testItem, void* testData ) case PCB_TEXT_T: break; - case PCB_LINE_T: + case PCB_SHAPE_T: drawSegment = static_cast( item ); break; @@ -329,7 +329,7 @@ SEARCH_RESULT GENERAL_COLLECTOR::Inspect( EDA_ITEM* testItem, void* testData ) case PCB_TARGET_T: break; - case PCB_MODULE_TEXT_T: + case PCB_FP_TEXT_T: { TEXTE_MODULE *text = static_cast( item ); if( m_Guide->IgnoreMTextsMarkedNoShow() && !text->IsVisible() ) @@ -371,7 +371,7 @@ SEARCH_RESULT GENERAL_COLLECTOR::Inspect( EDA_ITEM* testItem, void* testData ) } break; - case PCB_MODULE_EDGE_T: + case PCB_FP_SHAPE_T: drawSegment = static_cast( item ); break; @@ -393,7 +393,7 @@ SEARCH_RESULT GENERAL_COLLECTOR::Inspect( EDA_ITEM* testItem, void* testData ) // common tests: - if( module ) // true from case PCB_PAD_T, PCB_MODULE_TEXT_T, or PCB_MODULE_T + if( module ) // true from case PCB_PAD_T, PCB_FP_TEXT_T, or PCB_MODULE_T { if( m_Guide->IgnoreModulesOnBack() && (module->GetLayer() == B_Cu) ) goto exit; diff --git a/pcbnew/convert_drawsegment_list_to_polygon.cpp b/pcbnew/convert_drawsegment_list_to_polygon.cpp index 4325b82e07..93300ebda6 100644 --- a/pcbnew/convert_drawsegment_list_to_polygon.cpp +++ b/pcbnew/convert_drawsegment_list_to_polygon.cpp @@ -783,7 +783,7 @@ bool BuildBoardPolygonOutlines( BOARD* aBoard, SHAPE_POLY_SET& aOutlines, wxStri // Get all the DRAWSEGMENTS and module graphics into 'items', // then keep only those on layer == Edge_Cuts. - static const KICAD_T scan_graphics[] = { PCB_LINE_T, PCB_MODULE_EDGE_T, EOT }; + static const KICAD_T scan_graphics[] = { PCB_SHAPE_T, PCB_FP_SHAPE_T, EOT }; items.Collect( aBoard, scan_graphics ); // Make a working copy of aSegList, because the list is modified during calculations @@ -1004,7 +1004,7 @@ bool BuildFootprintPolygonOutlines( BOARD* aBoard, SHAPE_POLY_SET& aOutlines, // Get all the DRAWSEGMENTS and module graphics into 'items', // then keep only those on layer == Edge_Cuts. - static const KICAD_T scan_graphics[] = { PCB_LINE_T, PCB_MODULE_EDGE_T, EOT }; + static const KICAD_T scan_graphics[] = { PCB_SHAPE_T, PCB_FP_SHAPE_T, EOT }; items.Collect( aBoard, scan_graphics ); // Make a working copy of aSegList, because the list is modified during calculations diff --git a/pcbnew/cross-probing.cpp b/pcbnew/cross-probing.cpp index c2e200ce2d..2fb2fbca52 100644 --- a/pcbnew/cross-probing.cpp +++ b/pcbnew/cross-probing.cpp @@ -419,7 +419,7 @@ std::string FormatProbeItem( BOARD_ITEM* aItem ) TO_UTF8( pad ) ); } - case PCB_MODULE_TEXT_T: + case PCB_FP_TEXT_T: { module = static_cast( aItem->GetParent() ); diff --git a/pcbnew/dialogs/dialog_global_deletion.cpp b/pcbnew/dialogs/dialog_global_deletion.cpp index 7778d946ed..81982990c3 100644 --- a/pcbnew/dialogs/dialog_global_deletion.cpp +++ b/pcbnew/dialogs/dialog_global_deletion.cpp @@ -161,7 +161,7 @@ void DIALOG_GLOBAL_DELETION::AcceptPcbDelete() LAYER_NUM layer = dwg->GetLayer(); if( delAll - || ( type == PCB_LINE_T && delDrawings && masque_layer[layer] ) + || ( type == PCB_SHAPE_T && delDrawings && masque_layer[layer] ) || ( type == PCB_TEXT_T && delTexts && del_text_layers[layer] ) ) { commit.Remove( dwg ); diff --git a/pcbnew/dialogs/dialog_global_edit_text_and_graphics.cpp b/pcbnew/dialogs/dialog_global_edit_text_and_graphics.cpp index d73d9adcd8..3a5fb92f5a 100644 --- a/pcbnew/dialogs/dialog_global_edit_text_and_graphics.cpp +++ b/pcbnew/dialogs/dialog_global_edit_text_and_graphics.cpp @@ -375,7 +375,7 @@ bool DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS::TransferDataFromWindow() // Go through all other module items for( BOARD_ITEM* boardItem : module->GraphicalItems() ) { - if( boardItem->Type() == PCB_MODULE_TEXT_T ) + if( boardItem->Type() == PCB_FP_TEXT_T ) { // We are guaranteed to always get an EDA_TEXT in this statement, but we must // use the dynamic_cast to move through the type tree anyway. @@ -388,7 +388,7 @@ bool DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS::TransferDataFromWindow() else if( m_otherFields->GetValue() ) visitItem( commit, boardItem ); } - else if( boardItem->Type() == PCB_MODULE_EDGE_T ) + else if( boardItem->Type() == PCB_FP_SHAPE_T ) { if( m_footprintGraphics->GetValue() ) visitItem( commit, boardItem ); @@ -404,7 +404,7 @@ bool DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS::TransferDataFromWindow() if( m_boardText->GetValue() ) visitItem( commit, boardItem ); } - else if( boardItem->Type() == PCB_LINE_T ) + else if( boardItem->Type() == PCB_SHAPE_T ) { if( m_boardGraphics->GetValue() ) visitItem( commit, boardItem ); diff --git a/pcbnew/dialogs/dialog_pad_properties.cpp b/pcbnew/dialogs/dialog_pad_properties.cpp index c033be1c14..abeac6c619 100644 --- a/pcbnew/dialogs/dialog_pad_properties.cpp +++ b/pcbnew/dialogs/dialog_pad_properties.cpp @@ -2033,7 +2033,7 @@ void DIALOG_PAD_PROPERTIES::onAddPrimitive( wxCommandEvent& event ) if( type == -1 ) return; - STROKE_T listtype[] = { S_SEGMENT, S_ARC, S_CURVE, S_CIRCLE, S_POLYGON }; + PCB_SHAPE_TYPE_T listtype[] = { S_SEGMENT, S_ARC, S_CURVE, S_CIRCLE, S_POLYGON }; DRAWSEGMENT* primitive = new DRAWSEGMENT(); primitive->SetShape( listtype[type] ); diff --git a/pcbnew/dialogs/dialog_text_properties.cpp b/pcbnew/dialogs/dialog_text_properties.cpp index 2422aa8cae..fa267008af 100644 --- a/pcbnew/dialogs/dialog_text_properties.cpp +++ b/pcbnew/dialogs/dialog_text_properties.cpp @@ -65,7 +65,7 @@ DIALOG_TEXT_PROPERTIES::DIALOG_TEXT_PROPERTIES( PCB_BASE_EDIT_FRAME* aParent, BO m_MultiLineText->SetScrollWidth( 1 ); m_MultiLineText->SetScrollWidthTracking( true ); - if( m_item->Type() == PCB_MODULE_TEXT_T ) + if( m_item->Type() == PCB_FP_TEXT_T ) { title = _( "Footprint Text Properties" ); @@ -248,7 +248,7 @@ bool DIALOG_TEXT_PROPERTIES::TransferDataToWindow() m_MultiLineText->SetSelection( -1, -1 ); } - if( m_item->Type() == PCB_MODULE_TEXT_T && m_modText ) + if( m_item->Type() == PCB_FP_TEXT_T && m_modText ) { MODULE* module = dynamic_cast( m_modText->GetParent() ); wxString msg; diff --git a/pcbnew/drc/drc_test_provider.cpp b/pcbnew/drc/drc_test_provider.cpp index 7a80e495b8..5755e66c53 100644 --- a/pcbnew/drc/drc_test_provider.cpp +++ b/pcbnew/drc/drc_test_provider.cpp @@ -170,7 +170,7 @@ int DRC_TEST_PROVIDER::forEachGeometryItem( const std::vector& aTypes, n++; } - else if( typeMask[ PCB_LINE_T ] && item->Type() == PCB_LINE_T ) + else if( typeMask[ PCB_SHAPE_T ] && item->Type() == PCB_SHAPE_T ) { if( !aFunc( item ) ) return n; @@ -210,7 +210,7 @@ int DRC_TEST_PROVIDER::forEachGeometryItem( const std::vector& aTypes, for( MODULE* mod : brd->Modules() ) { - if( typeMask[ PCB_MODULE_TEXT_T ] ) + if( typeMask[ PCB_FP_TEXT_T ] ) { if( (mod->Reference().GetLayerSet() & aLayers).any() ) { @@ -247,14 +247,14 @@ int DRC_TEST_PROVIDER::forEachGeometryItem( const std::vector& aTypes, { if( (dwg->GetLayerSet() & aLayers).any() ) { - if( typeMask[ PCB_MODULE_TEXT_T ] && dwg->Type() == PCB_MODULE_TEXT_T ) + if( typeMask[ PCB_FP_TEXT_T ] && dwg->Type() == PCB_FP_TEXT_T ) { if( !aFunc( dwg ) ) return n; n++; } - else if( typeMask[ PCB_MODULE_EDGE_T ] && dwg->Type() == PCB_MODULE_EDGE_T ) + else if( typeMask[ PCB_FP_SHAPE_T ] && dwg->Type() == PCB_FP_SHAPE_T ) { if( !aFunc( dwg ) ) return n; @@ -268,7 +268,7 @@ int DRC_TEST_PROVIDER::forEachGeometryItem( const std::vector& aTypes, { if( (zone->GetLayerSet() & aLayers).any() ) { - if( typeMask[ PCB_MODULE_ZONE_AREA_T ] && zone->Type() == PCB_MODULE_ZONE_AREA_T ) + if( typeMask[ PCB_FP_ZONE_AREA_T ] && zone->Type() == PCB_FP_ZONE_AREA_T ) { if( ! aFunc( zone ) ) return n; diff --git a/pcbnew/drc/drc_test_provider_copper_clearance.cpp b/pcbnew/drc/drc_test_provider_copper_clearance.cpp index 3b72d0e148..d3d5c6e597 100644 --- a/pcbnew/drc/drc_test_provider_copper_clearance.cpp +++ b/pcbnew/drc/drc_test_provider_copper_clearance.cpp @@ -176,9 +176,9 @@ void DRC_TEST_PROVIDER_COPPER_CLEARANCE::testCopperTextAndGraphics() { if( IsCopperLayer( item->GetLayer() ) ) { - if( item->Type() == PCB_MODULE_TEXT_T && ( (TEXTE_MODULE*) item )->IsVisible() ) + if( item->Type() == PCB_FP_TEXT_T && ( (TEXTE_MODULE*) item )->IsVisible() ) testCopperDrawItem( item ); - else if( item->Type() == PCB_MODULE_EDGE_T ) + else if( item->Type() == PCB_FP_SHAPE_T ) testCopperDrawItem( item ); } } @@ -254,7 +254,7 @@ void DRC_TEST_PROVIDER_COPPER_CLEARANCE::testCopperDrawItem( BOARD_ITEM* aItem ) continue; // Graphic items are allowed to act as net-ties within their own footprint - if( aItem->Type() == PCB_MODULE_EDGE_T && pad->GetParent() == aItem->GetParent() ) + if( aItem->Type() == PCB_FP_SHAPE_T && pad->GetParent() == aItem->GetParent() ) continue; // Fast test to detect a pad candidate inside the text bounding box diff --git a/pcbnew/drc/drc_test_provider_edge_clearance.cpp b/pcbnew/drc/drc_test_provider_edge_clearance.cpp index fb2b07667d..13773bbe7b 100644 --- a/pcbnew/drc/drc_test_provider_edge_clearance.cpp +++ b/pcbnew/drc/drc_test_provider_edge_clearance.cpp @@ -110,7 +110,7 @@ bool DRC_TEST_PROVIDER_EDGE_CLEARANCE::Run() return true; }; - forEachGeometryItem( { PCB_LINE_T }, LSET( Edge_Cuts ), queryBoardOutlineItems ); + forEachGeometryItem( { PCB_SHAPE_T }, LSET( Edge_Cuts ), queryBoardOutlineItems ); forEachGeometryItem( {}, LSET::AllCuMask(), queryBoardGeometryItems ); wxString val; diff --git a/pcbnew/drc/drc_test_provider_misc.cpp b/pcbnew/drc/drc_test_provider_misc.cpp index 7d72db6619..6ae72520ed 100644 --- a/pcbnew/drc/drc_test_provider_misc.cpp +++ b/pcbnew/drc/drc_test_provider_misc.cpp @@ -151,7 +151,7 @@ void DRC_TEST_PROVIDER_MISC::testTextVars() return true; }; - forEachGeometryItem( { PCB_MODULE_TEXT_T, PCB_TEXT_T }, LSET::AllLayersMask(), + forEachGeometryItem( { PCB_FP_TEXT_T, PCB_TEXT_T }, LSET::AllLayersMask(), checkUnresolvedTextVar ); KIGFX::WS_PROXY_VIEW_ITEM* worksheet = m_drcEngine->GetWorksheet(); diff --git a/pcbnew/drc/drc_test_provider_silk_to_mask.cpp b/pcbnew/drc/drc_test_provider_silk_to_mask.cpp index f79b97cf0e..cc2b53ab62 100644 --- a/pcbnew/drc/drc_test_provider_silk_to_mask.cpp +++ b/pcbnew/drc/drc_test_provider_silk_to_mask.cpp @@ -156,16 +156,16 @@ bool test::DRC_TEST_PROVIDER_SILK_TO_MASK::Run() }; int numPads = forEachGeometryItem( { PCB_PAD_T, - PCB_LINE_T, - PCB_MODULE_EDGE_T, + PCB_SHAPE_T, + PCB_FP_SHAPE_T, PCB_TEXT_T, - PCB_MODULE_TEXT_T }, + PCB_FP_TEXT_T }, LSET( 2, F_Mask, B_Mask ), addMaskToTree ); - int numSilk = forEachGeometryItem( { PCB_LINE_T, - PCB_MODULE_EDGE_T, + int numSilk = forEachGeometryItem( { PCB_SHAPE_T, + PCB_FP_SHAPE_T, PCB_TEXT_T, - PCB_MODULE_TEXT_T }, + PCB_FP_TEXT_T }, LSET( 2, F_SilkS, B_SilkS ), addSilkToTree ); reportAux( _("Testing %d exposed copper against %d silkscreen features."), numPads, numSilk ); diff --git a/pcbnew/drc/drc_test_provider_silk_to_silk.cpp b/pcbnew/drc/drc_test_provider_silk_to_silk.cpp index 6462ad9a14..6e97a10d14 100644 --- a/pcbnew/drc/drc_test_provider_silk_to_silk.cpp +++ b/pcbnew/drc/drc_test_provider_silk_to_silk.cpp @@ -136,12 +136,12 @@ bool DRC_TEST_PROVIDER_SILK_TO_SILK::Run() if ( isInvisibleText( aTestItem->parent ) ) return true; - if( typeRef == PCB_MODULE_EDGE_T || typeRef == PCB_MODULE_TEXT_T ) + if( typeRef == PCB_FP_SHAPE_T || typeRef == PCB_FP_TEXT_T ) { parentModRef = static_cast ( aRefItem->parent->GetParent() ); } - if( typeTest == PCB_MODULE_EDGE_T || typeTest == PCB_MODULE_TEXT_T ) + if( typeTest == PCB_FP_SHAPE_T || typeTest == PCB_FP_TEXT_T ) { parentModTest = static_cast ( aTestItem->parent->GetParent() ); } @@ -151,13 +151,13 @@ bool DRC_TEST_PROVIDER_SILK_TO_SILK::Run() if( parentModRef && parentModRef == parentModTest ) { - if( typeRef == PCB_MODULE_EDGE_T && typeTest == PCB_MODULE_EDGE_T ) + if( typeRef == PCB_FP_SHAPE_T && typeTest == PCB_FP_SHAPE_T ) return true; } if( !parentModRef && !parentModTest ) { - if( typeRef == PCB_LINE_T && typeTest == PCB_LINE_T ) + if( typeRef == PCB_SHAPE_T && typeTest == PCB_SHAPE_T ) return true; } @@ -187,7 +187,7 @@ bool DRC_TEST_PROVIDER_SILK_TO_SILK::Run() return true; }; - int numSilk = forEachGeometryItem( { PCB_LINE_T, PCB_MODULE_EDGE_T, PCB_TEXT_T, PCB_MODULE_TEXT_T }, + int numSilk = forEachGeometryItem( { PCB_SHAPE_T, PCB_FP_SHAPE_T, PCB_TEXT_T, PCB_FP_TEXT_T }, LSET( 2, F_SilkS, B_SilkS ), addToTree ); reportAux( _("Testing %d silkscreen features."), numSilk ); diff --git a/pcbnew/edit.cpp b/pcbnew/edit.cpp index 62e52a9294..6ced6bf96c 100644 --- a/pcbnew/edit.cpp +++ b/pcbnew/edit.cpp @@ -148,11 +148,11 @@ void PCB_EDIT_FRAME::OnEditItemRequest( BOARD_ITEM* aItem ) ShowDimensionPropertyDialog( static_cast( aItem ) ); break; - case PCB_MODULE_TEXT_T: + case PCB_FP_TEXT_T: InstallTextOptionsFrame( aItem ); break; - case PCB_LINE_T: + case PCB_SHAPE_T: InstallGraphicItemPropertiesDialog( aItem ); break; diff --git a/pcbnew/exporters/export_gencad.cpp b/pcbnew/exporters/export_gencad.cpp index e0f08f08cd..e1165dc31b 100644 --- a/pcbnew/exporters/export_gencad.cpp +++ b/pcbnew/exporters/export_gencad.cpp @@ -1088,7 +1088,7 @@ static void CreateBoardSection( FILE* aFile, BOARD* aPcb ) // Extract the board edges for( BOARD_ITEM* drawing : aPcb->Drawings() ) { - if( drawing->Type() == PCB_LINE_T ) + if( drawing->Type() == PCB_SHAPE_T ) { DRAWSEGMENT* drawseg = static_cast( drawing ); @@ -1160,12 +1160,12 @@ static void FootprintWriteShape( FILE* aFile, MODULE* module, const wxString& aS { switch( PtStruct->Type() ) { - case PCB_MODULE_TEXT_T: + case PCB_FP_TEXT_T: // If we wanted to export text, this is not the correct section break; - case PCB_MODULE_EDGE_T: + case PCB_FP_SHAPE_T: PtEdge = (EDGE_MODULE*) PtStruct; if( PtEdge->GetLayer() == F_SilkS || PtEdge->GetLayer() == B_SilkS ) { diff --git a/pcbnew/exporters/export_idf.cpp b/pcbnew/exporters/export_idf.cpp index 37b4af80bb..a7182a269d 100644 --- a/pcbnew/exporters/export_idf.cpp +++ b/pcbnew/exporters/export_idf.cpp @@ -77,7 +77,7 @@ static void idf_export_outline( BOARD* aPcb, IDF3_BOARD& aIDFBoard ) // Retrieve segments and arcs from the board for( auto item : aPcb->Drawings() ) { - if( item->Type() != PCB_LINE_T || item->GetLayer() != Edge_Cuts ) + if( item->Type() != PCB_SHAPE_T || item->GetLayer() != Edge_Cuts ) continue; graphic = (DRAWSEGMENT*) item; @@ -294,7 +294,7 @@ static void idf_export_module( BOARD* aPcb, MODULE* aModule, // TODO: If module cutouts are supported we must add code here // for( EDA_ITEM* item = aModule->GraphicalItems(); item != NULL; item = item->Next() ) // { - // if( ( item->Type() != PCB_MODULE_EDGE_T ) + // if( ( item->Type() != PCB_FP_SHAPE_T ) // || (item->GetLayer() != Edge_Cuts ) ) continue; // code to export cutouts // } diff --git a/pcbnew/exporters/export_vrml.cpp b/pcbnew/exporters/export_vrml.cpp index d47668c141..062093deb6 100644 --- a/pcbnew/exporters/export_vrml.cpp +++ b/pcbnew/exporters/export_vrml.cpp @@ -809,7 +809,7 @@ static void export_vrml_drawings( MODEL_VRML& aModel, BOARD* pcb ) switch( drawing->Type() ) { - case PCB_LINE_T: + case PCB_SHAPE_T: export_vrml_drawsegment( aModel, (DRAWSEGMENT*) drawing ); break; @@ -1380,11 +1380,11 @@ static void export_vrml_module( MODEL_VRML& aModel, BOARD* aPcb, { switch( item->Type() ) { - case PCB_MODULE_TEXT_T: + case PCB_FP_TEXT_T: export_vrml_text_module( static_cast( item ) ); break; - case PCB_MODULE_EDGE_T: + case PCB_FP_SHAPE_T: export_vrml_edge_module( aModel, static_cast( item ), aModule ); break; diff --git a/pcbnew/exporters/gen_drill_report_files.cpp b/pcbnew/exporters/gen_drill_report_files.cpp index b1e525e5ef..4350f04a1f 100644 --- a/pcbnew/exporters/gen_drill_report_files.cpp +++ b/pcbnew/exporters/gen_drill_report_files.cpp @@ -191,7 +191,7 @@ bool GENDRILL_WRITER_BASE::genDrillMapFile( const wxString& aFullFileName, PLOT_ { switch( PtStruct->Type() ) { - case PCB_LINE_T: + case PCB_SHAPE_T: itemplotter.PlotDrawSegment( (DRAWSEGMENT*) PtStruct ); break; diff --git a/pcbnew/exporters/gerber_placefile_writer.cpp b/pcbnew/exporters/gerber_placefile_writer.cpp index cd562d2ead..e2f8725fc0 100644 --- a/pcbnew/exporters/gerber_placefile_writer.cpp +++ b/pcbnew/exporters/gerber_placefile_writer.cpp @@ -298,9 +298,9 @@ int PLACEFILE_GERBER_WRITER::CreatePlaceFile( wxString& aFullFilename, PCB_LAYER // Draw footprint other graphic items: for( MODULE* footprint : fp_list ) { - for( auto item : footprint->GraphicalItems() ) + for( BOARD_ITEM* item : footprint->GraphicalItems() ) { - if( item->Type() == PCB_MODULE_EDGE_T && item->GetLayer() == Edge_Cuts ) + if( item->Type() == PCB_FP_SHAPE_T && item->GetLayer() == Edge_Cuts ) brd_plotter.PlotFootprintGraphicItem((EDGE_MODULE*) item ); } } diff --git a/pcbnew/files.cpp b/pcbnew/files.cpp index 7892597808..5307e01706 100644 --- a/pcbnew/files.cpp +++ b/pcbnew/files.cpp @@ -476,7 +476,7 @@ int PCB_EDIT_FRAME::inferLegacyEdgeClearance( BOARD* aBoard ) for( int i = 0; i < collector.GetCount(); i++ ) { - if( collector[i]->Type() == PCB_LINE_T ) + if( collector[i]->Type() == PCB_SHAPE_T ) { int itemWidth = static_cast( collector[i] )->GetWidth(); diff --git a/pcbnew/footprint_edit_frame.cpp b/pcbnew/footprint_edit_frame.cpp index 23c3d027dc..b2112198e0 100644 --- a/pcbnew/footprint_edit_frame.cpp +++ b/pcbnew/footprint_edit_frame.cpp @@ -520,7 +520,7 @@ const BOX2I FOOTPRINT_EDIT_FRAME::GetDocumentExtents( bool aIncludeAllVisible ) { for( const BOARD_ITEM* item : module->GraphicalItems() ) { - if( item->Type() == PCB_MODULE_TEXT_T ) + if( item->Type() == PCB_FP_TEXT_T ) continue; hasGraphicalItem = true; diff --git a/pcbnew/footprint_editor_utils.cpp b/pcbnew/footprint_editor_utils.cpp index 19d4904308..6fb9b7b164 100644 --- a/pcbnew/footprint_editor_utils.cpp +++ b/pcbnew/footprint_editor_utils.cpp @@ -371,15 +371,15 @@ void FOOTPRINT_EDIT_FRAME::OnEditItemRequest( BOARD_ITEM* aItem ) GetCanvas()->Refresh(); break; - case PCB_MODULE_TEXT_T: + case PCB_FP_TEXT_T: InstallTextOptionsFrame( aItem ); break; - case PCB_MODULE_EDGE_T : + case PCB_FP_SHAPE_T : InstallGraphicItemPropertiesDialog( aItem ); break; - case PCB_MODULE_ZONE_AREA_T: + case PCB_FP_ZONE_AREA_T: { ZONE_CONTAINER* zone = static_cast( aItem ); bool success = false; diff --git a/pcbnew/footprint_libraries_utils.cpp b/pcbnew/footprint_libraries_utils.cpp index dbf12c546a..57d6e9b00b 100644 --- a/pcbnew/footprint_libraries_utils.cpp +++ b/pcbnew/footprint_libraries_utils.cpp @@ -1073,7 +1073,7 @@ MODULE* PCB_BASE_FRAME::CreateNewModule( const wxString& aModuleName ) module->RunOnChildren( [&] ( BOARD_ITEM* aChild ) { - if( aChild->Type() == PCB_MODULE_TEXT_T ) + if( aChild->Type() == PCB_FP_TEXT_T ) { TEXTE_MODULE* textItem = static_cast( aChild ); PCB_LAYER_ID layer = textItem->GetLayer(); diff --git a/pcbnew/graphics_cleaner.cpp b/pcbnew/graphics_cleaner.cpp index 589f544bbb..d4bc6ddec2 100644 --- a/pcbnew/graphics_cleaner.cpp +++ b/pcbnew/graphics_cleaner.cpp @@ -88,7 +88,7 @@ bool GRAPHICS_CLEANER::isNullSegment( DRAWSEGMENT* aSegment ) default: wxFAIL_MSG( "GRAPHICS_CLEANER::isNullSegment unsupported DRAWSEGMENT shape: " - + STROKE_T_asString( aSegment->GetShape() ) ); + + PCB_SHAPE_TYPE_T_asString( aSegment->GetShape()) ); return false; } } @@ -127,7 +127,7 @@ bool GRAPHICS_CLEANER::areEquivalent( DRAWSEGMENT* aSegment1, DRAWSEGMENT* aSegm default: wxFAIL_MSG( "GRAPHICS_CLEANER::areEquivalent unsupported DRAWSEGMENT shape: " - + STROKE_T_asString( aSegment1->GetShape() ) ); + + PCB_SHAPE_TYPE_T_asString( aSegment1->GetShape()) ); return false; } } diff --git a/pcbnew/import_gfx/graphics_importer_pcbnew.cpp b/pcbnew/import_gfx/graphics_importer_pcbnew.cpp index 947126f979..29bc38279a 100644 --- a/pcbnew/import_gfx/graphics_importer_pcbnew.cpp +++ b/pcbnew/import_gfx/graphics_importer_pcbnew.cpp @@ -68,7 +68,7 @@ void GRAPHICS_IMPORTER_PCBNEW::AddLine( const VECTOR2D& aOrigin, const VECTOR2D& line->SetStart( MapCoordinate( aOrigin ) ); line->SetEnd( MapCoordinate( aEnd ) ); - if( line->Type() == PCB_MODULE_EDGE_T ) + if( line->Type() == PCB_FP_SHAPE_T ) static_cast( line.get() )->SetLocalCoord(); addItem( std::move( line ) ); @@ -84,7 +84,7 @@ void GRAPHICS_IMPORTER_PCBNEW::AddCircle( const VECTOR2D& aCenter, double aRadiu circle->SetCenter( MapCoordinate( aCenter ) ); circle->SetArcStart( MapCoordinate( VECTOR2D( aCenter.x + aRadius, aCenter.y ) ) ); - if( circle->Type() == PCB_MODULE_EDGE_T ) + if( circle->Type() == PCB_FP_SHAPE_T ) static_cast( circle.get() )->SetLocalCoord(); addItem( std::move( circle ) ); @@ -102,7 +102,7 @@ void GRAPHICS_IMPORTER_PCBNEW::AddArc( const VECTOR2D& aCenter, const VECTOR2D& arc->SetArcStart( MapCoordinate( aStart ) ); arc->SetAngle( aAngle * 10.0 ); // Pcbnew uses the decidegree - if( arc->Type() == PCB_MODULE_EDGE_T ) + if( arc->Type() == PCB_FP_SHAPE_T ) static_cast( arc.get() )->SetLocalCoord(); addItem( std::move( arc ) ); @@ -122,7 +122,7 @@ void GRAPHICS_IMPORTER_PCBNEW::AddPolygon( const std::vector< VECTOR2D >& aVerti polygon->SetLayer( GetLayer() ); polygon->SetPolyPoints( convertedPoints ); - if( polygon->Type() == PCB_MODULE_EDGE_T ) + if( polygon->Type() == PCB_FP_SHAPE_T ) static_cast( polygon.get() )->SetLocalCoord(); polygon->SetWidth( MapLineWidth( aWidth ) ); @@ -147,7 +147,7 @@ void GRAPHICS_IMPORTER_PCBNEW::AddText( const VECTOR2D& aOrigin, const wxString& textItem->SetHorizJustify( aHJustify ); textItem->SetText( aText ); - if( boardItem->Type() == PCB_MODULE_TEXT_T ) + if( boardItem->Type() == PCB_FP_TEXT_T ) static_cast( boardItem.get() )->SetLocalCoord(); addItem( std::move( boardItem ) ); @@ -167,7 +167,7 @@ void GRAPHICS_IMPORTER_PCBNEW::AddSpline( const VECTOR2D& aStart, const VECTOR2D spline->SetEnd( MapCoordinate( aEnd ) ); spline->RebuildBezierToSegmentsPointsList( aWidth ); - if( spline->Type() == PCB_MODULE_EDGE_T ) + if( spline->Type() == PCB_FP_SHAPE_T ) static_cast( spline.get() )->SetLocalCoord(); addItem( std::move( spline ) ); diff --git a/pcbnew/kicad_clipboard.cpp b/pcbnew/kicad_clipboard.cpp index 5b4f380849..60fb2bd0f5 100644 --- a/pcbnew/kicad_clipboard.cpp +++ b/pcbnew/kicad_clipboard.cpp @@ -148,13 +148,13 @@ void CLIPBOARD_IO::SaveSelection( const PCBNEW_SELECTION& aSelected, bool isModE BOARD_ITEM* item = static_cast( i ); BOARD_ITEM* copy = nullptr; - if( item->Type() == PCB_MODULE_EDGE_T ) + if( item->Type() == PCB_FP_SHAPE_T ) { - // Convert to PCB_LINE_T + // Convert to PCB_SHAPE_T copy = (BOARD_ITEM*) reinterpret_cast( item )->Clone(); copy->SetLayer( item->GetLayer() ); } - else if( item->Type() == PCB_MODULE_TEXT_T ) + else if( item->Type() == PCB_FP_TEXT_T ) { // Convert to PCB_TEXT_T MODULE* mod = static_cast( item->GetParent() ); @@ -183,7 +183,7 @@ void CLIPBOARD_IO::SaveSelection( const PCBNEW_SELECTION& aSelected, bool isModE mod->Add( pad ); copy = mod; } - else if( item->Type() == PCB_MODULE_ZONE_AREA_T ) + else if( item->Type() == PCB_FP_ZONE_AREA_T ) { // Convert to PCB_ZONE_AREA_T ZONE_CONTAINER* zone = new ZONE_CONTAINER( m_board ); diff --git a/pcbnew/kicad_plugin.cpp b/pcbnew/kicad_plugin.cpp index c9fa799bed..25e8b5ca7f 100644 --- a/pcbnew/kicad_plugin.cpp +++ b/pcbnew/kicad_plugin.cpp @@ -399,11 +399,11 @@ void PCB_IO::Format( BOARD_ITEM* aItem, int aNestLevel ) const format( static_cast( aItem ), aNestLevel ); break; - case PCB_LINE_T: + case PCB_SHAPE_T: format( static_cast( aItem ), aNestLevel ); break; - case PCB_MODULE_EDGE_T: + case PCB_FP_SHAPE_T: format( static_cast( aItem ), aNestLevel ); break; @@ -423,7 +423,7 @@ void PCB_IO::Format( BOARD_ITEM* aItem, int aNestLevel ) const format( static_cast( aItem ), aNestLevel ); break; - case PCB_MODULE_TEXT_T: + case PCB_FP_TEXT_T: format( static_cast( aItem ), aNestLevel ); break; @@ -437,7 +437,7 @@ void PCB_IO::Format( BOARD_ITEM* aItem, int aNestLevel ) const format( static_cast( aItem ), aNestLevel ); break; - case PCB_MODULE_ZONE_AREA_T: + case PCB_FP_ZONE_AREA_T: case PCB_ZONE_AREA_T: format( static_cast( aItem ), aNestLevel ); break; @@ -832,7 +832,7 @@ void PCB_IO::format( DRAWSEGMENT* aSegment, int aNestLevel ) const default: wxFAIL_MSG( "PCB_IO::format cannot format unknown DRAWSEGMENT shape:" - + STROKE_T_asString( aSegment->GetShape() ) ); + + PCB_SHAPE_TYPE_T_asString( aSegment->GetShape()) ); return; }; @@ -917,7 +917,7 @@ void PCB_IO::format( EDGE_MODULE* aModuleDrawing, int aNestLevel ) const default: wxFAIL_MSG( "PCB_IO::format cannot format unknown EDGE_MODULE shape:" - + STROKE_T_asString( aModuleDrawing->GetShape() ) ); + + PCB_SHAPE_TYPE_T_asString( aModuleDrawing->GetShape()) ); return; }; diff --git a/pcbnew/legacy_plugin.cpp b/pcbnew/legacy_plugin.cpp index e45a3a1845..dc08a3f392 100644 --- a/pcbnew/legacy_plugin.cpp +++ b/pcbnew/legacy_plugin.cpp @@ -1637,8 +1637,8 @@ void LEGACY_PLUGIN::loadPAD( MODULE* aModule ) void LEGACY_PLUGIN::loadMODULE_EDGE( MODULE* aModule ) { - STROKE_T shape; - char* line = m_reader->Line(); // obtain current (old) line + PCB_SHAPE_TYPE_T shape; + char* line = m_reader->Line(); // obtain current (old) line switch( line[1] ) { @@ -1942,7 +1942,7 @@ void LEGACY_PLUGIN::loadPCB_LINE() if( width < 0 ) width = 0; - dseg->SetShape( STROKE_T( shape ) ); + dseg->SetShape( PCB_SHAPE_TYPE_T( shape ) ); dseg->SetWidth( width ); dseg->SetStart( wxPoint( start_x, start_y ) ); dseg->SetEnd( wxPoint( end_x, end_y ) ); diff --git a/pcbnew/pcb_painter.cpp b/pcbnew/pcb_painter.cpp index 127924c93f..794d8d69af 100644 --- a/pcbnew/pcb_painter.cpp +++ b/pcbnew/pcb_painter.cpp @@ -342,7 +342,7 @@ COLOR4D PCB_RENDER_SETTINGS::GetColor( const VIEW_ITEM* aItem, int aLayer ) cons color.a *= m_viaOpacity; else if( item->Type() == PCB_PAD_T ) color.a *= m_padOpacity; - else if( item->Type() == PCB_ZONE_AREA_T || item->Type() == PCB_MODULE_ZONE_AREA_T ) + else if( item->Type() == PCB_ZONE_AREA_T || item->Type() == PCB_FP_ZONE_AREA_T ) color.a *= m_zoneOpacity; // No special modificators enabled @@ -412,8 +412,8 @@ bool PCB_PAINTER::Draw( const VIEW_ITEM* aItem, int aLayer ) draw( static_cast( item ), aLayer ); break; - case PCB_LINE_T: - case PCB_MODULE_EDGE_T: + case PCB_SHAPE_T: + case PCB_FP_SHAPE_T: draw( static_cast( item ), aLayer ); break; @@ -421,7 +421,7 @@ bool PCB_PAINTER::Draw( const VIEW_ITEM* aItem, int aLayer ) draw( static_cast( item ), aLayer ); break; - case PCB_MODULE_TEXT_T: + case PCB_FP_TEXT_T: draw( static_cast( item ), aLayer ); break; @@ -437,7 +437,7 @@ bool PCB_PAINTER::Draw( const VIEW_ITEM* aItem, int aLayer ) draw( static_cast( item ), aLayer ); break; - case PCB_MODULE_ZONE_AREA_T: + case PCB_FP_ZONE_AREA_T: draw( static_cast( item ), aLayer ); break; diff --git a/pcbnew/plot_board_layers.cpp b/pcbnew/plot_board_layers.cpp index 8434071a77..744eb4d53b 100644 --- a/pcbnew/plot_board_layers.cpp +++ b/pcbnew/plot_board_layers.cpp @@ -782,7 +782,7 @@ void PlotSolderMaskLayer( BOARD *aBoard, PLOTTER* aPlotter, LSET aLayerMask, { itemplotter.PlotFootprintTextItems( module ); - if( item->Type() == PCB_MODULE_EDGE_T && item->GetLayer() == layer ) + if( item->Type() == PCB_FP_SHAPE_T && item->GetLayer() == layer ) itemplotter.PlotFootprintGraphicItem((EDGE_MODULE*) item ); } } diff --git a/pcbnew/plot_brditems_plotter.cpp b/pcbnew/plot_brditems_plotter.cpp index 5a10d1d6b9..b1b1ac926f 100644 --- a/pcbnew/plot_brditems_plotter.cpp +++ b/pcbnew/plot_brditems_plotter.cpp @@ -330,18 +330,17 @@ void BRDITEMS_PLOTTER::PlotBoardGraphicItems() { switch( item->Type() ) { - case PCB_LINE_T: PlotDrawSegment( (DRAWSEGMENT*) item); break; - case PCB_TEXT_T: PlotTextePcb( (TEXTE_PCB*) item ); break; + case PCB_SHAPE_T: PlotDrawSegment( (DRAWSEGMENT*) item); break; + case PCB_TEXT_T: PlotTextePcb( (TEXTE_PCB*) item ); break; case PCB_DIM_ALIGNED_T: case PCB_DIM_CENTER_T: case PCB_DIM_ORTHOGONAL_T: - case PCB_DIM_LEADER_T: - PlotDimension( (DIMENSION*) item ); - break; + case PCB_DIM_LEADER_T: PlotDimension( (DIMENSION*) item ); break; - case PCB_TARGET_T: PlotPcbTarget( (PCB_TARGET*) item ); break; - default: break; + case PCB_TARGET_T: PlotPcbTarget( (PCB_TARGET*) item ); break; + + default: break; } } } @@ -504,7 +503,7 @@ void BRDITEMS_PLOTTER::PlotFootprintGraphicItems( MODULE* aModule ) //* Plot a graphic item (outline) relative to a footprint void BRDITEMS_PLOTTER::PlotFootprintGraphicItem( EDGE_MODULE* aEdge ) { - if( aEdge->Type() != PCB_MODULE_EDGE_T ) + if( aEdge->Type() != PCB_FP_SHAPE_T ) return; m_plotter->SetColor( getColor( aEdge->GetLayer() ) ); diff --git a/pcbnew/plugins/altium/altium_pcb.cpp b/pcbnew/plugins/altium/altium_pcb.cpp index e9f603ceba..d7e5d723ae 100644 --- a/pcbnew/plugins/altium/altium_pcb.cpp +++ b/pcbnew/plugins/altium/altium_pcb.cpp @@ -149,181 +149,97 @@ PCB_LAYER_ID ALTIUM_PCB::GetKicadLayer( ALTIUM_LAYER aAltiumLayer ) const switch( aAltiumLayer ) { - case ALTIUM_LAYER::UNKNOWN: - return UNDEFINED_LAYER; + case ALTIUM_LAYER::UNKNOWN: return UNDEFINED_LAYER; - case ALTIUM_LAYER::TOP_LAYER: - return F_Cu; - case ALTIUM_LAYER::MID_LAYER_1: - return In1_Cu; // TODO: stackup same as in KiCad? - case ALTIUM_LAYER::MID_LAYER_2: - return In2_Cu; - case ALTIUM_LAYER::MID_LAYER_3: - return In3_Cu; - case ALTIUM_LAYER::MID_LAYER_4: - return In4_Cu; - case ALTIUM_LAYER::MID_LAYER_5: - return In5_Cu; - case ALTIUM_LAYER::MID_LAYER_6: - return In6_Cu; - case ALTIUM_LAYER::MID_LAYER_7: - return In7_Cu; - case ALTIUM_LAYER::MID_LAYER_8: - return In8_Cu; - case ALTIUM_LAYER::MID_LAYER_9: - return In9_Cu; - case ALTIUM_LAYER::MID_LAYER_10: - return In10_Cu; - case ALTIUM_LAYER::MID_LAYER_11: - return In11_Cu; - case ALTIUM_LAYER::MID_LAYER_12: - return In12_Cu; - case ALTIUM_LAYER::MID_LAYER_13: - return In13_Cu; - case ALTIUM_LAYER::MID_LAYER_14: - return In14_Cu; - case ALTIUM_LAYER::MID_LAYER_15: - return In15_Cu; - case ALTIUM_LAYER::MID_LAYER_16: - return In16_Cu; - case ALTIUM_LAYER::MID_LAYER_17: - return In17_Cu; - case ALTIUM_LAYER::MID_LAYER_18: - return In18_Cu; - case ALTIUM_LAYER::MID_LAYER_19: - return In19_Cu; - case ALTIUM_LAYER::MID_LAYER_20: - return In20_Cu; - case ALTIUM_LAYER::MID_LAYER_21: - return In21_Cu; - case ALTIUM_LAYER::MID_LAYER_22: - return In22_Cu; - case ALTIUM_LAYER::MID_LAYER_23: - return In23_Cu; - case ALTIUM_LAYER::MID_LAYER_24: - return In24_Cu; - case ALTIUM_LAYER::MID_LAYER_25: - return In25_Cu; - case ALTIUM_LAYER::MID_LAYER_26: - return In26_Cu; - case ALTIUM_LAYER::MID_LAYER_27: - return In27_Cu; - case ALTIUM_LAYER::MID_LAYER_28: - return In28_Cu; - case ALTIUM_LAYER::MID_LAYER_29: - return In29_Cu; - case ALTIUM_LAYER::MID_LAYER_30: - return In30_Cu; - case ALTIUM_LAYER::BOTTOM_LAYER: - return B_Cu; + case ALTIUM_LAYER::TOP_LAYER: return F_Cu; + case ALTIUM_LAYER::MID_LAYER_1: return In1_Cu; // TODO: stackup same as in KiCad? + case ALTIUM_LAYER::MID_LAYER_2: return In2_Cu; + case ALTIUM_LAYER::MID_LAYER_3: return In3_Cu; + case ALTIUM_LAYER::MID_LAYER_4: return In4_Cu; + case ALTIUM_LAYER::MID_LAYER_5: return In5_Cu; + case ALTIUM_LAYER::MID_LAYER_6: return In6_Cu; + case ALTIUM_LAYER::MID_LAYER_7: return In7_Cu; + case ALTIUM_LAYER::MID_LAYER_8: return In8_Cu; + case ALTIUM_LAYER::MID_LAYER_9: return In9_Cu; + case ALTIUM_LAYER::MID_LAYER_10: return In10_Cu; + case ALTIUM_LAYER::MID_LAYER_11: return In11_Cu; + case ALTIUM_LAYER::MID_LAYER_12: return In12_Cu; + case ALTIUM_LAYER::MID_LAYER_13: return In13_Cu; + case ALTIUM_LAYER::MID_LAYER_14: return In14_Cu; + case ALTIUM_LAYER::MID_LAYER_15: return In15_Cu; + case ALTIUM_LAYER::MID_LAYER_16: return In16_Cu; + case ALTIUM_LAYER::MID_LAYER_17: return In17_Cu; + case ALTIUM_LAYER::MID_LAYER_18: return In18_Cu; + case ALTIUM_LAYER::MID_LAYER_19: return In19_Cu; + case ALTIUM_LAYER::MID_LAYER_20: return In20_Cu; + case ALTIUM_LAYER::MID_LAYER_21: return In21_Cu; + case ALTIUM_LAYER::MID_LAYER_22: return In22_Cu; + case ALTIUM_LAYER::MID_LAYER_23: return In23_Cu; + case ALTIUM_LAYER::MID_LAYER_24: return In24_Cu; + case ALTIUM_LAYER::MID_LAYER_25: return In25_Cu; + case ALTIUM_LAYER::MID_LAYER_26: return In26_Cu; + case ALTIUM_LAYER::MID_LAYER_27: return In27_Cu; + case ALTIUM_LAYER::MID_LAYER_28: return In28_Cu; + case ALTIUM_LAYER::MID_LAYER_29: return In29_Cu; + case ALTIUM_LAYER::MID_LAYER_30: return In30_Cu; + case ALTIUM_LAYER::BOTTOM_LAYER: return B_Cu; - case ALTIUM_LAYER::TOP_OVERLAY: - return F_SilkS; - case ALTIUM_LAYER::BOTTOM_OVERLAY: - return B_SilkS; - case ALTIUM_LAYER::TOP_PASTE: - return F_Paste; - case ALTIUM_LAYER::BOTTOM_PASTE: - return B_Paste; - case ALTIUM_LAYER::TOP_SOLDER: - return F_Mask; - case ALTIUM_LAYER::BOTTOM_SOLDER: - return B_Mask; + case ALTIUM_LAYER::TOP_OVERLAY: return F_SilkS; + case ALTIUM_LAYER::BOTTOM_OVERLAY: return B_SilkS; + case ALTIUM_LAYER::TOP_PASTE: return F_Paste; + case ALTIUM_LAYER::BOTTOM_PASTE: return B_Paste; + case ALTIUM_LAYER::TOP_SOLDER: return F_Mask; + case ALTIUM_LAYER::BOTTOM_SOLDER: return B_Mask; - case ALTIUM_LAYER::INTERNAL_PLANE_1: - return UNDEFINED_LAYER; - case ALTIUM_LAYER::INTERNAL_PLANE_2: - return UNDEFINED_LAYER; - case ALTIUM_LAYER::INTERNAL_PLANE_3: - return UNDEFINED_LAYER; - case ALTIUM_LAYER::INTERNAL_PLANE_4: - return UNDEFINED_LAYER; - case ALTIUM_LAYER::INTERNAL_PLANE_5: - return UNDEFINED_LAYER; - case ALTIUM_LAYER::INTERNAL_PLANE_6: - return UNDEFINED_LAYER; - case ALTIUM_LAYER::INTERNAL_PLANE_7: - return UNDEFINED_LAYER; - case ALTIUM_LAYER::INTERNAL_PLANE_8: - return UNDEFINED_LAYER; - case ALTIUM_LAYER::INTERNAL_PLANE_9: - return UNDEFINED_LAYER; - case ALTIUM_LAYER::INTERNAL_PLANE_10: - return UNDEFINED_LAYER; - case ALTIUM_LAYER::INTERNAL_PLANE_11: - return UNDEFINED_LAYER; - case ALTIUM_LAYER::INTERNAL_PLANE_12: - return UNDEFINED_LAYER; - case ALTIUM_LAYER::INTERNAL_PLANE_13: - return UNDEFINED_LAYER; - case ALTIUM_LAYER::INTERNAL_PLANE_14: - return UNDEFINED_LAYER; - case ALTIUM_LAYER::INTERNAL_PLANE_15: - return UNDEFINED_LAYER; - case ALTIUM_LAYER::INTERNAL_PLANE_16: - return UNDEFINED_LAYER; + case ALTIUM_LAYER::INTERNAL_PLANE_1: return UNDEFINED_LAYER; + case ALTIUM_LAYER::INTERNAL_PLANE_2: return UNDEFINED_LAYER; + case ALTIUM_LAYER::INTERNAL_PLANE_3: return UNDEFINED_LAYER; + case ALTIUM_LAYER::INTERNAL_PLANE_4: return UNDEFINED_LAYER; + case ALTIUM_LAYER::INTERNAL_PLANE_5: return UNDEFINED_LAYER; + case ALTIUM_LAYER::INTERNAL_PLANE_6: return UNDEFINED_LAYER; + case ALTIUM_LAYER::INTERNAL_PLANE_7: return UNDEFINED_LAYER; + case ALTIUM_LAYER::INTERNAL_PLANE_8: return UNDEFINED_LAYER; + case ALTIUM_LAYER::INTERNAL_PLANE_9: return UNDEFINED_LAYER; + case ALTIUM_LAYER::INTERNAL_PLANE_10: return UNDEFINED_LAYER; + case ALTIUM_LAYER::INTERNAL_PLANE_11: return UNDEFINED_LAYER; + case ALTIUM_LAYER::INTERNAL_PLANE_12: return UNDEFINED_LAYER; + case ALTIUM_LAYER::INTERNAL_PLANE_13: return UNDEFINED_LAYER; + case ALTIUM_LAYER::INTERNAL_PLANE_14: return UNDEFINED_LAYER; + case ALTIUM_LAYER::INTERNAL_PLANE_15: return UNDEFINED_LAYER; + case ALTIUM_LAYER::INTERNAL_PLANE_16: return UNDEFINED_LAYER; - case ALTIUM_LAYER::DRILL_GUIDE: - return Dwgs_User; - case ALTIUM_LAYER::KEEP_OUT_LAYER: - return Margin; + case ALTIUM_LAYER::DRILL_GUIDE: return Dwgs_User; + case ALTIUM_LAYER::KEEP_OUT_LAYER: return Margin; - case ALTIUM_LAYER::MECHANICAL_1: - return Dwgs_User; //Edge_Cuts; - case ALTIUM_LAYER::MECHANICAL_2: - return Dwgs_User; - case ALTIUM_LAYER::MECHANICAL_3: - return Dwgs_User; - case ALTIUM_LAYER::MECHANICAL_4: - return Dwgs_User; - case ALTIUM_LAYER::MECHANICAL_5: - return Dwgs_User; - case ALTIUM_LAYER::MECHANICAL_6: - return Dwgs_User; - case ALTIUM_LAYER::MECHANICAL_7: - return Dwgs_User; - case ALTIUM_LAYER::MECHANICAL_8: - return Dwgs_User; - case ALTIUM_LAYER::MECHANICAL_9: - return Dwgs_User; - case ALTIUM_LAYER::MECHANICAL_10: - return Dwgs_User; - case ALTIUM_LAYER::MECHANICAL_11: - return Dwgs_User; - case ALTIUM_LAYER::MECHANICAL_12: - return Dwgs_User; - case ALTIUM_LAYER::MECHANICAL_13: - return F_Fab; - case ALTIUM_LAYER::MECHANICAL_14: - return B_Fab; - case ALTIUM_LAYER::MECHANICAL_15: - return F_CrtYd; - case ALTIUM_LAYER::MECHANICAL_16: - return B_CrtYd; + case ALTIUM_LAYER::MECHANICAL_1: return Dwgs_User; //Edge_Cuts; + case ALTIUM_LAYER::MECHANICAL_2: return Dwgs_User; + case ALTIUM_LAYER::MECHANICAL_3: return Dwgs_User; + case ALTIUM_LAYER::MECHANICAL_4: return Dwgs_User; + case ALTIUM_LAYER::MECHANICAL_5: return Dwgs_User; + case ALTIUM_LAYER::MECHANICAL_6: return Dwgs_User; + case ALTIUM_LAYER::MECHANICAL_7: return Dwgs_User; + case ALTIUM_LAYER::MECHANICAL_8: return Dwgs_User; + case ALTIUM_LAYER::MECHANICAL_9: return Dwgs_User; + case ALTIUM_LAYER::MECHANICAL_10: return Dwgs_User; + case ALTIUM_LAYER::MECHANICAL_11: return Dwgs_User; + case ALTIUM_LAYER::MECHANICAL_12: return Dwgs_User; + case ALTIUM_LAYER::MECHANICAL_13: return F_Fab; + case ALTIUM_LAYER::MECHANICAL_14: return B_Fab; + case ALTIUM_LAYER::MECHANICAL_15: return F_CrtYd; + case ALTIUM_LAYER::MECHANICAL_16: return B_CrtYd; - case ALTIUM_LAYER::DRILL_DRAWING: - return Dwgs_User; - case ALTIUM_LAYER::MULTI_LAYER: - return UNDEFINED_LAYER; - case ALTIUM_LAYER::CONNECTIONS: - return UNDEFINED_LAYER; - case ALTIUM_LAYER::BACKGROUND: - return UNDEFINED_LAYER; - case ALTIUM_LAYER::DRC_ERROR_MARKERS: - return UNDEFINED_LAYER; - case ALTIUM_LAYER::SELECTIONS: - return UNDEFINED_LAYER; - case ALTIUM_LAYER::VISIBLE_GRID_1: - return UNDEFINED_LAYER; - case ALTIUM_LAYER::VISIBLE_GRID_2: - return UNDEFINED_LAYER; - case ALTIUM_LAYER::PAD_HOLES: - return UNDEFINED_LAYER; - case ALTIUM_LAYER::VIA_HOLES: - return UNDEFINED_LAYER; + case ALTIUM_LAYER::DRILL_DRAWING: return Dwgs_User; + case ALTIUM_LAYER::MULTI_LAYER: return UNDEFINED_LAYER; + case ALTIUM_LAYER::CONNECTIONS: return UNDEFINED_LAYER; + case ALTIUM_LAYER::BACKGROUND: return UNDEFINED_LAYER; + case ALTIUM_LAYER::DRC_ERROR_MARKERS: return UNDEFINED_LAYER; + case ALTIUM_LAYER::SELECTIONS: return UNDEFINED_LAYER; + case ALTIUM_LAYER::VISIBLE_GRID_1: return UNDEFINED_LAYER; + case ALTIUM_LAYER::VISIBLE_GRID_2: return UNDEFINED_LAYER; + case ALTIUM_LAYER::PAD_HOLES: return UNDEFINED_LAYER; + case ALTIUM_LAYER::VIA_HOLES: return UNDEFINED_LAYER; - default: - return UNDEFINED_LAYER; + default: return UNDEFINED_LAYER; } } @@ -693,13 +609,13 @@ void ALTIUM_PCB::HelperCreateBoardOutline( const std::vector& aV if( !last->isRound && !cur->isRound ) { - ds->SetShape( STROKE_T::S_SEGMENT ); + ds->SetShape( S_SEGMENT ); ds->SetStart( last->position ); ds->SetEnd( cur->position ); } else if( cur->isRound ) { - ds->SetShape( STROKE_T::S_ARC ); + ds->SetShape( S_ARC ); ds->SetAngle( -NormalizeAngleDegreesPos( cur->endangle - cur->startangle ) * 10. ); double startradiant = DEG2RAD( cur->startangle ); @@ -717,7 +633,7 @@ void ALTIUM_PCB::HelperCreateBoardOutline( const std::vector& aV wxPoint arcEnd = cur->center + arcEndOffset; DRAWSEGMENT* ds2 = new DRAWSEGMENT( m_board ); - ds2->SetShape( STROKE_T::S_SEGMENT ); + ds2->SetShape( S_SEGMENT ); m_board->Add( ds2, ADD_MODE::APPEND ); ds2->SetWidth( m_board->GetDesignSettings().GetLineThickness( Edge_Cuts ) ); ds2->SetLayer( Edge_Cuts ); @@ -997,7 +913,7 @@ void ALTIUM_PCB::HelperParseDimensions6Leader( const ADIMENSION6& aElem ) { DRAWSEGMENT* ds = new DRAWSEGMENT( m_board ); m_board->Add( ds, ADD_MODE::APPEND ); - ds->SetShape( STROKE_T::S_SEGMENT ); + ds->SetShape( S_SEGMENT ); ds->SetLayer( klayer ); ds->SetWidth( aElem.linewidth ); ds->SetStart( last ); @@ -1018,7 +934,7 @@ void ALTIUM_PCB::HelperParseDimensions6Leader( const ADIMENSION6& aElem ) DRAWSEGMENT* ds1 = new DRAWSEGMENT( m_board ); m_board->Add( ds1, ADD_MODE::APPEND ); - ds1->SetShape( STROKE_T::S_SEGMENT ); + ds1->SetShape( S_SEGMENT ); ds1->SetLayer( klayer ); ds1->SetWidth( aElem.linewidth ); ds1->SetStart( referencePoint0 ); @@ -1028,7 +944,7 @@ void ALTIUM_PCB::HelperParseDimensions6Leader( const ADIMENSION6& aElem ) DRAWSEGMENT* ds2 = new DRAWSEGMENT( m_board ); m_board->Add( ds2, ADD_MODE::APPEND ); - ds2->SetShape( STROKE_T::S_SEGMENT ); + ds2->SetShape( S_SEGMENT ); ds2->SetLayer( klayer ); ds2->SetWidth( aElem.linewidth ); ds2->SetStart( referencePoint0 ); @@ -1069,7 +985,7 @@ void ALTIUM_PCB::HelperParseDimensions6Datum( const ADIMENSION6& aElem ) { DRAWSEGMENT* ds1 = new DRAWSEGMENT( m_board ); m_board->Add( ds1, ADD_MODE::APPEND ); - ds1->SetShape( STROKE_T::S_SEGMENT ); + ds1->SetShape( S_SEGMENT ); ds1->SetLayer( klayer ); ds1->SetWidth( aElem.linewidth ); ds1->SetStart( aElem.referencePoint.at( i ) ); @@ -1090,7 +1006,7 @@ void ALTIUM_PCB::HelperParseDimensions6Center( const ADIMENSION6& aElem ) DRAWSEGMENT* ds1 = new DRAWSEGMENT( m_board ); m_board->Add( ds1, ADD_MODE::APPEND ); - ds1->SetShape( STROKE_T::S_SEGMENT ); + ds1->SetShape( S_SEGMENT ); ds1->SetLayer( klayer ); ds1->SetWidth( aElem.linewidth ); @@ -1101,7 +1017,7 @@ void ALTIUM_PCB::HelperParseDimensions6Center( const ADIMENSION6& aElem ) DRAWSEGMENT* ds2 = new DRAWSEGMENT( m_board ); m_board->Add( ds2, ADD_MODE::APPEND ); - ds2->SetShape( STROKE_T::S_SEGMENT ); + ds2->SetShape( S_SEGMENT ); ds2->SetLayer( klayer ); ds2->SetWidth( aElem.linewidth ); @@ -1475,7 +1391,7 @@ void ALTIUM_PCB::ParseShapeBasedRegions6Data( DRAWSEGMENT* ds = new DRAWSEGMENT( m_board ); m_board->Add( ds, ADD_MODE::APPEND ); - ds->SetShape( STROKE_T::S_POLYGON ); + ds->SetShape( S_POLYGON ); ds->SetLayer( klayer ); ds->SetWidth( 0 ); @@ -1595,12 +1511,12 @@ void ALTIUM_PCB::ParseArcs6Data( ds.SetCenter( elem.center ); if( elem.startangle == 0. && elem.endangle == 360. ) { // TODO: other variants to define circle? - ds.SetShape( STROKE_T::S_CIRCLE ); + ds.SetShape( S_CIRCLE ); ds.SetArcStart( elem.center - wxPoint( 0, elem.radius ) ); } else { - ds.SetShape( STROKE_T::S_ARC ); + ds.SetShape( S_ARC ); ds.SetAngle( -NormalizeAngleDegreesPos( elem.endangle - elem.startangle ) * 10. ); double startradiant = DEG2RAD( elem.startangle ); @@ -1653,12 +1569,12 @@ void ALTIUM_PCB::ParseArcs6Data( if( elem.startangle == 0. && elem.endangle == 360. ) { // TODO: other variants to define circle? - ds->SetShape( STROKE_T::S_CIRCLE ); + ds->SetShape( S_CIRCLE ); ds->SetArcStart( elem.center - wxPoint( 0, elem.radius ) ); } else { - ds->SetShape( STROKE_T::S_ARC ); + ds->SetShape( S_ARC ); ds->SetAngle( -NormalizeAngleDegreesPos( elem.endangle - elem.startangle ) * 10. ); double startradiant = DEG2RAD( elem.startangle ); @@ -1926,7 +1842,7 @@ void ALTIUM_PCB::HelperParsePad6NonCopper( const APAD6& aElem ) { // filled rect DRAWSEGMENT* ds = HelperCreateAndAddDrawsegment( aElem.component ); - ds->SetShape( STROKE_T::S_POLYGON ); + ds->SetShape( S_POLYGON ); ds->SetLayer( klayer ); ds->SetWidth( 0 ); @@ -1965,13 +1881,13 @@ void ALTIUM_PCB::HelperParsePad6NonCopper( const APAD6& aElem ) wxPoint p22 = aElem.position + wxPoint( -offsetX, -offsetY ); wxPoint p21 = aElem.position + wxPoint( -offsetX, offsetY ); - ds->SetShape( STROKE_T::S_POLYGON ); + ds->SetShape( S_POLYGON ); ds->SetPolyPoints( { p11, p12, p22, p21 } ); } else if( aElem.topsize.x == aElem.topsize.y ) { // circle - ds->SetShape( STROKE_T::S_CIRCLE ); + ds->SetShape( S_CIRCLE ); ds->SetCenter( aElem.position ); ds->SetWidth( aElem.topsize.x / 2 ); ds->SetArcStart( aElem.position - wxPoint( 0, aElem.topsize.x / 4 ) ); @@ -1979,7 +1895,7 @@ void ALTIUM_PCB::HelperParsePad6NonCopper( const APAD6& aElem ) else if( aElem.topsize.x < aElem.topsize.y ) { // short vertical line - ds->SetShape( STROKE_T::S_SEGMENT ); + ds->SetShape( S_SEGMENT ); wxPoint pointOffset( 0, ( aElem.topsize.y - aElem.topsize.x ) / 2 ); ds->SetStart( aElem.position + pointOffset ); ds->SetEnd( aElem.position - pointOffset ); @@ -1987,7 +1903,7 @@ void ALTIUM_PCB::HelperParsePad6NonCopper( const APAD6& aElem ) else { // short horizontal line - ds->SetShape( STROKE_T::S_SEGMENT ); + ds->SetShape( S_SEGMENT ); wxPoint pointOffset( ( aElem.topsize.x - aElem.topsize.y ) / 2, 0 ); ds->SetStart( aElem.position + pointOffset ); ds->SetEnd( aElem.position - pointOffset ); @@ -2004,7 +1920,7 @@ void ALTIUM_PCB::HelperParsePad6NonCopper( const APAD6& aElem ) { // filled circle DRAWSEGMENT* ds = HelperCreateAndAddDrawsegment( aElem.component ); - ds->SetShape( STROKE_T::S_CIRCLE ); + ds->SetShape( S_CIRCLE ); ds->SetLayer( klayer ); ds->SetCenter( aElem.position ); ds->SetWidth( aElem.topsize.x / 2 ); @@ -2015,7 +1931,7 @@ void ALTIUM_PCB::HelperParsePad6NonCopper( const APAD6& aElem ) { // short line DRAWSEGMENT* ds = HelperCreateAndAddDrawsegment( aElem.component ); - ds->SetShape( STROKE_T::S_SEGMENT ); + ds->SetShape( S_SEGMENT ); ds->SetLayer( klayer ); ds->SetWidth( std::min( aElem.topsize.x, aElem.topsize.y ) ); if( aElem.topsize.x < aElem.topsize.y ) @@ -2041,7 +1957,7 @@ void ALTIUM_PCB::HelperParsePad6NonCopper( const APAD6& aElem ) { // filled octagon DRAWSEGMENT* ds = HelperCreateAndAddDrawsegment( aElem.component ); - ds->SetShape( STROKE_T::S_POLYGON ); + ds->SetShape( S_POLYGON ); ds->SetLayer( klayer ); ds->SetWidth( 0 ); @@ -2160,7 +2076,7 @@ void ALTIUM_PCB::ParseTracks6Data( if( elem.is_keepout || IsAltiumLayerAPlane( elem.layer ) ) { DRAWSEGMENT ds( nullptr ); // just a helper to get the graphic - ds.SetShape( STROKE_T::S_SEGMENT ); + ds.SetShape( S_SEGMENT ); ds.SetStart( elem.start ); ds.SetEnd( elem.end ); ds.SetWidth( elem.width ); @@ -2197,7 +2113,7 @@ void ALTIUM_PCB::ParseTracks6Data( else { DRAWSEGMENT* ds = HelperCreateAndAddDrawsegment( elem.component ); - ds->SetShape( STROKE_T::S_SEGMENT ); + ds->SetShape( S_SEGMENT ); ds->SetStart( elem.start ); ds->SetEnd( elem.end ); ds->SetWidth( elem.width ); @@ -2455,7 +2371,7 @@ void ALTIUM_PCB::ParseFills6Data( DRAWSEGMENT* ds = new DRAWSEGMENT( m_board ); m_board->Add( ds, ADD_MODE::APPEND ); - ds->SetShape( STROKE_T::S_POLYGON ); + ds->SetShape( S_POLYGON ); ds->SetLayer( klayer ); ds->SetWidth( 0 ); diff --git a/pcbnew/plugins/cadstar/cadstar_pcb_archive_loader.cpp b/pcbnew/plugins/cadstar/cadstar_pcb_archive_loader.cpp index c8f4bf0129..40e4e50f6d 100644 --- a/pcbnew/plugins/cadstar/cadstar_pcb_archive_loader.cpp +++ b/pcbnew/plugins/cadstar/cadstar_pcb_archive_loader.cpp @@ -1703,11 +1703,11 @@ void CADSTAR_PCB_ARCHIVE_LOADER::drawCadstarShape( const SHAPE& aCadstarShape, DRAWSEGMENT* ds; if( isModule( aContainer ) ) - ds = new EDGE_MODULE( (MODULE*) aContainer, STROKE_T::S_POLYGON ); + ds = new EDGE_MODULE( (MODULE*) aContainer, S_POLYGON ); else { ds = new DRAWSEGMENT( aContainer ); - ds->SetShape( STROKE_T::S_POLYGON ); + ds->SetShape( S_POLYGON ); } ds->SetPolyShape( getPolySetFromCadstarShape( aCadstarShape, -1, aContainer, aMoveVector, @@ -1812,12 +1812,12 @@ DRAWSEGMENT* CADSTAR_PCB_ARCHIVE_LOADER::getDrawSegmentFromVertex( const POINT& if( isModule( aContainer ) ) { - ds = new EDGE_MODULE( static_cast( aContainer ), STROKE_T::S_SEGMENT ); + ds = new EDGE_MODULE( static_cast( aContainer ), S_SEGMENT ); } else { ds = new DRAWSEGMENT( aContainer ); - ds->SetShape( STROKE_T::S_SEGMENT ); + ds->SetShape( S_SEGMENT ); } ds->SetStart( startPoint ); @@ -1834,12 +1834,12 @@ DRAWSEGMENT* CADSTAR_PCB_ARCHIVE_LOADER::getDrawSegmentFromVertex( const POINT& if( isModule( aContainer ) ) { - ds = new EDGE_MODULE( (MODULE*) aContainer, STROKE_T::S_ARC ); + ds = new EDGE_MODULE( (MODULE*) aContainer, S_ARC ); } else { ds = new DRAWSEGMENT( aContainer ); - ds->SetShape( STROKE_T::S_ARC ); + ds->SetShape( S_ARC ); } ds->SetArcStart( startPoint ); @@ -1981,7 +1981,7 @@ SHAPE_LINE_CHAIN CADSTAR_PCB_ARCHIVE_LOADER::getLineChainFromDrawsegments( { switch( ds->GetShape() ) { - case STROKE_T::S_ARC: + case S_ARC: { if( ds->GetClass() == wxT( "MGRAPHIC" ) ) { @@ -1996,7 +1996,7 @@ SHAPE_LINE_CHAIN CADSTAR_PCB_ARCHIVE_LOADER::getLineChainFromDrawsegments( } } break; - case STROKE_T::S_SEGMENT: + case S_SEGMENT: if( ds->GetClass() == wxT( "MGRAPHIC" ) ) { EDGE_MODULE* em = (EDGE_MODULE*) ds; @@ -2024,8 +2024,10 @@ SHAPE_LINE_CHAIN CADSTAR_PCB_ARCHIVE_LOADER::getLineChainFromDrawsegments( std::vector CADSTAR_PCB_ARCHIVE_LOADER::makeTracksFromDrawsegments( - const std::vector aDrawsegments, BOARD_ITEM_CONTAINER* aParentContainer, - NETINFO_ITEM* aNet, const PCB_LAYER_ID& aLayerOverride, int aWidthOverride ) + const std::vector aDrawsegments, + BOARD_ITEM_CONTAINER* aParentContainer, + NETINFO_ITEM* aNet, PCB_LAYER_ID aLayerOverride, + int aWidthOverride ) { std::vector tracks; @@ -2035,7 +2037,7 @@ std::vector CADSTAR_PCB_ARCHIVE_LOADER::makeTracksFromDrawsegments( switch( ds->GetShape() ) { - case STROKE_T::S_ARC: + case S_ARC: if( ds->GetClass() == wxT( "MGRAPHIC" ) ) { EDGE_MODULE* em = (EDGE_MODULE*) ds; @@ -2048,7 +2050,7 @@ std::vector CADSTAR_PCB_ARCHIVE_LOADER::makeTracksFromDrawsegments( track = new ARC( aParentContainer, &arc ); } break; - case STROKE_T::S_SEGMENT: + case S_SEGMENT: if( ds->GetClass() == wxT( "MGRAPHIC" ) ) { EDGE_MODULE* em = (EDGE_MODULE*) ds; diff --git a/pcbnew/plugins/cadstar/cadstar_pcb_archive_loader.h b/pcbnew/plugins/cadstar/cadstar_pcb_archive_loader.h index 4a01016a8a..3e56de5e47 100644 --- a/pcbnew/plugins/cadstar/cadstar_pcb_archive_loader.h +++ b/pcbnew/plugins/cadstar/cadstar_pcb_archive_loader.h @@ -307,8 +307,7 @@ private: */ std::vector makeTracksFromDrawsegments( const std::vector aDrawsegments, BOARD_ITEM_CONTAINER* aParentContainer, NETINFO_ITEM* aNet = nullptr, - const PCB_LAYER_ID& aLayerOverride = PCB_LAYER_ID::UNDEFINED_LAYER, - int aWidthOverride = -1 ); + PCB_LAYER_ID aLayerOverride = PCB_LAYER_ID::UNDEFINED_LAYER, int aWidthOverride = -1 ); /** * @brief Adds a CADSTAR Attribute to a KiCad module diff --git a/pcbnew/router/pns_kicad_iface.cpp b/pcbnew/router/pns_kicad_iface.cpp index 19738f8245..a32a1eb42a 100644 --- a/pcbnew/router/pns_kicad_iface.cpp +++ b/pcbnew/router/pns_kicad_iface.cpp @@ -983,9 +983,9 @@ void PNS_KICAD_IFACE_BASE::SyncWorld( PNS::NODE *aWorld ) return; } - for( auto gitem : m_board->Drawings() ) + for( BOARD_ITEM* gitem : m_board->Drawings() ) { - if ( gitem->Type() == PCB_LINE_T ) + if ( gitem->Type() == PCB_SHAPE_T ) { syncGraphicalItem( aWorld, static_cast( gitem ) ); } @@ -995,12 +995,12 @@ void PNS_KICAD_IFACE_BASE::SyncWorld( PNS::NODE *aWorld ) } } - for( auto zone : m_board->Zones() ) + for( ZONE_CONTAINER* zone : m_board->Zones() ) { syncZone( aWorld, zone ); } - for( auto module : m_board->Modules() ) + for( MODULE* module : m_board->Modules() ) { for( auto pad : module->Pads() ) { @@ -1019,20 +1019,20 @@ void PNS_KICAD_IFACE_BASE::SyncWorld( PNS::NODE *aWorld ) if( module->IsNetTie() ) continue; - for( auto mgitem : module->GraphicalItems() ) + for( BOARD_ITEM* mgitem : module->GraphicalItems() ) { - if( mgitem->Type() == PCB_MODULE_EDGE_T ) + if( mgitem->Type() == PCB_FP_SHAPE_T ) { syncGraphicalItem( aWorld, static_cast( mgitem ) ); } - else if( mgitem->Type() == PCB_MODULE_TEXT_T ) + else if( mgitem->Type() == PCB_FP_TEXT_T ) { syncTextItem( aWorld, static_cast( mgitem ), mgitem->GetLayer() ); } } } - for( auto t : m_board->Tracks() ) + for( TRACK* t : m_board->Tracks() ) { KICAD_T type = t->Type(); diff --git a/pcbnew/router/router_tool.cpp b/pcbnew/router/router_tool.cpp index bdbac9a46a..bd2ba6cceb 100644 --- a/pcbnew/router/router_tool.cpp +++ b/pcbnew/router/router_tool.cpp @@ -1443,7 +1443,7 @@ int ROUTER_TOOL::InlineDrag( const TOOL_EVENT& aEvent ) { previewItem = static_cast( drawing->Clone() ); - if( drawing->Type() == PCB_MODULE_EDGE_T ) + if( drawing->Type() == PCB_FP_SHAPE_T ) { EDGE_MODULE* edge = static_cast( previewItem ); edge->DRAWSEGMENT::Move( (wxPoint) offset ); diff --git a/pcbnew/specctra_import_export/specctra_export.cpp b/pcbnew/specctra_import_export/specctra_export.cpp index 07296bbac9..3b753c8728 100644 --- a/pcbnew/specctra_import_export/specctra_export.cpp +++ b/pcbnew/specctra_import_export/specctra_export.cpp @@ -696,7 +696,7 @@ IMAGE* SPECCTRA_DB::makeIMAGE( BOARD* aBoard, MODULE* aModule ) } #if 1 // enable image (outline) scopes. - static const KICAD_T scanEDGEs[] = { PCB_MODULE_EDGE_T, EOT }; + static const KICAD_T scanEDGEs[] = { PCB_FP_SHAPE_T, EOT }; // get all the MODULE's EDGE_MODULEs and convert those to DSN outlines. moduleItems.Collect( aModule, scanEDGEs ); diff --git a/pcbnew/tools/convert_tool.cpp b/pcbnew/tools/convert_tool.cpp index abc8661a13..1556479d54 100644 --- a/pcbnew/tools/convert_tool.cpp +++ b/pcbnew/tools/convert_tool.cpp @@ -69,7 +69,7 @@ bool CONVERT_TOOL::Init() m_menu->SetTitle( _( "Convert..." ) ); static KICAD_T convertableTracks[] = { PCB_TRACE_T, PCB_ARC_T, EOT }; - static KICAD_T convertableZones[] = { PCB_ZONE_AREA_T, PCB_MODULE_ZONE_AREA_T, EOT }; + static KICAD_T convertableZones[] = { PCB_ZONE_AREA_T, PCB_FP_ZONE_AREA_T, EOT }; auto graphicLines = P_S_C::OnlyGraphicShapeTypes( { S_SEGMENT, S_RECT } ) && P_S_C::SameLayer(); @@ -122,8 +122,8 @@ int CONVERT_TOOL::LinesToPoly( const TOOL_EVENT& aEvent ) switch( item->Type() ) { - case PCB_LINE_T: - case PCB_MODULE_EDGE_T: + case PCB_SHAPE_T: + case PCB_FP_SHAPE_T: switch( static_cast( item )->GetShape() ) { case S_SEGMENT: @@ -327,7 +327,7 @@ SHAPE_POLY_SET CONVERT_TOOL::makePolysFromRects( const std::deque& aI for( EDA_ITEM* item : aItems ) { - if( item->Type() != PCB_LINE_T && item->Type() != PCB_MODULE_EDGE_T ) + if( item->Type() != PCB_SHAPE_T && item->Type() != PCB_FP_SHAPE_T ) continue; DRAWSEGMENT* graphic = static_cast( item ); @@ -366,8 +366,8 @@ int CONVERT_TOOL::PolyToLines( const TOOL_EVENT& aEvent ) switch( item->Type() ) { - case PCB_LINE_T: - case PCB_MODULE_EDGE_T: + case PCB_SHAPE_T: + case PCB_FP_SHAPE_T: switch( static_cast( item )->GetShape() ) { case S_POLYGON: @@ -383,7 +383,7 @@ int CONVERT_TOOL::PolyToLines( const TOOL_EVENT& aEvent ) break; case PCB_ZONE_AREA_T: - case PCB_MODULE_ZONE_AREA_T: + case PCB_FP_ZONE_AREA_T: break; default: @@ -403,12 +403,12 @@ int CONVERT_TOOL::PolyToLines( const TOOL_EVENT& aEvent ) switch( aItem->Type() ) { case PCB_ZONE_AREA_T: - case PCB_MODULE_ZONE_AREA_T: + case PCB_FP_ZONE_AREA_T: set = *static_cast( aItem )->Outline(); break; - case PCB_LINE_T: - case PCB_MODULE_EDGE_T: + case PCB_SHAPE_T: + case PCB_FP_SHAPE_T: { DRAWSEGMENT* graphic = static_cast( aItem ); @@ -524,9 +524,9 @@ int CONVERT_TOOL::SegmentToArc( const TOOL_EVENT& aEvent ) { BOARD_ITEM* item = aCollector[i]; - if( !( item->Type() == PCB_LINE_T || + if( !( item->Type() == PCB_SHAPE_T || item->Type() == PCB_TRACE_T || - item->Type() == PCB_MODULE_EDGE_T ) ) + item->Type() == PCB_FP_SHAPE_T ) ) aCollector.Remove( item ); } } ); @@ -561,7 +561,7 @@ int CONVERT_TOOL::SegmentToArc( const TOOL_EVENT& aEvent ) BOARD_COMMIT commit( m_frame ); - if( source->Type() == PCB_LINE_T || source->Type() == PCB_MODULE_EDGE_T ) + if( source->Type() == PCB_SHAPE_T || source->Type() == PCB_FP_SHAPE_T ) { DRAWSEGMENT* line = static_cast( source ); DRAWSEGMENT* arc = new DRAWSEGMENT( parent ); @@ -604,8 +604,8 @@ OPT CONVERT_TOOL::getStartEndPoints( EDA_ITEM* aItem ) { switch( aItem->Type() ) { - case PCB_LINE_T: - case PCB_MODULE_EDGE_T: + case PCB_SHAPE_T: + case PCB_FP_SHAPE_T: { DRAWSEGMENT* line = static_cast( aItem ); return boost::make_optional( { VECTOR2I( line->GetStart() ), diff --git a/pcbnew/tools/drawing_tool.cpp b/pcbnew/tools/drawing_tool.cpp index 8844591d7e..566891129e 100644 --- a/pcbnew/tools/drawing_tool.cpp +++ b/pcbnew/tools/drawing_tool.cpp @@ -942,7 +942,7 @@ int DRAWING_TOOL::PlaceImportedGraphics( const TOOL_EVENT& aEvent ) if( !m_frame->GetModel() ) return 0; - // Note: PlaceImportedGraphics() will convert PCB_LINE_T and PCB_TEXT_T to module graphic + // Note: PlaceImportedGraphics() will convert PCB_SHAPE_T and PCB_TEXT_T to footprint // items if needed DIALOG_IMPORT_GFX dlg( m_frame, m_editModules ); int dlgResult = dlg.ShowModal(); @@ -975,9 +975,9 @@ int DRAWING_TOOL::PlaceImportedGraphics( const TOOL_EVENT& aEvent ) EDA_ITEM* item = ptr.get(); if( m_editModules ) - wxASSERT( item->Type() == PCB_MODULE_EDGE_T || item->Type() == PCB_MODULE_TEXT_T ); + wxASSERT( item->Type() == PCB_FP_SHAPE_T || item->Type() == PCB_FP_TEXT_T ); else - wxASSERT( item->Type() == PCB_LINE_T || item->Type() == PCB_TEXT_T ); + wxASSERT( item->Type() == PCB_SHAPE_T || item->Type() == PCB_TEXT_T ); if( grp ) grp->AddItem( static_cast( item ) ); @@ -1188,7 +1188,7 @@ bool DRAWING_TOOL::drawSegment( const std::string& aTool, int aShape, DRAWSEGMEN KIGFX::PREVIEW::TWO_POINT_GEOMETRY_MANAGER twoPointManager; // drawing assistant overlay - // TODO: workaround because STROKE_T is not visible from commons. + // TODO: workaround because PCB_SHAPE_TYPE_T is not visible from commons. KIGFX::PREVIEW::GEOM_SHAPE geomShape( static_cast( aShape ) ); KIGFX::PREVIEW::TWO_POINT_ASSISTANT twoPointAsst( twoPointManager, m_frame->GetUserUnits(), geomShape ); @@ -1310,7 +1310,7 @@ bool DRAWING_TOOL::drawSegment( const std::string& aTool, int aShape, DRAWSEGMEN m_lineWidth = getSegmentWidth( m_frame->GetActiveLayer() ); // Init the new item attributes - graphic->SetShape( (STROKE_T) aShape ); + graphic->SetShape( (PCB_SHAPE_TYPE_T) aShape ); graphic->SetWidth( m_lineWidth ); graphic->SetLayer( m_frame->GetActiveLayer() ); grid.SetSkipPoint( cursorPos ); diff --git a/pcbnew/tools/drawing_tool.h b/pcbnew/tools/drawing_tool.h index 302648d574..8e17c889f3 100644 --- a/pcbnew/tools/drawing_tool.h +++ b/pcbnew/tools/drawing_tool.h @@ -167,7 +167,7 @@ private: /** * Starts drawing a selected shape (i.e. DRAWSEGMENT). - * @param aShape is the type of created shape (@see STROKE_T). + * @param aShape is the type of created shape (@see PCB_SHAPE_TYPE_T). * @param aGraphic is an object that is going to be used by the tool for drawing. Must be * already created. The tool deletes the object if it is not added to a BOARD. * @param aStartingPoint is a starting point for this new DRAWSEGMENT. If it exists the new diff --git a/pcbnew/tools/edit_tool.cpp b/pcbnew/tools/edit_tool.cpp index 73b6615eff..6ca494bca2 100644 --- a/pcbnew/tools/edit_tool.cpp +++ b/pcbnew/tools/edit_tool.cpp @@ -72,7 +72,7 @@ void EditToolSelectionFilter( GENERAL_COLLECTOR& aCollector, int aFlags, { aCollector.Remove( item ); } - else if( item->Type() == PCB_MODULE_ZONE_AREA_T ) + else if( item->Type() == PCB_FP_ZONE_AREA_T ) { MODULE* mod = static_cast( item->GetParent() ); @@ -914,9 +914,9 @@ int EDIT_TOOL::Mirror( const TOOL_EVENT& aEvent ) // only modify items we can mirror switch( item->Type() ) { - case PCB_MODULE_EDGE_T: - case PCB_MODULE_TEXT_T: - case PCB_MODULE_ZONE_AREA_T: + case PCB_FP_SHAPE_T: + case PCB_FP_TEXT_T: + case PCB_FP_ZONE_AREA_T: case PCB_PAD_T: // Only create undo entry for items on the board if( !item->IsNew() && !EditingModules() ) @@ -930,21 +930,21 @@ int EDIT_TOOL::Mirror( const TOOL_EVENT& aEvent ) // modify each object as necessary switch( item->Type() ) { - case PCB_MODULE_EDGE_T: + case PCB_FP_SHAPE_T: { EDGE_MODULE* edge = static_cast( item ); edge->Mirror( mirrorPoint, false ); break; } - case PCB_MODULE_ZONE_AREA_T: + case PCB_FP_ZONE_AREA_T: { MODULE_ZONE_CONTAINER* zone = static_cast( item ); zone->Mirror( mirrorPoint, false ); break; } - case PCB_MODULE_TEXT_T: + case PCB_FP_TEXT_T: { TEXTE_MODULE* modText = static_cast( item ); modText->Mirror( mirrorPoint, false ); @@ -1125,7 +1125,7 @@ int EDIT_TOOL::Remove( const TOOL_EVENT& aEvent ) switch( item->Type() ) { - case PCB_MODULE_TEXT_T: + case PCB_FP_TEXT_T: { TEXTE_MODULE* text = static_cast( item ); MODULE* parent = static_cast( item->GetParent() ); @@ -1150,7 +1150,7 @@ int EDIT_TOOL::Remove( const TOOL_EVENT& aEvent ) } break; - case PCB_MODULE_ZONE_AREA_T: + case PCB_FP_ZONE_AREA_T: { MODULE_ZONE_CONTAINER* zone = static_cast( item ); MODULE* parent = static_cast( item->GetParent() ); @@ -1427,7 +1427,7 @@ int EDIT_TOOL::Duplicate( const TOOL_EVENT& aEvent ) { case PCB_MODULE_T: case PCB_TEXT_T: - case PCB_LINE_T: + case PCB_SHAPE_T: case PCB_TRACE_T: case PCB_VIA_T: case PCB_ZONE_AREA_T: diff --git a/pcbnew/tools/grid_helper.cpp b/pcbnew/tools/grid_helper.cpp index 98ac9fc09c..46433464f9 100644 --- a/pcbnew/tools/grid_helper.cpp +++ b/pcbnew/tools/grid_helper.cpp @@ -547,8 +547,8 @@ void GRID_HELPER::computeAnchors( BOARD_ITEM* aItem, const VECTOR2I& aRefPos, bo break; } - case PCB_MODULE_EDGE_T: - case PCB_LINE_T: + case PCB_FP_SHAPE_T: + case PCB_SHAPE_T: { if( !m_magneticSettings->graphics ) break; @@ -714,7 +714,7 @@ void GRID_HELPER::computeAnchors( BOARD_ITEM* aItem, const VECTOR2I& aRefPos, bo break; } - case PCB_MODULE_TEXT_T: + case PCB_FP_TEXT_T: case PCB_TEXT_T: addAnchor( aItem->GetPosition(), ORIGIN, aItem ); break; diff --git a/pcbnew/tools/pcb_selection_conditions.cpp b/pcbnew/tools/pcb_selection_conditions.cpp index c533f64260..37b7d556b0 100644 --- a/pcbnew/tools/pcb_selection_conditions.cpp +++ b/pcbnew/tools/pcb_selection_conditions.cpp @@ -62,7 +62,7 @@ S_C PCB_SELECTION_CONDITIONS::SameLayer() } -S_C PCB_SELECTION_CONDITIONS::OnlyGraphicShapeTypes( const std::set aTypes ) +S_C PCB_SELECTION_CONDITIONS::OnlyGraphicShapeTypes( const std::set aTypes ) { return std::bind( &PCB_SELECTION_CONDITIONS::onlyGraphicShapeTypesFunc, _1, aTypes ); } @@ -137,17 +137,17 @@ bool PCB_SELECTION_CONDITIONS::sameLayerFunc( const SELECTION& aSelection ) bool PCB_SELECTION_CONDITIONS::onlyGraphicShapeTypesFunc( const SELECTION& aSelection, - const std::set aTypes ) + const std::set aTypes ) { if( aSelection.Empty() ) return false; for( const EDA_ITEM* item : aSelection ) { - if( item->Type() != PCB_LINE_T && item->Type() != PCB_MODULE_EDGE_T ) + if( item->Type() != PCB_SHAPE_T && item->Type() != PCB_FP_SHAPE_T ) return false; - STROKE_T shape = static_cast( item )->GetShape(); + PCB_SHAPE_TYPE_T shape = static_cast( item )->GetShape(); if( !aTypes.count( shape ) ) return false; diff --git a/pcbnew/tools/pcb_selection_conditions.h b/pcbnew/tools/pcb_selection_conditions.h index db102ba42f..20b044a3d6 100644 --- a/pcbnew/tools/pcb_selection_conditions.h +++ b/pcbnew/tools/pcb_selection_conditions.h @@ -62,11 +62,11 @@ public: /** * Creates a functor that tests if the selection contains DRAWSEGMENT* items of certain shapes - * This implicitly includes an OnlyType( PCB_LINE_T ) as part of the test - * @param aTypes is a list of allowed DRAWSEGMENT shapes (@see STROKE_T) + * This implicitly includes an OnlyType( PCB_SHAPE_T ) as part of the test + * @param aTypes is a list of allowed DRAWSEGMENT shapes (@see PCB_SHAPE_TYPE_T) * @return functor testing if selected items match the given list of allowed shapes */ - static SELECTION_CONDITION OnlyGraphicShapeTypes( const std::set aTypes ); + static SELECTION_CONDITION OnlyGraphicShapeTypes( const std::set aTypes ); private: @@ -78,7 +78,7 @@ private: ///> Helper function used by OnlyGraphicShapeTypes() static bool onlyGraphicShapeTypesFunc( const SELECTION& aSelection, - const std::set aTypes ); + const std::set aTypes ); }; #endif /* PCB_SELECTION_CONDITIONS_H_ */ diff --git a/pcbnew/tools/pcb_viewer_tools.cpp b/pcbnew/tools/pcb_viewer_tools.cpp index 225de15d1d..e0bc50e99f 100644 --- a/pcbnew/tools/pcb_viewer_tools.cpp +++ b/pcbnew/tools/pcb_viewer_tools.cpp @@ -140,7 +140,7 @@ int PCB_VIEWER_TOOLS::GraphicOutlines( const TOOL_EVENT& aEvent ) { for( BOARD_ITEM* item : module->GraphicalItems() ) { - if( item->Type() == PCB_MODULE_EDGE_T ) + if( item->Type() == PCB_FP_SHAPE_T ) view()->Update( item, KIGFX::GEOMETRY ); } } @@ -149,7 +149,7 @@ int PCB_VIEWER_TOOLS::GraphicOutlines( const TOOL_EVENT& aEvent ) { KICAD_T t = item->Type(); - if( t == PCB_LINE_T || BaseType( t ) == PCB_DIMENSION_T || t == PCB_TARGET_T ) + if( t == PCB_SHAPE_T || BaseType( t ) == PCB_DIMENSION_T || t == PCB_TARGET_T ) view()->Update( item, KIGFX::GEOMETRY ); } @@ -173,7 +173,7 @@ int PCB_VIEWER_TOOLS::TextOutlines( const TOOL_EVENT& aEvent ) for( BOARD_ITEM* item : module->GraphicalItems() ) { - if( item->Type() == PCB_MODULE_TEXT_T ) + if( item->Type() == PCB_FP_TEXT_T ) view()->Update( item, KIGFX::GEOMETRY ); } } diff --git a/pcbnew/tools/pcbnew_control.cpp b/pcbnew/tools/pcbnew_control.cpp index 06d7520318..729f16d774 100644 --- a/pcbnew/tools/pcbnew_control.cpp +++ b/pcbnew/tools/pcbnew_control.cpp @@ -551,14 +551,14 @@ void pasteModuleItemsToModEdit( MODULE* aClipModule, BOARD* aBoard, for( BOARD_ITEM* item : aClipModule->GraphicalItems() ) { - if( item->Type() == PCB_MODULE_EDGE_T ) + if( item->Type() == PCB_FP_SHAPE_T ) { EDGE_MODULE* edge = static_cast( item ); edge->SetParent( nullptr ); edge->SetLocalCoord(); } - else if( item->Type() == PCB_MODULE_TEXT_T ) + else if( item->Type() == PCB_FP_TEXT_T ) { TEXTE_MODULE* text = static_cast( item ); @@ -655,11 +655,11 @@ int PCBNEW_CONTROL::Paste( const TOOL_EVENT& aEvent ) for( BOARD_ITEM* clipDrawItem : clipBoard->Drawings() ) { - if( clipDrawItem->Type() == PCB_LINE_T ) + if( clipDrawItem->Type() == PCB_SHAPE_T ) { DRAWSEGMENT* clipDrawSeg = static_cast( clipDrawItem ); - // Convert to PCB_MODULE_EDGE_T + // Convert to PCB_FP_SHAPE_T EDGE_MODULE* pastedDrawSeg = new EDGE_MODULE( editModule ); static_cast( pastedDrawSeg )->SwapData( clipDrawSeg ); pastedDrawSeg->SetLocalCoord(); @@ -672,7 +672,7 @@ int PCBNEW_CONTROL::Paste( const TOOL_EVENT& aEvent ) { TEXTE_PCB* clipTextItem = static_cast( clipDrawItem ); - // Convert to PCB_MODULE_TEXT_T + // Convert to PCB_FP_TEXT_T TEXTE_MODULE* pastedTextItem = new TEXTE_MODULE( editModule ); static_cast( pastedTextItem )->SwapText( *clipTextItem ); static_cast( pastedTextItem )->SwapEffects( *clipTextItem ); diff --git a/pcbnew/tools/point_editor.cpp b/pcbnew/tools/point_editor.cpp index 609b991ab1..1b8068feb3 100644 --- a/pcbnew/tools/point_editor.cpp +++ b/pcbnew/tools/point_editor.cpp @@ -137,8 +137,8 @@ public: // Generate list of edit points basing on the item type switch( aItem->Type() ) { - case PCB_LINE_T: - case PCB_MODULE_EDGE_T: + case PCB_SHAPE_T: + case PCB_FP_SHAPE_T: { const DRAWSEGMENT* segment = static_cast( aItem ); @@ -237,7 +237,7 @@ public: } break; - case PCB_MODULE_ZONE_AREA_T: + case PCB_FP_ZONE_AREA_T: case PCB_ZONE_AREA_T: { auto zone = static_cast( aItem ); @@ -1039,8 +1039,8 @@ void POINT_EDITOR::updateItem() const switch( item->Type() ) { - case PCB_LINE_T: - case PCB_MODULE_EDGE_T: + case PCB_SHAPE_T: + case PCB_FP_SHAPE_T: { DRAWSEGMENT* segment = static_cast( item ); @@ -1294,7 +1294,7 @@ void POINT_EDITOR::updateItem() const } break; - case PCB_MODULE_ZONE_AREA_T: + case PCB_FP_ZONE_AREA_T: case PCB_ZONE_AREA_T: { ZONE_CONTAINER* zone = static_cast( item ); @@ -1480,7 +1480,7 @@ void POINT_EDITOR::finishItem() if( !item ) return; - if( item->Type() == PCB_ZONE_AREA_T || item->Type() == PCB_MODULE_ZONE_AREA_T ) + if( item->Type() == PCB_ZONE_AREA_T || item->Type() == PCB_FP_ZONE_AREA_T ) { auto zone = static_cast( item ); @@ -1524,8 +1524,8 @@ void POINT_EDITOR::updatePoints() switch( item->Type() ) { - case PCB_LINE_T: - case PCB_MODULE_EDGE_T: + case PCB_SHAPE_T: + case PCB_FP_SHAPE_T: { const DRAWSEGMENT* segment = static_cast( item ); @@ -1660,7 +1660,7 @@ void POINT_EDITOR::updatePoints() } break; - case PCB_MODULE_ZONE_AREA_T: + case PCB_FP_ZONE_AREA_T: case PCB_ZONE_AREA_T: { ZONE_CONTAINER* zone = static_cast( item ); @@ -1752,11 +1752,13 @@ void POINT_EDITOR::setAltConstraint( bool aEnabled ) bool isPoly = false; if( m_editPoints->GetParent()->Type() == PCB_ZONE_AREA_T - || m_editPoints->GetParent()->Type() == PCB_MODULE_ZONE_AREA_T ) + || m_editPoints->GetParent()->Type() == PCB_FP_ZONE_AREA_T ) + { isPoly = true; + } - else if( m_editPoints->GetParent()->Type() == PCB_LINE_T - || m_editPoints->GetParent()->Type() == PCB_MODULE_EDGE_T ) + else if( m_editPoints->GetParent()->Type() == PCB_SHAPE_T + || m_editPoints->GetParent()->Type() == PCB_FP_SHAPE_T ) { DRAWSEGMENT* seg = static_cast( m_editPoints->GetParent() ); isPoly = seg->GetShape() == S_POLYGON; @@ -1786,8 +1788,8 @@ EDIT_POINT POINT_EDITOR::get45DegConstrainer() const switch( item->Type() ) { - case PCB_LINE_T: - case PCB_MODULE_EDGE_T: + case PCB_SHAPE_T: + case PCB_FP_SHAPE_T: { const DRAWSEGMENT* segment = static_cast( item ); { @@ -1845,10 +1847,16 @@ bool POINT_EDITOR::canAddCorner( const EDA_ITEM& aItem ) const auto type = aItem.Type(); // Works only for zones and line segments - return type == PCB_ZONE_AREA_T || type == PCB_MODULE_ZONE_AREA_T || - ( ( type == PCB_LINE_T || type == PCB_MODULE_EDGE_T ) && - ( static_cast( aItem ).GetShape() == S_SEGMENT || - static_cast( aItem ).GetShape() == S_POLYGON ) ); + if( type == PCB_ZONE_AREA_T || type == PCB_FP_ZONE_AREA_T ) + return true; + + if( type == PCB_SHAPE_T || type == PCB_FP_SHAPE_T ) + { + const DRAWSEGMENT& shape = static_cast( aItem ); + return shape.GetShape() == S_SEGMENT || shape.GetShape() == S_POLYGON; + } + + return false; } @@ -1886,14 +1894,17 @@ bool POINT_EDITOR::removeCornerCondition( const SELECTION& ) EDA_ITEM* item = m_editPoints->GetParent(); - if( !item || !( item->Type() == PCB_ZONE_AREA_T || item->Type() == PCB_MODULE_ZONE_AREA_T || - ( ( item->Type() == PCB_MODULE_EDGE_T || item->Type() == PCB_LINE_T ) && + if( !item ) + return false; + + if( !( item->Type() == PCB_ZONE_AREA_T || item->Type() == PCB_FP_ZONE_AREA_T + || ( ( item->Type() == PCB_FP_SHAPE_T || item->Type() == PCB_SHAPE_T ) && static_cast( item )->GetShape() == S_POLYGON ) ) ) return false; SHAPE_POLY_SET *polyset; - if( item->Type() == PCB_ZONE_AREA_T || item->Type() == PCB_MODULE_ZONE_AREA_T ) + if( item->Type() == PCB_ZONE_AREA_T || item->Type() == PCB_FP_ZONE_AREA_T ) polyset = static_cast( item )->Outline(); else polyset = &static_cast( item )->GetPolyShape(); @@ -1936,8 +1947,8 @@ int POINT_EDITOR::addCorner( const TOOL_EVENT& aEvent ) DRAWSEGMENT* graphicItem = dynamic_cast( item ); BOARD_COMMIT commit( frame ); - if( item->Type() == PCB_ZONE_AREA_T || item->Type() == PCB_MODULE_ZONE_AREA_T || - ( graphicItem && graphicItem->GetShape() == S_POLYGON ) ) + if( item->Type() == PCB_ZONE_AREA_T || item->Type() == PCB_FP_ZONE_AREA_T || + ( graphicItem && graphicItem->GetShape() == S_POLYGON ) ) { unsigned int nearestIdx = 0; unsigned int nextNearestIdx = 0; @@ -1945,7 +1956,7 @@ int POINT_EDITOR::addCorner( const TOOL_EVENT& aEvent ) unsigned int firstPointInContour = 0; SHAPE_POLY_SET* zoneOutline; - if( item->Type() == PCB_ZONE_AREA_T || item->Type() == PCB_MODULE_ZONE_AREA_T ) + if( item->Type() == PCB_ZONE_AREA_T || item->Type() == PCB_FP_ZONE_AREA_T ) { ZONE_CONTAINER* zone = static_cast( item ); zoneOutline = zone->Outline(); @@ -2001,7 +2012,7 @@ int POINT_EDITOR::addCorner( const TOOL_EVENT& aEvent ) zoneOutline->InsertVertex( nextNearestIdx, nearestPoint ); // We re-hatch the filled zones but not polygons - if( item->Type() == PCB_ZONE_AREA_T || item->Type() == PCB_MODULE_ZONE_AREA_T ) + if( item->Type() == PCB_ZONE_AREA_T || item->Type() == PCB_FP_ZONE_AREA_T ) static_cast( item )->HatchBorder(); @@ -2018,13 +2029,13 @@ int POINT_EDITOR::addCorner( const TOOL_EVENT& aEvent ) // Move the end of the line to the break point.. graphicItem->SetEnd( wxPoint( nearestPoint.x, nearestPoint.y ) ); - if( graphicItem->Type() == PCB_MODULE_EDGE_T ) + if( graphicItem->Type() == PCB_FP_SHAPE_T ) static_cast( graphicItem )->SetLocalCoord(); // and add another one starting from the break point DRAWSEGMENT* newSegment; - if( item->Type() == PCB_MODULE_EDGE_T ) + if( item->Type() == PCB_FP_SHAPE_T ) { EDGE_MODULE* edge = static_cast( graphicItem ); assert( edge->GetParent()->Type() == PCB_MODULE_T ); @@ -2039,7 +2050,7 @@ int POINT_EDITOR::addCorner( const TOOL_EVENT& aEvent ) newSegment->SetStart( wxPoint( nearestPoint.x, nearestPoint.y ) ); newSegment->SetEnd( wxPoint( seg.B.x, seg.B.y ) ); - if( newSegment->Type() == PCB_MODULE_EDGE_T ) + if( newSegment->Type() == PCB_FP_SHAPE_T ) static_cast( newSegment )->SetLocalCoord(); commit.Add( newSegment ); @@ -2063,13 +2074,13 @@ int POINT_EDITOR::removeCorner( const TOOL_EVENT& aEvent ) SHAPE_POLY_SET* polygon = nullptr; - if( item->Type() == PCB_ZONE_AREA_T || item->Type() == PCB_MODULE_ZONE_AREA_T ) + if( item->Type() == PCB_ZONE_AREA_T || item->Type() == PCB_FP_ZONE_AREA_T ) { auto zone = static_cast( item ); polygon = zone->Outline(); zone->SetNeedRefill( true ); } - else if( (item->Type() == PCB_MODULE_EDGE_T ) || ( item->Type() == PCB_LINE_T ) ) + else if( item->Type() == PCB_FP_SHAPE_T || item->Type() == PCB_SHAPE_T ) { auto ds = static_cast( item ); @@ -2117,7 +2128,7 @@ int POINT_EDITOR::removeCorner( const TOOL_EVENT& aEvent ) commit.Push( _( "Remove a zone/polygon corner" ) ); // Refresh zone hatching - if( item->Type() == PCB_ZONE_AREA_T || item->Type() == PCB_MODULE_ZONE_AREA_T ) + if( item->Type() == PCB_ZONE_AREA_T || item->Type() == PCB_FP_ZONE_AREA_T ) static_cast( item )->HatchBorder(); updatePoints(); diff --git a/pcbnew/tools/selection_tool.cpp b/pcbnew/tools/selection_tool.cpp index 3f0941ee18..cbbe631dff 100644 --- a/pcbnew/tools/selection_tool.cpp +++ b/pcbnew/tools/selection_tool.cpp @@ -754,9 +754,9 @@ SELECTION_LOCK_FLAGS SELECTION_TOOL::CheckLock() containsLocked = true; break; - case PCB_MODULE_EDGE_T: - case PCB_MODULE_TEXT_T: - case PCB_MODULE_ZONE_AREA_T: + case PCB_FP_SHAPE_T: + case PCB_FP_TEXT_T: + case PCB_FP_ZONE_AREA_T: if( static_cast( item->GetParent() )->IsLocked() ) containsLocked = true; break; @@ -1394,7 +1394,7 @@ static bool itemIsIncludedByFilter( const BOARD_ITEM& aItem, const BOARD& aBoard include = aFilterOptions.includeZones; break; } - case PCB_LINE_T: + case PCB_SHAPE_T: case PCB_TARGET_T: case PCB_DIM_ALIGNED_T: case PCB_DIM_CENTER_T: @@ -1522,14 +1522,14 @@ bool SELECTION_TOOL::itemPassesFilter( BOARD_ITEM* aItem ) break; } - case PCB_LINE_T: + case PCB_SHAPE_T: case PCB_TARGET_T: if( !m_filter.graphics ) return false; break; - case PCB_MODULE_TEXT_T: + case PCB_FP_TEXT_T: case PCB_TEXT_T: if( !m_filter.text ) return false; @@ -1815,7 +1815,7 @@ bool SELECTION_TOOL::Selectable( const BOARD_ITEM* aItem, bool checkVisibilityOn switch( aItem->Type() ) { case PCB_ZONE_AREA_T: - case PCB_MODULE_ZONE_AREA_T: + case PCB_FP_ZONE_AREA_T: { const ZONE_CONTAINER* zone = static_cast( aItem ); @@ -1879,7 +1879,7 @@ bool SELECTION_TOOL::Selectable( const BOARD_ITEM* aItem, bool checkVisibilityOn return false; } - case PCB_MODULE_TEXT_T: + case PCB_FP_TEXT_T: // Multiple selection is only allowed in modedit mode. In pcbnew, you have to select // module subparts one by one, rather than with a drag selection. This is so you can // pick up items under an (unlocked) module without also moving the module's sub-parts. @@ -1894,7 +1894,7 @@ bool SELECTION_TOOL::Selectable( const BOARD_ITEM* aItem, bool checkVisibilityOn break; - case PCB_MODULE_EDGE_T: + case PCB_FP_SHAPE_T: // Module edge selections are only allowed in modedit mode. if( !m_editModules && !checkVisibilityOnly ) return false; @@ -2258,7 +2258,7 @@ void SELECTION_TOOL::GuessSelectionCandidates( GENERAL_COLLECTOR& aCollector, BOARD_ITEM* item = aCollector[i]; KICAD_T type = item->Type(); - if( ( type == PCB_MODULE_TEXT_T || type == PCB_TEXT_T || type == PCB_LINE_T ) + if( ( type == PCB_FP_TEXT_T || type == PCB_TEXT_T || type == PCB_SHAPE_T ) && silkLayers[item->GetLayer()] ) { preferred.insert( item ); @@ -2301,7 +2301,7 @@ void SELECTION_TOOL::GuessSelectionCandidates( GENERAL_COLLECTOR& aCollector, } } - if( aCollector.CountType( PCB_MODULE_TEXT_T ) > 0 ) + if( aCollector.CountType( PCB_FP_TEXT_T ) > 0 ) { for( int i = 0; i < aCollector.GetCount(); ++i ) { @@ -2334,7 +2334,7 @@ void SELECTION_TOOL::GuessSelectionCandidates( GENERAL_COLLECTOR& aCollector, case PCB_TRACE_T: case PCB_ARC_T: case PCB_PAD_T: - case PCB_LINE_T: + case PCB_SHAPE_T: case PCB_VIA_T: case PCB_MODULE_T: if( areaRatio > textToFeatureMinRatio && txtCommonRatio < commonAreaRatio ) @@ -2348,7 +2348,7 @@ void SELECTION_TOOL::GuessSelectionCandidates( GENERAL_COLLECTOR& aCollector, } } - if( aCollector.CountType( PCB_MODULE_EDGE_T ) + aCollector.CountType( PCB_LINE_T ) > 1 ) + if( aCollector.CountType( PCB_FP_SHAPE_T ) + aCollector.CountType( PCB_SHAPE_T ) > 1 ) { // Prefer exact hits to sloppy ones int accuracy = KiROUND( 5 * aCollector.GetGuide()->OnePixelInIU() ); diff --git a/pcbnew/zone_filler.cpp b/pcbnew/zone_filler.cpp index 236607d20f..ab958dbd0e 100644 --- a/pcbnew/zone_filler.cpp +++ b/pcbnew/zone_filler.cpp @@ -609,7 +609,7 @@ void ZONE_FILLER::addKnockout( BOARD_ITEM* aItem, PCB_LAYER_ID aLayer, int aGap, { switch( aItem->Type() ) { - case PCB_LINE_T: + case PCB_SHAPE_T: { DRAWSEGMENT* seg = (DRAWSEGMENT*) aItem; seg->TransformShapeWithClearanceToPolygon( aHoles, aLayer, aGap, m_maxError, @@ -622,14 +622,14 @@ void ZONE_FILLER::addKnockout( BOARD_ITEM* aItem, PCB_LAYER_ID aLayer, int aGap, text->TransformBoundingBoxWithClearanceToPolygon( &aHoles, aGap ); break; } - case PCB_MODULE_EDGE_T: + case PCB_FP_SHAPE_T: { EDGE_MODULE* edge = (EDGE_MODULE*) aItem; edge->TransformShapeWithClearanceToPolygon( aHoles, aLayer, aGap, m_maxError, aIgnoreLineWidth ); break; } - case PCB_MODULE_TEXT_T: + case PCB_FP_TEXT_T: { TEXTE_MODULE* text = (TEXTE_MODULE*) aItem; diff --git a/qa/drc_proto/drc_test_provider_silk_to_pad.cpp b/qa/drc_proto/drc_test_provider_silk_to_pad.cpp index 36618d3ad6..eb16efbb0d 100644 --- a/qa/drc_proto/drc_test_provider_silk_to_pad.cpp +++ b/qa/drc_proto/drc_test_provider_silk_to_pad.cpp @@ -113,7 +113,7 @@ bool test::DRC_TEST_PROVIDER_SILK_TO_PAD::Run() boardItems.push_back( item ); }; - forEachGeometryItem( { PCB_LINE_T }, LSET( Edge_Cuts ), queryBoardOutlineItems ); + forEachGeometryItem( { PCB_SHAPE_T }, LSET( Edge_Cuts ), queryBoardOutlineItems ); forEachGeometryItem( {}, LSET::AllTechMask() | LSET::AllCuMask(), queryBoardGeometryItems ); diff --git a/qa/pcbnew_utils/board_construction_utils.cpp b/qa/pcbnew_utils/board_construction_utils.cpp index 1f89df3772..cc276e0933 100644 --- a/qa/pcbnew_utils/board_construction_utils.cpp +++ b/qa/pcbnew_utils/board_construction_utils.cpp @@ -34,7 +34,7 @@ namespace KI_TEST void DrawSegment( MODULE& aMod, const SEG& aSeg, int aWidth, PCB_LAYER_ID aLayer ) { - auto seg = std::make_unique( &aMod, STROKE_T::S_SEGMENT ); + auto seg = std::make_unique( &aMod, S_SEGMENT ); seg->SetStart0( (wxPoint) aSeg.A ); seg->SetEnd0( (wxPoint) aSeg.B ); @@ -59,7 +59,7 @@ void DrawPolyline( void DrawArc( MODULE& aMod, const VECTOR2I& aCentre, const VECTOR2I& aStart, double aAngle, int aWidth, PCB_LAYER_ID aLayer ) { - auto seg = std::make_unique( &aMod, STROKE_T::S_ARC ); + auto seg = std::make_unique( &aMod, S_ARC ); seg->SetStart0( (wxPoint) aCentre ); seg->SetEnd0( (wxPoint) aStart );