Go to the documentation of this file.
3 #include <pcl/common/colors.h>
4 #include <pcl/point_types.h>
26 return !visu.
voxel.isFree();
31 armarx::DrawColor color {1, 1, 1, 1};
33 const std::map<Label, float> density = visu.
voxel.getDensity();
35 const Eigen::Vector3f y = (visu.
ori * Eigen::Vector3f::UnitY()) * visu.
extents.y();
36 const Eigen::Vector3f posBase = visu.
pos - y / 2;
39 for (
const auto& [label, fraction] : density)
41 const pcl::RGB rgb = pcl::GlasbeyLUT::at(
static_cast<unsigned int>(label)
42 % pcl::GlasbeyLUT::size());
46 Eigen::Vector3f extents = visu.
extents;
47 extents.y() *= fraction;
49 const Eigen::Vector3f position = posBase + y * (sum + fraction / 2);
55 position, visu.
ori, extents, color);
Visualizer for label density voxel grids.
The DebugDrawerTopic wraps a DebugDrawerInterfacePrx and provides a more useful interface than the Ic...
Information about a voxel about to-be-drawn.
const Eigen::Vector3f & pos
The voxel.
armarx::DebugDrawerTopic & drawer()
Get the debug drawer.
static DrawColor toDrawColor(const ColorT &color, float alpha=1, bool byteToFloat=false)
Construct a DrawColor from the given color type.
const Eigen::Quaternionf & ori
The voxel's position.
void setAlpha(float value)
Set the alpha. Must be in [0, 1].
std::shared_ptr< Value > value()
virtual bool isVisible(const VoxelVisuData &voxelVisu) const override
Indicate whether a voxel shall be drawn.
std::string getVoxelLayer() const
Get the layer name.
const VoxelT & voxel
The voxel's index.
void drawBox(const VisuID &id, const Eigen::Vector3f &position, const Eigen::Quaternionf &orientation, const Eigen::Vector3f &extents, const DrawColor &color=DEFAULTS.colorBox, bool ignoreLengthScale=false)
Draw a box.
Map of labels (object IDs) to number of points.
const std::string & to_string(const std::string &s)
#define ARMARX_CHECK_LESS_EQUAL(lhs, rhs)
This macro evaluates whether lhs is less or equal (<=) rhs and if it turns out to be false it will th...
const Eigen::Vector3f & extents
The voxel's orientation.
float getAlpha() const
Get the alpha.
const std::string & name
The voxel grid.
virtual ~Visualizer() override
Virtual destructor.
virtual void drawVoxel(const VoxelVisuData &voxelVisu) override
Draw a voxel.