------------------------------------------------------------------------------
| 837 | |
| 838 | //------------------------------------------------------------------------------ |
| 839 | vtkIdType vtkReebGraph::Implementation::FindGreater( |
| 840 | vtkIdType nodeId, vtkIdType startingNodeId, vtkReebLabelTag label) |
| 841 | { |
| 842 | if (!this->GetNode(nodeId)->IsFinalized) |
| 843 | return 0; |
| 844 | |
| 845 | // base case |
| 846 | if (vtkReebGraphIsHigherThan( |
| 847 | this, nodeId, startingNodeId, this->GetNode(nodeId), this->GetNode(startingNodeId))) |
| 848 | return nodeId; |
| 849 | |
| 850 | // iterative case |
| 851 | for (vtkIdType A = this->GetNode(nodeId)->ArcUpId; A; A = this->GetArc(A)->ArcDwId0) |
| 852 | { |
| 853 | vtkReebArc* a = this->GetArc(A); |
| 854 | vtkIdType M = this->GetArc(A)->NodeId1; |
| 855 | vtkReebNode* m = this->GetNode(M); |
| 856 | |
| 857 | if (a->LabelId0 || !m->IsFinalized) // other labels or not final node |
| 858 | { |
| 859 | continue; |
| 860 | } |
| 861 | |
| 862 | if ((M = FindGreater(M, startingNodeId, label))) |
| 863 | { |
| 864 | if (label) |
| 865 | { |
| 866 | SetLabel(A, label); |
| 867 | } |
| 868 | return M; |
| 869 | } |
| 870 | } |
| 871 | |
| 872 | return 0; |
| 873 | } |
| 874 | |
| 875 | //------------------------------------------------------------------------------ |
| 876 | vtkIdType vtkReebGraph::Implementation::FindLess( |