Flatland
flatland_window.h
1 /*
2  * ______ __ __ __
3  * /\ _ \ __ /\ \/\ \ /\ \__
4  * \ \ \L\ \ __ __ /\_\ \_\ \ \ \____ ___\ \ ,_\ ____
5  * \ \ __ \/\ \/\ \\/\ \ /'_` \ \ '__`\ / __`\ \ \/ /',__\
6  * \ \ \/\ \ \ \_/ |\ \ \/\ \L\ \ \ \L\ \/\ \L\ \ \ \_/\__, `\
7  * \ \_\ \_\ \___/ \ \_\ \___,_\ \_,__/\ \____/\ \__\/\____/
8  * \/_/\/_/\/__/ \/_/\/__,_ /\/___/ \/___/ \/__/\/___/
9  * @copyright Copyright 2017 Avidbots Corp.
10  * @name flatland_window.cpp
11  * @brief Main window and toolbars for flatland_viz
12  * @author Joseph Duchesne
13  *
14  * Software License Agreement (BSD License)
15  *
16  * Copyright (c) 2017, Avidbots Corp.
17  * All rights reserved.
18  *
19  * Redistribution and use in source and binary forms, with or without
20  * modification, are permitted provided that the following conditions
21  * are met:
22  *
23  * * Redistributions of source code must retain the above copyright
24  * notice, this list of conditions and the following disclaimer.
25  * * Redistributions in binary form must reproduce the above
26  * copyright notice, this list of conditions and the following
27  * disclaimer in the documentation and/or other materials provided
28  * with the distribution.
29  * * Neither the name of the Avidbots Corp. nor the names of its
30  * contributors may be used to endorse or promote products derived
31  * from this software without specific prior written permission.
32  *
33  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
34  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
35  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
36  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
37  * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
38  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
39  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
40  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
41  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
42  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
43  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
44  * POSSIBILITY OF SUCH DAMAGE.
45  */
46 
47 // namespace rviz;
48 
49 #include <ros/ros.h>
50 #include <QLabel>
51 #include <QMainWindow>
52 #include <QPushButton>
53 #include <QWidget>
54 #include "flatland_viz/flatland_viz.h"
55 
56 #include "rviz/display.h"
57 #include "rviz/display_context.h"
58 #include "rviz/displays_panel.h"
59 #include "rviz/env_config.h"
60 #include "rviz/failed_panel.h"
61 #include "rviz/help_panel.h"
62 #include "rviz/load_resource.h"
63 #include "rviz/loading_dialog.h"
64 #include "rviz/new_object_dialog.h"
65 #include "rviz/panel_dock_widget.h"
66 #include "rviz/panel_factory.h"
67 #include "rviz/properties/status_property.h"
68 #include "rviz/render_panel.h"
69 #include "rviz/screenshot_dialog.h"
70 #include "rviz/selection/selection_manager.h"
71 #include "rviz/selection_panel.h"
72 #include "rviz/splash_screen.h"
73 #include "rviz/time_panel.h"
74 #include "rviz/tool.h"
75 #include "rviz/tool_manager.h"
76 #include "rviz/tool_properties_panel.h"
77 #include "rviz/view_manager.h"
78 #include "rviz/views_panel.h"
79 #include "rviz/visualization_frame.h"
80 #include "rviz/visualization_manager.h"
81 #include "rviz/widget_geometry_change_detector.h"
82 #include "rviz/yaml_config_reader.h"
83 #include "rviz/yaml_config_writer.h"
84 
85 class FlatlandWindow : public QMainWindow {
86  Q_OBJECT
87  public:
88  FlatlandWindow(QWidget* parent = 0);
89  rviz::VisualizationManager* visualization_manager_;
90  rviz::RenderPanel* render_panel_;
91 
92  rviz::VisualizationManager* getManager();
93 
94  QLabel* fps_label_;
95 
96  protected Q_SLOTS:
97 
98  void openNewToolDialog();
99 
100  void UpdateFps();
101 
102  private:
103  FlatlandViz* viz_;
104 
105  int frame_count_;
106  ros::WallTime last_fps_calc_time_;
107 };
Definition: flatland_window.h:85
Definition: flatland_viz.h:90