Go to the documentation of this file.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 #ifndef RVIZ_VISUALIZATION_FRAME_H
00031 #define RVIZ_VISUALIZATION_FRAME_H
00032
00033 #include <QMainWindow>
00034 #include <QList>
00035
00036 #include <string>
00037 #include <deque>
00038 #include <boost/shared_ptr.hpp>
00039
00040 #include "rviz/window_manager_interface.h"
00041 #include "rviz/config.h"
00042
00043 class QSplashScreen;
00044 class QAction;
00045 class QActionGroup;
00046
00047 namespace rviz
00048 {
00049
00050 class PanelDockWidget;
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
00069 class VisualizationFrame : public QMainWindow, public WindowManagerInterface
00070 {
00071 Q_OBJECT
00072 public:
00073 VisualizationFrame( QWidget* parent = 0 );
00074 ~VisualizationFrame();
00075
00076 void initialize( const std::string& display_config_file = "",
00077 const std::string& fixed_frame = "",
00078 const std::string& target_frame = "",
00079 const std::string& splash_path = "",
00080 bool verbose=false );
00081
00082 VisualizationManager* getManager() { return manager_; }
00083
00084
00085 virtual QWidget* getParentWindow();
00086 virtual PanelDockWidget* addPane( const std::string& name, QWidget* panel, Qt::DockWidgetArea area = Qt::LeftDockWidgetArea, bool floating = true );
00087
00088 protected Q_SLOTS:
00089 void onOpen();
00090 void onSave();
00091 void onRecentConfigSelected();
00092 void onHelpWiki();
00093
00096 void onToolbarActionTriggered( QAction* action );
00097
00102 void addTool(Tool* tool);
00103
00106 void indicateToolIsCurrent(Tool* tool);
00107
00108 protected:
00109 void initConfigs();
00110 void initMenus();
00111 void loadDisplayConfig(const std::string& path);
00112 void saveConfigs();
00113
00114 void moveEvent( QMoveEvent* event );
00115 void closeEvent( QCloseEvent* event );
00116
00118
00119 void onSplashLoadStatus( const std::string& status );
00120
00121 void markRecentConfig(const std::string& path);
00122 void updateRecentConfigMenu();
00123
00124 QRect hackedFrameGeometry();
00125
00126 RenderPanel* render_panel_;
00127 DisplaysPanel* displays_panel_;
00128 ViewsPanel* views_panel_;
00129 TimePanel* time_panel_;
00130 SelectionPanel* selection_panel_;
00131 ToolPropertiesPanel* tool_properties_panel_;
00132
00133 boost::shared_ptr<Config> general_config_;
00134 boost::shared_ptr<Config> display_config_;
00135 std::string config_dir_;
00136 std::string general_config_file_;
00137 std::string display_config_file_;
00138 std::string last_config_dir_;
00139
00140 QMenu* file_menu_;
00141 QMenu* recent_configs_menu_;
00142 QMenu* view_menu_;
00143 QMenu* plugins_menu_;
00144 QList<QAction*> view_menu_actions_;
00145
00146 QToolBar* toolbar_;
00147
00148 VisualizationManager* manager_;
00149
00150 std::string package_path_;
00151
00152 QSplashScreen* splash_;
00153
00154 typedef std::deque<std::string> D_string;
00155 D_string recent_configs_;
00156
00157 QPoint first_position_;
00158 QPoint position_correction_;
00159 int num_move_events_;
00160 QActionGroup* toolbar_actions_;
00161 std::map<QAction*,Tool*> action_to_tool_map_;
00162 std::map<Tool*,QAction*> tool_to_action_map_;
00163 };
00164
00165 }
00166
00167 #endif // RVIZ_VISUALIZATION_FRAME_H