ArmarXVisualizer.h
Go to the documentation of this file.
1 #pragma once
2 
4 
5 #include <RobotAPI/interface/visualization/DebugDrawerInterface.h>
6 
7 #include <SemanticObjectRelations/Hooks/VisualizerInterface.h>
8 
9 namespace armarx::semantic
10 {
11 
12  /**
13  * @brief Implementation of semrel::VisualizerInterface for ArmarX
14  * (using the DebugDrawer).
15  */
16  class ArmarXVisualizer : public semrel::VisualizerInterface
17  {
18  public:
19  static void setAsImplementation(const armarx::DebugDrawerInterfacePrx& debugDrawer);
20 
22 
23  virtual void clearAll() override;
24  virtual void clearLayer(const std::string& layer) override;
25 
26  virtual void drawLine(semrel::VisuMetaInfo id,
27  const Eigen::Vector3f& start,
28  const Eigen::Vector3f& end,
29  float lineWidth,
30  semrel::DrawColor color) override;
31  virtual void drawArrow(semrel::VisuMetaInfo id,
32  const Eigen::Vector3f& origin,
33  const Eigen::Vector3f& direction,
34  float length,
35  float width,
36  semrel::DrawColor color) override;
37  virtual void
38  drawBox(semrel::VisuMetaInfo id, const semrel::Box& box, semrel::DrawColor color) override;
39  virtual void drawCylinder(semrel::VisuMetaInfo id,
40  const semrel::Cylinder& cylinder,
41  semrel::DrawColor color) override;
42  virtual void drawSphere(semrel::VisuMetaInfo id,
43  const semrel::Sphere& sphere,
44  semrel::DrawColor color) override;
45  virtual void drawPolygon(semrel::VisuMetaInfo id,
46  const std::vector<Eigen::Vector3f>& polygonPoints,
47  float lineWidth,
48  semrel::DrawColor colorInner,
49  semrel::DrawColor colorBorder) override;
50  virtual void drawTriMesh(semrel::VisuMetaInfo id,
51  const semrel::TriMesh& mesh,
52  semrel::DrawColor color) override;
53  virtual void drawText(semrel::VisuMetaInfo id,
54  const std::string& text,
55  const Eigen::Vector3f& position,
56  float size,
57  semrel::DrawColor color) override;
58  virtual void drawPointCloud(semrel::VisuMetaInfo id,
59  const std::vector<Eigen::Vector3f>& cloud,
60  float pointSize,
61  semrel::DrawColor color) override;
62 
63  private:
65  };
66 } // namespace armarx::semantic
67 
69 {
70  extern const std::string visualizationLevelName;
71  extern const std::string visualizationLevelDescription;
72 } // namespace armarx::semantic::properties::defaults
73 
75 {
76 
79  const std::string& propertyName = defaults::visualizationLevelName,
80  semrel::VisuLevel defaultLevel = semrel::VisuLevel::RESULT,
81  const std::string& description = defaults::visualizationLevelDescription);
82 
83  semrel::VisuLevel
85  const std::string& propertyName = defaults::visualizationLevelName);
86 
88  const std::string& propertyName = defaults::visualizationLevelName);
89 
90 } // namespace armarx::semantic::properties
armarx::semantic::ArmarXVisualizer::drawLine
virtual void drawLine(semrel::VisuMetaInfo id, const Eigen::Vector3f &start, const Eigen::Vector3f &end, float lineWidth, semrel::DrawColor color) override
Definition: ArmarXVisualizer.cpp:57
armarx::semantic::properties::defaults
Definition: ArmarXVisualizer.h:68
armarx::semantic::ArmarXVisualizer::drawPolygon
virtual void drawPolygon(semrel::VisuMetaInfo id, const std::vector< Eigen::Vector3f > &polygonPoints, float lineWidth, semrel::DrawColor colorInner, semrel::DrawColor colorBorder) override
Definition: ArmarXVisualizer.cpp:120
armarx::semantic::ArmarXVisualizer::clearLayer
virtual void clearLayer(const std::string &layer) override
Definition: ArmarXVisualizer.cpp:51
armarx::semantic::properties::defaults::visualizationLevelDescription
const std::string visualizationLevelDescription
Definition: ArmarXVisualizer.cpp:212
armarx::semantic::ArmarXVisualizer
Implementation of semrel::VisualizerInterface for ArmarX (using the DebugDrawer).
Definition: ArmarXVisualizer.h:16
armarx::semantic::ArmarXVisualizer::drawText
virtual void drawText(semrel::VisuMetaInfo id, const std::string &text, const Eigen::Vector3f &position, float size, semrel::DrawColor color) override
Definition: ArmarXVisualizer.cpp:181
armarx::semantic::ArmarXVisualizer::setAsImplementation
static void setAsImplementation(const armarx::DebugDrawerInterfacePrx &debugDrawer)
Definition: ArmarXVisualizer.cpp:33
armarx::semantic::ArmarXVisualizer::drawTriMesh
virtual void drawTriMesh(semrel::VisuMetaInfo id, const semrel::TriMesh &mesh, semrel::DrawColor color) override
Definition: ArmarXVisualizer.cpp:141
armarx::semantic::properties::defineVisualizationLevel
void defineVisualizationLevel(armarx::ComponentPropertyDefinitions &defs, const std::string &propertyName=defaults::visualizationLevelName, semrel::VisuLevel defaultLevel=semrel::VisuLevel::RESULT, const std::string &description=defaults::visualizationLevelDescription)
Definition: ArmarXVisualizer.cpp:217
armarx::semantic::ArmarXVisualizer::drawCylinder
virtual void drawCylinder(semrel::VisuMetaInfo id, const semrel::Cylinder &cylinder, semrel::DrawColor color) override
Definition: ArmarXVisualizer.cpp:97
armarx::semantic::properties::getVisualizationLevel
semrel::VisuLevel getVisualizationLevel(armarx::PropertyUser &defs, const std::string &propertyName=defaults::visualizationLevelName)
Definition: ArmarXVisualizer.cpp:231
armarx::semantic::ArmarXVisualizer::ArmarXVisualizer
ArmarXVisualizer(armarx::DebugDrawerInterfacePrx const &debugDrawer)
Definition: ArmarXVisualizer.cpp:39
armarx::semantic::ArmarXVisualizer::drawArrow
virtual void drawArrow(semrel::VisuMetaInfo id, const Eigen::Vector3f &origin, const Eigen::Vector3f &direction, float length, float width, semrel::DrawColor color) override
Definition: ArmarXVisualizer.cpp:68
armarx::semantic::ArmarXVisualizer::drawSphere
virtual void drawSphere(semrel::VisuMetaInfo id, const semrel::Sphere &sphere, semrel::DrawColor color) override
Definition: ArmarXVisualizer.cpp:111
Component.h
armarx::semantic
Definition: ShapesSupportRelations.cpp:32
armarx::ComponentPropertyDefinitions
Default component property definition container.
Definition: Component.h:69
armarx::semantic::properties::defaults::visualizationLevelName
const std::string visualizationLevelName
Definition: ArmarXVisualizer.cpp:211
armarx::semantic::ArmarXVisualizer::clearAll
virtual void clearAll() override
Definition: ArmarXVisualizer.cpp:45
IceInternal::ProxyHandle<::IceProxy::armarx::DebugDrawerInterface >
armarx::semantic::ArmarXVisualizer::drawBox
virtual void drawBox(semrel::VisuMetaInfo id, const semrel::Box &box, semrel::DrawColor color) override
Definition: ArmarXVisualizer.cpp:85
armarx::semantic::properties
Definition: ArmarXVisualizer.h:68
armarx::PropertyUser
Abstract PropertyUser class.
Definition: PropertyUser.h:63
armarx::semantic::properties::setMinimumVisuLevel
void setMinimumVisuLevel(armarx::PropertyUser &defs, const std::string &propertyName=defaults::visualizationLevelName)
Definition: ArmarXVisualizer.cpp:237
armarx::semantic::ArmarXVisualizer::drawPointCloud
virtual void drawPointCloud(semrel::VisuMetaInfo id, const std::vector< Eigen::Vector3f > &cloud, float pointSize, semrel::DrawColor color) override
Definition: ArmarXVisualizer.cpp:192