Wrap ZONE_FILLER to allow use without commit from Python
Fixes https://gitlab.com/kicad/code/kicad/-/issues/5646
This commit is contained in:
parent
ff652d5375
commit
1319885285
|
@ -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 class_zone.h
|
||||||
%include zones.h
|
%include zones.h
|
||||||
%include zone_filler.h
|
|
||||||
%{
|
%{
|
||||||
#include <class_zone.h>
|
#include <class_zone.h>
|
||||||
#include <zones.h>
|
#include <zones.h>
|
||||||
#include <zone_filler.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 );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -79,6 +79,7 @@ void ZONE_FILLER::InstallNewProgressReporter( wxWindow* aParent, const wxString&
|
||||||
void ZONE_FILLER::SetProgressReporter( PROGRESS_REPORTER* aReporter )
|
void ZONE_FILLER::SetProgressReporter( PROGRESS_REPORTER* aReporter )
|
||||||
{
|
{
|
||||||
m_progressReporter = 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() )
|
if( zone->GetIsRuleArea() )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
m_commit->Modify( zone );
|
if( m_commit )
|
||||||
|
m_commit->Modify( zone );
|
||||||
|
|
||||||
// calculate the hash value for filled areas. it will be used later
|
// calculate the hash value for filled areas. it will be used later
|
||||||
// to know if the current filled areas are up to date
|
// to know if the current filled areas are up to date
|
||||||
|
|
Loading…
Reference in New Issue