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
27#include <QCoreApplication>
28#include <QShortcut>
29
30#include <VirtualRobot/XML/RobotIO.h>
31
34
35#include <RobotAPI/interface/core/RobotState.h>
36using namespace armarx;
37
41
46
47void
51
52void
56
57void
59{
60 QMetaObject::invokeMethod(this, "initWidget");
61}
62
63void
65{
66 QMetaObject::invokeMethod(this, "connectWidget");
67}
68
69void
71{
72 viewControllerPtr.reset();
73 toolBarControllerPtr.reset();
74 widget.robotVisualization->~QWidget();
75 this->robotVisualizationControllerPtr.reset();
76 mementoControllerPtr.reset();
77 settingControllerPtr.reset();
78 shortcutControllerPtr.reset();
79 tcpInformationControllerPtr.reset();
80 tcpSelectionControllerPtr.reset();
81 trajectoryControllerPtr.reset();
82 transitionControllerPtr.reset();
83 waypointControllerPtr.reset();
84 exportDialogControllerPtr.reset();
85 importDialogControllerPtr.reset();
86 robotVisualizationControllerPtr.reset();
87 environmentControllerPtr.reset();
89}
90
91void
93{
94 widget.setupUi(getWidget());
95 // Create shared pointers for each member, initialize each controller
96 this->exportDialogControllerPtr = std::make_shared<ExportDialogController>();
97 this->importDialogControllerPtr = std::make_shared<ImportDialogController>();
98 this->mementoControllerPtr =
99 std::make_shared<MementoController>(widget.undoButton, widget.redoButton);
100 this->robotVisualizationControllerPtr =
101 std::make_shared<RobotVisualizationController>(widget.robotVisualization);
102 this->robotVisualizationControllerPtr->addConnection(this->robotVisualizationControllerPtr);
103
104 SettingTabPtr settingTabPtr(widget.settingTab);
105 this->settingControllerPtr = std::make_shared<SettingController>(settingTabPtr);
106 this->shortcutControllerPtr = std::make_shared<ShortcutController>(getWidget().data());
107 TCPInformationPtr tcpInformationPtr(widget.tcpInformationTab);
108 this->tcpInformationControllerPtr =
109 std::make_shared<TCPInformationController>(tcpInformationPtr);
110 this->tcpSelectionControllerPtr =
111 std::make_shared<TCPSelectionController>(widget.currentTPComboBox);
112
113 ToolBarPtr toolBarPtr(widget.toolBar);
114 this->toolBarControllerPtr = std::make_shared<ToolBarController>(toolBarPtr);
115 widget.toolBar->raise();
116 this->trajectoryControllerPtr = std::make_shared<TrajectoryController>();
117
118 TransitionTabPtr transitionTabPtr(widget.transitionTab);
119 this->transitionControllerPtr = std::make_shared<TransitionController>(transitionTabPtr);
120 PerspectivesPtr perspectivesPtr(widget.perspectives);
121 this->viewControllerPtr = std::make_shared<ViewController>(perspectivesPtr);
122 widget.perspectives->raise();
123
124 WaypointTabPtr waypointTabPtr(widget.waypointTab);
125 this->waypointControllerPtr = std::make_shared<WaypointController>(waypointTabPtr);
126 this->environmentControllerPtr = std::make_shared<EnvironmentController>();
127}
128
129void
131{
132 //=============================================================================================
133 //EnvironmentController Signals
134
135 QObject::connect(environmentControllerPtr.get(),
136 SIGNAL(environmentChanged(EnvironmentPtr)),
137 exportDialogControllerPtr.get(),
138 SLOT(environmentChanged(EnvironmentPtr)));
139 QObject::connect(environmentControllerPtr.get(),
140 SIGNAL(environmentChanged(EnvironmentPtr)),
141 importDialogControllerPtr.get(),
142 SLOT(environmentChanged(EnvironmentPtr)));
143 QObject::connect(environmentControllerPtr.get(),
144 SIGNAL(environmentChanged(EnvironmentPtr)),
145 robotVisualizationControllerPtr.get(),
146 SLOT(environmentChanged(EnvironmentPtr)));
147 QObject::connect(environmentControllerPtr.get(),
148 SIGNAL(environmentChanged(EnvironmentPtr)),
149 trajectoryControllerPtr.get(),
150 SLOT(environmentChanged(EnvironmentPtr)));
151 QObject::connect(environmentControllerPtr.get(),
152 SIGNAL(environmentChanged(EnvironmentPtr)),
153 settingControllerPtr.get(),
154 SLOT(environmentChanged(EnvironmentPtr)));
155
156 //=============================================================================================
157 //ExportDialogController Signals
158
159 QObject::connect(exportDialogControllerPtr.get(),
160 SIGNAL(exportDesignerTrajectory(int)),
161 trajectoryControllerPtr.get(),
162 SLOT(exportTrajectory(int)));
163 QObject::connect(exportDialogControllerPtr.get(),
164 SIGNAL(exportDesignerTrajectory()),
165 trajectoryControllerPtr.get(),
166 SLOT(exportTrajectory()));
167
168 //=============================================================================================
169 //ImportDialogController Signals
170
171 QObject::connect(importDialogControllerPtr.get(),
172 SIGNAL(import(DesignerTrajectoryPtr)),
173 trajectoryControllerPtr.get(),
174 SLOT(import(DesignerTrajectoryPtr)));
175
176 //=============================================================================================
177 //MementoController Signals
178
179 QObject::connect(
180 mementoControllerPtr.get(), SIGNAL(undo()), trajectoryControllerPtr.get(), SLOT(undo()));
181 QObject::connect(
182 mementoControllerPtr.get(), SIGNAL(redo()), trajectoryControllerPtr.get(), SLOT(redo()));
183
184 //=============================================================================================
185 //RobotVisualizationController Signals
186 QObject::connect(robotVisualizationControllerPtr.get(),
187 SIGNAL(manipulatorChanged(Eigen::Matrix4f)),
188 tcpInformationControllerPtr.get(),
189 SLOT(setDesiredPose(Eigen::Matrix4f)));
190 QObject::connect(robotVisualizationControllerPtr.get(),
191 SIGNAL(tcpPoseChanged(Eigen::Matrix4f)),
192 tcpInformationControllerPtr.get(),
193 SLOT(setCurrentPose(Eigen::Matrix4f)));
194 QObject::connect(robotVisualizationControllerPtr.get(),
195 SIGNAL(poseReachable(bool)),
196 tcpInformationControllerPtr.get(),
197 SLOT(setReachable(bool)));
198
199 QObject::connect(robotVisualizationControllerPtr.get(),
200 SIGNAL(wayPointSelected(int)),
201 waypointControllerPtr.get(),
202 SLOT(updateSelectedWaypoint(int)));
203
204 QObject::connect(robotVisualizationControllerPtr.get(),
205 SIGNAL(trajectoryPlayerNotPlaying(bool)),
206 waypointControllerPtr.get(),
207 SLOT(enableDeleteButton(bool)));
208 QObject::connect(robotVisualizationControllerPtr.get(),
209 SIGNAL(trajectoryPlayerNotPlaying(bool)),
210 waypointControllerPtr.get(),
211 SLOT(enableAddButton(bool)));
212 QObject::connect(robotVisualizationControllerPtr.get(),
213 SIGNAL(trajectoryPlayerNotPlaying(bool)),
214 waypointControllerPtr.get(),
215 SLOT(enableWaypointListLineEdit(bool)));
216
217 QObject::connect(robotVisualizationControllerPtr.get(),
218 SIGNAL(trajectoryPlayerNotPlaying(bool)),
219 waypointControllerPtr.get(),
220 SLOT(enableAddButton(bool)));
221
222 QObject::connect(robotVisualizationControllerPtr.get(),
223 SIGNAL(trajectoryPlayerNotPlaying(bool)),
224 toolBarControllerPtr.get(),
225 SLOT(enableAddButton(bool)));
226 QObject::connect(robotVisualizationControllerPtr.get(),
227 SIGNAL(trajectoryPlayerNotPlaying(bool)),
228 toolBarControllerPtr.get(),
229 SLOT(enableDeleteChangeButton(bool)));
230 QObject::connect(robotVisualizationControllerPtr.get(),
231 SIGNAL(trajectoryPlayerNotPlaying(bool)),
232 toolBarControllerPtr.get(),
233 SLOT(enablePreviewAllButton(bool)));
234 QObject::connect(robotVisualizationControllerPtr.get(),
235 SIGNAL(trajectoryPlayerNotPlaying(bool)),
236 toolBarControllerPtr.get(),
237 SLOT(enablePreviewButton(bool)));
238 QObject::connect(robotVisualizationControllerPtr.get(),
239 SIGNAL(trajectoryPlayerPlaying(bool)),
240 toolBarControllerPtr.get(),
241 SLOT(enableStopButton(bool)));
242
243 QObject::connect(robotVisualizationControllerPtr.get(),
244 SIGNAL(trajectoryPlayerNotPlaying(bool)),
245 settingControllerPtr.get(),
246 SLOT(enableSelectRobotButton(bool)));
247 QObject::connect(robotVisualizationControllerPtr.get(),
248 SIGNAL(trajectoryPlayerNotPlaying(bool)),
249 settingControllerPtr.get(),
250 SLOT(enableExportButtons(bool)));
251 QObject::connect(robotVisualizationControllerPtr.get(),
252 SIGNAL(trajectoryPlayerNotPlaying(bool)),
253 settingControllerPtr.get(),
254 SLOT(enableImportTCPCollision(bool)));
255
256 QObject::connect(robotVisualizationControllerPtr.get(),
257 SIGNAL(trajectoryPlayerNotPlaying(bool)),
258 mementoControllerPtr.get(),
259 SLOT(enableRedoButtonVisualization(bool)));
260 QObject::connect(robotVisualizationControllerPtr.get(),
261 SIGNAL(trajectoryPlayerNotPlaying(bool)),
262 mementoControllerPtr.get(),
263 SLOT(enableUndoButton(bool)));
264
265 QObject::connect(robotVisualizationControllerPtr.get(),
266 SIGNAL(trajectoryPlayerNotPlaying(bool)),
267 shortcutControllerPtr.get(),
268 SLOT(enableAddShortcut(bool)));
269 QObject::connect(robotVisualizationControllerPtr.get(),
270 SIGNAL(trajectoryPlayerNotPlaying(bool)),
271 shortcutControllerPtr.get(),
272 SLOT(enableDeleteChangeShortcut(bool)));
273 QObject::connect(robotVisualizationControllerPtr.get(),
274 SIGNAL(trajectoryPlayerNotPlaying(bool)),
275 shortcutControllerPtr.get(),
276 SLOT(enablePreviewAllShortcut(bool)));
277 QObject::connect(robotVisualizationControllerPtr.get(),
278 SIGNAL(trajectoryPlayerNotPlaying(bool)),
279 shortcutControllerPtr.get(),
280 SLOT(enablePreviewShortcut(bool)));
281 QObject::connect(robotVisualizationControllerPtr.get(),
282 SIGNAL(trajectoryPlayerNotPlaying(bool)),
283 shortcutControllerPtr.get(),
284 SLOT(enableRedoShortcut(bool)));
285 QObject::connect(robotVisualizationControllerPtr.get(),
286 SIGNAL(trajectoryPlayerNotPlaying(bool)),
287 shortcutControllerPtr.get(),
288 SLOT(enableUndoShortcut(bool)));
289 QObject::connect(robotVisualizationControllerPtr.get(),
290 SIGNAL(trajectoryPlayerPlaying(bool)),
291 shortcutControllerPtr.get(),
292 SLOT(enableStopPreviewShortcut(bool)));
293
294 QObject::connect(robotVisualizationControllerPtr.get(),
295 SIGNAL(trajectoryPlayerNotPlaying(bool)),
296 tcpSelectionControllerPtr.get(),
297 SLOT(enableSelectedTCP(bool)));
298
299 QObject::connect(robotVisualizationControllerPtr.get(),
300 SIGNAL(trajectoryPlayerNotPlaying(bool)),
301 transitionControllerPtr.get(),
302 SLOT(enableAll(bool)));
303
304 //=============================================================================================
305 //SettingController Signals
306
307 QObject::connect(settingControllerPtr.get(),
308 SIGNAL(changedTCP(QString)),
309 trajectoryControllerPtr.get(),
310 SLOT(updateTCP(QString)));
311 QObject::connect(settingControllerPtr.get(),
312 SIGNAL(setActiveColModelName(QString)),
313 trajectoryControllerPtr.get(),
314 SLOT(setActiveColModelName(QString)));
315 QObject::connect(settingControllerPtr.get(),
316 SIGNAL(setBodyColModelsNames(QStringList)),
317 trajectoryControllerPtr.get(),
318 SLOT(setBodyColModelsNames(QStringList)));
319
320 QObject::connect(settingControllerPtr.get(),
321 SIGNAL(openRobotSelection()),
322 environmentControllerPtr.get(),
323 SLOT(openRobotFileDialog()));
324
325 QObject::connect(settingControllerPtr.get(),
326 SIGNAL(openShortcut()),
327 shortcutControllerPtr.get(),
328 SLOT(open()));
329
330 QObject::connect(settingControllerPtr.get(),
331 SIGNAL(convertToMMM()),
332 exportDialogControllerPtr.get(),
333 SLOT(exportMMM()));
334
335 QObject::connect(settingControllerPtr.get(),
336 SIGNAL(openImport()),
337 importDialogControllerPtr.get(),
338 SLOT(open()));
339
340 //=============================================================================================
341 //ShortcutController Signals
342
343 QObject::connect(shortcutControllerPtr.get(),
344 SIGNAL(addedWaypoint(int, bool)),
345 trajectoryControllerPtr.get(),
346 SLOT(addWaypoint(int, bool)));
347 QObject::connect(shortcutControllerPtr.get(),
348 SIGNAL(deletedWaypoint(int)),
349 trajectoryControllerPtr.get(),
350 SLOT(deleteWaypoint(int)));
351 QObject::connect(shortcutControllerPtr.get(),
352 SIGNAL(changeWaypoint(int)),
353 trajectoryControllerPtr.get(),
354 SLOT(updateWaypoint(int)));
355 QObject::connect(
356 shortcutControllerPtr.get(), SIGNAL(undo()), trajectoryControllerPtr.get(), SLOT(undo()));
357 QObject::connect(
358 shortcutControllerPtr.get(), SIGNAL(redo()), trajectoryControllerPtr.get(), SLOT(redo()));
359 QObject::connect(shortcutControllerPtr.get(),
360 SIGNAL(playPreviewAllSignal()),
361 trajectoryControllerPtr.get(),
362 SLOT(playTrajectories()));
363
364 QObject::connect(shortcutControllerPtr.get(),
365 SIGNAL(playPreviewSignal()),
366 robotVisualizationControllerPtr.get(),
367 SLOT(playTrajectory()));
368 QObject::connect(shortcutControllerPtr.get(),
369 SIGNAL(changedPerspective(int)),
370 robotVisualizationControllerPtr.get(),
371 SLOT(setCamera(int)));
372
373 QObject::connect(shortcutControllerPtr.get(),
374 SIGNAL(addedWaypointPressed(bool)),
375 robotVisualizationControllerPtr.get(),
376 SLOT(enableLeftMouse(bool)));
377 QObject::connect(shortcutControllerPtr.get(),
378 SIGNAL(stopPreviewSignal()),
379 robotVisualizationControllerPtr.get(),
380 SLOT(trajectoryPlayerStopped()));
381
382 //=============================================================================================
383 //TCPSelectionController Signals
384
385 QObject::connect(tcpSelectionControllerPtr.get(),
386 SIGNAL(changedSelectedTCP(QString)),
387 trajectoryControllerPtr.get(),
388 SLOT(updateTCP(QString)));
389 QObject::connect(tcpSelectionControllerPtr.get(),
390 SIGNAL(changedSelectedTCP(QString)),
391 settingControllerPtr.get(),
392 SLOT(selectTCP(QString)));
393
394
395 //=============================================================================================
396 //ToolBarController Signals
397
398 QObject::connect(toolBarControllerPtr.get(),
399 SIGNAL(addedWaypoint(int, bool)),
400 trajectoryControllerPtr.get(),
401 SLOT(addWaypoint(int, bool)));
402 QObject::connect(toolBarControllerPtr.get(),
403 SIGNAL(deletedWaypoint(int)),
404 trajectoryControllerPtr.get(),
405 SLOT(deleteWaypoint(int)));
406 QObject::connect(toolBarControllerPtr.get(),
407 SIGNAL(changeWaypoint(int)),
408 trajectoryControllerPtr.get(),
409 SLOT(updateWaypoint(int)));
410
411 QObject::connect(toolBarControllerPtr.get(),
412 SIGNAL(notifyAllPreview()),
413 trajectoryControllerPtr.get(),
414 SLOT(playTrajectories()));
415
416 QObject::connect(toolBarControllerPtr.get(),
417 SIGNAL(notifyPreview()),
418 robotVisualizationControllerPtr.get(),
419 SLOT(playTrajectory()));
420 QObject::connect(toolBarControllerPtr.get(),
421 SIGNAL(notifyStopPreview()),
422 robotVisualizationControllerPtr.get(),
423 SLOT(trajectoryPlayerStopped()));
424
425 //=============================================================================================
426 //TrajectroyController Signals
427
428 QObject::connect(trajectoryControllerPtr.get(),
429 SIGNAL(addWaypointGui(int, std::vector<double>, int, bool)),
430 waypointControllerPtr.get(),
431 SLOT(addWaypoint(int, std::vector<double>, int, bool)));
432 QObject::connect(trajectoryControllerPtr.get(),
433 SIGNAL(changeWaypointGui(int, std::vector<double>, int, bool)),
434 waypointControllerPtr.get(),
435 SLOT(setWaypointData(int, std::vector<double>, int, bool)));
436 QObject::connect(trajectoryControllerPtr.get(),
437 SIGNAL(removeWaypointGui(int)),
438 waypointControllerPtr.get(),
439 SLOT(removeWaypoint(int)));
440 QObject::connect(trajectoryControllerPtr.get(),
441 SIGNAL(removeTransitionWaypointGui()),
442 waypointControllerPtr.get(),
443 SLOT(clearWaypointList()));
444 QObject::connect(trajectoryControllerPtr.get(),
445 SIGNAL(enableDeleteChange(bool)),
446 waypointControllerPtr.get(),
447 SLOT(enableDeleteButton(bool)));
448 QObject::connect(trajectoryControllerPtr.get(),
449 SIGNAL(enableAdd(bool)),
450 waypointControllerPtr.get(),
451 SLOT(enableAddButton(bool)));
452
453 QObject::connect(trajectoryControllerPtr.get(),
454 SIGNAL(addTransitionGui(int, double, double, int)),
455 transitionControllerPtr.get(),
456 SLOT(addTransition(int, double, double, int)));
457 QObject::connect(trajectoryControllerPtr.get(),
458 SIGNAL(changeTransitionGui(int, double, double, int)),
459 transitionControllerPtr.get(),
460 SLOT(setTransitionData(int, double, double, int)));
461 QObject::connect(trajectoryControllerPtr.get(),
462 SIGNAL(removeTransitionGui(int)),
463 transitionControllerPtr.get(),
464 SLOT(removeTransition(int)));
465 QObject::connect(trajectoryControllerPtr.get(),
466 SIGNAL(removeTransitionWaypointGui()),
467 transitionControllerPtr.get(),
468 SLOT(clearTransitionList()));
469
470 QObject::connect(trajectoryControllerPtr.get(),
471 SIGNAL(newTrajectory(QString)),
472 tcpSelectionControllerPtr.get(),
473 SLOT(addTrajectory(QString)));
474 QObject::connect(trajectoryControllerPtr.get(),
475 SIGNAL(updateSelectedTCP(QString)),
476 tcpSelectionControllerPtr.get(),
477 SLOT(updateSelectedTCP(QString)));
478 QObject::connect(trajectoryControllerPtr.get(),
479 SIGNAL(removeTrajectory(QString)),
480 tcpSelectionControllerPtr.get(),
481 SLOT(removeTrajectory(QString)));
482 QObject::connect(trajectoryControllerPtr.get(),
483 SIGNAL(removeAllTrajectories()),
484 tcpSelectionControllerPtr.get(),
485 SLOT(removeAllTrajectories()));
486
487 QObject::connect(trajectoryControllerPtr.get(),
488 SIGNAL(updateSelectedTCP(QString)),
489 settingControllerPtr.get(),
490 SLOT(selectTCP(QString)));
491 QObject::connect(trajectoryControllerPtr.get(),
492 SIGNAL(enableIKSolutionButton(bool)),
493 settingControllerPtr.get(),
494 SLOT(enableIKSolutionButton(bool)));
495 QObject::connect(trajectoryControllerPtr.get(),
496 SIGNAL(enableExportButtons(bool)),
497 settingControllerPtr.get(),
498 SLOT(enableExportButtons(bool)));
499
500 QObject::connect(trajectoryControllerPtr.get(),
501 SIGNAL(enableRedo(bool)),
502 mementoControllerPtr.get(),
503 SLOT(enableRedoButton(bool)));
504 QObject::connect(trajectoryControllerPtr.get(),
505 SIGNAL(enableUndo(bool)),
506 mementoControllerPtr.get(),
507 SLOT(enableUndoButton(bool)));
508
509 QObject::connect(trajectoryControllerPtr.get(),
510 SIGNAL(exportTrajectory(std::vector<DesignerTrajectoryPtr>)),
511 exportDialogControllerPtr.get(),
512 SLOT(exportTrajectory(std::vector<DesignerTrajectoryPtr>)));
513
514 QObject::connect(trajectoryControllerPtr.get(),
515 SIGNAL(showTrajectory(DesignerTrajectoryPtr)),
516 robotVisualizationControllerPtr.get(),
517 SLOT(updateViews(DesignerTrajectoryPtr)));
518 QObject::connect(trajectoryControllerPtr.get(),
519 SIGNAL(removeTransitionWaypointGui()),
520 robotVisualizationControllerPtr.get(),
521 SLOT(clearView()));
522 QObject::connect(
523 trajectoryControllerPtr.get(),
524 SIGNAL(cartesianSelectionChanged(VirtualRobot::IKSolver::CartesianSelection())),
525 robotVisualizationControllerPtr.get(),
526 SLOT(cartesianSelectionChanged(VirtualRobot::IKSolver::CartesianSelection())));
527 QObject::connect(trajectoryControllerPtr.get(),
528 SIGNAL(playTrajectories(std::vector<DesignerTrajectoryPtr>)),
529 robotVisualizationControllerPtr.get(),
530 SLOT(playTrajectories(std::vector<DesignerTrajectoryPtr>)));
531 QObject::connect(trajectoryControllerPtr.get(),
532 SIGNAL(rnsChanged(VirtualRobot::RobotNodeSetPtr)),
533 robotVisualizationControllerPtr.get(),
534 SLOT(kinematicChainChanged(VirtualRobot::RobotNodeSetPtr)));
535
536 QObject::connect(trajectoryControllerPtr.get(),
537 SIGNAL(enableDeleteChange(bool)),
538 toolBarControllerPtr.get(),
539 SLOT(enableDeleteChangeButton(bool)));
540 QObject::connect(trajectoryControllerPtr.get(),
541 SIGNAL(enableAdd(bool)),
542 toolBarControllerPtr.get(),
543 SLOT(enableAddButton(bool)));
544 QObject::connect(trajectoryControllerPtr.get(),
545 SIGNAL(enablePreview(bool)),
546 toolBarControllerPtr.get(),
547 SLOT(enablePreviewButton(bool)));
548 QObject::connect(trajectoryControllerPtr.get(),
549 SIGNAL(enablePreviewAll(bool)),
550 toolBarControllerPtr.get(),
551 SLOT(enablePreviewAllButton(bool)));
552
553 QObject::connect(trajectoryControllerPtr.get(),
554 SIGNAL(enableDeleteChange(bool)),
555 shortcutControllerPtr.get(),
556 SLOT(enableDeleteChangeShortcut(bool)));
557 QObject::connect(trajectoryControllerPtr.get(),
558 SIGNAL(enableAdd(bool)),
559 shortcutControllerPtr.get(),
560 SLOT(enableAddShortcut(bool)));
561 QObject::connect(trajectoryControllerPtr.get(),
562 SIGNAL(enablePreview(bool)),
563 shortcutControllerPtr.get(),
564 SLOT(enablePreviewShortcut(bool)));
565 QObject::connect(trajectoryControllerPtr.get(),
566 SIGNAL(enablePreviewAll(bool)),
567 shortcutControllerPtr.get(),
568 SLOT(enablePreviewAllShortcut(bool)));
569 QObject::connect(trajectoryControllerPtr.get(),
570 SIGNAL(enableRedo(bool)),
571 shortcutControllerPtr.get(),
572 SLOT(enableRedoShortcut(bool)));
573 QObject::connect(trajectoryControllerPtr.get(),
574 SIGNAL(enableUndo(bool)),
575 shortcutControllerPtr.get(),
576 SLOT(enableUnoShortcut(bool)));
577
578 //=============================================================================================
579 //TransitionController Signals
580
581 QObject::connect(transitionControllerPtr.get(),
582 SIGNAL(changedDuration(int, double)),
583 trajectoryControllerPtr.get(),
584 SLOT(updateTransition(int, double)));
585 QObject::connect(transitionControllerPtr.get(),
586 SIGNAL(changedInterpolation(int, int)),
587 trajectoryControllerPtr.get(),
588 SLOT(updateTransition(int, int)));
589
590 QObject::connect(transitionControllerPtr.get(),
591 SIGNAL(selectedTransitionChanged(int)),
592 robotVisualizationControllerPtr.get(),
593 SLOT(selectedTransitionChanged(int)));
594
595 //=============================================================================================
596 //ViewController Signals
597
598 QObject::connect(viewControllerPtr.get(),
599 SIGNAL(changedPerspective(int)),
600 robotVisualizationControllerPtr.get(),
601 SLOT(setCamera(int)));
602 QObject::connect(viewControllerPtr.get(),
603 SIGNAL(addView()),
604 robotVisualizationControllerPtr.get(),
605 SLOT(addView()));
606 QObject::connect(viewControllerPtr.get(),
607 SIGNAL(removeView()),
608 robotVisualizationControllerPtr.get(),
609 SLOT(removeView()));
610
611
612 //=============================================================================================
613 //WaypointController Signals
614
615 QObject::connect(waypointControllerPtr.get(),
616 SIGNAL(changedWaypoint(int, std::vector<double>)),
617 trajectoryControllerPtr.get(),
618 SLOT(updateWaypoint(int, std::vector<double>)));
619 QObject::connect(waypointControllerPtr.get(),
620 SIGNAL(changedWaypoint(int, int)),
621 trajectoryControllerPtr.get(),
622 SLOT(updateWaypoint(int, int)));
623 QObject::connect(waypointControllerPtr.get(),
624 SIGNAL(changedWaypoint(int, bool)),
625 trajectoryControllerPtr.get(),
626 SLOT(updateWaypoint(int, bool)));
627 QObject::connect(waypointControllerPtr.get(),
628 SIGNAL(addedWaypoint(int, bool)),
629 trajectoryControllerPtr.get(),
630 SLOT(addWaypoint(int, bool)));
631 QObject::connect(waypointControllerPtr.get(),
632 SIGNAL(deletedWaypoint(int)),
633 trajectoryControllerPtr.get(),
634 SLOT(deleteWaypoint(int)));
635 QObject::connect(waypointControllerPtr.get(),
636 SIGNAL(enableIKSolutionButton(bool)),
637 settingControllerPtr.get(),
638 SLOT(enableIKSolutionButton(bool)));
639 QObject::connect(waypointControllerPtr.get(),
640 SIGNAL(setCurrentIndex(int)),
641 toolBarControllerPtr.get(),
642 SLOT(setCurrentWaypoint(int)));
643 QObject::connect(waypointControllerPtr.get(),
644 SIGNAL(setCurrentIndex(int)),
645 shortcutControllerPtr.get(),
646 SLOT(setCurrentWaypoint(int)));
647
648 QObject::connect(waypointControllerPtr.get(),
649 SIGNAL(setCurrentIndexRobotVisualization(int)),
650 robotVisualizationControllerPtr.get(),
651 SLOT(selectedWayPointChanged(int)));
652
653 //=============================================================================================
654 //Load Robot
655 RobotStateComponentInterfacePrx robotStateComponent =
656 getProxy<RobotStateComponentInterfacePrx>("RobotStateComponent", false, "", false);
657 if (robotStateComponent)
658 {
659 environmentControllerPtr->loadRobotFromProxy(robotStateComponent->getRobotFilename());
660 }
661 else
662 {
663 //Laods a Robot in the application. Default Armar3.
664 environmentControllerPtr->loadArmar3();
665 }
666}
std::shared_ptr< Perspectives > PerspectivesPtr
std::shared_ptr< SettingTab > SettingTabPtr
Definition SettingTab.h:54
std::shared_ptr< TCPInformationTab > TCPInformationPtr
std::shared_ptr< ToolBar > ToolBarPtr
Definition ToolBar.h:52
std::shared_ptr< TransitionTab > TransitionTabPtr
std::shared_ptr< WaypointTab > WaypointTabPtr
Definition WaypointTab.h:52
virtual QPointer< QWidget > getWidget()
getWidget returns a pointer to the a widget of this controller.
static void reset()
reset Destroys the current instance of KinematicSolver that a new one can be created via call of getI...
Ice::ObjectPrx getProxy(long timeoutMs=0, bool waitForScheduler=true) const
Returns the proxy of this object (optionally it waits for the proxy)
This file offers overloads of toIce() and fromIce() functions for STL container types.
std::shared_ptr< Environment > EnvironmentPtr
Definition Environment.h:29
std::shared_ptr< DesignerTrajectory > DesignerTrajectoryPtr
::IceInternal::ProxyHandle<::IceProxy::armarx::RobotStateComponentInterface > RobotStateComponentInterfacePrx