| 
    KiCad PCB EDA Suite
    
   | 
 
Implement an R-tree for fast spatial and type indexing of schematic items. More...
#include <sch_rtree.h>
Classes | |
| struct | EE_TYPE | 
| The EE_TYPE struct provides a type-specific auto-range iterator to the RTree.  More... | |
Public Types | |
| using | iterator = typename ee_rtree::Iterator | 
Public Member Functions | |
| EE_RTREE () | |
| ~EE_RTREE () | |
| void | insert (SCH_ITEM *aItem) | 
| Insert an item into the tree.   | |
| bool | remove (SCH_ITEM *aItem) | 
| Remove an item from the tree.   | |
| void | clear () | 
| Remove all items from the RTree.   | |
| bool | contains (const SCH_ITEM *aItem, bool aRobust=false) const | 
| Determine if a given item exists in the tree.   | |
| size_t | size () const | 
| Return the number of items in the tree.   | |
| bool | empty () const | 
| EE_TYPE | OfType (KICAD_T aType) const | 
| EE_TYPE | Overlapping (const BOX2I &aRect) const | 
| EE_TYPE | Overlapping (const VECTOR2I &aPoint, int aAccuracy=0) const | 
| EE_TYPE | Overlapping (KICAD_T aType, const VECTOR2I &aPoint, int aAccuracy=0) const | 
| EE_TYPE | Overlapping (KICAD_T aType, const BOX2I &aRect) const | 
| iterator | begin () | 
| Return a read/write iterator that points to the first.   | |
| iterator | end () | 
| Return a read/write iterator that points to one past the last element in the EE_RTREE.   | |
| const iterator | begin () const | 
| const iterator | end () const | 
Private Types | |
| using | ee_rtree = RTree<SCH_ITEM*, int, 3, double> | 
Private Attributes | |
| ee_rtree * | m_tree | 
| size_t | m_count | 
Implement an R-tree for fast spatial and type indexing of schematic items.
Non-owning.
Definition at line 39 of file sch_rtree.h.
      
  | 
  private | 
Definition at line 42 of file sch_rtree.h.
| using EE_RTREE::iterator = typename ee_rtree::Iterator | 
Definition at line 184 of file sch_rtree.h.
      
  | 
  inline | 
Definition at line 45 of file sch_rtree.h.
      
  | 
  inline | 
Definition at line 51 of file sch_rtree.h.
References m_tree.
      
  | 
  inline | 
Return a read/write iterator that points to the first.
element in the EE_RTREE.
Definition at line 281 of file sch_rtree.h.
References m_tree.
Referenced by API_HANDLER_SCH::handleCreateUpdateItemsInternal(), CADSTAR_SCH_ARCHIVE_LOADER::Load(), and SCH_IO_EAGLE::loadSheet().
      
  | 
  inline | 
Definition at line 295 of file sch_rtree.h.
References m_tree.
      
  | 
  inline | 
Remove all items from the RTree.
Definition at line 112 of file sch_rtree.h.
      
  | 
  inline | 
Determine if a given item exists in the tree.
| aItem | Item that may potentially exist in the tree. | 
| aRobust | If true, search the whole tree, not just the bounding box. | 
Definition at line 128 of file sch_rtree.h.
References BOX2< Vec >::GetBottom(), EDA_ITEM::GetBoundingBox(), SCH_ITEM::GetPenWidth(), BOX2< Vec >::GetRight(), BOX2< Vec >::GetX(), BOX2< Vec >::GetY(), BOX2< Vec >::Inflate(), m_tree, and EDA_ITEM::Type().
Referenced by SCH_EDIT_FRAME::onNetNavigatorSelection().
      
  | 
  inline | 
Definition at line 179 of file sch_rtree.h.
References m_count.
Referenced by SCH_EDIT_FRAME::setupUIConditions().
      
  | 
  inline | 
Return a read/write iterator that points to one past the last element in the EE_RTREE.
Definition at line 289 of file sch_rtree.h.
References m_tree.
Referenced by API_HANDLER_SCH::handleCreateUpdateItemsInternal(), CADSTAR_SCH_ARCHIVE_LOADER::Load(), and SCH_IO_EAGLE::loadSheet().
      
  | 
  inline | 
Definition at line 300 of file sch_rtree.h.
References m_tree.
      
  | 
  inline | 
