46 auto zone = std::make_unique<ZONE>( &aParent );
47 zone->SetLayer( aLayer );
49 auto outline = std::make_unique<SHAPE_POLY_SET>();
52 zone->SetOutline( outline.release() );
63 auto zone = std::make_unique<ZONE>( &aParent );
64 zone->SetLayer( aLayer );
66 std::unique_ptr<SHAPE_POLY_SET> outline = std::make_unique<SHAPE_POLY_SET>( *aOther.
Outline() );
67 zone->SetOutline( outline.release() );
77 ZONE zone( &m_board );
89 ZONE zone( &m_board );
109 ZONE zone( &m_board );
131 ZONE* ruleArea =
new ZONE( &footprint );
134 footprint.
Add( ruleArea );
144 usedLayers |=
static_cast<ZONE*
>( aItem )->GetLayerSet();
155 usedLayers &= ~allowedLayers;
156 usedLayers &=
~LSET::AllTechMask();
157 usedLayers &=
~LSET::UserMask();
170 ZONE zone( &m_board );
181 std::vector<std::unique_ptr<ZONE>> zones;
183 zones.emplace_back( std::make_unique<ZONE>( &m_board ) );
184 zones.back()->SetLayer(
F_Cu );
186 zones.emplace_back( std::make_unique<ZONE>( &m_board ) );
187 zones.back()->SetLayer(
F_Cu );
198 std::vector<std::unique_ptr<ZONE>> zones;
212 std::vector<std::unique_ptr<ZONE>> zones;
223 BOOST_TEST( merged[0]->GetNumCorners() == 4 );
229 std::vector<std::unique_ptr<ZONE>> zones;
237 auto newPolyB = std::make_unique<SHAPE_POLY_SET>( *zones.back()->Outline() );
238 newPolyB->Outline( 0 ).Reverse();
239 zones.back()->SetOutline( newPolyB.release() );
247 BOOST_TEST( merged[0]->GetNumCorners() == 4 );
254 via->SetPosition( aPos );
255 via->SetLayerPair( aTopLayer, aBotLayer );
258 via->SetNetCode( aNetCode );
272 pad->SetPosition( aPos );
276 pad->SetLayerSet(
LSET( { aLayer } ) );
277 pad->SetNetCode( aNetCode );
295 zoneA->SetAssignedPriority( 5 );
302 zoneB->SetAssignedPriority( 10 );
304 ZONE* ptrA = zoneA.get();
305 ZONE* ptrB = zoneB.get();
306 m_board.Add( zoneA.release() );
307 m_board.Add( zoneB.release() );
334 ZONE* ptrA = zoneA.get();
335 ZONE* ptrB = zoneB.get();
336 m_board.Add( zoneA.release() );
337 m_board.Add( zoneB.release() );
339 for(
int i = 0; i < 5; i++ )
375 ZONE* ptrA = zoneA.get();
376 ZONE* ptrB = zoneB.get();
377 m_board.Add( zoneA.release() );
378 m_board.Add( zoneB.release() );
397 m_board.SetCopperLayerCount( 2 );
418 ZONE* ptrA = zoneA.get();
419 ZONE* ptrB = zoneB.get();
420 m_board.Add( zoneA.release() );
421 m_board.Add( zoneB.release() );
458 ZONE* ptrA = zoneA.get();
459 ZONE* ptrB = zoneB.get();
460 m_board.Add( zoneA.release() );
461 m_board.Add( zoneB.release() );
488 zoneA->SetAssignedPriority( 50 );
495 zoneB->SetAssignedPriority( 50 );
497 ZONE* ptrA = zoneA.get();
498 ZONE* ptrB = zoneB.get();
499 m_board.Add( zoneA.release() );
500 m_board.Add( zoneB.release() );
514 m_board.Add( netGND );
516 m_board.Add( netVCC );
539 ZONE* ptrA = zoneA.get();
540 ZONE* ptrB = zoneB.get();
541 ZONE* ptrC = zoneC.get();
542 m_board.Add( zoneA.release() );
543 m_board.Add( zoneB.release() );
544 m_board.Add( zoneC.release() );
547 for(
int i = 0; i < 4; i++ )
constexpr EDA_IU_SCALE pcbIUScale
BASE_SET & set(size_t pos)
Abstract interface for BOARD_ITEMs capable of storing other items inside.
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
virtual PCB_LAYER_ID GetLayer() const
Return the primary layer this item is on.
Information pertinent to a Pcbnew printed circuit board.
void Add(BOARD_ITEM *aItem, ADD_MODE aMode=ADD_MODE::INSERT, bool aSkipConnectivity=false) override
Removes an item from the container.
KICAD_T Type() const
Returns the type of object.
LSET is a set of PCB_LAYER_IDs.
static LSET UserDefinedLayersMask(int aUserDefinedLayerCount=MAX_USER_DEFINED_LAYERS)
Return a mask with the requested number of user defined layers.
static const LSET & InternalCuMask()
Return a complete set of internal copper layers which is all Cu layers except F_Cu and B_Cu.
Handle the data for a net.
static constexpr PCB_LAYER_ID ALL_LAYERS
! Temporary layer identifier to identify code that is not padstack-aware
Handle a list of polygons defining a copper zone.
virtual PCB_LAYER_ID GetLayer() const override
Return the primary layer this item is on.
virtual void SetLayer(PCB_LAYER_ID aLayer) override
Set the layer this item is on.
SHAPE_POLY_SET * Outline()
void SetIsRuleArea(bool aEnable)
void SetLayerSet(const LSET &aLayerSet) override
VECTOR2I GetPosition() const override
bool IsOnCopperLayer() const override
PCB_LAYER_ID GetFirstLayer() const
unsigned GetAssignedPriority() const
int GetNumCorners(void) const
Access to m_Poly parameters.
PCB_LAYER_ID
A quick note on layer IDs:
SHAPE_LINE_CHAIN BoxToLineChain(const BOX2I &aBox)
Utility functions for working with shapes.
BOOST_AUTO_TEST_CASE(HorizontalAlignment)
BOOST_TEST(contains==c.ExpectedContains)
BOOST_REQUIRE(intersection.has_value()==c.ExpectedIntersection.has_value())
BOOST_AUTO_TEST_SUITE_END()
static std::unique_ptr< ZONE > CreateSquareZone(BOARD_ITEM_CONTAINER &aParent, BOX2I aBox, PCB_LAYER_ID aLayer)
static PCB_VIA * AddVia(BOARD &aBoard, const VECTOR2I &aPos, int aNetCode, PCB_LAYER_ID aTopLayer=F_Cu, PCB_LAYER_ID aBotLayer=B_Cu)
static std::unique_ptr< ZONE > CreateSimilarZone(BOARD_ITEM_CONTAINER &aParent, const ZONE &aOther, PCB_LAYER_ID aLayer)
Create a similar zone (same outline) on a different layer.
BOOST_AUTO_TEST_CASE(SingleLayer)
static PAD * AddPadToBoard(BOARD &aBoard, const VECTOR2I &aPos, int aNetCode, PCB_LAYER_ID aLayer=F_Cu)
@ PCB_ZONE_T
class ZONE, a copper pour area
VECTOR2< int32_t > VECTOR2I
std::vector< std::unique_ptr< ZONE > > MergeZonesWithSameOutline(std::vector< std::unique_ptr< ZONE > > &&aZones)
Merges zones with identical outlines and nets on different layers into single multi-layer zones.
bool AutoAssignZonePriorities(BOARD *aBoard, PROGRESS_REPORTER *aReporter)
Automatically assign zone priorities based on connectivity analysis of overlapping regions.