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