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 <QWidget>
29 #include <QSplitter>
30 
31 #include "RobotVisualization.h"
32 
33 namespace 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, QWidget* viewerWidget = 0, RobotVisualizationPtr viewer = 0);
55 
56  /**
57  * Destructor.
58  *
59  */
61  /**
62  * @brief getRobotViewer the RobotVisualizationPtr that is held by this widget
63  * @return he RobotVisualizationPtr that is held by this widget
64  */
66  /**
67  * @brief addWidget adds a new View by reproducing the original viewer
68  */
69  void addWidget();
70  /**
71  * @brief removeWidget removes a view from this Widget
72  */
73  void removeWidget();
74  /**
75  * @brief setCameraOfFocused sets the camera of the viewer that is currently focused (the viewer that was last clicked on or zoomed in)
76  * @param position the position of the camera
77  * @param pointAtA the lower point to point the camera at
78  * @param pointAtB the upper point to point the camera at
79  */
80  void setCameraOfFocused(Eigen::Vector3f position, Eigen::Vector3f pointAtA, Eigen::Vector3f pointAtB);
81 
82 
83  private slots:
84  void activeWidgetChanged(QWidget* old, QWidget* now);
85 
86  private:
87  RobotVisualizationPtr viewer;
88  QWidget* viewerWidget;
89  QSplitter* leftSplitter;
90  QSplitter* rightSplitter;
91  int childrenCounter;
92  int selectedViewer;
93  std::vector<RobotVisualizationPtr> clones;
94  std::vector<QWidget*> cloneWidgets;
95  };
96 
97  using RobotVisualizationWidgetPtr = std::shared_ptr<RobotVisualizationWidget>;
98 }
99 
100 #endif
armarx::RobotVisualizationWidgetPtr
std::shared_ptr< RobotVisualizationWidget > RobotVisualizationWidgetPtr
Definition: RobotVisualizationWidget.h:97
armarx::RobotVisualizationWidget
The RobotVisualizationWidget class Holds the original viewer and reproduces it tosupport parallel vie...
Definition: RobotVisualizationWidget.h:40
armarx::RobotVisualizationWidget::removeWidget
void removeWidget()
removeWidget removes a view from this Widget
Definition: RobotVisualizationWidget.cpp:93
armarx::RobotVisualizationWidget::getRobotViewer
RobotVisualizationPtr getRobotViewer()
getRobotViewer the RobotVisualizationPtr that is held by this widget
armarx::RobotVisualizationWidget::~RobotVisualizationWidget
~RobotVisualizationWidget()
Destructor.
Definition: RobotVisualizationWidget.cpp:54
armarx::RobotVisualizationWidget::setCameraOfFocused
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 ...
Definition: RobotVisualizationWidget.cpp:135
armarx::RobotVisualizationWidget::RobotVisualizationWidget
RobotVisualizationWidget(QWidget *parent=0, QWidget *viewerWidget=0, RobotVisualizationPtr viewer=0)
Constructor.
Definition: RobotVisualizationWidget.cpp:32
armarx::RobotVisualizationPtr
std::shared_ptr< RobotVisualization > RobotVisualizationPtr
Definition: RobotVisualization.h:161
RobotVisualization.h
armarx::RobotVisualizationWidget::addWidget
void addWidget()
addWidget adds a new View by reproducing the original viewer
Definition: RobotVisualizationWidget.cpp:59
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:28