##

GuiIface.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_GUIIFACE_HH_
#define _GAZEBO_GUIIFACE_HH_
#include <string>
#include <boost/property_tree/ptree.hpp>
#include <boost/filesystem.hpp>
#include "gazebo/rendering/RenderingIface.hh"
#include "gazebo/util/system.hh"
extern GZ_GUI_VISIBLE boost::property_tree::ptree g_propTree;
namespace gazebo
{
namespace gui
{
class MainWindow;
GZ_GUI_VISIBLE
bool load();
GZ_GUI_VISIBLE
void init();
GZ_GUI_VISIBLE
bool run(int _argc, char **_argv);
GZ_GUI_VISIBLE
void stop();
GZ_GUI_VISIBLE
void set_world(const std::string& _name);
GZ_GUI_VISIBLE
std::string get_world();
GZ_GUI_VISIBLE
void set_active_camera(rendering::UserCameraPtr _cam);
GZ_GUI_VISIBLE
rendering::UserCameraPtr get_active_camera();
GZ_GUI_VISIBLE
void clear_active_camera();
GZ_GUI_VISIBLE
MainWindow *get_main_window();
GZ_GUI_VISIBLE
unsigned int get_entity_id(const std::string &_name);
GZ_GUI_VISIBLE
bool has_entity_name(const std::string &_name);
GZ_GUI_VISIBLE
bool register_metatypes();
GZ_GUI_VISIBLE
bool loadINI(boost::filesystem::path _file = "");
template<typename T>
T getINIProperty(const std::string &_key, const T &_default)
{
try
{
return g_propTree.get<T>(_key);
}
catch(...)
{
}
return _default;
}
template<typename T>
bool setINIProperty(const std::string &_key, const T &_value)
{
g_propTree.put(_key, _value);
return true;
}
GZ_GUI_VISIBLE
bool saveINI(const boost::filesystem::path &_file);
}
}
#endif
gazebo::rendering::UserCameraPtr
boost::shared_ptr< UserCamera > UserCameraPtr
Definition: RenderTypes.hh:94
gazebo::gui::clear_active_camera
void clear_active_camera()
gazebo::gui::set_world
void set_world(const std::string &_name)
gazebo
Forward declarations for the common classes.
Definition: Animation.hh:26
gazebo::gui::set_active_camera
void set_active_camera(rendering::UserCameraPtr _cam)
gazebo::gui::get_entity_id
unsigned int get_entity_id(const std::string &_name)
system.hh
gazebo::gui::get_main_window
MainWindow * get_main_window()
Return a pointer to the main graphical window.
gazebo::gui::get_world
std::string get_world()
gazebo::gui::get_active_camera
rendering::UserCameraPtr get_active_camera()
g_propTree
boost::property_tree::ptree g_propTree
gazebo::gui::run
bool run(int _argc, char **_argv)
gazebo::gui::getINIProperty
T getINIProperty(const std::string &_key, const T &_default)
Get a property from the GUI INI file.
Definition: GuiIface.hh:90
gazebo::gui::load
bool load()
Load the graphical interface.
RenderingIface.hh
gazebo::gui::setINIProperty
bool setINIProperty(const std::string &_key, const T &_value)
Set a value in the INI property tree.
Definition: GuiIface.hh:109
gazebo::gui::saveINI
bool saveINI(const boost::filesystem::path &_file)
Save the configuration parameters to file.
gui
gui
Definition: KeyEventHandler.hh:29
gazebo::gui::has_entity_name
bool has_entity_name(const std::string &_name)
gazebo::gui::init
void init()
gazebo::gui::loadINI
bool loadINI(boost::filesystem::path _file="")
Locate and load the INI configuration file.
gazebo::gui::register_metatypes
bool register_metatypes()
Register the Qt metatypes.
gazebo::gui::stop
void stop()