42 auto zone = std::make_unique<ZONE>( &aParent );
43 zone->SetLayer( aLayer );
45 auto outline = std::make_unique<SHAPE_POLY_SET>();
48 zone->SetOutline( outline.release() );
59 auto zone = std::make_unique<ZONE>( &aParent );
60 zone->SetLayer( aLayer );
62 std::unique_ptr<SHAPE_POLY_SET> outline = std::make_unique<SHAPE_POLY_SET>( *aOther.
Outline() );
63 zone->SetOutline( outline.release() );
73 ZONE zone( &m_board );
85 ZONE zone( &m_board );
105 ZONE zone( &m_board );
127 ZONE* ruleArea =
new ZONE( &footprint );
130 footprint.
Add( ruleArea );
140 usedLayers |=
static_cast<ZONE*
>( aItem )->GetLayerSet();
151 usedLayers &= ~allowedLayers;
152 usedLayers &=
~LSET::AllTechMask();
153 usedLayers &=
~LSET::UserMask();
166 ZONE zone( &m_board );
177 std::vector<std::unique_ptr<ZONE>> zones;
179 zones.emplace_back( std::make_unique<ZONE>( &m_board ) );
180 zones.back()->SetLayer(
F_Cu );
182 zones.emplace_back( std::make_unique<ZONE>( &m_board ) );
183 zones.back()->SetLayer(
F_Cu );
194 std::vector<std::unique_ptr<ZONE>> zones;
208 std::vector<std::unique_ptr<ZONE>> zones;
219 BOOST_TEST( merged[0]->GetNumCorners() == 4 );
225 std::vector<std::unique_ptr<ZONE>> zones;
233 auto newPolyB = std::make_unique<SHAPE_POLY_SET>( *zones.back()->Outline() );
234 newPolyB->Outline( 0 ).Reverse();
235 zones.back()->SetOutline( newPolyB.release() );
243 BOOST_TEST( merged[0]->GetNumCorners() == 4 );
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.
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 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
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 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)
@ 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.