本文整理汇总了C++中KnobChoicePtr::linkTo方法的典型用法代码示例。如果您正苦于以下问题:C++ KnobChoicePtr::linkTo方法的具体用法?C++ KnobChoicePtr::linkTo怎么用?C++ KnobChoicePtr::linkTo使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KnobChoicePtr
的用法示例。
在下文中一共展示了KnobChoicePtr::linkTo方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: args
void
TrackMarkerPM::initializeKnobs()
{
TrackMarker::initializeKnobs();
NodePtr thisNode = getModel()->getNode();
NodePtr node;
{
CreateNodeArgsPtr args(CreateNodeArgs::create( PLUGINID_OFX_TRACKERPM, NodeCollectionPtr() ));
args->setProperty<bool>(kCreateNodeArgsPropVolatile, true);
args->setProperty<bool>(kCreateNodeArgsPropNoNodeGUI, true);
args->setProperty<std::string>(kCreateNodeArgsPropNodeInitialName, "TrackerPMNode");
node = getApp()->createNode(args);
if (!node) {
throw std::runtime_error("Couldn't create plug-in " PLUGINID_OFX_TRACKERPM);
}
if (thisNode) {
NodePtr inputNode = thisNode->getInput(0);
if (inputNode) {
node->connectInput(inputNode, 0);
}
}
trackerNode = node;
}
KnobItemsTablePtr model = getModel();
EffectInstancePtr effect;
if (model) {
effect = model->getNode()->getEffectInstance();
}
trackPrevButton = getNodeKnob<KnobButton>(node, kTrackerPMParamTrackingPrevious);
trackNextButton = getNodeKnob<KnobButton>(node, kTrackerPMParamTrackingNext);
KnobDoublePtr center = getNodeKnob<KnobDouble>(node, kTrackerPMParamTrackingCenterPoint);
centerKnob = center;
// Slave the center knob and unslave when tracking
if ( !center->linkTo(getCenterKnob()) ) {
throw std::runtime_error("Could not link center");
}
KnobDoublePtr offset = getNodeKnob<KnobDouble>(node, kTrackerPMParamTrackingOffset);
// Slave the offset knob
if ( !offset->linkTo( getOffsetKnob() ) ) {
throw std::runtime_error("Could not link offset");
}
offsetKnob = offset;
// Ref frame is set for each
refFrameKnob = getNodeKnob<KnobInt>(node, kTrackerPMParamTrackingReferenceFrame);
// Enable reference frame
KnobBoolPtr enableRefFrameKnob = getNodeKnob<KnobBool>(node, kTrackerPMParamTrackingEnableReferenceFrame);
enableRefFrameKnob->setValue(true);
KnobChoicePtr scoreType = getNodeKnob<KnobChoice>(node, kTrackerPMParamScore);
if (effect) {
#ifdef kTrackerParamPatternMatchingScoreType
KnobIPtr modelKnob = effect->getKnobByName(kTrackerParamPatternMatchingScoreType);
if (modelKnob) {
if ( !scoreType->linkTo(modelKnob) ) {
throw std::runtime_error("Could not link scoreType");
}
}
#endif
}
scoreTypeKnob = scoreType;
KnobDoublePtr correlationScore = getNodeKnob<KnobDouble>(node, kTrackerPMParamTrackingCorrelationScore);
correlationScoreKnob = correlationScore;
KnobDoublePtr patternBtmLeft = getNodeKnob<KnobDouble>(node, kTrackerPMParamTrackingPatternBoxBtmLeft);
patternBtmLeftKnob = patternBtmLeft;
// Slave the search window and pattern of the node to the parameters of the marker
(void)patternBtmLeft->linkTo(getPatternBtmLeftKnob());
KnobDoublePtr patternTopRight = getNodeKnob<KnobDouble>(node, kTrackerPMParamTrackingPatternBoxTopRight);
patternTopRightKnob = patternTopRight;
(void)patternTopRight->linkTo(getPatternTopRightKnob());
KnobDoublePtr searchWindowBtmLeft = getNodeKnob<KnobDouble>(node, kTrackerPMParamTrackingSearchBoxBtmLeft);
searchWindowBtmLeftKnob = searchWindowBtmLeft;
(void)searchWindowBtmLeft->linkTo(getSearchWindowBottomLeftKnob());
KnobDoublePtr searchWindowTopRight = getNodeKnob<KnobDouble>(node, kTrackerPMParamTrackingSearchBoxTopRight);
searchWindowTopRightKnob = searchWindowTopRight;
(void)searchWindowTopRight->linkTo(getSearchWindowTopRightKnob());
} // TrackMarkerPM::initializeKnobs