Main Page Namespace List Class Hierarchy Alphabetical List Compound List File List Namespace Members Compound Members File Members Related Pages

# Ogre::Cursor Class Reference

The Cursor is an non-visual object that contains a the XYZ values that are modified by a InputReader. More...

`#include <OgreCursor.h>`

Inheritance diagram for Ogre::Cursor:

[legend]
List of all members.

## Public Methods

| Cursor ()
virtual | ~Cursor ()
void | addToX (Real val)
| add relative amount to X
void | addToY (Real val)
| add relative amount to Y
void | addToZ (Real val)
| add relative amount to Z
void | processEvent (InputEvent *e)
| process the mouse events that are for any listeners to the cursor
Real | getX () const
| get the current X position of the cursor 0 left, 1 right
Real | getY () const
| get the current Y position of the cursor 0 top, 1 bottom
Real | getZ () const
| get the current Z position of the cursor 0 none, 1 full
Real | getRelX () const
| get relative X cursor movement
Real | getRelY () const
| get relative Y cursor movement
Real | getRelZ () const
| get relative Z cursor movement
Real | getLeft (void) const
| Gets the left of this element in relation to the screen (where 0 = far left, 1.0 = far right).
Real | getTop (void) const
| Gets the top of this element in relation to the screen (where 0 = top, 1.0 = bottom).
PositionTarget * | getPositionTargetParent () const
| The parent of the cursor is NULL as it's position is absolute in the window.
virtual bool | isKeyEnabled () const
Real | getScale (void) const
| Gets the current cursor movement scaling factor.
void | setScale (Real scale)
| Sets the current cursor movement scaling factor.
void | processMouseMotionEvent (MouseEvent *e)
void | addMouseMotionListener (MouseMotionListener *l)
void | removeMouseMotionListener (MouseMotionListener *l)
void | processMouseEvent (MouseEvent *e)
void | addMouseListener (MouseListener *l)
void | removeMouseListener (MouseListener *l)
bool | isMouseWithin () const

## Protected Methods

Real | limit (Real val, Real low, Real high)
| inline function to clip a value to its low and high limits

## Protected Attributes

Real | mMouseX
| Cursor position.
Real | mMouseY
| Cursor position.
Real | mMouseZ
| Cursor position.
Real | mRelX
| relative cursor position
Real | mRelY
| relative cursor position
Real | mRelZ
| relative cursor position
Real | mXLowLimit
| Cursor limits 0-1.
Real | mXHighLimit
| Cursor limits 0-1.
Real | mYLowLimit
| Cursor limits 0-1.
Real | mYHighLimit
| Cursor limits 0-1.
Real | mZLowLimit
| Cursor limits 0-1.
Real | mZHighLimit
| Cursor limits 0-1.
Real | mScale
| Scale the cursor movements.
MouseMotionListener * | mMouseMotionListener
MouseListener * | mMouseListener
bool | mMouseWithin

## Detailed Description

The Cursor is an non-visual object that contains a the XYZ values that are modified by a InputReader.

Remarks:
  An InputReader creates and contains a Cursor object that it uses when it is set to buffered input (using the EventQueue).

To get a graphical representation of the cursor, a CursorGuiElement is used, which is a MouseMotionListener to the Cursor.

Definition at line 60 of file OgreCursor.h.

## Constructor & Destructor Documentation

Ogre::Cursor::Cursor | ( |  | ) |

| Definition at line 35 of file OgreCursor.cpp. References mMouseX, mMouseY, mMouseZ, mRelX, mRelY, mRelZ, mScale, mXHighLimit, mXLowLimit, mYHighLimit, mYLowLimit, mZHighLimit, and mZLowLimit.

Ogre::Cursor::~Cursor | ( |  | ) | `[virtual]`

| Definition at line 58 of file OgreCursor.cpp.

## Member Function Documentation

void Ogre::MouseTarget::addMouseListener | ( | MouseListener * | l | ) | `[inherited]`

