KiCad PCB EDA Suite
placement_tool.cpp File Reference
#include "tool/selection.h"
#include "placement_tool.h"
#include "pcb_actions.h"
#include "pcb_selection_tool.h"
#include <ratsnest/ratsnest_data.h>
#include <tool/tool_manager.h>
#include <pcb_edit_frame.h>
#include <board.h>
#include <board_commit.h>
#include <bitmaps.h>
#include <confirm.h>
#include <menus_helpers.h>

Go to the source code of this file.

Functions

template<class T >
ALIGNMENT_RECTS GetBoundingBoxes (const T &aItems)
 

Function Documentation

◆ GetBoundingBoxes()

template<class T >
ALIGNMENT_RECTS GetBoundingBoxes ( const T &  aItems)

Definition at line 89 of file placement_tool.cpp.

90{
91 ALIGNMENT_RECTS rects;
92
93 for( EDA_ITEM* item : aItems )
94 {
95 BOARD_ITEM* boardItem = static_cast<BOARD_ITEM*>( item );
96
97 if( item->Type() == PCB_FOOTPRINT_T )
98 {
99 FOOTPRINT* footprint = static_cast<FOOTPRINT*>( item );
100 rects.emplace_back( std::make_pair( boardItem,
101 footprint->GetBoundingBox( false, false ) ) );
102 }
103 else
104 {
105 rects.emplace_back( std::make_pair( boardItem, item->GetBoundingBox() ) );
106 }
107 }
108
109 return rects;
110}
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
Definition: board_item.h:53
A base class for most all the KiCad significant classes used in schematics and boards.
Definition: eda_item.h:100
const EDA_RECT GetBoundingBox() const override
Return the orthogonal bounding box of this object for display purposes.
Definition: footprint.cpp:753
std::vector< ALIGNMENT_RECT > ALIGNMENT_RECTS
@ PCB_FOOTPRINT_T
class FOOTPRINT, a footprint
Definition: typeinfo.h:88

References EDA_ITEM::GetBoundingBox(), FOOTPRINT::GetBoundingBox(), and PCB_FOOTPRINT_T.

Referenced by ALIGN_DISTRIBUTE_TOOL::DistributeHorizontally(), ALIGN_DISTRIBUTE_TOOL::DistributeVertically(), and ALIGN_DISTRIBUTE_TOOL::GetSelections().