18#ifndef _VIEWERFACTORY_HH_
19#define _VIEWERFACTORY_HH_
36 typedef TopicView* (*ViewFactoryFn) (QWidget *_parent);
53 ViewFactoryFn _factoryfn);
61 const std::string &_topicName,
62 QWidget *_parent =
NULL);
66 public:
static void GetViewTypes(std::vector<std::string> &_types);
69 private:
static std::map<std::string, ViewFactoryFn> viewMap;
78 #define GZ_REGISTER_STATIC_VIEWER(msgtype, classname) \
79 GZ_GUI_VISIBLE TopicView *New##classname(QWidget *_parent) \
81 return new gazebo::gui::classname(_parent); \
84 void Register##classname() \
86 ViewFactory::RegisterView(msgtype, New##classname);\
#define NULL
Definition CommonTypes.hh:31
default namespace for gazebo
gui
Definition KeyEventHandler.hh:29
Base class for widgets that display topic data.
Definition TopicView.hh:79
The view factory creates GUI widgets to visualize data on a topic.
Definition ViewFactory.hh:44
static void RegisterView(const std::string &_className, ViewFactoryFn _factoryfn)
Register a view class (called by view registration function).
static void GetViewTypes(std::vector< std::string > &_types)
Get all the view types.
static TopicView * NewView(const std::string &_msgType, const std::string &_topicName, QWidget *_parent=NULL)
Create a new instance of a view.
static void RegisterAll()
Register all known views.
TopicView *(* ViewFactoryFn)(QWidget *_parent)
Definition ViewFactory.hh:36
Forward declarations for the common classes.
Definition Animation.hh:27