##

ViewController Class Referenceabstract
Rendering

Base class for view controllers. More...

`#include <rendering/rendering.hh>`

Inherited by FPSViewController, and OrbitViewController.

## Public Member Functions

| ViewController (UserCameraPtr _camera)
| Constructor. More...
virtual | ~ViewController ()
| Destructor. More...
std::string | GetTypeString () const
| Get the type of view controller. More...
virtual void | HandleKeyPressEvent (const std::string &_key)=0
| Handle a key press event. More...
virtual void | HandleKeyReleaseEvent (const std::string &_key)=0
| Handle a key release event. More...
virtual void | HandleMouseEvent (const common::MouseEvent &_event)=0
| Handle a mouse event. More...
virtual void | Init ()=0
| Initialize the view controller. More...
virtual void | Init (const ignition::math::Vector3d &_focalPoint, const double _yaw=0, const double _pitch=0)
| Initialize with a focus point. More...
virtual void | Resize (const unsigned int _width, const unsigned int _height)
| Called by the UserCamera when a resize event occurs. More...
void | SetEnabled (bool _value)
| Set whether the controller is enabled. More...
virtual void | Update ()=0
| Update the controller, which should update the position of the Camera. More...

## Protected Attributes

UserCameraPtr | camera
| Pointer to the camera to control. More...
bool | enabled
| True if enabled. More...
std::string | typeString
| Type of view controller. More...

## Detailed Description

Base class for view controllers.

## Constructor & Destructor Documentation

## ViewController()

ViewController | ( | UserCameraPtr | _camera | ) |

explicit

Constructor.

Parameters

  [in] | _camera | The user camera to controll.

## ~ViewController()

virtual ~ViewController | ( |  | ) |

virtual

Destructor.

## Member Function Documentation

## GetTypeString()

std::string GetTypeString | ( |  | ) | const

Get the type of view controller.

Returns
  The view controller type string.

## HandleKeyPressEvent()

virtual void HandleKeyPressEvent | ( | const std::string & | _key | ) |

pure virtual

Handle a key press event.

Parameters

  [in] | _key | The key that was pressed.

Implemented in OrbitViewController, and FPSViewController.

## HandleKeyReleaseEvent()

virtual void HandleKeyReleaseEvent | ( | const std::string & | _key | ) |

pure virtual

Handle a key release event.

Parameters

  [in] | _key | The key that was released.

Implemented in OrbitViewController, and FPSViewController.

## HandleMouseEvent()

virtual void HandleMouseEvent | ( | const common::MouseEvent & | _event | ) |

pure virtual

Handle a mouse event.

Parameters

  [in] | _event | The mouse position.

Implemented in OrbitViewController, OrthoViewController, and FPSViewController.

## Init() [1/2]

virtual void Init | ( |  | ) |

pure virtual

Initialize the view controller.

Implemented in OrbitViewController, OrthoViewController, and FPSViewController.

## Init() [2/2]

virtual void Init | ( | const ignition::math::Vector3d & | _focalPoint,
|  | const double | _yaw = `0`,
|  | const double | _pitch = `0`
| ) |  |

virtual

Initialize with a focus point.

Parameters

  [in] | _focalPoint | The point to look at.
  [in] | _yaw | Initial yaw angle.
  [in] | _pitch | Initial pitch angle.

Reimplemented in OrbitViewController, and OrthoViewController.

## Resize()

virtual void Resize | ( | const unsigned int | _width,
|  | const unsigned int | _height
| ) |  |

virtual

Called by the UserCamera when a resize event occurs.

Parameters

  [in] | _width | New width
  [in] | _height | New height

Reimplemented in OrthoViewController.

## SetEnabled()

void SetEnabled | ( | bool | _value | ) |

Set whether the controller is enabled.

Parameters

  [in] | _value | True if the controller is enabled.

## Update()

virtual void Update | ( |  | ) |

pure virtual

Update the controller, which should update the position of the Camera.

Implemented in OrbitViewController, and FPSViewController.

## Member Data Documentation

## camera

UserCameraPtr camera

protected

Pointer to the camera to control.

## enabled

bool enabled

protected

True if enabled.

## typeString

std::string typeString

protected

Type of view controller.

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

- ViewController.hh