17 #ifndef _GAZEBO_GUI_MODELLISTWIDGET_HH_
18 #define _GAZEBO_GUI_MODELLISTWIDGET_HH_
22 #include <QItemDelegate>
32 class QTreeWidgetItem;
38 class ModelListWidgetPrivate;
46 private slots:
void OnModelSelection(QTreeWidgetItem *item,
int column);
47 private slots:
void Update();
48 private slots:
void OnPropertyChanged(QtProperty *_item);
49 private slots:
void OnCustomContextMenu(
const QPoint &_pt);
50 private slots:
void OnCurrentPropertyChanged(QtBrowserItem *_item);
51 private:
void OnSetSelectedEntity(
const std::string &_name,
52 const std::string &_mode);
53 private:
void OnResponse(ConstResponsePtr &_msg);
55 private:
void OnModelUpdate(
const msgs::Model &_msg);
59 private:
void OnLightUpdate(
const msgs::Light &_msg);
61 private:
void OnRequest(ConstRequestPtr &_msg);
63 private:
void OnRemoveScene(
const std::string &_name);
64 private:
void OnCreateScene(
const std::string &_name);
66 private:
void AddModelToList(
const msgs::Model &_msg);
68 private:
void FillMsgField(QtProperty *_item,
69 google::protobuf::Message *_message,
70 const google::protobuf::Reflection *_reflection,
71 const google::protobuf::FieldDescriptor *_field);
73 private:
void FillMsg(QtProperty *_item,
74 google::protobuf::Message *_message,
75 const google::protobuf::Descriptor *_descriptor,
76 QtProperty *_changedItem);
78 private:
void FillGeometryMsg(QtProperty *_item,
79 google::protobuf::Message *_message,
80 const google::protobuf::Descriptor *_descriptor,
81 QtProperty *_changedItem);
83 private:
void FillPoseMsg(QtProperty *_item,
84 google::protobuf::Message *_message,
85 const google::protobuf::Descriptor *_descriptor);
87 private:
void FillColorMsg(QtProperty *_item, msgs::Color *_msg);
89 private:
void FillVector3Msg(QtProperty *_item, msgs::Vector3d *_msg);
91 private: QtProperty *PopChildItem(QList<QtProperty*> &_list,
92 const std::string &_name);
94 private: QtProperty *ParentItemValue(
const std::string &_name);
95 private: QtProperty *ParentItemValue(QtProperty *_item,
96 const std::string &_name);
98 private: QtProperty *ParentItem(
const std::string &_name);
99 private: QtProperty *ParentItem(QtProperty *_item,
100 const std::string &_name);
102 private: QtProperty *ChildItemValue(
const std::string &_name);
103 private: QtProperty *ChildItemValue(QtProperty *_item,
104 const std::string &_name);
106 private: QtProperty *ChildItem(
const std::string &_name);
107 private: QtProperty *ChildItem(QtProperty *_item,
108 const std::string &_name);
110 private:
bool HasChildItem(QtProperty *_parent, QtProperty *_child);
112 private:
void RemoveEntity(
const std::string &_name);
114 private: QTreeWidgetItem *ListItem(
const std::string &_name,
115 QTreeWidgetItem *_parent);
117 private:
void FillPropertyTree(
const msgs::Model &_msg,
118 QtProperty *_parent);
120 private:
void FillPropertyTree(
const msgs::Link &_msg,
121 QtProperty *_parent);
123 private:
void FillPropertyTree(
const msgs::Collision &_msg,
124 QtProperty *_parent);
126 private:
void FillPropertyTree(
const msgs::Joint &_msg,
127 QtProperty *_parent);
129 private:
void FillPropertyTree(
const msgs::Surface &_msg,
130 QtProperty *_parent);
132 private:
void FillPropertyTree(
const msgs::Visual &_msg,
133 QtProperty *_parent);
135 private:
void FillPropertyTree(
const msgs::Geometry &_msg,
136 QtProperty *_parent);
138 private:
void FillPropertyTree(
const msgs::Scene &_msg,
139 QtProperty *_parent);
141 private:
void FillPropertyTree(
const msgs::Physics &_msg,
142 QtProperty *_parent);
144 private:
void FillPropertyTree(
const msgs::Wind &_msg,
145 QtProperty *_parent);
151 private:
void FillPropertyTree(
const msgs::Atmosphere &_msg,
152 QtProperty *_parent);
154 private:
void FillPropertyTree(
const msgs::Light &_msg,
155 QtProperty *_parent);
157 private:
void FillVector3dProperty(
const msgs::Vector3d &_msg,
158 QtProperty *_parent);
160 private:
void FillPoseProperty(
const msgs::Pose &_msg,
161 QtProperty *_parent);
167 private:
void FillPropertyTree(
const msgs::SphericalCoordinates &_msg,
168 QtProperty *_parent);
173 private:
void AddProperty(QtProperty *_item, QtProperty *_parent);
175 private:
void ProcessModelMsgs();
176 private:
void ProcessLightMsgs();
177 private:
void ProcessRemoveEntity();
179 public:
void InitTransport(
const std::string &_name =
"");
180 private:
void ResetTree();
181 private:
void ResetScene();
185 private:
void ModelPropertyChanged(QtProperty *_item);
189 private:
void ScenePropertyChanged(QtProperty *_item);
191 private:
void LightPropertyChanged(QtProperty *_item);
195 private:
void PhysicsPropertyChanged(QtProperty *_item);
199 private:
void WindPropertyChanged(QtProperty *_item);
203 private:
void AtmospherePropertyChanged(QtProperty *_item);
207 private:
void GUIPropertyChanged(QtProperty *_item);
211 private: std::unique_ptr<ModelListWidgetPrivate> dataPtr;