| 172 | } |
| 173 | |
| 174 | void |
| 175 | VisualNode::labelPath(NodeAllocator& na, |
| 176 | BestNode* curBest, int c_d, int a_d) { |
| 177 | if (na.hasLabel(this)) { |
| 178 | // clear labels on path to root |
| 179 | VisualNode* p = this; |
| 180 | while (p) { |
| 181 | na.clearLabel(p); |
| 182 | p = p->getParent(na); |
| 183 | } |
| 184 | } else { |
| 185 | // set labels on path to root |
| 186 | std::vector<std::pair<VisualNode*,int> > path; |
| 187 | VisualNode* p = this; |
| 188 | while (p) { |
| 189 | path.push_back(std::pair<VisualNode*,int>(p,p->getAlternative(na))); |
| 190 | p = p->getParent(na); |
| 191 | } |
| 192 | while (!path.empty()) { |
| 193 | std::pair<VisualNode*,int> cur = path.back(); path.pop_back(); |
| 194 | if (p) { |
| 195 | std::string l = |
| 196 | cur.first->getBranchLabel(na,p,p->getChoice(), |
| 197 | curBest,c_d,a_d,cur.second); |
| 198 | na.setLabel(cur.first,QString(l.c_str())); |
| 199 | } |
| 200 | p = cur.first; |
| 201 | } |
| 202 | } |
| 203 | dirtyUp(na); |
| 204 | } |
| 205 | |
| 206 | void |
| 207 | VisualNode::unhideAll(const NodeAllocator& na) { |
nothing calls this directly
no test coverage detected