12 #include <mrpt/version.h> 13 #if MRPT_VERSION<0x199 14 #include <mrpt/utils/utils_defs.h> 16 #include <mrpt/core/format.h> 19 #include <mrpt/opengl/COpenGLScene.h> 20 #include <mrpt/opengl/CGridPlaneXY.h> 25 using namespace mvsim;
42 std::map<std::string, TParamEntry> gui_params;
76 m_gui_win = mrpt::gui::CDisplayWindow3D::Create(
97 mrpt::opengl::COpenGLScene::Ptr gl_scene =
105 if (!gl_scene->getByName(
"level_0"))
107 for (
unsigned int i = 0; i < 5; i++)
109 auto gl_obj = mrpt::opengl::CSetOfObjects::Create();
110 gl_obj->setName(mrpt::format(
"level_%u", i));
111 gl_scene->insert(gl_obj);
121 (*it)->gui_update(*gl_scene);
129 for (TListVehicles::iterator it =
m_vehicles.begin();
131 it->second->gui_update(*gl_scene);
141 it->second->gui_update(*gl_scene);
149 const int txt_h = 12, space_h = 2;
157 mrpt::system::formatTimeInterval(this->
m_simul_time).c_str()),
158 TColorf(1, 1, 1, 0.5),
"serif", txt_h,
160 txt_y += txt_h + space_h;
165 const size_t nLines = std::count(
167 txt_y += nLines * (txt_h + space_h);
170 TColorf(1, 1, 1, 0.5),
"serif", txt_h,
181 TListVehicles::const_iterator it =
185 static bool warn1st =
true;
188 std::cerr << mrpt::format(
189 "GUI: Camera set to follow vehicle named '%s' which can't " 197 const mrpt::poses::CPose2D pose = it->second->getCPose2D();
198 m_gui_win->setCameraPointingToPoint(pose.x(), pose.y(), 0.0f);
double force_scale
In meters/Newton.
This file contains rapidxml parser and DOM implementation.
mrpt::gui::CDisplayWindow3D::Ptr m_gui_win
static WorldElementBase * factory(World *parent, const rapidxml::xml_node< char > *xml_node, const char *class_name=NULL)
TListWorldElements m_world_elements
void update_GUI(TUpdateGUIParams *params=NULL)
double m_simul_time
evaluate weights for friction, etc.
std::string follow_vehicle
Name of the vehicle to follow (empty=none)
TGUIKeyEvent keyevent
Keystrokes in the window are returned here.
void parse_xmlnode_children_as_param(const rapidxml::xml_node< char > &xml_node, const std::map< std::string, TParamEntry > ¶ms, const char *function_name_context="")
bool is_GUI_open() const
Forces closing the GUI window, if any.
TGUI_Options m_gui_options
std::string msg_lines
Messages to show.
mrpt::gui::mrptKeyModifier key_modifier
void parse_from(const rapidxml::xml_node< char > &node)
int keycode
0=no Key. Otherwise, ASCII code.
void close_GUI()
a previous call to update_GUI()