KiCad PCB EDA Suite
Loading...
Searching...
No Matches
drc_rtree.h
Go to the documentation of this file.
1/*
2 * This program source code file is part of KiCad, a free EDA CAD application.
3 *
4 * Copyright The KiCad Developers, see AUTHORS.txt for contributors.
5 * Copyright (C) 2020 CERN
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version 3
10 * of the License, or (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, you may find one here:
19 * http://www.gnu.org/licenses/old-licenses/gpl-3.0.html
20 * or you may search the http://www.gnu.org website for the version 3 license,
21 * or you may write to the Free Software Foundation, Inc.,
22 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
23 */
24
25#ifndef DRC_RTREE_H_
26#define DRC_RTREE_H_
27
28#include <board_item.h>
29#include <pad.h>
30#include <pcb_field.h>
31#include <memory>
32#include <unordered_set>
33#include <set>
34#include <vector>
35
36#include <geometry/rtree.h>
37#include <geometry/shape.h>
39#include <math/vector2d.h>
40#include "geometry/shape_null.h"
41#include "board.h"
42
48{
49
50public:
51
53 {
54 ITEM_WITH_SHAPE( BOARD_ITEM *aParent, const SHAPE* aShape,
55 std::shared_ptr<SHAPE> aParentShape = nullptr ) :
56 parent( aParent ),
57 shape( aShape ),
58 shapeStorage( nullptr ),
59 parentShape( std::move( aParentShape ) )
60 {};
61
62 ITEM_WITH_SHAPE( BOARD_ITEM *aParent, const std::shared_ptr<SHAPE>& aShape,
63 std::shared_ptr<SHAPE> aParentShape = nullptr ) :
64 parent( aParent ),
65 shape( aShape.get() ),
66 shapeStorage( aShape ),
67 parentShape( std::move( aParentShape ) )
68 {};
69
71 const SHAPE* shape;
72 std::shared_ptr<SHAPE> shapeStorage;
73 std::shared_ptr<SHAPE> parentShape;
74 };
75
76private:
77
78 using drc_rtree = RTree<ITEM_WITH_SHAPE*, int, 2, double>;
79
80public:
81
83 {
84 for( int layer : LSET::AllLayersMask().Seq() )
85 m_tree[layer] = new drc_rtree();
86
87 m_count = 0;
88 }
89
91 {
92 for( auto& [_, tree] : m_tree )
93 {
94 for( DRC_RTREE::ITEM_WITH_SHAPE* el : *tree )
95 delete el;
96
97 delete tree;
98 }
99 }
100
104 void Insert( BOARD_ITEM* aItem, PCB_LAYER_ID aLayer, int aWorstClearance = 0 )
105 {
106 Insert( aItem, aLayer, aLayer, aWorstClearance );
107 }
108
113 void Insert( BOARD_ITEM* aItem, PCB_LAYER_ID aRefLayer, PCB_LAYER_ID aTargetLayer,
114 int aWorstClearance )
115 {
116 wxCHECK( aTargetLayer != UNDEFINED_LAYER, /* void */ );
117
118 if( aItem->Type() == PCB_FIELD_T && !static_cast<PCB_FIELD*>( aItem )->IsVisible() )
119 return;
120
121 std::vector<const SHAPE*> subshapes;
122 std::shared_ptr<SHAPE> shape = aItem->GetEffectiveShape( aRefLayer );
123
124 wxCHECK2_MSG( shape, return, wxT( "Item does not have a valid shape for this layer" ) );
125
126 if( shape->HasIndexableSubshapes() )
127 shape->GetIndexableSubshapes( subshapes );
128 else
129 subshapes.push_back( shape.get() );
130
131 for( const SHAPE* subshape : subshapes )
132 {
133 if( dynamic_cast<const SHAPE_NULL*>( subshape ) )
134 continue;
135
136 BOX2I bbox = subshape->BBox();
137
138 bbox.Inflate( aWorstClearance );
139
140 const int mmin[2] = { bbox.GetX(), bbox.GetY() };
141 const int mmax[2] = { bbox.GetRight(), bbox.GetBottom() };
142 ITEM_WITH_SHAPE* itemShape = new ITEM_WITH_SHAPE( aItem, subshape, shape );
143
144 m_tree[aTargetLayer]->Insert( mmin, mmax, itemShape );
145 m_count++;
146 }
147
148 if( aItem->Type() == PCB_PAD_T && aItem->HasHole() )
149 {
150 std::shared_ptr<SHAPE_SEGMENT> hole = aItem->GetEffectiveHoleShape();
151 BOX2I bbox = hole->BBox();
152
153 bbox.Inflate( aWorstClearance );
154
155 const int mmin[2] = { bbox.GetX(), bbox.GetY() };
156 const int mmax[2] = { bbox.GetRight(), bbox.GetBottom() };
157 ITEM_WITH_SHAPE* itemShape = new ITEM_WITH_SHAPE( aItem, hole, shape );
158
159 m_tree[aTargetLayer]->Insert( mmin, mmax, itemShape );
160 m_count++;
161 }
162 }
163
167 void clear()
168 {
169 for( auto& [_, tree] : m_tree )
170 tree->RemoveAll();
171
172 m_count = 0;
173 }
174
175 bool CheckColliding( SHAPE* aRefShape, PCB_LAYER_ID aTargetLayer, int aClearance = 0,
176 std::function<bool( BOARD_ITEM*)> aFilter = nullptr ) const
177 {
178 BOX2I box = aRefShape->BBox();
179 box.Inflate( aClearance );
180
181 int min[2] = { box.GetX(), box.GetY() };
182 int max[2] = { box.GetRight(), box.GetBottom() };
183
184 int count = 0;
185
186 auto visit =
187 [&] ( ITEM_WITH_SHAPE* aItem ) -> bool
188 {
189 if( !aFilter || aFilter( aItem->parent ) )
190 {
191 int actual;
192
193 if( aRefShape->Collide( aItem->shape, aClearance, &actual ) )
194 {
195 count++;
196 return false;
197 }
198 }
199
200 return true;
201 };
202
203 if( auto it = m_tree.find( aTargetLayer ); it != m_tree.end() )
204 it->second->Search( min, max, visit );
205
206 return count > 0;
207 }
208
214 int QueryColliding( BOARD_ITEM* aRefItem, PCB_LAYER_ID aRefLayer, PCB_LAYER_ID aTargetLayer,
215 std::function<bool( BOARD_ITEM* )> aFilter = nullptr,
216 std::function<bool( BOARD_ITEM* )> aVisitor = nullptr,
217 int aClearance = 0 ) const
218 {
219 // keep track of BOARD_ITEMs that have already been found to collide (some items might
220 // be built of COMPOUND/triangulated shapes and a single subshape collision means we have
221 // a hit)
222 std::unordered_set<BOARD_ITEM*> collidingCompounds;
223
224 // keep track of results of client filter so we don't ask more than once for compound
225 // shapes
226 std::unordered_map<BOARD_ITEM*, bool> filterResults;
227
228 BOX2I box = aRefItem->GetBoundingBox();
229 box.Inflate( aClearance );
230
231 int min[2] = { box.GetX(), box.GetY() };
232 int max[2] = { box.GetRight(), box.GetBottom() };
233
234 std::shared_ptr<SHAPE> refShape = aRefItem->GetEffectiveShape( aRefLayer );
235
236 int count = 0;
237
238 auto visit =
239 [&]( ITEM_WITH_SHAPE* aItem ) -> bool
240 {
241 if( aItem->parent == aRefItem )
242 return true;
243
244 if( collidingCompounds.find( aItem->parent ) != collidingCompounds.end() )
245 return true;
246
247 bool filtered;
248 auto it = filterResults.find( aItem->parent );
249
250 if( it == filterResults.end() )
251 {
252 filtered = aFilter && !aFilter( aItem->parent );
253 filterResults[ aItem->parent ] = filtered;
254 }
255 else
256 {
257 filtered = it->second;
258 }
259
260 if( filtered )
261 return true;
262
263 wxCHECK( aItem->shape, false );
264
265 if( refShape->Collide( aItem->shape, aClearance ) )
266 {
267 collidingCompounds.insert( aItem->parent );
268 count++;
269
270 if( aVisitor )
271 return aVisitor( aItem->parent );
272 }
273
274 return true;
275 };
276
277 if( auto it = m_tree.find( aTargetLayer ); it != m_tree.end() )
278 it->second->Search( min, max, visit );
279
280 return count;
281 }
282
289 bool QueryColliding( const BOX2I& aBox, SHAPE* aRefShape, PCB_LAYER_ID aLayer, int aClearance,
290 int* aActual, VECTOR2I* aPos ) const
291 {
292 BOX2I bbox = aBox;
293 bbox.Inflate( aClearance );
294
295 int min[2] = { bbox.GetX(), bbox.GetY() };
296 int max[2] = { bbox.GetRight(), bbox.GetBottom() };
297
298 bool collision = false;
299 int actual = INT_MAX;
300 VECTOR2I pos;
301
302 auto visit =
303 [&]( ITEM_WITH_SHAPE* aItem ) -> bool
304 {
305 int curActual;
306 VECTOR2I curPos;
307
308 if( aRefShape->Collide( aItem->shape, aClearance, &curActual, &curPos ) )
309 {
310 collision = true;
311
312 if( curActual < actual )
313 {
314 actual = curActual;
315 pos = curPos;
316 }
317
318 // Stop looking after we have a true collision
319 if( actual <= 0 )
320 return false;
321 }
322
323 return true;
324 };
325
326 if( auto it = m_tree.find( aLayer ); it != m_tree.end() )
327 it->second->Search( min, max, visit );
328
329 if( collision )
330 {
331 if( aActual )
332 *aActual = std::max( 0, actual );
333
334 if( aPos )
335 *aPos = pos;
336
337 return true;
338 }
339
340 return false;
341 }
342
346 bool QueryColliding( const BOX2I& aBox, SHAPE* aRefShape, PCB_LAYER_ID aLayer ) const
347 {
348 SHAPE_POLY_SET* poly = dynamic_cast<SHAPE_POLY_SET*>( aRefShape );
349
350 int min[2] = { aBox.GetX(), aBox.GetY() };
351 int max[2] = { aBox.GetRight(), aBox.GetBottom() };
352 bool collision = false;
353
354 // Special case the polygon case. Otherwise we'll call its Collide() method which will
355 // triangulate it as well and then do triangle/triangle collisions. This ends up being
356 // *much* slower than 3 segment Collide()s and a PointInside().
357 auto polyVisitor =
358 [&]( ITEM_WITH_SHAPE* aItem ) -> bool
359 {
360 const SHAPE* shape = aItem->shape;
361
362 // There are certain degenerate cases that result in empty zone fills, which
363 // will be represented in the rtree with only a root (and no triangles).
364 // https://gitlab.com/kicad/code/kicad/-/issues/18600
365 if( shape->Type() != SH_POLY_SET_TRIANGLE )
366 return true;
367
368 auto tri = static_cast<const SHAPE_POLY_SET::TRIANGULATED_POLYGON::TRI*>( shape );
369
370 const SHAPE_LINE_CHAIN& outline = poly->Outline( 0 );
371
372 for( int ii = 0; ii < (int) tri->GetSegmentCount(); ++ii )
373 {
374 if( outline.Collide( tri->GetSegment( ii ) ) )
375 {
376 collision = true;
377 return false;
378 }
379 }
380
381 // Also must check for poly being completely inside the triangle
382 if( tri->PointInside( outline.CPoint( 0 ) ) )
383 {
384 collision = true;
385 return false;
386 }
387
388 return true;
389 };
390
391 auto visitor =
392 [&]( ITEM_WITH_SHAPE* aItem ) -> bool
393 {
394 if( aRefShape->Collide( aItem->shape, 0 ) )
395 {
396 collision = true;
397 return false;
398 }
399
400 return true;
401 };
402 auto it = m_tree.find( aLayer );
403
404 if( it == m_tree.end() )
405 return false;
406
407 if( poly && poly->OutlineCount() == 1 && poly->HoleCount( 0 ) == 0 )
408 it->second->Search( min, max, polyVisitor );
409 else
410 it->second->Search( min, max, visitor );
411
412 return collision;
413 }
414
421 std::unordered_set<BOARD_ITEM*> GetObjectsAt( const VECTOR2I& aPt, PCB_LAYER_ID aLayer,
422 int aClearance = 0 )
423 {
424 std::unordered_set<BOARD_ITEM*> retval;
425 int min[2] = { aPt.x - aClearance, aPt.y - aClearance };
426 int max[2] = { aPt.x + aClearance, aPt.y + aClearance };
427
428 auto visitor =
429 [&]( ITEM_WITH_SHAPE* aItem ) -> bool
430 {
431 retval.insert( aItem->parent );
432 return true;
433 };
434
435 m_tree[aLayer]->Search( min, max, visitor );
436
437 return retval;
438 }
439
440 typedef std::pair<PCB_LAYER_ID, PCB_LAYER_ID> LAYER_PAIR;
441
443 {
445 layerPair( aPair ),
446 refItem( aRef ),
447 testItem( aTest )
448 { };
449
453 };
454
455 int QueryCollidingPairs( DRC_RTREE* aRefTree, std::vector<LAYER_PAIR> aLayerPairs,
456 std::function<bool( const LAYER_PAIR&, ITEM_WITH_SHAPE*,
457 ITEM_WITH_SHAPE*, bool* aCollision )> aVisitor,
458 int aMaxClearance,
459 std::function<bool(int, int )> aProgressReporter ) const
460 {
461 std::vector<PAIR_INFO> pairsToVisit;
462
463 for( LAYER_PAIR& layerPair : aLayerPairs )
464 {
465 const PCB_LAYER_ID refLayer = layerPair.first;
466 const PCB_LAYER_ID targetLayer = layerPair.second;
467
468 for( ITEM_WITH_SHAPE* refItem : aRefTree->OnLayer( refLayer ) )
469 {
470 BOX2I box = refItem->shape->BBox();
471 box.Inflate( aMaxClearance );
472
473 int min[2] = { box.GetX(), box.GetY() };
474 int max[2] = { box.GetRight(), box.GetBottom() };
475
476 auto visit =
477 [&]( ITEM_WITH_SHAPE* aItemToTest ) -> bool
478 {
479 // don't collide items against themselves
480 if( aItemToTest->parent == refItem->parent )
481 return true;
482
483 pairsToVisit.emplace_back( layerPair, refItem, aItemToTest );
484 return true;
485 };
486
487 auto it = m_tree.find( targetLayer );
488
489 if( it != m_tree.end() )
490 it->second->Search( min, max, visit );
491 };
492 }
493
494 // keep track of BOARD_ITEMs pairs that have been already found to collide (some items
495 // might be build of COMPOUND/triangulated shapes and a single subshape collision
496 // means we have a hit)
497 std::unordered_map<PTR_PTR_CACHE_KEY, int> collidingCompounds;
498
499 int progress = 0;
500 int count = pairsToVisit.size();
501
502 for( const PAIR_INFO& pair : pairsToVisit )
503 {
504 if( !aProgressReporter( progress++, count ) )
505 break;
506
507 BOARD_ITEM* a = pair.refItem->parent;
508 BOARD_ITEM* b = pair.testItem->parent;
509
510 // store canonical order so we don't collide in both directions (a:b and b:a)
511 if( static_cast<void*>( a ) > static_cast<void*>( b ) )
512 std::swap( a, b );
513
514 // don't report multiple collisions for compound or triangulated shapes
515 if( collidingCompounds.count( { a, b } ) )
516 continue;
517
518 bool collisionDetected = false;
519
520 if( !aVisitor( pair.layerPair, pair.refItem, pair.testItem, &collisionDetected ) )
521 break;
522
523 if( collisionDetected )
524 collidingCompounds[ { a, b } ] = 1;
525 }
526
527 return 0;
528 }
529
535 size_t size() const
536 {
537 return m_count;
538 }
539
540 bool empty() const
541 {
542 return m_count == 0;
543 }
544
545 using iterator = typename drc_rtree::Iterator;
546
556 {
557 DRC_LAYER( drc_rtree* aTree ) : layer_tree( aTree )
558 {
559 m_rect = { { INT_MIN, INT_MIN }, { INT_MAX, INT_MAX } };
560 };
561
562 DRC_LAYER( drc_rtree* aTree, const BOX2I& aRect ) : layer_tree( aTree )
563 {
564 m_rect = { { aRect.GetX(), aRect.GetY() },
565 { aRect.GetRight(), aRect.GetBottom() } };
566 };
567
568 drc_rtree::Rect m_rect;
570
572 {
573 return layer_tree->begin( m_rect );
574 }
575
577 {
578 return layer_tree->end( m_rect );
579 }
580 };
581
583 {
584 auto it = m_tree.find( int( aLayer ) );
585 return it == m_tree.end() ? DRC_LAYER( nullptr ) : DRC_LAYER( it->second );
586 }
587
588 DRC_LAYER Overlapping( PCB_LAYER_ID aLayer, const VECTOR2I& aPoint, int aAccuracy = 0 ) const
589 {
590 BOX2I rect( aPoint, VECTOR2I( 0, 0 ) );
591 rect.Inflate( aAccuracy );
592 auto it = m_tree.find( int( aLayer ) );
593 return it == m_tree.end() ? DRC_LAYER( nullptr ) : DRC_LAYER( it->second, rect );
594 }
595
596 DRC_LAYER Overlapping( PCB_LAYER_ID aLayer, const BOX2I& aRect ) const
597 {
598 auto it = m_tree.find( int( aLayer ) );
599 return it == m_tree.end() ? DRC_LAYER( nullptr ) : DRC_LAYER( it->second, aRect );
600 }
601
602
603private:
604 std::map<int, drc_rtree*> m_tree;
605 size_t m_count;
606};
607
608
609#endif /* DRC_RTREE_H_ */
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
Definition: board_item.h:79
virtual std::shared_ptr< SHAPE > GetEffectiveShape(PCB_LAYER_ID aLayer=UNDEFINED_LAYER, FLASHING aFlash=FLASHING::DEFAULT) const
Some pad shapes can be complex (rounded/chamfered rectangle), even without considering custom shapes.
Definition: board_item.cpp:278
virtual std::shared_ptr< SHAPE_SEGMENT > GetEffectiveHoleShape() const
Definition: board_item.cpp:288
virtual bool HasHole() const
Definition: board_item.h:155
constexpr BOX2< Vec > & Inflate(coord_type dx, coord_type dy)
Inflates the rectangle horizontally by dx and vertically by dy.
Definition: box2.h:558
constexpr coord_type GetY() const
Definition: box2.h:208
constexpr coord_type GetX() const
Definition: box2.h:207
constexpr coord_type GetRight() const
Definition: box2.h:217
constexpr coord_type GetBottom() const
Definition: box2.h:222
Implement an R-tree for fast spatial and layer indexing of connectable items.
Definition: drc_rtree.h:48
DRC_LAYER OnLayer(PCB_LAYER_ID aLayer) const
Definition: drc_rtree.h:582
void Insert(BOARD_ITEM *aItem, PCB_LAYER_ID aLayer, int aWorstClearance=0)
Insert an item into the tree on a particular layer with an optional worst clearance.
Definition: drc_rtree.h:104
void Insert(BOARD_ITEM *aItem, PCB_LAYER_ID aRefLayer, PCB_LAYER_ID aTargetLayer, int aWorstClearance)
Insert an item into the tree on a particular layer with a worst clearance.
Definition: drc_rtree.h:113
RTree< ITEM_WITH_SHAPE *, int, 2, double > drc_rtree
Definition: drc_rtree.h:78
size_t size() const
Return the number of items in the tree.
Definition: drc_rtree.h:535
typename drc_rtree::Iterator iterator
Definition: drc_rtree.h:545
bool empty() const
Definition: drc_rtree.h:540
int QueryColliding(BOARD_ITEM *aRefItem, PCB_LAYER_ID aRefLayer, PCB_LAYER_ID aTargetLayer, std::function< bool(BOARD_ITEM *)> aFilter=nullptr, std::function< bool(BOARD_ITEM *)> aVisitor=nullptr, int aClearance=0) const
This is a fast test which essentially does bounding-box overlap given a worst-case clearance.
Definition: drc_rtree.h:214
DRC_RTREE()
Definition: drc_rtree.h:82
bool CheckColliding(SHAPE *aRefShape, PCB_LAYER_ID aTargetLayer, int aClearance=0, std::function< bool(BOARD_ITEM *)> aFilter=nullptr) const
Definition: drc_rtree.h:175
~DRC_RTREE()
Definition: drc_rtree.h:90
DRC_LAYER Overlapping(PCB_LAYER_ID aLayer, const BOX2I &aRect) const
Definition: drc_rtree.h:596
std::unordered_set< BOARD_ITEM * > GetObjectsAt(const VECTOR2I &aPt, PCB_LAYER_ID aLayer, int aClearance=0)
Gets the BOARD_ITEMs that overlap the specified point/layer.
Definition: drc_rtree.h:421
bool QueryColliding(const BOX2I &aBox, SHAPE *aRefShape, PCB_LAYER_ID aLayer) const
Quicker version of above that just reports a raw yes/no.
Definition: drc_rtree.h:346
void clear()
Remove all items from the RTree.
Definition: drc_rtree.h:167
std::pair< PCB_LAYER_ID, PCB_LAYER_ID > LAYER_PAIR
Definition: drc_rtree.h:440
std::map< int, drc_rtree * > m_tree
Definition: drc_rtree.h:604
size_t m_count
Definition: drc_rtree.h:605
DRC_LAYER Overlapping(PCB_LAYER_ID aLayer, const VECTOR2I &aPoint, int aAccuracy=0) const
Definition: drc_rtree.h:588
int QueryCollidingPairs(DRC_RTREE *aRefTree, std::vector< LAYER_PAIR > aLayerPairs, std::function< bool(const LAYER_PAIR &, ITEM_WITH_SHAPE *, ITEM_WITH_SHAPE *, bool *aCollision)> aVisitor, int aMaxClearance, std::function< bool(int, int)> aProgressReporter) const
Definition: drc_rtree.h:455
bool QueryColliding(const BOX2I &aBox, SHAPE *aRefShape, PCB_LAYER_ID aLayer, int aClearance, int *aActual, VECTOR2I *aPos) const
This one is for tessellated items.
Definition: drc_rtree.h:289
virtual const BOX2I GetBoundingBox() const
Return the orthogonal bounding box of this object for display purposes.
Definition: eda_item.cpp:77
KICAD_T Type() const
Returns the type of object.
Definition: eda_item.h:101
virtual bool IsVisible() const
Definition: eda_text.h:174
static LSET AllLayersMask()
Definition: lset.cpp:593
SHAPE_TYPE Type() const
Return the type of the shape.
Definition: shape.h:98
Represent a polyline containing arcs as well as line segments: A chain of connected line and/or arc s...
virtual bool Collide(const VECTOR2I &aP, int aClearance=0, int *aActual=nullptr, VECTOR2I *aLocation=nullptr) const override
Check if point aP lies closer to us than aClearance.
const VECTOR2I & CPoint(int aIndex) const
Return a reference to a given point in the line chain.
Represent a set of closed polygons.
int HoleCount(int aOutline) const
Returns the number of holes in a given outline.
SHAPE_LINE_CHAIN & Outline(int aIndex)
Return the reference to aIndex-th outline in the set.
int OutlineCount() const
Return the number of outlines in the set.
An abstract shape on 2D plane.
Definition: shape.h:126
virtual bool Collide(const VECTOR2I &aP, int aClearance=0, int *aActual=nullptr, VECTOR2I *aLocation=nullptr) const
Check if the boundary of shape (this) lies closer to the point aP than aClearance,...
Definition: shape.h:181
virtual const BOX2I BBox(int aClearance=0) const =0
Compute a bounding box of the shape, with a margin of aClearance a collision.
#define _(s)
PCB_LAYER_ID
A quick note on layer IDs:
Definition: layer_ids.h:60
@ UNDEFINED_LAYER
Definition: layer_ids.h:61
STL namespace.
@ SH_POLY_SET_TRIANGLE
a single triangle belonging to a POLY_SET triangulation
Definition: shape.h:56
The DRC_LAYER struct provides a layer-specific auto-range iterator to the RTree.
Definition: drc_rtree.h:556
iterator begin()
Definition: drc_rtree.h:571
drc_rtree::Rect m_rect
Definition: drc_rtree.h:568
drc_rtree * layer_tree
Definition: drc_rtree.h:569
DRC_LAYER(drc_rtree *aTree)
Definition: drc_rtree.h:557
DRC_LAYER(drc_rtree *aTree, const BOX2I &aRect)
Definition: drc_rtree.h:562
ITEM_WITH_SHAPE(BOARD_ITEM *aParent, const SHAPE *aShape, std::shared_ptr< SHAPE > aParentShape=nullptr)
Definition: drc_rtree.h:54
std::shared_ptr< SHAPE > parentShape
Definition: drc_rtree.h:73
ITEM_WITH_SHAPE(BOARD_ITEM *aParent, const std::shared_ptr< SHAPE > &aShape, std::shared_ptr< SHAPE > aParentShape=nullptr)
Definition: drc_rtree.h:62
std::shared_ptr< SHAPE > shapeStorage
Definition: drc_rtree.h:72
ITEM_WITH_SHAPE * refItem
Definition: drc_rtree.h:451
PAIR_INFO(LAYER_PAIR aPair, ITEM_WITH_SHAPE *aRef, ITEM_WITH_SHAPE *aTest)
Definition: drc_rtree.h:444
ITEM_WITH_SHAPE * testItem
Definition: drc_rtree.h:452
LAYER_PAIR layerPair
Definition: drc_rtree.h:450
int actual
@ PCB_FIELD_T
class PCB_FIELD, text associated with a footprint property
Definition: typeinfo.h:90
@ PCB_PAD_T
class PAD, a pad in a footprint
Definition: typeinfo.h:87
VECTOR2< int32_t > VECTOR2I
Definition: vector2d.h:695