Insert an item into the tree.
Item's bounding box is taken via its BBox() method.
Definition at line 59 of file sch_rtree.h.
References BOX2< Vec >::GetBottom(), EDA_ITEM::GetBoundingBox(), SCH_ITEM::GetPenWidth(), BOX2< Vec >::GetRight(), BOX2< Vec >::GetX(), BOX2< Vec >::GetY(), BOX2< Vec >::Inflate(), m_count, m_tree, and EDA_ITEM::Type().
Referenced by JUNCTION_HELPERS::AnalyzePoint().
Definition at line 241 of file sch_rtree.h.
References m_tree.
Referenced by SCH_IO_EAGLE::addBusEntries(), SCH_SHEET_LIST::AnnotatePowerSymbols(), SCH_EDIT_FRAME::AutoRotateItem(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), SCH_LINE_WIRE_BUS_TOOL::BreakSegmentsOnJunctions(), CONNECTION_GRAPH::buildConnectionGraph(), SCH_SCREENS::buildScreenList(), SCH_SCREENS::ChangeSymbolLibNickname(), SCHEMATIC::CleanUp(), SCH_IO_ALTIUM::CreateAliases(), findItemsFromSyncSelection(), SCH_EDITOR_CONTROL::FindSymbolAndItem(), SCH_DRAWING_TOOLS::importHierLabel(), SCH_DRAWING_TOOLS::importHierLabels(), KI_TEST::LoadHierarchy(), SCH_IO_KICAD_LEGACY::loadHierarchy(), SCH_IO_KICAD_SEXPR::loadHierarchy(), SCH_IO_EAGLE::loadModuleInstance(), SCH_IO_EAGLE::loadSheet(), DIALOG_SHEET_PIN_PROPERTIES::onComboBox(), SCH_IO_ALTIUM::ParseAltiumSch(), SCH_IO_ALTIUM::ParseSheetName(), DIALOG_CHANGE_SYMBOLS::processMatchingSymbols(), DIALOG_SYMBOL_REMAP::remapSymbolsToLibTable(), SCH_EDITOR_CONTROL::RepairSchematic(), SCH_EDIT_FRAME::SaveProject(), SCH_LABEL_BASE::SetLabelShape(), ERC_TESTER::TestFourWayJunction(), ERC_TESTER::TestGroundPins(), ERC_TESTER::TestStackedPinNotation(), ERC_TESTER::TestTextVars(), DIALOG_SHEET_PIN_PROPERTIES::TransferDataToWindow(), DIALOG_CHANGE_SYMBOLS::updateFieldsList(), and SCH_SHEET_LIST::UpdateSymbolInstanceData().
Definition at line 246 of file sch_rtree.h.
References m_tree, and SCH_LOCATE_ANY_T.
Referenced by SCH_DRAG_NET_COLLISION_MONITOR::analyzeJunction(), JUNCTION_HELPERS::AnalyzePoint(), SCH_LINE::BuildWireWithHopShape(), SCH_COLLECTOR::Collect(), SCH_IO_ALTIUM::CreateAliases(), SCH_EDIT_FRAME::DeleteJunction(), SCH_LINE_WIRE_BUS_TOOL::doUnfoldBus(), CONNECTION_GRAPH::ercCheckNoConnects(), SCH_MOVE_TOOL::getConnectedDragItems(), SCH_MOVE_TOOL::getConnectedItems(), SCH_LINE_WIRE_BUS_TOOL::getSheetPin(), SCH_IO_EAGLE::moveLabels(), SCH_DRAG_NET_COLLISION_MONITOR::recordOriginalConnections(), SCH_RULE_AREA::RefreshContainedItemsAndDirectives(), SCH_LINE_WIRE_BUS_TOOL::TrimOverLappingWires(), SCH_EDIT_FRAME::TrimWire(), and CONNECTION_GRAPH::updateItemConnectivity().
Definition at line 251 of file sch_rtree.h.
References BOX2< Vec >::Inflate(), m_tree, and SCH_LOCATE_ANY_T.
Definition at line 265 of file sch_rtree.h.
References m_tree.
      
  | 
  inline | 
Definition at line 258 of file sch_rtree.h.
References BOX2< Vec >::Inflate(), and m_tree.
      
  | 
  inline | 
Remove an item from the tree.
Removal is done by comparing pointers, attempting to remove a copy of the item will fail.
Definition at line 79 of file sch_rtree.h.
References BOX2< Vec >::GetBottom(), EDA_ITEM::GetBoundingBox(), SCH_ITEM::GetPenWidth(), BOX2< Vec >::GetRight(), BOX2< Vec >::GetX(), BOX2< Vec >::GetY(), BOX2< Vec >::Inflate(), m_count, m_tree, and EDA_ITEM::Type().
      
  | 
  inline | 
Return the number of items in the tree.
Definition at line 174 of file sch_rtree.h.
References m_count.
Referenced by JUNCTION_HELPERS::AnalyzePoint(), and SCH_DRAG_NET_COLLISION_MONITOR::Initialize().
      
  | 
  private | 
Definition at line 308 of file sch_rtree.h.
Referenced by clear(), EE_RTREE(), empty(), insert(), remove(), and size().
      
  | 
  private | 
Definition at line 307 of file sch_rtree.h.
Referenced by begin(), begin(), clear(), contains(), EE_RTREE(), end(), end(), insert(), OfType(), Overlapping(), Overlapping(), Overlapping(), Overlapping(), remove(), and ~EE_RTREE().