71 wxString msg = wxString::Format(
_(
"Board edges must be defined on the %s layer." ),
74 frame()->GetInfoBar()->RemoveAllButtons();
75 frame()->GetInfoBar()->ShowMessageFor( msg, 5000, wxICON_ERROR );
79 int locked_count = std::count_if( aFootprints.begin(), aFootprints.end(),
80 [](
FOOTPRINT* fp) { return fp->IsLocked(); } );
93 aFootprints.erase( std::remove_if( aFootprints.begin(), aFootprints.end(),
96 return fp->IsLocked();
123 std::unique_ptr<WX_PROGRESS_REPORTER> progressReporter =
124 std::make_unique<WX_PROGRESS_REPORTER>(
frame(),
_(
"Autoplace Components" ), 1 );
130 commit.
Push(
_(
"Autoplace Components" ) );
140 std::vector<FOOTPRINT*> footprints;
160 std::vector<FOOTPRINT*> footprints;
AR_RESULT AutoplaceFootprints(std::vector< FOOTPRINT * > &aFootprints, BOARD_COMMIT *aCommit, bool aPlaceOffboardModules=false)
void SetOverlay(std::shared_ptr< KIGFX::VIEW_OVERLAY > aOverlay)
Set a VIEW overlay to draw items during a autoplace session.
void SetRefreshCallback(std::function< int(FOOTPRINT *aFootprint)> aCallback)
Callback to redraw on screen the view after changes, for instance after moving a footprint.
void SetProgressReporter(PROGRESS_REPORTER *aReporter)
virtual void Push(const wxString &aMessage=wxEmptyString, int aCommitFlags=0) override
Execute the changes.
virtual void Revert() override
Revert the commit by restoring the modified items state.
bool GetBoardPolygonOutlines(SHAPE_POLY_SET &aOutlines, OUTLINE_ERROR_HANDLER *aErrorHandler=nullptr, bool aAllowUseArcsInPolygons=false, bool aIncludeNPTHAsOutlines=false)
Extract the board outlines and build a closed polygon from lines, arcs and circle items on edge cut l...
const BOX2I GetBoardEdgesBoundingBox() const
Return the board bounding box calculated using exclusively the board edges (graphics on Edge....
constexpr size_type GetWidth() const
constexpr size_type GetHeight() const
virtual void Refresh(bool aEraseBackground=true, const wxRect *aRect=nullptr) override
A base class for most all the KiCad significant classes used in schematics and boards.
virtual void Update(const VIEW_ITEM *aItem, int aUpdateFlags) const override
For dynamic VIEWs, inform the associated VIEW that the graphical representation of this item has chan...
std::shared_ptr< VIEW_OVERLAY > MakeOverlay()
void MarkDirty()
Force redraw of view on the next rendering.
LOCKING_OPTIONS m_LockingOptions
static TOOL_ACTION autoplaceOffboardComponents
static TOOL_ACTION autoplaceSelectedComponents
Common, abstract interface for edit frames.
PCB_DRAW_PANEL_GAL * GetCanvas() const override
Return a pointer to GAL-based canvas of given EDA draw frame.
virtual KIGFX::PCB_VIEW * GetView() const override
Return a pointer to the #VIEW instance used in the panel.
Represent a set of closed polygons.
bool Contains(const VECTOR2I &aP, int aSubpolyIndex=-1, int aAccuracy=0, bool aUseBBoxCaches=false) const
Return true if a given subpolygon contains the point aP.
wxString LayerName(int aLayer)
Returns the default display name for a given layer.
std::shared_ptr< PNS_LOG_VIEWER_OVERLAY > overlay
bool m_sessionSkipPrompts
@ PCB_FOOTPRINT_T
class FOOTPRINT, a footprint