39#include <wx/hyperlink.h>
50 m_fillInProgress( false )
72 std::vector<ZONE*> toFill;
75 toFill.push_back( zone );
78 std::unique_ptr<WX_PROGRESS_REPORTER> reporter;
84 m_filler->SetProgressReporter( aReporter );
88 reporter = std::make_unique<WX_PROGRESS_REPORTER>( aCaller,
_(
"Checking Zones" ), 4 );
89 m_filler->SetProgressReporter( reporter.get() );
92 if(
m_filler->Fill( toFill,
true, aCaller ) )
95 getEditFrame<PCB_EDIT_FRAME>()->m_ZoneFillsDirty =
false;
126 std::unique_ptr<WX_PROGRESS_REPORTER> reporter;
128 std::vector<ZONE*> toFill;
135 toFill.push_back( zone );
137 m_filler = std::make_unique<ZONE_FILLER>(
board(), &commit );
139 if( !
board()->GetDesignSettings().m_DRCEngine->RulesValid() )
142 wxHyperlinkCtrl* button =
new wxHyperlinkCtrl( infobar, wxID_ANY,
_(
"Show DRC rules" ),
145 button->Bind( wxEVT_COMMAND_HYPERLINK,
146 std::function<
void( wxHyperlinkEvent& aEvent )>(
147 [
frame]( wxHyperlinkEvent& aEvent )
149 frame->ShowBoardSetupDialog(
_(
"Rules" ) );
155 infobar->
ShowMessageFor(
_(
"Zone fills may be inaccurate. DRC rules contain errors." ),
156 10000, wxICON_WARNING );
161 m_filler->SetProgressReporter( aReporter );
165 reporter = std::make_unique<WX_PROGRESS_REPORTER>( aCaller,
_(
"Fill All Zones" ), 5 );
166 m_filler->SetProgressReporter( reporter.get() );
171 m_filler->GetProgressReporter()->AdvancePhase();
174 frame->m_ZoneFillsDirty =
false;
185 frame->UpdateUserInterface();
199 std::vector<ZONE*> toFill;
204 toFill.push_back( zone );
221 std::unique_ptr<WX_PROGRESS_REPORTER> reporter;
224 m_filler = std::make_unique<ZONE_FILLER>(
board(), &commit );
226 if( !
board()->GetDesignSettings().m_DRCEngine->RulesValid() )
229 wxHyperlinkCtrl* button =
new wxHyperlinkCtrl( infobar, wxID_ANY,
_(
"Show DRC rules" ),
232 button->Bind( wxEVT_COMMAND_HYPERLINK,
233 std::function<
void( wxHyperlinkEvent& aLocEvent )>(
234 [
frame]( wxHyperlinkEvent& aLocEvent )
236 frame->ShowBoardSetupDialog(
_(
"Rules" ) );
242 infobar->
ShowMessageFor(
_(
"Zone fills may be inaccurate. DRC rules contain errors." ),
243 10000, wxICON_WARNING );
246 for(
ZONE* zone : toFill )
249 pts += zone->GetFilledPolysList( layer )->FullPointCount();
253 wxString title = wxString::Format(
_(
"Refill %d Zones" ), (
int) toFill.size() );
255 reporter = std::make_unique<WX_PROGRESS_REPORTER>(
frame, title, 5 );
256 m_filler->SetProgressReporter( reporter.get() );
273 wxHyperlinkCtrl* button =
new wxHyperlinkCtrl( infobar, wxID_ANY,
_(
"Open Preferences" ),
276 button->Bind( wxEVT_COMMAND_HYPERLINK, std::function<
void( wxHyperlinkEvent& )>(
277 [
this]( wxHyperlinkEvent& )
279 getEditFrame<PCB_EDIT_FRAME>()->ShowPreferences(
_(
"Editing Options" ),
285 infobar->
ShowMessageFor(
_(
"Automatic refill of zones can be turned off in Preferences "
286 "if it becomes too slow." ),
291 frame->UpdateUserInterface();
314 std::vector<ZONE*> toFill;
318 toFill.push_back( passedZone );
324 if(
ZONE* zone =
dynamic_cast<ZONE*
>( item ) )
325 toFill.push_back( zone );
330 std::unique_ptr<WX_PROGRESS_REPORTER> reporter;
332 m_filler = std::make_unique<ZONE_FILLER>(
board(), &commit );
334 reporter = std::make_unique<WX_PROGRESS_REPORTER>(
frame(),
_(
"Fill Zone" ), 5 );
335 m_filler->SetProgressReporter( reporter.get() );
339 reporter->AdvancePhase();
371 ZONE* zone =
static_cast<ZONE*
>( item );
408 return m_filler->GetProgressReporter();
431 return via->GetRemoveUnconnected();
433 else if(
PAD*
pad =
dynamic_cast<PAD*
>( aItem ) )
435 return pad->GetRemoveUnconnected();
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, BASE_SCREEN *aScreen=nullptr)
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
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.
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.
bool UnFill()
Removes the zone filling.
PCB_LAYER_ID
A quick note on layer IDs:
@ ALL
All except INITIAL_ADD.
Class to handle a set of BOARD_ITEMs.
unsigned GetRunningMicroSecs()
An alternate way to calculate an elapsed time (in microsecondes) to class PROF_COUNTER.
#define SKIP_CONNECTIVITY
@ PCB_ZONE_T
class ZONE, a copper pour area