18 #ifndef _CONFIG_WIDGET_HH_
19 #define _CONFIG_WIDGET_HH_
35 class FieldDescriptor;
59 public: std::string
key;
102 private slots:
void GeometryChanged(
const QString _text);
105 private slots:
void OnSelectFile();
116 Q_SIGNALS:
void EnumValueChanged(
const QString &_value);
120 private slots:
void EnumChanged(
const QString &_value);
134 private slots:
void Toggle(
bool _checked);
151 public:
void Load(
const google::protobuf::Message *_msg);
155 public: google::protobuf::Message *GetMsg();
161 public: std::string GetHumanReadableKey(
const std::string &_key);
169 public: std::string GetUnitFromKey(
const std::string &_key,
170 const std::string &_jointType =
"");
177 public:
void GetRangeFromKey(
const std::string &_key,
178 double &_min,
double &_max);
183 public:
void SetWidgetVisible(
const std::string &_name,
bool _visible);
188 public:
bool GetWidgetVisible(
const std::string &_name)
const;
193 public:
void SetWidgetReadOnly(
const std::string &_name,
bool _readOnly);
198 public:
bool GetWidgetReadOnly(
const std::string &_name)
const;
202 public:
void UpdateFromMsg(
const google::protobuf::Message *_msg);
208 public:
bool SetIntWidgetValue(
const std::string &_name,
int _value);
214 public:
bool SetUIntWidgetValue(
const std::string &_name,
unsigned int
221 public:
bool SetDoubleWidgetValue(
const std::string &_name,
228 public:
bool SetBoolWidgetValue(
const std::string &_name,
bool _value);
233 public:
bool SetStringWidgetValue(
const std::string &_name,
234 const std::string &_value);
240 public:
bool SetVector3WidgetValue(
const std::string &_name,
247 public:
bool SetColorWidgetValue(
const std::string &_name,
254 public:
bool SetPoseWidgetValue(
const std::string &_name,
262 public:
bool SetGeometryWidgetValue(
const std::string &_name,
264 const std::string &_uri =
"");
270 public:
bool SetEnumWidgetValue(
const std::string &_name,
271 const std::string &_value);
276 public:
int GetIntWidgetValue(
const std::string &_name)
const;
281 public:
unsigned int GetUIntWidgetValue(
const std::string &_name)
const;
286 public:
double GetDoubleWidgetValue(
const std::string &_name)
const;
291 public:
bool GetBoolWidgetValue(
const std::string &_name)
const;
296 public: std::string GetStringWidgetValue(
const std::string &_name)
const;
301 public:
math::Vector3 GetVector3WidgetValue(
const std::string &_name)
307 public:
common::Color GetColorWidgetValue(
const std::string &_name)
const;
312 public:
math::Pose GetPoseWidgetValue(
const std::string &_name)
const;
318 public: std::string GetGeometryWidgetValue(
const std::string &_name,
324 public: std::string GetEnumWidgetValue(
const std::string &_name)
const;
335 private: QWidget *Parse(google::protobuf::Message *_msg,
336 bool _update =
false,
const std::string &_name =
"",
337 const int _level = 0);
343 const google::protobuf::Message *_msg);
348 private:
void UpdateMsg(google::protobuf::Message *_msg,
349 const std::string &_name =
"");
354 private:
void UpdateVector3Msg(google::protobuf::Message *_msg,
362 const int _level = 0);
369 const int _level = 0);
376 const int _level = 0);
383 const int _level = 0);
390 const int _level = 0);
397 const int _level = 0);
404 const int _level = 0);
411 const int _level = 0);
418 const int _level = 0);
426 const std::vector<std::string> &_values,
const int _level = 0);
433 unsigned int _value);
453 const std::string &_value);
490 const std::string &_uri =
"");
497 const std::string &_value);
559 private slots:
void OnItemSelection(QTreeWidgetItem *_item,
int _column);
563 private slots:
void OnEnumValueChanged(
const QString &_value);
568 Q_SIGNALS:
void EnumValueChanged(
const QString &_name,
569 const QString &_value);
575 private:
bool eventFilter(QObject *_obj, QEvent *_event);
578 private: std::map <std::string, ConfigChildWidget *> configWidgets;
581 private: google::protobuf::Message *configMsg;
584 private:
static const QString level0BgColor;
587 private:
static const QString level1BgColor;
590 private:
static const QString level2BgColor;
593 private:
static const QString level3BgColor;
596 private:
static const QString level0WidgetColor;
599 private:
static const QString level1WidgetColor;
602 private:
static const QString level2WidgetColor;
605 private:
static const QString level3WidgetColor;
608 private:
static const QString redColor;
611 private:
static const QString greenColor;
614 private:
static const QString blueColor;
QWidget * geomLengthLabel
A label for the length widget.
Definition: ConfigWidget.hh:86
QWidget * geomFilenameLabel
A label for the mesh filename widget.
Definition: ConfigWidget.hh:95
GroupWidget * groupWidget
Pointer to group widget.
Definition: ConfigWidget.hh:69
Encapsulates a position and rotation in three space.
Definition: Pose.hh:37
QWidget * childWidget
Child widget that can be collapsed or expanded.
Definition: ConfigWidget.hh:130
The Vector3 class represents the generic vector containing 3 elements.
Definition: Vector3.hh:39
ConfigChildWidget()
Constructor;.
Definition: ConfigWidget.hh:56
QWidget * geomFilenameButton
A button for selecting the mesh filename.
Definition: ConfigWidget.hh:98
QWidget * geomLengthSpinBox
A spin box for configuring the length of the geometry.
Definition: ConfigWidget.hh:83
QWidget * geomFilenameLineEdit
A line edit for editing the mesh filename.
Definition: ConfigWidget.hh:92
std::vector< QWidget * > widgets
List of widgets holding values, such as Spins and LineEdits.
Definition: ConfigWidget.hh:62
std::map< QWidget *, QLabel * > mapWidgetToUnit
Map a widget to the label holding its unit value.
Definition: ConfigWidget.hh:65
#define NULL
Definition: CommonTypes.hh:30
Defines a color.
Definition: Color.hh:36
QWidget * geomLengthUnitLabel
A label for the unit of the length widget.
Definition: ConfigWidget.hh:89
#define GAZEBO_VISIBLE
Use to represent "symbol visible" if supported.
Definition: system.hh:66
QStackedWidget * geomDimensionWidget
A stacked widget containing widgets for configuring geometry dimensions.
Definition: ConfigWidget.hh:80
std::string key
Widget's key value.
Definition: ConfigWidget.hh:59