DebugDrawerComponent.h
Go to the documentation of this file.
1/*
2 * This file is part of ArmarX.
3 *
4 * Copyright (C) 2012-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 RobotAPI::ArmarXObjects::DebugDrawerComponent
19 * @author Nikolaus Vahrenkamp ( vahrenkamp at kit dot edu )
20 * @author Peter Kaiser ( peter dot kaiser at kit dot edu )
21 * @date 2014
22 * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
23 * GNU General Public License
24 */
25
26#pragma once
27
28
29// Coin3D & SoQt
30#include <Inventor/nodes/SoNode.h>
31#include <Inventor/nodes/SoSelection.h>
32#include <Inventor/nodes/SoSeparator.h>
33#include <Inventor/sensors/SoTimerSensor.h>
34
35// ArmarX
36#include <VirtualRobot/VirtualRobot.h>
37#include <VirtualRobot/Visualization/VisualizationFactory.h>
38
43
44#include <RobotAPI/interface/visualization/DebugDrawerInterface.h>
46
47//std
48#include <memory>
49#include <mutex>
50
51namespace armarx
52{
53
54 /*!
55 * \class DebugDrawerPropertyDefinitions
56 * \brief
57 */
59 {
60 public:
62 {
64 "ShowDebugDrawing",
65 true,
66 "The simulator implements the DebugDrawerInterface. The debug visualizations (e.g. "
67 "coordinate systems) can enabled/disbaled with this flag.");
69 "DebugDrawerTopic", "DebugDrawerUpdates", "Name of the DebugDrawerTopic");
70 defineOptionalProperty<std::string>("DebugDrawerSelectionTopic",
71 "DebugDrawerSelections",
72 "Name of the DebugDrawerSelectionTopic");
73 }
74 };
75
76 /*!
77 * \defgroup Component-DebugDrawerComponent DebugDrawerComponent
78 * \ingroup RobotAPI-Components
79 * \brief Visualizes debug information.
80 *
81 * The DebugDrawerComponent implements the DebugDrawerInterface and provides a convenient way for visualizing debug information.
82 * It creates a scene graph representation of the debug content and offers it to visualization components.
83 * Several GUI plugins visualize this debug scene graph, among others:
84 * - RobotViewer (RobotAPI)
85 * - WorkingMemoryGui (MemoryX)
86 * - SimulatorViewer (ArmarXSimulation)
87 *
88 * The following example shows an exemplary debug drawing:
89 \code
90 DebugDrawerInterfacePrx prxDD = getTopic<DebugDrawerInterfacePrx>("DebugDrawerUpdates");
91 if (prxDD)
92 {
93 // draw in global coordinate system
94 Eigen::Matrix4f p;
95 p.setIdentity();
96 p(2,3) = 1000.0f;
97 PosePtr gp(new Pose(p));
98 prxDD->setPoseDebugLayerVisu("testPose",gp);
99
100 armarx::Vector3Ptr p1(new armarx::Vector3(0, 0, 0));
101 armarx::Vector3Ptr p2(new armarx::Vector3(1000, 1000, 1000));
102
103 armarx::DrawColor c = {1, 0, 0, 1}; // RGBA
104 prxDD->setLineDebugLayerVisu("testLine", p1, p2, 2.0f, c);
105 }
106 \endcode
107 */
108
109 /**
110 * @brief The DebugDrawerComponent class
111 * @ingroup Component-DebugDrawerComponent
112 */
114 virtual public armarx::DebugDrawerInterfaceAndListener,
115 virtual public Component
116 {
117 public:
118 /*!
119 * \brief DebugDrawerComponent Constructs a debug drawer
120 */
122
123 /*!
124 * \brief setVisuUpdateTime Specifies how often the accumulated draw commands should be applied to the visualization (default 30). Has to be called before init.
125 * \param visuUpdatesPerSec All topic requests are collected asynchronously. This parameter specifies how often the rendering should be updated according to the accumulated updates.
126 */
127 void setVisuUpdateTime(float visuUpdatesPerSec);
128
129 // inherited from Component
130 std::string
131 getDefaultName() const override
132 {
133 return "DebugDrawer";
134 }
135
136 void onInitComponent() override;
137 void onConnectComponent() override;
138 void onDisconnectComponent() override;
139 void onExitComponent() override;
140
141 /*!
142 * \see PropertyUser::createPropertyDefinitions()
143 */
150
151 /* Inherited from DebugDrawerInterface. */
152 void exportScene(const std::string& filename,
153 const ::Ice::Current& = Ice::emptyCurrent) override;
154 void exportLayer(const std::string& filename,
155 const std::string& layerName,
156 const ::Ice::Current& = Ice::emptyCurrent) override;
157
158 void setPoseVisu(const std::string& layerName,
159 const std::string& poseName,
160 const ::armarx::PoseBasePtr& globalPose,
161 const ::Ice::Current& = Ice::emptyCurrent) override;
162 void setScaledPoseVisu(const std::string& layerName,
163 const std::string& poseName,
164 const ::armarx::PoseBasePtr& globalPose,
165 const ::Ice::Float scale,
166 const ::Ice::Current& = Ice::emptyCurrent) override;
167 void setPoseDebugLayerVisu(const std::string& poseName,
168 const ::armarx::PoseBasePtr& globalPose,
169 const ::Ice::Current& = Ice::emptyCurrent) override;
170 void setScaledPoseDebugLayerVisu(const std::string& poseName,
171 const ::armarx::PoseBasePtr& globalPose,
172 const ::Ice::Float scale,
173 const ::Ice::Current& = Ice::emptyCurrent) override;
174 void removePoseVisu(const std::string& layerName,
175 const std::string& poseName,
176 const ::Ice::Current& = Ice::emptyCurrent) override;
177 void removePoseDebugLayerVisu(const std::string& poseName,
178 const ::Ice::Current& = Ice::emptyCurrent) override;
179
180 void setLineVisu(const std::string& layerName,
181 const std::string& lineName,
182 const ::armarx::Vector3BasePtr& globalPosition1,
183 const ::armarx::Vector3BasePtr& globalPosition2,
184 float lineWidth,
185 const ::armarx::DrawColor& color,
186 const ::Ice::Current& = Ice::emptyCurrent) override;
187 void setLineDebugLayerVisu(const std::string& lineName,
188 const ::armarx::Vector3BasePtr& globalPosition1,
189 const ::armarx::Vector3BasePtr& globalPosition2,
190 float lineWidth,
191 const ::armarx::DrawColor& color,
192 const ::Ice::Current& = Ice::emptyCurrent) override;
193 void removeLineVisu(const std::string& layerName,
194 const std::string& lineName,
195 const ::Ice::Current& = Ice::emptyCurrent) override;
196 void removeLineDebugLayerVisu(const std::string& lineName,
197 const ::Ice::Current& = Ice::emptyCurrent) override;
198
199 void setLineSetVisu(const std::string& layerName,
200 const std::string& lineSetName,
201 const DebugDrawerLineSet& lineSet,
202 const ::Ice::Current& = Ice::emptyCurrent) override;
203 void setLineSetDebugLayerVisu(const std::string& lineSetName,
204 const DebugDrawerLineSet& lineSet,
205 const ::Ice::Current& = Ice::emptyCurrent) override;
206 void removeLineSetVisu(const std::string& layerName,
207 const std::string& lineSetName,
208 const ::Ice::Current& = Ice::emptyCurrent) override;
209 void removeLineSetDebugLayerVisu(const std::string& lineSetName,
210 const ::Ice::Current& = Ice::emptyCurrent) override;
211
212 void setBoxVisu(const std::string& layerName,
213 const std::string& boxName,
214 const ::armarx::PoseBasePtr& globalPose,
215 const ::armarx::Vector3BasePtr& dimensions,
216 const DrawColor& color,
217 const ::Ice::Current& = Ice::emptyCurrent) override;
218 void setBoxDebugLayerVisu(const std::string& boxName,
219 const ::armarx::PoseBasePtr& globalPose,
220 const ::armarx::Vector3BasePtr& dimensions,
221 const DrawColor& color,
222 const ::Ice::Current& = Ice::emptyCurrent) override;
223 void removeBoxVisu(const std::string& layerName,
224 const std::string& boxName,
225 const ::Ice::Current& = Ice::emptyCurrent) override;
226 void removeBoxDebugLayerVisu(const std::string& boxName,
227 const ::Ice::Current& = Ice::emptyCurrent) override;
228
229 void setTextVisu(const std::string& layerName,
230 const std::string& textName,
231 const std::string& text,
232 const ::armarx::Vector3BasePtr& globalPosition,
233 const DrawColor& color,
234 int size,
235 const ::Ice::Current& = Ice::emptyCurrent) override;
236 void setTextDebugLayerVisu(const std::string& textName,
237 const std::string& text,
238 const ::armarx::Vector3BasePtr& globalPosition,
239 const DrawColor& color,
240 int size,
241 const ::Ice::Current& = Ice::emptyCurrent) override;
242 void removeTextVisu(const std::string& layerName,
243 const std::string& textName,
244 const ::Ice::Current& = Ice::emptyCurrent) override;
245 void removeTextDebugLayerVisu(const std::string& textName,
246 const ::Ice::Current& = Ice::emptyCurrent) override;
247
248 void setSphereVisu(const std::string& layerName,
249 const std::string& sphereName,
250 const ::armarx::Vector3BasePtr& globalPosition,
251 const DrawColor& color,
252 float radius,
253 const ::Ice::Current& = Ice::emptyCurrent) override;
254 void setSphereDebugLayerVisu(const std::string& sphereName,
255 const ::armarx::Vector3BasePtr& globalPosition,
256 const DrawColor& color,
257 float radius,
258 const ::Ice::Current& = Ice::emptyCurrent) override;
259 void removeSphereVisu(const std::string& layerName,
260 const std::string& sphereName,
261 const ::Ice::Current& = Ice::emptyCurrent) override;
262 void removeSphereDebugLayerVisu(const std::string& sphereName,
263 const ::Ice::Current& = Ice::emptyCurrent) override;
264
265 void setCylinderVisu(const std::string& layerName,
266 const std::string& cylinderName,
267 const ::armarx::Vector3BasePtr& globalPosition,
268 const ::armarx::Vector3BasePtr& direction,
269 float length,
270 float radius,
271 const DrawColor& color,
272 const ::Ice::Current& = Ice::emptyCurrent) override;
273 void setCylinderDebugLayerVisu(const std::string& cylinderName,
274 const ::armarx::Vector3BasePtr& globalPosition,
275 const ::armarx::Vector3BasePtr& direction,
276 float length,
277 float radius,
278 const DrawColor& color,
279 const ::Ice::Current& = Ice::emptyCurrent) override;
280 void removeCylinderVisu(const std::string& layerName,
281 const std::string& cylinderName,
282 const ::Ice::Current& = Ice::emptyCurrent) override;
283 void removeCylinderDebugLayerVisu(const std::string& cylinderName,
284 const ::Ice::Current& = Ice::emptyCurrent) override;
285
286 void setPointCloudVisu(const std::string& layerName,
287 const std::string& pointCloudName,
288 const DebugDrawerPointCloud& pointCloud,
289 const ::Ice::Current& = Ice::emptyCurrent) override;
290 void setPointCloudDebugLayerVisu(const std::string& pointCloudName,
291 const DebugDrawerPointCloud& pointCloud,
292 const ::Ice::Current& = Ice::emptyCurrent) override;
293 void removePointCloudVisu(const std::string& layerName,
294 const std::string& pointCloudName,
295 const ::Ice::Current& = Ice::emptyCurrent) override;
296 void removePointCloudDebugLayerVisu(const std::string& pointCloudName,
297 const ::Ice::Current& = Ice::emptyCurrent) override;
298
299 virtual void
300 setColoredPointCloudDebugLayerVisu(const std::string& pointCloudName,
301 const DebugDrawerColoredPointCloud& pointCloud,
302 const ::Ice::Current& = Ice::emptyCurrent);
303 void setColoredPointCloudVisu(const std::string& layerName,
304 const std::string& pointCloudName,
305 const DebugDrawerColoredPointCloud& pointCloud,
306 const ::Ice::Current& = Ice::emptyCurrent) override;
307 void removeColoredPointCloudVisu(const std::string& layerName,
308 const std::string& pointCloudName,
309 const ::Ice::Current& = Ice::emptyCurrent) override;
310 void
311 removeColoredPointCloudDebugLayerVisu(const std::string& pointCloudName,
312 const ::Ice::Current& = Ice::emptyCurrent) override;
313
314 void
315 set24BitColoredPointCloudDebugLayerVisu(const std::string& pointCloudName,
316 const DebugDrawer24BitColoredPointCloud& pointCloud,
317 const ::Ice::Current& = Ice::emptyCurrent) override;
318 void set24BitColoredPointCloudVisu(const std::string& layerName,
319 const std::string& pointCloudName,
320 const DebugDrawer24BitColoredPointCloud& pointCloud,
321 const ::Ice::Current& = Ice::emptyCurrent) override;
322 void remove24BitColoredPointCloudVisu(const std::string& layerName,
323 const std::string& pointCloudName,
324 const ::Ice::Current& = Ice::emptyCurrent) override;
326 const std::string& pointCloudName,
327 const ::Ice::Current& = Ice::emptyCurrent) override;
328
329
330 void setPolygonVisu(const std::string& layerName,
331 const std::string& polygonName,
332 const std::vector<::armarx::Vector3BasePtr>& polygonPoints,
333 const DrawColor& colorInner,
334 const DrawColor& colorBorder,
335 float lineWidth,
336 const ::Ice::Current& = Ice::emptyCurrent) override;
337 void setPolygonDebugLayerVisu(const std::string& polygonName,
338 const std::vector<::armarx::Vector3BasePtr>& polygonPoints,
339 const DrawColor& colorInner,
340 const DrawColor& colorBorder,
341 float lineWidth,
342 const ::Ice::Current& = Ice::emptyCurrent) override;
343 void removePolygonVisu(const std::string& layerName,
344 const std::string& polygonName,
345 const ::Ice::Current& = Ice::emptyCurrent) override;
346 void removePolygonDebugLayerVisu(const std::string& polygonName,
347 const ::Ice::Current& = Ice::emptyCurrent) override;
348
349 void setTriMeshVisu(const std::string& layerName,
350 const std::string& triMeshName,
351 const DebugDrawerTriMesh& triMesh,
352 const ::Ice::Current& = Ice::emptyCurrent) override;
353 void setTriMeshDebugLayerVisu(const std::string& triMeshName,
354 const DebugDrawerTriMesh& triMesh,
355 const ::Ice::Current& = Ice::emptyCurrent) override;
356 void removeTriMeshVisu(const std::string& layerName,
357 const std::string& triMeshName,
358 const ::Ice::Current& = Ice::emptyCurrent) override;
359 void removeTriMeshDebugLayerVisu(const std::string& triMeshName,
360 const ::Ice::Current& = Ice::emptyCurrent) override;
361
362 void setArrowVisu(const std::string& layerName,
363 const std::string& arrowName,
364 const ::armarx::Vector3BasePtr& position,
365 const ::armarx::Vector3BasePtr& direction,
366 const DrawColor& color,
367 float length,
368 float width,
369 const ::Ice::Current& = Ice::emptyCurrent) override;
370 void setArrowDebugLayerVisu(const std::string& arrowName,
371 const ::armarx::Vector3BasePtr& position,
372 const ::armarx::Vector3BasePtr& direction,
373 const DrawColor& color,
374 float length,
375 float width,
376 const ::Ice::Current& = Ice::emptyCurrent) override;
377 void removeArrowVisu(const std::string& layerName,
378 const std::string& arrowName,
379 const ::Ice::Current& = Ice::emptyCurrent) override;
380 void removeArrowDebugLayerVisu(const std::string& arrowName,
381 const ::Ice::Current& = Ice::emptyCurrent) override;
382
383 void setCircleArrowVisu(const std::string& layerName,
384 const std::string& circleName,
385 const Vector3BasePtr& globalPosition,
386 const Vector3BasePtr& directionVec,
387 Ice::Float radius,
388 Ice::Float circleCompletion,
389 Ice::Float width,
390 const DrawColor& color,
391 const Ice::Current& = Ice::emptyCurrent) override;
392 void setCircleDebugLayerVisu(const std::string& circleName,
393 const Vector3BasePtr& globalPosition,
394 const Vector3BasePtr& directionVec,
395 Ice::Float radius,
396 Ice::Float circleCompletion,
397 Ice::Float width,
398 const DrawColor& color,
399 const Ice::Current& = Ice::emptyCurrent) override;
400 void removeCircleVisu(const std::string& layerName,
401 const std::string& circleName,
402 const Ice::Current& = Ice::emptyCurrent) override;
403 void removeCircleDebugLayerVisu(const std::string& circleName,
404 const Ice::Current& = Ice::emptyCurrent) override;
405
406
407 /*!
408 * \brief setRobotVisu Initializes a robot visualization
409 * \param layerName The layer
410 * \param robotName The identifier of the robot
411 * \param robotFile The filename of the robot. The robot must be locally present in a project.
412 * \param DrawStyle Either FullModel ior CollisionModel.
413 * \param armarxProject Additional armarx project that should be used to search the robot. Must be locally available and accessible through the armarx cmake search procedure.
414 */
415 void setRobotVisu(const std::string& layerName,
416 const std::string& robotName,
417 const std::string& robotFile,
418 const std::string& armarxProject,
419 DrawStyle drawStyle,
420 const ::Ice::Current& = Ice::emptyCurrent) override;
421 void updateRobotPose(const std::string& layerName,
422 const std::string& robotName,
423 const ::armarx::PoseBasePtr& globalPose,
424 const ::Ice::Current& = Ice::emptyCurrent) override;
425 void updateRobotConfig(const std::string& layerName,
426 const std::string& robotName,
427 const std::map<std::string, float>& configuration,
428 const ::Ice::Current& = Ice::emptyCurrent) override;
429 /*!
430 * \brief updateRobotColor Colorizes the robot visualization
431 * \param layerName The layer
432 * \param robotName The robot identifyer
433 * \param c The draw color, if all is set to 0, the colorization is disabled (i.e. the original vizaulization shows up)
434 */
435 void updateRobotColor(const std::string& layerName,
436 const std::string& robotName,
437 const armarx::DrawColor& c,
438 const ::Ice::Current& = Ice::emptyCurrent) override;
439 void updateRobotNodeColor(const std::string& layerName,
440 const std::string& robotName,
441 const std::string& robotNodeName,
442 const armarx::DrawColor& c,
443 const ::Ice::Current& = Ice::emptyCurrent) override;
444 void removeRobotVisu(const std::string& layerName,
445 const std::string& robotName,
446 const ::Ice::Current& = Ice::emptyCurrent) override;
447
448 void clearAll(const ::Ice::Current& = Ice::emptyCurrent) override;
449 void clearLayer(const std::string& layerName,
450 const ::Ice::Current& = Ice::emptyCurrent) override;
451 void clearDebugLayer(const ::Ice::Current& = Ice::emptyCurrent) override;
452
453 bool hasLayer(const std::string& layerName,
454 const ::Ice::Current& = Ice::emptyCurrent) override;
455 void removeLayer(const std::string& layerName,
456 const ::Ice::Current& = Ice::emptyCurrent) override;
457
458 void enableLayerVisu(const std::string& layerName,
459 bool visible,
460 const ::Ice::Current& = Ice::emptyCurrent) override;
461 void enableDebugLayerVisu(bool visible, const ::Ice::Current& = Ice::emptyCurrent) override;
462
463 ::Ice::StringSeq layerNames(const ::Ice::Current& = Ice::emptyCurrent) override;
464 ::armarx::LayerInformationSequence
465 layerInformation(const ::Ice::Current& = Ice::emptyCurrent) override;
466
467 void disableAllLayers(const ::Ice::Current& = Ice::emptyCurrent) override;
468 void enableAllLayers(const ::Ice::Current& = Ice::emptyCurrent) override;
469
470 // Methods for selection management
471 void enableSelections(const std::string& layerName,
472 const ::Ice::Current& = Ice::emptyCurrent) override;
473 void disableSelections(const std::string& layerName,
474 const ::Ice::Current& = Ice::emptyCurrent) override;
475 void clearSelections(const std::string& layerName,
476 const ::Ice::Current& = Ice::emptyCurrent) override;
477 void select(const std::string& layerName,
478 const std::string& elementName,
479 const ::Ice::Current& = Ice::emptyCurrent) override;
480 void deselect(const std::string& layerName,
481 const std::string& elementName,
482 const ::Ice::Current& = Ice::emptyCurrent) override;
483
484 DebugDrawerSelectionList getSelections(const ::Ice::Current& = Ice::emptyCurrent) override;
485
486 void selectionCallback();
487 void deselectionCallback();
490
491 void reportSelectionChanged(const DebugDrawerSelectionList& selectedElements,
492 const ::Ice::Current& = Ice::emptyCurrent) override;
493
494 // This is all total madness. Why do we put mutexes and locks into shared pointers?
495 using RecursiveMutex = std::recursive_mutex;
496 using RecursiveMutexPtr = std::shared_ptr<RecursiveMutex>;
497 using RecursiveMutexLock = std::unique_lock<RecursiveMutex>;
498 using RecursiveMutexLockPtr = std::shared_ptr<RecursiveMutexLock>;
499
500 /*!
501 * \brief getScopedLock If using the coin visualization it must be ensured that all rendering calls are protected with this mutex
502 * \return The lock that is automatically destructed when leaving the current scope.
503 */
505
506 /*!
507 * \brief getVisualization Ensure that all access to this node is protected with the scoped lock mutex.
508 * \return The visualization
509 */
510 SoSeparator* getVisualization();
511
512 void setMutex(RecursiveMutexPtr const& m);
513
514 ~DebugDrawerComponent() override;
515
516 void
518 {
519 this->defaultLayerVisibility = defaultLayerVisibility;
520 }
521
522 void
523 setDefaultLayerVisibility(const std::string& layerName, bool defaultLayerVisibility)
524 {
526 }
527
528 void
529 removeDefaultLayerVisibility(const std::string& layerName)
530 {
531 defaultLayerVisibilityPerLayer.erase(layerName);
532 }
533
534 bool
536 {
538 }
539
540 bool
541 getDefaultLayerVisibility(const std::string& layerName) const
542 {
543 auto elem = defaultLayerVisibilityPerLayer.find(layerName);
544 if (elem != defaultLayerVisibilityPerLayer.end())
545 {
546 return elem->second;
547 }
549 }
550
551 std::map<std::string, bool>
556
557 protected:
558 static void updateVisualizationCB(void* data, SoSensor* sensor);
559
560 // It turned out, that heavy data traffic (resulting in heavy mutex locking) somehow interferes with coin rendering: the
561 // SoQt timers are misaligned at some point, could be a bug in SoQt, that results in a situation where the GL window is never updated
562 // while the rest of the qt widget works well.
563 // The solution for now: collect all data updates and update the coin scene by qt-timed thread (qt events ensure that no drawing event is active)
564
565 struct DrawData
566 {
568 {
569 active = false;
570 update = false;
571 }
572
573 std::string layerName;
574 std::string name;
575 bool active;
576 /**
577 * @brief Whether an existing visu should be updated
578 */
579 bool update;
580 };
581
582 struct CoordData : public DrawData
583 {
584 Eigen::Matrix4f globalPose;
585 float scale;
586 };
587
588 struct LineData : public DrawData
589 {
590 Eigen::Vector3f p1;
591 Eigen::Vector3f p2;
592 float scale;
593 VirtualRobot::VisualizationFactory::Color color;
594 };
595
596 struct LineSetData : public DrawData
597 {
598 DebugDrawerLineSet lineSet;
599 };
600
601 struct BoxData : public DrawData
602 {
603 Eigen::Matrix4f globalPose;
604 float width;
605 float height;
606 float depth;
607 VirtualRobot::VisualizationFactory::Color color;
608 };
609
610 struct TextData : public DrawData
611 {
612 std::string text;
613 Eigen::Vector3f position;
614 VirtualRobot::VisualizationFactory::Color color;
615 int size;
616 };
617
618 struct SphereData : public DrawData
619 {
620 Eigen::Vector3f position;
621 VirtualRobot::VisualizationFactory::Color color;
622 float radius;
623 };
624
625 struct CylinderData : public DrawData
626 {
627 Eigen::Vector3f position;
628 Eigen::Vector3f direction;
629 float length;
630 float radius;
631 VirtualRobot::VisualizationFactory::Color color;
632 };
633
634 struct CircleData : public DrawData
635 {
636 Eigen::Vector3f position;
637 Eigen::Vector3f direction;
638 float radius;
639 float width;
641 VirtualRobot::VisualizationFactory::Color color;
642 };
643
644 struct PointCloudData : public DrawData
645 {
646 DebugDrawerPointCloud pointCloud;
647 };
648
650 {
651 DebugDrawerColoredPointCloud pointCloud;
652 };
653
655 {
656 DebugDrawer24BitColoredPointCloud pointCloud;
657 };
658
659 struct PolygonData : public DrawData
660 {
661 std::vector<Eigen::Vector3f> points;
663 VirtualRobot::VisualizationFactory::Color colorInner;
664 VirtualRobot::VisualizationFactory::Color colorBorder;
665 };
666
667 struct TriMeshData : public DrawData
668 {
669 DebugDrawerTriMesh triMesh;
670 };
671
672 struct ArrowData : public DrawData
673 {
674 Eigen::Vector3f position;
675 Eigen::Vector3f direction;
676 float length;
677 float width;
678 VirtualRobot::VisualizationFactory::Color color;
679 };
680
681 struct RobotData : public DrawData
682 {
684 {
685 updateColor = false;
686 updatePose = false;
687 updateConfig = false;
688 }
689
690 std::string robotFile;
691 std::string armarxProject;
692
694 VirtualRobot::VisualizationFactory::Color color;
695
697 std::map<std::string, VirtualRobot::VisualizationFactory::Color> nodeColors;
698
700 Eigen::Matrix4f globalPose;
701
703 std::map<std::string, float> configuration;
704
705 armarx::DrawStyle drawStyle;
706 };
707
709 {
710 std::map<std::string, CoordData> coord;
711 std::map<std::string, LineData> line;
712 std::map<std::string, LineSetData> lineSet;
713 std::map<std::string, BoxData> box;
714 std::map<std::string, TextData> text;
715 std::map<std::string, SphereData> sphere;
716 std::map<std::string, CircleData> circle;
717 std::map<std::string, CylinderData> cylinder;
718 std::map<std::string, PointCloudData> pointcloud;
719 std::map<std::string, ColoredPointCloudData> coloredpointcloud;
720 std::map<std::string, Colored24BitPointCloudData> colored24Bitpointcloud;
721 std::map<std::string, PolygonData> polygons;
722 std::map<std::string, TriMeshData> triMeshes;
723 std::map<std::string, ArrowData> arrows;
724 std::map<std::string, RobotData> robots;
725
726 std::set<std::string> clearLayers;
727 std::set<std::string> removeLayers;
728 };
729
731
732 // Reads accumulatedUpdateData, writes all data to coin visualization and clears accumulatedUpdateData
733 void updateVisualization();
734
735 /*!
736 * \brief onUpdateVisualization derived methods can overwrite this method to update custom visualizations.
737 */
738 virtual void
742
743 virtual void
744 onRemoveAccumulatedData(const std::string& layerName)
745 {
746 }
747
748 virtual void
749 removeCustomVisu(const std::string& layerName, const std::string& name)
750 {
751 }
752
753 void drawCoordSystem(const CoordData& d);
754 void drawLine(const LineData& d);
755 void drawLineSet(const LineSetData& d);
756 void drawBox(const BoxData& d);
757 void drawText(const TextData& d);
758 void drawSphere(const SphereData& d);
759 void drawCylinder(const CylinderData& d);
761 void drawPointCloud(const PointCloudData& d);
762 void drawColoredPointCloud(const ColoredPointCloudData& d);
763 void draw24BitColoredPointCloud(const Colored24BitPointCloudData& d);
764 void drawPolygon(const PolygonData& d);
765 void drawTriMesh(const TriMeshData& d);
766 void drawArrow(const ArrowData& d);
767 void drawRobot(const RobotData& d);
768
769 void removeCoordSystem(const std::string& layerName, const std::string& name);
770 void removeLine(const std::string& layerName, const std::string& name);
771 void removeLineSet(const std::string& layerName, const std::string& name);
772 void removeBox(const std::string& layerName, const std::string& name);
773 void removeText(const std::string& layerName, const std::string& name);
774 void removeSphere(const std::string& layerName, const std::string& name);
775 void removeCylinder(const std::string& layerName, const std::string& name);
776 void removeCircle(const std::string& layerName, const std::string& name);
777 void removePointCloud(const std::string& layerName, const std::string& name);
778 void removeColoredPointCloud(const std::string& layerName, const std::string& name);
779 void remove24BitColoredPointCloud(const std::string& layerName, const std::string& name);
780 void removePolygon(const std::string& layerName, const std::string& name);
781 void removeTriMesh(const std::string& layerName, const std::string& name);
782 void removeArrow(const std::string& layerName, const std::string& name);
783 void removeRobot(const std::string& layerName, const std::string& name);
784
785
786 /*!
787 * QT safe version, should not be called from an ICE thread
788 */
789 void clearLayerQt(const std::string& layerName);
790 void removeLayerQt(const std::string& layerName);
791
792 void setLayerVisibility(const std::string& layerName, bool visible);
793
794 /*!
795 * \brief Contains data for a layer.
796 */
797 struct Layer
798 {
799 SoSeparator* mainNode;
800 std::map<std::string, SoSeparator*> addedCoordVisualizations;
801 std::map<std::string, SoSeparator*> addedLineVisualizations;
802 std::map<std::string, SoSeparator*> addedLineSetVisualizations;
803 std::map<std::string, SoSeparator*> addedBoxVisualizations;
804 std::map<std::string, SoSeparator*> addedTextVisualizations;
805 std::map<std::string, SoSeparator*> addedSphereVisualizations;
806 std::map<std::string, SoSeparator*> addedCylinderVisualizations;
807 std::map<std::string, SoSeparator*> addedCircleVisualizations;
808 std::map<std::string, SoSeparator*> addedPointCloudVisualizations;
809 std::map<std::string, SoSeparator*> addedColoredPointCloudVisualizations;
810 std::map<std::string, SoSeparator*> added24BitColoredPointCloudVisualizations;
811 std::map<std::string, SoSeparator*> addedPolygonVisualizations;
812 std::map<std::string, SoSeparator*> addedTriMeshVisualizations;
813 std::map<std::string, SoSeparator*> addedArrowVisualizations;
814 std::map<std::string, SoSeparator*> addedRobotVisualizations;
815 std::map<std::string, SoSeparator*>
816 addedCustomVisualizations; // these separators are only used by derived classes and have to start with a material node
817
819 };
820
821 /*!
822 * \brief If a layer with layerName exists it is returned. Otherwise a new layer with given name is created and returned.
823 * \param layerName The layer.
824 * \return The requested layer.
825 */
826 Layer& requestLayer(const std::string& layerName);
828
829 /*!
830 * \brief ensureExistingRobotNodes Checks if all robotnodes of configuration exist in robot. If not the specific configuration entry is removed from the list.
831 * \param d
832 */
834
835 std::map<std::string, VirtualRobot::RobotPtr> activeRobots;
836 SoSeparator* coinVisu;
837 SoSelection* selectionNode;
838
840
841 /*!
842 * \brief Main node for all layers
843 */
844 SoSeparator* layerMainNode;
845
846 /*!
847 * \brief All existing layers.
848 */
849 std::map<const std::string, Layer> layers;
850
851 //! The coin mutex
853
854 //! The data update mutex
856
858
859 static std::recursive_mutex selectionMutex;
860 std::set<std::string> selectableLayers;
861
863
864 DebugDrawerListenerPrx listenerPrx;
865
867 //PeriodicTask<DebugDrawerComponent>::pointer_type execTaskVisuUpdates;
868 SoTimerSensor* timerSensor;
870 void removeAccumulatedData(const std::string& layerName);
871
872 std::map<std::string, VirtualRobot::RobotPtr> loadedRobots;
873
875 std::map<std::string, bool> defaultLayerVisibilityPerLayer;
876 };
877
879
880} // namespace armarx
constexpr T c
ComponentPropertyDefinitions(std::string prefix, bool hasObjectNameParameter=true)
Definition Component.cpp:46
Component()
Protected default constructor. Used for virtual inheritance. Use createManagedIceObject() instead.
Definition Component.cpp:66
std::string getConfigIdentifier()
Retrieve config identifier for this component as set in constructor.
Definition Component.cpp:90
void removeCylinderVisu(const std::string &layerName, const std::string &cylinderName, const ::Ice::Current &=Ice::emptyCurrent) override
DebugDrawerComponent()
DebugDrawerComponent Constructs a debug drawer.
void setLineSetVisu(const std::string &layerName, const std::string &lineSetName, const DebugDrawerLineSet &lineSet, const ::Ice::Current &=Ice::emptyCurrent) override
void setLineDebugLayerVisu(const std::string &lineName, const ::armarx::Vector3BasePtr &globalPosition1, const ::armarx::Vector3BasePtr &globalPosition2, float lineWidth, const ::armarx::DrawColor &color, const ::Ice::Current &=Ice::emptyCurrent) override
void removeSphere(const std::string &layerName, const std::string &name)
void onInitComponent() override
Pure virtual hook for the subclass.
void setPointCloudVisu(const std::string &layerName, const std::string &pointCloudName, const DebugDrawerPointCloud &pointCloud, const ::Ice::Current &=Ice::emptyCurrent) override
void setArrowDebugLayerVisu(const std::string &arrowName, const ::armarx::Vector3BasePtr &position, const ::armarx::Vector3BasePtr &direction, const DrawColor &color, float length, float width, const ::Ice::Current &=Ice::emptyCurrent) override
void removePointCloud(const std::string &layerName, const std::string &name)
void setPointCloudDebugLayerVisu(const std::string &pointCloudName, const DebugDrawerPointCloud &pointCloud, const ::Ice::Current &=Ice::emptyCurrent) override
void removeTextDebugLayerVisu(const std::string &textName, const ::Ice::Current &=Ice::emptyCurrent) override
void drawLineSet(const LineSetData &d)
void setTextVisu(const std::string &layerName, const std::string &textName, const std::string &text, const ::armarx::Vector3BasePtr &globalPosition, const DrawColor &color, int size, const ::Ice::Current &=Ice::emptyCurrent) override
void removePolygonDebugLayerVisu(const std::string &polygonName, const ::Ice::Current &=Ice::emptyCurrent) override
void removePolygon(const std::string &layerName, const std::string &name)
void setBoxDebugLayerVisu(const std::string &boxName, const ::armarx::PoseBasePtr &globalPose, const ::armarx::Vector3BasePtr &dimensions, const DrawColor &color, const ::Ice::Current &=Ice::emptyCurrent) override
void clearDebugLayer(const ::Ice::Current &=Ice::emptyCurrent) override
void removeRobotVisu(const std::string &layerName, const std::string &robotName, const ::Ice::Current &=Ice::emptyCurrent) override
void removeBox(const std::string &layerName, const std::string &name)
void setVisuUpdateTime(float visuUpdatesPerSec)
setVisuUpdateTime Specifies how often the accumulated draw commands should be applied to the visualiz...
void removeTriMeshVisu(const std::string &layerName, const std::string &triMeshName, const ::Ice::Current &=Ice::emptyCurrent) override
void setSphereDebugLayerVisu(const std::string &sphereName, const ::armarx::Vector3BasePtr &globalPosition, const DrawColor &color, float radius, const ::Ice::Current &=Ice::emptyCurrent) override
void reportSelectionChanged(const DebugDrawerSelectionList &selectedElements, const ::Ice::Current &=Ice::emptyCurrent) override
void updateRobotNodeColor(const std::string &layerName, const std::string &robotName, const std::string &robotNodeName, const armarx::DrawColor &c, const ::Ice::Current &=Ice::emptyCurrent) override
void removeLineSetVisu(const std::string &layerName, const std::string &lineSetName, const ::Ice::Current &=Ice::emptyCurrent) override
void removeLineVisu(const std::string &layerName, const std::string &lineName, const ::Ice::Current &=Ice::emptyCurrent) override
void removeLineDebugLayerVisu(const std::string &lineName, const ::Ice::Current &=Ice::emptyCurrent) override
void setDefaultLayerVisibility(bool defaultLayerVisibility)
void removeBoxVisu(const std::string &layerName, const std::string &boxName, const ::Ice::Current &=Ice::emptyCurrent) override
void updateRobotPose(const std::string &layerName, const std::string &robotName, const ::armarx::PoseBasePtr &globalPose, const ::Ice::Current &=Ice::emptyCurrent) override
void setCircleArrowVisu(const std::string &layerName, const std::string &circleName, const Vector3BasePtr &globalPosition, const Vector3BasePtr &directionVec, Ice::Float radius, Ice::Float circleCompletion, Ice::Float width, const DrawColor &color, const Ice::Current &=Ice::emptyCurrent) override
void enableLayerVisu(const std::string &layerName, bool visible, const ::Ice::Current &=Ice::emptyCurrent) override
void onDisconnectComponent() override
Hook for subclass.
void removeTextVisu(const std::string &layerName, const std::string &textName, const ::Ice::Current &=Ice::emptyCurrent) override
std::shared_ptr< RecursiveMutexLock > RecursiveMutexLockPtr
void removeCircleVisu(const std::string &layerName, const std::string &circleName, const Ice::Current &=Ice::emptyCurrent) override
void removePolygonVisu(const std::string &layerName, const std::string &polygonName, const ::Ice::Current &=Ice::emptyCurrent) override
virtual void onUpdateVisualization()
onUpdateVisualization derived methods can overwrite this method to update custom visualizations.
RecursiveMutexLockPtr getScopedVisuLock()
getScopedLock If using the coin visualization it must be ensured that all rendering calls are protect...
void removeBoxDebugLayerVisu(const std::string &boxName, const ::Ice::Current &=Ice::emptyCurrent) override
void updateRobotColor(const std::string &layerName, const std::string &robotName, const armarx::DrawColor &c, const ::Ice::Current &=Ice::emptyCurrent) override
updateRobotColor Colorizes the robot visualization
virtual void setColoredPointCloudDebugLayerVisu(const std::string &pointCloudName, const DebugDrawerColoredPointCloud &pointCloud, const ::Ice::Current &=Ice::emptyCurrent)
void setTriMeshDebugLayerVisu(const std::string &triMeshName, const DebugDrawerTriMesh &triMesh, const ::Ice::Current &=Ice::emptyCurrent) override
void setBoxVisu(const std::string &layerName, const std::string &boxName, const ::armarx::PoseBasePtr &globalPose, const ::armarx::Vector3BasePtr &dimensions, const DrawColor &color, const ::Ice::Current &=Ice::emptyCurrent) override
void remove24BitColoredPointCloud(const std::string &layerName, const std::string &name)
std::shared_ptr< RecursiveMutex > RecursiveMutexPtr
void removeLine(const std::string &layerName, const std::string &name)
std::map< std::string, bool > defaultLayerVisibilityPerLayer
void removeCylinder(const std::string &layerName, const std::string &name)
SoSeparator * getVisualization()
getVisualization Ensure that all access to this node is protected with the scoped lock mutex.
void enableSelections(const std::string &layerName, const ::Ice::Current &=Ice::emptyCurrent) override
void removeCoordSystem(const std::string &layerName, const std::string &name)
void set24BitColoredPointCloudDebugLayerVisu(const std::string &pointCloudName, const DebugDrawer24BitColoredPointCloud &pointCloud, const ::Ice::Current &=Ice::emptyCurrent) override
void setPoseDebugLayerVisu(const std::string &poseName, const ::armarx::PoseBasePtr &globalPose, const ::Ice::Current &=Ice::emptyCurrent) override
void drawCoordSystem(const CoordData &d)
::armarx::LayerInformationSequence layerInformation(const ::Ice::Current &=Ice::emptyCurrent) override
void removeSphereVisu(const std::string &layerName, const std::string &sphereName, const ::Ice::Current &=Ice::emptyCurrent) override
void setLineSetDebugLayerVisu(const std::string &lineSetName, const DebugDrawerLineSet &lineSet, const ::Ice::Current &=Ice::emptyCurrent) override
SoSeparator * layerMainNode
Main node for all layers.
void exportScene(const std::string &filename, const ::Ice::Current &=Ice::emptyCurrent) override
void removeTriMeshDebugLayerVisu(const std::string &triMeshName, const ::Ice::Current &=Ice::emptyCurrent) override
void drawPointCloud(const PointCloudData &d)
void removeArrowDebugLayerVisu(const std::string &arrowName, const ::Ice::Current &=Ice::emptyCurrent) override
void select(const std::string &layerName, const std::string &elementName, const ::Ice::Current &=Ice::emptyCurrent) override
std::unique_lock< RecursiveMutex > RecursiveMutexLock
void removePoseDebugLayerVisu(const std::string &poseName, const ::Ice::Current &=Ice::emptyCurrent) override
void setSphereVisu(const std::string &layerName, const std::string &sphereName, const ::armarx::Vector3BasePtr &globalPosition, const DrawColor &color, float radius, const ::Ice::Current &=Ice::emptyCurrent) override
void setRobotVisu(const std::string &layerName, const std::string &robotName, const std::string &robotFile, const std::string &armarxProject, DrawStyle drawStyle, const ::Ice::Current &=Ice::emptyCurrent) override
setRobotVisu Initializes a robot visualization
void clearLayerQt(const std::string &layerName)
void removeArrowVisu(const std::string &layerName, const std::string &arrowName, const ::Ice::Current &=Ice::emptyCurrent) override
void drawCylinder(const CylinderData &d)
void removeColoredPointCloudVisu(const std::string &layerName, const std::string &pointCloudName, const ::Ice::Current &=Ice::emptyCurrent) override
void deselect(const std::string &layerName, const std::string &elementName, const ::Ice::Current &=Ice::emptyCurrent) override
void remove24BitColoredPointCloudDebugLayerVisu(const std::string &pointCloudName, const ::Ice::Current &=Ice::emptyCurrent) override
void setPolygonVisu(const std::string &layerName, const std::string &polygonName, const std::vector<::armarx::Vector3BasePtr > &polygonPoints, const DrawColor &colorInner, const DrawColor &colorBorder, float lineWidth, const ::Ice::Current &=Ice::emptyCurrent) override
void updateRobotConfig(const std::string &layerName, const std::string &robotName, const std::map< std::string, float > &configuration, const ::Ice::Current &=Ice::emptyCurrent) override
DebugDrawerListenerPrx listenerPrx
void setTextDebugLayerVisu(const std::string &textName, const std::string &text, const ::armarx::Vector3BasePtr &globalPosition, const DrawColor &color, int size, const ::Ice::Current &=Ice::emptyCurrent) override
void setPolygonDebugLayerVisu(const std::string &polygonName, const std::vector<::armarx::Vector3BasePtr > &polygonPoints, const DrawColor &colorInner, const DrawColor &colorBorder, float lineWidth, const ::Ice::Current &=Ice::emptyCurrent) override
void removePointCloudDebugLayerVisu(const std::string &pointCloudName, const ::Ice::Current &=Ice::emptyCurrent) override
Layer & requestLayer(const std::string &layerName)
If a layer with layerName exists it is returned. Otherwise a new layer with given name is created and...
void removeCircle(const std::string &layerName, const std::string &name)
std::map< std::string, bool > getAllDefaultLayerVisibilities() const
void removeCylinderDebugLayerVisu(const std::string &cylinderName, const ::Ice::Current &=Ice::emptyCurrent) override
bool getDefaultLayerVisibility(const std::string &layerName) const
RecursiveMutexPtr dataUpdateMutex
The data update mutex.
std::map< std::string, VirtualRobot::RobotPtr > activeRobots
void enableAllLayers(const ::Ice::Current &=Ice::emptyCurrent) override
void setDefaultLayerVisibility(const std::string &layerName, bool defaultLayerVisibility)
void setLineVisu(const std::string &layerName, const std::string &lineName, const ::armarx::Vector3BasePtr &globalPosition1, const ::armarx::Vector3BasePtr &globalPosition2, float lineWidth, const ::armarx::DrawColor &color, const ::Ice::Current &=Ice::emptyCurrent) override
void removePointCloudVisu(const std::string &layerName, const std::string &pointCloudName, const ::Ice::Current &=Ice::emptyCurrent) override
bool hasLayer(const std::string &layerName, const ::Ice::Current &=Ice::emptyCurrent) override
void exportLayer(const std::string &filename, const std::string &layerName, const ::Ice::Current &=Ice::emptyCurrent) override
void removeColoredPointCloud(const std::string &layerName, const std::string &name)
void set24BitColoredPointCloudVisu(const std::string &layerName, const std::string &pointCloudName, const DebugDrawer24BitColoredPointCloud &pointCloud, const ::Ice::Current &=Ice::emptyCurrent) override
void removeRobot(const std::string &layerName, const std::string &name)
void draw24BitColoredPointCloud(const Colored24BitPointCloudData &d)
void onConnectComponent() override
Pure virtual hook for the subclass.
void setCylinderDebugLayerVisu(const std::string &cylinderName, const ::armarx::Vector3BasePtr &globalPosition, const ::armarx::Vector3BasePtr &direction, float length, float radius, const DrawColor &color, const ::Ice::Current &=Ice::emptyCurrent) override
::Ice::StringSeq layerNames(const ::Ice::Current &=Ice::emptyCurrent) override
RecursiveMutexLockPtr getScopedAccumulatedDataLock()
static std::recursive_mutex selectionMutex
VirtualRobot::RobotPtr requestRobot(const RobotData &d)
PropertyDefinitionsPtr createPropertyDefinitions() override
virtual void removeCustomVisu(const std::string &layerName, const std::string &name)
void removeTriMesh(const std::string &layerName, const std::string &name)
void setColoredPointCloudVisu(const std::string &layerName, const std::string &pointCloudName, const DebugDrawerColoredPointCloud &pointCloud, const ::Ice::Current &=Ice::emptyCurrent) override
void removeSphereDebugLayerVisu(const std::string &sphereName, const ::Ice::Current &=Ice::emptyCurrent) override
void setMutex(RecursiveMutexPtr const &m)
void remove24BitColoredPointCloudVisu(const std::string &layerName, const std::string &pointCloudName, const ::Ice::Current &=Ice::emptyCurrent) override
void removeCircleDebugLayerVisu(const std::string &circleName, const Ice::Current &=Ice::emptyCurrent) override
DebugDrawerSelectionList getSelections(const ::Ice::Current &=Ice::emptyCurrent) override
void clearSelections(const std::string &layerName, const ::Ice::Current &=Ice::emptyCurrent) override
void removeColoredPointCloudDebugLayerVisu(const std::string &pointCloudName, const ::Ice::Current &=Ice::emptyCurrent) override
void setTriMeshVisu(const std::string &layerName, const std::string &triMeshName, const DebugDrawerTriMesh &triMesh, const ::Ice::Current &=Ice::emptyCurrent) override
void removePoseVisu(const std::string &layerName, const std::string &poseName, const ::Ice::Current &=Ice::emptyCurrent) override
static void updateVisualizationCB(void *data, SoSensor *sensor)
void setScaledPoseVisu(const std::string &layerName, const std::string &poseName, const ::armarx::PoseBasePtr &globalPose, const ::Ice::Float scale, const ::Ice::Current &=Ice::emptyCurrent) override
void clearLayer(const std::string &layerName, const ::Ice::Current &=Ice::emptyCurrent) override
void enableDebugLayerVisu(bool visible, const ::Ice::Current &=Ice::emptyCurrent) override
void removeArrow(const std::string &layerName, const std::string &name)
void setPoseVisu(const std::string &layerName, const std::string &poseName, const ::armarx::PoseBasePtr &globalPose, const ::Ice::Current &=Ice::emptyCurrent) override
void onExitComponent() override
Hook for subclass.
std::map< const std::string, Layer > layers
All existing layers.
std::map< std::string, VirtualRobot::RobotPtr > loadedRobots
void setArrowVisu(const std::string &layerName, const std::string &arrowName, const ::armarx::Vector3BasePtr &position, const ::armarx::Vector3BasePtr &direction, const DrawColor &color, float length, float width, const ::Ice::Current &=Ice::emptyCurrent) override
void setLayerVisibility(const std::string &layerName, bool visible)
void removeLayer(const std::string &layerName, const ::Ice::Current &=Ice::emptyCurrent) override
virtual void onRemoveAccumulatedData(const std::string &layerName)
void drawColoredPointCloud(const ColoredPointCloudData &d)
void disableAllLayers(const ::Ice::Current &=Ice::emptyCurrent) override
void drawCircle(const DebugDrawerComponent::CircleData &d)
void setCircleDebugLayerVisu(const std::string &circleName, const Vector3BasePtr &globalPosition, const Vector3BasePtr &directionVec, Ice::Float radius, Ice::Float circleCompletion, Ice::Float width, const DrawColor &color, const Ice::Current &=Ice::emptyCurrent) override
void removeLineSetDebugLayerVisu(const std::string &lineSetName, const ::Ice::Current &=Ice::emptyCurrent) override
void clearAll(const ::Ice::Current &=Ice::emptyCurrent) override
RecursiveMutexPtr mutex
The coin mutex.
void drawSphere(const SphereData &d)
std::set< std::string > selectableLayers
void removeDefaultLayerVisibility(const std::string &layerName)
void disableSelections(const std::string &layerName, const ::Ice::Current &=Ice::emptyCurrent) override
void drawPolygon(const PolygonData &d)
void ensureExistingRobotNodes(DebugDrawerComponent::RobotData &d)
ensureExistingRobotNodes Checks if all robotnodes of configuration exist in robot....
std::string getDefaultName() const override
Retrieve default name of component.
void removeAccumulatedData(const std::string &layerName)
void removeLineSet(const std::string &layerName, const std::string &name)
void setCylinderVisu(const std::string &layerName, const std::string &cylinderName, const ::armarx::Vector3BasePtr &globalPosition, const ::armarx::Vector3BasePtr &direction, float length, float radius, const DrawColor &color, const ::Ice::Current &=Ice::emptyCurrent) override
void setScaledPoseDebugLayerVisu(const std::string &poseName, const ::armarx::PoseBasePtr &globalPose, const ::Ice::Float scale, const ::Ice::Current &=Ice::emptyCurrent) override
void removeText(const std::string &layerName, const std::string &name)
void drawTriMesh(const TriMeshData &d)
void removeLayerQt(const std::string &layerName)
std::string prefix
Prefix of the properties such as namespace, domain, component name, etc.
PropertyDefinition< PropertyType > & defineOptionalProperty(const std::string &name, PropertyType defaultValue, const std::string &description="", PropertyDefinitionBase::PropertyConstness constness=PropertyDefinitionBase::eConstant)
std::shared_ptr< class Robot > RobotPtr
Definition Bus.h:19
This file offers overloads of toIce() and fromIce() functions for STL container types.
IceInternal::Handle< DebugDrawerComponent > DebugDrawerComponentPtr
IceUtil::Handle< class PropertyDefinitionContainer > PropertyDefinitionsPtr
PropertyDefinitions smart pointer type.
VirtualRobot::VisualizationFactory::Color color
VirtualRobot::VisualizationFactory::Color color
VirtualRobot::VisualizationFactory::Color color
VirtualRobot::VisualizationFactory::Color color
bool update
Whether an existing visu should be updated.
std::map< std::string, SoSeparator * > addedTextVisualizations
std::map< std::string, SoSeparator * > addedTriMeshVisualizations
std::map< std::string, SoSeparator * > addedCylinderVisualizations
std::map< std::string, SoSeparator * > addedCoordVisualizations
std::map< std::string, SoSeparator * > addedArrowVisualizations
std::map< std::string, SoSeparator * > addedColoredPointCloudVisualizations
std::map< std::string, SoSeparator * > addedBoxVisualizations
std::map< std::string, SoSeparator * > addedLineSetVisualizations
std::map< std::string, SoSeparator * > addedRobotVisualizations
std::map< std::string, SoSeparator * > addedCircleVisualizations
std::map< std::string, SoSeparator * > addedLineVisualizations
std::map< std::string, SoSeparator * > addedSphereVisualizations
std::map< std::string, SoSeparator * > added24BitColoredPointCloudVisualizations
std::map< std::string, SoSeparator * > addedPolygonVisualizations
std::map< std::string, SoSeparator * > addedPointCloudVisualizations
std::map< std::string, SoSeparator * > addedCustomVisualizations
VirtualRobot::VisualizationFactory::Color color
VirtualRobot::VisualizationFactory::Color colorInner
VirtualRobot::VisualizationFactory::Color colorBorder
std::map< std::string, float > configuration
std::map< std::string, VirtualRobot::VisualizationFactory::Color > nodeColors
VirtualRobot::VisualizationFactory::Color color
VirtualRobot::VisualizationFactory::Color color
VirtualRobot::VisualizationFactory::Color color
std::map< std::string, ColoredPointCloudData > coloredpointcloud
std::map< std::string, SphereData > sphere
std::map< std::string, LineSetData > lineSet
std::map< std::string, CylinderData > cylinder
std::map< std::string, RobotData > robots
std::map< std::string, CircleData > circle
std::map< std::string, Colored24BitPointCloudData > colored24Bitpointcloud
std::map< std::string, TextData > text
std::map< std::string, PointCloudData > pointcloud
std::map< std::string, ArrowData > arrows
std::map< std::string, LineData > line
std::map< std::string, CoordData > coord
std::map< std::string, TriMeshData > triMeshes
std::map< std::string, PolygonData > polygons