45class HATCH_KNOCKOUT_SHAPE :
public PCB_SHAPE
50 SHAPE_POLY_SET CallGetHatchingKnockouts()
const {
return getHatchingKnockouts(); }
55std::unique_ptr<BOARD> makeBoardWithCourtyard()
57 std::unique_ptr<BOARD> board = std::make_unique<BOARD>();
58 std::unique_ptr<FOOTPRINT> footprint = std::make_unique<FOOTPRINT>( board.get() );
65 footprint->SetReference(
"U1" );
66 footprint->SetPosition(
VECTOR2I( 0, 0 ) );
68 board->Add( footprint.release() );
78 shape->SetLayer( aLayer );
98 std::unique_ptr<BOARD> board = makeBoardWithCourtyard();
99 HATCH_KNOCKOUT_SHAPE* shape = addHatchedRect( *board,
User_1 );
113 std::unique_ptr<BOARD> board = makeBoardWithCourtyard();
114 HATCH_KNOCKOUT_SHAPE* shape = addHatchedRect( *board,
F_CrtYd );
119 BOOST_CHECK_GT( knockouts.
Area(), 0.0 );
constexpr EDA_IU_SCALE pcbIUScale
Construction utilities for PCB tests.
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.
PCB_SHAPE(BOARD_ITEM *aParent, KICAD_T aItemType, SHAPE_T aShapeType)
Represent a set of closed polygons.
double Area()
Return the area of this poly set.
int OutlineCount() const
Return the number of outlines in the set.
Simple container to manage line stroke parameters.
@ RECTANGLE
Use RECTANGLE instead of RECT to avoid collision in a Windows header.
PCB_LAYER_ID
A quick note on layer IDs:
void DrawRect(FOOTPRINT &aFootprint, const VECTOR2I &aPos, const VECTOR2I &aSize, int aRadius, int aWidth, PCB_LAYER_ID aLayer)
Draw a rectangle on a footprint.
BOOST_AUTO_TEST_CASE(HorizontalAlignment)
BOOST_AUTO_TEST_SUITE(CadstarPartParser)
BOOST_AUTO_TEST_SUITE_END()
BOOST_AUTO_TEST_CASE(UserLayerIgnoresCourtyard)
A hatched shape on a User layer produces no knockouts, since the only same-layer item would be the fr...
BOOST_CHECK_EQUAL(result, "25.4")
VECTOR2< int32_t > VECTOR2I