00001 /* 00002 * Copyright (c) 2008, Willow Garage, Inc. 00003 * All rights reserved. 00004 * 00005 * Redistribution and use in source and binary forms, with or without 00006 * modification, are permitted provided that the following conditions are met: 00007 * 00008 * * Redistributions of source code must retain the above copyright 00009 * notice, this list of conditions and the following disclaimer. 00010 * * Redistributions in binary form must reproduce the above copyright 00011 * notice, this list of conditions and the following disclaimer in the 00012 * documentation and/or other materials provided with the distribution. 00013 * * Neither the name of the Willow Garage, Inc. nor the names of its 00014 * contributors may be used to endorse or promote products derived from 00015 * this software without specific prior written permission. 00016 * 00017 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 00018 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 00019 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 00020 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 00021 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 00022 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 00023 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 00024 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 00025 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 00026 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 00027 * POSSIBILITY OF SUCH DAMAGE. 00028 */ 00029 00030 00031 #ifndef RVIZ_PATH_DISPLAY_H 00032 #define RVIZ_PATH_DISPLAY_H 00033 00034 #include <nav_msgs/Path.h> 00035 00036 #include "rviz/message_filter_display.h" 00037 #include <rviz/ogre_helpers/arrow.h> 00038 #include <rviz/ogre_helpers/axes.h> 00039 00040 namespace Ogre 00041 { 00042 class ManualObject; 00043 } 00044 00045 namespace rviz 00046 { 00047 00048 class ColorProperty; 00049 class FloatProperty; 00050 class IntProperty; 00051 class EnumProperty; 00052 class BillboardLine; 00053 class VectorProperty; 00054 00055 00060 class PathDisplay: public MessageFilterDisplay<nav_msgs::Path> 00061 { 00062 Q_OBJECT 00063 public: 00064 PathDisplay(); 00065 virtual ~PathDisplay(); 00066 00068 virtual void reset(); 00069 00070 protected: 00072 virtual void onInitialize(); 00073 00075 void processMessage( const nav_msgs::Path::ConstPtr& msg ); 00076 00077 private Q_SLOTS: 00078 void updateBufferLength(); 00079 void updateStyle(); 00080 void updateLineWidth(); 00081 void updateOffset(); 00082 void updatePoseStyle(); 00083 void updatePoseAxisGeometry(); 00084 void updatePoseArrowColor(); 00085 void updatePoseArrowGeometry(); 00086 00087 private: 00088 void destroyObjects(); 00089 void allocateArrowVector(std::vector<rviz::Arrow*>& arrow_vect, int num); 00090 void allocateAxesVector(std::vector<rviz::Axes*>& axes_vect, int num); 00091 void destroyPoseAxesChain(); 00092 void destroyPoseArrowChain(); 00093 00094 std::vector<Ogre::ManualObject*> manual_objects_; 00095 std::vector<rviz::BillboardLine*> billboard_lines_; 00096 std::vector<std::vector<rviz::Axes*> >axes_chain_; 00097 std::vector<std::vector<rviz::Arrow*> >arrow_chain_; 00098 00099 EnumProperty* style_property_; 00100 ColorProperty* color_property_; 00101 FloatProperty* alpha_property_; 00102 FloatProperty* line_width_property_; 00103 IntProperty* buffer_length_property_; 00104 VectorProperty* offset_property_; 00105 00106 enum LineStyle { 00107 LINES, 00108 BILLBOARDS 00109 }; 00110 00111 // pose marker property 00112 EnumProperty* pose_style_property_; 00113 FloatProperty* pose_axes_length_property_; 00114 FloatProperty* pose_axes_radius_property_; 00115 ColorProperty* pose_arrow_color_property_; 00116 FloatProperty* pose_arrow_shaft_length_property_; 00117 FloatProperty* pose_arrow_head_length_property_; 00118 FloatProperty* pose_arrow_shaft_diameter_property_; 00119 FloatProperty* pose_arrow_head_diameter_property_; 00120 00121 enum PoseStyle 00122 { 00123 NONE, 00124 AXES, 00125 ARROWS, 00126 }; 00127 00128 }; 00129 00130 } // namespace rviz 00131 00132 #endif /* RVIZ_PATH_DISPLAY_H */ 00133