39#include <wx/hyperlink.h>
51 m_fillInProgress( false )
73 std::vector<ZONE*> toFill;
76 toFill.push_back( zone );
79 std::unique_ptr<WX_PROGRESS_REPORTER> reporter;
85 m_filler->SetProgressReporter( aReporter );
89 reporter = std::make_unique<WX_PROGRESS_REPORTER>( aCaller,
_(
"Checking Zones" ), 4 );
90 m_filler->SetProgressReporter( reporter.get() );
93 if(
m_filler->Fill( toFill,
true, aCaller ) )
96 getEditFrame<PCB_EDIT_FRAME>()->m_ZoneFillsDirty =
false;
127 std::unique_ptr<WX_PROGRESS_REPORTER> reporter;
129 std::vector<ZONE*> toFill;
136 toFill.push_back( zone );
138 m_filler = std::make_unique<ZONE_FILLER>(
board(), &commit );
140 if( !
board()->GetDesignSettings().m_DRCEngine->RulesValid() )
143 wxHyperlinkCtrl* button =
new wxHyperlinkCtrl( infobar, wxID_ANY,
_(
"Show DRC rules" ),
146 button->Bind( wxEVT_COMMAND_HYPERLINK,
147 std::function<
void( wxHyperlinkEvent& aEvent )>(
148 [
frame]( wxHyperlinkEvent& aEvent )
150 frame->ShowBoardSetupDialog(
_(
"Rules" ) );
156 infobar->
ShowMessageFor(
_(
"Zone fills may be inaccurate. DRC rules contain errors." ),
157 10000, wxICON_WARNING );
162 m_filler->SetProgressReporter( aReporter );
166 reporter = std::make_unique<WX_PROGRESS_REPORTER>( aCaller,
_(
"Fill All Zones" ), 5 );
167 m_filler->SetProgressReporter( reporter.get() );
172 m_filler->GetProgressReporter()->AdvancePhase();
175 frame->m_ZoneFillsDirty =
false;
186 frame->UpdateUserInterface();
200 std::vector<ZONE*> toFill;
205 toFill.push_back( zone );
222 std::unique_ptr<WX_PROGRESS_REPORTER> reporter;
225 m_filler = std::make_unique<ZONE_FILLER>(
board(), &commit );
227 if( !
board()->GetDesignSettings().m_DRCEngine->RulesValid() )
230 wxHyperlinkCtrl* button =
new wxHyperlinkCtrl( infobar, wxID_ANY,
_(
"Show DRC rules" ),
233 button->Bind( wxEVT_COMMAND_HYPERLINK,
234 std::function<
void( wxHyperlinkEvent& aLocEvent )>(
235 [
frame]( wxHyperlinkEvent& aLocEvent )
237 frame->ShowBoardSetupDialog(
_(
"Rules" ) );
243 infobar->
ShowMessageFor(
_(
"Zone fills may be inaccurate. DRC rules contain errors." ),
244 10000, wxICON_WARNING );
247 for(
ZONE* zone : toFill )
249 zone->GetLayerSet().RunOnLayers(
252 pts += zone->GetFilledPolysList( layer )->FullPointCount();
257 wxString title = wxString::Format(
_(
"Refill %d Zones" ), (
int) toFill.size() );
259 reporter = std::make_unique<WX_PROGRESS_REPORTER>(
frame, title, 5 );
260 m_filler->SetProgressReporter( reporter.get() );
277 wxHyperlinkCtrl* button =
new wxHyperlinkCtrl( infobar, wxID_ANY,
_(
"Open Preferences" ),
280 button->Bind( wxEVT_COMMAND_HYPERLINK, std::function<
void( wxHyperlinkEvent& )>(
281 [
this]( wxHyperlinkEvent& )
283 getEditFrame<PCB_EDIT_FRAME>()->ShowPreferences(
_(
"Editing Options" ),
289 infobar->
ShowMessageFor(
_(
"Automatic refill of zones can be turned off in Preferences "
290 "if it becomes too slow." ),
295 frame->UpdateUserInterface();
316 std::vector<ZONE*> toFill;
320 toFill.push_back( passedZone );
331 if(
ZONE* zone =
dynamic_cast<ZONE*
>( item ) )
332 toFill.push_back( zone );
346 std::unique_ptr<WX_PROGRESS_REPORTER> reporter;
348 m_filler = std::make_unique<ZONE_FILLER>(
board(), &commit );
350 reporter = std::make_unique<WX_PROGRESS_REPORTER>(
frame(),
_(
"Fill Zone" ), 5 );
351 m_filler->SetProgressReporter( reporter.get() );
355 reporter->AdvancePhase();
386 std::vector<ZONE*> toUnfill;
390 if(
ZONE* zone =
dynamic_cast<ZONE*
>( item ) )
391 toUnfill.push_back( zone );
395 if( toUnfill.empty() )
403 for(
ZONE* zone : toUnfill )
440 return m_filler->GetProgressReporter();
463 return via->GetRemoveUnconnected();
465 else if(
PAD*
pad =
dynamic_cast<PAD*
>( aItem ) )
467 return pad->GetRemoveUnconnected();
#define SKIP_CONNECTIVITY
virtual void Push(const wxString &aMessage=wxEmptyString, int aCommitFlags=0) override
Revert the commit by restoring the modified items state.
virtual void Revert() override
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, BASE_SCREEN *aScreen=nullptr)
Create an undo entry for an item that has been already modified.
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.
static const TOOL_EVENT ConnectivityChangedEvent
Selected item had a property changed (except movement)
Used when the right click button is pressed, or when the select tool is in effect.
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.
TEARDROP_MANAGER manage and build teardrop areas A teardrop area is a polygonal area (a copper ZONE) ...
void UpdateTeardrops(BOARD_COMMIT &aCommit, const std::vector< BOARD_ITEM * > *dirtyPadsAndVias, const std::set< PCB_TRACK * > *dirtyTracks, bool aForceFullUpdate=false)
Update teardrops on a list of items.
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.
PCB_LAYER_ID
A quick note on layer IDs:
@ ALL
All except INITIAL_ADD.
Class to handle a set of BOARD_ITEMs.
int64_t GetRunningMicroSecs()
An alternate way to calculate an elapsed time (in microsecondes) to class PROF_COUNTER.