MCPcopy Create free account
hub / github.com/brenocq/implot3d / PlotMeshEx

Function PlotMeshEx

implot3d_items.cpp:1500–1529  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1498
1499template <typename _VtxGetter, typename _TriGetter>
1500void PlotMeshEx(const char* label_id, const _VtxGetter& getter, const _TriGetter& getter_triangles, const ImPlot3DSpec& spec) {
1501 if (BeginItemEx(label_id, getter, spec, spec.FillColor, spec.Marker)) {
1502 const ImPlot3DNextItemData& n = GetItemData();
1503 const ImPlot3DSpec& s = n.Spec;
1504
1505 // Render fill
1506 if (getter.Count >= 3 && n.RenderFill && !ImHasFlag(spec.Flags, ImPlot3DMeshFlags_NoFill)) {
1507 if (s.FillColors != nullptr)
1508 RenderPrimitives2<RendererTriangleFill>(getter_triangles, GetterIdxColor(s.FillColors, getter_triangles.Count, s.FillAlpha));
1509 else
1510 RenderPrimitives2<RendererTriangleFill>(getter_triangles, GetterConstColor(ImGui::GetColorU32(s.FillColor)));
1511 }
1512
1513 // Render lines
1514 if (getter.Count >= 2 && n.RenderLine && !n.IsAutoLine && !ImHasFlag(spec.Flags, ImPlot3DMeshFlags_NoLines)) {
1515 if (s.LineColors != nullptr)
1516 RenderPrimitives2<RendererLineSegments>(GetterTriangleLines<_TriGetter>(getter_triangles),
1517 GetterIdxColor(s.LineColors, getter_triangles.Count), s.LineWeight);
1518 else
1519 RenderPrimitives2<RendererLineSegments>(GetterTriangleLines<_TriGetter>(getter_triangles),
1520 GetterConstColor(ImGui::GetColorU32(s.LineColor)), s.LineWeight);
1521 }
1522
1523 // Render markers
1524 if (s.Marker != ImPlot3DMarker_None && !ImHasFlag(spec.Flags, ImPlot3DMeshFlags_NoMarkers))
1525 RenderColoredMarkers(getter, n);
1526
1527 EndItem();
1528 }
1529}
1530
1531IMPLOT3D_TMP void PlotMesh(const char* label_id, const T* vtx_xs, const T* vtx_ys, const T* vtx_zs, const unsigned int* idxs, int vtx_count,
1532 int idx_count, const ImPlot3DSpec& spec) {

Callers 1

PlotMeshFunction · 0.85

Calls 6

BeginItemExFunction · 0.85
ImHasFlagFunction · 0.85
GetterIdxColorClass · 0.85
GetterConstColorClass · 0.85
RenderColoredMarkersFunction · 0.85
EndItemFunction · 0.85

Tested by

no test coverage detected