Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
gazebo::rendering::OrbitViewController Class Reference

Orbit view controller. More...

#include <OrbitViewController.hh>

Inheritance diagram for gazebo::rendering::OrbitViewController:
Inheritance graph
[legend]

Public Member Functions

 OrbitViewController (UserCameraPtr _camera, const std::string &_name="OrbitViewController")
 Constructor. More...
 
virtual ~OrbitViewController ()
 Destructor. More...
 
math::Vector3 GetFocalPoint () const
 Get the focal point. More...
 
virtual void HandleKeyPressEvent (const std::string &_key)
 Handle a key press event. More...
 
void HandleKeyReleaseEvent (const std::string &_key)
 Handle a key release event. More...
 
virtual void HandleMouseEvent (const common::MouseEvent &_event)
 Handle a mouse event. More...
 
virtual void Init ()
 Initialize the controller. More...
 
virtual void Init (const math::Vector3 &_focalPoint, const double _yaw=0, const double _pitch=0)
 Initialize with a focus point. More...
 
double Pitch () const
 
void SetDistance (float _d)
 Set the distance to the focal point. More...
 
void SetFocalPoint (const math::Vector3 &_fp)
 Set the focal point. More...
 
virtual void Update ()
 Update. More...
 
double Yaw () const
 
- Public Member Functions inherited from gazebo::rendering::ViewController
 ViewController (UserCameraPtr _camera)
 Constructor. More...
 
virtual ~ViewController ()
 Destructor. More...
 
std::string GetTypeString () const
 Get the type of view controller. 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...
 

Static Public Member Functions

static std::string GetTypeString ()
 Get the type name of this view controller. More...
 

Protected Member Functions

double NormalizePitch (double _v)
 Normalize pitch value. More...
 
double NormalizeYaw (double _v)
 Normalize yaw value. More...
 
void Orbit (double _dy, double _dp)
 Update the camera's pose based on a rotation update. More...
 
void TranslateGlobal (const math::Vector3 &_vec)
 Translate the focal point in the global coordinate frame. More...
 
void TranslateLocal (const math::Vector3 &_vec)
 Translate the focal point in the local coordinate frame. More...
 
void UpdateRefVisual ()
 Update the reference visual. More...
 
void Zoom (float _amount)
 Zoom the camera. More...
 

Protected Attributes

float distance
 Distance to the focal point. More...
 
ignition::math::Vector3d focalPoint
 The focal point. More...
 
bool init
 A flag used to inidicate that the view controller has just been initialized. More...
 
std::string key
 Key that is currently pressed. More...
 
float pitch
 Pitch value. More...
 
VisualPtr refVisual
 A reference visual. More...
 
float yaw
 Yaw value. More...
 
- Protected Attributes inherited from gazebo::rendering::ViewController
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

Orbit view controller.

Constructor & Destructor Documentation

gazebo::rendering::OrbitViewController::OrbitViewController ( UserCameraPtr  _camera,
const std::string &  _name = "OrbitViewController" 
)

Constructor.

Parameters
[in]_cameraPointer to the camera to control.
[in]_nameName of the view controller. A subclass of OrbitViewController should use a name other than "OrbitViewController".
virtual gazebo::rendering::OrbitViewController::~OrbitViewController ( )
virtual

Destructor.

Member Function Documentation

math::Vector3 gazebo::rendering::OrbitViewController::GetFocalPoint ( ) const

Get the focal point.

Returns
The focal point
static std::string gazebo::rendering::OrbitViewController::GetTypeString ( )
static

Get the type name of this view controller.

Returns
The view controller name: "orbit".
virtual void gazebo::rendering::OrbitViewController::HandleKeyPressEvent ( const std::string &  _key)
virtual

Handle a key press event.

Parameters
[in]_keyThe key that was pressed.

Implements gazebo::rendering::ViewController.

void gazebo::rendering::OrbitViewController::HandleKeyReleaseEvent ( const std::string &  _key)
virtual

Handle a key release event.

Parameters
[in]_keyThe key that was released.

Implements gazebo::rendering::ViewController.

virtual void gazebo::rendering::OrbitViewController::HandleMouseEvent ( const common::MouseEvent _event)
virtual

Handle a mouse event.

Parameters
[in]_eventThe mouse event.

Implements gazebo::rendering::ViewController.

Reimplemented in gazebo::rendering::OrthoViewController.

virtual void gazebo::rendering::OrbitViewController::Init ( )
virtual

Initialize the controller.

Implements gazebo::rendering::ViewController.

Reimplemented in gazebo::rendering::OrthoViewController.

virtual void gazebo::rendering::OrbitViewController::Init ( const math::Vector3 _focalPoint,
const double  _yaw = 0,
const double  _pitch = 0 
)
virtual

Initialize with a focus point.

Parameters
[in]_focalPointThe point to look at.
[in]_yawInitial yaw angle.
[in]_pitchInitial pitch angle.

Reimplemented from gazebo::rendering::ViewController.

Reimplemented in gazebo::rendering::OrthoViewController.

double gazebo::rendering::OrbitViewController::NormalizePitch ( double  _v)
protected

Normalize pitch value.

[in] _v Normalize a pitch value.

Returns
The normalized value.
double gazebo::rendering::OrbitViewController::NormalizeYaw ( double  _v)
protected

Normalize yaw value.

[in] _v Normalize a yaw value.

Returns
The normalized value.
void gazebo::rendering::OrbitViewController::Orbit ( double  _dy,
double  _dp 
)
protected

Update the camera's pose based on a rotation update.

Parameters
[in]_dyDelta yaw movement.
[in]_dpDelta pitch movement.
double gazebo::rendering::OrbitViewController::Pitch ( ) const
void gazebo::rendering::OrbitViewController::SetDistance ( float  _d)

Set the distance to the focal point.

Parameters
[in]_dThe distance from the focal point.
void gazebo::rendering::OrbitViewController::SetFocalPoint ( const math::Vector3 _fp)

Set the focal point.

Parameters
[in]_fpThe focal point
void gazebo::rendering::OrbitViewController::TranslateGlobal ( const math::Vector3 _vec)
protected

Translate the focal point in the global coordinate frame.

Parameters
[in]_vecDirection and amount to translate the camera.
void gazebo::rendering::OrbitViewController::TranslateLocal ( const math::Vector3 _vec)
protected

Translate the focal point in the local coordinate frame.

Parameters
[in]_vecDirection and amount to translate the camera.
virtual void gazebo::rendering::OrbitViewController::Update ( )
virtual

Update.

Implements gazebo::rendering::ViewController.

void gazebo::rendering::OrbitViewController::UpdateRefVisual ( )
protected

Update the reference visual.

double gazebo::rendering::OrbitViewController::Yaw ( ) const
void gazebo::rendering::OrbitViewController::Zoom ( float  _amount)
protected

Zoom the camera.

[in] _amount Zoom quatity.

Member Data Documentation

float gazebo::rendering::OrbitViewController::distance
protected

Distance to the focal point.

ignition::math::Vector3d gazebo::rendering::OrbitViewController::focalPoint
protected

The focal point.

bool gazebo::rendering::OrbitViewController::init
protected

A flag used to inidicate that the view controller has just been initialized.

std::string gazebo::rendering::OrbitViewController::key
protected

Key that is currently pressed.

float gazebo::rendering::OrbitViewController::pitch
protected

Pitch value.

VisualPtr gazebo::rendering::OrbitViewController::refVisual
protected

A reference visual.

float gazebo::rendering::OrbitViewController::yaw
protected

Yaw value.


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