| Definition at line 87 of file OgreMouseTarget.cpp. References Ogre::MouseTarget::mMouseListener. Referenced by Ogre::ListGuiElement::addListItem(), Ogre::ScrollBarGuiElement::setScrollBitName(), and Ogre::GuiPressable::setSource().

void Ogre::MouseMotionTarget::addMouseMotionListener | ( | MouseMotionListener * | l | ) | `[inherited]`

| Definition at line 66 of file OgreMouseMotionTarget.cpp. References Ogre::MouseMotionTarget::mMouseMotionListener. Referenced by Ogre::InputReader::addCursorMoveListener(), Ogre::ListGuiElement::addListItem(), Ogre::PopupMenuGuiElement::PopupMenuGuiElement(), and Ogre::ScrollBarGuiElement::setScrollBitName().

void Ogre::Cursor::addToX | ( | Real | val | ) |

| add relative amount to X Definition at line 63 of file OgreCursor.cpp. References limit(), mMouseX, mRelX, mScale, mXHighLimit, mXLowLimit, and Ogre::Real. Referenced by Ogre::GLXInput::capture(), Ogre::SDLInput::processBufferedMouse(), and Ogre::Win32Input8::readBufferedMouseData().

void Ogre::Cursor::addToY | ( | Real | val | ) |

| add relative amount to Y Definition at line 71 of file OgreCursor.cpp. References limit(), mMouseY, mRelY, mScale, mYHighLimit, mYLowLimit, and Ogre::Real. Referenced by Ogre::GLXInput::capture(), Ogre::SDLInput::processBufferedMouse(), and Ogre::Win32Input8::readBufferedMouseData().

void Ogre::Cursor::addToZ | ( | Real | val | ) |

| add relative amount to Z Definition at line 79 of file OgreCursor.cpp. References limit(), mMouseZ, mRelZ, mScale, mZHighLimit, mZLowLimit, and Ogre::Real. Referenced by Ogre::Win32Input8::readBufferedMouseData().

Real Ogre::Cursor::getLeft | ( | void |  | ) | const`[virtual]`

| Gets the left of this element in relation to the screen (where 0 = far left, 1.0 = far right). Implements Ogre::PositionTarget. Definition at line 128 of file OgreCursor.cpp. References getX(), and Ogre::Real.

PositionTarget * Ogre::Cursor::getPositionTargetParent | ( |  | ) | const`[virtual]`

| The parent of the cursor is NULL as it's position is absolute in the window. Implements Ogre::PositionTarget. Definition at line 141 of file OgreCursor.cpp.

Real Ogre::Cursor::getRelX | ( |  | ) | const

| get relative X cursor movement Definition at line 106 of file OgreCursor.h. References Ogre::Real. Referenced by Ogre::InputReader::createMouseEvent().

Real Ogre::Cursor::getRelY | ( |  | ) | const

| get relative Y cursor movement Definition at line 109 of file OgreCursor.h. References Ogre::Real. Referenced by Ogre::InputReader::createMouseEvent().

Real Ogre::Cursor::getRelZ | ( |  | ) | const

| get relative Z cursor movement Definition at line 112 of file OgreCursor.h. References Ogre::Real. Referenced by Ogre::InputReader::createMouseEvent().

Real Ogre::Cursor::getScale | ( | void |  | ) | const

| Gets the current cursor movement scaling factor. Definition at line 130 of file OgreCursor.h. References Ogre::Real.

Real Ogre::Cursor::getTop | ( | void |  | ) | const`[virtual]`

| Gets the top of this element in relation to the screen (where 0 = top, 1.0 = bottom). Implements Ogre::PositionTarget. Definition at line 134 of file OgreCursor.cpp. References getY(), and Ogre::Real.

Real Ogre::Cursor::getX | ( |  | ) | const

| get the current X position of the cursor 0 left, 1 right Definition at line 110 of file OgreCursor.cpp. References mMouseX, and Ogre::Real. Referenced by Ogre::InputReader::createMouseEvent(), and getLeft().

