point_drawing_plugin.h
Go to the documentation of this file.
1 // *****************************************************************************
2 //
3 // Copyright (c) 2014, Southwest Research Institute® (SwRI®)
4 // All rights reserved.
5 //
6 // Redistribution and use in source and binary forms, with or without
7 // modification, are permitted provided that the following conditions are met:
8 // * Redistributions of source code must retain the above copyright
9 // notice, this list of conditions and the following disclaimer.
10 // * Redistributions in binary form must reproduce the above copyright
11 // notice, this list of conditions and the following disclaimer in the
12 // documentation and/or other materials provided with the distribution.
13 // * Neither the name of Southwest Research Institute® (SwRI®) nor the
14 // names of its contributors may be used to endorse or promote products
15 // derived from this software without specific prior written permission.
16 //
17 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
18 // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20 // ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
21 // DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
22 // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23 // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
24 // ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
26 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 //
28 // *****************************************************************************
29 
30 #ifndef MAPVIZ_POINT_DRAW_H_
31 #define MAPVIZ_POINT_DRAW_H_
32 
33 // C++ standard libraries
34 #include <string>
35 #include <list>
36 
37 #include <mapviz/mapviz_plugin.h>
38 #include <mapviz/map_canvas.h>
39 
40 // QT libraries
41 #include <QGLWidget>
42 #include <QObject>
43 #include <QWidget>
44 
45 // ROS libraries
46 #include <ros/ros.h>
47 #include <tf/transform_datatypes.h>
48 
49 namespace mapviz_plugins
50 {
52  {
53  Q_OBJECT
54 
55  public:
56  struct StampedPoint
57  {
64  std::string source_frame;
67 
68  std::vector<tf::Point> cov_points;
69  std::vector<tf::Point> transformed_cov_points;
70  };
71 
72  enum DrawStyle
73  {
74  LINES = 0,
77  };
78 
81  {
82  }
83 
84  void ClearHistory();
85 
86  virtual void Transform();
87  virtual bool DrawPoints(double scale);
88  virtual bool DrawArrows();
89  virtual bool DrawArrow(const StampedPoint& point);
90  virtual bool DrawLaps();
91  virtual bool DrawLines();
92  virtual void CollectLaps();
93  virtual bool DrawLapsArrows();
94  virtual bool TransformPoint(StampedPoint& point);
95  virtual void UpdateColor(QColor base_color, int i);
96 
97  protected Q_SLOTS:
98  virtual void BufferSizeChanged(int value);
99  virtual void DrawIcon();
100  virtual void SetColor(const QColor& color);
101  virtual void SetDrawStyle(QString style);
102  virtual void SetStaticArrowSizes(bool isChecked);
103  virtual void SetArrowSize(int arrowSize);
104  virtual void PositionToleranceChanged(double value);
105 
106  protected:
110  std::list<StampedPoint> points_;
114  bool new_lap_;
115  QColor color_;
118  double scale_;
120 
121  private:
122  std::vector<std::list<StampedPoint> > laps_;
125  };
126 }
127 
128 #endif // MAPVIZ_PLUGINS_POINT_DRAW_H_
virtual void PositionToleranceChanged(double value)
virtual void SetArrowSize(int arrowSize)
virtual void UpdateColor(QColor base_color, int i)
std::vector< std::list< StampedPoint > > laps_
virtual void SetColor(const QColor &color)
virtual void SetStaticArrowSizes(bool isChecked)
virtual bool DrawArrow(const StampedPoint &point)
virtual void SetDrawStyle(QString style)
virtual bool TransformPoint(StampedPoint &point)


mapviz_plugins
Author(s): Marc Alban
autogenerated on Thu Jun 6 2019 19:25:16