63 BOOST_CHECK_EQUAL( m_tree.empty(),
true );
66 for(
auto item : m_tree )
72 BOOST_CHECK_EQUAL( count, 0 );
77 for(
auto item : m_tree.OfType(
KICAD_T( type ) ) )
83 BOOST_CHECK_EQUAL( count, 0 );
98 BOOST_CHECK_EQUAL( count, 0 );
104 for(
int i = 0; i < 100; i++ )
108 m_tree.insert( junction );
119 BOOST_CHECK_EQUAL( count, 100 );
128 BOOST_CHECK_EQUAL( count, 0 );
139 for(
SCH_ITEM* item : m_tree.Overlapping( small_bbox ) )
145 BOOST_CHECK_EQUAL( count, 1 );
155 BOOST_CHECK_EQUAL( count, 1 );
165 BOOST_CHECK_EQUAL( count, 0 );
169 for(
SCH_ITEM* item : m_tree.Overlapping( med_bbox ) )
175 BOOST_CHECK_EQUAL( count, 2 );
179 for(
SCH_ITEM* item : m_tree.Overlapping( big_bbox ) )
185 BOOST_CHECK_EQUAL( count, 51 );
193 for(
int i = 0; i < 100; i++ )
195 int x_sign = ( i % 2 == 0 ) ? -1 : 1;
196 int y_sign = ( i % 3 == 0 ) ? -1 : 1;
200 m_tree.insert( junction );
215 BOOST_CHECK_EQUAL( count, 100 );
225 BOOST_CHECK_EQUAL( count, 100 );
231 for(
SCH_ITEM* item : m_tree.Overlapping( small_bbox ) )
237 BOOST_CHECK_EQUAL( count, 2 );
247 BOOST_CHECK_EQUAL( count, 1 );
257 BOOST_CHECK_EQUAL( count, 1 );
268 m_tree.insert( junction );
281 BOOST_CHECK_EQUAL( count, 1 );
290 BOOST_CHECK_EQUAL( count, 1 );
296BOOST_AUTO_TEST_SUITE_END()
constexpr EDA_IU_SCALE schIUScale
bool Intersects(const BOX2< Vec > &aRect) const
Implements an R-tree for fast spatial and type indexing of schematic items.
Base class for any item which can be embedded within the SCHEMATIC container class,...
void ignore_unused(const T &)
constexpr int MilsToIU(int mils) const
BOOST_CHECK(box.ClosestPointTo(VECTOR2D(0, 0))==VECTOR2D(1, 2))
Test suite for KiCad math code.
BOOST_AUTO_TEST_CASE(Default)
Declare the test suite.
KICAD_T
The set of class identification values stored in EDA_ITEM::m_structType.
Test utilities for timestamps.