Visualizer.h
Go to the documentation of this file.
1 #pragma once
2 
4 
5 #include "VoxelGrid.h"
6 
7 
9 {
10 
11  /**
12  * @brief Visualizer for label occupancy voxel grids.
13  *
14  * Draws occupied voxels as single colored boxes according to their label.
15  */
16  class Visualizer : public voxelgrid::Visualizer<Voxel>
17  {
18 
19  public:
20 
21  Visualizer();
23  const std::string& layer = "LabelOccupancyVoxelGrid");
24 
25  virtual ~Visualizer() override;
26 
27 
28  /// Get the alpha.
29  float getAlpha() const;
30  /// Set the alpha. Must be in [0, 1].
31  void setAlpha(float value);
32 
33 
34  protected:
35 
36  virtual bool isVisible(const VoxelVisuData& voxelVisu) const override;
37  virtual void drawVoxel(const VoxelVisuData& voxelVisu) override;
38 
39 
40  float alpha = 0.75;
41 
42  };
43 
44 }
visionx::voxelgrid::LabelOccupancy::Visualizer::isVisible
virtual bool isVisible(const VoxelVisuData &voxelVisu) const override
Indicate whether a voxel shall be drawn.
armarx::DebugDrawerTopic
The DebugDrawerTopic wraps a DebugDrawerInterfacePrx and provides a more useful interface than the Ic...
Definition: DebugDrawerTopic.h:152
visionx::voxelgrid::LabelOccupancy::Visualizer::setAlpha
void setAlpha(float value)
Set the alpha. Must be in [0, 1].
Definition: Visualizer.cpp:49
visionx::voxelgrid::LabelOccupancy::Visualizer::getAlpha
float getAlpha() const
Get the alpha.
Definition: Visualizer.cpp:44
visionx::voxelgrid::LabelOccupancy::Visualizer::~Visualizer
virtual ~Visualizer() override
Virtual destructor.
visionx::voxelgrid::Visualizer< Voxel >::drawer
armarx::DebugDrawerTopic & drawer()
Get the debug drawer.
Definition: Visualizer.hpp:122
visionx::voxelgrid::Visualizer
Visualizer for voxel grids of with voxel type VoxelT.
Definition: Visualizer.hpp:44
visionx::voxelgrid::LabelOccupancy
Definition: Visualizer.cpp:9
visionx::voxelgrid::LabelOccupancy::Visualizer::Visualizer
Visualizer()
cxxopts::value
std::shared_ptr< Value > value()
Definition: cxxopts.hpp:926
Visualizer.hpp
VoxelGrid.h
visionx::voxelgrid::LabelOccupancy::Visualizer
Visualizer for label occupancy voxel grids.
Definition: Visualizer.h:16
visionx::voxelgrid::LabelOccupancy::Visualizer::drawVoxel
virtual void drawVoxel(const VoxelVisuData &voxelVisu) override
Draw a voxel.
visionx::voxelgrid::LabelOccupancy::Visualizer::alpha
float alpha
Definition: Visualizer.h:40