| 613 | } |
| 614 | |
| 615 | std::pair<QuadContourGenerator::vertices_list_type, |
| 616 | QuadContourGenerator::codes_list_type> |
| 617 | QuadContourGenerator::create_filled_contour(const double &lower_level, |
| 618 | const double &upper_level) { |
| 619 | init_cache_levels(lower_level, upper_level); |
| 620 | |
| 621 | Contour contour; |
| 622 | |
| 623 | vertices_list_type vertices; |
| 624 | codes_list_type codes; |
| 625 | |
| 626 | // for each chunk |
| 627 | long ichunk, jchunk, istart, iend, jstart, jend; |
| 628 | for (long ijchunk = 0; ijchunk < _chunk_count; ++ijchunk) { |
| 629 | get_chunk_limits(ijchunk, ichunk, jchunk, istart, iend, jstart, |
| 630 | jend); |
| 631 | _parent_cache.set_chunk_starts(istart, jstart); |
| 632 | |
| 633 | // iterate quads |
| 634 | for (long j = jstart; j < jend; ++j) { |
| 635 | long quad_end = iend + j * _nx; |
| 636 | for (long quad = istart + j * _nx; quad < quad_end; ++quad) { |
| 637 | if (!EXISTS_NONE(quad)) |
| 638 | single_quad_filled(contour, quad, lower_level, |
| 639 | upper_level); |
| 640 | } |
| 641 | } |
| 642 | |
| 643 | // Clear VISITED_W and VISITED_S flags that are reused by later |
| 644 | // chunks. |
| 645 | if (jchunk < _nychunk - 1) { |
| 646 | long quad_end = iend + jend * _nx; |
| 647 | for (long quad = istart + jend * _nx; quad < quad_end; ++quad) |
| 648 | _cache[quad] &= ~MASK_VISITED_S; |
| 649 | } |
| 650 | |
| 651 | if (ichunk < _nxchunk - 1) { |
| 652 | long quad_end = iend + jend * _nx; |
| 653 | for (long quad = iend + jstart * _nx; quad < quad_end; |
| 654 | quad += _nx) |
| 655 | _cache[quad] &= ~MASK_VISITED_W; |
| 656 | } |
| 657 | |
| 658 | // Create python objects to return for this chunk. |
| 659 | append_contour_to_vertices_and_codes(contour, vertices, codes); |
| 660 | } |
| 661 | |
| 662 | return std::make_pair(vertices, codes); |
| 663 | } |
| 664 | |
| 665 | XY QuadContourGenerator::edge_interp(const QuadEdge &quad_edge, |
| 666 | const double &level) { |
no test coverage detected