![]() |
KiCad PCB EDA Suite
|
EE_RTREE - Implements 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) |
Function Insert() Inserts an item into the tree. More... | |
bool | remove (SCH_ITEM *aItem) |
Function Remove() Removes an item from the tree. More... | |
void | clear () |
Function RemoveAll() Removes all items from the RTree. More... | |
bool | contains (const SCH_ITEM *aItem, bool aRobust=false) const |
Determine if a given item exists in the tree. More... | |
size_t | size () const |
Returns the number of items in the tree. More... | |
bool | empty () const |
EE_TYPE | OfType (KICAD_T aType) const |
EE_TYPE | Overlapping (const EDA_RECT &aRect) |
EE_TYPE | Overlapping (const wxPoint &aPoint, int aAccuracy=0) |
EE_TYPE | Overlapping (KICAD_T aType, const wxPoint &aPoint, int aAccuracy=0) |
EE_TYPE | Overlapping (KICAD_T aType, const EDA_RECT &aRect) |
iterator | begin () |
iterator | end () |
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 |
EE_RTREE - Implements an R-tree for fast spatial and type indexing of schematic items.
Non-owning.
Definition at line 41 of file sch_rtree.h.
|
private |
Definition at line 44 of file sch_rtree.h.
using EE_RTREE::iterator = typename ee_rtree::Iterator |
Definition at line 171 of file sch_rtree.h.
|
inline |
Definition at line 47 of file sch_rtree.h.
|
inline |
Definition at line 53 of file sch_rtree.h.
References m_tree.
|
inline |
Definition at line 248 of file sch_rtree.h.
References m_tree.
Referenced by SCH_SCREEN::FreeDrawList(), and CADSTAR_SCH_ARCHIVE_LOADER::Load().
|
inline |
Definition at line 259 of file sch_rtree.h.
References m_tree.
|
inline |
Function RemoveAll() Removes all items from the RTree.
Definition at line 108 of file sch_rtree.h.
References m_count, and m_tree.
Referenced by SCH_SCREEN::Clear(), and SCH_SCREEN::FreeDrawList().
|
inline |
Determine if a given item exists in the tree.
Note that this does not search the full tree so if the item has been moved, this will return false when it should be true.
aItem | Item that may potentially exist in the tree |
aRobust | If true, search the whole tree, not just the bounding box |
Definition at line 122 of file sch_rtree.h.
References EDA_RECT::GetBottom(), EDA_ITEM::GetBoundingBox(), EDA_RECT::GetRight(), EDA_RECT::GetX(), EDA_RECT::GetY(), m_tree, and EDA_ITEM::Type().
Referenced by SCH_SCREEN::CheckIfOnDrawList().
|
inline |
Definition at line 166 of file sch_rtree.h.
References m_count.
Referenced by SCH_EDIT_TOOL::Init(), SCH_SCREEN::IsEmpty(), and SCH_EDIT_FRAME::setupUIConditions().
|
inline |
Definition at line 253 of file sch_rtree.h.
References m_tree.
Referenced by SCH_SCREEN::FreeDrawList(), and CADSTAR_SCH_ARCHIVE_LOADER::Load().
|
inline |
Definition at line 264 of file sch_rtree.h.
References m_tree.
|
inline |
Function Insert() Inserts an item into the tree.
Item's bounding box is taken via its BBox() method.
Definition at line 62 of file sch_rtree.h.
References EDA_RECT::GetBottom(), EDA_ITEM::GetBoundingBox(), EDA_RECT::GetRight(), EDA_RECT::GetX(), EDA_RECT::GetY(), m_count, m_tree, and EDA_ITEM::Type().
Referenced by SCH_SCREEN::Append(), and SCH_SCREEN::UpdateLocalLibSymbolLinks().
Definition at line 219 of file sch_rtree.h.
References m_tree.
Referenced by SCH_SHEET_LIST::AnnotatePowerSymbols(), SCH_EDIT_FRAME::BreakSegmentsOnJunctions(), CONNECTION_GRAPH::buildConnectionGraph(), SCH_SCREENS::buildScreenList(), SCH_SCREENS::ChangeSymbolLibNickname(), SCH_SHEET::CleanupSheet(), EE_COLLECTOR::Collect(), SCH_SHEET::CountSheets(), SCH_EDIT_FRAME::DeleteAnnotation(), SCH_EDITOR_CONTROL::FindComponentAndItem(), SCH_LINE_WIRE_BUS_TOOL::finishSegments(), SCH_EDIT_FRAME::FixupJunctions(), SCH_SCREEN::HasItems(), SCH_SCREENS::HasNoFullyDefinedLibIds(), SCH_SHEET::HasUndefinedPins(), SCH_DRAWING_TOOLS::importHierLabel(), SCH_SEXPR_PLUGIN::loadHierarchy(), SCH_LEGACY_PLUGIN::loadHierarchy(), SCH_EDIT_FRAME::LoadSheetFromFile(), SCH_SHEET::LocatePathOfScreen(), EDIT_POINTS_FACTORY::Make(), NETLIST_EXPORTER_XML::makeSymbols(), DIALOG_SHEET_PIN_PROPERTIES::onComboBox(), DIALOG_ERC::OnERCItemRClick(), DIALOG_CHANGE_SYMBOLS::processMatchingSymbols(), NETLIST_EXPORTER_PSPICE::ProcessNetlist(), DIALOG_SYMBOL_REMAP::remapSymbolsToLibTable(), SCH_SHEET_LIST::ReplaceLegacySheetPaths(), SCH_EDIT_FRAME::SaveProject(), SCH_EDIT_FRAME::SchematicCleanUp(), SCH_SHEET::SearchHierarchy(), SCH_SHEET::SymbolCount(), ERC_TESTER::TestDuplicateSheetNames(), DIALOG_ERC::testErc(), ERC_TESTER::TestTextVars(), DIALOG_SHEET_PROPERTIES::TransferDataFromWindow(), DIALOG_SHEET_PIN_PROPERTIES::TransferDataToWindow(), DIALOG_CHANGE_SYMBOLS::updateFieldsList(), and NETLIST_EXPORTER_ORCADPCB2::WriteNetlist().
Definition at line 224 of file sch_rtree.h.
References m_tree, and SCH_LOCATE_ANY_T.
Referenced by SCH_EDIT_FRAME::BreakSegments(), SCH_EDIT_FRAME::DeleteJunction(), SCH_MOVE_TOOL::getConnectedDragItems(), AUTOPLACER::getPossibleCollisions(), SCH_LINE_WIRE_BUS_TOOL::getSheetPin(), SCH_SCREEN::IsJunctionNeeded(), and SCH_EDIT_FRAME::TrimWire().
|
inline |
Definition at line 229 of file sch_rtree.h.
References EDA_RECT::Inflate(), m_tree, and SCH_LOCATE_ANY_T.
|
inline |
Function Remove() Removes an item from the tree.
Removal is done by comparing pointers, attempting to remove a copy of the item will fail.
Definition at line 78 of file sch_rtree.h.
References EDA_RECT::GetBottom(), EDA_ITEM::GetBoundingBox(), EDA_RECT::GetRight(), EDA_RECT::GetX(), EDA_RECT::GetY(), m_count, m_tree, and EDA_ITEM::Type().
Referenced by SCH_SCREEN::Remove(), and SCH_SCREEN::UpdateLocalLibSymbolLinks().
|
inline |
Returns the number of items in the tree.
Definition at line 161 of file sch_rtree.h.
References m_count.
|
private |
Definition at line 272 of file sch_rtree.h.
Referenced by clear(), EE_RTREE(), empty(), insert(), remove(), and size().
|
private |
Definition at line 271 of file sch_rtree.h.
Referenced by begin(), clear(), contains(), EE_RTREE(), end(), insert(), OfType(), Overlapping(), remove(), and ~EE_RTREE().