| 783 | } |
| 784 | |
| 785 | void RenderPlotBorder(ImDrawList* draw_list, const ImPlot3DPlot&, const ImVec2* corners_pix, const bool* active_faces, const int plane_2d) { |
| 786 | // Determine which edges to render (all visible edges) |
| 787 | bool render_edge[12]; |
| 788 | for (int i = 0; i < 12; i++) |
| 789 | render_edge[i] = false; |
| 790 | for (int a = 0; a < 3; a++) { |
| 791 | int face_idx = a + 3 * active_faces[a]; |
| 792 | if (plane_2d != -1 && a != plane_2d) |
| 793 | continue; |
| 794 | for (size_t i = 0; i < 4; i++) |
| 795 | render_edge[face_edges[face_idx][i]] = true; |
| 796 | } |
| 797 | |
| 798 | // Render edge lines (all visible edges) |
| 799 | ImU32 col_bd = GetStyleColorU32(ImPlot3DCol_PlotBorder); |
| 800 | for (int i = 0; i < 12; i++) { |
| 801 | if (render_edge[i]) { |
| 802 | int idx0 = edges[i][0]; |
| 803 | int idx1 = edges[i][1]; |
| 804 | draw_list->AddLine(corners_pix[idx0], corners_pix[idx1], col_bd, 1.0f); |
| 805 | } |
| 806 | } |
| 807 | } |
| 808 | |
| 809 | void RenderGrid(ImDrawList* draw_list, const ImPlot3DPlot& plot, const ImPlot3DPoint* corners, const bool* active_faces, const int plane_2d) { |
| 810 | ImVec4 col_grid = GetStyleColorVec4(ImPlot3DCol_AxisGrid); |
no test coverage detected