40#include <wx/hyperlink.h>
74 std::vector<ZONE*> toFill;
77 toFill.push_back( zone );
80 std::unique_ptr<WX_PROGRESS_REPORTER> reporter;
86 m_filler->SetProgressReporter( aReporter );
90 reporter = std::make_unique<WX_PROGRESS_REPORTER>( aCaller,
_(
"Check Zones" ), 4,
PR_CAN_ABORT );
91 m_filler->SetProgressReporter( reporter.get() );
94 if(
m_filler->Fill( toFill,
true, aCaller ) )
131 std::unique_ptr<WX_PROGRESS_REPORTER> reporter;
133 std::vector<ZONE*> toFill;
140 toFill.push_back( zone );
142 m_filler = std::make_unique<ZONE_FILLER>(
board(), &commit );
144 if( !aHeadless && !
board()->GetDesignSettings().m_DRCEngine->RulesValid() )
147 wxHyperlinkCtrl* button =
new wxHyperlinkCtrl( infobar, wxID_ANY,
_(
"Show DRC rules" ), wxEmptyString );
149 button->Bind( wxEVT_COMMAND_HYPERLINK,
150 std::function<
void( wxHyperlinkEvent& aEvent )>(
151 [
frame]( wxHyperlinkEvent& aEvent )
153 frame->ShowBoardSetupDialog(
_(
"Rules" ) );
159 infobar->
ShowMessageFor(
_(
"Zone fills may be inaccurate. DRC rules contain errors." ), 10000,
165 m_filler->SetProgressReporter( aReporter );
167 else if( !aHeadless )
169 reporter = std::make_unique<WX_PROGRESS_REPORTER>( aCaller,
_(
"Fill All Zones" ), 5,
PR_CAN_ABORT );
170 m_filler->SetProgressReporter( reporter.get() );
175 if(
m_filler->GetProgressReporter() )
176 m_filler->GetProgressReporter()->AdvancePhase();
180 frame->m_ZoneFillsDirty =
false;
194 frame->UpdateUserInterface();
210 std::vector<ZONE*> toFill;
215 toFill.push_back( zone );
232 std::unique_ptr<WX_PROGRESS_REPORTER> reporter;
235 m_filler = std::make_unique<ZONE_FILLER>(
board(), &commit );
237 if( !
board()->GetDesignSettings().m_DRCEngine->RulesValid() )
240 wxHyperlinkCtrl* button =
new wxHyperlinkCtrl( infobar, wxID_ANY,
_(
"Show DRC rules" ), wxEmptyString );
242 button->Bind( wxEVT_COMMAND_HYPERLINK,
243 std::function<
void( wxHyperlinkEvent& aLocEvent )>(
244 [
frame]( wxHyperlinkEvent& aLocEvent )
246 frame->ShowBoardSetupDialog(
_(
"Rules" ) );
252 infobar->
ShowMessageFor(
_(
"Zone fills may be inaccurate. DRC rules contain errors." ), 10000,
256 for(
ZONE* zone : toFill )
258 zone->GetLayerSet().RunOnLayers(
261 pts += zone->GetFilledPolysList( layer )->FullPointCount();
266 wxString title = wxString::Format(
_(
"Refill %d Zones" ), (
int) toFill.size() );
268 reporter = std::make_unique<WX_PROGRESS_REPORTER>(
frame, title, 5,
PR_CAN_ABORT );
269 m_filler->SetProgressReporter( reporter.get() );
286 wxHyperlinkCtrl* button =
new wxHyperlinkCtrl( infobar, wxID_ANY,
_(
"Open Preferences" ),
289 button->Bind( wxEVT_COMMAND_HYPERLINK, std::function<
void( wxHyperlinkEvent& )>(
290 [
this]( wxHyperlinkEvent& )
297 infobar->
ShowMessageFor(
_(
"Automatic refill of zones can be turned off in Preferences if it becomes "
299 10000, wxICON_INFORMATION, WX_INFOBAR::MESSAGE_TYPE::GENERIC );
303 frame->UpdateUserInterface();
324 std::vector<ZONE*> toFill;
328 toFill.push_back( passedZone );
339 if(
ZONE* zone =
dynamic_cast<ZONE*
>( item ) )
340 toFill.push_back( zone );
354 std::unique_ptr<WX_PROGRESS_REPORTER> reporter;
356 m_filler = std::make_unique<ZONE_FILLER>(
board(), &commit );
358 reporter = std::make_unique<WX_PROGRESS_REPORTER>(
frame(),
_(
"Fill Zone" ), 5,
PR_CAN_ABORT );
359 m_filler->SetProgressReporter( reporter.get() );
363 reporter->AdvancePhase();
394 std::vector<ZONE*> toUnfill;
398 if(
ZONE* zone =
dynamic_cast<ZONE*
>( item ) )
399 toUnfill.push_back( zone );
403 if( toUnfill.empty() )
411 for(
ZONE* zone : toUnfill )
448 return m_filler->GetProgressReporter();
472 return via->GetRemoveUnconnected();
474 else if(
PAD*
pad =
dynamic_cast<PAD*
>( aItem ) )
476 return pad->GetRemoveUnconnected();
#define SKIP_CONNECTIVITY
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 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, RECURSE_MODE aRecurse=RECURSE_MODE::NO_RECURSE)
Modify a given item in the model.
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.
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.
VECTOR2< int32_t > VECTOR2I