MapLink Pro 11.1.2.0.
Envitia MapLink Pro: The Ultimate Mapping Application Toolkit
All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages
Loading...
Searching...
No Matches
TSLInteractionModeMagnify Class Reference
Inheritance diagram for TSLInteractionModeMagnify:

Detailed Description

This is a simple interaction mode for handling the magnifying glass.

The user's application creates an instance of one these classes and adds it to a TSLInteractionModeManager.

During mouse move events, a magnifying glass is displayed. When an RButtonUp event occurs, the mode resets to the default mode.

The border around the magnifying glass may be specified using the magnifyingGlassBorder method.

The size and offset of the magnifying glass may be set using the magnifyingGlassProperties method.

The magnification factor may be set and queried using the magnificationFactor methods. Optionally the default value may be set. The current magnification factor is reset to the default value each time the mode is activation.

Public Member Functions

 TSLInteractionModeMagnify (int modeID, const char *prompt="Mouse move to change magnified area, Right button click to finish", bool middleButtonPansToPoint=true)
 
virtual ~TSLInteractionModeMagnify ()
 
void activate ()
 
bool clearBackgroundColour ()
 
void deactivate ()
 
int getBackgroundColour () const
 
void magnifyingGlassBorder (TSLDeviceUnits thickness, int red, int green, int blue)
 
double magnifyingFactor (bool getDefault=false)
 
void magnifyingFactor (double factor, bool setDefault=false)
 
void magnifyingGlassProperties (double radius, double offset)
 
virtual void onSize (TSLDeviceUnits cx, TSLDeviceUnits cy)
 
virtual bool onMouseMove (TSLButtonType button, TSLDeviceUnits x, TSLDeviceUnits y, bool shift, bool control)
 
virtual bool onRButtonUp (TSLDeviceUnits x, TSLDeviceUnits y, bool shift, bool control)
 
virtual void onDraw (TSLDeviceUnits x1, TSLDeviceUnits y1, TSLDeviceUnits x2, TSLDeviceUnits y2)
 
TSLCursorStyle queryCursor ()
 
virtual const char * queryPrompt ()
 
virtual void setDisplay (TSLInteractionModeDisplay *display)
 
void * operator new (size_t size) TSL_NO_THROW
 
void operator delete (void *self)
 
void * operator new (size_t size, char *filename, int line)
 
void setBackgroundColour (int red, int green, int blue)
 
- Public Member Functions inherited from TSLInteractionMode
virtual ~TSLInteractionMode ()
 
virtual bool onLButtonDown (TSLDeviceUnits x, TSLDeviceUnits y, bool shift, bool control)
 
virtual bool onLButtonUp (TSLDeviceUnits x, TSLDeviceUnits y, bool shift, bool control)
 
virtual bool onMButtonDown (TSLDeviceUnits x, TSLDeviceUnits y, bool shift, bool control)
 
virtual bool onMButtonUp (TSLDeviceUnits x, TSLDeviceUnits y, bool shift, bool control)
 
virtual bool onMouseWheel (short delta, TSLDeviceUnits x, TSLDeviceUnits y, int zoomPercentage, bool lockCursorLocation)
 
virtual bool onRButtonDown (TSLDeviceUnits x, TSLDeviceUnits y, bool shift, bool control)
 
virtual bool onGestureZoom (TSLDeviceUnits cx, TSLDeviceUnits cy, double zoomFactor)
 
virtual bool onGesturePan (TSLDeviceUnits startx, TSLDeviceUnits starty, TSLDeviceUnits endx, TSLDeviceUnits endy)
 
virtual bool onGestureRotate (TSLDeviceUnits cx, TSLDeviceUnits cy, double dblAngle)
 
virtual bool onGestureTap (TSLDeviceUnits x, TSLDeviceUnits y)
 
virtual bool onGesturePressAndTap (TSLDeviceUnits firstFingerX, TSLDeviceUnits firstFingerY, long lDelta)
 
virtual bool onGestureTwoFingerTap (TSLDeviceUnits cx, TSLDeviceUnits cy)
 
int id ()
 

Additional Inherited Members

- Protected Member Functions inherited from TSLInteractionMode
 TSLInteractionMode (int modeID, bool middleButtonPansToPoint=true)
 
- Protected Attributes inherited from TSLInteractionMode
int m_id
 
TSLDrawingSurfacem_drawingSurface
 
bool m_middleButtonPansToPoint
 
TSLInteractionModeDisplaym_display
 

Constructor & Destructor Documentation

◆ TSLInteractionModeMagnify()

TSLInteractionModeMagnify::TSLInteractionModeMagnify ( int modeID,
const char * prompt = "Mouse move to change magnified area, Right button click to finish",
bool middleButtonPansToPoint = true )

Constructor for magnify interaction mode class.

Parameters
modeIDThis ID is not used by the mode itself, but is used as a unique identified by the mode manager.
promptDefaulted to interaction description. Prompt to return from queryPrompt method.
middleButtonPansToPointDefaults to true. This flag allows modes to easily provide standard behaviour for pressing of the middle button - typically the mouse wheel.

◆ ~TSLInteractionModeMagnify()

virtual TSLInteractionModeMagnify::~TSLInteractionModeMagnify ( )
virtual

