diff options
author | Bjørn Erik Nilsen <bjorn.nilsen@nokia.com> | 2009-07-02 08:46:37 (GMT) |
---|---|---|
committer | Bjørn Erik Nilsen <bjorn.nilsen@nokia.com> | 2009-07-02 08:46:37 (GMT) |
commit | 6d71de4283c05b1b42ef26fe4c23334ad34c8a54 (patch) | |
tree | bd16b1350b54836be6d11e8c11c56d6fa21cd1e7 | |
parent | 5fc3fe2e3f04475ac8c0e3287af6042bd8b67c57 (diff) | |
download | Qt-6d71de4283c05b1b42ef26fe4c23334ad34c8a54.zip Qt-6d71de4283c05b1b42ef26fe4c23334ad34c8a54.tar.gz Qt-6d71de4283c05b1b42ef26fe4c23334ad34c8a54.tar.bz2 |
Kill dead BSP tree code in graphics view.
-rw-r--r-- | src/gui/graphicsview/qgraphicsscene_bsp.cpp | 41 | ||||
-rw-r--r-- | src/gui/graphicsview/qgraphicsscene_bsp_p.h | 3 |
2 files changed, 0 insertions, 44 deletions
diff --git a/src/gui/graphicsview/qgraphicsscene_bsp.cpp b/src/gui/graphicsview/qgraphicsscene_bsp.cpp index 5858eab..7d30749 100644 --- a/src/gui/graphicsview/qgraphicsscene_bsp.cpp +++ b/src/gui/graphicsview/qgraphicsscene_bsp.cpp @@ -154,17 +154,6 @@ QList<QGraphicsItem *> QGraphicsSceneBspTree::items(const QRectF &rect) const return tmp; } -QList<QGraphicsItem *> QGraphicsSceneBspTree::items(const QPointF &pos) const -{ - QList<QGraphicsItem *> tmp; - findVisitor->foundItems = &tmp; - climbTree(findVisitor, pos); - // Reset discovery bits. - for (int i = 0; i < tmp.size(); ++i) - tmp.at(i)->d_ptr->itemDiscovered = 0; - return tmp; -} - int QGraphicsSceneBspTree::leafCount() const { return leafCnt; @@ -241,36 +230,6 @@ void QGraphicsSceneBspTree::initialize(const QRectF &rect, int depth, int index) } } -void QGraphicsSceneBspTree::climbTree(QGraphicsSceneBspTreeVisitor *visitor, const QPointF &pos, int index) const -{ - if (nodes.isEmpty()) - return; - - const Node &node = nodes.at(index); - const int childIndex = firstChildIndex(index); - - switch (node.type) { - case Node::Leaf: { - visitor->visit(const_cast<QList<QGraphicsItem*>*>(&leaves[node.leafIndex])); - break; - } - case Node::Vertical: - if (pos.x() < node.offset) { - climbTree(visitor, pos, childIndex); - } else { - climbTree(visitor, pos, childIndex + 1); - } - break; - case Node::Horizontal: - if (pos.y() < node.offset) { - climbTree(visitor, pos, childIndex); - } else { - climbTree(visitor, pos, childIndex + 1); - } - break; - } -} - void QGraphicsSceneBspTree::climbTree(QGraphicsSceneBspTreeVisitor *visitor, const QRectF &rect, int index) const { if (nodes.isEmpty()) diff --git a/src/gui/graphicsview/qgraphicsscene_bsp_p.h b/src/gui/graphicsview/qgraphicsscene_bsp_p.h index 323cf04..24b926c 100644 --- a/src/gui/graphicsview/qgraphicsscene_bsp_p.h +++ b/src/gui/graphicsview/qgraphicsscene_bsp_p.h @@ -93,7 +93,6 @@ public: void removeItems(const QSet<QGraphicsItem *> &items); QList<QGraphicsItem *> items(const QRectF &rect) const; - QList<QGraphicsItem *> items(const QPointF &pos) const; int leafCount() const; inline int firstChildIndex(int index) const @@ -106,11 +105,9 @@ public: private: void initialize(const QRectF &rect, int depth, int index); - void climbTree(QGraphicsSceneBspTreeVisitor *visitor, const QPointF &pos, int index = 0) const; void climbTree(QGraphicsSceneBspTreeVisitor *visitor, const QRectF &rect, int index = 0) const; void findItems(QList<QGraphicsItem *> *foundItems, const QRectF &rect, int index); - void findItems(QList<QGraphicsItem *> *foundItems, const QPointF &pos, int index); QRectF rectForIndex(int index) const; QVector<Node> nodes; |