17 #ifndef GAZEBO_GUI_PLOT_VARIABLE_PILL_HH_
18 #define GAZEBO_GUI_PLOT_VARIABLE_PILL_HH_
24 #include <ignition/math/Helpers.hh>
25 #include <ignition/math/Vector2.hh>
35 class VariablePillPrivate;
37 class VariablePillContainer;
46 public:
explicit VariablePill(QWidget *_parent =
nullptr);
53 public:
unsigned int Id()
const;
57 public:
void SetName(
const std::string &_name);
61 public: std::string Name()
const;
65 public:
void SetText(
const std::string &_text);
69 public: std::string Text()
const;
93 public:
void RemoveVariablePill(
VariablePill *_variable);
98 public:
VariablePill *VariablePillByName(
const std::string &_name);
102 public:
unsigned int VariablePillCount()
const;
106 public: std::map<unsigned int, VariablePill *> &VariablePills()
const;
110 public:
void SetSelected(
const bool _selected);
114 public:
bool IsSelected()
const;
119 public:
bool ContainsPoint(
const ignition::math::Vector2i &_pt)
const;
123 protected:
void dragEnterEvent(QDragEnterEvent *_evt);
127 protected:
void dropEvent(QDropEvent *_evt);
131 protected:
void mouseMoveEvent(QMouseEvent *_event);
135 protected:
void mousePressEvent(QMouseEvent *_event);
139 private:
void SetMultiVariableMode(
const bool _enable);
142 private:
void UpdateStyleSheet();
147 private:
bool IsDragValid(QDropEvent *_evt);
152 Q_SIGNALS:
void VariableAdded(
const unsigned int _id,
153 const std::string &_name);
157 Q_SIGNALS:
void VariableRemoved(
const unsigned int _id);
162 Q_SIGNALS:
void VariableMoved(
const unsigned int _id);
166 Q_SIGNALS:
void VariableLabelChanged(
const std::string &_label);
173 private: std::unique_ptr<VariablePillPrivate> dataPtr;
static const unsigned int EmptyVariable
Empty variable id used to indicate non-existent variable.
Definition: VariablePill.hh:169
A container for holding variable pills.
Definition: VariablePillContainer.hh:37
A variable pill.
Definition: VariablePill.hh:40