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

Method Render

implot3d_items.cpp:514–537  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

512 void Init(ImDrawList3D& draw_list_3d) const { GetLineRenderProps(draw_list_3d, HalfWeight, UV0, UV1); }
513
514 IMPLOT3D_INLINE bool Render(ImDrawList3D& draw_list_3d, const ImPlot3DBox& cull_box, int prim) const {
515 // Get the segment's endpoints in plot coordinates
516 ImPlot3DPoint P1_plot = Getter(prim * 2 + 0);
517 ImPlot3DPoint P2_plot = Getter(prim * 2 + 1);
518
519 // Check for NaNs in P1_plot and P2_plot
520 if (!ImNan(P1_plot.x) && !ImNan(P1_plot.y) && !ImNan(P1_plot.z) && !ImNan(P2_plot.x) && !ImNan(P2_plot.y) && !ImNan(P2_plot.z)) {
521
522 // Clip the line segment to the culling box
523 ImPlot3DPoint P1_clipped, P2_clipped;
524 bool visible = cull_box.ClipLineSegment(P1_plot, P2_plot, P1_clipped, P2_clipped);
525
526 if (visible) {
527 // Convert clipped points to pixel coordinates
528 ImVec2 P1_screen = PlotToPixels(P1_clipped);
529 ImVec2 P2_screen = PlotToPixels(P2_clipped);
530 // Render the line segment
531 PrimLine(draw_list_3d, P1_screen, P2_screen, HalfWeight, ColGetter(prim), UV0, UV1, GetPointDepth((P1_plot + P2_plot) * 0.5));
532 }
533 return visible;
534 }
535
536 return false;
537 }
538
539 const _Getter& Getter;
540 const _GetterColor ColGetter;

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected