rock_widget_collection  0.1
SonarPlot.h
Go to the documentation of this file.
1 #ifndef SONARPLOT_H
2 #define SONARPLOT_H
3 
4 #include <QtGui>
5 #include <QFrame>
6 #include <base/samples/Sonar.hpp>
7 #include <frame_helper/ColorGradient.h>
8 
9 #define BASE_WIDTH 1300
10 #define BASE_HEIGHT 600
11 #define BINS_REF_SIZE 500
12 
13 using namespace frame_helper;
14 
15 
16 class SonarPlot : public QFrame
17 {
18  Q_OBJECT
19 
20 
21 public:
22  SonarPlot(QWidget *parent = 0);
23  virtual ~SonarPlot();
24  void setData(const base::samples::Sonar& sonar);
25  void setSectorScan(bool continuous, base::Angle leftLimit, base::Angle rightLimit);
26 
27 protected:
28  void paintEvent(QPaintEvent *event);
29  void resizeEvent ( QResizeEvent * event );
30  void drawOverlay();
31  void generateMultibeamTransferTable(const base::samples::Sonar& sonar);
32  void generateScanningTransferTable(const base::samples::Sonar& sonar);
33  void applyColormap(ColorGradientType type);
34  bool isMotorStepChanged(const base::Angle& bearing);
35  void addScanningData(const base::samples::Sonar& sonar);
36  base::samples::Sonar lastSonar;
37  double scaleX;
38  double scaleY;
39  int range;
40  int numSteps;
44  bool continuous;
46  QPoint origin;
47  std::vector<int> transfer;
48  std::vector<QColor> colorMap;
49  ColorGradient heatMapGradient;
50  base::Angle motorStep, lastDiffStep;
51  base::Angle leftLimit, rightLimit;
52  std::vector<float> sonarData;
53 
54 protected slots:
55  void rangeChanged(int);
56  void sonarPaletteChanged(int);
57  void gridChanged(bool);
58 };
59 
60 
61 #endif
bool enabledGrid
Definition: SonarPlot.h:45
ColorGradient heatMapGradient
Definition: SonarPlot.h:49
base::Angle motorStep
Definition: SonarPlot.h:50
bool continuous
Definition: SonarPlot.h:44
bool changedSize
Definition: SonarPlot.h:41
int range
Definition: SonarPlot.h:39
std::vector< float > sonarData
Definition: SonarPlot.h:52
int numSteps
Definition: SonarPlot.h:40
QPoint origin
Definition: SonarPlot.h:46
base::samples::Sonar lastSonar
Definition: SonarPlot.h:36
double scaleY
Definition: SonarPlot.h:38
bool isMultibeamSonar
Definition: SonarPlot.h:43
base::Angle rightLimit
Definition: SonarPlot.h:51
bool changedSectorScan
Definition: SonarPlot.h:42
std::vector< QColor > colorMap
Definition: SonarPlot.h:48
double scaleX
Definition: SonarPlot.h:37
std::vector< int > transfer
Definition: SonarPlot.h:47