See this class description and base class method description for further details

Member Function Documentation

◆ activate()

void TSLInteractionModeMagnify::activate ( )
virtual

See this class description and base class method description for further details

Reimplemented from TSLInteractionMode.

◆ clearBackgroundColour()

bool TSLInteractionModeMagnify::clearBackgroundColour ( )

Clears the background colour of the Magnifying Glass so that anything beneath shall be visible.

◆ deactivate()

void TSLInteractionModeMagnify::deactivate ( )
virtual

See this class description and base class method description for further details

Reimplemented from TSLInteractionMode.

◆ getBackgroundColour()

int TSLInteractionModeMagnify::getBackgroundColour ( ) const

This method returns the background colour for the magnifying glass.

Returns the background colour of the magnifying glass or -1 if the colour is not defined. The return value will either be a colour index or a composed RGB value. See tslcolourhelper.h for information on determining the type and in the case of an RGB value uncomposing it back into its respective components.

◆ magnifyingFactor() [1/2]

double TSLInteractionModeMagnify::magnifyingFactor ( bool getDefault = false)

Query the current or default magnifying factor.

The current factor is reset to the default factor whenever the mode is activated. A larger factor will magnify more, a small factor will magnify less.

Parameters
getDefaultDefault false. Flag indicating whether the default factor should be queried.
Returns
the magnifying factor requested - either current or default.

◆ magnifyingFactor() [2/2]

void TSLInteractionModeMagnify::magnifyingFactor ( double factor,
bool setDefault = false )

Set the current or default magnifying factor.

The current factor is reset to the default factor whenever the mode is activated. A larger factor will magnify more, a small factor will magnify less.

Parameters
factorNew factor to use.
setDefaultDefault false. Flag indicating whether the default factor should be set. The default default factor is '15.0'!

◆ magnifyingGlassBorder()

void TSLInteractionModeMagnify::magnifyingGlassBorder ( TSLDeviceUnits thickness,
int red,
int green,
int blue )

Set the rendering attributes for the border around the magnifying glass.

Parameters
thicknessThe thickness of the border, in pixels.
red,green,blueRGB components of colour used for border.

◆ magnifyingGlassProperties()

void TSLInteractionModeMagnify::magnifyingGlassProperties ( double radius,
double offset )

Set the size and offset properties for he magnifying glass.

Parameters
radiusThe radius of the magnifying glass, as a percentage of the drawing surface width. Thus a larger size gives a bigger magnifying glass. The default value is 15.0
offsetThe offset of the centre of magnifying glass as a multiple of the size. This a value of 0.0 makes the magnifying glass appear centred at the cursor location obscuring the map underneath and a value of 1.0 has the boundary circle of the magnifying glass at the cursor location. The default offset is 1.8

◆ onDraw()

virtual void TSLInteractionModeMagnify::onDraw ( TSLDeviceUnits x1,
TSLDeviceUnits y1,
TSLDeviceUnits x2,
TSLDeviceUnits y2 )
virtual

See this class description and base class method description for further details

Reimplemented from TSLInteractionMode.

◆ onMouseMove()

virtual bool TSLInteractionModeMagnify::onMouseMove ( TSLButtonType button,
TSLDeviceUnits x,
TSLDeviceUnits y,
bool shift,
bool control )
virtual

See this class description and base class method description for further details

Reimplemented from TSLInteractionMode.

◆ onRButtonUp()

virtual bool TSLInteractionModeMagnify::onRButtonUp ( TSLDeviceUnits x,
TSLDeviceUnits y,
bool shift,
bool control )
virtual

See this class description and base class method description for further details

Reimplemented from TSLInteractionMode.

◆ onSize()

virtual void TSLInteractionModeMagnify::onSize ( TSLDeviceUnits cx,
TSLDeviceUnits cy )
virtual

See this class description and base class method description for further details

Reimplemented from TSLInteractionMode.

◆ operator delete()

void TSLInteractionModeMagnify::operator delete ( void * self)

◆ operator new() [1/2]

void * TSLInteractionModeMagnify::operator new ( size_t size)

◆ operator new() [2/2]

void * TSLInteractionModeMagnify::operator new ( size_t size,
char * filename,
int line )

When included in an MFC application in debug mode, the debug new expects this to be here. Override it and return the same as the normal one. The library must include it when compiled in release mode, since the user's application may be in debug mode.

◆ queryCursor()

TSLCursorStyle TSLInteractionModeMagnify::queryCursor ( )
virtual

See this class description and base class method description for further details

Reimplemented from TSLInteractionMode.

◆ queryPrompt()

virtual const char * TSLInteractionModeMagnify::queryPrompt ( )
virtual

See this class description and base class method description for further details

Reimplemented from TSLInteractionMode.

◆ setBackgroundColour()

void TSLInteractionModeMagnify::setBackgroundColour ( int red,
int green,
int blue )
inline

Set the background colour of the magnifying glass.

Parameters
red,green,blueRGB components of the background colour.

◆ setDisplay()

virtual void TSLInteractionModeMagnify::setDisplay ( TSLInteractionModeDisplay * display)
virtual

Internal function called by the mode manager to bind an instance of TSLInteractionModeDisplay to the mode.

Reimplemented from TSLInteractionMode.