5 #include <Inventor/SbVec3f.h>
6 #include <Inventor/nodes/SoCoordinate3.h>
7 #include <Inventor/nodes/SoDrawStyle.h>
8 #include <Inventor/nodes/SoLineSet.h>
9 #include <Inventor/nodes/SoPointSet.h>
10 #include <Inventor/nodes/SoMaterial.h>
20 SoSeparator* lineSep =
new SoSeparator;
33 node->addChild(lineSep);
49 node->addChild(
new SoPointSet);
55 coordinate3->point.setValuesPointer(element.points.size(),
56 reinterpret_cast<const float*
>(element.points.data()));
59 const auto lineColor = element.color;
61 constexpr
float toUnit = 1.0F / 255.0F;
63 const auto color = SbVec3f(lineColor.r, lineColor.g, lineColor.b) * toUnit;
64 const float transparency = 1.0F -
static_cast<float>(lineColor.a) * toUnit;
70 if (element.lineWidth > 0.0F)
72 lineStyle->lineWidth.setValue(element.lineWidth);
76 lineStyle->style = SoDrawStyleElement::INVISIBLE;
79 const int pointSize =
static_cast<int>(element.points.size());
80 lineSet->numVertices.set1Value(0, pointSize);
91 pclCoords->point.setValuesPointer(element.points.size(),
92 reinterpret_cast<const float*
>(element.points.data()));
94 pclStyle->pointSize = element.lineWidth + 5;