21#include <boost/test/unit_test.hpp>
28#include <api/board/board_types.pb.h>
56 int referenceImageCount = 0;
58 for(
PCB_TRACK* track : m_board->Tracks() )
60 switch( track->Type() )
76 m_board.get(),
false );
84 for(
FOOTPRINT* footprint : m_board->Footprints() )
87 for(
ZONE* zone : m_board->Zones() )
92 switch( item->Type() )
121 static_cast<PCB_BARCODE*
>( item ), m_board.get() );
128 ++referenceImageCount;
138 BOOST_CHECK_GT( barcodeCount, 0 );
139 BOOST_CHECK_GT( referenceImageCount, 0 );
147 for(
PCB_TRACK* track : m_board->Tracks() )
149 switch( track->Type() )
156 m_board.get(),
false );
164 for(
FOOTPRINT* footprint : m_board->Footprints() )
176 m_board = std::make_unique<BOARD>();
178 ZONE* zone =
new ZONE( m_board.get() );
195 m_board->Add( zone );
197 google::protobuf::Any
any;
200 kiapi::board::types::Zone proto;
203 BOOST_REQUIRE( proto.copper_settings().has_thieving_settings() );
205 std::unique_ptr<ZONE> roundTripped = std::make_unique<ZONE>( m_board.get() );
211 BOOST_CHECK_LE( roundTripped->GetNetCode(), 0 );
void testProtoFromKiCadObject(KiCadClass *aInput, Factory &&aCreateOutput)
constexpr EDA_IU_SCALE pcbIUScale
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
For better understanding of the points that make a dimension:
Mark the center of a circle or arc with a cross shape.
A leader is a dimension-like object pointing to a specific point.
An orthogonal dimension is like an aligned dimension, but the extension lines are locked to the X or ...
A radial dimension indicates either the radius or diameter of an arc or circle.
Object to handle a bitmap image that can be inserted in a PCB.
Handle a list of polygons defining a copper zone.
virtual void SetLayer(PCB_LAYER_ID aLayer) override
Set the layer this item is on.
void Serialize(google::protobuf::Any &aContainer) const override
Serializes this object to the given Any message.
void SetFillMode(ZONE_FILL_MODE aFillMode)
void SetThievingSettings(const THIEVING_SETTINGS &aSettings)
bool AppendCorner(VECTOR2I aPosition, int aHoleIdx, bool aAllowDuplication=false)
Add a new corner to the zone outline (to the main outline or a hole)
A type-safe container of any type.
void LoadBoard(SETTINGS_MANAGER &aSettingsManager, const wxString &aRelPath, std::unique_ptr< BOARD > &aBoard)
BARCODE class definition.
std::unique_ptr< BOARD > m_board
SETTINGS_MANAGER m_settingsManager
Parameters that drive copper-thieving fill generation.
BOOST_FIXTURE_TEST_CASE(BoardTypes, PROTO_TEST_FIXTURE)
BOOST_AUTO_TEST_SUITE(CadstarPartParser)
BOOST_REQUIRE(intersection.has_value()==c.ExpectedIntersection.has_value())
BOOST_AUTO_TEST_SUITE_END()
BOOST_CHECK_EQUAL(result, "25.4")
@ PCB_DIM_ORTHOGONAL_T
class PCB_DIM_ORTHOGONAL, a linear dimension constrained to x/y
@ PCB_DIM_LEADER_T
class PCB_DIM_LEADER, a leader dimension (graphic item)
@ PCB_VIA_T
class PCB_VIA, a via (like a track segment on a copper layer)
@ PCB_DIM_CENTER_T
class PCB_DIM_CENTER, a center point marking (graphic item)
@ PCB_REFERENCE_IMAGE_T
class PCB_REFERENCE_IMAGE, bitmap on a layer
@ PCB_BARCODE_T
class PCB_BARCODE, a barcode (graphic item)
@ PCB_DIM_ALIGNED_T
class PCB_DIM_ALIGNED, a linear dimension (graphic item)
@ PCB_ARC_T
class PCB_ARC, an arc track segment on a copper layer
@ PCB_TRACE_T
class PCB_TRACK, a track segment (segment on a copper layer)
@ PCB_DIM_RADIAL_T
class PCB_DIM_RADIAL, a radius or diameter dimension
VECTOR2< int32_t > VECTOR2I