ArmarXVisualizer.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <SemanticObjectRelations/Hooks/VisualizerInterface.h>
4 
6 
7 #include <RobotAPI/interface/visualization/DebugDrawerInterface.h>
8 
9 
10 namespace armarx::semantic
11 {
12 
13  /**
14  * @brief Implementation of semrel::VisualizerInterface for ArmarX
15  * (using the DebugDrawer).
16  */
17  class ArmarXVisualizer : public semrel::VisualizerInterface
18  {
19  public:
20  static void setAsImplementation(const armarx::DebugDrawerInterfacePrx& debugDrawer);
21 
23 
24  virtual void clearAll() override;
25  virtual void clearLayer(const std::string& layer) override;
26 
27  virtual void drawLine(semrel::VisuMetaInfo id, const Eigen::Vector3f& start, const Eigen::Vector3f& end, float lineWidth, semrel::DrawColor color) override;
28  virtual void drawArrow(semrel::VisuMetaInfo id, const Eigen::Vector3f& origin, const Eigen::Vector3f& direction, float length, float width, semrel::DrawColor color) override;
29  virtual void drawBox(semrel::VisuMetaInfo id, const semrel::Box& box, semrel::DrawColor color) override;
30  virtual void drawCylinder(semrel::VisuMetaInfo id, const semrel::Cylinder& cylinder, semrel::DrawColor color) override;
31  virtual void drawSphere(semrel::VisuMetaInfo id, const semrel::Sphere& sphere, semrel::DrawColor color) override;
32  virtual void drawPolygon(semrel::VisuMetaInfo id, const std::vector<Eigen::Vector3f>& polygonPoints, float lineWidth, semrel::DrawColor colorInner, semrel::DrawColor colorBorder) override;
33  virtual void drawTriMesh(semrel::VisuMetaInfo id, const semrel::TriMesh& mesh, semrel::DrawColor color) override;
34  virtual void drawText(semrel::VisuMetaInfo id, const std::string& text, const Eigen::Vector3f& position, float size, semrel::DrawColor color) override;
35  virtual void drawPointCloud(semrel::VisuMetaInfo id, const std::vector<Eigen::Vector3f>& cloud, float pointSize, semrel::DrawColor color) override;
36 
37  private:
39  };
40 }
41 
43 {
44  extern const std::string visualizationLevelName;
45  extern const std::string visualizationLevelDescription;
46 }
47 
49 {
50 
52  const std::string& propertyName = defaults::visualizationLevelName,
53  semrel::VisuLevel defaultLevel = semrel::VisuLevel::RESULT,
54  const std::string& description = defaults::visualizationLevelDescription);
55 
56  semrel::VisuLevel getVisualizationLevel(
58  const std::string& propertyName = defaults::visualizationLevelName);
59 
62  const std::string& propertyName = defaults::visualizationLevelName);
63 
64 }
65 
66 
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:49
armarx::semantic::properties::defaults
Definition: ArmarXVisualizer.h:42
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:76
armarx::semantic::ArmarXVisualizer::clearLayer
virtual void clearLayer(const std::string &layer) override
Definition: ArmarXVisualizer.cpp:44
armarx::semantic::properties::defaults::visualizationLevelDescription
const std::string visualizationLevelDescription
Definition: ArmarXVisualizer.cpp:146
armarx::semantic::ArmarXVisualizer
Implementation of semrel::VisualizerInterface for ArmarX (using the DebugDrawer).
Definition: ArmarXVisualizer.h:17
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:124
armarx::semantic::ArmarXVisualizer::setAsImplementation
static void setAsImplementation(const armarx::DebugDrawerInterfacePrx &debugDrawer)
Definition: ArmarXVisualizer.cpp:29
armarx::semantic::ArmarXVisualizer::drawTriMesh
virtual void drawTriMesh(semrel::VisuMetaInfo id, const semrel::TriMesh &mesh, semrel::DrawColor color) override
Definition: ArmarXVisualizer.cpp:87
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:151
armarx::semantic::ArmarXVisualizer::drawCylinder
virtual void drawCylinder(semrel::VisuMetaInfo id, const semrel::Cylinder &cylinder, semrel::DrawColor color) override
Definition: ArmarXVisualizer.cpp:65
armarx::semantic::properties::getVisualizationLevel
semrel::VisuLevel getVisualizationLevel(armarx::PropertyUser &defs, const std::string &propertyName=defaults::visualizationLevelName)
Definition: ArmarXVisualizer.cpp:163
armarx::semantic::ArmarXVisualizer::ArmarXVisualizer
ArmarXVisualizer(armarx::DebugDrawerInterfacePrx const &debugDrawer)
Definition: ArmarXVisualizer.cpp:34
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:54
armarx::semantic::ArmarXVisualizer::drawSphere
virtual void drawSphere(semrel::VisuMetaInfo id, const semrel::Sphere &sphere, semrel::DrawColor color) override
Definition: ArmarXVisualizer.cpp:71
Component.h
armarx::semantic
Definition: ShapesSupportRelations.cpp:32
armarx::ComponentPropertyDefinitions
Default component property definition container.
Definition: Component.h:70
armarx::semantic::properties::defaults::visualizationLevelName
const std::string visualizationLevelName
Definition: ArmarXVisualizer.cpp:145
armarx::semantic::ArmarXVisualizer::clearAll
virtual void clearAll() override
Definition: ArmarXVisualizer.cpp:39
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:59
armarx::semantic::properties
Definition: ArmarXVisualizer.h:42
armarx::PropertyUser
Abstract PropertyUser class.
Definition: PropertyUser.h:62
armarx::semantic::properties::setMinimumVisuLevel
void setMinimumVisuLevel(armarx::PropertyUser &defs, const std::string &propertyName=defaults::visualizationLevelName)
Definition: ArmarXVisualizer.cpp:168
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:129