rwlogo
Rogue Wave Views 5.5.1

Rogue Wave Views
Charts Package API Reference Guide

Product Documentation:

Rogue Wave Views
Documentation Home

IlvChartZoomInteractor Class Reference

Implements interactive zooming of a chart. More...

#include <ilviews/charts/chartint.h>

Inheritance diagram for IlvChartZoomInteractor:
IlvChartInteractor IlvInteractor

List of all members.

Public Types

enum  ZoomState { Zooming, UnZooming }
 

This enumeration type defines the possible zooming states of the interactor.

More...

Public Member Functions

 IlvChartZoomInteractor (IlUShort whichButton=IlvLeftButton)
 Constructor.
ZoomState getState () const
 Returns the current zooming state.
IlUShort getZoomSteps ()
 Returns the number of intermediate steps during a zooming operation.
virtual IlBoolean handleEvent (IlvGraphic *chart, IlvEvent &ev, const IlvTransformer *t=0)
 Handles events received by the interactor.
virtual IlBoolean isShowingAbscissaCursor () const
 Indicates whether the interactor uses a cursor on the abscissa.
virtual IlBoolean isShowingOrdinateCursor () const
 Indicates whether the interactor uses a cursor on the ordinate.
void setZoomSteps (IlUShort count)
 Sets the number of intermediate steps during the zooming operation.

Protected Member Functions

virtual void adjustZoomRange (const IlvChartGraphic *chart, IlvCoordInterval &abscissaRange, IlvCoordInterval &ordinateRange)
 Adjusts the zooming range.
virtual void doIt (IlvChartGraphic *chart, const IlvCoordInterval &abscissaRange, const IlvCoordInterval &ordinateRange)
 Action method called when the user releases the mouse button.
virtual void drawGhost (const IlvChartGraphic *chart, const IlvCoordInterval &abscissaRange, const IlvCoordInterval &ordinateRange, const IlvTransformer *t) const
 Draws the graphical representation of the dragged rectangle.

Detailed Description

Implements interactive zooming of a chart.

Library: ilvcharts

This class lets the user trigger a zoom-in or zoom-out command by dragging a rectangular region within the chart data display area.

The registered name of this interactor class is "ChartZoom".


Member Enumeration Documentation

This enumeration type defines the possible zooming states of the interactor.

Enumerator:
Zooming 

The interactor is in a zooming state.

UnZooming 

The interactor is in an unzooming state.


Constructor & Destructor Documentation

IlvChartZoomInteractor::IlvChartZoomInteractor ( IlUShort  whichButton = IlvLeftButton  ) 

Constructor.

Initializes a new IlvChartZoomInteractor object.

Parameters:
whichButton The mouse button that should be used for the interaction.

Member Function Documentation

virtual void IlvChartZoomInteractor::adjustZoomRange ( const IlvChartGraphic chart,
IlvCoordInterval abscissaRange,
IlvCoordInterval ordinateRange 
) [protected, virtual]

Adjusts the zooming range.

This method is called each time the mouse is dragged and lets you control the range selected by the user. The default implementation does nothing.

Parameters:
chart The considered chart.
abscissaRange The abscissa coordinate range corresponding to the dragged rectangle.
ordinateRange The ordinate coordinate range corresponding to the dragged rectangle.
See also:
IlvCoordInterval, IlvChartGraphic::zoomCharts.
virtual void IlvChartZoomInteractor::doIt ( IlvChartGraphic chart,
const IlvCoordInterval abscissaRange,
const IlvCoordInterval ordinateRange 
) [protected, virtual]

Action method called when the user releases the mouse button.

The default implementation computes the new coordinate ranges and then calls IlvChartGraphic::zoomCharts.

Parameters:
chart The considered chart.
abscissaRange The abscissa coordinate range corresponding to the dragged rectangle.
ordinateRange The ordinate coordinate range corresponding to the dragged rectangle.
See also:
IlvCoordInterval, IlvChartGraphic::zoomCharts.
virtual void IlvChartZoomInteractor::drawGhost ( const IlvChartGraphic chart,
const IlvCoordInterval abscissaRange,
const IlvCoordInterval ordinateRange,
const IlvTransformer t 
) const [protected, virtual]

Draws the graphical representation of the dragged rectangle.

This method draws the dragged region in XOR mode.

Parameters:
chart The considered chart.
abscissaRange The abscissa coordinate range corresponding to the dragged rectangle.
ordinateRange The ordinate coordinate range corresponding to the dragged rectangle.
t The transformer applied to the view in which the event occurred.
See also:
IlvCoordInterval, IlvChartGraphic::zoomCharts.
ZoomState IlvChartZoomInteractor::getState (  )  const

Returns the current zooming state.

During a drag operation, the interactor can either be in a Zooming or UnZooming state depending on the initial event. (The default implementation of this class uses IlvShiftModifier to discriminate between a zoom-in and a zoom-out command.) This method returns the current zooming state of the interactor and is typically used in methods such as IlvChartZoomInteractor::doIt, IlvChartZoomInteractor::drawGhost, and IlvChartZoomInteractor::adjustZoomRange.

Returns:
The current zooming state.
IlUShort IlvChartZoomInteractor::getZoomSteps (  ) 

Returns the number of intermediate steps during a zooming operation.

Each zooming-in/zooming-out operation can be divided into several steps to render a smooth transition between the original and the final visual state of the displayed data. This method returns the number of steps for the current object. The default number of steps when an instance is created is 0.

Returns:
The number of steps.
virtual IlBoolean IlvChartZoomInteractor::handleEvent ( IlvGraphic chart,
IlvEvent event,
const IlvTransformer t = 0 
) [virtual]

Handles events received by the interactor.

This method is the entry point of all events dispatched to this interactor.

Parameters:
chart The chart object that received the event.
event The received event.
t The transformer applied to the view in which the event occurred.
Returns:
IlTrue if the event was successfully handled and IlFalse otherwise.

Implements IlvChartInteractor.

virtual IlBoolean IlvChartZoomInteractor::isShowingAbscissaCursor (  )  const [virtual]

Indicates whether the interactor uses a cursor on the abscissa.

Interactor instances will use the API of IlvChartInteractorManager to display and move the corresponding cursor. If this method returns IlTrue and IlvChartInteractorManager::isShowingAbscissaCursor also returns IlTrue, the cursor will be displayed during the event sequence handled by this interactor. The default implementation returns IlFalse.

Returns:
IlTrue if the interactor uses an abscissa cursor and IlFalse otherwise.
See also:
IlvChartInteractorManager.

Reimplemented from IlvChartInteractor.

virtual IlBoolean IlvChartZoomInteractor::isShowingOrdinateCursor (  )  const [virtual]

Indicates whether the interactor uses a cursor on the ordinate.

Interactor instances will use the API of IlvChartInteractorManager to display and move the corresponding cursor. If this method returns IlTrue and IlvChartInteractorManager::isShowingAbscissaCursor also returns IlTrue, the cursor will be displayed during the event sequence handled by this interactor.

Returns:
IlTrue if the interactor uses an ordinate cursor and IlFalse otherwise.
See also:
IlvChartInteractorManager.

Reimplemented from IlvChartInteractor.

void IlvChartZoomInteractor::setZoomSteps ( IlUShort  count  ) 

Sets the number of intermediate steps during the zooming operation.

Parameters:
The new number of steps.
See also:
getZoomSteps.

© Copyright 2012, Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave is a registered trademark of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.