#include <vtkQtChartZoomHistory.h>
The zoom history contains a list of zoom viewports. The list is ordered chronologically, and contains an index to the current item. The history list is limited to a certain number of items. The default limit is 10, but it can be changed using the setLimit
method.
When adding items to the history list, the new item will become the current item. The front of the list may be trimmed to stay within limits. If the current item is in the middle of the list, the subsequent items will be removed before adding the new item to the end of the list.
The history list is navigated using the getPrevious
and getNext
methods. You can also use the getCurrent
method to get the current item without changing the index.
Definition at line 124 of file vtkQtChartZoomHistory.h.
Public Member Functions | |
vtkQtChartZoomHistory () | |
~vtkQtChartZoomHistory () | |
void | setLimit (int limit) |
Sets the maximum number of items in the history. | |
int | getLimit () const |
Gets the maximum number of items in the history. | |
void | addHistory (float x, float y, float xZoom, float yZoom) |
Adds a zoom viewport to the history list. | |
void | updatePosition (float x, float y) |
Used to update the viewport position for the current zoom factors. | |
bool | isPreviousAvailable () const |
Gets whether or not a zoom viewport is before the current. | |
bool | isNextAvailable () const |
Gets whether or not a zoom viewport is after the current. | |
const vtkQtChartZoomViewport * | getCurrent () const |
Gets the current zoom viewport. | |
const vtkQtChartZoomViewport * | getPrevious () |
Gets the previous zoom viewport in the history. | |
const vtkQtChartZoomViewport * | getNext () |
Gets the next zoom viewport in the history. |
vtkQtChartZoomHistory::vtkQtChartZoomHistory | ( | ) |
vtkQtChartZoomHistory::~vtkQtChartZoomHistory | ( | ) |
void vtkQtChartZoomHistory::setLimit | ( | int | limit | ) |
Sets the maximum number of items in the history.
limit | The maximum number of entries. |
int vtkQtChartZoomHistory::getLimit | ( | ) | const [inline] |
Gets the maximum number of items in the history.
Definition at line 139 of file vtkQtChartZoomHistory.h.
void vtkQtChartZoomHistory::addHistory | ( | float | x, | |
float | y, | |||
float | xZoom, | |||
float | yZoom | |||
) |
Adds a zoom viewport to the history list.
The new item will become the current item in the list. If the current item is not at the end of the list, all the subsequent items will be removed. If the list is longer than the allowed limit, items will be removed from the front of the list.
x | The x position of the viewport. | |
y | The y position of the viewport. | |
xZoom | The x-axis zoom factor for the viewport. | |
yZoom | The y-axis zoom factor for the viewport. |
void vtkQtChartZoomHistory::updatePosition | ( | float | x, | |
float | y | |||
) |
Used to update the viewport position for the current zoom factors.
This method allows the current zoom viewport to be updated when the user changes the viewport position by panning or scrolling.
x | The x position of the viewport. | |
y | The y position of the viewport. |
bool vtkQtChartZoomHistory::isPreviousAvailable | ( | ) | const |
Gets whether or not a zoom viewport is before the current.
bool vtkQtChartZoomHistory::isNextAvailable | ( | ) | const |
Gets whether or not a zoom viewport is after the current.
const vtkQtChartZoomViewport* vtkQtChartZoomHistory::getCurrent | ( | ) | const |
Gets the current zoom viewport.
const vtkQtChartZoomViewport* vtkQtChartZoomHistory::getPrevious | ( | ) |
Gets the previous zoom viewport in the history.
const vtkQtChartZoomViewport* vtkQtChartZoomHistory::getNext | ( | ) |
Gets the next zoom viewport in the history.