#include <menu_handler.h>
Classes | |
struct | EntryContext |
Public Types | |
enum | CheckState { NO_CHECKBOX, CHECKED, UNCHECKED } |
typedef uint32_t | EntryHandle |
typedef boost::function< void(const FeedbackConstPtr &) > | FeedbackCallback |
typedef visualization_msgs::InteractiveMarkerFeedbackConstPtr | FeedbackConstPtr |
Public Member Functions | |
bool | apply (InteractiveMarkerServer &server, const std::string &marker_name) |
bool | getCheckState (EntryHandle handle, CheckState &check_state) const |
bool | getTitle (EntryHandle handle, std::string &title) const |
EntryHandle | insert (const std::string &title, const FeedbackCallback &feedback_cb) |
Insert top-level entry with feedback function. | |
EntryHandle | insert (const std::string &title, const uint8_t command_type=visualization_msgs::MenuEntry::FEEDBACK, const std::string &command="") |
Insert top-level entry with custom (client-side) command. | |
EntryHandle | insert (EntryHandle parent, const std::string &title, const FeedbackCallback &feedback_cb) |
Insert second-level entry with feedback function. | |
EntryHandle | insert (EntryHandle parent, const std::string &title, const uint8_t command_type=visualization_msgs::MenuEntry::FEEDBACK, const std::string &command="") |
Insert second-level entry with custom (client-side) command. | |
MenuHandler () | |
bool | reApply (InteractiveMarkerServer &server) |
Re-apply to all markers that this was applied to previously. | |
bool | setCheckState (EntryHandle handle, CheckState check_state) |
Specify if an entry is checked or can't be checked at all. | |
bool | setVisible (EntryHandle handle, bool visible) |
Specify if an entry should be visible or hidden. | |
Private Member Functions | |
EntryHandle | doInsert (const std::string &title, const uint8_t command_type, const std::string &command, const FeedbackCallback &feedback_cb) |
visualization_msgs::MenuEntry | makeEntry (EntryContext &context, EntryHandle handle, EntryHandle parent_handle) |
void | processFeedback (const visualization_msgs::InteractiveMarkerFeedbackConstPtr &feedback) |
bool | pushMenuEntries (std::vector< EntryHandle > &handles_in, std::vector< visualization_msgs::MenuEntry > &entries_out, EntryHandle parent_handle) |
Private Attributes | |
EntryHandle | current_handle_ |
boost::unordered_map < EntryHandle, EntryContext > | entry_contexts_ |
std::set< std::string > | managed_markers_ |
std::vector< EntryHandle > | top_level_handles_ |
Definition at line 46 of file menu_handler.h.
typedef uint32_t interactive_markers::MenuHandler::EntryHandle |
Definition at line 50 of file menu_handler.h.
typedef boost::function< void ( const FeedbackConstPtr& ) > interactive_markers::MenuHandler::FeedbackCallback |
Definition at line 53 of file menu_handler.h.
typedef visualization_msgs::InteractiveMarkerFeedbackConstPtr interactive_markers::MenuHandler::FeedbackConstPtr |
Definition at line 52 of file menu_handler.h.
Definition at line 55 of file menu_handler.h.
Definition at line 40 of file menu_handler.cpp.
bool interactive_markers::MenuHandler::apply | ( | InteractiveMarkerServer & | server, |
const std::string & | marker_name | ||
) |
Copy current menu state into the marker given by the specified name & divert callback for MENU_SELECT feedback to this manager
Definition at line 139 of file menu_handler.cpp.
MenuHandler::EntryHandle interactive_markers::MenuHandler::doInsert | ( | const std::string & | title, |
const uint8_t | command_type, | ||
const std::string & | command, | ||
const FeedbackCallback & | feedback_cb | ||
) | [private] |
Definition at line 208 of file menu_handler.cpp.
bool interactive_markers::MenuHandler::getCheckState | ( | EntryHandle | handle, |
CheckState & | check_state | ||
) | const |
Get the current state of an entry
Definition at line 123 of file menu_handler.cpp.
bool interactive_markers::MenuHandler::getTitle | ( | EntryHandle | handle, |
std::string & | title | ||
) | const |
Get the title for the given menu entry
Definition at line 265 of file menu_handler.cpp.
MenuHandler::EntryHandle interactive_markers::MenuHandler::insert | ( | const std::string & | title, |
const FeedbackCallback & | feedback_cb | ||
) |
Insert top-level entry with feedback function.
Definition at line 46 of file menu_handler.cpp.
MenuHandler::EntryHandle interactive_markers::MenuHandler::insert | ( | const std::string & | title, |
const uint8_t | command_type = visualization_msgs::MenuEntry::FEEDBACK , |
||
const std::string & | command = "" |
||
) |
Insert top-level entry with custom (client-side) command.
Definition at line 54 of file menu_handler.cpp.
MenuHandler::EntryHandle interactive_markers::MenuHandler::insert | ( | EntryHandle | parent, |
const std::string & | title, | ||
const FeedbackCallback & | feedback_cb | ||
) |
Insert second-level entry with feedback function.
Definition at line 64 of file menu_handler.cpp.
MenuHandler::EntryHandle interactive_markers::MenuHandler::insert | ( | EntryHandle | parent, |
const std::string & | title, | ||
const uint8_t | command_type = visualization_msgs::MenuEntry::FEEDBACK , |
||
const std::string & | command = "" |
||
) |
Insert second-level entry with custom (client-side) command.
Definition at line 78 of file menu_handler.cpp.
visualization_msgs::MenuEntry interactive_markers::MenuHandler::makeEntry | ( | EntryContext & | context, |
EntryHandle | handle, | ||
EntryHandle | parent_handle | ||
) | [private] |
Definition at line 228 of file menu_handler.cpp.
void interactive_markers::MenuHandler::processFeedback | ( | const visualization_msgs::InteractiveMarkerFeedbackConstPtr & | feedback | ) | [private] |
Definition at line 254 of file menu_handler.cpp.
bool interactive_markers::MenuHandler::pushMenuEntries | ( | std::vector< EntryHandle > & | handles_in, |
std::vector< visualization_msgs::MenuEntry > & | entries_out, | ||
EntryHandle | parent_handle | ||
) | [private] |
Definition at line 160 of file menu_handler.cpp.
Re-apply to all markers that this was applied to previously.
Definition at line 192 of file menu_handler.cpp.
bool interactive_markers::MenuHandler::setCheckState | ( | EntryHandle | handle, |
CheckState | check_state | ||
) |
Specify if an entry is checked or can't be checked at all.
Definition at line 108 of file menu_handler.cpp.
bool interactive_markers::MenuHandler::setVisible | ( | EntryHandle | handle, |
bool | visible | ||
) |
Specify if an entry should be visible or hidden.
Definition at line 93 of file menu_handler.cpp.
Definition at line 136 of file menu_handler.h.
boost::unordered_map<EntryHandle, EntryContext> interactive_markers::MenuHandler::entry_contexts_ [private] |
Definition at line 134 of file menu_handler.h.
std::set<std::string> interactive_markers::MenuHandler::managed_markers_ [private] |
Definition at line 138 of file menu_handler.h.
Definition at line 132 of file menu_handler.h.