60 std::vector<KIGFX::VIEW::LAYER_ITEM_PAIR> baseline;
61 view.
Query( maxBox, baseline );
66 std::vector<KIGFX::VIEW::LAYER_ITEM_PAIR> withOverlay;
67 view.
Query( maxBox, withOverlay );
71 std::set<KIGFX::VIEW::LAYER_ITEM_PAIR> unique( withOverlay.begin(), withOverlay.end() );
81 std::vector<KIGFX::VIEW::LAYER_ITEM_PAIR> afterDestruction;
82 view.
Query( maxBox, afterDestruction );
96 constexpr int MM = 1000000;
118 BOOST_REQUIRE_EQUAL(
overlay.Badges().size(), 2 );
125 for(
double worldPerPx : { 200.0, 8000.0 } )
129 BOOST_REQUIRE_EQUAL( layout.size(), 2 );
130 double dist = ( layout[0] - layout[1] ).EuclideanNorm();
131 BOOST_TEST( dist >= 18.0 * worldPerPx - 1.0 );
137 BOOST_CHECK(
overlay.GetSelected() == c1->m_Uuid );
146 constexpr int MM = 1000000;
166 BOOST_REQUIRE_EQUAL(
overlay.Badges().size(), 2 );
168 const double worldPerPx = 8000.0;
171 BOOST_TEST( ( layout[0] - layout[1] ).EuclideanNorm() >= 18.0 * worldPerPx - 1.0 );
179 constexpr int MM = 1000000;
215 BOOST_REQUIRE_EQUAL(
overlay.Badges().size(), 1 );
216 BOOST_CHECK(
overlay.Badges()[0].constraint == c1->m_Uuid );
218 overlay.SetIsolated( c2->m_Uuid );
220 BOOST_REQUIRE_EQUAL(
overlay.Badges().size(), 1 );
221 BOOST_CHECK(
overlay.Badges()[0].constraint == c2->m_Uuid );
227 constexpr int MM = 1000000;
239 BOOST_CHECK( *hit == seg->
m_Uuid );
254 std::unique_ptr<BOARD> board;
258 auto hasConstraints = [](
const FOOTPRINT* aFootprint ) {
return !aFootprint->Constraints().empty(); };
259 auto fpIt = std::ranges::find_if( board->Footprints(), hasConstraints );
268 [](
BOARD_ITEM* aItem ) { return aItem->Type() == PCB_SHAPE_T; } );
274 footprint->
Add( live );
277 BOOST_REQUIRE_EQUAL( ids.size(), 1 );
278 BOOST_CHECK( ids.front() == ( *shapeIt )->m_Uuid );
BOARD_CONSTRAINT_DIAGNOSTICS DiagnoseBoardConstraints(BOARD *aBoard)
Diagnose every constraint cluster on the board (validate only – geometry is not changed) and return t...
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.
void Remove(BOARD_ITEM *aBoardItem, REMOVE_MODE aMode=REMOVE_MODE::NORMAL) override
Removes an item from the container.
constexpr void SetMaximum()
static std::vector< VECTOR2D > LayoutBadges(const std::vector< CONSTRAINT_BADGE > &aBadges, double aWorldPerPx)
The on-screen draw position (world units) of each badge at the given scale: the anchor offset by Badg...
Hold a (potentially large) number of VIEW_ITEMs and renders them on a graphics device provided by the...
int Query(const BOX2I &aRect, std::vector< LAYER_ITEM_PAIR > &aResult) const
Find all visible items that touch or are within the rectangle aRect.
A geometric constraint between board items (issue #2329).
const std::vector< CONSTRAINT_MEMBER > & GetMembers() const
void RemapKIIDs(const std::map< KIID, KIID > &aIdMap) override
Remap KIIDs this item stores to reference other items (e.g.
EDA_ITEM * Clone() const override
Create a duplicate of this item with linked list members set to NULL.
void SetEnd(const VECTOR2I &aEnd) override
void SetStart(const VECTOR2I &aStart) override
std::optional< KIID > NearestConstrainedShape(const BOARD *aBoard, const std::vector< KIID > &aCandidates, const VECTOR2I &aPos, int aMaxDist)
The candidate shape whose outline aPos hits within aMaxDist, or std::nullopt.
std::vector< KIID > ConstrainedShapeIds(const BOARD *aBoard)
The member ids of every board and footprint constraint that are on aBoard, in first reference order: ...
void LoadBoard(SETTINGS_MANAGER &aSettingsManager, const wxString &aRelPath, std::unique_ptr< BOARD > &aBoard)
@ START
First endpoint of a segment or arc.
@ END
Second endpoint of a segment or arc.
@ FIXED_POSITION
A point is locked at its current location.
std::shared_ptr< PNS_LOG_VIEWER_OVERLAY > overlay
Board-wide diagnostics for the constraint overlay and info bar.
BOOST_AUTO_TEST_CASE(HorizontalAlignment)
BOOST_AUTO_TEST_SUITE(CadstarPartParser)
BOOST_AUTO_TEST_CASE(OverlayRegistersOncePerLayerAndUnregistersFully)
BOOST_REQUIRE(intersection.has_value()==c.ExpectedIntersection.has_value())
BOOST_AUTO_TEST_SUITE_END()
BOOST_TEST(netlist.find("R_G1 ARM_OUT1 DIE_B R='0.001 / ((SW_STATE)") !=std::string::npos)
static const long long MM
static std::vector< int > candidates(const SEGMENT_INDEX &aIndex, const SEG &aQuery, int aPadding)
BOOST_CHECK_EQUAL(result, "25.4")
VECTOR2< int32_t > VECTOR2I