vtkQtChartZoomHistory Class Reference

#include <vtkQtChartZoomHistory.h>

List of all members.


Detailed Description

The vtkQtChartZoomHistory class stores a list of vtkQtChartZoomViewport objects.

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.

See also:
vtkQtChartZoomHistory::setLimit(int), vtkQtChartZoomHistory::addHistory(float, float, float, float), vtkQtChartZoomHistory::getNext(), vtkQtChartZoomHistory::getPrevious(), vtkQtChartZoomHistory::getCurrent()

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 vtkQtChartZoomViewportgetCurrent () const
 Gets the current zoom viewport.
const vtkQtChartZoomViewportgetPrevious ()
 Gets the previous zoom viewport in the history.
const vtkQtChartZoomViewportgetNext ()
 Gets the next zoom viewport in the history.

Constructor & Destructor Documentation

vtkQtChartZoomHistory::vtkQtChartZoomHistory (  ) 

vtkQtChartZoomHistory::~vtkQtChartZoomHistory (  ) 


Member Function Documentation

void vtkQtChartZoomHistory::setLimit ( int  limit  ) 

Sets the maximum number of items in the history.

Parameters:
limit The maximum number of entries.

int vtkQtChartZoomHistory::getLimit (  )  const [inline]

Gets the maximum number of items in the history.

Returns:
The maximum number of entries.

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.

Parameters:
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.
See also:
vtkQtChartZoomHistory::updatePosition(float, float)

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.

Parameters:
x The x position of the viewport.
y The y position of the viewport.
See also:
vtkQtChartZoomHistory::addHistory(float, float, float, float)

bool vtkQtChartZoomHistory::isPreviousAvailable (  )  const

Gets whether or not a zoom viewport is before the current.

Returns:
True if a zoom viewport is before the current.

bool vtkQtChartZoomHistory::isNextAvailable (  )  const

Gets whether or not a zoom viewport is after the current.

Returns:
True if a zoom viewport is after the current.

const vtkQtChartZoomViewport* vtkQtChartZoomHistory::getCurrent (  )  const

Gets the current zoom viewport.

Returns:
A pointer to the current zoom viewport or null if the list is empty.

const vtkQtChartZoomViewport* vtkQtChartZoomHistory::getPrevious (  ) 

Gets the previous zoom viewport in the history.

Returns:
A pointer to the previous zoom viewport or null if the beginning of the list is reached.
See also:
vtkQtChartZoomHistory::getNext()

const vtkQtChartZoomViewport* vtkQtChartZoomHistory::getNext (  ) 

Gets the next zoom viewport in the history.

Returns:
A pointer to the next zoom viewport or null if the end of the list is reached.
See also:
vtkQtChartZoomHistory::getPrevious()


The documentation for this class was generated from the following file:

Generated on Mon Sep 27 18:44:54 2010 for VTK by  doxygen 1.5.6