| 297 | } |
| 298 | |
| 299 | void |
| 300 | WriteNodePrivate::placeWriteNodeKnobsInPage() |
| 301 | { |
| 302 | KnobIPtr pageKnob = _publicInterface->getKnobByName("Controls"); |
| 303 | KnobPage* isPage = dynamic_cast<KnobPage*>( pageKnob.get() ); |
| 304 | |
| 305 | if (!isPage) { |
| 306 | return; |
| 307 | } |
| 308 | for (std::list<KnobIWPtr>::iterator it = writeNodeKnobs.begin(); it != writeNodeKnobs.end(); ++it) { |
| 309 | KnobIPtr knob = it->lock(); |
| 310 | knob->setParentKnob( KnobIPtr() ); |
| 311 | isPage->removeKnob( knob.get() ); |
| 312 | } |
| 313 | KnobsVec children = isPage->getChildren(); |
| 314 | int index = -1; |
| 315 | for (std::size_t i = 0; i < children.size(); ++i) { |
| 316 | if (children[i]->getName() == kParamLastFrame) { |
| 317 | index = i; |
| 318 | break; |
| 319 | } |
| 320 | } |
| 321 | if (index != -1) { |
| 322 | ++index; |
| 323 | for (std::list<KnobIWPtr>::iterator it = writeNodeKnobs.begin(); it != writeNodeKnobs.end(); ++it) { |
| 324 | KnobIPtr knob = it->lock(); |
| 325 | isPage->insertKnob(index, knob); |
| 326 | ++index; |
| 327 | } |
| 328 | } |
| 329 | |
| 330 | // Find the separatorKnob in the page and if the next parameter is also a separator, hide it |
| 331 | int foundSep = -1; |
| 332 | for (std::size_t i = 0; i < children.size(); ++i) { |
| 333 | if (children[i]== separatorKnob.lock()) { |
| 334 | foundSep = i; |
| 335 | break; |
| 336 | } |
| 337 | } |
| 338 | if (foundSep != -1) { |
| 339 | ++foundSep; |
| 340 | if (foundSep < (int)children.size()) { |
| 341 | bool isSecret = children[foundSep]->getIsSecret(); |
| 342 | while (isSecret && foundSep < (int)children.size()) { |
| 343 | ++foundSep; |
| 344 | isSecret = children[foundSep]->getIsSecret(); |
| 345 | } |
| 346 | if (foundSep < (int)children.size()) { |
| 347 | separatorKnob.lock()->setSecret(dynamic_cast<KnobSeparator*>(children[foundSep].get())); |
| 348 | } else { |
| 349 | separatorKnob.lock()->setSecret(true); |
| 350 | } |
| 351 | |
| 352 | } else { |
| 353 | separatorKnob.lock()->setSecret(true); |
| 354 | } |
| 355 | } |
| 356 |
nothing calls this directly
no test coverage detected