Rogue Wave Views
Charts Package API Reference Guide
Product Documentation:

Rogue Wave Views
Documentation Home
List of all members | Public Types | Public Member Functions | Protected Member Functions
IlvChartZoomInteractor Class Reference

Implements interactive zooming of a chart. More...

#include <ilviews/charts/chartint.h>

Inheritance diagram for IlvChartZoomInteractor:
IlvChartInteractor IlvInteractor

Public Types

Public Member Functions

 IlvChartZoomInteractor (IlUShort whichButton=IlvLeftButton)
 Constructor. More...
 
ZoomState getState () const
 Returns the current zooming state. More...
 
IlUShort getZoomSteps ()
 Returns the number of intermediate steps during a zooming operation. More...
 
virtual IlBoolean handleEvent (IlvGraphic *chart, IlvEvent &ev, const IlvTransformer *t=0)
 Handles events received by the interactor. More...
 
virtual IlBoolean isShowingAbscissaCursor () const
 Indicates whether the interactor uses a cursor on the abscissa. More...
 
virtual IlBoolean isShowingOrdinateCursor () const
 Indicates whether the interactor uses a cursor on the ordinate. More...
 
void setZoomSteps (IlUShort count)
 Sets the number of intermediate steps during the zooming operation. More...
 
- Public Member Functions inherited from IlvChartInteractor
virtual void endSequence (IlvChartGraphic *chart, const IlvEvent &event, const IlvTransformer *t)
 Performs the actions needed when an interactor leaves an event sequence. More...
 
IlBoolean isShared () const
 Indicates whether the current object is a shared instance. More...
 
virtual void startSequence (IlvChartGraphic *chart, const IlvEvent &event, const IlvTransformer *t)
 Performs the actions needed when an interactor enters an event sequence. More...
 

Protected Member Functions

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

Additional Inherited Members

- Static Public Member Functions inherited from IlvChartInteractor
static IlvChartInteractorGet (const char *name)
 Returns a shared interactor instance. More...
 

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
whichButtonThe mouse button that should be used for the interaction.

Member Function Documentation

virtual void IlvChartZoomInteractor::adjustZoomRange ( const IlvChartGraphic chart,
IlvCoordInterval abscissaRange,
IlvCoordInterval ordinateRange 
)
protectedvirtual

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
chartThe considered chart.
abscissaRangeThe abscissa coordinate range corresponding to the dragged rectangle.
ordinateRangeThe 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 
)
protectedvirtual

Action method called when the user releases the mouse button.

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

Parameters
chartThe considered chart.
abscissaRangeThe abscissa coordinate range corresponding to the dragged rectangle.
ordinateRangeThe 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
protectedvirtual

Draws the graphical representation of the dragged rectangle.

This method draws the dragged region in XOR mode.

Parameters
chartThe considered chart.
abscissaRangeThe abscissa coordinate range corresponding to the dragged rectangle.
ordinateRangeThe ordinate coordinate range corresponding to the dragged rectangle.
tThe 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
chartThe chart object that received the event.
eventThe received event.
tThe 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
countThe new number of steps.
See also
getZoomSteps.

© Copyright 2016, 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.