RobotVisualizationWidget.h
Go to the documentation of this file.
1/*
2 * This file is part of ArmarX.
3 *
4 * Copyright (C) 2011-2016, High Performance Humanoid Technologies (H2T), Karlsruhe Institute of Technology (KIT), all rights reserved.
5 *
6 * ArmarX is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 * ArmarX is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 *
18 * @package
19 * @author
20 * @date
21 * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
22 * GNU General Public License
23 */
24#ifndef RobotVisualizationWidget_h
25#define RobotVisualizationWidget_h
26
27/* Qt headers */
28#include <QSplitter>
29#include <QWidget>
30
31#include "RobotVisualization.h"
32
33namespace armarx
34{
35 /**
36 * @brief The RobotVisualizationWidget class
37 * Holds the original viewer and reproduces it tosupport parallel views.
38 * Automatically splits the viewers.
39 */
40 class RobotVisualizationWidget : public QSplitter
41 {
42 Q_OBJECT
43
44 public:
45 /**
46 * Constructor.
47 * Constructs a robot viewer widget.
48 * Expects a controller::ControllerPtr.
49 *
50 * @param control shared pointer to controller::controller
51 * @param parent parent widget
52 *
53 */
54 explicit RobotVisualizationWidget(QWidget* parent = 0,
55 QWidget* viewerWidget = 0,
56 RobotVisualizationPtr viewer = 0);
57
58 /**
59 * Destructor.
60 *
61 */
63 /**
64 * @brief getRobotViewer the RobotVisualizationPtr that is held by this widget
65 * @return he RobotVisualizationPtr that is held by this widget
66 */
68 /**
69 * @brief addWidget adds a new View by reproducing the original viewer
70 */
71 void addWidget();
72 /**
73 * @brief removeWidget removes a view from this Widget
74 */
75 void removeWidget();
76 /**
77 * @brief setCameraOfFocused sets the camera of the viewer that is currently focused (the viewer that was last clicked on or zoomed in)
78 * @param position the position of the camera
79 * @param pointAtA the lower point to point the camera at
80 * @param pointAtB the upper point to point the camera at
81 */
82 void setCameraOfFocused(Eigen::Vector3f position,
83 Eigen::Vector3f pointAtA,
84 Eigen::Vector3f pointAtB);
85
86
87 private slots:
88 void activeWidgetChanged(QWidget* old, QWidget* now);
89
90 private:
92 QWidget* viewerWidget;
93 QSplitter* leftSplitter;
94 QSplitter* rightSplitter;
95 int childrenCounter;
96 int selectedViewer;
97 std::vector<RobotVisualizationPtr> clones;
98 std::vector<QWidget*> cloneWidgets;
99 };
100
101 using RobotVisualizationWidgetPtr = std::shared_ptr<RobotVisualizationWidget>;
102} // namespace armarx
103
104#endif
void addWidget()
addWidget adds a new View by reproducing the original viewer
void removeWidget()
removeWidget removes a view from this Widget
RobotVisualizationPtr getRobotViewer()
getRobotViewer the RobotVisualizationPtr that is held by this widget
RobotVisualizationWidget(QWidget *parent=0, QWidget *viewerWidget=0, RobotVisualizationPtr viewer=0)
Constructor.
void setCameraOfFocused(Eigen::Vector3f position, Eigen::Vector3f pointAtA, Eigen::Vector3f pointAtB)
setCameraOfFocused sets the camera of the viewer that is currently focused (the viewer that was last ...
This file offers overloads of toIce() and fromIce() functions for STL container types.
std::shared_ptr< RobotVisualizationWidget > RobotVisualizationWidgetPtr
std::shared_ptr< RobotVisualization > RobotVisualizationPtr