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

Method Render

implot3d_items.cpp:434–453  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

432 void Init(ImDrawList3D& draw_list_3d) const { GetLineRenderProps(draw_list_3d, HalfWeight, UV0, UV1); }
433
434 IMPLOT3D_INLINE bool Render(ImDrawList3D& draw_list_3d, const ImPlot3DBox& cull_box, int prim) const {
435 ImPlot3DPoint P2_plot = Getter(prim + 1);
436
437 // Clip the line segment to the culling box using Liang-Barsky algorithm
438 ImPlot3DPoint P1_clipped, P2_clipped;
439 bool visible = cull_box.ClipLineSegment(P1_plot, P2_plot, P1_clipped, P2_clipped);
440
441 if (visible) {
442 // Convert clipped points to pixel coordinates
443 ImVec2 P1_screen = PlotToPixels(P1_clipped);
444 ImVec2 P2_screen = PlotToPixels(P2_clipped);
445 // Render the line segment
446 PrimLine(draw_list_3d, P1_screen, P2_screen, HalfWeight, ColGetter(prim), UV0, UV1, GetPointDepth((P1_plot + P2_plot) * 0.5));
447 }
448
449 // Update for next segment
450 P1_plot = P2_plot;
451
452 return visible;
453 }
454
455 const _Getter& Getter;
456 const _GetterColor ColGetter;

Callers

nothing calls this directly

Calls 4

PlotToPixelsFunction · 0.85
PrimLineFunction · 0.85
GetPointDepthFunction · 0.85
ClipLineSegmentMethod · 0.80

Tested by

no test coverage detected