本文整理汇总了C++中KnobChoicePtr::getDefaultValue方法的典型用法代码示例。如果您正苦于以下问题:C++ KnobChoicePtr::getDefaultValue方法的具体用法?C++ KnobChoicePtr::getDefaultValue怎么用?C++ KnobChoicePtr::getDefaultValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KnobChoicePtr
的用法示例。
在下文中一共展示了KnobChoicePtr::getDefaultValue方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ts
//.........这里部分代码省略.........
knobType = tr("Color");
} else {
knobType = tr("N/A");
}
if (!isGroup && !isPage) {
for (int i = 0; i < (*it)->getNDimensions(); ++i) {
QString valueStr;
if (!isBtn && !isSep && !isParametric) {
// If this is a ChoiceParam and we are not generating live HTML doc,
// only add the list of entries and their halp if this node should not be
// ignored (eg. OCIO colorspace knobs).
if ( isChoice &&
(genHTML || !( knobScriptName == QString::fromUtf8(kOCIOParamInputSpaceChoice) ||
knobScriptName == QString::fromUtf8(kOCIOParamOutputSpaceChoice) ||
( ( pluginID == QString::fromUtf8(kOCIODisplayPluginIdentifier) ) &&
( knobScriptName == QString::fromUtf8(kOCIODisplayParamDisplayChoice) ) ) ||
( ( pluginID == QString::fromUtf8(kOCIODisplayPluginIdentifier) ) &&
( knobScriptName == QString::fromUtf8(kOCIODisplayParamViewChoice) ) ) ||
//( ( pluginID == QString::fromUtf8(kOCIOCDLTransformPluginIdentifier) ) &&
// ( knobScriptName == QString::fromUtf8(kOCIOCDLTransformParamCCCIDChoice) ) ) ||
( ( pluginID == QString::fromUtf8(kOCIOFileTransformPluginIdentifier) ) &&
( knobScriptName == QString::fromUtf8(kOCIOFileTransformParamCCCIDChoice) ) ) ||
( ( pluginID == QString::fromUtf8("net.fxarena.openfx.Text") ) &&
( knobScriptName == QString::fromUtf8("name") ) ) || // font family from Text plugin
( ( pluginID == QString::fromUtf8("net.fxarena.openfx.Polaroid") ) &&
( knobScriptName == QString::fromUtf8("font") ) ) || // font family from Polaroid plugin
( ( pluginID == QString::fromUtf8(PLUGINID_NATRON_PRECOMP) ) &&
( knobScriptName == QString::fromUtf8("writeNode") ) ) ||
( ( pluginID == QString::fromUtf8(PLUGINID_NATRON_ONEVIEW) ) &&
( knobScriptName == QString::fromUtf8("view") ) ) ) ) ) {
// see also KnobChoice::getHintToolTipFull()
int index = isChoice->getDefaultValue(DimIdx(i));
std::vector<ChoiceOption> entries = isChoice->getEntries();
if ( (index >= 0) && ( index < (int)entries.size() ) ) {
valueStr = QString::fromUtf8( entries[index].id.c_str() );
}
bool first = true;
for (size_t i = 0; i < entries.size(); i++) {
QString entryHelp = QString::fromUtf8( entries[i].tooltip.c_str() );
QString entry;
if (entries[i].id != entries[i].label) {
entry = QString::fromUtf8( "%1 (%2)" ).arg(QString::fromUtf8( entries[i].label.c_str() )).arg(QString::fromUtf8( entries[i].id.c_str() ));
} else {
entry = QString::fromUtf8( entries[i].label.c_str() );
}
if (!entry.isEmpty()) {
if (first) {
// empty line before the option descriptions
if (genHTML) {
if ( !knobHint.isEmpty() ) {
knobHint.append( QString::fromUtf8("<br />") );
}
knobHint.append( tr("Possible values:") + QString::fromUtf8("<br />") );
} else {
// we do a hack for multiline elements, because the markdown->rst conversion by pandoc doesn't use the line block syntax.
// what we do here is put a supplementary dot at the beginning of each line, which is then converted to a pipe '|' in the
// genStaticDocs.sh script by a simple sed command after converting to RsT
if ( !knobHint.isEmpty() ) {
if (!knobHint.startsWith( QString::fromUtf8(". ") )) {
knobHint.prepend( QString::fromUtf8(". ") );
}
knobHint.append( QString::fromUtf8("\\\n") );
}
knobHint.append( QString::fromUtf8(". ") + tr("Possible values:") + QString::fromUtf8("\\\n") );