ui::SelectionManager Class Reference

Collaboration diagram for ui::SelectionManager:

Collaboration graph
[legend]
List of all members.

Detailed Description

SelectionManager handles picking of objects. How this works, you can read at: http://www.bramstein.nl in the articles section. A short description of the mouse handling follows. MouseMotion: A mousemotion event is sent each frame to the currently focused (selected) component. This is done so that a Component can receive MouseMotion events while the mouse is not actually located at the Component. MouseEntered, MouseExited: The mouse location is checked every frame, and each time the mouse enters or exits an event is sent, this happens independently from the other events. MouseClicked, MousePressed, MouseReleased: when a mouse is pressed, the current location is probed for a Component, and if found, events are sent.
Note:
This is a Singleton object.


Public Types

enum  RENDERMODE { NORMAL, SELECTION }

Public Member Functions

void setRenderMode (int m)
int getRenderMode () const
void addComponent (Component *comp)
void removeComponent (Component *comp)
int getComponentId (Component *comp) const
void beginUpdate (int x, int y)
ComponentgetComponentAt (int x, int y) const
void mouseMotion (int x, int y)
void mousePressed (int button)
void mouseReleased (int button)

Static Public Member Functions

SelectionManagergetInstance ()


Member Enumeration Documentation

enum ui::SelectionManager::RENDERMODE
 

Enumeration values:
NORMAL  Normal render mode.
SELECTION  Selection render mode.


Member Function Documentation

void ui::SelectionManager::setRenderMode int  m  ) 
 

Sets the rendermode.

Parameters:
m Rendermode to use.
See also:
RENDERMODE

int ui::SelectionManager::getRenderMode  )  const
 

Returns the currently used render mode.

void ui::SelectionManager::addComponent Component comp  ) 
 

Register a component with the SelectionManager. Registering means that the object will be pickable, and receive mouse input.

Parameters:
comp Component to add.

void ui::SelectionManager::removeComponent Component comp  ) 
 

Unregister a component with the SelectionManager.

Parameters:
comp Component to remove.

int ui::SelectionManager::getComponentId Component comp  )  const
 

Returns the identifier for the given Component. The identifier is unique and can be used (and is) for calculating the unique color for picking.

Parameters:
comp The Component for which to return the id.

void ui::SelectionManager::beginUpdate int  x,
int  y
 

Begins the update. Should be called at the start of a frame.

Component * ui::SelectionManager::getComponentAt int  x,
int  y
const
 

Returns the Component located at x,y. Returns NULL(0) if no Component is present.

void ui::SelectionManager::mouseMotion int  x,
int  y
 

Input feeds. Inputs mouse motion to the SelectionManager.

void ui::SelectionManager::mousePressed int  button  ) 
 

Input feeds. A mouse button went down.

void ui::SelectionManager::mouseReleased int  button  ) 
 

Input feeds. A mouse button was released (up).

SelectionManager& ui::SelectionManager::getInstance  )  [inline, static]
 

Returns an instance of the SelectionManager.


Generated on Mon Jun 20 19:41:45 2005 for UI by doxygen 1.3.1 using KingsTools