RouteSegmentsDisplay.h
Go to the documentation of this file.
1 /***************************************************************************
2  * Software License Agreement (BSD License) *
3  * Copyright (C) 2016 by Markus Bader <markus.bader@tuwien.ac.at> *
4  * *
5  * Redistribution and use in source and binary forms, with or without *
6  * modification, are permitted provided that the following conditions *
7  * are met: *
8  * *
9  * 1. Redistributions of source code must retain the above copyright *
10  * notice, this list of conditions and the following disclaimer. *
11  * 2. Redistributions in binary form must reproduce the above copyright *
12  * notice, this list of conditions and the following disclaimer in *
13  * the documentation and/or other materials provided with the *
14  * distribution. *
15  * 3. Neither the name of the copyright holder nor the names of its *
16  * contributors may be used to endorse or promote products derived *
17  * from this software without specific prior written permission. *
18  * *
19  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS *
20  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT *
21  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS *
22  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE *
23  * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, *
24  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, *
25  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; *
26  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER *
27  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT *
28  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY *
29  * WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE *
30  * POSSIBILITY OF SUCH DAMAGE. *
31  ***************************************************************************/
32 
33 #ifndef ROUTESEGMENTS_DISPLAY_H
34 #define ROUTESEGMENTS_DISPLAY_H
35 
36 #ifndef Q_MOC_RUN
37 #include <boost/circular_buffer.hpp>
38 
40 #include <tuw_nav_msgs/RouteSegments.h>
42 #endif
43 
45 
46 namespace Ogre
47 {
48 class SceneNode;
49 }
50 
51 namespace rviz
52 {
53 class ColorProperty;
54 class EnumProperty;
55 class FloatProperty;
56 class IntProperty;
57 }
58 
59 // All the source in this plugin is in its own namespace. This is not
60 // required but is good practice.
61 namespace tuw_nav_rviz
62 {
63 
64 class RouteSegmentsVisual;
65 
66 // Here we declare our new subclass of rviz::Display. Every display
67 // which can be listed in the "Displays" panel is a subclass of
68 // rviz::Display.
69 class RouteSegmentsDisplay: public rviz::MessageFilterDisplay<tuw_nav_msgs::RouteSegments>
70 {
71 Q_OBJECT
72 public:
73  // Constructor. pluginlib::ClassLoader creates instances by calling
74  // the default constructor, so make sure you have one.
76  virtual ~RouteSegmentsDisplay();
77 
78  // Overrides of protected virtual functions from Display. As much
79  // as possible, when Displays are not enabled, they should not be
80  // subscribed to incoming data and should not show anything in the
81  // 3D view. These functions are where these connections are made
82  // and broken.
83 protected:
84  virtual void onInitialize();
85 
86  // A helper to clear this display back to the initial state.
87  virtual void reset();
88 
89  // These Qt slots get connected to signals indicating changes in the user-editable properties.
90 private Q_SLOTS:
91  void updateStartPointColor();
92  void updateStartPointShape();
93  void updateStartPointScale();
94  void updateEndPointColor();
95  void updateEndPointShape();
96  void updateEndPointScale();
97  void updateCenterPointColor();
98  void updateCenterPointShape();
99  void updateCenterPointScale();
100 
101  void updateHistoryLength();
102  void updateColorLines();
103  void updateColorArcs();
104  void updateShowLines();
105  void updateShowArcs();
106  void updateShowStartPoints();
107  void updateShowEndPoints();
108  void updateShowCenterPoints();
109 
110  // Function to handle an incoming ROS message.
111 private:
112  void processMessage( const tuw_nav_msgs::RouteSegments::ConstPtr& msg );
113 
114  // Storage for the list of visuals. It is a circular buffer where
115  // data gets popped from the front (oldest) and pushed to the back (newest)
116  boost::circular_buffer<boost::shared_ptr<RouteSegmentsVisual> > visuals_;
117 
118  // User-editable property variables.
128 
132 
138 };
139 
140 } // end namespace tuw_nav_rviz
141 
142 #endif // ROUTESEGMENTS_DISPLAY_H
143 // %EndTag(FULL_SOURCE)%
boost::circular_buffer< boost::shared_ptr< RouteSegmentsVisual > > visuals_


tuw_nav_rviz
Author(s):
autogenerated on Mon Jun 10 2019 15:40:12