39#include <wx/hyperlink.h>
49 m_fillInProgress( false )
71 std::vector<ZONE*> toFill;
74 toFill.push_back( zone );
77 std::unique_ptr<WX_PROGRESS_REPORTER> reporter;
83 m_filler->SetProgressReporter( aReporter );
87 reporter = std::make_unique<WX_PROGRESS_REPORTER>( aCaller,
_(
"Checking Zones" ), 4 );
88 m_filler->SetProgressReporter( reporter.get() );
91 if(
m_filler->Fill( toFill,
true, aCaller ) )
94 getEditFrame<PCB_EDIT_FRAME>()->m_ZoneFillsDirty =
false;
119 std::vector<ZONE*> toFill;
127 toFill.push_back( zone );
132 std::unique_ptr<WX_PROGRESS_REPORTER> reporter;
134 m_filler = std::make_unique<ZONE_FILLER>(
board(), &commit );
136 if( !
board()->GetDesignSettings().m_DRCEngine->RulesValid() )
139 wxHyperlinkCtrl* button =
new wxHyperlinkCtrl( infobar, wxID_ANY,
_(
"Show DRC rules" ),
142 button->Bind( wxEVT_COMMAND_HYPERLINK,
143 std::function<
void( wxHyperlinkEvent& aEvent )>(
144 [
frame]( wxHyperlinkEvent& aEvent )
146 frame->ShowBoardSetupDialog(
_(
"Rules" ) );
152 infobar->
ShowMessageFor(
_(
"Zone fills may be inaccurate. DRC rules contain errors." ),
153 10000, wxICON_WARNING );
158 m_filler->SetProgressReporter( aReporter );
162 reporter = std::make_unique<WX_PROGRESS_REPORTER>( aCaller,
_(
"Fill All Zones" ), 5 );
163 m_filler->SetProgressReporter( reporter.get() );
168 m_filler->GetProgressReporter()->AdvancePhase();
171 frame->m_ZoneFillsDirty =
false;
182 frame->UpdateUserInterface();
196 std::vector<ZONE*> toFill;
201 toFill.push_back( zone );
218 std::unique_ptr<WX_PROGRESS_REPORTER> reporter;
221 m_filler = std::make_unique<ZONE_FILLER>(
board(), &commit );
223 if( !
board()->GetDesignSettings().m_DRCEngine->RulesValid() )
226 wxHyperlinkCtrl* button =
new wxHyperlinkCtrl( infobar, wxID_ANY,
_(
"Show DRC rules" ),
229 button->Bind( wxEVT_COMMAND_HYPERLINK,
230 std::function<
void( wxHyperlinkEvent& aLocEvent )>(
231 [
frame]( wxHyperlinkEvent& aLocEvent )
233 frame->ShowBoardSetupDialog(
_(
"Rules" ) );
239 infobar->
ShowMessageFor(
_(
"Zone fills may be inaccurate. DRC rules contain errors." ),
240 10000, wxICON_WARNING );
243 for(
ZONE* zone : toFill )
246 pts += zone->GetFilledPolysList( layer )->FullPointCount();
250 wxString title =
wxString::Format(
_(
"Refill %d Zones" ), (
int) toFill.size() );
252 reporter = std::make_unique<WX_PROGRESS_REPORTER>(
frame, title, 5 );
253 m_filler->SetProgressReporter( reporter.get() );
270 wxHyperlinkCtrl* button =
new wxHyperlinkCtrl( infobar, wxID_ANY,
_(
"Open Preferences" ),
273 button->Bind( wxEVT_COMMAND_HYPERLINK, std::function<
void( wxHyperlinkEvent& )>(
274 [
this]( wxHyperlinkEvent& )
276 getEditFrame<PCB_EDIT_FRAME>()->ShowPreferences(
_(
"Editing Options" ),
282 infobar->
ShowMessageFor(
_(
"Automatic refill of zones can be turned off in Preferences "
283 "if it becomes too slow." ),
288 frame->UpdateUserInterface();
311 std::vector<ZONE*> toFill;
315 toFill.push_back( passedZone );
321 if(
ZONE* zone =
dynamic_cast<ZONE*
>( item ) )
322 toFill.push_back( zone );
327 std::unique_ptr<WX_PROGRESS_REPORTER> reporter;
329 m_filler = std::make_unique<ZONE_FILLER>(
board(), &commit );
331 reporter = std::make_unique<WX_PROGRESS_REPORTER>(
frame(),
_(
"Fill Zone" ), 5 );
332 m_filler->SetProgressReporter( reporter.get() );
336 reporter->AdvancePhase();
368 ZONE* zone =
static_cast<ZONE*
>( item );
405 return m_filler->GetProgressReporter();
428 return via->GetRemoveUnconnected();
430 else if(
PAD*
pad =
dynamic_cast<PAD*
>( aItem ) )
432 return pad->GetRemoveUnconnected();
#define SKIP_CONNECTIVITY
virtual void Revert() override
virtual void Push(const wxString &aMessage=wxT("A commit"), int aCommitFlags=0) override
Revert the commit by restoring the modified items state.
bool BuildConnectivity(PROGRESS_REPORTER *aReporter=nullptr)
Build or rebuild the board connectivity database for the board, especially the list of connected item...
void IncrementTimeStamp()
COMMIT & Modify(EDA_ITEM *aItem)
Create an undo entry for an item that has been already modified.
WX_INFOBAR * GetInfoBar()
virtual void Refresh(bool aEraseBackground=true, const wxRect *aRect=nullptr) override
Update the board display after modifying it by a python script (note: it is automatically called by a...
A base class for most all the KiCad significant classes used in schematics and boards.
static const TOOL_EVENT ConnectivityChangedEvent
Selected item had a property changed (except movement)
An abstract base class for deriving all objects that can be added to a VIEW.
void UpdateAllItemsConditionally(int aUpdateFlags, std::function< bool(VIEW_ITEM *)> aCondition)
Update items in the view according to the given flags and condition.
static TOOL_ACTION zoneFillAll
static TOOL_ACTION zoneFill
static TOOL_ACTION zoneUnfill
static TOOL_ACTION zoneUnfillAll
static TOOL_ACTION zoneFillDirty
virtual KIGFX::PCB_VIEW * GetView() const override
Return a pointer to the #VIEW instance used in the panel.
void RedrawRatsnest()
Return the bounding box of the view that should be used if model is not valid.
The main frame for Pcbnew.
A progress reporter interface for use in multi-threaded environments.
A modified version of the wxInfoBar class that allows us to:
void RemoveAllButtons()
Remove all the buttons that have been added by the user.
void ShowMessageFor(const wxString &aMessage, int aTime, int aFlags=wxICON_INFORMATION, MESSAGE_TYPE aType=WX_INFOBAR::MESSAGE_TYPE::GENERIC)
Show the infobar with the provided message and icon for a specific period of time.
void AddButton(wxButton *aButton)
Add an already created button to the infobar.
@ GENERIC
GENERIC Are messages that do not have special handling.
Handle a list of polygons defining a copper zone.
bool UnFill()
Removes the zone filling.
PCB_LAYER_ID
A quick note on layer IDs:
@ ALL
All except INITIAL_ADD.
unsigned GetRunningMicroSecs()
An alternate way to calculate an elapsed time (in microsecondes) to class PROF_COUNTER.
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, const CPTREE &aTree)
Output a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
@ PCB_ZONE_T
class ZONE, a copper pour area
@ PCB_FP_ZONE_T
class ZONE, managed by a footprint