RobotTrajectoryDesignerGuiPluginWidgetController.cpp
Go to the documentation of this file.
1 /*
2 * This file is part of ArmarX.
3 *
4 * ArmarX is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 *
8 * ArmarX is distributed in the hope that it will be useful, but
9 * WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * \package RobotTrajectoryDesigner::gui-plugins::RobotTrajectoryDesignerGuiPluginWidgetController
17 * \author Max Beddies
18 * \date 2018
19 * \copyright http://www.gnu.org/licenses/gpl-2.0.txt
20 * GNU General Public License
21 */
22 
24 
25 #include <string>
26 #include <QCoreApplication>
27 #include <VirtualRobot/XML/RobotIO.h>
28 #include <QShortcut>
29 
32 
33 #include <RobotAPI/interface/core/RobotState.h>
34 using namespace armarx;
35 
37 {
38 }
39 
40 
42 {
43 
44 }
45 
46 
48 {
49 
50 }
51 
53 {
54 
55 }
56 
57 
59 {
60  QMetaObject::invokeMethod(this, "initWidget");
61 }
62 
63 
65 {
66  QMetaObject::invokeMethod(this, "connectWidget");
67 }
68 
70 {
71  viewControllerPtr.reset();
72  toolBarControllerPtr.reset();
73  widget.robotVisualization->~QWidget();
74  this->robotVisualizationControllerPtr.reset();
75  mementoControllerPtr.reset();
76  settingControllerPtr.reset();
77  shortcutControllerPtr.reset();
78  tcpInformationControllerPtr.reset();
79  tcpSelectionControllerPtr.reset();
80  trajectoryControllerPtr.reset();
81  transitionControllerPtr.reset();
82  waypointControllerPtr.reset();
83  exportDialogControllerPtr.reset();
84  importDialogControllerPtr.reset();
85  robotVisualizationControllerPtr.reset();
86  environmentControllerPtr.reset();
88 }
89 
91 {
92  widget.setupUi(getWidget());
93  // Create shared pointers for each member, initialize each controller
94  this->exportDialogControllerPtr = std::make_shared<ExportDialogController>();
95  this->importDialogControllerPtr = std::make_shared<ImportDialogController>();
96  this->mementoControllerPtr = std::make_shared<MementoController>(
97  widget.undoButton, widget.redoButton);
98  this->robotVisualizationControllerPtr = std::make_shared<RobotVisualizationController>(widget.robotVisualization);
99  this->robotVisualizationControllerPtr->addConnection(this->robotVisualizationControllerPtr);
100 
101  SettingTabPtr settingTabPtr(widget.settingTab);
102  this->settingControllerPtr = std::make_shared<SettingController>(settingTabPtr);
103  this->shortcutControllerPtr = std::make_shared<ShortcutController>(getWidget().data());
104  TCPInformationPtr tcpInformationPtr(widget.tcpInformationTab);
105  this->tcpInformationControllerPtr = std::make_shared<TCPInformationController>(
106  tcpInformationPtr);
107  this->tcpSelectionControllerPtr = std::make_shared<TCPSelectionController>(
108  widget.currentTPComboBox);
109 
110  ToolBarPtr toolBarPtr(widget.toolBar);
111  this->toolBarControllerPtr = std::make_shared<ToolBarController>(toolBarPtr);
112  widget.toolBar->raise();
113  this->trajectoryControllerPtr = std::make_shared<TrajectoryController>();
114 
115  TransitionTabPtr transitionTabPtr(widget.transitionTab);
116  this->transitionControllerPtr = std::make_shared<TransitionController>(
117  transitionTabPtr);
118  PerspectivesPtr perspectivesPtr(widget.perspectives);
119  this->viewControllerPtr = std::make_shared<ViewController>(perspectivesPtr);
120  widget.perspectives->raise();
121 
122  WaypointTabPtr waypointTabPtr(widget.waypointTab);
123  this->waypointControllerPtr = std::make_shared<WaypointController>(waypointTabPtr);
124  this->environmentControllerPtr = std::make_shared<EnvironmentController>();
125 }
126 
128 {
129  //=============================================================================================
130  //EnvironmentController Signals
131 
132  QObject::connect(environmentControllerPtr.get(), SIGNAL(environmentChanged(EnvironmentPtr)),
133  exportDialogControllerPtr.get(), SLOT(environmentChanged(EnvironmentPtr)));
134  QObject::connect(environmentControllerPtr.get(), SIGNAL(environmentChanged(EnvironmentPtr)),
135  importDialogControllerPtr.get(), SLOT(environmentChanged(EnvironmentPtr)));
136  QObject::connect(environmentControllerPtr.get(), SIGNAL(environmentChanged(EnvironmentPtr)),
137  robotVisualizationControllerPtr.get(), SLOT(environmentChanged(EnvironmentPtr)));
138  QObject::connect(environmentControllerPtr.get(), SIGNAL(environmentChanged(EnvironmentPtr)),
139  trajectoryControllerPtr.get(), SLOT(environmentChanged(EnvironmentPtr)));
140  QObject::connect(environmentControllerPtr.get(), SIGNAL(environmentChanged(EnvironmentPtr)),
141  settingControllerPtr.get(), SLOT(environmentChanged(EnvironmentPtr)));
142 
143  //=============================================================================================
144  //ExportDialogController Signals
145 
146  QObject::connect(exportDialogControllerPtr.get(), SIGNAL(exportDesignerTrajectory(int)),
147  trajectoryControllerPtr.get(), SLOT(exportTrajectory(int)));
148  QObject::connect(exportDialogControllerPtr.get(), SIGNAL(exportDesignerTrajectory()),
149  trajectoryControllerPtr.get(), SLOT(exportTrajectory()));
150 
151  //=============================================================================================
152  //ImportDialogController Signals
153 
154  QObject::connect(importDialogControllerPtr.get(), SIGNAL(import(DesignerTrajectoryPtr)),
155  trajectoryControllerPtr.get(), SLOT(import(DesignerTrajectoryPtr)));
156 
157  //=============================================================================================
158  //MementoController Signals
159 
160  QObject::connect(mementoControllerPtr.get(), SIGNAL(undo()), trajectoryControllerPtr.get(), SLOT(undo()));
161  QObject::connect(mementoControllerPtr.get(), SIGNAL(redo()), trajectoryControllerPtr.get(), SLOT(redo()));
162 
163  //=============================================================================================
164  //RobotVisualizationController Signals
165  QObject::connect(robotVisualizationControllerPtr.get(), SIGNAL(manipulatorChanged(Eigen::Matrix4f)),
166  tcpInformationControllerPtr.get(), SLOT(setDesiredPose(Eigen::Matrix4f)));
167  QObject::connect(robotVisualizationControllerPtr.get(), SIGNAL(tcpPoseChanged(Eigen::Matrix4f)),
168  tcpInformationControllerPtr.get(), SLOT(setCurrentPose(Eigen::Matrix4f)));
169  QObject::connect(robotVisualizationControllerPtr.get(), SIGNAL(poseReachable(bool)),
170  tcpInformationControllerPtr.get(), SLOT(setReachable(bool)));
171 
172  QObject::connect(robotVisualizationControllerPtr.get(), SIGNAL(wayPointSelected(int)),
173  waypointControllerPtr.get(), SLOT(updateSelectedWaypoint(int)));
174 
175  QObject::connect(robotVisualizationControllerPtr.get(), SIGNAL(trajectoryPlayerNotPlaying(bool)),
176  waypointControllerPtr.get(), SLOT(enableDeleteButton(bool)));
177  QObject::connect(robotVisualizationControllerPtr.get(), SIGNAL(trajectoryPlayerNotPlaying(bool)),
178  waypointControllerPtr.get(), SLOT(enableAddButton(bool)));
179  QObject::connect(robotVisualizationControllerPtr.get(), SIGNAL(trajectoryPlayerNotPlaying(bool)),
180  waypointControllerPtr.get(), SLOT(enableWaypointListLineEdit(bool)));
181 
182  QObject::connect(robotVisualizationControllerPtr.get(), SIGNAL(trajectoryPlayerNotPlaying(bool)),
183  waypointControllerPtr.get(), SLOT(enableAddButton(bool)));
184 
185  QObject::connect(robotVisualizationControllerPtr.get(), SIGNAL(trajectoryPlayerNotPlaying(bool)),
186  toolBarControllerPtr.get(), SLOT(enableAddButton(bool)));
187  QObject::connect(robotVisualizationControllerPtr.get(), SIGNAL(trajectoryPlayerNotPlaying(bool)),
188  toolBarControllerPtr.get(), SLOT(enableDeleteChangeButton(bool)));
189  QObject::connect(robotVisualizationControllerPtr.get(), SIGNAL(trajectoryPlayerNotPlaying(bool)),
190  toolBarControllerPtr.get(), SLOT(enablePreviewAllButton(bool)));
191  QObject::connect(robotVisualizationControllerPtr.get(), SIGNAL(trajectoryPlayerNotPlaying(bool)),
192  toolBarControllerPtr.get(), SLOT(enablePreviewButton(bool)));
193  QObject::connect(robotVisualizationControllerPtr.get(), SIGNAL(trajectoryPlayerPlaying(bool)),
194  toolBarControllerPtr.get(), SLOT(enableStopButton(bool)));
195 
196  QObject::connect(robotVisualizationControllerPtr.get(), SIGNAL(trajectoryPlayerNotPlaying(bool)),
197  settingControllerPtr.get(), SLOT(enableSelectRobotButton(bool)));
198  QObject::connect(robotVisualizationControllerPtr.get(), SIGNAL(trajectoryPlayerNotPlaying(bool)),
199  settingControllerPtr.get(), SLOT(enableExportButtons(bool)));
200  QObject::connect(robotVisualizationControllerPtr.get(), SIGNAL(trajectoryPlayerNotPlaying(bool)),
201  settingControllerPtr.get(), SLOT(enableImportTCPCollision(bool)));
202 
203  QObject::connect(robotVisualizationControllerPtr.get(), SIGNAL(trajectoryPlayerNotPlaying(bool)),
204  mementoControllerPtr.get(), SLOT(enableRedoButtonVisualization(bool)));
205  QObject::connect(robotVisualizationControllerPtr.get(), SIGNAL(trajectoryPlayerNotPlaying(bool)),
206  mementoControllerPtr.get(), SLOT(enableUndoButton(bool)));
207 
208  QObject::connect(robotVisualizationControllerPtr.get(), SIGNAL(trajectoryPlayerNotPlaying(bool)),
209  shortcutControllerPtr.get(), SLOT(enableAddShortcut(bool)));
210  QObject::connect(robotVisualizationControllerPtr.get(), SIGNAL(trajectoryPlayerNotPlaying(bool)),
211  shortcutControllerPtr.get(), SLOT(enableDeleteChangeShortcut(bool)));
212  QObject::connect(robotVisualizationControllerPtr.get(), SIGNAL(trajectoryPlayerNotPlaying(bool)),
213  shortcutControllerPtr.get(), SLOT(enablePreviewAllShortcut(bool)));
214  QObject::connect(robotVisualizationControllerPtr.get(), SIGNAL(trajectoryPlayerNotPlaying(bool)),
215  shortcutControllerPtr.get(), SLOT(enablePreviewShortcut(bool)));
216  QObject::connect(robotVisualizationControllerPtr.get(), SIGNAL(trajectoryPlayerNotPlaying(bool)),
217  shortcutControllerPtr.get(), SLOT(enableRedoShortcut(bool)));
218  QObject::connect(robotVisualizationControllerPtr.get(), SIGNAL(trajectoryPlayerNotPlaying(bool)),
219  shortcutControllerPtr.get(), SLOT(enableUndoShortcut(bool)));
220  QObject::connect(robotVisualizationControllerPtr.get(), SIGNAL(trajectoryPlayerPlaying(bool)),
221  shortcutControllerPtr.get(), SLOT(enableStopPreviewShortcut(bool)));
222 
223  QObject::connect(robotVisualizationControllerPtr.get(), SIGNAL(trajectoryPlayerNotPlaying(bool)),
224  tcpSelectionControllerPtr.get(), SLOT(enableSelectedTCP(bool)));
225 
226  QObject::connect(robotVisualizationControllerPtr.get(), SIGNAL(trajectoryPlayerNotPlaying(bool)),
227  transitionControllerPtr.get(), SLOT(enableAll(bool)));
228 
229  //=============================================================================================
230  //SettingController Signals
231 
232  QObject::connect(settingControllerPtr.get(), SIGNAL(changedTCP(QString)),
233  trajectoryControllerPtr.get(), SLOT(updateTCP(QString)));
234  QObject::connect(settingControllerPtr.get(), SIGNAL(setActiveColModelName(QString)),
235  trajectoryControllerPtr.get(), SLOT(setActiveColModelName(QString)));
236  QObject::connect(settingControllerPtr.get(), SIGNAL(setBodyColModelsNames(QStringList)),
237  trajectoryControllerPtr.get(), SLOT(setBodyColModelsNames(QStringList)));
238 
239  QObject::connect(settingControllerPtr.get(), SIGNAL(openRobotSelection()),
240  environmentControllerPtr.get(), SLOT(openRobotFileDialog()));
241 
242  QObject::connect(settingControllerPtr.get(), SIGNAL(openShortcut()),
243  shortcutControllerPtr.get(), SLOT(open()));
244 
245  QObject::connect(settingControllerPtr.get(), SIGNAL(convertToMMM()),
246  exportDialogControllerPtr.get(), SLOT(exportMMM()));
247 
248  QObject::connect(settingControllerPtr.get(), SIGNAL(openImport()),
249  importDialogControllerPtr.get(), SLOT(open()));
250 
251  //=============================================================================================
252  //ShortcutController Signals
253 
254  QObject::connect(shortcutControllerPtr.get(), SIGNAL(addedWaypoint(int, bool)),
255  trajectoryControllerPtr.get(), SLOT(addWaypoint(int, bool)));
256  QObject::connect(shortcutControllerPtr.get(), SIGNAL(deletedWaypoint(int)),
257  trajectoryControllerPtr.get(), SLOT(deleteWaypoint(int)));
258  QObject::connect(shortcutControllerPtr.get(), SIGNAL(changeWaypoint(int)),
259  trajectoryControllerPtr.get(), SLOT(updateWaypoint(int)));
260  QObject::connect(shortcutControllerPtr.get(), SIGNAL(undo()),
261  trajectoryControllerPtr.get(), SLOT(undo()));
262  QObject::connect(shortcutControllerPtr.get(), SIGNAL(redo()),
263  trajectoryControllerPtr.get(), SLOT(redo()));
264  QObject::connect(shortcutControllerPtr.get(), SIGNAL(playPreviewAllSignal()),
265  trajectoryControllerPtr.get(), SLOT(playTrajectories()));
266 
267  QObject::connect(shortcutControllerPtr.get(), SIGNAL(playPreviewSignal()),
268  robotVisualizationControllerPtr.get(), SLOT(playTrajectory()));
269  QObject::connect(shortcutControllerPtr.get(), SIGNAL(changedPerspective(int)),
270  robotVisualizationControllerPtr.get(), SLOT(setCamera(int)));
271 
272  QObject::connect(shortcutControllerPtr.get(), SIGNAL(addedWaypointPressed(bool)),
273  robotVisualizationControllerPtr.get(), SLOT(enableLeftMouse(bool)));
274  QObject::connect(shortcutControllerPtr.get(), SIGNAL(stopPreviewSignal()),
275  robotVisualizationControllerPtr.get(), SLOT(trajectoryPlayerStopped()));
276 
277  //=============================================================================================
278  //TCPSelectionController Signals
279 
280  QObject::connect(tcpSelectionControllerPtr.get(), SIGNAL(changedSelectedTCP(QString)),
281  trajectoryControllerPtr.get(), SLOT(updateTCP(QString)));
282  QObject::connect(tcpSelectionControllerPtr.get(), SIGNAL(changedSelectedTCP(QString)),
283  settingControllerPtr.get(), SLOT(selectTCP(QString)));
284 
285 
286  //=============================================================================================
287  //ToolBarController Signals
288 
289  QObject::connect(toolBarControllerPtr.get(), SIGNAL(addedWaypoint(int, bool)),
290  trajectoryControllerPtr.get(), SLOT(addWaypoint(int, bool)));
291  QObject::connect(toolBarControllerPtr.get(), SIGNAL(deletedWaypoint(int)),
292  trajectoryControllerPtr.get(), SLOT(deleteWaypoint(int)));
293  QObject::connect(toolBarControllerPtr.get(), SIGNAL(changeWaypoint(int)),
294  trajectoryControllerPtr.get(), SLOT(updateWaypoint(int)));
295 
296  QObject::connect(toolBarControllerPtr.get(), SIGNAL(notifyAllPreview()),
297  trajectoryControllerPtr.get(), SLOT(playTrajectories()));
298 
299  QObject::connect(toolBarControllerPtr.get(), SIGNAL(notifyPreview()),
300  robotVisualizationControllerPtr.get(), SLOT(playTrajectory()));
301  QObject::connect(toolBarControllerPtr.get(), SIGNAL(notifyStopPreview()),
302  robotVisualizationControllerPtr.get(), SLOT(trajectoryPlayerStopped()));
303 
304  //=============================================================================================
305  //TrajectroyController Signals
306 
307  QObject::connect(trajectoryControllerPtr.get(), SIGNAL(addWaypointGui(int, std::vector<double>, int, bool)),
308  waypointControllerPtr.get(), SLOT(addWaypoint(int, std::vector<double>, int, bool)));
309  QObject::connect(trajectoryControllerPtr.get(), SIGNAL(changeWaypointGui(int, std::vector<double>, int, bool)),
310  waypointControllerPtr.get(), SLOT(setWaypointData(int, std::vector<double>, int, bool)));
311  QObject::connect(trajectoryControllerPtr.get(), SIGNAL(removeWaypointGui(int)),
312  waypointControllerPtr.get(), SLOT(removeWaypoint(int)));
313  QObject::connect(trajectoryControllerPtr.get(), SIGNAL(removeTransitionWaypointGui()),
314  waypointControllerPtr.get(), SLOT(clearWaypointList()));
315  QObject::connect(trajectoryControllerPtr.get(), SIGNAL(enableDeleteChange(bool)),
316  waypointControllerPtr.get(), SLOT(enableDeleteButton(bool)));
317  QObject::connect(trajectoryControllerPtr.get(), SIGNAL(enableAdd(bool)),
318  waypointControllerPtr.get(), SLOT(enableAddButton(bool)));
319 
320  QObject::connect(trajectoryControllerPtr.get(), SIGNAL(addTransitionGui(int, double, double, int)),
321  transitionControllerPtr.get(), SLOT(addTransition(int, double, double, int)));
322  QObject::connect(trajectoryControllerPtr.get(), SIGNAL(changeTransitionGui(int, double, double, int)),
323  transitionControllerPtr.get(), SLOT(setTransitionData(int, double, double, int)));
324  QObject::connect(trajectoryControllerPtr.get(), SIGNAL(removeTransitionGui(int)),
325  transitionControllerPtr.get(), SLOT(removeTransition(int)));
326  QObject::connect(trajectoryControllerPtr.get(), SIGNAL(removeTransitionWaypointGui()),
327  transitionControllerPtr.get(), SLOT(clearTransitionList()));
328 
329  QObject::connect(trajectoryControllerPtr.get(), SIGNAL(newTrajectory(QString)),
330  tcpSelectionControllerPtr.get(), SLOT(addTrajectory(QString)));
331  QObject::connect(trajectoryControllerPtr.get(), SIGNAL(updateSelectedTCP(QString)),
332  tcpSelectionControllerPtr.get(), SLOT(updateSelectedTCP(QString)));
333  QObject::connect(trajectoryControllerPtr.get(), SIGNAL(removeTrajectory(QString)),
334  tcpSelectionControllerPtr.get(), SLOT(removeTrajectory(QString)));
335  QObject::connect(trajectoryControllerPtr.get(), SIGNAL(removeAllTrajectories()),
336  tcpSelectionControllerPtr.get(), SLOT(removeAllTrajectories()));
337 
338  QObject::connect(trajectoryControllerPtr.get(), SIGNAL(updateSelectedTCP(QString)),
339  settingControllerPtr.get(), SLOT(selectTCP(QString)));
340  QObject::connect(trajectoryControllerPtr.get(), SIGNAL(enableIKSolutionButton(bool)),
341  settingControllerPtr.get(), SLOT(enableIKSolutionButton(bool)));
342  QObject::connect(trajectoryControllerPtr.get(), SIGNAL(enableExportButtons(bool)),
343  settingControllerPtr.get(), SLOT(enableExportButtons(bool)));
344 
345  QObject::connect(trajectoryControllerPtr.get(), SIGNAL(enableRedo(bool)),
346  mementoControllerPtr.get(), SLOT(enableRedoButton(bool)));
347  QObject::connect(trajectoryControllerPtr.get(), SIGNAL(enableUndo(bool)),
348  mementoControllerPtr.get(), SLOT(enableUndoButton(bool)));
349 
350  QObject::connect(trajectoryControllerPtr.get(), SIGNAL(exportTrajectory(std::vector<DesignerTrajectoryPtr>)),
351  exportDialogControllerPtr.get(), SLOT(exportTrajectory(std::vector<DesignerTrajectoryPtr>)));
352 
353  QObject::connect(trajectoryControllerPtr.get(), SIGNAL(showTrajectory(DesignerTrajectoryPtr)),
354  robotVisualizationControllerPtr.get(), SLOT(updateViews(DesignerTrajectoryPtr)));
355  QObject::connect(trajectoryControllerPtr.get(), SIGNAL(removeTransitionWaypointGui()),
356  robotVisualizationControllerPtr.get(), SLOT(clearView()));
357  QObject::connect(trajectoryControllerPtr.get(), SIGNAL(cartesianSelectionChanged(VirtualRobot::IKSolver::CartesianSelection())),
358  robotVisualizationControllerPtr.get(), SLOT(cartesianSelectionChanged(VirtualRobot::IKSolver::CartesianSelection())));
359  QObject::connect(trajectoryControllerPtr.get(), SIGNAL(playTrajectories(std::vector<DesignerTrajectoryPtr>)),
360  robotVisualizationControllerPtr.get(), SLOT(playTrajectories(std::vector<DesignerTrajectoryPtr>)));
361  QObject::connect(trajectoryControllerPtr.get(), SIGNAL(rnsChanged(VirtualRobot::RobotNodeSetPtr)),
362  robotVisualizationControllerPtr.get(), SLOT(kinematicChainChanged(VirtualRobot::RobotNodeSetPtr)));
363 
364  QObject::connect(trajectoryControllerPtr.get(), SIGNAL(enableDeleteChange(bool)),
365  toolBarControllerPtr.get(), SLOT(enableDeleteChangeButton(bool)));
366  QObject::connect(trajectoryControllerPtr.get(), SIGNAL(enableAdd(bool)),
367  toolBarControllerPtr.get(), SLOT(enableAddButton(bool)));
368  QObject::connect(trajectoryControllerPtr.get(), SIGNAL(enablePreview(bool)),
369  toolBarControllerPtr.get(), SLOT(enablePreviewButton(bool)));
370  QObject::connect(trajectoryControllerPtr.get(), SIGNAL(enablePreviewAll(bool)),
371  toolBarControllerPtr.get(), SLOT(enablePreviewAllButton(bool)));
372 
373  QObject::connect(trajectoryControllerPtr.get(), SIGNAL(enableDeleteChange(bool)),
374  shortcutControllerPtr.get(), SLOT(enableDeleteChangeShortcut(bool)));
375  QObject::connect(trajectoryControllerPtr.get(), SIGNAL(enableAdd(bool)),
376  shortcutControllerPtr.get(), SLOT(enableAddShortcut(bool)));
377  QObject::connect(trajectoryControllerPtr.get(), SIGNAL(enablePreview(bool)),
378  shortcutControllerPtr.get(), SLOT(enablePreviewShortcut(bool)));
379  QObject::connect(trajectoryControllerPtr.get(), SIGNAL(enablePreviewAll(bool)),
380  shortcutControllerPtr.get(), SLOT(enablePreviewAllShortcut(bool)));
381  QObject::connect(trajectoryControllerPtr.get(), SIGNAL(enableRedo(bool)),
382  shortcutControllerPtr.get(), SLOT(enableRedoShortcut(bool)));
383  QObject::connect(trajectoryControllerPtr.get(), SIGNAL(enableUndo(bool)),
384  shortcutControllerPtr.get(), SLOT(enableUnoShortcut(bool)));
385 
386  //=============================================================================================
387  //TransitionController Signals
388 
389  QObject::connect(transitionControllerPtr.get(), SIGNAL(changedDuration(int, double)),
390  trajectoryControllerPtr.get(), SLOT(updateTransition(int, double)));
391  QObject::connect(transitionControllerPtr.get(), SIGNAL(changedInterpolation(int, int)),
392  trajectoryControllerPtr.get(), SLOT(updateTransition(int, int)));
393 
394  QObject::connect(transitionControllerPtr.get(), SIGNAL(selectedTransitionChanged(int)),
395  robotVisualizationControllerPtr.get(), SLOT(selectedTransitionChanged(int)));
396 
397  //=============================================================================================
398  //ViewController Signals
399 
400  QObject::connect(viewControllerPtr.get(), SIGNAL(changedPerspective(int)),
401  robotVisualizationControllerPtr.get(), SLOT(setCamera(int)));
402  QObject::connect(viewControllerPtr.get(), SIGNAL(addView()),
403  robotVisualizationControllerPtr.get(), SLOT(addView()));
404  QObject::connect(viewControllerPtr.get(), SIGNAL(removeView()),
405  robotVisualizationControllerPtr.get(), SLOT(removeView()));
406 
407 
408  //=============================================================================================
409  //WaypointController Signals
410 
411  QObject::connect(waypointControllerPtr.get(), SIGNAL(changedWaypoint(int, std::vector<double>)),
412  trajectoryControllerPtr.get(), SLOT(updateWaypoint(int, std::vector<double>)));
413  QObject::connect(waypointControllerPtr.get(), SIGNAL(changedWaypoint(int, int)),
414  trajectoryControllerPtr.get(), SLOT(updateWaypoint(int, int)));
415  QObject::connect(waypointControllerPtr.get(), SIGNAL(changedWaypoint(int, bool)),
416  trajectoryControllerPtr.get(), SLOT(updateWaypoint(int, bool)));
417  QObject::connect(waypointControllerPtr.get(), SIGNAL(addedWaypoint(int, bool)),
418  trajectoryControllerPtr.get(), SLOT(addWaypoint(int, bool)));
419  QObject::connect(waypointControllerPtr.get(), SIGNAL(deletedWaypoint(int)),
420  trajectoryControllerPtr.get(), SLOT(deleteWaypoint(int)));
421  QObject::connect(waypointControllerPtr.get(), SIGNAL(enableIKSolutionButton(bool)),
422  settingControllerPtr.get(), SLOT(enableIKSolutionButton(bool)));
423  QObject::connect(waypointControllerPtr.get(), SIGNAL(setCurrentIndex(int)),
424  toolBarControllerPtr.get(), SLOT(setCurrentWaypoint(int)));
425  QObject::connect(waypointControllerPtr.get(), SIGNAL(setCurrentIndex(int)),
426  shortcutControllerPtr.get(), SLOT(setCurrentWaypoint(int)));
427 
428  QObject::connect(waypointControllerPtr.get(), SIGNAL(setCurrentIndexRobotVisualization(int)),
429  robotVisualizationControllerPtr.get(), SLOT(selectedWayPointChanged(int)));
430 
431  //=============================================================================================
432  //Load Robot
433  RobotStateComponentInterfacePrx robotStateComponent = getProxy<RobotStateComponentInterfacePrx>("RobotStateComponent", false, "", false);
434  if (robotStateComponent)
435  {
436  environmentControllerPtr->loadRobotFromProxy(robotStateComponent->getRobotFilename());
437  }
438  else
439  {
440  //Laods a Robot in the application. Default Armar3.
441  environmentControllerPtr->loadArmar3();
442  }
443 }
armarx::RobotTrajectoryDesignerGuiPluginWidgetController::connectWidget
void connectWidget()
Definition: RobotTrajectoryDesignerGuiPluginWidgetController.cpp:127
armarx::RobotTrajectoryDesignerGuiPluginWidgetController::~RobotTrajectoryDesignerGuiPluginWidgetController
virtual ~RobotTrajectoryDesignerGuiPluginWidgetController()
Controller destructor.
Definition: RobotTrajectoryDesignerGuiPluginWidgetController.cpp:41
armarx::RobotTrajectoryDesignerGuiPluginWidgetController::initWidget
void initWidget()
Definition: RobotTrajectoryDesignerGuiPluginWidgetController.cpp:90
armarx::KinematicSolver::reset
static void reset()
reset Destroys the current instance of KinematicSolver that a new one can be created via call of getI...
Definition: KinematicSolver.cpp:103
TCPInformationPtr
std::shared_ptr< TCPInformationTab > TCPInformationPtr
Definition: TCPInformationTab.h:50
RobotTrajectoryDesignerGuiPluginWidgetController.h
armarx::RobotTrajectoryDesignerGuiPluginWidgetController::onConnectComponent
virtual void onConnectComponent() override
Definition: RobotTrajectoryDesignerGuiPluginWidgetController.cpp:64
armarx::EnvironmentPtr
std::shared_ptr< Environment > EnvironmentPtr
Definition: Environment.h:29
WaypointTabPtr
std::shared_ptr< WaypointTab > WaypointTabPtr
Definition: WaypointTab.h:50
data
uint8_t data[1]
Definition: EtherCATFrame.h:68
armarx::NJointTaskSpaceDMPControllerMode::CartesianSelection
CartesianSelection
Definition: ControllerInterface.ice:34
TransitionTabPtr
std::shared_ptr< TransitionTab > TransitionTabPtr
Definition: TransitionTab.h:50
armarx::RobotTrajectoryDesignerGuiPluginWidgetController::RobotTrajectoryDesignerGuiPluginWidgetController
RobotTrajectoryDesignerGuiPluginWidgetController()
Controller Constructor.
Definition: RobotTrajectoryDesignerGuiPluginWidgetController.cpp:36
SettingTabPtr
std::shared_ptr< SettingTab > SettingTabPtr
Definition: SettingTab.h:52
CMakePackageFinder.h
GfxTL::Matrix4f
MatrixXX< 4, 4, float > Matrix4f
Definition: MatrixXX.h:601
armarx::DesignerTrajectoryPtr
std::shared_ptr< DesignerTrajectory > DesignerTrajectoryPtr
Definition: DesignerTrajectory.h:165
IceInternal::ProxyHandle<::IceProxy::armarx::RobotStateComponentInterface >
armarx::RobotTrajectoryDesignerGuiPluginWidgetController::loadSettings
virtual void loadSettings(QSettings *settings) override
Definition: RobotTrajectoryDesignerGuiPluginWidgetController.cpp:47
armarx::ArmarXWidgetController::getWidget
virtual QPointer< QWidget > getWidget()
getWidget returns a pointer to the a widget of this controller.
Definition: ArmarXWidgetController.cpp:54
PerspectivesPtr
std::shared_ptr< Perspectives > PerspectivesPtr
Definition: Perspectives.h:51
armarx::RobotTrajectoryDesignerGuiPluginWidgetController::onInitComponent
virtual void onInitComponent() override
Definition: RobotTrajectoryDesignerGuiPluginWidgetController.cpp:58
armarx::RobotTrajectoryDesignerGuiPluginWidgetController::saveSettings
virtual void saveSettings(QSettings *settings) override
Definition: RobotTrajectoryDesignerGuiPluginWidgetController.cpp:52
ArmarXDataPath.h
ToolBarPtr
std::shared_ptr< ToolBar > ToolBarPtr
Definition: ToolBar.h:50
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:28
armarx::RobotTrajectoryDesignerGuiPluginWidgetController::onDisconnectComponent
virtual void onDisconnectComponent() override
Hook for subclass.
Definition: RobotTrajectoryDesignerGuiPluginWidgetController.cpp:69