MCPcopy Create free account
hub / github.com/ColdGrub1384/Pyto / find_interior_lines

Method find_interior_lines

site-packages/matplotlib/tri/_tri.cpp:797–832  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

795}
796
797void TriContourGenerator::find_interior_lines(Contour& contour,
798 const double& level,
799 bool on_upper,
800 bool filled)
801{
802 const Triangulation& triang = _triangulation;
803 int ntri = triang.get_ntri();
804 for (int tri = 0; tri < ntri; ++tri) {
805 int visited_index = (on_upper ? tri+ntri : tri);
806
807 if (_interior_visited[visited_index] || triang.is_masked(tri))
808 continue; // Triangle has already been visited or is masked.
809
810 _interior_visited[visited_index] = true;
811
812 // Determine edge via which to leave this triangle.
813 int edge = get_exit_edge(tri, level, on_upper);
814 assert(edge >= -1 && edge < 3 && "Invalid exit edge");
815 if (edge == -1)
816 continue; // Contour does not pass through this triangle.
817
818 // Found start of new contour line loop.
819 contour.push_back(ContourLine());
820 ContourLine& contour_line = contour.back();
821 TriEdge tri_edge = triang.get_neighbor_edge(tri, edge);
822 follow_interior(contour_line, tri_edge, false, level, on_upper);
823
824 if (!filled)
825 // Non-filled contour lines must be closed.
826 contour_line.push_back(contour_line.front());
827 else if (contour_line.size() > 1 &&
828 contour_line.front() == contour_line.back())
829 // Filled contour lines must not have same first and last points.
830 contour_line.pop_back();
831 }
832}
833
834bool TriContourGenerator::follow_boundary(ContourLine& contour_line,
835 TriEdge& tri_edge,

Callers

nothing calls this directly

Calls 8

assertFunction · 0.85
ContourLineClass · 0.85
get_ntriMethod · 0.80
is_maskedMethod · 0.80
get_neighbor_edgeMethod · 0.80
push_backMethod · 0.45
backMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected