35 std::vector<std::shared_ptr<ZONE>> clonedZones;
39 if( !zone->GetIsRuleArea() && !zone->IsTeardropArea() && zone->IsOnCopperLayer() )
41 auto zone_clone = std::shared_ptr<ZONE>(
static_cast<ZONE*
>( zone->Clone() ) );
44 clonedZones.push_back( std::move( zone_clone ) );
48 std::sort( clonedZones.begin(), clonedZones.end(),
49 []( std::shared_ptr<ZONE>
const& l, std::shared_ptr<ZONE>
const& r )
51 return l->GetAssignedPriority() > r->GetAssignedPriority();
54 unsigned currentPriority = clonedZones.size() - 1;
56 for(
const std::shared_ptr<ZONE>& zone : clonedZones )
58 m_managedZones.push_back( std::make_shared<MANAGED_ZONE>( zone, currentPriority ) );
66 m_zoneSettings[
nullptr] = std::make_shared<ZONE_SETTINGS>( *aSettings );
75 std::shared_ptr<ZONE_SETTINGS> zoneSetting = std::make_shared<ZONE_SETTINGS>();
76 *zoneSetting << *aZone;
89 std::map<PCB_LAYER_ID, std::shared_ptr<SHAPE_POLY_SET>> filled_zone_to_restore;
90 ZONE* internal_zone = zone;
98 filled_zone_to_restore[layer] = fill;
103 for(
const auto& [ layer, fill ] : filled_zone_to_restore )
104 zone->SetFilledPolysList( layer, *fill );
114 ll->second->ExportSetting( zone->GetZone() );
121 bool priorityChanged =
false;
125 if( c->PriorityChanged() )
127 priorityChanged =
true;
132 if( priorityChanged )
135 c->OnUserConfirmChange();
138 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< std::shared_ptr< MANAGED_ZONE > > m_managedZones
void OnUserConfirmChange()
ZONE_SETTINGS_BAG()=default
std::unordered_map< ZONE *, std::shared_ptr< ZONE > > m_zonesCloneMap
bool FlushPriorityChange()
Flush the priority change to the cloned ones.
std::vector< ZONE * > m_clonedZoneList
std::unordered_map< ZONE *, std::shared_ptr< ZONE_SETTINGS > > m_zoneSettings
void FlushZoneSettingsChange()
Flush the zone settings change to the cloned ones.
ZONE_SETTINGS handles zones parameters.
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: