22 template<
typename GetTrianglesT>
31 "Polyhedron callback must return a vector of triangles with points ordered clockwise, expressed as "
32 "an std::vector<std::array<double, 3>>");
57 template<
typename GetVerticesT,
typename GetTrianglesT>
64 GetVerticesT get_vertices_fn,
65 GetTrianglesT get_triangles_fn)
69 "Polyhedron vertices callback must return a vector of 3D points");
71 "Polyhedron triangles callback must return a list of 3-uple index into vertices array");
98 template<
typename PolyhedronT,
typename GetColorT>
107 "Polyhedron color callback must return an std::vector<std::array<mc_rtc::gui::Color, 3>> (color for "
108 "each of the triangle vertices)");
113 "Polyhedron color callback must return an std::vector<mc_rtc::gui::Color> (color for "
114 "each of the vertices)");
121 static constexpr
size_t write_size() {
return PolyhedronT::write_size() + 1; }
128 for(
const auto & c : colors)
138 else { c.write(builder); }
150 template<
typename GetTrianglesT>
151 auto Polyhedron(
const std::string & name, GetTrianglesT get_triangles_fn)
157 template<
typename GetTrianglesT>
164 template<
typename GetVerticesOrTrianglesT,
typename GetTrianglesOrColorsT>
166 GetVerticesOrTrianglesT get_vertices_or_triangles_fn,
167 GetTrianglesOrColorsT get_triangles_or_colors_fn)
173 get_triangles_or_colors_fn);
178 name, {}, get_vertices_or_triangles_fn, get_triangles_or_colors_fn);
183 template<
typename GetVerticesOrTrianglesT,
typename GetTrianglesOrColorsT>
186 GetVerticesOrTrianglesT get_vertices_or_triangles_fn,
187 GetTrianglesOrColorsT get_triangles_or_colors_fn)
191 auto poly =
Polyhedron(name, config, get_vertices_or_triangles_fn);
193 get_triangles_or_colors_fn);
198 name, config, get_vertices_or_triangles_fn, get_triangles_or_colors_fn);
203 template<
typename GetTrianglesT,
typename GetColorT>
206 GetTrianglesT get_triangles_fn,
207 GetColorT get_color_fn)
209 auto poly =
Polyhedron(name, config, get_triangles_fn);
214 template<
typename GetVerticesT,
typename GetTrianglesT,
typename GetColorT>
216 GetVerticesT get_vertices_fn,
217 GetTrianglesT get_triangles_fn,
218 GetColorT get_color_fn)
220 auto poly =
Polyhedron(name, get_vertices_fn, get_triangles_fn);
225 template<
typename GetVerticesT,
typename GetTrianglesT,
typename GetColorT>
228 GetVerticesT get_vertices_fn,
229 GetTrianglesT get_triangles_fn,
230 GetColorT get_color_fn)
232 auto poly =
Polyhedron(name, config, get_vertices_fn, get_triangles_fn);