------------------------------------------------------------------------------
| 874 | |
| 875 | //------------------------------------------------------------------------------ |
| 876 | vtkIdType vtkReebGraph::Implementation::FindLess( |
| 877 | vtkIdType nodeId, vtkIdType startingNodeId, vtkReebLabelTag label) |
| 878 | { |
| 879 | if (!this->GetNode(nodeId)->IsFinalized) |
| 880 | return 0; |
| 881 | |
| 882 | // base case |
| 883 | if (vtkReebGraphIsSmaller( |
| 884 | this, nodeId, startingNodeId, this->GetNode(nodeId), this->GetNode(startingNodeId))) |
| 885 | return nodeId; |
| 886 | |
| 887 | // iterative case |
| 888 | for (vtkIdType A = this->GetNode(nodeId)->ArcDownId; A; A = this->GetArc(A)->ArcDwId1) |
| 889 | { |
| 890 | vtkReebArc* a = this->GetArc(A); |
| 891 | vtkIdType M = this->GetArc(A)->NodeId0; |
| 892 | vtkReebNode* m = this->GetNode(M); |
| 893 | |
| 894 | if (a->LabelId0 || !m->IsFinalized) // other labels or not final node |
| 895 | continue; |
| 896 | |
| 897 | if ((M = FindLess(M, startingNodeId, label))) |
| 898 | { |
| 899 | if (label) |
| 900 | { |
| 901 | SetLabel(A, label); |
| 902 | } |
| 903 | return M; |
| 904 | } |
| 905 | } |
| 906 | |
| 907 | return 0; |
| 908 | } |
| 909 | |
| 910 | //------------------------------------------------------------------------------ |
| 911 | vtkIdType vtkReebGraph::Implementation::FindJoinNode( |