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

Function PlotText

implot3d_items.cpp:1613–1634  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1611//-----------------------------------------------------------------------------
1612
1613void PlotText(const char* text, double x, double y, double z, double angle, const ImVec2& pix_offset) {
1614 ImPlot3DContext& gp = *GImPlot3D;
1615 IM_ASSERT_USER_ERROR(gp.CurrentPlot != nullptr, "PlotText() needs to be called between BeginPlot() and EndPlot()!");
1616 SetupLock();
1617 ImPlot3DPlot& plot = *gp.CurrentPlot;
1618
1619 ImPlot3DBox cull_box;
1620 if (ImHasFlag(plot.Flags, ImPlot3DFlags_NoClip)) {
1621 cull_box.Min = ImPlot3DPoint(-HUGE_VAL, -HUGE_VAL, -HUGE_VAL);
1622 cull_box.Max = ImPlot3DPoint(HUGE_VAL, HUGE_VAL, HUGE_VAL);
1623 } else {
1624 cull_box.Min = plot.RangeMin();
1625 cull_box.Max = plot.RangeMax();
1626 }
1627 if (!cull_box.Contains(ImPlot3DPoint(x, y, z)))
1628 return;
1629
1630 ImVec2 p = PlotToPixels(ImPlot3DPoint(x, y, z));
1631 p.x += pix_offset.x;
1632 p.y += pix_offset.y;
1633 AddTextRotated(GetPlotDrawList(), p, (float)angle, GetStyleColorU32(ImPlot3DCol_InlayText), text);
1634}
1635
1636void PlotDummy(const char* label_id, const ImPlot3DSpec& spec) {
1637 if (BeginItem(label_id, spec, spec.LineColor, spec.Marker))

Callers 1

DemoMarkersAndTextFunction · 0.85

Calls 10

SetupLockFunction · 0.85
ImHasFlagFunction · 0.85
ImPlot3DPointClass · 0.85
PlotToPixelsFunction · 0.85
AddTextRotatedFunction · 0.85
GetPlotDrawListFunction · 0.85
GetStyleColorU32Function · 0.85
RangeMinMethod · 0.80
RangeMaxMethod · 0.80
ContainsMethod · 0.80

Tested by

no test coverage detected