Changeset View
Changeset View
Standalone View
Standalone View
libs/flake/KoRTree.h
Show All 36 Lines | |||||
37 | #ifdef CALLIGRA_RTREE_DEBUG | 37 | #ifdef CALLIGRA_RTREE_DEBUG | ||
38 | #include <QPainter> | 38 | #include <QPainter> | ||
39 | #endif | 39 | #endif | ||
40 | 40 | | |||
41 | /** | 41 | /** | ||
42 | * @brief The KoRTree class is a template class that provides a R-tree. | 42 | * @brief The KoRTree class is a template class that provides a R-tree. | ||
43 | * | 43 | * | ||
44 | * This class implements a R-tree as described in | 44 | * This class implements a R-tree as described in | ||
45 | * "R-TREES. A DYNAMIC INDEX STRUCTURE FOR SPATIAL SEARCHING" by Antomn Guttman | 45 | * "R-TREES. A DYNAMIC INDEX STRUCTURE FOR SPATIAL SEARCHING" by Antonin Guttman | ||
46 | * | 46 | * | ||
47 | * It only supports 2 dimensional bounding boxes which are represented by a QRectF. | 47 | * It only supports 2 dimensional bounding boxes which are represented by a QRectF. | ||
48 | * For node splitting the Quadratic-Cost Algorithm is used as described by Guttman. | 48 | * For node splitting the Quadratic-Cost Algorithm is used as described by Guttman. | ||
49 | */ | 49 | */ | ||
50 | template <typename T> | 50 | template <typename T> | ||
51 | class KoRTree | 51 | class KoRTree | ||
52 | { | 52 | { | ||
53 | public: | 53 | public: | ||
▲ Show 20 Lines • Show All 395 Lines • ▼ Show 20 Line(s) | |||||
449 | 449 | | |||
450 | 450 | | |||
451 | template <typename T> | 451 | template <typename T> | ||
452 | void KoRTree<T>::remove(const T&data) | 452 | void KoRTree<T>::remove(const T&data) | ||
453 | { | 453 | { | ||
454 | //debugFlake << "KoRTree remove"; | 454 | //debugFlake << "KoRTree remove"; | ||
455 | LeafNode * leaf = m_leafMap[data]; | 455 | LeafNode * leaf = m_leafMap[data]; | ||
456 | 456 | | |||
457 | // Trying to remove unexistent leaf. Most probably, this leaf hasn't been added | 457 | // Trying to remove inexistent leaf. Most probably, this leaf hasn't been added | ||
458 | // to the shape manager correctly | 458 | // to the shape manager correctly | ||
459 | KIS_SAFE_ASSERT_RECOVER_RETURN(leaf); | 459 | KIS_SAFE_ASSERT_RECOVER_RETURN(leaf); | ||
460 | 460 | | |||
461 | m_leafMap.remove(data); | 461 | m_leafMap.remove(data); | ||
462 | leaf->remove(data); | 462 | leaf->remove(data); | ||
463 | 463 | | |||
464 | /** | 464 | /** | ||
465 | * WARNING: after calling condenseTree() the temporary enters an inconsistent state! | 465 | * WARNING: after calling condenseTree() the temporary enters an inconsistent state! | ||
▲ Show 20 Lines • Show All 700 Lines • Show Last 20 Lines |