##

MainWindow.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_GUI_MAINWINDOW_HH_
#define GAZEBO_GUI_MAINWINDOW_HH_
#include <memory>
#include <string>
#include "gazebo/gazebo_config.h"
#include "gazebo/common/CommonTypes.hh"
#include "gazebo/msgs/MessageTypes.hh"
#include "gazebo/gui/qt.h"
#include "gazebo/util/system.hh"
#ifdef HAVE_OCULUS
#include "gazebo/gui/OculusWindow.hh"
#endif
namespace gazebo
{
namespace gui
{
class Editor;
class RenderWidget;
// Forward declare private data
class MainWindowPrivate;
class GZ_GUI_VISIBLE MainWindow : public QMainWindow
{
Q_OBJECT
public: MainWindow();
public: virtual ~MainWindow();
public: void Load();
public: void Init();
public: unsigned int EntityId(const std::string &_name);
public: bool HasEntityName(const std::string &_name);
public: void AddToLeftColumn(const std::string &_name, QWidget *_widget);
public: void ShowLeftColumnWidget(const std::string &_name = "default");
public: gui::RenderWidget *RenderWidget() const;
public: bool IsPaused() const;
public slots: void Play();
public slots: void Pause();
public: void SetLeftPaneVisibility(bool _on);
public: void AddMenu(QMenu *_menu);
public: void ShowMenuBar(QMenuBar *_bar = NULL);
public: QAction *CloneAction(QAction *_action, QObject *_parent);
public: gui::Editor *Editor(const std::string &_name) const;
signals: void AddPlugins();
signals: void TrackVisual(const std::string &_visualName);
signals: void Close();
protected: void closeEvent(QCloseEvent *_event);
private: void OnGUI(ConstGUIPtr &_msg);
private slots: void ItemSelected(QTreeWidgetItem *, int);
private slots: void New();
private slots: void Open();
private slots: void Save();
private slots: void SaveAs();
private slots: void SaveINI();
private slots: void Clone();
private slots: void HotkeyChart();
private slots: void About();
private slots: void Step();
private slots: void Arrow();
private slots: void Translate();
private slots: void Rotate();
private slots: void Scale();
private slots: void Align();
private slots: void Snap();
private slots: void CreateBox();
private slots: void CreateSphere();
private slots: void CreateCylinder();
private slots: void CreateMesh();
private slots: void CreatePointLight();
private slots: void CreateSpotLight();
private slots: void CreateDirectionalLight();
private slots: void CaptureScreenshot();
private slots: void InsertModel();
private slots: void ShowGrid();
private slots: void ShowOrigin();
private slots: void ShowCollisions();
private slots: void ShowJoints();
private slots: void ShowContacts();
private slots: void ShowCOM();
private slots: void ShowInertia();
private slots: void ShowLinkFrame();
private slots: void ShowSkeleton();
private slots: void FullScreen();
private slots: void ShowToolbars();
private slots: void FPS();
private slots: void Orbit();
private slots: void ViewOculus();
private slots: void OnResetModelOnly();
private slots: void OnResetWorld();
private slots: void SetTransparent();
private slots: void SetWireframe();
private slots: void ShowGUIOverlays();
private slots: void DataLogger();
private slots: void OnDataLoggerClosed();
private slots: void SelectTopic();
private slots: void Plot();
private slots: void OnAddPlugins();
private slots: void OnTrackVisual(const std::string &_visualName);
private slots: void OnEditorGroup(QAction *_action);
private: void OnFullScreen(bool _value);
private: void OnShowToolbars(bool _value);
private: void OnMoveMode(bool _mode);
private: void CreateActions();
private: void DeleteActions();
private: void CreateMenus();
private: void CreateMenuBar();
private: void CreateEditors();
private: void OnModel(ConstModelPtr &_msg);
private: void OnLight(ConstLightPtr &_msg);
private: void OnResponse(ConstResponsePtr &_msg);
private: void OnWorldModify(ConstWorldModifyPtr &_msg);
private: void OnManipMode(const std::string &_mode);
private: void OnSetSelectedEntity(const std::string &_name,
const std::string &_mode);
private: void OnInputStepSizeChanged(int _value);
private: void OnFollow(const std::string &_modelName);
private: void CreateDisabledIcon(const std::string &_pixmap,
QAction *_act);
private: void OnWindowMode(const std::string &_mode);
private: std::unique_ptr<MainWindowPrivate> dataPtr;
};
}
}
#endif
gazebo::gui::MainWindow::SetLeftPaneVisibility
void SetLeftPaneVisibility(bool _on)
Set whether the left pane is visible.
gazebo::gui::MainWindow::AddPlugins
void AddPlugins()
A signal to trigger loading of GUI plugins.
gazebo
Forward declarations for the common classes.
Definition: Animation.hh:26
qt.h
gazebo::gui::DataLogger
A widget that provides data logging functionality.
Definition: DataLogger.hh:37
gazebo::gui::MainWindow::IsPaused
bool IsPaused() const
Returns the state of the simulation, true if paused.
NULL
#define NULL
Definition: CommonTypes.hh:31
gazebo::gui::MainWindow::EntityId
unsigned int EntityId(const std::string &_name)
Get an entity id.
gazebo::gui::RenderWidget
Definition: RenderWidget.hh:37
gazebo::gui::MainWindow::MainWindow
MainWindow()
Constructor.
gazebo::gui::MainWindow::Init
void Init()
Initialization.
gazebo::gui::MainWindow::Close
void Close()
A signal to indicate the main window is about to close.
system.hh
CommonTypes.hh
gazebo::gui::Editor
Base class for editors, such as BuildingEditor and TerrainEditor.
Definition: Editor.hh:35
gazebo::gui::MainWindow::TrackVisual
void TrackVisual(const std::string &_visualName)
A signal to track a visual.
gazebo::gui::MainWindow::closeEvent
void closeEvent(QCloseEvent *_event)
gazebo::gui::MainWindow::CloneAction
QAction * CloneAction(QAction *_action, QObject *_parent)
Create a new action with information from the given action, such as text and tooltip.
gazebo::gui::MainWindow::RenderWidget
gui::RenderWidget * RenderWidget() const
Get a pointer to the render widget.
OculusWindow.hh
gazebo::gui::MainWindow::Pause
void Pause()
Pause simulation.
gazebo::gui::MainWindow::AddToLeftColumn
void AddToLeftColumn(const std::string &_name, QWidget *_widget)
Add a widget to the left column stack of widgets.
gazebo::gui::MainWindow::HasEntityName
bool HasEntityName(const std::string &_name)
Has an entity name.
gazebo::msgs::Init
GAZEBO_VISIBLE void Init(google::protobuf::Message &_message, const std::string &_id="")
Initialize a message.
gazebo::gui::MainWindow::Play
void Play()
Play simulation.
gazebo::gui::MainWindow::ShowLeftColumnWidget
void ShowLeftColumnWidget(const std::string &_name="default")
Show a widget in the left column.
gui
gui
Definition: KeyEventHandler.hh:29
gazebo::gui::MainWindow::Load
void Load()
Load the mainwindow.
gazebo::gui::MainWindow
Definition: MainWindow.hh:43
gazebo::gui::MainWindow::~MainWindow
virtual ~MainWindow()
Destructor.
gazebo::gui::MainWindow::Editor
gui::Editor * Editor(const std::string &_name) const
Get an editor by name.
gazebo::gui::MainWindow::ShowMenuBar
void ShowMenuBar(QMenuBar *_bar=NULL)
Show a custom menubar.
gazebo::gui::MainWindow::AddMenu
void AddMenu(QMenu *_menu)
Add a menu to the main window menu bar.