MCPcopy Create free account
hub / github.com/alandefreitas/matplotplusplus / create_contour

Method create_contour

source/matplot/util/contourc.cpp:512–613  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

510 }
511
512 QuadContourGenerator::vertices_list_type
513 QuadContourGenerator::create_contour(const double &level) {
514 init_cache_levels(level, level);
515
516 vertices_list_type vertices_list;
517
518 // Lines that start and end on boundaries.
519 long ichunk, jchunk, istart, iend, jstart, jend;
520 for (long ijchunk = 0; ijchunk < _chunk_count; ++ijchunk) {
521 get_chunk_limits(ijchunk, ichunk, jchunk, istart, iend, jstart,
522 jend);
523
524 for (long j = jstart; j < jend; ++j) {
525 long quad_end = iend + j * _nx;
526 for (long quad = istart + j * _nx; quad < quad_end; ++quad) {
527 if (EXISTS_NONE(quad) || VISITED(quad, 1))
528 continue;
529
530 if (BOUNDARY_S(quad) && Z_SW >= 1 && Z_SE < 1 &&
531 start_line(vertices_list, quad, Edge::Edge_S, level))
532 continue;
533
534 if (BOUNDARY_W(quad) && Z_NW >= 1 && Z_SW < 1 &&
535 start_line(vertices_list, quad, Edge::Edge_W, level))
536 continue;
537
538 if (BOUNDARY_N(quad) && Z_NE >= 1 && Z_NW < 1 &&
539 start_line(vertices_list, quad, Edge::Edge_N, level))
540 continue;
541
542 if (BOUNDARY_E(quad) && Z_SE >= 1 && Z_NE < 1 &&
543 start_line(vertices_list, quad, Edge::Edge_E, level))
544 continue;
545
546 if (_corner_mask) {
547 // Equates to NE boundary.
548 if (EXISTS_SW_CORNER(quad) && Z_SE >= 1 && Z_NW < 1 &&
549 start_line(vertices_list, quad, Edge::Edge_NE,
550 level))
551 continue;
552
553 // Equates to NW boundary.
554 if (EXISTS_SE_CORNER(quad) && Z_NE >= 1 && Z_SW < 1 &&
555 start_line(vertices_list, quad, Edge::Edge_NW,
556 level))
557 continue;
558
559 // Equates to SE boundary.
560 if (EXISTS_NW_CORNER(quad) && Z_SW >= 1 && Z_NE < 1 &&
561 start_line(vertices_list, quad, Edge::Edge_SE,
562 level))
563 continue;
564
565 // Equates to SW boundary.
566 if (EXISTS_NE_CORNER(quad) && Z_NW >= 1 && Z_SE < 1 &&
567 start_line(vertices_list, quad, Edge::Edge_SW,
568 level))
569 continue;

Callers 2

contour_lineFunction · 0.80

Calls 2

emptyMethod · 0.80
push_backMethod · 0.80

Tested by

no test coverage detected