MCPcopy Create free account
hub / github.com/IppClub/Dora-SSR / PlotErrorBarsHEx

Function PlotErrorBarsHEx

Source/3rdParty/implot/implot_items.cpp:2567–2589  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2565
2566template <typename _GetterPos, typename _GetterNeg>
2567void PlotErrorBarsHEx(const char* label_id, const _GetterPos& getter_pos, const _GetterNeg& getter_neg, const ImPlotSpec& spec) {
2568 if (BeginItemEx(label_id, Fitter2<_GetterPos,_GetterNeg>(getter_pos, getter_neg), spec, IMPLOT_AUTO_COL)) {
2569 if (getter_pos.Count <= 0 || getter_neg.Count <= 0) {
2570 EndItem();
2571 return;
2572 }
2573 const ImPlotNextItemData& s = GetItemData();
2574 ImDrawList& draw_list = *GetPlotDrawList();
2575 const ImU32 col = ImGui::GetColorU32( IsColorAuto(spec.LineColor) ? ImGui::GetStyleColorVec4(ImGuiCol_Text) : s.Spec.LineColor );
2576 const bool rend_whisker = s.Spec.Size > 0;
2577 const float half_whisker = s.Spec.Size * 0.5f;
2578 for (int i = 0; i < getter_pos.Count; ++i) {
2579 ImVec2 p1 = PlotToPixels(getter_neg[i],IMPLOT_AUTO,IMPLOT_AUTO);
2580 ImVec2 p2 = PlotToPixels(getter_pos[i],IMPLOT_AUTO,IMPLOT_AUTO);
2581 draw_list.AddLine(p1, p2, col, s.Spec.LineWeight);
2582 if (rend_whisker) {
2583 draw_list.AddLine(p1 - ImVec2(0, half_whisker), p1 + ImVec2(0, half_whisker), col, s.Spec.LineWeight);
2584 draw_list.AddLine(p2 - ImVec2(0, half_whisker), p2 + ImVec2(0, half_whisker), col, s.Spec.LineWeight);
2585 }
2586 }
2587 EndItem();
2588 }
2589}
2590
2591template <typename T>
2592void PlotErrorBars(const char* label_id, const T* xs, const T* ys, const T* err, int count, const ImPlotSpec& spec) {

Callers 1

PlotErrorBarsFunction · 0.85

Calls 8

BeginItemExFunction · 0.85
EndItemFunction · 0.85
GetPlotDrawListFunction · 0.85
IsColorAutoFunction · 0.85
GetStyleColorVec4Function · 0.85
PlotToPixelsFunction · 0.85
ImVec2Function · 0.85
AddLineMethod · 0.45

Tested by

no test coverage detected