rwlogo
Rogue Wave Views 5.6

Rogue Wave Views
Manager Package API Reference Guide

Product Documentation:

Rogue Wave Views
Documentation Home

IlvPanZoomInteractor Class Reference

An interactor designed for translation, zooming in, and zooming out on an IlvView. More...

#include <ilviews/manager/paninter.h>

Inheritance diagram for IlvPanZoomInteractor:
IlvManagerViewInteractor

List of all members.

Public Member Functions

 IlvPanZoomInteractor (IlvCursor *handup=0, IlvCursor *handdown=0, IlvCursor *zoomin=0, IlvCursor *zoomout=0)
 Constructor.
 IlvPanZoomInteractor (IlvManager *manager, IlvView *view, IlvCursor *handup=0, IlvCursor *handdown=0, IlvCursor *zoomin=0, IlvCursor *zoomout=0)
 Constructor.
virtual void abort ()
 Aborts the interaction.
void allocateBitmap ()
 Allocates an IlvBitmap to simulate double buffering.
virtual void drawGhost ()
 Draws a ghost rectangle representing the translation.
IlvCursorgetDefaultCursor () const
 Returns the default IlvCursor set on the associated view when no mouse drag is performed.
IlvCursorgetDragCursor () const
 Returns the drag IlvCursor.
IlFloat getMaxZoomingFactor () const
 Returns the maximum zooming factor.
IlFloat getMinZoomingFactor () const
 Returns the minimum zooming factor.
IlvCursorgetZoomInCursor () const
 Returns the "zoom in" IlvCursor.
IlFloat getZoomingRatio () const
 Returns the zooming ratio used by the zoomView method.
IlvCursorgetZoomOutCursor () const
 Returns the "zoom out" IlvCursor.
virtual void handleEvent (IlvEvent &event)
 Handles events for the manager view.
virtual void init ()
 Initialization, when the interactor is attached to a view.
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.
virtual void setDefaultCursor (IlvCursor *c)
 Sets the cursor for this interactor.
virtual void setDragCursor (IlvCursor *c)
 Sets the drag cursor.
void setDrawingBitmap (IlBoolean set)
 Sets the "drawing bitmap" mode.
void setMaxZoomingFactor (IlFloat sx)
 Sets the maximum "zooming in" factors.
void setMinZoomingFactor (IlFloat sx)
 Sets the minimum zooming factor.
void setOpaqueMove (IlBoolean set)
 Sets the interactor in Opaque Move mode.
virtual void setZoomInCursor (IlvCursor *c)
 Sets the "Zooming in" cursor.
void setZoomingRatio (IlFloat sx)
 Sets the zooming ratio used by the zoomView method.
virtual void setZoomOutCursor (IlvCursor *c)
 Sets the "Zooming out" cursor.

Protected Member Functions

virtual void doTranslate (IlvPos dx, IlvPos dy, IlBoolean reDraw)
 Called by the handleEvent method in order to translate the view.
virtual void doZoom (const IlvPoint &center, IlFloat scalex, IlBoolean reDraw)
 Called by the handleEvent method in order to zoom the view.
virtual void drawBitmap ()
 Called to draw a bitmap simulating the translation.

Detailed Description

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.


Constructor & Destructor Documentation

IlvPanZoomInteractor::IlvPanZoomInteractor ( IlvManager manager,
IlvView view,
IlvCursor handup = 0,
IlvCursor handdown = 0,
IlvCursor zoomin = 0,
IlvCursor zoomout = 0 
)

Constructor.

Parameters:
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.

Parameters:
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.

Member Function Documentation

virtual void IlvPanZoomInteractor::abort (  )  [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.

virtual void IlvPanZoomInteractor::doTranslate ( IlvPos  dx,
IlvPos  dy,
IlBoolean  reDraw 
) [protected, virtual]

Called by the handleEvent method in order to translate the view.

Parameters:
dx The x translation factor.
dy The y translation factor.
reDraw If IlTrue, the view must be redrawn.
virtual void IlvPanZoomInteractor::doZoom ( const IlvPoint center,
IlFloat  scalex,
IlBoolean  reDraw 
) [protected, virtual]

Called by the handleEvent method in order to zoom the view.

The default zooming factor used by the 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 (for example, scaley = scalex).

Parameters:
center The point that is left unchanged by the zoom operation. The default point used by the handleEvent method is the center of the view.
scalex The x zooming factor.
reDraw If IlTrue, the view must be redrawn.
virtual void IlvPanZoomInteractor::drawBitmap (  )  [protected, virtual]

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 void IlvPanZoomInteractor::drawGhost (  )  [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.

See also:
IlvManagerViewInteractor::drawGhost.

Reimplemented from IlvManagerViewInteractor.

IlvCursor* IlvPanZoomInteractor::getDefaultCursor (  )  const

Returns the default IlvCursor set on the associated view when no mouse drag is performed.

See also:
setDefaultCursor.
IlvCursor* IlvPanZoomInteractor::getDragCursor (  )  const

Returns the drag IlvCursor.

See also:
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.

See also:
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.

See also:
setZoomOutCursor.
virtual void IlvPanZoomInteractor::handleEvent ( IlvEvent event  )  [virtual]

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.

Implements IlvManagerViewInteractor.

virtual void IlvPanZoomInteractor::init (  )  [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.

Returns:
A Boolean specifying whether this interactor is in Opaque Move mode.
virtual void IlvPanZoomInteractor::setDefaultCursor ( IlvCursor c  )  [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).

Parameters:
c The cursor object.
See also:
getDefaultCursor.
virtual void IlvPanZoomInteractor::setDragCursor ( IlvCursor c  )  [virtual]

Sets the drag cursor.

Sets the drag IlvCursor on the associated view while the left mouse button is pressed (while dragging for instance).

Parameters:
c The cursor object.
See also:
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.

Parameters:
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).

Parameters:
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).

Parameters:
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.

Parameters:
set A Boolean specifying whether the Opaque Move mode is to be set.
virtual void IlvPanZoomInteractor::setZoomInCursor ( IlvCursor c  )  [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).

Parameters:
c The new cursor.
See also:
getZoomInCursor.
void IlvPanZoomInteractor::setZoomingRatio ( IlFloat  sx  ) 

Sets the zooming ratio used by the zoomView method.

The zooming out factor is 1 / sx.

Parameters:
sx The new zooming ratio.
virtual void IlvPanZoomInteractor::setZoomOutCursor ( IlvCursor c  )  [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).

Parameters:
c The cursor object.
See also:
getZoomOutCursor.
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

© 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.