20#include <boost/test/unit_test.hpp>
85 BOOST_REQUIRE_EQUAL( netPads(), 1u );
89 commit.
Push( wxT(
"Delete Pad" ) );
101 BOOST_CHECK(
copy != &shape );
130 text->SetText( wxT(
"${REFERENCE}" ) );
243 VECTOR2I origin( 10000000, 10000000 );
254 std::map<BOARD_ITEM*, VECTOR2I> before;
257 before[item] = item->GetPosition();
259 BOOST_REQUIRE_EQUAL( before.size(), 2u );
263 stack->
EditStart(
nullptr, &board, &commit );
269 stack->
Update(
nullptr, &board, &commit );
272 stack->
EditFinish(
nullptr, &board, &commit );
278 for(
const auto& [item, pos] : before )
280 BOOST_CHECK_MESSAGE( item->GetPosition() == pos,
281 "hop left behind at " + item->GetPosition().Format() +
" instead of " + pos.Format() );
310 BOOST_REQUIRE_EQUAL( original.size(), 2u );
314 stack->
EditStart(
nullptr, &board, &commit );
318 stack->
Update(
nullptr, &board, &commit );
319 stack->
EditFinish(
nullptr, &board, &commit );
324 "replaced hop is staged as " << commit.
GetStatus( item ) <<
", expected CHT_REMOVE only" );
355 BOOST_REQUIRE_EQUAL( before.size(), 2u );
360 BOOST_CHECK( !stack->
Update(
nullptr, &board, &commit ) );
364 BOOST_REQUIRE_EQUAL( after.size(), before.size() );
365 BOOST_CHECK_MESSAGE( std::set<BOARD_ITEM*>( before.begin(), before.end() )
366 == std::set<BOARD_ITEM*>( after.begin(), after.end() ),
367 "the hops were rebuilt outside an edit" );
void Push(const wxString &aMessage=wxEmptyString, int aCommitFlags=0) override
Execute the changes.
COMMIT & Stage(EDA_ITEM *aItem, CHANGE_TYPE aChangeType, BASE_SCREEN *aScreen=nullptr, RECURSE_MODE aRecurse=RECURSE_MODE::NO_RECURSE) override
Add a change of the item aItem of type aChangeType to the change list.
void Revert() override
Revert the commit by restoring the modified items state.
static EDA_ITEM * MakeImage(EDA_ITEM *aItem)
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
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_BOARD_OUTLINE * BoardOutline()
void UpdateBoardOutline()
bool BuildConnectivity(PROGRESS_REPORTER *aReporter=nullptr)
Build or rebuild the board connectivity database for the board, especially the list of connected item...
void SetCopperLayerCount(int aCount)
void SetEnabledLayers(const LSET &aLayerMask)
A proxy function that calls the correspondent function in m_BoardSettings.
std::shared_ptr< CONNECTIVITY_DATA > GetConnectivity() const
Return a list of missing connections between components/tracks.
COMMIT & Remove(EDA_ITEM *aItem, BASE_SCREEN *aScreen=nullptr)
Remove a new item from the model.
COMMIT & Modify(EDA_ITEM *aItem, BASE_SCREEN *aScreen=nullptr, RECURSE_MODE aRecurse=RECURSE_MODE::NO_RECURSE)
Modify a given item in the model.
COMMIT & Add(EDA_ITEM *aItem, BASE_SCREEN *aScreen=nullptr)
Add a new item to the model.
int GetStatus(EDA_ITEM *aItem, BASE_SCREEN *aScreen=nullptr)
Returns status of an item.
const std::vector< BOARD_CONNECTED_ITEM * > GetNetItems(int aNetCode, const std::vector< KICAD_T > &aTypes) const
Return the list of items that belong to a certain net.
A base class for most all the KiCad significant classes used in schematics and boards.
static const LSET & AllTechMask()
Return a mask holding all technical layers (no CU layer) on both side.
static LSET AllCuMask(int aCuLayerCount)
Return a mask holding the requested number of Cu PCB_LAYER_IDs.
Handle the data for a net.
const SHAPE_POLY_SET & GetOutline() const
void SetPosition(const VECTOR2I &aPos) override
VECTOR2I GetPosition() const override
A set of BOARD_ITEMs (i.e., without duplicates).
std::unordered_set< BOARD_ITEM * > GetBoardItems() const
void SetEnd(const VECTOR2I &aEnd) override
void SetLayer(PCB_LAYER_ID aLayer) override
Set the layer this item is on.
void SetStart(const VECTOR2I &aStart) override
A microvia stack: several single hop microvias, plus connecting traces for staggered stacks,...
bool Update(GENERATOR_TOOL *aTool, BOARD *aBoard, BOARD_COMMIT *aCommit) override
void EditStart(GENERATOR_TOOL *aTool, BOARD *aBoard, BOARD_COMMIT *aCommit) override
void EditFinish(GENERATOR_TOOL *aTool, BOARD *aBoard, BOARD_COMMIT *aCommit) override
void Regenerate(BOARD *aBoard, BOARD_COMMIT *aCommit)
Rebuild the member vias (and, for a staggered stack, the connecting traces) from the current stack se...
void SetStartLayer(PCB_LAYER_ID aLayer)
void SetViaSize(int aSize)
void SetViaDrill(int aDrill)
void Move(const VECTOR2I &aMoveVector) override
Move this object.
void SetEndLayer(PCB_LAYER_ID aLayer)
bool Contains(EDA_ITEM *aItem) const
int OutlineCount() const
Return the number of outlines in the set.
#define UR_TRANSIENT
indicates the item is owned by the undo/redo stack
@ RECTANGLE
Use RECTANGLE instead of RECT to avoid collision in a Windows header.
Class to handle a set of BOARD_ITEMs.
BOOST_AUTO_TEST_CASE(HorizontalAlignment)
BOOST_AUTO_TEST_CASE(RecursesThroughGroups)
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_PAD_T
class PAD, a pad in a footprint
VECTOR2< int32_t > VECTOR2I