本文整理汇总了C++中KnobChoicePtr::slaveTo方法的典型用法代码示例。如果您正苦于以下问题:C++ KnobChoicePtr::slaveTo方法的具体用法?C++ KnobChoicePtr::slaveTo怎么用?C++ KnobChoicePtr::slaveTo使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KnobChoicePtr
的用法示例。
在下文中一共展示了KnobChoicePtr::slaveTo方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
void
TrackMarker::setMotionModelFromGui(int index)
{
KnobChoicePtr knob = _imp->motionModel.lock();
if (!knob) {
return;
}
KeyFrame k;
std::pair<int, KnobIPtr> master = knob->getMaster(0);
if (master.second) {
knob->unSlave(0, true);
}
knob->onValueChanged(index, ViewSpec::all(), 0, eValueChangedReasonNatronGuiEdited, &k);
if (master.second) {
master.second->cloneAndUpdateGui(knob);
knob->slaveTo(0, master.second, master.first);
}
}
示例2: args
void
TrackMarkerPM::initializeKnobs()
{
TrackMarker::initializeKnobs();
NodePtr thisNode = getContext()->getNode();
QObject::connect( getContext().get(), SIGNAL(onNodeInputChanged(int)), this, SLOT(onTrackerNodeInputChanged(int)) );
NodePtr node;
{
CreateNodeArgs args( PLUGINID_OFX_TRACKERPM, NodeCollectionPtr() );
args.setProperty<bool>(kCreateNodeArgsPropOutOfProject, true);
args.setProperty<bool>(kCreateNodeArgsPropNoNodeGUI, true);
args.setProperty<std::string>(kCreateNodeArgsPropNodeInitialName, "TrackerPMNode");
node = getContext()->getNode()->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;
}
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
for (int i = 0; i < center->getDimension(); ++i) {
center->slaveTo(i, getCenterKnob(), i);
}
KnobDoublePtr offset = getNodeKnob<KnobDouble>(node, kTrackerPMParamTrackingOffset);
// Slave the offset knob
for (int i = 0; i < offset->getDimension(); ++i) {
offset->slaveTo(i, getOffsetKnob(), i);
}
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);
scoreType->slaveTo(0, getContext()->getCorrelationScoreTypeKnob(), 0);
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
for (int i = 0; i < patternBtmLeft->getDimension(); ++i) {
patternBtmLeft->slaveTo(i, getPatternBtmLeftKnob(), i);
}
KnobDoublePtr patternTopRight = getNodeKnob<KnobDouble>(node, kTrackerPMParamTrackingPatternBoxTopRight);
patternTopRightKnob = patternTopRight;
for (int i = 0; i < patternTopRight->getDimension(); ++i) {
patternTopRight->slaveTo(i, getPatternTopRightKnob(), i);
}
KnobDoublePtr searchWindowBtmLeft = getNodeKnob<KnobDouble>(node, kTrackerPMParamTrackingSearchBoxBtmLeft);
searchWindowBtmLeftKnob = searchWindowBtmLeft;
for (int i = 0; i < searchWindowBtmLeft->getDimension(); ++i) {
searchWindowBtmLeft->slaveTo(i, getSearchWindowBottomLeftKnob(), i);
}
KnobDoublePtr searchWindowTopRight = getNodeKnob<KnobDouble>(node, kTrackerPMParamTrackingSearchBoxTopRight);
searchWindowTopRightKnob = searchWindowTopRight;
for (int i = 0; i < searchWindowTopRight->getDimension(); ++i) {
searchWindowTopRight->slaveTo(i, getSearchWindowTopRightKnob(), i);
}
} // TrackMarkerPM::initializeKnobs