Real Ogre::Cursor::getY | ( |  | ) | const

| get the current Y position of the cursor 0 top, 1 bottom Definition at line 116 of file OgreCursor.cpp. References mMouseY, and Ogre::Real. Referenced by Ogre::InputReader::createMouseEvent(), and getTop().

Real Ogre::Cursor::getZ | ( |  | ) | const

| get the current Z position of the cursor 0 none, 1 full Definition at line 122 of file OgreCursor.cpp. References mMouseZ, and Ogre::Real. Referenced by Ogre::InputReader::createMouseEvent().

virtual bool Ogre::Cursor::isKeyEnabled | ( |  | ) | const`[virtual]`

| Implements Ogre::PositionTarget. Definition at line 126 of file OgreCursor.h.

bool Ogre::MouseTarget::isMouseWithin | ( |  | ) | const`[inherited]`

| Definition at line 106 of file OgreMouseTarget.cpp. References Ogre::MouseTarget::mMouseWithin. Referenced by Ogre::ButtonGuiElement::updateMaterials(), and Ogre::BorderButtonGuiElement::updateMaterials().

Real Ogre::Cursor::limit | ( | Real | val,
|  | Real | low,
|  | Real | high
| ) | `[protected]`

| inline function to clip a value to its low and high limits Definition at line 77 of file OgreCursor.h. References Ogre::Real. Referenced by addToX(), addToY(), and addToZ().

void Ogre::Cursor::processEvent | ( | InputEvent * | e | ) | `[virtual]`

| process the mouse events that are for any listeners to the cursor Implements Ogre::EventTarget. Definition at line 87 of file OgreCursor.cpp. References Ogre::InputEvent::getID(), mRelX, mRelY, mRelZ, Ogre::MouseTarget::processMouseEvent(), and Ogre::MouseMotionTarget::processMouseMotionEvent(). Referenced by Ogre::InputReader::createMouseEvent().

void Ogre::MouseTarget::processMouseEvent | ( | MouseEvent * | e | ) | `[inherited]`

Definition at line 47 of file OgreMouseTarget.cpp.

References Ogre::InputEvent::getID(), Ogre::MouseTarget::mMouseListener, Ogre::MouseTarget::mMouseWithin, Ogre::MouseListener::mouseClicked(), Ogre::MouseListener::mouseDragDropped(), Ogre::MouseListener::mouseDragEntered(), Ogre::MouseListener::mouseDragExited(), Ogre::MouseListener::mouseEntered(), Ogre::MouseListener::mouseExited(), Ogre::MouseListener::mousePressed(), and Ogre::MouseListener::mouseReleased().

Referenced by Ogre::GuiElement::processEvent(), Ogre::EventProcessor::processEvent(), and processEvent().

void Ogre::MouseMotionTarget::processMouseMotionEvent | ( | MouseEvent * | e | ) | `[inherited]`

| Definition at line 45 of file OgreMouseMotionTarget.cpp. References Ogre::InputEvent::getID(), Ogre::MouseMotionTarget::mMouseMotionListener, Ogre::MouseMotionListener::mouseDragged(), Ogre::MouseMotionListener::mouseDragMoved(), and Ogre::MouseMotionListener::mouseMoved(). Referenced by Ogre::GuiElement::processEvent(), Ogre::EventProcessor::processEvent(), and processEvent().

void Ogre::MouseTarget::removeMouseListener | ( | MouseListener * | l | ) | `[inherited]`

| Definition at line 96 of file OgreMouseTarget.cpp. References Ogre::MouseTarget::mMouseListener.

void Ogre::MouseMotionTarget::removeMouseMotionListener | ( | MouseMotionListener * | l | ) | `[inherited]`

| Definition at line 75 of file OgreMouseMotionTarget.cpp. References Ogre::MouseMotionTarget::mMouseMotionListener. Referenced by Ogre::InputReader::removeCursorMoveListener().

void Ogre::Cursor::setScale | ( | Real | scale | ) |

