##

ViewController.hh
Go to the documentation of this file.
/*
* Copyright (C) 2012 Open Source Robotics Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
#ifndef GAZEBO_RENDERING_VIEWCONTROLLER_HH_
#define GAZEBO_RENDERING_VIEWCONTROLLER_HH_
#include <string>
#include <ignition/math/Vector3.hh>
#include "gazebo/rendering/RenderTypes.hh"
#include "gazebo/util/system.hh"
namespace gazebo
{
namespace common
{
class MouseEvent;
}
namespace rendering
{
class GZ_RENDERING_VISIBLE ViewController
{
public: explicit ViewController(UserCameraPtr _camera);
public: virtual ~ViewController();
public: virtual void Init() = 0;
public: virtual void Init(const ignition::math::Vector3d &_focalPoint,
const double _yaw = 0, const double _pitch = 0);
public: virtual void Update() = 0;
public: virtual void Resize(const unsigned int _width,
const unsigned int _height);
public: void SetEnabled(bool _value);
public: virtual void HandleMouseEvent(
const common::MouseEvent &_event) = 0;
public: virtual void HandleKeyReleaseEvent(const std::string &_key) = 0;
public: virtual void HandleKeyPressEvent(const std::string &_key) = 0;
public: std::string GetTypeString() const;
protected: UserCameraPtr camera;
protected: bool enabled;
protected: std::string typeString;
};
}
}
#endif
gazebo::rendering::UserCameraPtr
boost::shared_ptr< UserCamera > UserCameraPtr
Definition: RenderTypes.hh:94
gazebo::rendering::ViewController::HandleKeyPressEvent
virtual void HandleKeyPressEvent(const std::string &_key)=0
Handle a key press event.
gazebo::rendering::ViewController::HandleKeyReleaseEvent
virtual void HandleKeyReleaseEvent(const std::string &_key)=0
Handle a key release event.
gazebo
Forward declarations for the common classes.
Definition: Animation.hh:26
common
common
Definition: FuelModelDatabase.hh:37
system.hh
gazebo::rendering::ViewController::Init
virtual void Init()=0
Initialize the view controller.
gazebo::rendering::ViewController::SetEnabled
void SetEnabled(bool _value)
Set whether the controller is enabled.
RenderTypes.hh
rendering
rendering
Definition: RenderEngine.hh:31
gazebo::rendering::ViewController::typeString
std::string typeString
Type of view controller.
Definition: ViewController.hh:98
gazebo::rendering::ViewController::ViewController
ViewController(UserCameraPtr _camera)
Constructor.
gazebo::msgs::Init
GAZEBO_VISIBLE void Init(google::protobuf::Message &_message, const std::string &_id="")
Initialize a message.
gazebo::rendering::ViewController::GetTypeString
std::string GetTypeString() const
Get the type of view controller.
gazebo::rendering::ViewController
Base class for view controllers.
Definition: ViewController.hh:41
gazebo::rendering::ViewController::camera
UserCameraPtr camera
Pointer to the camera to control.
Definition: ViewController.hh:92
gazebo::rendering::ViewController::HandleMouseEvent
virtual void HandleMouseEvent(const common::MouseEvent &_event)=0
Handle a mouse event.
gazebo::rendering::ViewController::enabled
bool enabled
True if enabled.
Definition: ViewController.hh:95
gazebo::rendering::ViewController::~ViewController
virtual ~ViewController()
Destructor.
gazebo::rendering::ViewController::Update
virtual void Update()=0
Update the controller, which should update the position of the Camera.
gazebo::rendering::ViewController::Resize
virtual void Resize(const unsigned int _width, const unsigned int _height)
Called by the UserCamera when a resize event occurs.
gazebo::common::MouseEvent
Generic description of a mouse event.
Definition: MouseEvent.hh:35