本文整理汇总了C++中scenenode::ScenePath::back方法的典型用法代码示例。如果您正苦于以下问题:C++ ScenePath::back方法的具体用法?C++ ScenePath::back怎么用?C++ ScenePath::back使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类scenenode::ScenePath
的用法示例。
在下文中一共展示了ScenePath::back方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: hashObject
void Grid::hashObject( const SceneNode::ScenePath &path, const Gaffer::Context *context, const ScenePlug *parent, IECore::MurmurHash &h ) const
{
if( path.size() == 2 )
{
SceneNode::hashObject( path, context, parent, h );
h.append( path.back() );
dimensionsPlug()->hash( h );
if( path.back() == g_gridLinesName )
{
spacingPlug()->hash( h );
gridColorPlug()->hash( h );
}
else if( path.back() == g_centerLinesName )
{
centerColorPlug()->hash( h );
}
else if( path.back() == g_borderLinesName )
{
borderColorPlug()->hash( h );
}
}
else
{
h = outPlug()->objectPlug()->defaultValue()->hash();
}
}
示例2: computeAttributes
IECore::ConstCompoundObjectPtr Grid::computeAttributes( const SceneNode::ScenePath &path, const Gaffer::Context *context, const ScenePlug *parent ) const
{
if( path.size() == 1 )
{
CompoundObjectPtr result = new CompoundObject;
result->members()["gl:curvesPrimitive:useGLLines"] = new BoolData( true );
result->members()["gl:smoothing:lines"] = new BoolData( true );
ShaderPtr shader = new Shader( "Constant", "gl:surface" );
shader->parameters()["Cs"] = new Color3fData( Color3f( 1 ) );
result->members()["gl:surface"] = shader;
return result;
}
else if( path.size() == 2 )
{
float pixelWidth = 1.0f;
if( path.back() == g_gridLinesName )
{
pixelWidth = gridPixelWidthPlug()->getValue();
}
else if( path.back() == g_centerLinesName )
{
pixelWidth = centerPixelWidthPlug()->getValue();
}
else if( path.back() == g_borderLinesName )
{
pixelWidth = borderPixelWidthPlug()->getValue();
}
CompoundObjectPtr result = new CompoundObject;
result->members()["gl:curvesPrimitive:glLineWidth"] = new FloatData( pixelWidth );
return result;
}
return outPlug()->attributesPlug()->defaultValue();
}
示例3: computeObject
IECore::ConstObjectPtr Grid::computeObject( const SceneNode::ScenePath &path, const Gaffer::Context *context, const ScenePlug *parent ) const
{
if( path.size() == 2 )
{
IntVectorDataPtr vertsPerCurveData = new IntVectorData;
vector<int> &vertsPerCurve = vertsPerCurveData->writable();
V3fVectorDataPtr pData = new V3fVectorData;
pData->setInterpretation( GeometricData::Point );
vector<V3f> &p = pData->writable();
bool periodic = false;
Color3f cs( 1 );
const V2f halfDimensions = dimensionsPlug()->getValue() / 2.0f;
if( path.back() == g_gridLinesName )
{
const float spacing = spacingPlug()->getValue();
const V2i n = V2f( halfDimensions / spacing ) - V2f( 0.01 );
for( int d = 0; d < 2; ++d )
{
const int d0 = d;
const int d1 = d == 0 ? 1 : 0;
for( int i = -n[d]; i <= n[d]; ++i )
{
if( i == 0 )
{
continue;
}
vertsPerCurve.push_back( 2 );
V3f e( 0 );
e[d0] = i * spacing;
e[d1] = -halfDimensions[d1];
p.push_back( e );
e[d1] = halfDimensions[d1];
p.push_back( e );
}
}
cs = gridColorPlug()->getValue();
}
else if( path.back() == g_centerLinesName )
{
vertsPerCurve.push_back( 2 );
p.push_back( V3f( halfDimensions.x, 0, 0 ) );
p.push_back( V3f( -halfDimensions.x, 0, 0 ) );
vertsPerCurve.push_back( 2 );
p.push_back( V3f( 0, halfDimensions.y, 0 ) );
p.push_back( V3f( 0, -halfDimensions.y, 0 ) );
cs = centerColorPlug()->getValue();
}
else if( path.back() == g_borderLinesName )
{
vertsPerCurve.push_back( 4 );
p.push_back( V3f( -halfDimensions.x, -halfDimensions.y, 0 ) );
p.push_back( V3f( halfDimensions.x, -halfDimensions.y, 0 ) );
p.push_back( V3f( halfDimensions.x, halfDimensions.y, 0 ) );
p.push_back( V3f( -halfDimensions.x, halfDimensions.y, 0 ) );
periodic = true;
cs = borderColorPlug()->getValue();
}
CurvesPrimitivePtr result = new CurvesPrimitive( vertsPerCurveData, CubicBasisf::linear(), periodic, pData );
result->variables["Cs"] = PrimitiveVariable( PrimitiveVariable::Constant, new Color3fData( cs ) );
return result;
}
return outPlug()->objectPlug()->defaultValue();
}