@@ -195,16 +195,16 @@ void AddTextCentered(ImDrawList* draw_list, ImVec2 top_center, ImU32 col, const
195195ImVec2 GetLocationPos (const ImRect& outer_rect, const ImVec2& inner_size, ImPlot3DLocation loc, const ImVec2& pad) {
196196 ImVec2 pos;
197197 // Legend x coordinate
198- if (ImHasFlag (loc, ImPlot3DLocation_West) && !ImHasFlag (loc, ImPlot3DLocation_East))
198+ if (ImPlot3D:: ImHasFlag (loc, ImPlot3DLocation_West) && !ImPlot3D:: ImHasFlag (loc, ImPlot3DLocation_East))
199199 pos.x = outer_rect.Min .x + pad.x ;
200- else if (!ImHasFlag (loc, ImPlot3DLocation_West) && ImHasFlag (loc, ImPlot3DLocation_East))
200+ else if (!ImPlot3D:: ImHasFlag (loc, ImPlot3DLocation_West) && ImPlot3D:: ImHasFlag (loc, ImPlot3DLocation_East))
201201 pos.x = outer_rect.Max .x - pad.x - inner_size.x ;
202202 else
203203 pos.x = outer_rect.GetCenter ().x - inner_size.x * 0 .5f ;
204204 // Legend y coordinate
205- if (ImHasFlag (loc, ImPlot3DLocation_North) && !ImHasFlag (loc, ImPlot3DLocation_South))
205+ if (ImPlot3D:: ImHasFlag (loc, ImPlot3DLocation_North) && !ImPlot3D:: ImHasFlag (loc, ImPlot3DLocation_South))
206206 pos.y = outer_rect.Min .y + pad.y ;
207- else if (!ImHasFlag (loc, ImPlot3DLocation_North) && ImHasFlag (loc, ImPlot3DLocation_South))
207+ else if (!ImPlot3D:: ImHasFlag (loc, ImPlot3DLocation_North) && ImPlot3D:: ImHasFlag (loc, ImPlot3DLocation_South))
208208 pos.y = outer_rect.Max .y - pad.y - inner_size.y ;
209209 else
210210 pos.y = outer_rect.GetCenter ().y - inner_size.y * 0 .5f ;
@@ -267,18 +267,18 @@ void ShowLegendEntries(ImPlot3DItemGroup& items, const ImRect& legend_bb, bool h
267267
268268 bool item_hov = false ;
269269 bool item_hld = false ;
270- bool item_clk = ImHasFlag (items.Legend .Flags , ImPlot3DLegendFlags_NoButtons)
270+ bool item_clk = ImPlot3D:: ImHasFlag (items.Legend .Flags , ImPlot3DLegendFlags_NoButtons)
271271 ? false
272272 : ImGui::ButtonBehavior (button_bb, item->ID , &item_hov, &item_hld);
273273
274274 if (item_clk)
275275 item->Show = !item->Show ;
276276
277- const bool hovering = item_hov && !ImHasFlag (items.Legend .Flags , ImPlot3DLegendFlags_NoHighlightItem);
277+ const bool hovering = item_hov && !ImPlot3D:: ImHasFlag (items.Legend .Flags , ImPlot3DLegendFlags_NoHighlightItem);
278278
279279 if (hovering) {
280280 item->LegendHovered = true ;
281- col_txt_hl = ImMixU32 (col_txt, col_item, 64 );
281+ col_txt_hl = ImPlot3D:: ImMixU32 (col_txt, col_item, 64 );
282282 } else {
283283 item->LegendHovered = false ;
284284 col_txt_hl = ImGui::GetColorU32 (col_txt);
@@ -302,15 +302,15 @@ void ShowLegendEntries(ImPlot3DItemGroup& items, const ImRect& legend_bb, bool h
302302void RenderLegend () {
303303 ImPlot3DContext& gp = *GImPlot3D;
304304 ImPlot3DPlot& plot = *gp.CurrentPlot ;
305- if (ImHasFlag (plot.Flags , ImPlot3DFlags_NoLegend) || plot.Items .GetLegendCount () == 0 )
305+ if (ImPlot3D:: ImHasFlag (plot.Flags , ImPlot3DFlags_NoLegend) || plot.Items .GetLegendCount () == 0 )
306306 return ;
307307 ImGuiContext& g = *GImGui;
308308 ImGuiWindow* window = g.CurrentWindow ;
309309 ImDrawList* draw_list = window->DrawList ;
310310 const ImGuiIO& IO = ImGui::GetIO ();
311311
312312 ImPlot3DLegend& legend = plot.Items .Legend ;
313- const bool legend_horz = ImHasFlag (legend.Flags , ImPlot3DLegendFlags_Horizontal);
313+ const bool legend_horz = ImPlot3D:: ImHasFlag (legend.Flags , ImPlot3DLegendFlags_Horizontal);
314314 const ImVec2 legend_size = CalcLegendSize (plot.Items , gp.Style .LegendInnerPadding , gp.Style .LegendSpacing , !legend_horz);
315315 const ImVec2 legend_pos = GetLocationPos (plot.PlotRect ,
316316 legend_size,
@@ -338,7 +338,7 @@ void RenderLegend() {
338338void RenderMousePos () {
339339 ImPlot3DContext& gp = *GImPlot3D;
340340 ImPlot3DPlot& plot = *gp.CurrentPlot ;
341- if (ImHasFlag (plot.Flags , ImPlot3DFlags_NoMouseText))
341+ if (ImPlot3D:: ImHasFlag (plot.Flags , ImPlot3DFlags_NoMouseText))
342342 return ;
343343
344344 ImVec2 mouse_pos = ImGui::GetMousePos ();
@@ -587,7 +587,7 @@ void RenderGrid(ImDrawList* draw_list, const ImPlot3DPlot& plot, const ImPlot3DP
587587 ImPlot3DPoint v_vec = p3 - p0;
588588
589589 // Render grid lines along u axis (axis_u)
590- if (!ImHasFlag (axis_u.Flags , ImPlot3DAxisFlags_NoGridLines))
590+ if (!ImPlot3D:: ImHasFlag (axis_u.Flags , ImPlot3DAxisFlags_NoGridLines))
591591 for (int t = 0 ; t < axis_u.Ticker .TickCount (); ++t) {
592592 const ImPlot3DTick& tick = axis_u.Ticker .Ticks [t];
593593
@@ -608,7 +608,7 @@ void RenderGrid(ImDrawList* draw_list, const ImPlot3DPlot& plot, const ImPlot3DP
608608 }
609609
610610 // Render grid lines along v axis (axis_v)
611- if (!ImHasFlag (axis_v.Flags , ImPlot3DAxisFlags_NoGridLines))
611+ if (!ImPlot3D:: ImHasFlag (axis_v.Flags , ImPlot3DAxisFlags_NoGridLines))
612612 for (int t = 0 ; t < axis_v.Ticker .TickCount (); ++t) {
613613 const ImPlot3DTick& tick = axis_v.Ticker .Ticks [t];
614614
@@ -647,7 +647,7 @@ void RenderTickMarks(ImDrawList* draw_list, const ImPlot3DPlot& plot, const ImPl
647647
648648 for (int a = 0 ; a < 3 ; a++) {
649649 const ImPlot3DAxis& axis = plot.Axes [a];
650- if (ImHasFlag (axis.Flags , ImPlot3DAxisFlags_NoTickMarks))
650+ if (ImPlot3D:: ImHasFlag (axis.Flags , ImPlot3DAxisFlags_NoTickMarks))
651651 continue ;
652652
653653 int idx0 = axis_corners[a][0 ];
@@ -739,7 +739,7 @@ void RenderTickLabels(ImDrawList* draw_list, const ImPlot3DPlot& plot, const ImP
739739
740740 for (int a = 0 ; a < 3 ; a++) {
741741 const ImPlot3DAxis& axis = plot.Axes [a];
742- if (ImHasFlag (axis.Flags , ImPlot3DAxisFlags_NoTickLabels))
742+ if (ImPlot3D:: ImHasFlag (axis.Flags , ImPlot3DAxisFlags_NoTickLabels))
743743 continue ;
744744
745745 // Corner indices for this axis
@@ -1119,10 +1119,10 @@ bool ShowLegendContextMenu(ImPlot3DLegend& legend, bool visible) {
11191119 bool ret = false ;
11201120 if (ImGui::Checkbox (" Show" , &visible))
11211121 ret = true ;
1122- if (ImGui::RadioButton (" H" , ImHasFlag (legend.Flags , ImPlot3DLegendFlags_Horizontal)))
1122+ if (ImGui::RadioButton (" H" , ImPlot3D:: ImHasFlag (legend.Flags , ImPlot3DLegendFlags_Horizontal)))
11231123 legend.Flags |= ImPlot3DLegendFlags_Horizontal;
11241124 ImGui::SameLine ();
1125- if (ImGui::RadioButton (" V" , !ImHasFlag (legend.Flags , ImPlot3DLegendFlags_Horizontal)))
1125+ if (ImGui::RadioButton (" V" , !ImPlot3D:: ImHasFlag (legend.Flags , ImPlot3DLegendFlags_Horizontal)))
11261126 legend.Flags &= ~ImPlot3DLegendFlags_Horizontal;
11271127 ImGui::PushStyleVar (ImGuiStyleVar_ItemSpacing, ImVec2 (2 , 2 ));
11281128 // clang-format off
@@ -1211,7 +1211,7 @@ void ShowPlotContextMenu(ImPlot3DPlot& plot) {
12111211
12121212 ImGui::Separator ();
12131213 if ((ImGui::BeginMenu (" Legend" ))) {
1214- if (ShowLegendContextMenu (plot.Items .Legend , !ImHasFlag (plot.Flags , ImPlot3DFlags_NoLegend)))
1214+ if (ShowLegendContextMenu (plot.Items .Legend , !ImPlot3D:: ImHasFlag (plot.Flags , ImPlot3DFlags_NoLegend)))
12151215 ImFlipFlag (plot.Flags , ImPlot3DFlags_NoLegend);
12161216 ImGui::EndMenu ();
12171217 }
@@ -1332,7 +1332,7 @@ void EndPlot() {
13321332 if (ImGui::BeginPopup (" ##LegendContext" )) {
13331333 ImGui::Text (" Legend" );
13341334 ImGui::Separator ();
1335- if (ShowLegendContextMenu (plot.Items .Legend , !ImHasFlag (plot.Flags , ImPlot3DFlags_NoLegend)))
1335+ if (ShowLegendContextMenu (plot.Items .Legend , !ImPlot3D:: ImHasFlag (plot.Flags , ImPlot3DFlags_NoLegend)))
13361336 ImFlipFlag (plot.Flags , ImPlot3DFlags_NoLegend);
13371337 ImGui::EndPopup ();
13381338 }
@@ -2531,7 +2531,7 @@ ImPlot3DPoint operator*(float lhs, const ImPlot3DPoint& rhs) {
25312531}
25322532
25332533bool ImPlot3DPoint::IsNaN () const {
2534- return ImNan (x) || ImNan (y) || ImNan (z);
2534+ return ImPlot3D:: ImNan (x) || ImPlot3D:: ImNan (y) || ImPlot3D:: ImNan (z);
25352535}
25362536
25372537// -----------------------------------------------------------------------------
@@ -2906,23 +2906,23 @@ void ImDrawList3D::SortedMoveToImGuiDrawList() {
29062906// [SECTION] ImPlot3DAxis
29072907// -----------------------------------------------------------------------------
29082908
2909- bool ImPlot3DAxis::HasLabel () const { return !Label.empty () && !ImHasFlag (Flags, ImPlot3DAxisFlags_NoLabel); }
2910- bool ImPlot3DAxis::HasGridLines () const { return !ImHasFlag (Flags, ImPlot3DAxisFlags_NoGridLines); }
2911- bool ImPlot3DAxis::HasTickLabels () const { return !ImHasFlag (Flags, ImPlot3DAxisFlags_NoTickLabels); }
2912- bool ImPlot3DAxis::HasTickMarks () const { return !ImHasFlag (Flags, ImPlot3DAxisFlags_NoTickMarks); }
2913- bool ImPlot3DAxis::IsAutoFitting () const { return ImHasFlag (Flags, ImPlot3DAxisFlags_AutoFit); }
2909+ bool ImPlot3DAxis::HasLabel () const { return !Label.empty () && !ImPlot3D:: ImHasFlag (Flags, ImPlot3DAxisFlags_NoLabel); }
2910+ bool ImPlot3DAxis::HasGridLines () const { return !ImPlot3D:: ImHasFlag (Flags, ImPlot3DAxisFlags_NoGridLines); }
2911+ bool ImPlot3DAxis::HasTickLabels () const { return !ImPlot3D:: ImHasFlag (Flags, ImPlot3DAxisFlags_NoTickLabels); }
2912+ bool ImPlot3DAxis::HasTickMarks () const { return !ImPlot3D:: ImHasFlag (Flags, ImPlot3DAxisFlags_NoTickMarks); }
2913+ bool ImPlot3DAxis::IsAutoFitting () const { return ImPlot3D:: ImHasFlag (Flags, ImPlot3DAxisFlags_AutoFit); }
29142914
29152915void ImPlot3DAxis::ExtendFit (float value) {
29162916 FitExtents.Min = ImMin (FitExtents.Min , value);
29172917 FitExtents.Max = ImMax (FitExtents.Max , value);
29182918}
29192919
29202920void ImPlot3DAxis::ApplyFit () {
2921- if (!IsLockedMin () && !ImNanOrInf (FitExtents.Min ))
2921+ if (!IsLockedMin () && !ImPlot3D:: ImNanOrInf (FitExtents.Min ))
29222922 Range.Min = FitExtents.Min ;
2923- if (!IsLockedMax () && !ImNanOrInf (FitExtents.Max ))
2923+ if (!IsLockedMax () && !ImPlot3D:: ImNanOrInf (FitExtents.Max ))
29242924 Range.Max = FitExtents.Max ;
2925- if (ImAlmostEqual (Range.Min , Range.Max )) {
2925+ if (ImPlot3D:: ImAlmostEqual (Range.Min , Range.Max )) {
29262926 Range.Max += 0.5 ;
29272927 Range.Min -= 0.5 ;
29282928 }
@@ -2944,7 +2944,7 @@ float ImPlot3DAxis::NDCToPlot(float value) const {
29442944
29452945void ImPlot3DPlot::ExtendFit (const ImPlot3DPoint& point) {
29462946 for (int i = 0 ; i < 3 ; i++) {
2947- if (!ImNanOrInf (point[i]) && Axes[i].FitThisFrame )
2947+ if (!ImPlot3D:: ImNanOrInf (point[i]) && Axes[i].FitThisFrame )
29482948 Axes[i].ExtendFit (point[i]);
29492949 }
29502950}
0 commit comments