36 std::vector<std::shared_ptr<ZONE>> clonedZones;
40 if( ( !zone->GetIsRuleArea() ) &&
IsCopperLayer( zone->GetFirstLayer() )
41 && ( !zone->IsTeardropArea() ) )
43 std::shared_ptr<ZONE> zone_clone =
44 std::shared_ptr<ZONE>(
static_cast<ZONE*
>( zone->Clone() ) );
47 clonedZones.push_back( std::move( zone_clone ) );
51 std::sort( clonedZones.begin(), clonedZones.end(),
52 []( std::shared_ptr<ZONE>
const& l, std::shared_ptr<ZONE>
const& r
56 return l->GetAssignedPriority() > r->GetAssignedPriority();
59 unsigned currentPriority = clonedZones.size() - 1;
61 for(
const std::shared_ptr<ZONE>& zone : clonedZones )
64 std::make_shared<ZONE_PRIORITY_CONTAINER>( zone, currentPriority ) );
76 std::shared_ptr<ZONE_SETTINGS> zoneSetting = std::make_shared<ZONE_SETTINGS>();
77 *zoneSetting << *aZone;
98 ll->second->ExportSetting( zone->GetZone() );
104 bool priorityChanged =
false;
108 if( c->PriorityChanged() )
110 priorityChanged =
true;
115 if( priorityChanged )
119 c->OnUserConfirmChange();
123 return priorityChanged;
Information pertinent to a Pcbnew printed circuit board.
const ZONES & Zones() const
std::shared_ptr< ZONE_SETTINGS > GetZoneSettings(ZONE *zone)
std::vector< ZONE * > m_clonedZoneList
std::vector< std::shared_ptr< ZONE_PRIORITY_CONTAINER > > m_zonesPriorityContainer
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_zonesColoneMap
void OnUserConfirmChange() override
std::unordered_map< ZONE *, std::shared_ptr< ZONE_SETTINGS > > m_zoneSettings
~ZONES_CONTAINER() override
ZONES_CONTAINER(BOARD *board)
Handle a list of polygons defining a copper zone.
bool IsCopperLayer(int aLayerId)
Tests whether a layer is a copper layer.