| Sets the current cursor movement scaling factor. Definition at line 132 of file OgreCursor.h. References Ogre::Real.

## Member Data Documentation

MouseListener* Ogre::MouseTarget::mMouseListener`[protected, inherited]`

| Definition at line 60 of file OgreMouseTarget.h. Referenced by Ogre::MouseTarget::addMouseListener(), Ogre::GuiElement::GuiElement(), Ogre::MouseTarget::MouseTarget(), Ogre::MouseTarget::processMouseEvent(), and Ogre::MouseTarget::removeMouseListener().

MouseMotionListener* Ogre::MouseMotionTarget::mMouseMotionListener`[protected, inherited]`

| Definition at line 59 of file OgreMouseMotionTarget.h. Referenced by Ogre::MouseMotionTarget::addMouseMotionListener(), Ogre::MouseMotionTarget::MouseMotionTarget(), Ogre::MouseMotionTarget::processMouseMotionEvent(), and Ogre::MouseMotionTarget::removeMouseMotionListener().

bool Ogre::MouseTarget::mMouseWithin`[protected, inherited]`

| Definition at line 63 of file OgreMouseTarget.h. Referenced by Ogre::MouseTarget::isMouseWithin(), Ogre::MouseTarget::MouseTarget(), and Ogre::MouseTarget::processMouseEvent().

Real Ogre::Cursor::mMouseX`[protected]`

| Cursor position. Definition at line 64 of file OgreCursor.h. Referenced by addToX(), Cursor(), and getX().

Real Ogre::Cursor::mMouseY`[protected]`

| Cursor position. Definition at line 64 of file OgreCursor.h. Referenced by addToY(), Cursor(), and getY().

Real Ogre::Cursor::mMouseZ`[protected]`

| Cursor position. Definition at line 64 of file OgreCursor.h. Referenced by addToZ(), Cursor(), and getZ().

Real Ogre::Cursor::mRelX`[protected]`

| relative cursor position Definition at line 67 of file OgreCursor.h. Referenced by addToX(), Cursor(), and processEvent().

Real Ogre::Cursor::mRelY`[protected]`

| relative cursor position Definition at line 67 of file OgreCursor.h. Referenced by addToY(), Cursor(), and processEvent().

Real Ogre::Cursor::mRelZ`[protected]`

| relative cursor position Definition at line 67 of file OgreCursor.h. Referenced by addToZ(), Cursor(), and processEvent().

Real Ogre::Cursor::mScale`[protected]`

| Scale the cursor movements. Initially set at 1 (no scaling). The scaling effects all axis, XYZ Definition at line 74 of file OgreCursor.h. Referenced by addToX(), addToY(), addToZ(), and Cursor().

Real Ogre::Cursor::mXHighLimit`[protected]`

| Cursor limits 0-1. Definition at line 70 of file OgreCursor.h. Referenced by addToX(), and Cursor().

Real Ogre::Cursor::mXLowLimit`[protected]`

| Cursor limits 0-1. Definition at line 70 of file OgreCursor.h. Referenced by addToX(), and Cursor().

Real Ogre::Cursor::mYHighLimit`[protected]`

| Cursor limits 0-1. Definition at line 70 of file OgreCursor.h. Referenced by addToY(), and Cursor().

Real Ogre::Cursor::mYLowLimit`[protected]`

| Cursor limits 0-1. Definition at line 70 of file OgreCursor.h. Referenced by addToY(), and Cursor().

Real Ogre::Cursor::mZHighLimit`[protected]`

| Cursor limits 0-1. Definition at line 70 of file OgreCursor.h. Referenced by addToZ(), and Cursor().

Real Ogre::Cursor::mZLowLimit`[protected]`

| Cursor limits 0-1. Definition at line 70 of file OgreCursor.h. Referenced by addToZ(), and Cursor().

The documentation for this class was generated from the following files:

- OgreCursor.h
- OgreCursor.cpp

Copyright © 2002-2003 by The OGRE Team
Last modified Sun Nov 28 19:50:51 2004