diff --git a/common/view/view.cpp b/common/view/view.cpp index c23b96400a..f9cba3ab45 100644 --- a/common/view/view.cpp +++ b/common/view/view.cpp @@ -620,7 +620,7 @@ void VIEW::SetCenter( const VECTOR2D& aCenter, const std::vector& obscuri while( !unobscuredPoly.IsEmpty() ) { - unobscuredCenter = (wxPoint) unobscuredPoly.BBox().Centre(); + unobscuredCenter = unobscuredPoly.BBox().Centre(); unobscuredPoly.Deflate( step, 4 ); } diff --git a/eeschema/sch_plugins/cadstar/cadstar_sch_archive_loader.cpp b/eeschema/sch_plugins/cadstar/cadstar_sch_archive_loader.cpp index e31f09621e..82475a8ff7 100644 --- a/eeschema/sch_plugins/cadstar/cadstar_sch_archive_loader.cpp +++ b/eeschema/sch_plugins/cadstar/cadstar_sch_archive_loader.cpp @@ -2101,8 +2101,8 @@ void CADSTAR_SCH_ARCHIVE_LOADER::loadShapeVertices( const std::vector& a for( int jj = 0; jj < arcSegments.SegmentCount(); jj++ ) { - VECTOR2I segStart = (wxPoint) arcSegments.Segment( jj ).A; - VECTOR2I segEnd = (wxPoint) arcSegments.Segment( jj ).B; + VECTOR2I segStart = arcSegments.Segment( jj ).A; + VECTOR2I segEnd = arcSegments.Segment( jj ).B; loadGraphicStaightSegment( segStart, segEnd, aCadstarLineCodeID, aCadstarSheetID, aKiCadSchLayerID, aMoveVector, aRotation, aScalingFactor, @@ -2869,7 +2869,7 @@ LIB_SYMBOL* CADSTAR_SCH_ARCHIVE_LOADER::getScaledLibPart( const LIB_SYMBOL* aSym SHAPE_LINE_CHAIN& poly = shape.GetPolyShape().Outline( 0 ); for( size_t ii = 0; ii < poly.GetPointCount(); ++ii ) - poly.SetPoint( ii, scalePt( (wxPoint) poly.CPoint( ii ) ) ); + poly.SetPoint( ii, scalePt( poly.CPoint( ii ) ) ); } break; } diff --git a/eeschema/tools/sch_drawing_tools.cpp b/eeschema/tools/sch_drawing_tools.cpp index e7e8d7fb1f..5986f5ff52 100644 --- a/eeschema/tools/sch_drawing_tools.cpp +++ b/eeschema/tools/sch_drawing_tools.cpp @@ -674,7 +674,7 @@ int SCH_DRAWING_TOOLS::PlaceImage( const TOOL_EVENT& aEvent ) int SCH_DRAWING_TOOLS::SingleClickPlace( const TOOL_EVENT& aEvent ) { - wxPoint cursorPos; + VECTOR2I cursorPos; KICAD_T type = aEvent.Parameter(); EE_GRID_HELPER grid( m_toolMgr ); KIGFX::VIEW_CONTROLS* controls = getViewControls(); @@ -784,10 +784,8 @@ int SCH_DRAWING_TOOLS::SingleClickPlace( const TOOL_EVENT& aEvent ) grid.SetSnap( !evt->Modifier( MD_SHIFT ) ); grid.SetUseGrid( getView()->GetGAL()->GetGridSnapping() && !evt->DisableGridSnapping() ); - cursorPos = evt->IsPrime() ? (wxPoint) evt->Position() - : (wxPoint) controls->GetMousePosition(); - - cursorPos = wxPoint( grid.BestSnapAnchor( cursorPos, LAYER_CONNECTABLE, nullptr ) ); + cursorPos = evt->IsPrime() ? evt->Position() : controls->GetMousePosition(); + cursorPos = grid.BestSnapAnchor( cursorPos, LAYER_CONNECTABLE, nullptr ); controls->ForceCursorPosition( true, cursorPos ); if( evt->IsCancelInteractive() ) @@ -853,7 +851,7 @@ int SCH_DRAWING_TOOLS::SingleClickPlace( const TOOL_EVENT& aEvent ) } else if( evt->IsAction( &ACTIONS::refreshPreview ) || evt->IsMotion() ) { - previewItem->SetPosition( (wxPoint)cursorPos ); + previewItem->SetPosition( cursorPos ); m_view->ClearPreview(); m_view->AddToPreview( previewItem->Clone() ); m_frame->SetMsgPanel( previewItem ); @@ -1599,7 +1597,7 @@ int SCH_DRAWING_TOOLS::DrawShape( const TOOL_EVENT& aEvent ) } item->SetFlags( IS_NEW ); - item->BeginEdit( (wxPoint) cursorPos ); + item->BeginEdit( cursorPos ); m_view->ClearPreview(); m_view->AddToPreview( item->Clone() ); @@ -1611,7 +1609,7 @@ int SCH_DRAWING_TOOLS::DrawShape( const TOOL_EVENT& aEvent ) { if( evt->IsDblClick( BUT_LEFT ) || evt->IsAction( &EE_ACTIONS::finishDrawing ) - || !item->ContinueEdit( (wxPoint) cursorPos ) ) + || !item->ContinueEdit( cursorPos ) ) { item->EndEdit(); item->ClearEditFlags(); @@ -1655,7 +1653,7 @@ int SCH_DRAWING_TOOLS::DrawShape( const TOOL_EVENT& aEvent ) } else if( item && ( evt->IsAction( &ACTIONS::refreshPreview ) || evt->IsMotion() ) ) { - item->CalcEdit( (wxPoint) cursorPos ); + item->CalcEdit( cursorPos ); m_view->ClearPreview(); m_view->AddToPreview( item->Clone() ); m_frame->SetMsgPanel( item ); diff --git a/eeschema/tools/sch_edit_tool.cpp b/eeschema/tools/sch_edit_tool.cpp index 871f95a062..73b3405738 100644 --- a/eeschema/tools/sch_edit_tool.cpp +++ b/eeschema/tools/sch_edit_tool.cpp @@ -50,9 +50,7 @@ #include #include #include -#include #include -#include #include #include #include @@ -2053,7 +2051,7 @@ int SCH_EDIT_TOOL::ChangeTextType( const TOOL_EVENT& aEvent ) int SCH_EDIT_TOOL::BreakWire( const TOOL_EVENT& aEvent ) { - wxPoint cursorPos = (wxPoint) getViewControls()->GetCursorPosition( !aEvent.DisableGridSnapping() ); + VECTOR2I cursorPos = getViewControls()->GetCursorPosition( !aEvent.DisableGridSnapping() ); EE_SELECTION& selection = m_selectionTool->RequestSelection( { SCH_LINE_T } ); std::vector lines; diff --git a/eeschema/tools/sch_editor_control.cpp b/eeschema/tools/sch_editor_control.cpp index 78674b5ada..c6f9f5a929 100644 --- a/eeschema/tools/sch_editor_control.cpp +++ b/eeschema/tools/sch_editor_control.cpp @@ -560,7 +560,7 @@ int SCH_EDITOR_CONTROL::FindNext( const TOOL_EVENT& aEvent ) if( item ) { m_selectionTool->AddItemToSel( item ); - m_frame->FocusOnLocation( (wxPoint)item->GetBoundingBox().GetCenter() ); + m_frame->FocusOnLocation( item->GetBoundingBox().GetCenter() ); m_frame->GetCanvas()->Refresh(); } else diff --git a/eeschema/tools/sch_line_wire_bus_tool.cpp b/eeschema/tools/sch_line_wire_bus_tool.cpp index c2db7063d1..5fa2cb8256 100644 --- a/eeschema/tools/sch_line_wire_bus_tool.cpp +++ b/eeschema/tools/sch_line_wire_bus_tool.cpp @@ -975,7 +975,7 @@ int SCH_LINE_WIRE_BUS_TOOL::doDrawSegments( const std::string& aTool, int aType, if( !segment ) m_toolMgr->VetoContextMenuMouseWarp(); - contextMenuPos = (wxPoint)cursorPos; + contextMenuPos = (wxPoint) cursorPos; m_menu.ShowContextMenu( m_selectionTool->GetSelection() ); } else if( evt->Category() == TC_COMMAND && evt->Action() == TA_CHOICE_MENU_CHOICE ) @@ -1046,7 +1046,7 @@ SCH_LINE* SCH_LINE_WIRE_BUS_TOOL::startSegments( int aType, const VECTOR2D& aPos else { aSegment = static_cast( aSegment->Duplicate() ); - aSegment->SetStartPoint( (wxPoint) aPos ); + aSegment->SetStartPoint( aPos ); } diff --git a/eeschema/tools/symbol_editor_pin_tool.cpp b/eeschema/tools/symbol_editor_pin_tool.cpp index 4956b05dfd..5ce6170fe1 100644 --- a/eeschema/tools/symbol_editor_pin_tool.cpp +++ b/eeschema/tools/symbol_editor_pin_tool.cpp @@ -2,7 +2,7 @@ * This program source code file is part of KiCad, a free EDA CAD application. * * Copyright (C) 2019 CERN - * Copyright (C) 2019-2021 KiCad Developers, see AUTHORS.txt for contributors. + * Copyright (C) 2019-2022 KiCad Developers, see AUTHORS.txt for contributors. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -301,7 +301,7 @@ LIB_PIN* SYMBOL_EDITOR_PIN_TOOL::CreatePin( const VECTOR2I& aPosition, LIB_SYMBO if( m_frame->SynchronizePins() ) pin->SetFlags( IS_LINKED ); - pin->MoveTo((wxPoint) aPosition ); + pin->MoveTo( aPosition ); pin->SetLength( GetLastPinLength() ); pin->SetOrientation( g_LastPinOrient ); pin->SetType( g_LastPinType ); diff --git a/pagelayout_editor/tools/pl_drawing_tools.cpp b/pagelayout_editor/tools/pl_drawing_tools.cpp index 714f2693cf..0b8caa8b53 100644 --- a/pagelayout_editor/tools/pl_drawing_tools.cpp +++ b/pagelayout_editor/tools/pl_drawing_tools.cpp @@ -169,7 +169,7 @@ int PL_DRAWING_TOOLS::PlaceItem( const TOOL_EVENT& aEvent ) // ... and second click places: else { - item->GetPeer()->MoveStartPointToUi( (wxPoint) cursorPos ); + item->GetPeer()->MoveStartPointToUi( cursorPos ); item->SetPosition( item->GetPeer()->GetStartPosUi( 0 ) ); item->ClearEditFlags(); getView()->Update( item ); @@ -194,7 +194,7 @@ int PL_DRAWING_TOOLS::PlaceItem( const TOOL_EVENT& aEvent ) } else if( item && ( evt->IsAction( &ACTIONS::refreshPreview ) || evt->IsMotion() ) ) { - item->GetPeer()->MoveStartPointToUi( (wxPoint) cursorPos ); + item->GetPeer()->MoveStartPointToUi( cursorPos ); item->SetPosition( item->GetPeer()->GetStartPosUi( 0 ) ); getView()->Update( item ); } @@ -278,7 +278,7 @@ int PL_DRAWING_TOOLS::DrawShape( const TOOL_EVENT& aEvent ) m_toolMgr->RunAction( PL_ACTIONS::clearSelection, true ); DS_DATA_ITEM* dataItem = m_frame->AddDrawingSheetItem( type ); - dataItem->MoveToUi( (wxPoint) cursorPos ); + dataItem->MoveToUi( cursorPos ); item = dataItem->GetDrawItems()[0]; item->SetFlags( IS_NEW ); @@ -307,7 +307,7 @@ int PL_DRAWING_TOOLS::DrawShape( const TOOL_EVENT& aEvent ) { if( item ) { - item->GetPeer()->MoveEndPointToUi( (wxPoint) cursorPos ); + item->GetPeer()->MoveEndPointToUi( cursorPos ); item->SetEnd( item->GetPeer()->GetEndPosUi( 0 ) ); getView()->Update( item ); } diff --git a/pagelayout_editor/tools/pl_edit_tool.cpp b/pagelayout_editor/tools/pl_edit_tool.cpp index dfcd547b96..1988391843 100644 --- a/pagelayout_editor/tools/pl_edit_tool.cpp +++ b/pagelayout_editor/tools/pl_edit_tool.cpp @@ -423,7 +423,7 @@ int PL_EDIT_TOOL::DeleteItemCursor( const TOOL_EVENT& aEvent ) { for( DS_DRAW_ITEM_BASE* drawItem : dataItem->GetDrawItems() ) { - if( drawItem->HitTest( (wxPoint) aPos, threshold ) ) + if( drawItem->HitTest( aPos, threshold ) ) { item = drawItem; break; diff --git a/pagelayout_editor/tools/pl_selection_tool.cpp b/pagelayout_editor/tools/pl_selection_tool.cpp index 1534e110bb..84a07a5b52 100644 --- a/pagelayout_editor/tools/pl_selection_tool.cpp +++ b/pagelayout_editor/tools/pl_selection_tool.cpp @@ -245,7 +245,7 @@ void PL_SELECTION_TOOL::SelectPoint( const VECTOR2I& aWhere, bool* aSelectionCan { for( DS_DRAW_ITEM_BASE* drawItem : dataItem->GetDrawItems() ) { - if( drawItem->HitTest( (wxPoint) aWhere, threshold ) ) + if( drawItem->HitTest( aWhere, threshold ) ) collector.Append( drawItem ); } } @@ -317,7 +317,7 @@ void PL_SELECTION_TOOL::guessSelectionCandidates( COLLECTOR& collector, const VE EDA_ITEM* item = collector[ i ]; EDA_ITEM* other = collector[ ( i + 1 ) % 2 ]; - if( item->HitTest( (wxPoint) aPos, 0 ) && !other->HitTest( (wxPoint) aPos, 0 ) ) + if( item->HitTest( aPos, 0 ) && !other->HitTest( aPos, 0 ) ) collector.Transfer( other ); } } diff --git a/pcbnew/array_creator.cpp b/pcbnew/array_creator.cpp index 3eabc31f56..dfd2424708 100644 --- a/pcbnew/array_creator.cpp +++ b/pcbnew/array_creator.cpp @@ -2,7 +2,7 @@ * This program source code file is part of KiCad, a free EDA CAD application. * * Created on: 11 Mar 2016, author John Beard - * Copyright (C) 2016-2021 KiCad Developers, see AUTHORS.txt for contributors. + * Copyright (C) 2016-2022 KiCad Developers, see AUTHORS.txt for contributors. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -44,7 +44,7 @@ static void TransformItem( const ARRAY_OPTIONS& aArrOpts, int aIndex, BOARD_ITEM { const ARRAY_OPTIONS::TRANSFORM transform = aArrOpts.GetTransform( aIndex, aItem.GetPosition() ); - aItem.Move( (wxPoint) transform.m_offset ); + aItem.Move( transform.m_offset ); aItem.Rotate( aItem.GetPosition(), transform.m_rotation ); } @@ -57,8 +57,8 @@ void ARRAY_CREATOR::Invoke() FOOTPRINT* const fp = m_isFootprintEditor ? m_parent.GetBoard()->GetFirstFootprint() : nullptr; - const bool enableArrayNumbering = m_isFootprintEditor; - const wxPoint rotPoint = (wxPoint) m_selection.GetCenter(); + const bool enableArrayNumbering = m_isFootprintEditor; + const VECTOR2I rotPoint = m_selection.GetCenter(); std::unique_ptr array_opts; diff --git a/pcbnew/cross-probing.cpp b/pcbnew/cross-probing.cpp index c616920c07..8962110ca0 100644 --- a/pcbnew/cross-probing.cpp +++ b/pcbnew/cross-probing.cpp @@ -225,11 +225,9 @@ void PCB_EDIT_FRAME::ExecuteRemoteCommand( const char* cmdline ) if( crossProbingSettings.center_on_items && bbox.GetWidth() != 0 && bbox.GetHeight() != 0 ) { if( crossProbingSettings.zoom_to_fit ) - { GetToolManager()->GetTool()->ZoomFitCrossProbeBBox( bbox ); - } - FocusOnLocation( (wxPoint) bbox.Centre() ); + FocusOnLocation( bbox.Centre() ); } view->UpdateAllLayersColor(); diff --git a/pcbnew/dialogs/dialog_create_array.cpp b/pcbnew/dialogs/dialog_create_array.cpp index ba8611ffca..272cb57061 100644 --- a/pcbnew/dialogs/dialog_create_array.cpp +++ b/pcbnew/dialogs/dialog_create_array.cpp @@ -148,7 +148,7 @@ static const std::vector numberingTypeData { DIALOG_CREATE_ARRAY::DIALOG_CREATE_ARRAY( PCB_BASE_FRAME* aParent, std::unique_ptr& aSettings, - bool aIsFootprintEditor, const wxPoint& aOrigPos ) : + bool aIsFootprintEditor, const VECTOR2I& aOrigPos ) : DIALOG_CREATE_ARRAY_BASE( aParent ), m_settings( aSettings ), m_originalItemPosition( aOrigPos ), diff --git a/pcbnew/dialogs/dialog_create_array.h b/pcbnew/dialogs/dialog_create_array.h index 198be10f2f..a1bcc7a056 100644 --- a/pcbnew/dialogs/dialog_create_array.h +++ b/pcbnew/dialogs/dialog_create_array.h @@ -44,12 +44,12 @@ public: * Construct a new dialog. * * @param aParent the parent window - * @param aOptions the options that will be re-seated when dialog is validly closed + * @param aOptions the options that will be updated when dialog is closed with OK * @param aEnableNumbering enable pad numbering * @param aOrigPos original item position (used for computing the circular array radius) */ DIALOG_CREATE_ARRAY( PCB_BASE_FRAME* aParent, std::unique_ptr& aOptions, - bool enableNumbering, const wxPoint& aOrigPos ); + bool enableNumbering, const VECTOR2I& aOrigPos ); private: // Event callbacks @@ -69,7 +69,7 @@ private: /* * The position of the original item(s), used for finding radius, etc */ - const wxPoint m_originalItemPosition; + const VECTOR2I m_originalItemPosition; // Decide whether to display pad numbering options or not bool m_isFootprintEditor; diff --git a/pcbnew/pcb_base_frame.cpp b/pcbnew/pcb_base_frame.cpp index 17bca69f59..371a824dc4 100644 --- a/pcbnew/pcb_base_frame.cpp +++ b/pcbnew/pcb_base_frame.cpp @@ -480,7 +480,7 @@ void PCB_BASE_FRAME::FocusOnItems( std::vector aItems, PCB_LAYER_ID while( !itemPoly.IsEmpty() ) { - focusPt = (wxPoint) itemPoly.BBox().Centre(); + focusPt = itemPoly.BBox().Centre(); try { diff --git a/pcbnew/plugins/eagle/eagle_plugin.cpp b/pcbnew/plugins/eagle/eagle_plugin.cpp index cd531ed4ac..7ac3ab9c4f 100644 --- a/pcbnew/plugins/eagle/eagle_plugin.cpp +++ b/pcbnew/plugins/eagle/eagle_plugin.cpp @@ -1039,9 +1039,9 @@ void EAGLE_PLUGIN::loadPlain( wxXmlNode* aGraphics ) dimension->SetLayer( layer ); dimension->SetPrecision( DIMENSION_PRECISION ); - dimension->SetStart( (wxPoint) pt1 ); - dimension->SetEnd( (wxPoint) pt2 ); - dimension->Text().SetPosition( (wxPoint) pt3 ); + dimension->SetStart( pt1 ); + dimension->SetEnd( pt2 ); + dimension->Text().SetPosition( pt3 ); dimension->Text().SetTextSize( textSize ); dimension->Text().SetTextThickness( textThickness ); dimension->SetLineThickness( designSettings.GetLineThickness( layer ) ); @@ -1055,9 +1055,9 @@ void EAGLE_PLUGIN::loadPlain( wxXmlNode* aGraphics ) leader->SetLayer( layer ); leader->SetPrecision( DIMENSION_PRECISION ); - leader->SetStart( (wxPoint) pt1 ); - leader->SetEnd( (wxPoint) pt2 ); - leader->Text().SetPosition( (wxPoint) pt3 ); + leader->SetStart( pt1 ); + leader->SetEnd( pt2 ); + leader->Text().SetPosition( pt3 ); leader->Text().SetTextSize( textSize ); leader->Text().SetTextThickness( textThickness ); leader->SetText( wxEmptyString ); @@ -1122,7 +1122,7 @@ void EAGLE_PLUGIN::loadPlain( wxXmlNode* aGraphics ) } else { - int offset = GetLineLength( (wxPoint) pt3, (wxPoint) pt1 ); + int offset = GetLineLength( pt3, pt1 ); if( pt1.y > pt2.y ) dimension->SetHeight( offset ); diff --git a/pcbnew/tools/pcb_control.cpp b/pcbnew/tools/pcb_control.cpp index aaeb1f54a8..5a532a7a6f 100644 --- a/pcbnew/tools/pcb_control.cpp +++ b/pcbnew/tools/pcb_control.cpp @@ -89,7 +89,7 @@ void PCB_CONTROL::Reset( RESET_REASON aReason ) if( aReason == MODEL_RELOAD || aReason == GAL_SWITCH ) { - m_gridOrigin->SetPosition( (wxPoint) board()->GetDesignSettings().GetGridOrigin() ); + m_gridOrigin->SetPosition( board()->GetDesignSettings().GetGridOrigin() ); m_gridOrigin->SetColor( m_frame->GetGridColor() ); getView()->Remove( m_gridOrigin.get() ); getView()->Add( m_gridOrigin.get() ); @@ -478,7 +478,7 @@ void PCB_CONTROL::DoSetGridOrigin( KIGFX::VIEW* aView, PCB_BASE_FRAME* aFrame, { aFrame->GetDesignSettings().SetGridOrigin( wxPoint( aPoint ) ); aView->GetGAL()->SetGridOrigin( aPoint ); - originViewItem->SetPosition( (wxPoint) aPoint ); + originViewItem->SetPosition( aPoint ); aView->MarkDirty(); aFrame->OnModify(); } diff --git a/pcbnew/tools/pcb_selection_tool.cpp b/pcbnew/tools/pcb_selection_tool.cpp index 50159325a1..37f0702538 100644 --- a/pcbnew/tools/pcb_selection_tool.cpp +++ b/pcbnew/tools/pcb_selection_tool.cpp @@ -2511,13 +2511,13 @@ bool PCB_SELECTION_TOOL::selectionContains( const VECTOR2I& aPoint ) const collector.Collect( board(), m_isFootprintEditor ? GENERAL_COLLECTOR::FootprintItems : GENERAL_COLLECTOR::AllBoardItems, - (wxPoint) aPoint, guide ); + aPoint, guide ); for( int i = collector.GetCount() - 1; i >= 0; --i ) { BOARD_ITEM* item = collector[i]; - if( item->IsSelected() && item->HitTest( (wxPoint) aPoint, 5 * guide.OnePixelInIU() ) ) + if( item->IsSelected() && item->HitTest( aPoint, 5 * guide.OnePixelInIU() ) ) return true; } diff --git a/pcbnew/tools/pcb_tool_base.cpp b/pcbnew/tools/pcb_tool_base.cpp index e5ea54fba7..783b1ecf3a 100644 --- a/pcbnew/tools/pcb_tool_base.cpp +++ b/pcbnew/tools/pcb_tool_base.cpp @@ -73,7 +73,7 @@ void PCB_TOOL_BASE::doInteractiveItemPlacement( const std::string& aTool, if( newItem ) { - newItem->SetPosition( (wxPoint) aPosition ); + newItem->SetPosition( aPosition ); preview.Add( newItem.get() ); if( newItem->Type() == PCB_FOOTPRINT_T ) @@ -240,7 +240,7 @@ void PCB_TOOL_BASE::doInteractiveItemPlacement( const std::string& aTool, preview.Clear(); newItem.release(); - makeNewItem( (wxPoint) cursorPos ); + makeNewItem( cursorPos ); aPlacer->SnapItem( newItem.get() ); view()->Update( &preview ); } @@ -252,7 +252,7 @@ void PCB_TOOL_BASE::doInteractiveItemPlacement( const std::string& aTool, else if( newItem && evt->IsMotion() ) { // track the cursor - newItem->SetPosition( (wxPoint) cursorPos ); + newItem->SetPosition( cursorPos ); aPlacer->SnapItem( newItem.get() ); // Show a preview of the item diff --git a/pcbnew/tools/placement_tool.cpp b/pcbnew/tools/placement_tool.cpp index 9b798dbc01..7246859c9a 100644 --- a/pcbnew/tools/placement_tool.cpp +++ b/pcbnew/tools/placement_tool.cpp @@ -2,7 +2,7 @@ * This program source code file is part of KiCad, a free EDA CAD application. * * Copyright (C) 2014-2016 CERN - * Copyright (C) 2021 KiCad Developers, see AUTHORS.txt for contributors. + * Copyright (C) 2021-2022 KiCad Developers, see AUTHORS.txt for contributors. * @author Maciej Suminski * * This program is free software; you can redistribute it and/or @@ -35,7 +35,6 @@ #include #include -#include #include @@ -86,9 +85,9 @@ bool ALIGN_DISTRIBUTE_TOOL::Init() template -ALIGNMENT_RECTS GetBoundingBoxes( const T& aItems ) +std::vector> GetBoundingBoxes( const T& aItems ) { - ALIGNMENT_RECTS rects; + std::vector> rects; for( EDA_ITEM* item : aItems ) { @@ -97,12 +96,12 @@ ALIGNMENT_RECTS GetBoundingBoxes( const T& aItems ) if( item->Type() == PCB_FOOTPRINT_T ) { FOOTPRINT* footprint = static_cast( item ); - rects.emplace_back( std::make_pair( boardItem, + rects.emplace_back( std::make_pair( footprint, footprint->GetBoundingBox( false, false ) ) ); } else { - rects.emplace_back( std::make_pair( boardItem, item->GetBoundingBox() ) ); + rects.emplace_back( std::make_pair( boardItem, boardItem->GetBoundingBox() ) ); } } @@ -111,17 +110,18 @@ ALIGNMENT_RECTS GetBoundingBoxes( const T& aItems ) template< typename T > -int ALIGN_DISTRIBUTE_TOOL::selectTarget( ALIGNMENT_RECTS& aItems, ALIGNMENT_RECTS& aLocked, +int ALIGN_DISTRIBUTE_TOOL::selectTarget( std::vector>& aItems, + std::vector>& aLocked, T aGetValue ) { - wxPoint curPos = (wxPoint) getViewControls()->GetCursorPosition(); + VECTOR2I curPos = getViewControls()->GetCursorPosition(); // Prefer locked items to unlocked items. // Secondly, prefer items under the cursor to other items. if( aLocked.size() >= 1 ) { - for( const ALIGNMENT_RECT& item : aLocked ) + for( const std::pair& item : aLocked ) { if( item.second.Contains( curPos ) ) return aGetValue( item ); @@ -130,7 +130,7 @@ int ALIGN_DISTRIBUTE_TOOL::selectTarget( ALIGNMENT_RECTS& aItems, ALIGNMENT_RECT return aGetValue( aLocked.front() ); } - for( const ALIGNMENT_RECT& item : aItems ) + for( const std::pair& item : aItems ) { if( item.second.Contains( curPos ) ) return aGetValue( item ); @@ -141,8 +141,9 @@ int ALIGN_DISTRIBUTE_TOOL::selectTarget( ALIGNMENT_RECTS& aItems, ALIGNMENT_RECT template< typename T > -size_t ALIGN_DISTRIBUTE_TOOL::GetSelections( ALIGNMENT_RECTS& aItemsToAlign, - ALIGNMENT_RECTS& aLockedItems, T aCompare ) +size_t ALIGN_DISTRIBUTE_TOOL::GetSelections( std::vector>& aItemsToAlign, + std::vector>& aLockedItems, + T aCompare ) { PCB_SELECTION& selection = m_selectionTool->RequestSelection( []( const VECTOR2I& aPt, GENERAL_COLLECTOR& aCollector, PCB_SELECTION_TOOL* sTool ) @@ -193,11 +194,11 @@ size_t ALIGN_DISTRIBUTE_TOOL::GetSelections( ALIGNMENT_RECTS& aItemsToAlign, int ALIGN_DISTRIBUTE_TOOL::AlignTop( const TOOL_EVENT& aEvent ) { - ALIGNMENT_RECTS itemsToAlign; - ALIGNMENT_RECTS locked_items; + std::vector> itemsToAlign; + std::vector> locked_items; if( !GetSelections( itemsToAlign, locked_items, - []( const ALIGNMENT_RECT left, const ALIGNMENT_RECT right) + []( const std::pair left, const std::pair right) { return ( left.second.GetTop() < right.second.GetTop() ); } ) ) @@ -208,13 +209,13 @@ int ALIGN_DISTRIBUTE_TOOL::AlignTop( const TOOL_EVENT& aEvent ) BOARD_COMMIT commit( m_frame ); int targetTop = selectTarget( itemsToAlign, locked_items, - []( const ALIGNMENT_RECT& aVal ) + []( const std::pair& aVal ) { return aVal.second.GetTop(); } ); // Move the selected items - for( std::pair& i : itemsToAlign ) + for( const std::pair& i : itemsToAlign ) { BOARD_ITEM* item = i.first; int difference = targetTop - i.second.GetTop(); @@ -227,7 +228,7 @@ int ALIGN_DISTRIBUTE_TOOL::AlignTop( const TOOL_EVENT& aEvent ) item = item->GetParent(); commit.Stage( item, CHT_MODIFY ); - item->Move( wxPoint( 0, difference ) ); + item->Move( VECTOR2I( 0, difference ) ); } commit.Push( _( "Align to top" ) ); @@ -238,11 +239,11 @@ int ALIGN_DISTRIBUTE_TOOL::AlignTop( const TOOL_EVENT& aEvent ) int ALIGN_DISTRIBUTE_TOOL::AlignBottom( const TOOL_EVENT& aEvent ) { - ALIGNMENT_RECTS itemsToAlign; - ALIGNMENT_RECTS locked_items; + std::vector> itemsToAlign; + std::vector> locked_items; if( !GetSelections( itemsToAlign, locked_items, - []( const ALIGNMENT_RECT left, const ALIGNMENT_RECT right) + []( const std::pair left, const std::pair right) { return ( left.second.GetBottom() < right.second.GetBottom() ); } ) ) @@ -253,13 +254,13 @@ int ALIGN_DISTRIBUTE_TOOL::AlignBottom( const TOOL_EVENT& aEvent ) BOARD_COMMIT commit( m_frame ); int targetBottom = selectTarget( itemsToAlign, locked_items, - []( const ALIGNMENT_RECT& aVal ) + []( const std::pair& aVal ) { return aVal.second.GetBottom(); } ); // Move the selected items - for( std::pair& i : itemsToAlign ) + for( const std::pair& i : itemsToAlign ) { int difference = targetBottom - i.second.GetBottom(); BOARD_ITEM* item = i.first; @@ -272,7 +273,7 @@ int ALIGN_DISTRIBUTE_TOOL::AlignBottom( const TOOL_EVENT& aEvent ) item = item->GetParent(); commit.Stage( item, CHT_MODIFY ); - item->Move( wxPoint( 0, difference ) ); + item->Move( VECTOR2I( 0, difference ) ); } commit.Push( _( "Align to bottom" ) ); @@ -298,11 +299,11 @@ int ALIGN_DISTRIBUTE_TOOL::AlignLeft( const TOOL_EVENT& aEvent ) int ALIGN_DISTRIBUTE_TOOL::doAlignLeft() { - ALIGNMENT_RECTS itemsToAlign; - ALIGNMENT_RECTS locked_items; + std::vector> itemsToAlign; + std::vector> locked_items; if( !GetSelections( itemsToAlign, locked_items, - []( const ALIGNMENT_RECT left, const ALIGNMENT_RECT right) + []( const std::pair left, const std::pair right) { return ( left.second.GetLeft() < right.second.GetLeft() ); } ) ) @@ -313,13 +314,13 @@ int ALIGN_DISTRIBUTE_TOOL::doAlignLeft() BOARD_COMMIT commit( m_frame ); int targetLeft = selectTarget( itemsToAlign, locked_items, - []( const ALIGNMENT_RECT& aVal ) + []( const std::pair& aVal ) { return aVal.second.GetLeft(); } ); // Move the selected items - for( std::pair& i : itemsToAlign ) + for( const std::pair& i : itemsToAlign ) { int difference = targetLeft - i.second.GetLeft(); BOARD_ITEM* item = i.first; @@ -332,7 +333,7 @@ int ALIGN_DISTRIBUTE_TOOL::doAlignLeft() item = item->GetParent(); commit.Stage( item, CHT_MODIFY ); - item->Move( wxPoint( difference, 0 ) ); + item->Move( VECTOR2I( difference, 0 ) ); } commit.Push( _( "Align to left" ) ); @@ -358,11 +359,11 @@ int ALIGN_DISTRIBUTE_TOOL::AlignRight( const TOOL_EVENT& aEvent ) int ALIGN_DISTRIBUTE_TOOL::doAlignRight() { - ALIGNMENT_RECTS itemsToAlign; - ALIGNMENT_RECTS locked_items; + std::vector> itemsToAlign; + std::vector> locked_items; if( !GetSelections( itemsToAlign, locked_items, - []( const ALIGNMENT_RECT left, const ALIGNMENT_RECT right) + []( const std::pair left, const std::pair right) { return ( left.second.GetRight() < right.second.GetRight() ); } ) ) @@ -373,13 +374,13 @@ int ALIGN_DISTRIBUTE_TOOL::doAlignRight() BOARD_COMMIT commit( m_frame ); int targetRight = selectTarget( itemsToAlign, locked_items, - []( const ALIGNMENT_RECT& aVal ) + []( const std::pair& aVal ) { return aVal.second.GetRight(); } ); // Move the selected items - for( std::pair& i : itemsToAlign ) + for( const std::pair& i : itemsToAlign ) { int difference = targetRight - i.second.GetRight(); BOARD_ITEM* item = i.first; @@ -392,7 +393,7 @@ int ALIGN_DISTRIBUTE_TOOL::doAlignRight() item = item->GetParent(); commit.Stage( item, CHT_MODIFY ); - item->Move( wxPoint( difference, 0 ) ); + item->Move( VECTOR2I( difference, 0 ) ); } commit.Push( _( "Align to right" ) ); @@ -403,13 +404,13 @@ int ALIGN_DISTRIBUTE_TOOL::doAlignRight() int ALIGN_DISTRIBUTE_TOOL::AlignCenterX( const TOOL_EVENT& aEvent ) { - ALIGNMENT_RECTS itemsToAlign; - ALIGNMENT_RECTS locked_items; + std::vector> itemsToAlign; + std::vector> locked_items; if( !GetSelections( itemsToAlign, locked_items, - []( const ALIGNMENT_RECT left, const ALIGNMENT_RECT right) + []( const std::pair left, const std::pair right) { - return ( left.second.GetCenter().x < right.second.GetCenter().x ); + return ( left.second.Centre().x < right.second.Centre().x ); } ) ) { return 0; @@ -418,15 +419,15 @@ int ALIGN_DISTRIBUTE_TOOL::AlignCenterX( const TOOL_EVENT& aEvent ) BOARD_COMMIT commit( m_frame ); int targetX = selectTarget( itemsToAlign, locked_items, - []( const ALIGNMENT_RECT& aVal ) + []( const std::pair& aVal ) { - return aVal.second.GetCenter().x; + return aVal.second.Centre().x; } ); // Move the selected items - for( std::pair& i : itemsToAlign ) + for( const std::pair& i : itemsToAlign ) { - int difference = targetX - i.second.GetCenter().x; + int difference = targetX - i.second.Centre().x; BOARD_ITEM* item = i.first; if( item->GetParent() && item->GetParent()->IsSelected() ) @@ -437,7 +438,7 @@ int ALIGN_DISTRIBUTE_TOOL::AlignCenterX( const TOOL_EVENT& aEvent ) item = item->GetParent(); commit.Stage( item, CHT_MODIFY ); - item->Move( wxPoint( difference, 0 ) ); + item->Move( VECTOR2I( difference, 0 ) ); } commit.Push( _( "Align to middle" ) ); @@ -448,13 +449,13 @@ int ALIGN_DISTRIBUTE_TOOL::AlignCenterX( const TOOL_EVENT& aEvent ) int ALIGN_DISTRIBUTE_TOOL::AlignCenterY( const TOOL_EVENT& aEvent ) { - ALIGNMENT_RECTS itemsToAlign; - ALIGNMENT_RECTS locked_items; + std::vector> itemsToAlign; + std::vector> locked_items; if( !GetSelections( itemsToAlign, locked_items, - []( const ALIGNMENT_RECT left, const ALIGNMENT_RECT right) + []( const std::pair left, const std::pair right) { - return ( left.second.GetCenter().y < right.second.GetCenter().y ); + return ( left.second.Centre().y < right.second.Centre().y ); } ) ) { return 0; @@ -463,15 +464,15 @@ int ALIGN_DISTRIBUTE_TOOL::AlignCenterY( const TOOL_EVENT& aEvent ) BOARD_COMMIT commit( m_frame ); int targetY = selectTarget( itemsToAlign, locked_items, - []( const ALIGNMENT_RECT& aVal ) + []( const std::pair& aVal ) { - return aVal.second.GetCenter().y; + return aVal.second.Centre().y; } ); // Move the selected items - for( std::pair& i : itemsToAlign ) + for( const std::pair& i : itemsToAlign ) { - int difference = targetY - i.second.GetCenter().y; + int difference = targetY - i.second.Centre().y; BOARD_ITEM* item = i.first; if( item->GetParent() && item->GetParent()->IsSelected() ) @@ -482,7 +483,7 @@ int ALIGN_DISTRIBUTE_TOOL::AlignCenterY( const TOOL_EVENT& aEvent ) item = item->GetParent(); commit.Stage( item, CHT_MODIFY ); - item->Move( wxPoint( 0, difference ) ); + item->Move( VECTOR2I( 0, difference ) ); } commit.Push( _( "Align to center" ) ); @@ -510,12 +511,13 @@ int ALIGN_DISTRIBUTE_TOOL::DistributeHorizontally( const TOOL_EVENT& aEvent ) if( selection.Size() <= 1 ) return 0; - BOARD_COMMIT commit( m_frame ); - ALIGNMENT_RECTS itemsToDistribute = GetBoundingBoxes( selection ); + BOARD_COMMIT commit( m_frame ); + std::vector> itemsToDistribute = GetBoundingBoxes( selection ); // find the last item by reverse sorting std::sort( itemsToDistribute.begin(), itemsToDistribute.end(), - [] ( const ALIGNMENT_RECT left, const ALIGNMENT_RECT right) + [] ( const std::pair left, + const std::pair right) { return ( left.second.GetRight() > right.second.GetRight() ); } ); @@ -525,7 +527,8 @@ int ALIGN_DISTRIBUTE_TOOL::DistributeHorizontally( const TOOL_EVENT& aEvent ) // sort to get starting order std::sort( itemsToDistribute.begin(), itemsToDistribute.end(), - [] ( const ALIGNMENT_RECT left, const ALIGNMENT_RECT right) + [] ( const std::pair left, + const std::pair right) { return ( left.second.GetX() < right.second.GetX() ); } ); @@ -534,8 +537,8 @@ int ALIGN_DISTRIBUTE_TOOL::DistributeHorizontally( const TOOL_EVENT& aEvent ) int totalGap = maxRight - minX; int totalWidth = 0; - for( std::pair& i : itemsToDistribute ) - totalWidth += i.second.GetWidth(); + for( const auto& [ item, rect ] : itemsToDistribute ) + totalWidth += rect.GetWidth(); if( totalGap < totalWidth ) { @@ -554,15 +557,15 @@ int ALIGN_DISTRIBUTE_TOOL::DistributeHorizontally( const TOOL_EVENT& aEvent ) } -void ALIGN_DISTRIBUTE_TOOL::doDistributeGapsHorizontally( ALIGNMENT_RECTS& itemsToDistribute, +void ALIGN_DISTRIBUTE_TOOL::doDistributeGapsHorizontally( std::vector>& aItems, BOARD_COMMIT& aCommit, const BOARD_ITEM* lastItem, int totalGap ) const { - const int itemGap = totalGap / ( itemsToDistribute.size() - 1 ); - int targetX = itemsToDistribute.begin()->second.GetX(); + const int itemGap = totalGap / ( aItems.size() - 1 ); + int targetX = aItems.begin()->second.GetX(); - for( std::pair& i : itemsToDistribute ) + for( const std::pair& i : aItems ) { BOARD_ITEM* item = i.first; @@ -579,27 +582,27 @@ void ALIGN_DISTRIBUTE_TOOL::doDistributeGapsHorizontally( ALIGNMENT_RECTS& items int difference = targetX - i.second.GetX(); aCommit.Stage( item, CHT_MODIFY ); - item->Move( wxPoint( difference, 0 ) ); + item->Move( VECTOR2I( difference, 0 ) ); targetX += ( i.second.GetWidth() + itemGap ); } } -void ALIGN_DISTRIBUTE_TOOL::doDistributeCentersHorizontally( ALIGNMENT_RECTS &itemsToDistribute, +void ALIGN_DISTRIBUTE_TOOL::doDistributeCentersHorizontally( std::vector> &aItems, BOARD_COMMIT& aCommit ) const { - std::sort( itemsToDistribute.begin(), itemsToDistribute.end(), - [] ( const ALIGNMENT_RECT left, const ALIGNMENT_RECT right) + std::sort( aItems.begin(), aItems.end(), + [] ( const std::pair left, const std::pair right) { - return ( left.second.GetCenter().x < right.second.GetCenter().x ); + return ( left.second.Centre().x < right.second.Centre().x ); } ); - const int totalGap = ( itemsToDistribute.end()-1 )->second.GetCenter().x - - itemsToDistribute.begin()->second.GetCenter().x; - const int itemGap = totalGap / ( itemsToDistribute.size() - 1 ); - int targetX = itemsToDistribute.begin()->second.GetCenter().x; + const int totalGap = ( aItems.end() - 1 )->second.Centre().x + - aItems.begin()->second.Centre().x; + const int itemGap = totalGap / ( aItems.size() - 1 ); + int targetX = aItems.begin()->second.Centre().x; - for( std::pair& i : itemsToDistribute ) + for( const std::pair& i : aItems ) { BOARD_ITEM* item = i.first; @@ -610,9 +613,9 @@ void ALIGN_DISTRIBUTE_TOOL::doDistributeCentersHorizontally( ALIGNMENT_RECTS &it if( item->Type() == PCB_PAD_T && m_frame->IsType( FRAME_PCB_EDITOR ) ) item = item->GetParent(); - int difference = targetX - i.second.GetCenter().x; + int difference = targetX - i.second.Centre().x; aCommit.Stage( item, CHT_MODIFY ); - item->Move( wxPoint( difference, 0 ) ); + item->Move( VECTOR2I( difference, 0 ) ); targetX += ( itemGap ); } } @@ -637,12 +640,12 @@ int ALIGN_DISTRIBUTE_TOOL::DistributeVertically( const TOOL_EVENT& aEvent ) if( selection.Size() <= 1 ) return 0; - BOARD_COMMIT commit( m_frame ); - ALIGNMENT_RECTS itemsToDistribute = GetBoundingBoxes( selection ); + BOARD_COMMIT commit( m_frame ); + std::vector> itemsToDistribute = GetBoundingBoxes( selection ); // find the last item by reverse sorting std::sort( itemsToDistribute.begin(), itemsToDistribute.end(), - [] ( const ALIGNMENT_RECT left, const ALIGNMENT_RECT right) + [] ( const std::pair left, const std::pair right) { return ( left.second.GetBottom() > right.second.GetBottom() ); } ); @@ -652,16 +655,16 @@ int ALIGN_DISTRIBUTE_TOOL::DistributeVertically( const TOOL_EVENT& aEvent ) // sort to get starting order std::sort( itemsToDistribute.begin(), itemsToDistribute.end(), - [] ( const ALIGNMENT_RECT left, const ALIGNMENT_RECT right) + [] ( const std::pair left, const std::pair right) { - return ( left.second.GetCenter().y < right.second.GetCenter().y ); + return ( left.second.Centre().y < right.second.Centre().y ); } ); int minY = itemsToDistribute.begin()->second.GetY(); int totalGap = maxBottom - minY; int totalHeight = 0; - for( std::pair& i : itemsToDistribute ) + for( const std::pair& i : itemsToDistribute ) totalHeight += i.second.GetHeight(); if( totalGap < totalHeight ) @@ -681,15 +684,15 @@ int ALIGN_DISTRIBUTE_TOOL::DistributeVertically( const TOOL_EVENT& aEvent ) } -void ALIGN_DISTRIBUTE_TOOL::doDistributeGapsVertically( ALIGNMENT_RECTS& itemsToDistribute, +void ALIGN_DISTRIBUTE_TOOL::doDistributeGapsVertically( std::vector>& aItems, BOARD_COMMIT& aCommit, const BOARD_ITEM* lastItem, int totalGap ) const { - const int itemGap = totalGap / ( itemsToDistribute.size() - 1 ); - int targetY = itemsToDistribute.begin()->second.GetY(); + const int itemGap = totalGap / ( aItems.size() - 1 ); + int targetY = aItems.begin()->second.GetY(); - for( std::pair& i : itemsToDistribute ) + for( std::pair& i : aItems ) { BOARD_ITEM* item = i.first; @@ -706,27 +709,27 @@ void ALIGN_DISTRIBUTE_TOOL::doDistributeGapsVertically( ALIGNMENT_RECTS& itemsTo int difference = targetY - i.second.GetY(); aCommit.Stage( item, CHT_MODIFY ); - item->Move( wxPoint( 0, difference ) ); + item->Move( VECTOR2I( 0, difference ) ); targetY += ( i.second.GetHeight() + itemGap ); } } -void ALIGN_DISTRIBUTE_TOOL::doDistributeCentersVertically( ALIGNMENT_RECTS& itemsToDistribute, +void ALIGN_DISTRIBUTE_TOOL::doDistributeCentersVertically( std::vector>& aItems, BOARD_COMMIT& aCommit ) const { - std::sort( itemsToDistribute.begin(), itemsToDistribute.end(), - [] ( const ALIGNMENT_RECT left, const ALIGNMENT_RECT right) + std::sort( aItems.begin(), aItems.end(), + [] ( const std::pair left, const std::pair right) { - return ( left.second.GetCenter().y < right.second.GetCenter().y ); + return ( left.second.Centre().y < right.second.Centre().y ); } ); - const int totalGap = ( itemsToDistribute.end()-1 )->second.GetCenter().y - - itemsToDistribute.begin()->second.GetCenter().y; - const int itemGap = totalGap / ( itemsToDistribute.size() - 1 ); - int targetY = itemsToDistribute.begin()->second.GetCenter().y; + const int totalGap = ( aItems.end() - 1 )->second.Centre().y + - aItems.begin()->second.Centre().y; + const int itemGap = totalGap / ( aItems.size() - 1 ); + int targetY = aItems.begin()->second.Centre().y; - for( std::pair& i : itemsToDistribute ) + for( const std::pair& i : aItems ) { BOARD_ITEM* item = i.first; @@ -737,9 +740,9 @@ void ALIGN_DISTRIBUTE_TOOL::doDistributeCentersVertically( ALIGNMENT_RECTS& item if( item->Type() == PCB_PAD_T && m_frame->IsType( FRAME_PCB_EDITOR ) ) item = item->GetParent(); - int difference = targetY - i.second.GetCenter().y; + int difference = targetY - i.second.Centre().y; aCommit.Stage( item, CHT_MODIFY ); - item->Move( wxPoint( 0, difference ) ); + item->Move( VECTOR2I( 0, difference ) ); targetY += ( itemGap ); } } diff --git a/pcbnew/tools/placement_tool.h b/pcbnew/tools/placement_tool.h index 526722f33a..dd6728309d 100644 --- a/pcbnew/tools/placement_tool.h +++ b/pcbnew/tools/placement_tool.h @@ -32,8 +32,6 @@ #include #include -using ALIGNMENT_RECT = std::pair; -using ALIGNMENT_RECTS = std::vector; class PCB_SELECTION_TOOL; @@ -105,11 +103,13 @@ private: * Returns the size of aItemsToAlign() */ template< typename T > - size_t GetSelections( ALIGNMENT_RECTS& aItemsToAlign, ALIGNMENT_RECTS& aLockedItems, + size_t GetSelections( std::vector>& aItemsToAlign, + std::vector>& aLockedItems, T aCompare ); template< typename T > - int selectTarget( ALIGNMENT_RECTS& aItems, ALIGNMENT_RECTS& aLocked, T aGetValue ); + int selectTarget( std::vector>& aItems, + std::vector>& aLocked, T aGetValue ); /** * Sets X coordinate of the selected items to the value of the left-most selected item @@ -136,7 +136,7 @@ private: * since items of differing widths will be placed with different gaps. Is only used if * items overlap. */ - void doDistributeCentersHorizontally( ALIGNMENT_RECTS& itemsToDistribute, + void doDistributeCentersHorizontally( std::vector>& aItems, BOARD_COMMIT& aCommit ) const; /** @@ -147,7 +147,7 @@ private: * since items of differing widths will be placed with different gaps. Is only used * if items overlap */ - void doDistributeCentersVertically( ALIGNMENT_RECTS& itemsToDistribute, + void doDistributeCentersVertically( std::vector>& aItems, BOARD_COMMIT& aCommit ) const; /** @@ -156,8 +156,9 @@ private: * @note Using the edges of bounding box of items is only possible if there is enough space * between them. If this is not the case, use the center spacing method */ - void doDistributeGapsHorizontally( ALIGNMENT_RECTS& itemsToDistribute, BOARD_COMMIT& aCommit, - const BOARD_ITEM* lastItem, int totalGap ) const; + void doDistributeGapsHorizontally( std::vector>& aItems, + BOARD_COMMIT& aCommit, const BOARD_ITEM* lastItem, + int totalGap ) const; /** * Distributes selected items using an even spacing between their bounding boxes @@ -165,8 +166,9 @@ private: * @note Using the edges of bounding box of items is only possible if there is enough space * between them. If this is not the case, use the center spacing method */ - void doDistributeGapsVertically( ALIGNMENT_RECTS& itemsToDistribute, BOARD_COMMIT& aCommit, - const BOARD_ITEM* lastItem, int totalGap ) const; + void doDistributeGapsVertically( std::vector>& aItems, + BOARD_COMMIT& aCommit, const BOARD_ITEM* lastItem, + int totalGap ) const; private: PCB_SELECTION_TOOL* m_selectionTool;