MCPcopy Create free account
hub / github.com/NatronGitHub/Natron / insertKnob

Method insertKnob

Engine/KnobTypes.cpp:1594–1618  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1592}
1593
1594void
1595KnobGroup::insertKnob(int index,
1596 const KnobIPtr& k)
1597{
1598 if ( !isUserKnob() && k->isUserKnob() ) {
1599 return;
1600 }
1601
1602 for (std::size_t i = 0; i < _children.size(); ++i) {
1603 if (_children[i].lock() == k) {
1604 return;
1605 }
1606 }
1607
1608 k->resetParent();
1609
1610 if ( index >= (int)_children.size() ) {
1611 _children.push_back(k);
1612 } else {
1613 std::vector<KnobIWPtr>::iterator it = _children.begin();
1614 std::advance(it, index);
1615 _children.insert(it, k);
1616 }
1617 k->setParentKnob( shared_from_this() );
1618}
1619
1620std::vector<KnobIPtr>
1621KnobGroup::getChildren() const

Callers

nothing calls this directly

Calls 8

resetParentMethod · 0.80
setParentKnobMethod · 0.80
isUserKnobMethod · 0.45
sizeMethod · 0.45
lockMethod · 0.45
push_backMethod · 0.45
beginMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected