(old_node, old_feat, new_node, new_feat, mesh, stime=False)
| 548 | return my_fpath_map, my_npath_map, disp_diff |
| 549 | |
| 550 | def refresh_node(old_node, old_feat, new_node, new_feat, mesh, stime=False): |
| 551 | mesh.add_node(new_node) |
| 552 | mesh.nodes[new_node].update(new_feat) |
| 553 | mesh.nodes[new_node].update(old_feat) |
| 554 | for ne in mesh.neighbors(old_node): |
| 555 | mesh.add_edge(new_node, ne) |
| 556 | if mesh.nodes[new_node].get('far') is not None: |
| 557 | tmp_far_nodes = mesh.nodes[new_node]['far'] |
| 558 | for far_node in tmp_far_nodes: |
| 559 | if mesh.has_node(far_node) is False: |
| 560 | mesh.nodes[new_node]['far'].remove(far_node) |
| 561 | continue |
| 562 | if mesh.nodes[far_node].get('near') is not None: |
| 563 | for idx in range(len(mesh.nodes[far_node].get('near'))): |
| 564 | if mesh.nodes[far_node]['near'][idx][0] == new_node[0] and mesh.nodes[far_node]['near'][idx][1] == new_node[1]: |
| 565 | if len(mesh.nodes[far_node]['near'][idx]) == len(old_node): |
| 566 | mesh.nodes[far_node]['near'][idx] = new_node |
| 567 | if mesh.nodes[new_node].get('near') is not None: |
| 568 | tmp_near_nodes = mesh.nodes[new_node]['near'] |
| 569 | for near_node in tmp_near_nodes: |
| 570 | if mesh.has_node(near_node) is False: |
| 571 | mesh.nodes[new_node]['near'].remove(near_node) |
| 572 | continue |
| 573 | if mesh.nodes[near_node].get('far') is not None: |
| 574 | for idx in range(len(mesh.nodes[near_node].get('far'))): |
| 575 | if mesh.nodes[near_node]['far'][idx][0] == new_node[0] and mesh.nodes[near_node]['far'][idx][1] == new_node[1]: |
| 576 | if len(mesh.nodes[near_node]['far'][idx]) == len(old_node): |
| 577 | mesh.nodes[near_node]['far'][idx] = new_node |
| 578 | if new_node != old_node: |
| 579 | mesh.remove_node(old_node) |
| 580 | if stime is False: |
| 581 | return mesh |
| 582 | else: |
| 583 | return mesh, None, None |
| 584 | |
| 585 | |
| 586 | def create_placeholder(context, mask, depth, fpath_map, npath_map, mesh, inpaint_id, edge_ccs, extend_edge_cc, all_edge_maps, self_edge_id): |
no test coverage detected