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

Function PlotErrorBarsVEx

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

Source from the content-addressed store, hash-verified

2540
2541template <typename _GetterPos, typename _GetterNeg>
2542void PlotErrorBarsVEx(const char* label_id, const _GetterPos& getter_pos, const _GetterNeg& getter_neg, const ImPlotSpec& spec) {
2543 if (BeginItemEx(label_id, Fitter2<_GetterPos,_GetterNeg>(getter_pos, getter_neg), spec, IMPLOT_AUTO_COL)) {
2544 if (getter_pos.Count <= 0 || getter_neg.Count <= 0) {
2545 EndItem();
2546 return;
2547 }
2548 const ImPlotNextItemData& s = GetItemData();
2549 ImDrawList& draw_list = *GetPlotDrawList();
2550 const ImU32 col = ImGui::GetColorU32( IsColorAuto(spec.LineColor) ? ImGui::GetStyleColorVec4(ImGuiCol_Text) : s.Spec.LineColor );
2551 const bool rend_whisker = s.Spec.Size > 0;
2552 const float half_whisker = s.Spec.Size * 0.5f;
2553 for (int i = 0; i < getter_pos.Count; ++i) {
2554 ImVec2 p1 = PlotToPixels(getter_neg[i],IMPLOT_AUTO,IMPLOT_AUTO);
2555 ImVec2 p2 = PlotToPixels(getter_pos[i],IMPLOT_AUTO,IMPLOT_AUTO);
2556 draw_list.AddLine(p1,p2,col, s.Spec.LineWeight);
2557 if (rend_whisker) {
2558 draw_list.AddLine(p1 - ImVec2(half_whisker, 0), p1 + ImVec2(half_whisker, 0), col, s.Spec.LineWeight);
2559 draw_list.AddLine(p2 - ImVec2(half_whisker, 0), p2 + ImVec2(half_whisker, 0), col, s.Spec.LineWeight);
2560 }
2561 }
2562 EndItem();
2563 }
2564}
2565
2566template <typename _GetterPos, typename _GetterNeg>
2567void PlotErrorBarsHEx(const char* label_id, const _GetterPos& getter_pos, const _GetterNeg& getter_neg, 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