00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030 #include "tf_frame_property.h"
00031 #include "properties/forwards.h"
00032 #include "frame_manager.h"
00033
00034 #include <ros/console.h>
00035
00036 #include <tf/transform_listener.h>
00037
00038 namespace rviz
00039 {
00040
00041 IMPLEMENT_DYNAMIC_CLASS(TFFramePGEditor, wxPGComboBoxEditor);
00042 IMPLEMENT_DYNAMIC_CLASS(TFFramePGProperty, wxEditEnumProperty);
00043
00044 TFFramePGEditor::TFFramePGEditor()
00045 {
00046
00047 }
00048
00049 wxPGWindowList TFFramePGEditor::CreateControls(wxPropertyGrid *propgrid, wxPGProperty *property, const wxPoint &pos, const wxSize &size) const
00050 {
00051
00052
00053
00054 #if wxMAJOR_VERSION == 2 and wxMINOR_VERSION == 9 // If wxWidgets 2.9.x
00055 wxPGChoices choices = property->GetChoices();
00056 #else
00057 wxPGChoices& choices = property->GetChoices();
00058 #endif
00059 choices.Clear();
00060 choices.Add(wxT(FIXED_FRAME_STRING));
00061
00062 typedef std::vector<std::string> V_string;
00063 V_string frames;
00064 FrameManager::instance()->getTFClient()->getFrameStrings( frames );
00065 std::sort(frames.begin(), frames.end());
00066
00067 V_string::iterator it = frames.begin();
00068 V_string::iterator end = frames.end();
00069 for (; it != end; ++it)
00070 {
00071 const std::string& frame = *it;
00072 if (frame.empty())
00073 {
00074 continue;
00075 }
00076
00077 choices.Add(wxString::FromAscii(frame.c_str()));
00078 }
00079
00080 return wxPGComboBoxEditor::CreateControls(propgrid, property, pos, size);
00081 }
00082
00083 TFFramePGProperty::TFFramePGProperty()
00084 {
00085
00086 }
00087
00088 TFFramePGProperty::TFFramePGProperty(const wxString& label, const wxString& name, const wxString& value )
00089 : wxEditEnumProperty( label, name )
00090 {
00091 SetValue(value);
00092 }
00093
00094 }
00095