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

Method get_corner_start_edge

source/matplot/util/contourc.cpp:1000–1088  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

998 }
999
1000 Edge QuadContourGenerator::get_corner_start_edge(
1001 long quad, unsigned int level_index) const {
1002 assert(quad >= 0 && quad < _n && "Quad index out of bounds");
1003 assert((level_index == 1 || level_index == 2) &&
1004 "level index must be 1 or 2");
1005 assert(EXISTS_ANY_CORNER(quad) && "Quad is not a corner");
1006
1007 // Diagram for NE corner. Rotate for other corners.
1008 //
1009 // edge12
1010 // point1 +---------+ point2
1011 // \ |
1012 // \ | edge23
1013 // edge31 \ |
1014 // \ |
1015 // + point3
1016 //
1017 long point1, point2, point3;
1018 Edge edge12, edge23, edge31;
1019 switch (_cache[quad] & MASK_EXISTS) {
1020 case MASK_EXISTS_SW_CORNER:
1021 point1 = POINT_SE;
1022 point2 = POINT_SW;
1023 point3 = POINT_NW;
1024 edge12 = Edge::Edge_S;
1025 edge23 = Edge::Edge_W;
1026 edge31 = Edge::Edge_NE;
1027 break;
1028 case MASK_EXISTS_SE_CORNER:
1029 point1 = POINT_NE;
1030 point2 = POINT_SE;
1031 point3 = POINT_SW;
1032 edge12 = Edge::Edge_E;
1033 edge23 = Edge::Edge_S;
1034 edge31 = Edge::Edge_NW;
1035 break;
1036 case MASK_EXISTS_NW_CORNER:
1037 point1 = POINT_SW;
1038 point2 = POINT_NW;
1039 point3 = POINT_NE;
1040 edge12 = Edge::Edge_W;
1041 edge23 = Edge::Edge_N;
1042 edge31 = Edge::Edge_SE;
1043 break;
1044 case MASK_EXISTS_NE_CORNER:
1045 point1 = POINT_NW;
1046 point2 = POINT_NE;
1047 point3 = POINT_SE;
1048 edge12 = Edge::Edge_N;
1049 edge23 = Edge::Edge_E;
1050 edge31 = Edge::Edge_SW;
1051 break;
1052 default:
1053 assert(0 && "Invalid EXISTS for quad");
1054 return Edge::Edge_None;
1055 }
1056
1057 unsigned int config = (Z_LEVEL(point1) >= level_index) << 2 |

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected