#include <vtkQtChartShapeLocator.h>
The tree is built from a table of shapes. The leaf nodes store the shapes and use them for searches. The parent nodes in the tree use the bounding rectangle for searches. The bounding rectangles can be updated if the layout remains unchanged.
Definition at line 142 of file vtkQtChartShapeLocator.h.
Public Member Functions | |
vtkQtChartShapeLocator () | |
~vtkQtChartShapeLocator () | |
void | clear () |
Removes all the tree items. | |
void | build (const QList< QList< vtkQtChartShape * > > &table) |
Builds a shape tree from the ordered table of shapes. | |
void | build (const QList< vtkQtChartShape * > &list) |
Builds a shape tree from the list of shapes. | |
void | update () |
Updates the bounding rectangles in the shape tree. | |
QList< vtkQtChartShape * > | getItemsAt (const QPointF &point) const |
Gets the shapes at the specified point. | |
QList< vtkQtChartShape * > | getItemsIn (const QRectF &area) const |
Gets the shapes in the specified rectangle. | |
vtkQtChartShapeLocatorNode * | getLast () |
Gets the last node in the tree. | |
vtkQtChartShapeLocatorNode * | getPrevious (vtkQtChartShapeLocatorNode *node) |
Gets the previous node in the tree. | |
Static Public Member Functions | |
static void | sort (QList< vtkQtChartShape * > &list) |
Sorts the list of shapes according to the y value. |
vtkQtChartShapeLocator::vtkQtChartShapeLocator | ( | ) |
vtkQtChartShapeLocator::~vtkQtChartShapeLocator | ( | ) |
void vtkQtChartShapeLocator::clear | ( | ) |
Removes all the tree items.
void vtkQtChartShapeLocator::build | ( | const QList< QList< vtkQtChartShape * > > & | table | ) |
Builds a shape tree from the ordered table of shapes.
The shape pointers are stored by the tree and should not be deleted until the tree has been cleared.
table | The ordered table of shapes. |
void vtkQtChartShapeLocator::build | ( | const QList< vtkQtChartShape * > & | list | ) |
Builds a shape tree from the list of shapes.
The list of shapes should be sorted in the x-axis direction before calling this method. The list will be divided into a table and sorted in the y-axis direction before building the tree. The shape pointers are stored by the tree and should not be deleted until the tree has been cleared.
list | The list of shapes. |
void vtkQtChartShapeLocator::update | ( | ) |
Updates the bounding rectangles in the shape tree.
The nodes are traversed from last to first. The bounding rectangle of each node is updated using the shape if it is a leaf or the bounds of the children otherwise.
QList<vtkQtChartShape *> vtkQtChartShapeLocator::getItemsAt | ( | const QPointF & | point | ) | const |
Gets the shapes at the specified point.
point | The point to search. |
QList<vtkQtChartShape *> vtkQtChartShapeLocator::getItemsIn | ( | const QRectF & | area | ) | const |
Gets the shapes in the specified rectangle.
area | The rectangle to search. |
vtkQtChartShapeLocatorNode* vtkQtChartShapeLocator::getLast | ( | ) |
Gets the last node in the tree.
vtkQtChartShapeLocatorNode* vtkQtChartShapeLocator::getPrevious | ( | vtkQtChartShapeLocatorNode * | node | ) |
Gets the previous node in the tree.
node | The node to search from. |
static void vtkQtChartShapeLocator::sort | ( | QList< vtkQtChartShape * > & | list | ) | [static] |
Sorts the list of shapes according to the y value.
The list of shapes is sorted by the y-axis value using a quick sort algorithm. The list is sorted in place.
list | The list of shapes to be sorted. |