本文整理汇总了C++中KnobChoicePtr::isEnabled方法的典型用法代码示例。如果您正苦于以下问题:C++ KnobChoicePtr::isEnabled方法的具体用法?C++ KnobChoicePtr::isEnabled怎么用?C++ KnobChoicePtr::isEnabled使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KnobChoicePtr
的用法示例。
在下文中一共展示了KnobChoicePtr::isEnabled方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
void
KnobGuiChoice::setEnabled()
{
KnobChoicePtr knob = _knob.lock();
bool b = knob->isEnabled(0) && knob->getExpression(0).empty();
_comboBox->setEnabled_natron(b);
}
示例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
示例3:
void
KnobGuiChoice::reflectAnimationLevel(DimIdx /*dimension*/,
AnimationLevelEnum level)
{
KnobChoicePtr knob = _knob.lock();
if (!knob) {
return;
}
bool isEnabled = knob->isEnabled();
_comboBox->setEnabled_natron(level != eAnimationLevelExpression && isEnabled);
if ( level != (AnimationLevelEnum)_comboBox->getAnimation() ) {
_comboBox->setAnimation((int)level);
}
}