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 density voxel grids.
13  *
14  * Draws voxels as multi-colored boxes, where the proportion of each color
15  * corresponds to the proportion of the respective label.
16  */
17  class Visualizer : public voxelgrid::Visualizer<Voxel>
18  {
19 
20  public:
21 
22  Visualizer();
24  const std::string& layer = "LabelDensityVoxelGrid");
25 
26  virtual ~Visualizer() override;
27 
28 
29  /// Get the alpha.
30  float getAlpha() const;
31  /// Set the alpha. Must be in [0, 1].
32  void setAlpha(float value);
33 
34 
35  protected:
36 
37  virtual bool isVisible(const VoxelVisuData& voxelVisu) const override;
38  virtual void drawVoxel(const VoxelVisuData& voxelVisu) override;
39 
40 
41  float alpha = 0.75;
42 
43  };
44 
45 }
visionx::voxelgrid::LabelDensity::Visualizer
Visualizer for label density voxel grids.
Definition: Visualizer.h:17
visionx::voxelgrid::LabelDensity::Visualizer::alpha
float alpha
Definition: Visualizer.h:41
VoxelGrid.h
armarx::DebugDrawerTopic
The DebugDrawerTopic wraps a DebugDrawerInterfacePrx and provides a more useful interface than the Ic...
Definition: DebugDrawerTopic.h:152
visionx::voxelgrid::LabelDensity::Visualizer::Visualizer
Visualizer()
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::LabelDensity::Visualizer::setAlpha
void setAlpha(float value)
Set the alpha. Must be in [0, 1].
Definition: Visualizer.cpp:64
cxxopts::value
std::shared_ptr< Value > value()
Definition: cxxopts.hpp:926
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:59
visionx::voxelgrid::LabelDensity::Visualizer::~Visualizer
virtual ~Visualizer() override
Virtual destructor.
visionx::voxelgrid::LabelDensity
Definition: Visualizer.cpp:9
visionx::voxelgrid::LabelDensity::Visualizer::drawVoxel
virtual void drawVoxel(const VoxelVisuData &voxelVisu) override
Draw a voxel.