| 1611 | //----------------------------------------------------------------------------- |
| 1612 | |
| 1613 | void 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 | |
| 1636 | void PlotDummy(const char* label_id, const ImPlot3DSpec& spec) { |
| 1637 | if (BeginItem(label_id, spec, spec.LineColor, spec.Marker)) |
no test coverage detected