18#define BOOST_TEST_NO_MAIN
19#include <boost/test/unit_test.hpp>
64std::unique_ptr<LIB_SYMBOL> MakeTwoPinSymbol()
66 auto libSymbol = std::make_unique<LIB_SYMBOL>(
"R",
nullptr );
68 for(
const auto& [number, position] : { std::pair(
"1",
VECTOR2I( -508000, 0 ) ),
69 std::pair(
"2",
VECTOR2I( 508000, 0 ) ) } )
72 pin->SetNumber( number );
74 pin->SetPosition( position );
75 libSymbol->AddDrawItem(
pin );
85 std::unique_ptr<LIB_SYMBOL> libSymbol = MakeTwoPinSymbol();
86 SCH_SYMBOL symbol( *libSymbol, libSymbol->GetLibId(),
nullptr, 0, 0,
VECTOR2I( 0, 0 ) );
97 std::unique_ptr<LIB_SYMBOL> libSymbol = MakeTwoPinSymbol();
98 SCH_SYMBOL symbol( *libSymbol, libSymbol->GetLibId(),
nullptr, 0, 0,
VECTOR2I( 2540000, 1270000 ) );
102 BOOST_REQUIRE_EQUAL( pins.size(), 2 );
104 for(
const auto& [
pin, position] : pins )
108 SCH_PIN standalone( libSymbol.get() );
static std::vector< std::pair< const SCH_PIN *, VECTOR2I > > LayoutPins(SCH_ITEM &aItem)
static BOX2I LayoutBounds(const SCH_ITEM &aItem)
static std::vector< std::pair< const SCH_PIN *, VECTOR2I > > layoutPins(SCH_ITEM &aItem)
Pin connection points the item offers as alignment anchors.
GRID_HELPER_GRIDS GetItemGrid(const EDA_ITEM *aItem) const override
Get the coarsest grid that applies to an item.
static BOX2I layoutBounds(const SCH_ITEM &aItem)
Bounds a layout relation should align to.
void SetPosition(const VECTOR2I &aPosition) override
Base class for any item which can be embedded within the SCHEMATIC container class,...
Segment description base class to describe items which have 2 end points (track, wire,...
void SetPosition(const VECTOR2I &aPos) override
BOX2I GetBodyAndPinsBoundingBox() const override
Return a bounding box for the symbol body and pins but not the fields.
void UpdatePins()
Updates the cache of SCH_PIN objects for each pin.
const BOX2I GetBoundingBox() const override
Return the orthogonal bounding box of this object for display purposes.
SCH_FIELD * GetField(FIELD_T aFieldType)
Return a mandatory field in this symbol.
@ PT_PASSIVE
pin for passive symbols: must be connected, and can be connected to any pin.
@ REFERENCE
Field Reference of part, i.e. "IC21".
BOOST_AUTO_TEST_CASE(HorizontalAlignment)
BOOST_AUTO_TEST_SUITE(CadstarPartParser)
BOOST_AUTO_TEST_CASE(ItemGridClassification)
BOOST_AUTO_TEST_SUITE_END()
BOOST_CHECK_EQUAL(result, "25.4")
VECTOR2< int32_t > VECTOR2I