$search
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 #ifndef RVIZ_VISUALIZATION_FRAME_H 00031 #define RVIZ_VISUALIZATION_FRAME_H 00032 00033 #include "window_manager_interface.h" 00034 00035 #include <wx/frame.h> 00036 00037 #include <string> 00038 #include <deque> 00039 #include <boost/shared_ptr.hpp> 00040 00041 class wxConfigBase; 00042 class wxMenuBar; 00043 class wxMenu; 00044 class wxAuiManager; 00045 class wxAuiManagerEvent; 00046 class wxToolBar; 00047 00048 namespace rviz 00049 { 00050 00051 class RenderPanel; 00052 class DisplaysPanel; 00053 class ViewsPanel; 00054 class TimePanel; 00055 class SelectionPanel; 00056 class ToolPropertiesPanel; 00057 class VisualizationManager; 00058 class Tool; 00059 class SplashScreen; 00060 00061 class VisualizationFrame : public wxFrame, public WindowManagerInterface 00062 { 00063 public: 00064 VisualizationFrame(wxWindow* parent); 00065 ~VisualizationFrame(); 00066 00067 void initialize(const std::string& display_config_file = "", const std::string& fixed_frame = "", 00068 const std::string& target_frame = "", const std::string& splash_path = "", bool verbose=false ); 00069 00070 VisualizationManager* getManager() { return manager_; } 00071 00072 // overrides from WindowManagerInterface 00073 virtual wxWindow* getParentWindow(); 00074 virtual void addPane(const std::string& name, wxWindow* panel); 00075 virtual void removePane(wxWindow* panel); 00076 virtual void showPane(wxWindow* panel); 00077 virtual void closePane(wxWindow* panel); 00078 00079 protected: 00080 void initConfigs(); 00081 void initMenus(); 00082 void loadDisplayConfig(const std::string& path); 00083 void saveConfigs(); 00084 00085 // wx Callbacks 00086 void onClose(wxCommandEvent& event); 00087 void onOpen(wxCommandEvent& event); 00088 void onSave(wxCommandEvent& event); 00090 void onToolClicked( wxCommandEvent& event ); 00091 void onPaneClosed(wxAuiManagerEvent& event); 00092 void onViewMenuItemSelected(wxCommandEvent& event); 00093 void onManagePlugins(wxCommandEvent& event); 00094 void onHelpWiki(wxCommandEvent& event); 00095 void onRecentConfigSelected(wxCommandEvent& event); 00096 00097 // other Callbacks 00098 void onToolAdded(Tool* tool); 00099 void onToolChanged(Tool* tool); 00100 00101 void onSplashLoadStatus(const std::string& status, SplashScreen* splash); 00102 00103 void markRecentConfig(const std::string& path); 00104 void updateRecentConfigMenu(); 00105 00106 RenderPanel* render_panel_; 00107 DisplaysPanel* displays_panel_; 00108 ViewsPanel* views_panel_; 00109 TimePanel* time_panel_; 00110 SelectionPanel* selection_panel_; 00111 ToolPropertiesPanel* tool_properties_panel_; 00112 00113 boost::shared_ptr<wxConfigBase> general_config_; 00114 boost::shared_ptr<wxConfigBase> display_config_; 00115 std::string config_dir_; 00116 std::string general_config_file_; 00117 std::string display_config_file_; 00118 std::string last_config_dir_; 00119 00120 wxMenuBar* menubar_; 00121 wxMenu* file_menu_; 00122 wxMenu* recent_configs_menu_; 00123 wxMenu* view_menu_; 00124 wxMenu* plugins_menu_; 00125 wxMenu* help_menu_; 00126 00127 wxToolBar* toolbar_; 00128 00129 wxAuiManager* aui_manager_; 00130 00131 VisualizationManager* manager_; 00132 00133 std::string package_path_; 00134 00135 SplashScreen* splash_; 00136 00137 typedef std::deque<std::string> D_string; 00138 D_string recent_configs_; 00139 }; 00140 00141 } 00142 00143 #endif // RVIZ_VISUALIZATION_FRAME_H