17 #ifndef _LASERVIEW_HH_
18 #define _LASERVIEW_HH_
22 #include <boost/thread/mutex.hpp>
49 public:
virtual void SetTopic(
const std::string &_topicName);
52 private:
virtual void UpdateImpl();
56 protected:
virtual void resizeEvent(QResizeEvent *_event);
60 private:
void OnScan(ConstLaserScanStampedPtr &_msg);
63 private slots:
void OnFitInView();
66 private slots:
void OnDegree(
bool _toggled);
69 private:
class LaserItem :
public QGraphicsItem
79 public:
unsigned int GetRangeCount();
83 public:
void AddRange(
double _range);
88 public:
void SetRange(
unsigned int _index,
double _range);
91 public: QRectF GetBoundingRect()
const;
96 public:
double GetHoverRange()
const;
101 public:
double GetHoverAngle()
const;
109 public:
void Update(
double _angleMin,
double _angleMax,
110 double _angleStep,
double _rangeMax,
115 private:
virtual QRectF boundingRect()
const;
124 private:
virtual void paint(QPainter *_painter,
125 const QStyleOptionGraphicsItem *_option,
131 private:
virtual void hoverEnterEvent(
132 QGraphicsSceneHoverEvent *_event);
137 private:
virtual void hoverLeaveEvent(
138 QGraphicsSceneHoverEvent *_event);
143 private:
void hoverMoveEvent(QGraphicsSceneHoverEvent *_event);
146 private: std::vector<QPointF> points;
150 private: std::vector<double> ranges;
153 private:
double angleMin;
156 private:
double angleMax;
159 private:
double angleStep;
162 private:
double rangeMax;
165 private:
double rangeMin;
168 private:
double indexAngle;
171 private:
double scale;
174 public:
bool radians;
177 private:
mutable boost::mutex mutex;
182 private:
class CustomView :
public QGraphicsView
186 public: CustomView(QWidget *_parent)
187 : QGraphicsView(_parent), viewZoomed(
false) {}
191 private:
void wheelEvent(QWheelEvent *_event)
193 this->viewZoomed =
true;
194 _event->delta() > 0 ? this->scale(1.15, 1.15) :
195 this->scale(1.0 / 1.15, 1.0 / 1.15);
200 public:
bool viewZoomed;
204 private: LaserItem *laserItem;
207 private: CustomView *view;
210 private:
bool firstMsg;
213 private: QLineEdit *rangeEdit;
216 private: QLineEdit *angleEdit;
219 private: QSpinBox *vertScanSpin;
Forward declarations for transport.
Base class for widgets that display topic data.
Definition: TopicView.hh:76
#define NULL
Definition: CommonTypes.hh:30
#define GAZEBO_VISIBLE
Use to represent "symbol visible" if supported.
Definition: system.hh:48
Definition: LaserView.hh:37