spline_display.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2012, Willow Garage, Inc.
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions are met:
7  *
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 the Willow Garage, Inc. nor the names of its
14  * contributors may be used to endorse or promote products derived from
15  * 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 THE COPYRIGHT OWNER OR CONTRIBUTORS BE
21  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
22  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
23  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
25  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
26  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27  * POSSIBILITY OF SUCH DAMAGE.
28  */
29 
30 #ifndef SPLINE_DISPLAY_H
31 #define SPLINE_DISPLAY_H
32 
33 #ifndef Q_MOC_RUN
34 #include <boost/circular_buffer.hpp>
35 
37 #include <tuw_spline_msgs/Spline.h>
39 #endif
40 
42 
43 namespace Ogre
44 {
45 class SceneNode;
46 }
47 
48 namespace rviz
49 {
50 class ColorProperty;
51 class EnumProperty;
52 class FloatProperty;
53 class IntProperty;
54 }
55 
56 // All the source in this plugin is in its own namespace. This is not
57 // required but is good practice.
59 {
60 
61 class SplineVisual;
62 
63 // Here we declare our new subclass of rviz::Display. Every display
64 // which can be listed in the "Displays" panel is a subclass of
65 // rviz::Display.
66 class SplineDisplay: public rviz::MessageFilterDisplay<tuw_spline_msgs::Spline>
67 {
68 Q_OBJECT
69 public:
70  // Constructor. pluginlib::ClassLoader creates instances by calling
71  // the default constructor, so make sure you have one.
72  SplineDisplay();
73  virtual ~SplineDisplay();
74 
75  // Overrides of protected virtual functions from Display. As much
76  // as possible, when Displays are not enabled, they should not be
77  // subscribed to incoming data and should not show anything in the
78  // 3D view. These functions are where these connections are made
79  // and broken.
80 protected:
81  virtual void onInitialize();
82 
83  // A helper to clear this display back to the initial state.
84  virtual void reset();
85 
86  // These Qt slots get connected to signals indicating changes in the user-editable properties.
87 private Q_SLOTS:
88  void updatePathColor();
89  void updateShape();
90  void updatePathScale();
91  void updatePathPointsNr();
92 
93  void updateOrientColor();
94  void updateOrientShape();
95  void updateOrientScale();
96  void updateOrientPointsNr();
97 
98  void updateHistoryLength();
99 
100  // Function to handle an incoming ROS message.
101 private:
102  void processMessage( const tuw_spline_msgs::Spline::ConstPtr& msg );
103 
104  // Storage for the list of visuals. It is a circular buffer where
105  // data gets popped from the front (oldest) and pushed to the back (newest)
106  boost::circular_buffer<boost::shared_ptr<SplineVisual> > visuals_;
107 
108  // User-editable property variables.
113 
117 
119 };
120 
121 } // end namespace marker_rviz_plugin
122 
123 #endif // SPLINE_DISPLAY_H
124 // %EndTag(FULL_SOURCE)%
boost::circular_buffer< boost::shared_ptr< SplineVisual > > visuals_
rviz::ColorProperty * color_orient_property_
rviz::IntProperty * points_nr_path_property_
rviz::ColorProperty * color_path_property_
rviz::FloatProperty * scale_orient_property_
rviz::IntProperty * points_nr_orient_property_
rviz::FloatProperty * scale_path_property_
rviz::IntProperty * history_length_property_


tuw_spline_rviz_plugin
Author(s):
autogenerated on Mon Aug 1 2016 04:05:16