20#include <boost/test/unit_test.hpp>
63 BOOST_CHECK(
text.IsSelected() );
70 std::unique_ptr<SCHEMATIC> schematic;
78 auto* candidate =
static_cast<SCH_LABEL*
>( item );
80 if( candidate->GetText() ==
"NET_2" )
85 schematic->ConnectionGraph()->Reset();
87 manager.
SetEnvironment( schematic.get(),
nullptr,
nullptr,
nullptr,
nullptr );
89 commit.
Modify( label, screen );
90 label->
SetText(
"DEFERRED_CONNECTIVITY" );
92 BOOST_CHECK( commit.
Empty() );
94 BOOST_CHECK( schematic->ConnectionGraph()->GetNetMap().empty() );
95 schematic->RecalculateConnections(
nullptr,
GLOBAL_CLEANUP, &manager );
104 std::unique_ptr<SCHEMATIC> schematic;
106 SCH_SCREEN* screen = schematic->GetCurrentScreen();
107 auto* wire =
dynamic_cast<SCH_LINE*
>(
109 auto* other =
dynamic_cast<SCH_LINE*
>(
112 const VECTOR2I start = wire->GetStartPoint();
115 manager.
SetEnvironment( schematic.get(),
nullptr,
nullptr,
nullptr,
nullptr );
117 move.Modify( wire, screen );
118 wire->Move( other->GetStartPoint() - start );
120 schematic->CleanUp( &
move, screen );
125 BOOST_CHECK( wire->GetStartPoint() == start );
126 BOOST_CHECK( wire->GetEndPoint() ==
end );
COMMIT & Modify(EDA_ITEM *aItem, BASE_SCREEN *aScreen=nullptr, RECURSE_MODE aRecurse=RECURSE_MODE::NO_RECURSE)
Modify a given item in the model.
int GetStatus(EDA_ITEM *aItem, BASE_SCREEN *aScreen=nullptr)
Returns status of an item.
virtual const wxString & GetText() const
Return the string associated with the text object.
virtual void SetText(const wxString &aText)
EE_TYPE OfType(KICAD_T aType) const
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.
virtual void Push(const wxString &aMessage=wxT("A commit"), int aCommitFlags=0) override
Execute the changes.
A set of SCH_ITEMs (i.e., without duplicates).
Base class for any item which can be embedded within the SCHEMATIC container class,...
std::optional< wxString > GetConnectionName(const SCH_SHEET_PATH *aSheet=nullptr, bool aLocal=false, bool aIgnoreSheet=false) const
Return the connection name for this sheet instance, if connected.
Segment description base class to describe items which have 2 end points (track, wire,...
EE_RTREE & Items()
Get the full RTree, usually for iterating.
SCH_ITEM * GetConnectivityItem(const KIID &aId) const
Resolve a drawing item or a connectable child on this screen; ambiguous IDs return null.
void Update(SCH_ITEM *aItem, bool aUpdateLibSymbol=true)
Update aItem's bounding box in the tree.
bool CheckIfOnDrawList(const SCH_ITEM *aItem) const
Handle access to a stack of flattened SCH_SHEET objects by way of a path for creating a flattened sch...
#define SELECTED_BY_DRAG
Item was algorithmically selected as a dragged item.
#define STRUCT_DELETED
flag indication structures to be erased
void LoadSchematic(SETTINGS_MANAGER &aSettingsManager, const wxString &aRelPath, std::unique_ptr< SCHEMATIC > &aSchematic)
#define SKIP_CONNECTIVITY
Class to handle a set of SCH_ITEMs.
BOOST_AUTO_TEST_CASE(HorizontalAlignment)
BOOST_AUTO_TEST_SUITE(CadstarPartParser)
BOOST_REQUIRE(intersection.has_value()==c.ExpectedIntersection.has_value())
BOOST_AUTO_TEST_SUITE_END()
BOOST_AUTO_TEST_CASE(RecursesThroughGroups)
BOOST_CHECK_EQUAL(result, "25.4")
VECTOR2< int32_t > VECTOR2I