| 134 | void checkGraphNodeSplit() { |
| 135 | TEMPLATE_GRAPH_TYPEDEFS(Graph); |
| 136 | |
| 137 | Graph G; |
| 138 | Node n0 = G.addNode(), |
| 139 | n1 = G.addNode(), |
| 140 | n2 = G.addNode(), |
| 141 | n3 = G.addNode(), |
| 142 | n4 = G.addNode(); |
| 143 | Edge a0 = G.addEdge(n4,n3,INVALID,INVALID), |
| 144 | a1 = G.addEdge(n4,n0,a0,INVALID), |
| 145 | a2 = G.addEdge(n1,n4,INVALID,a1), |
| 146 | a3 = G.addEdge(n4,n2,a2,INVALID), |
| 147 | a4 = G.addEdge(n2,n3,a3,a0); |
| 148 | |
| 149 | checkGraphNodeList(G, 5); |
| 150 | checkGraphEdgeList(G, 5); |
| 151 | checkGraphArcList(G, 10); |
| 152 | checkGraphFaceList(G, 2); |
| 153 | |
| 154 | checkGraphIncEdgeArcLists(G, n0, 1); |
| 155 | checkGraphIncEdgeArcLists(G, n1, 1); |
| 156 | checkGraphIncEdgeArcLists(G, n2, 2); |
| 157 | checkGraphIncEdgeArcLists(G, n3, 2); |
| 158 | checkGraphIncEdgeArcLists(G, n4, 4); |
| 159 | |
| 160 | checkGraphBoundaryArcList(G, G.leftFace(G.direct(a0,false)), 3); |
| 161 | checkGraphBoundaryArcList(G, G.leftFace(G.direct(a0,true)), 7); |
| 162 | |
| 163 | Node n5 = G.split(n4,a3,a1,true); |
| 164 | |
| 165 | checkGraphNodeList(G, 6); |
| 166 | checkGraphEdgeList(G, 6); |
| 167 | checkGraphArcList(G, 12); |
| 168 | checkGraphFaceList(G, 2); |
| 169 | |
| 170 | checkGraphIncEdgeArcLists(G, n0, 1); |
| 171 | checkGraphIncEdgeArcLists(G, n1, 1); |
| 172 | checkGraphIncEdgeArcLists(G, n2, 2); |
| 173 | checkGraphIncEdgeArcLists(G, n3, 2); |
| 174 | checkGraphIncEdgeArcLists(G, n4, 3); |
| 175 | checkGraphIncEdgeArcLists(G, n5, 3); |
| 176 | |
| 177 | checkGraphBoundaryArcList(G, G.leftFace(G.direct(a0,false)), 3); |
| 178 | checkGraphBoundaryArcList(G, G.leftFace(G.direct(a0,true)), 9); |
| 179 | } |
| 180 | |
| 181 | template <class Graph> |
| 182 | void checkGraphContract() { |
| 183 | TEMPLATE_GRAPH_TYPEDEFS(Graph); |
| 184 | |
| 185 | Graph G; |
| 186 | Node n0 = G.addNode(), |
| 187 | n1 = G.addNode(), |
| 188 | n2 = G.addNode(), |
| 189 | n3 = G.addNode(); |
| 190 | Edge a0 = G.addEdge(n0,n1,INVALID,INVALID), |
| 191 | a1 = G.addEdge(n0,n1,a0,a0), |
| 192 | a2 = G.addEdge(n0,n1,a1,a0), |
| 193 | a3 = G.addEdge(n0,n2,a1,INVALID), |
| 194 | a4 = G.addEdge(n0,n3,a3,INVALID), |
| 195 | a5 = G.addEdge(n2,n1,a3,a2), |
| 196 | a6 = G.addEdge(n3,n1,a4,a2); |
| 197 | |
| 198 | checkGraphNodeList(G, 4); |
| 199 | checkGraphEdgeList(G, 7); |
| 200 | checkGraphArcList(G, 14); |
| 201 | checkGraphFaceList(G, 5); |
| 202 | |
| 203 | checkGraphIncEdgeArcLists(G, n0, 5); |
| 204 | checkGraphIncEdgeArcLists(G, n1, 5); |
| 205 | checkGraphIncEdgeArcLists(G, n2, 2); |
| 206 | checkGraphIncEdgeArcLists(G, n3, 2); |
| 207 | |
| 208 | checkGraphBoundaryArcList(G, G.leftFace(G.direct(a0,false)), 2); |
| 209 | checkGraphBoundaryArcList(G, G.leftFace(G.direct(a0,true)), 2); |
| 210 | checkGraphBoundaryArcList(G, G.leftFace(G.direct(a1,true)), 3); |
| 211 | checkGraphBoundaryArcList(G, G.leftFace(G.direct(a2,false)), 3); |
| 212 | checkGraphBoundaryArcList(G, G.leftFace(G.direct(a3,true)), 4); |
| 213 | |
| 214 | G.contract(a0); |
| 215 | |
| 216 | checkGraphNodeList(G, 3); |
| 217 | checkGraphEdgeList(G, 6); |
| 218 | checkGraphArcList(G, 12); |
| 219 | checkGraphFaceList(G, 5); |
| 220 | |
| 221 | checkGraphIncEdgeArcLists(G, n0, 8); |
| 222 | checkGraphIncEdgeArcLists(G, n2, 2); |
| 223 | checkGraphIncEdgeArcLists(G, n3, 2); |
| 224 | |
| 225 | checkGraphBoundaryArcList(G, G.leftFace(G.direct(a1,false)), 1); |
| 226 | checkGraphBoundaryArcList(G, G.leftFace(G.direct(a2,true)), 1); |
| 227 | checkGraphBoundaryArcList(G, G.leftFace(G.direct(a1,true)), 3); |
| 228 | checkGraphBoundaryArcList(G, G.leftFace(G.direct(a2,false)), 3); |
| 229 | checkGraphBoundaryArcList(G, G.leftFace(G.direct(a3,true)), 4); |
| 230 | |
| 231 | } |
| 232 | |
| 233 | template <class Graph> |