36 std::vector<std::shared_ptr<ZONE>> clonedZones;
40 if( !zone->GetIsRuleArea() && !zone->IsTeardropArea() && zone->IsOnCopperLayer() )
42 auto zone_clone = std::shared_ptr<ZONE>(
static_cast<ZONE*
>( zone->Clone() ) );
45 clonedZones.push_back( std::move( zone_clone ) );
49 std::sort( clonedZones.begin(), clonedZones.end(),
50 []( std::shared_ptr<ZONE>
const& l, std::shared_ptr<ZONE>
const& r )
52 return l->GetAssignedPriority() > r->GetAssignedPriority();
55 unsigned currentPriority = clonedZones.size() - 1;
57 for(
const std::shared_ptr<ZONE>& zone : clonedZones )
59 m_managedZones.push_back( std::make_shared<MANAGED_ZONE>( zone, currentPriority ) );
70 std::shared_ptr<ZONE_SETTINGS> zoneSetting = std::make_shared<ZONE_SETTINGS>();
71 *zoneSetting << *aZone;
84 std::map<PCB_LAYER_ID, std::shared_ptr<SHAPE_POLY_SET>> filled_zone_to_restore;
85 ZONE* internal_zone = zone;
93 filled_zone_to_restore[layer] = fill;
98 for(
const auto& [ layer, fill ] : filled_zone_to_restore )
99 zone->SetFilledPolysList( layer, *fill );
108 ll->second->ExportSetting( zone->GetZone() );
114 bool priorityChanged =
false;
118 if( c->PriorityChanged() )
120 priorityChanged =
true;
125 if( priorityChanged )
128 c->OnUserConfirmChange();
131 return priorityChanged;
Information pertinent to a Pcbnew printed circuit board.
const ZONES & Zones() const
void RunOnLayers(const std::function< void(PCB_LAYER_ID)> &aFunction) const
Execute a function on each layer of the LSET.
std::shared_ptr< ZONE_SETTINGS > GetZoneSettings(ZONE *zone)
std::vector< ZONE * > m_clonedZoneList
void FlushZoneSettingsChange()
Flush the zone settings change to the cloned ones.
bool FlushPriorityChange()
Flush the priority change to the cloned ones.
std::unordered_map< ZONE *, std::shared_ptr< ZONE > > m_zonesCloneMap
void OnUserConfirmChange() override
std::unordered_map< ZONE *, std::shared_ptr< ZONE_SETTINGS > > m_zoneSettings
std::vector< std::shared_ptr< MANAGED_ZONE > > m_managedZones
ZONES_CONTAINER(BOARD *board)
Handle a list of polygons defining a copper zone.
const std::shared_ptr< SHAPE_POLY_SET > & GetFilledPolysList(PCB_LAYER_ID aLayer) const
virtual LSET GetLayerSet() const override
Return a std::bitset of all layers on which the item physically resides.
PCB_LAYER_ID
A quick note on layer IDs: