本文整理汇总了C++中KnobIPtr::getDimension方法的典型用法代码示例。如果您正苦于以下问题:C++ KnobIPtr::getDimension方法的具体用法?C++ KnobIPtr::getDimension怎么用?C++ KnobIPtr::getDimension使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KnobIPtr
的用法示例。
在下文中一共展示了KnobIPtr::getDimension方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: KnobGuiValue
KnobGuiColor::KnobGuiColor(KnobIPtr knob,
KnobGuiContainerI *container)
: KnobGuiValue(knob, container)
, _knob( toKnobColor(knob) )
, _colorLabel(0)
, _colorDialogButton(0)
, _lastColor( knob->getDimension() )
, _useSimplifiedUI( isViewerUIKnob() || _knob.lock()->isSimplified() )
{
}
示例2:
void
DSPasteKeysCommand::addOrRemoveKeyframe(bool add)
{
for (std::list<boost::weak_ptr<DSKnob> >::const_iterator it = _dstKnobs.begin(); it != _dstKnobs.end(); ++it) {
DSKnobPtr knobContext = it->lock();
if (!knobContext) {
continue;
}
for (std::size_t i = 0; i < _keys.size(); ++i) {
int dim = knobContext->getDimension();
KnobIPtr knob = knobContext->getInternalKnob();
knob->beginChanges();
double keyTime = _keys[i].key.getTime();
double setTime = _pasteRelativeToRefTime ? keyTime - _keys[_refKeyindex].key.getTime() + _refTime : keyTime;
if (add) {
for (int j = 0; j < knob->getDimension(); ++j) {
if ( (dim == -1) || (j == dim) ) {
KeyFrame k = _keys[i].key;
k.setTime(setTime);
knob->setKeyFrame(k, ViewSpec::all(), j, eValueChangedReasonNatronGuiEdited);
}
}
} else {
for (int j = 0; j < knob->getDimension(); ++j) {
if ( (dim == -1) || (j == dim) ) {
knob->deleteValueAtTime(eCurveChangeReasonDopeSheet, setTime, ViewSpec::all(), j, i == 0);
}
}
}
knob->endChanges();
}
}
_model->refreshSelectionBboxAndRedrawView();
} // DSPasteKeysCommand::addOrRemoveKeyframe
示例3: assert
static void
deleteKnobAnimation(const std::set<int>& userKeyframes,
const KnobIPtr& knob,
DeleteKnobAnimationEnum type,
int currentTime)
{
for (int i = 0; i < knob->getDimension(); ++i) {
CurvePtr curve = knob->getCurve(ViewSpec(0), i);
assert(curve);
KeyFrameSet keys = curve->getKeyFrames_mt_safe();
std::list<double> toRemove;
switch (type) {
case eDeleteKnobAnimationAll: {
for (KeyFrameSet::iterator it = keys.begin(); it != keys.end(); ++it) {
std::set<int>::iterator found = userKeyframes.find( (int)it->getTime() );
if ( found == userKeyframes.end() ) {
toRemove.push_back( it->getTime() );
}
}
break;
}
case eDeleteKnobAnimationBeforeTime: {
for (KeyFrameSet::iterator it = keys.begin(); it != keys.end(); ++it) {
if (it->getTime() >= currentTime) {
break;
}
std::set<int>::iterator found = userKeyframes.find( (int)it->getTime() );
if ( found == userKeyframes.end() ) {
toRemove.push_back( it->getTime() );
}
}
break;
}
case eDeleteKnobAnimationAfterTime: {
for (KeyFrameSet::reverse_iterator it = keys.rbegin(); it != keys.rend(); ++it) {
if (it->getTime() <= currentTime) {
break;
}
std::set<int>::iterator found = userKeyframes.find( (int)it->getTime() );
if ( found == userKeyframes.end() ) {
toRemove.push_back( it->getTime() );
}
}
break;
}
}
knob->deleteValuesAtTime(eCurveChangeReasonInternal, toRemove, ViewSpec::all(), i, true);
}
}