![]() |
MapLink Pro 11.1.1.0.
Envitia MapLink Pro: The Ultimate Mapping Application Toolkit
|
This is the base class for a simple 3D interaction mode handling system. This allows the various interaction modes such as zoom and pan to be implemented in an encapsulated and operating system independent manner.
The user's application creates an instance of one the TSL3DInteractionMode derived classes and passes it to an instance of a TSL3DInteractionMode Manager derived class. The 'm_display' attribute of this base class provides access to useful methods for interacting and querying the drawing surface to which the mode is attached. It also provides basic echo rectangle and line handling. The 'm_cameraManager' method of this base class provides access to derived values based on the camera of the attached drawing surface.
When the application wants to activate this mode, it passes the id to the mode manager. All subsequent mouse events are passed to the mode - until it is replaced by another. When a mode becomes active, the 'activate' method is triggered. When a mode becomes inactive, the 'deactivate' method is triggered. The mode event handlers typically return true to indicate that the view should be redrawn.
Any derived mode should ensure that the 'viewChanged' method and 'resetMode' methods are triggered when the view has been changed, or when the current mode has finished and should be reset to the default mode.
Some event handlers have specific default behaviours. See individual handlers for further details. Most other handlers in this base class return false to indicate that no redraw is required. In the derived classes, only those locator methods that are actually useful need to be overridden.
Note: If you are not using the same version of the compiler that MapLink was built with then any user derived classes that have been added to a TSLInteractionModeManager through the addMode() method should be removed from the mode manager before the manager is deleted in order to ensure memory is freed using the correct heap.
Public Member Functions | |
virtual | ~TSL3DInteractionMode () |
virtual void | activate () |
virtual void | deactivate () |
virtual void | onDraw (TSLDeviceUnits x1, TSLDeviceUnits y1, TSLDeviceUnits x2, TSLDeviceUnits y2) |
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 | onMouseMove (TSLButtonType button, TSLDeviceUnits x, TSLDeviceUnits y, bool shift, bool control) |
virtual bool | onMouseWheel (short delta, TSLDeviceUnits x, TSLDeviceUnits y) |
virtual bool | onRButtonUp (TSLDeviceUnits x, TSLDeviceUnits y, bool shift, bool control) |
virtual bool | onRButtonDown (TSLDeviceUnits x, TSLDeviceUnits y, bool shift, bool control) |
virtual void | onSize (TSLDeviceUnits cx, TSLDeviceUnits cy) |
virtual TSLCursorStyle | queryCursor () |
virtual const char * | queryPrompt () |
virtual void | setDisplay (TSL3DInteractionModeDisplay *display) |
int | id () const |
Protected Member Functions | |
TSL3DInteractionMode (int modeID) | |
Protected Attributes | |
int | m_id |
TSL3DInteractionModeDisplay * | m_display |
TSL3DInteractionCameraManager * | m_cameraManager |
TSL3DDrawingSurface * | m_drawingSurface |
bool | m_pressed |
|
virtual |
Destructor for the interaction mode
|
protected |
|
virtual |
This method is triggered when a mode is activated by the user - and therefore becomes the current mode.
Reimplemented in TSL3DInteractionModeTrackballEyepoint, and TSL3DInteractionModeTrackballWorld.
|
virtual |
This method is triggered when a mode is deactivated by the user - and therefore is no longer the current mode.
The derived class should clear any echo lines that may be active and generally tidy up after itself.
Reimplemented in TSL3DInteractionModeTrackballEyepoint, and TSL3DInteractionModeTrackballWorld.
|
inline |
Query the unique id passed in the constructor.
|
virtual |
Event handler for the paint method.
The default handler does nothing.
(x1,y1) | Bottom left, in device units, of the area being redrawn. |
(x2,y2) | Top right, in device units, of the area being redrawn. |
|
virtual |
Locator handler for interaction modes. This event will be passed on to the currently active mode.
The default base implementation returns false.
(x,y) | Position of locator event, in device unit coordinates. |
shift | Flag to indicate whether the shift key is pressed. An interaction mode may use this to modify its behaviour. |
control | Flag to indicate whether the control key is pressed. An interaction mode may use this to modify its behaviour. |
Reimplemented in TSL3DInteractionModeTrackballEyepoint, and TSL3DInteractionModeTrackballWorld.
|
virtual |
Locator handler for interaction modes. This event will be passed on to the currently active mode.
The default base implementation returns false.
(x,y) | Position of locator event, in device unit coordinates. |
shift | Flag to indicate whether the shift key is pressed. An interaction mode may use this to modify its behaviour. |
control | Flag to indicate whether the control key is pressed. An interaction mode may use this to modify its behaviour. |
Reimplemented in TSL3DInteractionModeTrackballEyepoint, and TSL3DInteractionModeTrackballWorld.
|
virtual |
Locator handler for interaction modes. This event will be passed on to the currently active mode.
The default base implementation returns false.
(x,y) | Position of locator event, in device unit coordinates. |
shift | Flag to indicate whether the shift key is pressed. An interaction mode may use this to modify its behaviour. |
control | Flag to indicate whether the control key is pressed. An interaction mode may use this to modify its behaviour. |
Reimplemented in TSL3DInteractionModeTrackballWorld.
|
virtual |
Locator handler for interaction modes. This event will be passed on to the currently active mode.
The default base implementation returns false.
(x,y) | Position of locator event, in device unit coordinates. |
shift | Flag to indicate whether the shift key is pressed. An interaction mode may use this to modify its behaviour. |
control | Flag to indicate whether the control key is pressed. An interaction mode may use this to modify its behaviour. |
Reimplemented in TSL3DInteractionModeTrackballWorld.
|
virtual |
Mouse move handlers for interaction mode base class
The default base class implementations all do nothing and return false.
button | Type of button pressed, if any. |
(x,y) | Position of locator event, in device unit co-ordinates. |
shift | Flag to indicate whether the shift key is pressed. An interaction mode may use this to modify its behaviour. |
control | Flag to indicate whether the control key is pressed. An interaction mode may use this to modify its behaviour. |
Reimplemented in TSL3DInteractionModeTrackballEyepoint, and TSL3DInteractionModeTrackballWorld.
|
virtual |
Mouse wheel hander for interaction modes. This event will be passed on to the currently active mode.
delta | Delta value of mouse wheel movement. See Windows help for further information. |
(x,y) | Position of locator event, in device unit coordinates. |
Reimplemented in TSL3DInteractionModeTrackballEyepoint, and TSL3DInteractionModeTrackballWorld.
|
virtual |
Locator handler for interaction modes. This event will be passed on to the currently active mode.
The default base implementation returns false.
(x,y) | Position of locator event, in device unit coordinates. |
shift | Flag to indicate whether the shift key is pressed. An interaction mode may use this to modify its behaviour. |
control | Flag to indicate whether the control key is pressed. An interaction mode may use this to modify its behaviour. |
Reimplemented in TSL3DInteractionModeTrackballEyepoint, and TSL3DInteractionModeTrackballWorld.
|
virtual |
Locator handler for interaction modes. This event will be passed on to the currently active mode.
The default base implementation returns false.
(x,y) | Position of locator event, in device unit coordinates. |
shift | Flag to indicate whether the shift key is pressed. An interaction mode may use this to modify its behaviour. |
control | Flag to indicate whether the control key is pressed. An interaction mode may use this to modify its behaviour. |
Reimplemented in TSL3DInteractionModeTrackballEyepoint, and TSL3DInteractionModeTrackballWorld.
|
virtual |
Event handler for the size method.
This default handler does nothing.
cx | New width of drawing surface. |
cy | New height of drawing surface. |
|
virtual |
Query the cursor style that may be appropriate to the currently active mode.
Returns TSLCursorStyleNone if no particular cursor style is appropriate. This is also the default return value if the method is not overridden.
Reimplemented in TSL3DInteractionModeTrackballEyepoint, and TSL3DInteractionModeTrackballWorld.
|
virtual |
Query prompt to display for this mode.
The default implementation returns an empty string. It is up to the derived modes to decide what prompt to return.
Reimplemented in TSL3DInteractionModeTrackballEyepoint, and TSL3DInteractionModeTrackballWorld.
|
virtual |
Internal function called by the mode manager to bind an instance of TSL3DInteractionModeDisplay to the mode.
|
protected |
Additional Protected Declarations
|
protected |
|
protected |
|
protected |
ID of the mode, as specified during the construction.
|
protected |