Rogue Wave Views Manager Package API Reference Guide |
Rogue Wave Views Documentation Home |
An interactor designed for translation, zooming in, and zooming out on an IlvView
.
More...
#include <ilviews/manager/paninter.h>
Public Member Functions | |
IlvPanZoomInteractor (IlvManager *manager, IlvView *view, IlvCursor *handup=0, IlvCursor *handdown=0, IlvCursor *zoomin=0, IlvCursor *zoomout=0) | |
Constructor. More... | |
IlvPanZoomInteractor (IlvCursor *handup=0, IlvCursor *handdown=0, IlvCursor *zoomin=0, IlvCursor *zoomout=0) | |
Constructor. More... | |
virtual void | abort () |
Aborts the interaction. More... | |
void | allocateBitmap () |
Allocates an IlvBitmap to simulate double buffering. More... | |
virtual void | drawGhost () |
Draws a ghost rectangle representing the translation. More... | |
IlvCursor * | getDefaultCursor () const |
Returns the default IlvCursor set on the associated view when no mouse drag is performed. More... | |
IlvCursor * | getDragCursor () const |
Returns the drag IlvCursor . More... | |
IlFloat | getMaxZoomingFactor () const |
Returns the maximum zooming factor. More... | |
IlFloat | getMinZoomingFactor () const |
Returns the minimum zooming factor. More... | |
IlvCursor * | getZoomInCursor () const |
Returns the "zoom in" IlvCursor . More... | |
IlFloat | getZoomingRatio () const |
Returns the zooming ratio used by the zoomView method. More... | |
IlvCursor * | getZoomOutCursor () const |
Returns the "zoom out" IlvCursor . More... | |
virtual IlBoolean | handleEvent (IlvEvent &event) |
Handles events for the manager view. More... | |
virtual void | init () |
Initialization, when the interactor is attached to a view. More... | |
IlBoolean | isDrawingBitmap () const |
Returns whether the interactor is drawing a bitmap or not before the translation. | |
IlBoolean | isOpaqueMove () const |
Returns whether the interactor is in Opaque Move mode. More... | |
virtual void | setDefaultCursor (IlvCursor *c) |
Sets the cursor for this interactor. More... | |
virtual void | setDragCursor (IlvCursor *c) |
Sets the drag cursor. More... | |
void | setDrawingBitmap (IlBoolean set) |
Sets the "drawing bitmap" mode. More... | |
void | setMaxZoomingFactor (IlFloat sx) |
Sets the maximum "zooming in" factors. More... | |
void | setMinZoomingFactor (IlFloat sx) |
Sets the minimum zooming factor. More... | |
void | setOpaqueMove (IlBoolean set) |
Sets the interactor in Opaque Move mode. More... | |
virtual void | setZoomInCursor (IlvCursor *c) |
Sets the "Zooming in" cursor. More... | |
void | setZoomingRatio (IlFloat sx) |
Sets the zooming ratio used by the zoomView method. More... | |
virtual void | setZoomOutCursor (IlvCursor *c) |
Sets the "Zooming out" cursor. More... | |
Public Member Functions inherited from IlvManagerViewInteractor | |
IlvManagerViewInteractor (IlvManager *manager, IlvView *view) | |
Initializes a new IlvManagerViewInteractor . More... | |
virtual void | ensureVisible (const IlvPoint &point) |
Ensures the visibility of a given location. More... | |
IlvDisplay * | getDisplay () const |
Returns the display of the manager view. More... | |
IlvManager * | getManager () const |
Returns the manager. More... | |
IlvTransformer * | getTransformer () const |
Returns the transformer used with the manager view. More... | |
IlvView * | getView () const |
Returns the manager view. More... | |
virtual void | handleExpose (IlvRegion *clip=0) |
Called when the manager view receives an expose event. More... | |
Protected Member Functions | |
virtual void | doTranslate (IlvPos dx, IlvPos dy, IlBoolean reDraw) |
Called by the handleEvent() method in order to translate the view. More... | |
virtual void | doZoom (const IlvPoint ¢er, IlFloat scalex, IlBoolean reDraw) |
Called by the handleEvent() method in order to zoom the view. More... | |
virtual void | drawBitmap () |
Called to draw a bitmap simulating the translation. More... | |
An interactor designed for translation, zooming in, and zooming out on an IlvView
.
Library: ilvmgr
The translation is done while dragging the mouse.
The zooming action is performing by dragging the mouse with the middle or the right button pressed down. The view will zoom in if the mouse is dragged downwards, and zoom out if the mouse is dragged upwards.
In addition, in a Microsoft Windows environment, the zooming action can be performed using the mouse wheel.
IlvPanZoomInteractor::IlvPanZoomInteractor | ( | IlvManager * | manager, |
IlvView * | view, | ||
IlvCursor * | handup = 0 , |
||
IlvCursor * | handdown = 0 , |
||
IlvCursor * | zoomin = 0 , |
||
IlvCursor * | zoomout = 0 |
||
) |
Constructor.
manager | The IlvManager of the interactor. |
view | The IlvView where the pan is done. |
handup | The IlvCursor set on the view when no event occurs. If this parameter is not specified, a default internal IlvCursor is used. |
handdown | The IlvCursor set on the view when drag events occurs. If this parameter is not specified, a default internal IlvCursor is used. |
zoomin | The IlvCursor set on the view when a "zooming in" transformation occurs. If this parameter is not specified, a default internal IlvCursor is used. |
zoomout | The IlvCursor set on the view when a "zooming out" transformation occurs. If this parameter is not specified, a default internal IlvCursor is used. |
IlvPanZoomInteractor::IlvPanZoomInteractor | ( | IlvCursor * | handup = 0 , |
IlvCursor * | handdown = 0 , |
||
IlvCursor * | zoomin = 0 , |
||
IlvCursor * | zoomout = 0 |
||
) |
Constructor.
handup | The IlvCursor set on the view when no event occurs. If this parameter is not specified, a default internal IlvCursor is used. |
handdown | the IlvCursor set on the view when drag events occurs. If this parameter is not specified, a default internal IlvCursor is used. |
zoomin | the IlvCursor set on the view when a "zooming in" transformation occurs. If this parameter is not specified, a default internal IlvCursor is used. |
zoomout | the IlvCursor set on the view when a "zooming out" transformation occurs. If this parameter is not specified, a default internal IlvCursor is used. |
|
virtual |
Aborts the interaction.
Called by the manager when the user changes the current interactor. It resets the interactor to a state in which it appears to have never been launched. A common implementation is to erase the ghost image. Call this member function to inhibit the interactor action in particular circumstances.
Reimplemented from IlvManagerViewInteractor.
void IlvPanZoomInteractor::allocateBitmap | ( | ) |
Allocates an IlvBitmap
to simulate double buffering.
Allocates an IlvBitmap
to simulate double buffering if the view is in simple buffering mode for the case of non-opaque zoom (for example, we allocate an IlvBitmap
in order to draw the manager's content inside it and then to zoom this bitmap). Note that this method is for internal use only.
|
protectedvirtual |
Called by the handleEvent()
method in order to translate the view.
dx | The x translation factor. |
dy | The y translation factor. |
reDraw | If IlTrue , the view must be redrawn. |
|
protectedvirtual |
Called by the handleEvent()
method in order to zoom the view.
The default zooming factor used by handleEvent()
is 1.5
for the zoom in operation and 1 / 1.5
for the zoom out.
Note that the performed zoom keeps the aspect ratio (that is, scaley = scalex).
center | The point that is left unchanged by the zoom operation. The default point used by handleEvent() method is the center of the view. |
scalex | The x zooming factor. |
reDraw | If IlTrue , the view must be redrawn. |
|
protectedvirtual |
Called to draw a bitmap simulating the translation.
In non-opaque mode, this method is called in order to draw a bitmap simulating the translation or the zooming of the manager's contents before it is actually done.
|
virtual |
Draws a ghost rectangle representing the translation.
Draws a ghost rectangle representing the translation before it is done. It is used in non-opaque mode.
Reimplemented from IlvManagerViewInteractor.
IlvCursor* IlvPanZoomInteractor::getDefaultCursor | ( | ) | const |
Returns the default IlvCursor
set on the associated view when no mouse drag is performed.
setDefaultCursor()
. IlvCursor* IlvPanZoomInteractor::getDragCursor | ( | ) | const |
Returns the drag IlvCursor
.
setDragCursor()
. IlFloat IlvPanZoomInteractor::getMaxZoomingFactor | ( | ) | const |
Returns the maximum zooming factor.
Returns the maximum zooming factor beyond which the interactor will not zoom in anymore (used for the non-opaque zoom mode to prevent the bitmap zooming from becoming too large).
IlFloat IlvPanZoomInteractor::getMinZoomingFactor | ( | ) | const |
Returns the minimum zooming factor.
Returns the minimum zooming factor beyond which the interactor will not zoom out anymore (used for the non-opaque zoom mode to prevent the bitmap zooming from becoming too small).
IlvCursor* IlvPanZoomInteractor::getZoomInCursor | ( | ) | const |
Returns the "zoom in" IlvCursor
.
setZoomInCursor()
. IlFloat IlvPanZoomInteractor::getZoomingRatio | ( | ) | const |
Returns the zooming ratio used by the zoomView
method.
Returns the zooming factor used by the zoomView
method. The default value is 1.5
. The zooming out factor is 1 / sx
.
IlvCursor* IlvPanZoomInteractor::getZoomOutCursor | ( | ) | const |
Returns the "zoom out" IlvCursor
.
setZoomOutCursor()
. Handles events for the manager view.
Called by the manager for which the interactor was created with every event it receives in the interactor view.
IlTrue
if the event is consumed, IlFalse
otherwise. Implements IlvManagerViewInteractor.
|
virtual |
Initialization, when the interactor is attached to a view.
Resets the interactor to its initial state.
Called by the manager whenever the interactor is associated with a view. An association of this kind is established by the member function IlvManager::setInteractor()
.
Reimplemented from IlvManagerViewInteractor.
IlBoolean IlvPanZoomInteractor::isOpaqueMove | ( | ) | const |
Returns whether the interactor is in Opaque Move mode.
The interactor has two modes to translate or zoom the attached view: The Opaque Move mode and the Ghost Move mode. In Opaque Move mode, the transformation is applied to the view for each drag event. In the Ghost Move mode, the view is transformed only when the user releases the mouse button. The default mode is the Opaque Move mode.
|
virtual |
Sets the cursor for this interactor.
Sets the default IlvCursor
on the associated view while this view is not being translated (the left mouse button is not pressed).
c | The cursor object. |
getDefaultCursor()
.
|
virtual |
Sets the drag cursor.
Sets the drag IlvCursor
on the associated view while the left mouse button is pressed (while dragging for instance).
c | The cursor object. |
getDragCursor()
. void IlvPanZoomInteractor::setDrawingBitmap | ( | IlBoolean | set | ) |
Sets the "drawing bitmap" mode.
Sets the "drawing bitmap" mode. If set to IlTrue
, the drawBitmap
method is called in order to simulate the translation of the manager contents before it is actually done (it is done after the IlvButtonUp).
If set to IlFalse
, the drawGhost
method is used.
set | The Boolean value of the drawing bitmap flag. |
void IlvPanZoomInteractor::setMaxZoomingFactor | ( | IlFloat | sx | ) |
Sets the maximum "zooming in" factors.
Sets the maximum zooming in factor beyond which the interactor will not zoom in anymore (used for the non-opaque zoom mode to prevent the bitmap zooming from becoming too large).
sx | The new maximum zooming factor. |
void IlvPanZoomInteractor::setMinZoomingFactor | ( | IlFloat | sx | ) |
Sets the minimum zooming factor.
Sets the minimum zooming factor beyond which the interactor will not zoom out anymore (used for the non-opaque zoom mode to prevent the bitmap zooming from becoming too small).
sx | The new minimum zooming factor. |
void IlvPanZoomInteractor::setOpaqueMove | ( | IlBoolean | set | ) |
Sets the interactor in Opaque Move mode.
The interactor has two modes to translate or zoom the attached view: the Opaque Move mode and the Ghost Move mode. In Opaque Move mode, the transformation is applied to the view for each drag event. In the Ghost Move mode, the view is transformed only when the user releases the mouse button. The default mode is the Opaque Move mode.
set | Specifies whether the Opaque Move mode is to be set. |
|
virtual |
Sets the "Zooming in" cursor.
Sets the zooming in IlvCursor
on the associated view when zooming in transformation occurs (middle or right mouse button vertical drag from north to south).
c | The new cursor. |
getZoomInCursor()
. void IlvPanZoomInteractor::setZoomingRatio | ( | IlFloat | sx | ) |
Sets the zooming ratio used by the zoomView method.
The zooming out factor is 1 / sx
.
sx | The new zooming ratio. |
|
virtual |
Sets the "Zooming out" cursor.
Sets the zooming out IlvCursor
on the associated view when zooming out transformation occurs (middle or right mouse button vertical drag from south to north).
c | The cursor object. |
getZoomOutCursor()
. © Copyright 2018, 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.