| 2624 | } |
| 2625 | |
| 2626 | void vtkReebGraph::Implementation::SimplifyLabels( |
| 2627 | const vtkIdType nodeId, vtkReebLabelTag onlyLabel, bool goDown, bool goUp) |
| 2628 | { |
| 2629 | int L, Lnext; |
| 2630 | vtkReebLabel* l; |
| 2631 | vtkReebNode* n = this->GetNode(nodeId); |
| 2632 | |
| 2633 | // I remove all Labels (paths) which start from me |
| 2634 | if (goDown) |
| 2635 | { |
| 2636 | int Anext; |
| 2637 | for (vtkIdType A = n->ArcDownId; A; A = Anext) |
| 2638 | { |
| 2639 | Anext = this->GetArc(A)->ArcDwId1; |
| 2640 | for (L = this->GetArc(A)->LabelId0; L; L = Lnext) |
| 2641 | { |
| 2642 | Lnext = this->GetLabel(L)->HNext; |
| 2643 | |
| 2644 | if (!(l = this->GetLabel(L))->VNext) //...starts from me! |
| 2645 | { |
| 2646 | if (!onlyLabel || onlyLabel == this->GetLabel(L)->label) |
| 2647 | { |
| 2648 | int Lprev; |
| 2649 | for (int Lcur = L; Lcur; Lcur = Lprev) |
| 2650 | { |
| 2651 | vtkReebLabel* lcur = this->GetLabel(Lcur); |
| 2652 | Lprev = lcur->VPrev; |
| 2653 | int CurA = lcur->ArcId; |
| 2654 | if (lcur->HPrev) |
| 2655 | this->GetLabel(lcur->HPrev)->HNext = lcur->HNext; |
| 2656 | else |
| 2657 | this->GetArc(CurA)->LabelId0 = lcur->HNext; |
| 2658 | if (lcur->HNext) |
| 2659 | this->GetLabel(lcur->HNext)->HPrev = lcur->HPrev; |
| 2660 | else |
| 2661 | this->GetArc(CurA)->LabelId1 = lcur->HPrev; |
| 2662 | |
| 2663 | // delete the label |
| 2664 | this->GetLabel(Lcur)->HNext = -2; |
| 2665 | this->GetLabel(Lcur)->ArcId = this->MainLabelTable.FreeZone; |
| 2666 | this->MainLabelTable.FreeZone = (Lcur); |
| 2667 | --(this->MainLabelTable.Number); |
| 2668 | } |
| 2669 | } |
| 2670 | } |
| 2671 | } |
| 2672 | } |
| 2673 | } |
| 2674 | |
| 2675 | // Remove all Labels (paths) which start from here |
| 2676 | |
| 2677 | if (goUp && !(this->GetNode(nodeId)->ArcUpId == -2)) |
| 2678 | { |
| 2679 | int Anext; |
| 2680 | for (vtkIdType A = n->ArcUpId; A; A = Anext) |
| 2681 | { |
| 2682 | Anext = this->GetArc(A)->ArcDwId0; |
| 2683 | for (L = this->GetArc(A)->LabelId0; L; L = Lnext) |
no test coverage detected