The vtkQtChartShapeLocator class is used to locate shapes in a tree structure.
More...
#include <vtkQtChartShapeLocator.h>
The vtkQtChartShapeLocator class is used to locate shapes in a tree structure.
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.
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.
- Parameters
-
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.
- Parameters
-
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.
- Parameters
-
point | The point to search. |
- Returns
- The list of shapes at the given point.
QList<vtkQtChartShape *> vtkQtChartShapeLocator::getItemsIn |
( |
const QRectF & |
area) | |
const |
Gets the shapes in the specified rectangle.
- Parameters
-
area | The rectangle to search. |
- Returns
- The list of shapes in the given rectangle.
Gets the last node in the tree.
- Returns
- A pointer to the last node in the tree.
Gets the previous node in the tree.
- Parameters
-
node | The node to search from. |
- Returns
- A pointer to the previous node in the tree.
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.
- Parameters
-
list | The list of shapes to be sorted. |
The documentation for this class was generated from the following file: