Wrap ZONE_FILLER to allow use without commit from Python

Fixes https://gitlab.com/kicad/code/kicad/-/issues/5646
This commit is contained in:
Jon Evans 2020-09-24 18:08:23 -04:00
parent ff652d5375
commit 1319885285
2 changed files with 15 additions and 3 deletions

View File

@ -1,11 +1,21 @@
// Do not permit default ZONE_FILLER ctor since commits are not supported from Python
%ignore ZONE_FILLER::ZONE_FILLER(BOARD*, COMMIT*);
%include class_zone.h
%include zones.h
%include zone_filler.h
%{
#include <class_zone.h>
#include <zones.h>
#include <zone_filler.h>
%}
// Provide a compatiblity ctor for ZONE_FILLER that doesn't need a COMMIT
%include zone_filler.h
%extend ZONE_FILLER
{
ZONE_FILLER( BOARD* aBoard )
{
return new ZONE_FILLER( aBoard, nullptr );
}
}

View File

@ -79,6 +79,7 @@ void ZONE_FILLER::InstallNewProgressReporter( wxWindow* aParent, const wxString&
void ZONE_FILLER::SetProgressReporter( PROGRESS_REPORTER* aReporter )
{
m_progressReporter = aReporter;
wxASSERT_MSG( m_commit, "ZONE_FILLER must have a valid commit to call SetProgressReporter" );
}
@ -133,7 +134,8 @@ bool ZONE_FILLER::Fill( std::vector<ZONE_CONTAINER*>& aZones, bool aCheck, wxWin
if( zone->GetIsRuleArea() )
continue;
m_commit->Modify( zone );
if( m_commit )
m_commit->Modify( zone );
// calculate the hash value for filled areas. it will be used later
// to know if the current filled areas are up to date