24 #include <Inventor/nodes/SoMaterial.h>
29 auto color = element.color;
30 constexpr
float conv = 1.0f / 255.0f;
31 const float r = color.r * conv;
32 const float g = color.g * conv;
33 const float b = color.b * conv;
34 const float a = color.a * conv;
36 VirtualRobot::VisualizationNodePtr cylindroid_node;
39 SoMaterial* mat =
new SoMaterial;
40 mat->diffuseColor.setValue(r, g, b);
41 mat->ambientColor.setValue(r, g, b);
42 mat->transparency.setValue(1. -
a);
44 SoSeparator* res =
new SoSeparator();
46 SoUnits* u =
new SoUnits();
47 u->units = SoUnits::MILLIMETERS;
49 res->addChild(VirtualRobot::CoinVisualizationFactory::CreateCylindroid(
50 element.axisLengths.e0, element.axisLengths.e1, element.height, mat));
52 cylindroid_node.reset(
new VirtualRobot::CoinVisualizationNode(res));
57 dynamic_cast<VirtualRobot::CoinVisualizationNode&
>(*cylindroid_node).getCoinVisualization();
59 node->removeAllChildren();
60 node->addChild(cylindroid);