本文整理汇总了C++中KnobChoicePtr::getActiveEntry方法的典型用法代码示例。如果您正苦于以下问题:C++ KnobChoicePtr::getActiveEntry方法的具体用法?C++ KnobChoicePtr::getActiveEntry怎么用?C++ KnobChoicePtr::getActiveEntry使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KnobChoicePtr
的用法示例。
在下文中一共展示了KnobChoicePtr::getActiveEntry方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getInputRecursive
void
ViewerNodePrivate::swapViewerProcessInputs()
{
NodePtr viewerProcessNodesInputs[2];
for (int i = 0; i < 2; ++i) {
viewerProcessNodesInputs[i] = getInputRecursive(i);
}
NodePtr input0 = viewerProcessNodesInputs[0]->getInput(0);
NodePtr input1 = viewerProcessNodesInputs[1]->getInput(0);
viewerProcessNodesInputs[0]->swapInput(input1, 0);
viewerProcessNodesInputs[1]->swapInput(input0, 0);
try {
KnobChoicePtr aChoice = aInputNodeChoiceKnob.lock();
KnobChoicePtr bChoice = bInputNodeChoiceKnob.lock();
ChoiceOption aCurChoice = aChoice->getActiveEntry();
ChoiceOption bCurChoice = bChoice->getActiveEntry();
aChoice->blockValueChanges();
aChoice->setValueFromID(bCurChoice.id);
aChoice->unblockValueChanges();
bChoice->blockValueChanges();
bChoice->setValueFromID(aCurChoice.id);
bChoice->unblockValueChanges();
} catch (...) {
}
}
示例2: if
void
ViewerNodePrivate::refreshInputChoices(bool resetChoiceIfNotFound)
{
// Refresh the A and B input choices
KnobChoicePtr aInputKnob = aInputNodeChoiceKnob.lock();
KnobChoicePtr bInputKnob = bInputNodeChoiceKnob.lock();
ViewerCompositingOperatorEnum operation = (ViewerCompositingOperatorEnum)blendingModeChoiceKnob.lock()->getValue();
bInputKnob->setEnabled(operation != eViewerCompositingOperatorNone);
std::vector<ChoiceOption> entries;
entries.push_back(ChoiceOption("-", "", ""));
int nInputs = _publicInterface->getMaxInputCount();
for (int i = 0; i < nInputs; ++i) {
NodePtr inputNode = _publicInterface->getNode()->getRealInput(i);
if (!inputNode) {
continue;
}
std::string optionID;
{
std::stringstream ss;
ss << i;
optionID = ss.str();
}
entries.push_back(ChoiceOption(optionID, inputNode->getLabel(), ""));
}
ChoiceOption currentAChoice = aInputKnob->getActiveEntry();
ChoiceOption currentBChoice = bInputKnob->getActiveEntry();
aInputKnob->populateChoices(entries);
bInputKnob->populateChoices(entries);
if (resetChoiceIfNotFound) {
if (currentAChoice.id == "-" || !aInputKnob->isActiveEntryPresentInEntries(ViewIdx(0))) {
aInputKnob->setValue(entries.size() > 1 ? 1 : 0);
}
if (currentBChoice.id == "-" || !bInputKnob->isActiveEntryPresentInEntries(ViewIdx(0))) {
bInputKnob->setValue(entries.size() > 1 ? 1 : 0);
}
}
if (uiContext) {
if ( (operation == eViewerCompositingOperatorNone) || !bInputKnob->isEnabled() || bInputKnob->getActiveEntry().id.empty() ) {
uiContext->setInfoBarVisible(1, false);
} else if (operation != eViewerCompositingOperatorNone) {
uiContext->setInfoBarVisible(1, true);
}
}
} // refreshInputChoices