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 <ratsnest/ratsnest_data.h>
#include <tool/tool_manager.h>
#include <pcb_edit_frame.h>
#include <class_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 &sel)
 

Function Documentation

◆ GetBoundingBoxes()

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

Definition at line 91 of file placement_tool.cpp.

92 {
93  ALIGNMENT_RECTS rects;
94 
95  for( auto item : sel )
96  {
97  BOARD_ITEM* boardItem = static_cast<BOARD_ITEM*>( item );
98 
99  if( item->Type() == PCB_MODULE_T )
100  rects.emplace_back( std::make_pair( boardItem, static_cast<MODULE*>( item )->GetFootprintRect() ) );
101  else
102  rects.emplace_back( std::make_pair( boardItem, item->GetBoundingBox() ) );
103  }
104 
105  return rects;
106 }
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().