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

Function PieChartSum

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

Source from the content-addressed store, hash-verified

2897
2898template <typename T>
2899double PieChartSum(IndexerIdx<T> indexer, bool ignore_hidden) {
2900 double sum = 0;
2901 if (ignore_hidden) {
2902 ImPlotContext& gp = *GImPlot;
2903 ImPlotItemGroup& Items = *gp.CurrentItems;
2904 for (int i = 0; i < indexer.Count; ++i) {
2905 if (i >= Items.GetItemCount())
2906 break;
2907
2908 ImPlotItem* item = Items.GetItemByIndex(i);
2909 IM_ASSERT(item != nullptr);
2910 if (item->Show) {
2911 sum += (double)indexer[i];
2912 }
2913 }
2914 }
2915 else {
2916 for (int i = 0; i < indexer.Count; ++i) {
2917 sum += (double)indexer[i];
2918 }
2919 }
2920 return sum;
2921}
2922
2923template <typename T>
2924void PlotPieChartEx(const char* const label_ids[], IndexerIdx<T> indexer, ImPlotPoint center, double radius, double angle0, const ImPlotSpec& spec) {

Callers 2

PlotPieChartExFunction · 0.85
PlotPieChartFunction · 0.85

Calls 2

GetItemCountMethod · 0.80
GetItemByIndexMethod · 0.80

Tested by

no test coverage detected