KiCad PCB EDA Suite
placement_tool.cpp File Reference
#include "tool/selection.h"
#include "placement_tool.h"
#include "pcb_actions.h"
#include "selection_tool.h"
#include "edit_tool.h"
#include <tool/tool_manager.h>
#include <pcb_edit_frame.h>
#include <class_board.h>
#include <ratsnest_data.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 &sel)
 

Function Documentation

◆ GetBoundingBoxes()

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

Definition at line 88 of file placement_tool.cpp.

89 {
90  ALIGNMENT_RECTS rects;
91 
92  for( auto item : sel )
93  {
94  BOARD_ITEM* boardItem = static_cast<BOARD_ITEM*>( item );
95 
96  if( item->Type() == PCB_MODULE_T )
97  rects.emplace_back( std::make_pair( boardItem, static_cast<MODULE*>( item )->GetFootprintRect() ) );
98  else
99  rects.emplace_back( std::make_pair( boardItem, item->GetBoundingBox() ) );
100  }
101 
102  return rects;
103 }
Class BOARD_ITEM is a base class for any item which can be embedded within the BOARD container class,...
class MODULE, a footprint
Definition: typeinfo.h:89
std::vector< ALIGNMENT_RECT > ALIGNMENT_RECTS

References EDA_ITEM::GetBoundingBox(), and PCB_MODULE_T.

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