本文整理汇总了C++中sceneplug::ScenePath::empty方法的典型用法代码示例。如果您正苦于以下问题:C++ ScenePath::empty方法的具体用法?C++ ScenePath::empty怎么用?C++ ScenePath::empty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sceneplug::ScenePath
的用法示例。
在下文中一共展示了ScenePath::empty方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: writeLocation
void SceneWriter::writeLocation( const GafferScene::ScenePlug *scene, const ScenePlug::ScenePath &scenePath, Context *context, IECore::SceneInterface *output, double time ) const
{
context->set( ScenePlug::scenePathContextName, scenePath );
ConstCompoundObjectPtr attributes = scene->attributesPlug()->getValue();
for( CompoundObject::ObjectMap::const_iterator it = attributes->members().begin(), eIt = attributes->members().end(); it != eIt; it++ )
{
output->writeAttribute( it->first, it->second.get(), time );
}
if( scenePath.empty() )
{
ConstCompoundObjectPtr globals = scene->globalsPlug()->getValue();
output->writeAttribute( "gaffer:globals", globals.get(), time );
}
ConstObjectPtr object = scene->objectPlug()->getValue();
if( object->typeId() != IECore::NullObjectTypeId && scenePath.size() > 0 )
{
output->writeObject( object.get(), time );
}
Imath::Box3f b = scene->boundPlug()->getValue();
output->writeBound( Imath::Box3d( Imath::V3f( b.min ), Imath::V3f( b.max ) ), time );
if( scenePath.size() )
{
Imath::M44f t = scene->transformPlug()->getValue();
Imath::M44d transform(
t[0][0], t[0][1], t[0][2], t[0][3],
t[1][0], t[1][1], t[1][2], t[1][3],
t[2][0], t[2][1], t[2][2], t[2][3],
t[3][0], t[3][1], t[3][2], t[3][3]
);
output->writeTransform( new IECore::M44dData( transform ), time );
}
ConstInternedStringVectorDataPtr childNames = scene->childNamesPlug()->getValue();
ScenePlug::ScenePath childScenePath = scenePath;
childScenePath.push_back( InternedString() );
for( vector<InternedString>::const_iterator it=childNames->readable().begin(); it!=childNames->readable().end(); it++ )
{
childScenePath[scenePath.size()] = *it;
SceneInterfacePtr outputChild = output->child( *it, SceneInterface::CreateIfMissing );
writeLocation( scene, childScenePath, context, outputChild.get(), time );
}
}
示例2:
const TransformTool::Selection &CameraTool::cameraSelection()
{
if( !m_cameraSelectionDirty )
{
return m_cameraSelection;
}
m_cameraSelection = TransformTool::Selection();
ScenePlug::ScenePath cameraPath = this->cameraPath();
if( !cameraPath.empty() )
{
m_cameraSelection = TransformTool::Selection(
scenePlug(),
cameraPath,
view()->getContext()
);
}
m_cameraSelectionDirty = false;
return m_cameraSelection;
}