00001 /**************************************************************** 00002 * 00003 * Copyright (c) 2010 00004 * 00005 * Fraunhofer Institute for Manufacturing Engineering 00006 * and Automation (IPA) 00007 * 00008 * +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 00009 * 00010 * Project name: care-o-bot 00011 * ROS stack name: cob_3d_environment_perception_intern 00012 * ROS package name: cob_3d_mapping_demonstrator 00013 * Description: Feature Map for storing and handling geometric features 00014 * 00015 * +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 00016 * 00017 * Author: Georg Arbeiter, email:georg.arbeiter@ipa.fhg.de 00018 * Supervised by: Georg Arbeiter, email:georg.arbeiter@ipa.fhg.de 00019 * 00020 * Date of creation: 04/2012 00021 * ToDo: 00022 * 00023 * 00024 * 00025 * +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 00026 * 00027 * Redistribution and use in source and binary forms, with or without 00028 * modification, are permitted provided that the following conditions are met: 00029 * 00030 * * Redistributions of source code must retain the above copyright 00031 * notice, this list of conditions and the following disclaimer. 00032 * * Redistributions in binary form must reproduce the above copyright 00033 * notice, this list of conditions and the following disclaimer in the 00034 * documentation and/or other materials provided with the distribution. 00035 * * Neither the name of the Fraunhofer Institute for Manufacturing 00036 * Engineering and Automation (IPA) nor the names of its 00037 * contributors may be used to endorse or promote products derived from 00038 * this software without specific prior written permission. 00039 * 00040 * This program is free software: you can redistribute it and/or modify 00041 * it under the terms of the GNU Lesser General Public License LGPL as 00042 * published by the Free Software Foundation, either version 3 of the 00043 * License, or (at your option) any later version. 00044 * 00045 * This program is distributed in the hope that it will be useful, 00046 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00047 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00048 * GNU Lesser General Public License LGPL for more details. 00049 * 00050 * You should have received a copy of the GNU Lesser General Public 00051 * License LGPL along with this program. 00052 * If not, see <http://www.gnu.org/licenses/>. 00053 * 00054 ****************************************************************/ 00055 00056 #include "cob_3d_mapping_demonstrator/wx_rviz_logo.h" 00057 #include "rviz/visualization_manager.h" 00058 #include "rviz/window_manager_interface.h" 00059 #include <ros/package.h> 00060 00061 using namespace std; 00062 00063 00064 namespace rviz 00065 { 00066 00067 RvizLogo::~RvizLogo() { 00068 00069 } 00070 00074 RvizLogo::RvizLogo(const std::string& name, VisualizationManager* manager/*wxWindow *parent, const wxString& title, rviz::WindowManagerInterface * wmi */) 00075 : Display( "logo", manager ), 00076 frame_(0) 00077 //: wxPanel( parent, wxID_ANY, wxDefaultPosition, wxSize(280, 180), wxTAB_TRAVERSAL, title) 00078 //, m_wmi( wmi ) 00079 { 00080 string path = ros::package::getPath("cob_3d_mapping_demonstrator") + "/ros/files/logo_title.jpg"; 00081 // Create controls 00082 //m_button = new wxButton(this, ID_RESET_BUTTON, wxT("Reset map")); 00083 wxWindow* parent = 0; 00084 00085 WindowManagerInterface* wm = vis_manager_->getWindowManager(); 00086 if (wm) 00087 { 00088 parent = wm->getParentWindow(); 00089 } 00090 else 00091 { 00092 frame_ = new wxFrame(0, wxID_ANY, wxString::FromAscii(""), wxDefaultPosition, wxDefaultSize, wxMINIMIZE_BOX | wxMAXIMIZE_BOX | wxRESIZE_BORDER | wxCAPTION | wxCLIP_CHILDREN); 00093 parent = frame_; 00094 } 00095 00096 panel_ = new wxImagePanel(parent, wxString::FromAscii(path.c_str()),wxBITMAP_TYPE_JPEG); 00097 //if (!pic_.LoadFile(wxT("/home/goa/git/cob_environment_perception_intern/cob_3d_mapping_demonstrator/lib/logo.jpg"),wxBITMAP_TYPE_JPEG)) ROS_ERROR("Image file not found!"); 00098 //logo_ = new wxStaticBitmap(panel_, wxID_ANY, pic_); 00099 //wxSizer *vsizer = new wxBoxSizer(wxVERTICAL); 00100 //vsizer->Add(logo_, 1, wxALIGN_CENTER); 00101 00102 //vsizer->SetSizeHints(panel_); 00103 //panel_->SetSizerAndFit(vsizer); 00104 00105 if (wm) 00106 { 00107 wm->addPane(name, panel_); 00108 } 00109 } 00110 00111 void RvizLogo::onEnable() 00112 { 00113 if (frame_) 00114 { 00115 frame_->Show(true); 00116 } 00117 else 00118 { 00119 WindowManagerInterface* wm = vis_manager_->getWindowManager(); 00120 wm->showPane(panel_); 00121 } 00122 } 00123 00124 void RvizLogo::onDisable() 00125 { 00126 if (frame_) 00127 { 00128 frame_->Show(false); 00129 } 00130 else 00131 { 00132 WindowManagerInterface* wm = vis_manager_->getWindowManager(); 00133 wm->closePane(panel_); 00134 } 00135 } 00136 00137 } 00139