##

OculusWindow.hh
Go to the documentation of this file.
/*
* Copyright (C) 2014 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_GUI_OCULUS_WINDOW_HH_
#define GAZEBO_GUI_OCULUS_WINDOW_HH_
#include <string>
#include <thread>
#ifndef Q_MOC_RUN
#include "gazebo/transport/TransportTypes.hh"
#include "gazebo/rendering/RenderTypes.hh"
#include "gazebo/msgs/msgs.hh"
#include "gazebo/gui/qt.h"
#endif
namespace gazebo
{
namespace gui
{
class GZ_GUI_VISIBLE OculusWindow : public QWidget
{
Q_OBJECT
public: OculusWindow(int _x, int _y, const std::string &_visual,
QWidget *_parent = 0);
public: virtual ~OculusWindow();
public: bool CreateCamera();
// Documentation inherited.
protected: virtual void showEvent(QShowEvent *_e);
// Documentation inherited.
protected: virtual void resizeEvent(QResizeEvent *_e);
// Documentation inherited.
protected: void keyPressEvent(QKeyEvent *_event);
private: std::string GetOgreHandle() const;
private: void AttachCameraToVisual();
private: QFrame *renderFrame;
private: int windowId;
private: rendering::OculusCameraPtr oculusCamera;
private: rendering::ScenePtr scene;
private: bool isFullScreen;
private: int xPos;
private: int yPos;
private: std::string visualName;
private: std::thread *attachCameraThread;
};
}
}
#endif
gazebo
Forward declarations for the common classes.
Definition: Animation.hh:26
qt.h
gazebo::gui::OculusWindow::resizeEvent
virtual void resizeEvent(QResizeEvent *_e)
gazebo::gui::OculusWindow::~OculusWindow
virtual ~OculusWindow()
Destructor.
TransportTypes.hh
Forward declarations for transport.
gazebo::gui::OculusWindow::keyPressEvent
void keyPressEvent(QKeyEvent *_event)
msgs.hh
gazebo::rendering::ScenePtr
boost::shared_ptr< Scene > ScenePtr
Definition: RenderTypes.hh:82
RenderTypes.hh
gazebo::gui::OculusWindow::showEvent
virtual void showEvent(QShowEvent *_e)
gui
gui
Definition: KeyEventHandler.hh:29
gazebo::gui::OculusWindow::OculusWindow
OculusWindow(int _x, int _y, const std::string &_visual, QWidget *_parent=0)
Constructor.
gazebo::gui::OculusWindow
A widget that renders a camera view suitable for the Oculus Rift.
Definition: OculusWindow.hh:40
gazebo::gui::OculusWindow::CreateCamera
bool CreateCamera()
Initialize Oculus and create a camera.