Rogue Wave Views |
Rogue Wave Views Documentation Home |
Implements interactive zooming of a chart. More...
#include <ilviews/charts/chartint.h>
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. 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 IlvChartInteractor * | Get (const char *name) |
Returns a shared interactor instance. More... | |
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".
IlvChartZoomInteractor::IlvChartZoomInteractor | ( | IlUShort | whichButton = IlvLeftButton | ) |
Constructor.
Initializes a new IlvChartZoomInteractor
object.
whichButton | The mouse button that should be used for the interaction. |
|
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.
chart | The considered chart. |
abscissaRange | The abscissa coordinate range corresponding to the dragged rectangle. |
ordinateRange | The ordinate coordinate range corresponding to the dragged rectangle. |
IlvCoordInterval
, IlvChartGraphic::zoomCharts
.
|
protectedvirtual |
Action method called when the user releases the mouse button.
The default implementation computes the new coordinate ranges and then calls IlvChartGraphic::zoomCharts
.
chart | The considered chart. |
abscissaRange | The abscissa coordinate range corresponding to the dragged rectangle. |
ordinateRange | The ordinate coordinate range corresponding to the dragged rectangle. |
IlvCoordInterval
, IlvChartGraphic::zoomCharts
.
|
protectedvirtual |
Draws the graphical representation of the dragged rectangle.
This method draws the dragged region in XOR mode.
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. |
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
.
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
.
|
virtual |
Handles events received by the interactor.
This method is the entry point of all events dispatched to this interactor.
chart | The chart object that received the event. |
event | The received event. |
t | The transformer applied to the view in which the event occurred. |
IlTrue
if the event was successfully handled and IlFalse
otherwise. Implements IlvChartInteractor.
|
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
.
IlTrue
if the interactor uses an abscissa cursor and IlFalse
otherwise. IlvChartInteractorManager
. Reimplemented from IlvChartInteractor.
|
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.
IlTrue
if the interactor uses an ordinate cursor and IlFalse
otherwise. IlvChartInteractorManager
. Reimplemented from IlvChartInteractor.
void IlvChartZoomInteractor::setZoomSteps | ( | IlUShort | count | ) |
Sets the number of intermediate steps during the zooming operation.
count | The new number of steps. |
getZoomSteps
. © Copyright 2015, 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.