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

Method follow_interior

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

Source from the content-addressed store, hash-verified

896}
897
898void TriContourGenerator::follow_interior(ContourLine& contour_line,
899 TriEdge& tri_edge,
900 bool end_on_boundary,
901 const double& level,
902 bool on_upper)
903{
904 int& tri = tri_edge.tri;
905 int& edge = tri_edge.edge;
906
907 // Initial point.
908 contour_line.push_back(edge_interp(tri, edge, level));
909
910 while (true) {
911 int visited_index = tri;
912 if (on_upper)
913 visited_index += _triangulation.get_ntri();
914
915 // Check for end not on boundary.
916 if (!end_on_boundary && _interior_visited[visited_index])
917 break; // Reached start point, so return.
918
919 // Determine edge by which to leave this triangle.
920 edge = get_exit_edge(tri, level, on_upper);
921 assert(edge >= 0 && edge < 3 && "Invalid exit edge");
922
923 _interior_visited[visited_index] = true;
924
925 // Append new point to point set.
926 assert(edge >= 0 && edge < 3 && "Invalid triangle edge");
927 contour_line.push_back(edge_interp(tri, edge, level));
928
929 // Move to next triangle.
930 TriEdge next_tri_edge = _triangulation.get_neighbor_edge(tri,edge);
931
932 // Check if ending on a boundary.
933 if (end_on_boundary && next_tri_edge.tri == -1)
934 break;
935
936 tri_edge = next_tri_edge;
937 assert(tri_edge.tri != -1 && "Invalid triangle for internal loop");
938 }
939}
940
941const TriContourGenerator::Boundaries& TriContourGenerator::get_boundaries() const
942{

Callers

nothing calls this directly

Calls 4

assertFunction · 0.85
get_ntriMethod · 0.80
get_neighbor_edgeMethod · 0.80
push_backMethod · 0.45

Tested by

no test coverage detected