53 #ifndef QGRAPHICSBSPTREEINDEX_H 54 #define QGRAPHICSBSPTREEINDEX_H 56 #include <QtCore/qglobal.h> 58 #if !defined(QT_NO_GRAPHICSVIEW) || (QT_EDITION & QT_MODULE_GRAPHICSVIEW) != QT_MODULE_GRAPHICSVIEW 64 #include <QtCore/qrect.h> 65 #include <QtCore/qlist.h> 87 void setBspTreeDepth(
int depth);
133 void purgeRemovedItems();
135 void _q_updateIndex();
139 void _q_updateSortCache();
142 void invalidateSortCache();
147 static void climbTree(
QGraphicsItem *item,
int *stackingOrder);
159 bool cached,
bool onlyTopLevelItems =
false);
182 if (l1 >= r2 || l2 >= r1)
199 return !(t1 >= b2 || t2 >= b1);
204 #endif // QT_NO_GRAPHICSVIEW 206 #endif // QGRAPHICSBSPTREEINDEX_H
The QGraphicsScene class provides a surface for managing a large number of 2D graphical items...
#define QT_END_NAMESPACE
This macro expands to.
QSet< QGraphicsItem * > removedItems
QScopedPointer< QGraphicsItemPrivate > d_ptr
QGraphicsSceneBspTree bsp
The QGraphicsItem class is the base class for all graphical items in a QGraphicsScene.
qreal left() const
Returns the x-coordinate of the rectangle's left edge.
The QGraphicsSceneBspTreeIndex class provides an implementation of a BSP indexing algorithm for disco...
#define Q_DISABLE_COPY(Class)
Disables the use of copy constructors and assignment operators for the given Class.
#define Q_PRIVATE_SLOT(d, signature)
GraphicsItemChange
This enum describes the state changes that are notified by QGraphicsItem::itemChange().
virtual bool event(QEvent *)
This virtual function receives events to an object and should return true if the event e was recogniz...
static const int QGRAPHICSSCENE_INDEXTIMER_TIMEOUT
static bool closestItemLast_withCache(const QGraphicsItem *item1, const QGraphicsItem *item2)
virtual void removeItem(QGraphicsItem *item)=0
This pure virtual function removes an item to the scene index.
static bool closestItemFirst_withCache(const QGraphicsItem *item1, const QGraphicsItem *item2)
#define QT_BEGIN_NAMESPACE
This macro expands to.
virtual void itemChange(const QGraphicsItem *item, QGraphicsItem::GraphicsItemChange, const void *const value)
This virtual function is called by QGraphicsItem to notify the index that some part of the item 's st...
int bspTreeDepth
the depth of the BSP index tree
The QRectF class defines a rectangle in the plane using floating point precision. ...
qreal height() const
Returns the height of the rectangle.
QList< int > freeItemIndexes
virtual void prepareBoundingRectChange(const QGraphicsItem *item)
Notify the index for a geometry change of an item.
virtual QList< QGraphicsItem * > estimateTopLevelItems(const QRectF &, Qt::SortOrder order) const
qreal width() const
Returns the width of the rectangle.
The QGraphicsSceneIndex class provides a base class to implement a custom indexing algorithm for disc...
virtual void clear()
This virtual function removes all items in the scene index.
QList< QGraphicsItem * > indexedItems
static bool QRectF_intersects(const QRectF &s, const QRectF &r)
virtual void addItem(QGraphicsItem *item)=0
This pure virtual function inserts an item to the scene index.
#define Q_DECLARE_PUBLIC(Class)
QList< QGraphicsItem * > untransformableItems
virtual QList< QGraphicsItem * > estimateItems(const QPointF &point, Qt::SortOrder order) const
This virtual function return an estimation of items at position point.
virtual void updateSceneRect(const QRectF &rect)
Notifies the index that the scene's scene rect has changed.
#define Q_AUTOTEST_EXPORT
qreal top() const
Returns the y-coordinate of the rectangle's top edge.
friend class QGraphicsSceneBspTreeIndex
#define Q_DECLARE_PRIVATE(Class)
virtual QList< QGraphicsItem * > items(Qt::SortOrder order=Qt::DescendingOrder) const =0
This pure virtual function all items in the index and sort them using order.
QList< QGraphicsItem * > unindexedItems
The QEvent class is the base class of all event classes.
The QList class is a template class that provides lists.