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 ) )
141 BOOST_CHECK( small_bbox.
Intersects( item->GetBoundingBox() ) );
145 BOOST_CHECK_EQUAL( count, 1 );
151 BOOST_CHECK( small_bbox.
Intersects( item->GetBoundingBox() ) );
155 BOOST_CHECK_EQUAL( count, 1 );
161 BOOST_CHECK( small_bbox.
Intersects( item->GetBoundingBox() ) );
165 BOOST_CHECK_EQUAL( count, 0 );
169 for(
SCH_ITEM* item : m_tree.Overlapping( med_bbox ) )
171 BOOST_CHECK( med_bbox.
Intersects( item->GetBoundingBox() ) );
175 BOOST_CHECK_EQUAL( count, 2 );
179 for(
SCH_ITEM* item : m_tree.Overlapping( big_bbox ) )
181 BOOST_CHECK( big_bbox.
Intersects( item->GetBoundingBox() ) );
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 ) )
233 BOOST_CHECK( small_bbox.
Intersects( item->GetBoundingBox() ) );
237 BOOST_CHECK_EQUAL( count, 2 );
243 BOOST_CHECK( small_bbox.
Intersects( item->GetBoundingBox() ) );
247 BOOST_CHECK_EQUAL( count, 1 );
253 BOOST_CHECK( small_bbox.
Intersects( item->GetBoundingBox() ) );
257 BOOST_CHECK_EQUAL( count, 1 );
268 m_tree.insert( junction );
281 BOOST_CHECK_EQUAL( count, 1 );
290 BOOST_CHECK_EQUAL( count, 1 );
constexpr EDA_IU_SCALE schIUScale
constexpr 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_AUTO_TEST_SUITE_END()
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.
VECTOR2< int32_t > VECTOR2I