![]() |
KiCad PCB EDA Suite
|
functions to spread footprints on free areas outside a board. More...
#include <algorithm>
#include <convert_to_biu.h>
#include <confirm.h>
#include <pcb_edit_frame.h>
#include <board.h>
#include <footprint.h>
#include <rect_placement/rect_placement.h>
Go to the source code of this file.
Classes | |
struct | TSubRect |
Typedefs | |
typedef std::vector< TSubRect > | CSubRectArray |
Functions | |
void | fillRectList (CSubRectArray &vecSubRects, std::vector< FOOTPRINT * > &aFootprintList) |
void | fillRectList (CSubRectArray &vecSubRects, std::vector< EDA_RECT > &aRectList) |
void | spreadRectangles (CRectPlacement &aPlacementArea, CSubRectArray &vecSubRects, int areaSizeX, int areaSizeY) |
void | moveFootprintsInArea (CRectPlacement &aPlacementArea, std::vector< FOOTPRINT * > &aFootprintList, EDA_RECT &aFreeArea, bool aFindAreaOnly) |
static bool | sortFootprintsbySheetPath (FOOTPRINT *ref, FOOTPRINT *compare) |
void | SpreadFootprints (std::vector< FOOTPRINT * > *aFootprints, wxPoint aSpreadAreaPosition) |
Footprints (after loaded by reading a netlist for instance) are moved to be in a small free area (outside the current board) without overlapping. More... | |
Variables | |
const int | scale = (int)(0.01 * IU_PER_MM) |
const int | PADDING = (int)(1 * IU_PER_MM) |
functions to spread footprints on free areas outside a board.
this is usefull after reading a netlist, when new footprints are loaded and stacked at 0,0 coordinate. Often, spread them on a free area near the board being edited make more easy their selection.
Definition in file spread_footprints.cpp.
typedef std::vector<TSubRect> CSubRectArray |
Definition at line 58 of file spread_footprints.cpp.
void fillRectList | ( | CSubRectArray & | vecSubRects, |
std::vector< FOOTPRINT * > & | aFootprintList | ||
) |
Definition at line 66 of file spread_footprints.cpp.
References EDA_RECT::GetHeight(), EDA_RECT::GetWidth(), PADDING, and scale.
Referenced by moveFootprintsInArea(), and SpreadFootprints().
void fillRectList | ( | CSubRectArray & | vecSubRects, |
std::vector< EDA_RECT > & | aRectList | ||
) |
Definition at line 80 of file spread_footprints.cpp.
References EDA_RECT::GetHeight(), EDA_RECT::GetWidth(), and scale.
void moveFootprintsInArea | ( | CRectPlacement & | aPlacementArea, |
std::vector< FOOTPRINT * > & | aFootprintList, | ||
EDA_RECT & | aFreeArea, | ||
bool | aFindAreaOnly | ||
) |
Definition at line 151 of file spread_footprints.cpp.
References fillRectList(), FOOTPRINT::GetBoundingBox(), EDA_RECT::GetHeight(), EDA_RECT::GetOrigin(), FOOTPRINT::GetPosition(), EDA_RECT::GetWidth(), FOOTPRINT::Move(), scale, and spreadRectangles().
Referenced by SpreadFootprints().
Definition at line 339 of file spread_footprints.cpp.
References FOOTPRINT::GetPath().
Referenced by SpreadFootprints().
void SpreadFootprints | ( | std::vector< FOOTPRINT * > * | aFootprints, |
wxPoint | aSpreadAreaPosition | ||
) |
Footprints (after loaded by reading a netlist for instance) are moved to be in a small free area (outside the current board) without overlapping.
aBoard | is the board to edit. |
aFootprints | a list of footprints to be spread out. |
aSpreadAreaPosition | the position of the upper left corner of the area allowed to spread footprints |
Definition at line 189 of file spread_footprints.cpp.
References fillRectList(), FOOTPRINT::GetArea(), FOOTPRINT::GetBoundingBox(), CRectPlacement::GetH(), EDA_RECT::GetHeight(), CRectPlacement::GetW(), EDA_RECT::GetWidth(), CRectPlacement::TRect::h, EDA_RECT::Inflate(), Millimeter2iu(), moveFootprintsInArea(), TSubRect::n, PADDING, scale, EDA_RECT::SetHeight(), EDA_RECT::SetOrigin(), EDA_RECT::SetWidth(), sortFootprintsbySheetPath(), spreadRectangles(), CRectPlacement::TRect::w, CRectPlacement::TPos::x, and CRectPlacement::TPos::y.
Referenced by PCB_EDIT_FRAME::OnNetlistChanged().
void spreadRectangles | ( | CRectPlacement & | aPlacementArea, |
CSubRectArray & | vecSubRects, | ||
int | areaSizeX, | ||
int | areaSizeY | ||
) |
Definition at line 95 of file spread_footprints.cpp.
References CRectPlacement::AddAtEmptySpotAutoGrow(), CRectPlacement::TRect::Greater(), CRectPlacement::Init(), scale, CRectPlacement::TPos::x, and CRectPlacement::TPos::y.
Referenced by moveFootprintsInArea(), and SpreadFootprints().
const int PADDING = (int)(1 * IU_PER_MM) |
Definition at line 63 of file spread_footprints.cpp.
Referenced by fillRectList(), and SpreadFootprints().
const int scale = (int)(0.01 * IU_PER_MM) |
Definition at line 61 of file spread_footprints.cpp.
Referenced by ACTION_TOOLBAR::AddScaledSeparator(), Clamp_Text_PenSize(), KIGFX::CAIRO_PRINT_GAL::ComputeWorldScreenMatrix(), KIGFX::GAL::ComputeWorldScreenMatrix(), DIALOG_PLOT_SCHEMATIC::createPSFile(), EDA_3D_CANVAS::DoRePaint(), COMMON_TOOLS::doZoomFit(), COMMON_TOOLS::doZoomToPreset(), KIGFX::CAIRO_GAL_BASE::DrawBitmap(), BITMAP_BASE::DrawBitmap(), KIGFX::OPENGL_GAL::DrawBitmap(), SCH_EDIT_FRAME::DrawCurrentSheetToClipboard(), PCB_EDIT_FRAME::Export_IDF3(), fillRectList(), SYMBOL_PREVIEW_WIDGET::fitOnDrawArea(), GENDRILL_WRITER_BASE::genDrillMapFile(), RENDER_3D_LEGACY::generate3dGrid(), DXF_IMPORT_PLUGIN::getCurrentUnitScale(), getEnviromentScale(), getKiCadConfiguredScale(), DIALOG_PRINT_GENERIC::getScaleValue(), idf_export_footprint(), idf_export_outline(), WRL1STATUS::Init(), KiScaledBitmap(), RENDER_3D_RAYTRACE::loadModels(), KIGFX::WX_VIEW_CONTROLS::LoadSettings(), moveFootprintsInArea(), PCB_EDIT_FRAME::OnExportVRML(), KIGFX::WX_VIEW_CONTROLS::onMotion(), DIALOG_PAD_PRIMITIVE_POLY_PROPS::onPaintPolyPanel(), DIALOG_PIN_PROPERTIES::OnPaintShowPanel(), DIALOG_IMAGE_EDITOR::OnRedrawPanel(), std::hash< SCALED_BITMAP_ID >::operator()(), DIALOG_PLOT_SCHEMATIC::plotOneSheetSVG(), SCENEGRAPH::Prepare(), PCB_EDIT_FRAME::PrepareLayerIndicator(), RENDER_3D_LEGACY::renderFootprint(), KIGFX::VERTEX_MANAGER::Scale(), ZOOM_TOOL::selectRegion(), UNIT_BINDER::setPrecision(), DIALOG_PLOT_SCHEMATIC::setupPlotPagePDF(), GERBVIEW_INSPECTION_TOOL::ShowDCodes(), SpreadFootprints(), spreadRectangles(), SYMBOL_EDIT_FRAME::SVGPlotSymbol(), DIALOG_IMAGE_EDITOR::TransferToImage(), DIALOG_PAD_PRIMITIVES_TRANSFORM::Transform(), WRL1TRANSFORM::TranslateToSG(), PCB_CALCULATOR_FRAME::TWCalculateCurrent(), PCB_CALCULATOR_FRAME::TWCalculateWidth(), GERBVIEW_FRAME::updateDCodeSelectBox(), DIALOG_PAGES_SETTINGS::UpdatePageLayoutExample(), PANEL_PCBNEW_COLOR_SETTINGS::zoomFitPreview(), PANEL_EESCHEMA_COLOR_SETTINGS::zoomFitPreview(), and PCB_SELECTION_TOOL::zoomFitSelection().