command_gui_rviz.cpp
Go to the documentation of this file.
00001 #include "cob_command_gui_rviz/command_gui_rviz.h"
00002 
00003 #include "rviz/visualization_manager.h"     
00004 #include "rviz/window_manager_interface.h" 
00005 
00006 namespace rviz 
00007 {
00008         
00009         //constructor
00010         CommandGuiRviz::CommandGuiRviz(const std::string &name, VisualizationManager* manager):
00011         Display(name, manager),
00012         frame_(0)
00013         {
00014                 //create controls
00015                 wxWindow* parent = 0;
00016                 
00017                 WindowManagerInterface* wm = vis_manager_->getWindowManager();
00018                 
00019                 if(wm)
00020                 {
00021                         parent = wm->getParentWindow();
00022                 }
00023                 else
00024                 {
00025                         frame_ = new wxFrame(0, wxID_ANY, wxString::FromAscii(name.c_str()), wxDefaultPosition, wxDefaultSize, wxMINIMIZE_BOX | wxMAXIMIZE_BOX | wxRESIZE_BORDER | wxCAPTION | wxCLIP_CHILDREN);
00026                         parent = frame_;                
00027                 }
00028                 
00029                 panel_ = new CommandGuiRvizPanel(parent, wxString());
00030                 
00031                 if(wm)
00032                 {
00033                         wm->addPane(name, panel_);
00034                 }
00035         }
00036         
00037         //destructor
00038         CommandGuiRviz::~CommandGuiRviz()
00039         {
00040         }
00041 
00042         //show panel
00043         void CommandGuiRviz::onEnable()
00044         {
00045                 if(frame_)
00046                 {
00047                         frame_->Show(true);
00048                 }
00049                 else
00050                 {
00051                         WindowManagerInterface* wm = vis_manager_->getWindowManager();
00052                         wm->showPane(panel_);
00053                 }
00054         }
00055         
00056         //hide panel
00057         void CommandGuiRviz::onDisable()
00058         {
00059                 if(frame_)
00060                 {
00061                         frame_->Show(false);
00062                 }
00063                 else
00064                 {
00065                         WindowManagerInterface *wm = vis_manager_->getWindowManager();
00066                         wm->closePane(panel_);
00067                 }
00068         }
00069         
00070 }
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Properties Friends


cob_command_gui_rviz
Author(s): Jonathan Schwarz
autogenerated on Sun Jan 20 2013 12:37:04