本文整理汇总了C++中KnobBoolPtr::getValueAtTime方法的典型用法代码示例。如果您正苦于以下问题:C++ KnobBoolPtr::getValueAtTime方法的具体用法?C++ KnobBoolPtr::getValueAtTime怎么用?C++ KnobBoolPtr::getValueAtTime使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KnobBoolPtr
的用法示例。
在下文中一共展示了KnobBoolPtr::getValueAtTime方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getInverted
bool getInverted(TimeValue time) const
{
KnobBoolPtr knob = invert.lock();
if (!knob) {
return false;
}
return knob->getValueAtTime(time);
}
示例2: getEnabled
bool getEnabled(TimeValue time,
int index) const
{
KnobBoolPtr knob = enable[index].lock();
if (!knob) {
return true;
}
return knob->getValueAtTime(time);
}
示例3: assert
bool
RotoShapeRenderNodePrivate::renderStroke_generic(RenderStrokeDataPtr userData,
PFNRenderStrokeBeginRender beginCallback,
PFNRenderStrokeRenderDot renderDotCallback,
PFNRenderStrokeEndRender endCallback,
const std::list<std::list<std::pair<Point, double> > >& strokes,
const double distToNextIn,
const Point& lastCenterPointIn,
const RotoDrawableItemPtr& stroke,
bool doBuildup,
double opacity,
TimeValue time,
ViewIdx /*view*/,
const RenderScale& scale,
double* distToNextOut,
Point* lastCenterPoint)
{
assert(distToNextOut && lastCenterPoint);
*distToNextOut = 0;
double brushSize, brushSizePixelX, brushSizePixelY, brushSpacing, brushHardness, writeOnStart, writeOnEnd;
bool pressureAffectsOpacity, pressureAffectsHardness, pressureAffectsSize;
{
KnobDoublePtr brushSizeKnob = stroke->getBrushSizeKnob();
brushSize = brushSizeKnob->getValueAtTime(time);
KnobDoublePtr brushSpacingKnob = stroke->getBrushSpacingKnob();
brushSpacing = brushSpacingKnob->getValueAtTime(time);
if (brushSpacing == 0.) {
return false;
}
brushSpacing = std::max(brushSpacing, 0.05);
KnobDoublePtr brushHardnessKnob = stroke->getBrushHardnessKnob();
brushHardness = brushHardnessKnob->getValueAtTime(time);
KnobDoublePtr visiblePortionKnob = stroke->getBrushVisiblePortionKnob();
writeOnStart = visiblePortionKnob->getValueAtTime(time);
writeOnEnd = visiblePortionKnob->getValueAtTime(time, DimIdx(1));
if ( (writeOnEnd - writeOnStart) <= 0. ) {
return false;
}
// This function is also used for opened bezier which do not have pressure.
RotoStrokeItemPtr isStroke = toRotoStrokeItem(stroke);
if (!isStroke) {
pressureAffectsOpacity = false;
pressureAffectsSize = false;
pressureAffectsHardness = false;
} else {
KnobBoolPtr pressureOpacityKnob = isStroke->getPressureOpacityKnob();
KnobBoolPtr pressureSizeKnob = isStroke->getPressureSizeKnob();
KnobBoolPtr pressureHardnessKnob = isStroke->getPressureHardnessKnob();
pressureAffectsOpacity = pressureOpacityKnob->getValueAtTime(time);
pressureAffectsSize = pressureSizeKnob->getValueAtTime(time);
pressureAffectsHardness = pressureHardnessKnob->getValueAtTime(time);
}
brushSizePixelX = brushSize;
brushSizePixelY = brushSizePixelX;
brushSizePixelX = std::max( 1., brushSizePixelX * scale.x);
brushSizePixelY = std::max( 1., brushSizePixelY * scale.y);
}
double distToNext = distToNextIn;
bool hasRenderedDot = false;
beginCallback(userData, brushSizePixelX, brushSizePixelY, brushSpacing, brushHardness, pressureAffectsOpacity, pressureAffectsHardness, pressureAffectsSize, doBuildup, opacity);
*lastCenterPoint = lastCenterPointIn;
Point prevCenter = lastCenterPointIn;
for (std::list<std::list<std::pair<Point, double> > >::const_iterator strokeIt = strokes.begin(); strokeIt != strokes.end(); ++strokeIt) {
int firstPoint = (int)std::floor( (strokeIt->size() * writeOnStart) );
int endPoint = (int)std::ceil( (strokeIt->size() * writeOnEnd) );
assert( firstPoint >= 0 && firstPoint < (int)strokeIt->size() && endPoint > firstPoint && endPoint <= (int)strokeIt->size() );
///The visible portion of the paint's stroke with points adjusted to pixel coordinates
std::list<std::pair<Point, double> > visiblePortion;
std::list<std::pair<Point, double> >::const_iterator startingIt = strokeIt->begin();
std::list<std::pair<Point, double> >::const_iterator endingIt = strokeIt->begin();
std::advance(startingIt, firstPoint);
std::advance(endingIt, endPoint);
for (std::list<std::pair<Point, double> >::const_iterator it = startingIt; it != endingIt; ++it) {
visiblePortion.push_back(*it);
}
if ( visiblePortion.empty() ) {
continue;
}
std::list<std::pair<Point, double> >::iterator it = visiblePortion.begin();
if (visiblePortion.size() == 1) {
double spacing;
*lastCenterPoint = it->first;
renderDotCallback(userData, prevCenter, *lastCenterPoint, it->second, &spacing);
distToNext += spacing;
continue;
//.........这里部分代码省略.........