Number5
Visualisierung 2 Project - Florian Schober (0828151, f.schober@live.com), Andreas Walch (0926780, walch.andreas89@gmail.com)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Private Attributes | List of all members
Picker Class Reference

#include <Picker.hpp>

Public Member Functions

id_t getFocusId () const
 
float getFocusDistance () const
 
bool hasFocusId () const
 
uint maxDistance () const
 
HighlightTargetEffecthighlightEffect ()
 
void maxDistance (uint const maxDistance)
 
void updateMode (PickerUpdateMode const mode)
 
PickerUpdateMode updateMode ()
 
void onKeyStateChanged (int key, bool pressed)
 
 Picker (Application *app)
 
void update (double time, double timeDelta)
 
void draw (double time, double timeDelta)
 
void onWindowSizeChanged (vec2 const &size)
 

Private Attributes

id_t m_focusId
 
bool m_hasFocusId
 
float m_focusDistance
 
Applicationm_app
 
QuadTree m_quadTree
 
HighlightTargetEffect m_highlightEffect
 
PickerUpdateMode m_mode
 
bool m_modeHasChanged
 

Detailed Description

Picker is used to find the nearest pickable object to the cursor in screen space. It provides information about the nearest object and its distance to the cursor.

Definition at line 23 of file Picker.hpp.

Constructor & Destructor Documentation

Picker ( Application app)

Constructs a Picker-object.

Parameters
appThe global application.

Definition at line 5 of file Picker.cpp.

Member Function Documentation

void draw ( double  time,
double  timeDelta 
)

Draws the highlight-effect to highlight the currently focused object.

Parameters
timeThe absolute frame time
timeDeltaTime since the last frame

Definition at line 106 of file Picker.cpp.

float getFocusDistance ( ) const
inline

Accessor to the maximum distance to the cursor (in city-block-distance) that an object can have

Returns
The maximum distance to the cursor (in city-block-distance) that an object can have

Definition at line 44 of file Picker.hpp.

id_t getFocusId ( ) const
inline

Accessor to the currently focused objects id.

Returns
The currently focused objects id.

Definition at line 39 of file Picker.hpp.

bool hasFocusId ( ) const
inline

Accessor to wheter the picker has a focused obejct

Returns
Wheter the picker has a focused obejct.

Definition at line 49 of file Picker.hpp.

HighlightTargetEffect& highlightEffect ( )
inline

Accessor to the highlighting effect to highlight the focused obejct

Returns
The highlighting effect to highlight the focused obejct

Definition at line 59 of file Picker.hpp.

uint maxDistance ( ) const
inline

Accessor to the maximum distance to the cursor that an object can have

Returns
The maximum distance to the cursor that an object can have

Definition at line 54 of file Picker.hpp.

void maxDistance ( uint const  maxDistance)

Accessor to the maximum distance to the cursor that an object can have

Parameters
maxDistanceThe new maximum distance to the cursor that an object can have.

Definition at line 34 of file Picker.cpp.

void onKeyStateChanged ( int  key,
bool  pressed 
)

Callback for key-state-changes. Toggles the picker-mode on F1-key.

Parameters
keyThe key
pressedWheter the key was pressed or released

Definition at line 99 of file Picker.cpp.

void onWindowSizeChanged ( vec2 const &  size)

Callback for window-size-changes. Passes this information to the quadtree (if needed) and the hightlight-effect.

Parameters
sizeThe new window-size.

Definition at line 92 of file Picker.cpp.

void update ( double  time,
double  timeDelta 
)

Updates the picker-object. Updates the quad-tree and focus-information (if needed).

Parameters
timeThe absolute frame time
timeDeltaTime since the last frame

Definition at line 42 of file Picker.cpp.

void updateMode ( PickerUpdateMode const  mode)

Accessor to the current active picker-mode

Parameters
modeThe new active picker-mode

Definition at line 18 of file Picker.cpp.

PickerUpdateMode updateMode ( )
inline

Accessor to the current active picker-mode

Returns
The current active picker-mode

Definition at line 74 of file Picker.hpp.

Member Data Documentation

Application* m_app
private

The global application

Definition at line 28 of file Picker.hpp.

float m_focusDistance
private

The distance to the cursor that the focused object has

Definition at line 27 of file Picker.hpp.

id_t m_focusId
private

The currently focused objects id

Definition at line 25 of file Picker.hpp.

bool m_hasFocusId
private

Wheter the picker has a focused obejct

Definition at line 26 of file Picker.hpp.

HighlightTargetEffect m_highlightEffect
private

A highlighting effect to highlight the focused obejct

Definition at line 30 of file Picker.hpp.

PickerUpdateMode m_mode
private

The current active picker-mode

Definition at line 31 of file Picker.hpp.

bool m_modeHasChanged
private

Wheter the picker-mode has changed since the last frame

Definition at line 32 of file Picker.hpp.

QuadTree m_quadTree
private

A quadtree to organize scene-data

Definition at line 29 of file Picker.hpp.


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