本文整理汇总了C++中IObject::getParent方法的典型用法代码示例。如果您正苦于以下问题:C++ IObject::getParent方法的具体用法?C++ IObject::getParent怎么用?C++ IObject::getParent使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IObject
的用法示例。
在下文中一共展示了IObject::getParent方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getFinalMatrix
//-*****************************************************************************
M44d getFinalMatrix( IObject &iObj )
{
M44d xf;
xf.makeIdentity();
IObject parent = iObj.getParent();
while ( parent )
{
accumXform( xf, parent );
parent = parent.getParent();
}
return xf;
}
示例2: scopingTest
void scopingTest(bool useOgawa)
{
{
OObject top;
{
OArchive archive;
if (useOgawa)
{
archive = CreateArchiveWithInfo(
Alembic::AbcCoreOgawa::WriteArchive(),
"archiveScopeTest.abc",
"Alembic test", "", MetaData() );
}
else
{
archive = CreateArchiveWithInfo(
Alembic::AbcCoreHDF5::WriteArchive(),
"archiveScopeTest.abc",
"Alembic test", "", MetaData() );
}
top = archive.getTop();
}
OObject childA( top, "a");
OObject childB( top, "b");
ODoubleProperty prop(top.getProperties(), "prop", 0);
TESTING_ASSERT(prop.getObject().getArchive().getName() ==
"archiveScopeTest.abc");
}
{
IObject top;
{
AbcF::IFactory factory;
AbcF::IFactory::CoreType coreType;
IArchive archive = factory.getArchive("archiveScopeTest.abc",
coreType);
TESTING_ASSERT( (useOgawa && coreType == AbcF::IFactory::kOgawa) ||
(!useOgawa && coreType == AbcF::IFactory::kHDF5) );
top = archive.getTop();
double start, end;
GetArchiveStartAndEndTime( archive, start, end );
TESTING_ASSERT( start == DBL_MAX && end == -DBL_MAX );
}
TESTING_ASSERT(top.getNumChildren() == 2 );
TESTING_ASSERT(top.getChildHeader("a") != NULL);
TESTING_ASSERT(top.getChildHeader("b") != NULL);
TESTING_ASSERT( ! top.getParent().valid() );
TESTING_ASSERT( top.getArchive().getName() ==
"archiveScopeTest.abc");
IScalarProperty prop(top.getProperties(), "prop");
TESTING_ASSERT(prop.valid());
TESTING_ASSERT(prop.getObject().getArchive().getName() ==
"archiveScopeTest.abc");
}
}
示例3: getConcatMatrix
const Matrix4 getConcatMatrix( IObject iObj, chrono_t curTime , bool interpolate)
{
Imath::M44d xf;
xf.makeIdentity();
IObject parent = iObj.getParent();
// Once the Archive's Top Object is reached, IObject::getParent() will
// return an invalid IObject, and that will evaluate to False.
while ( parent )
{
accumXform( xf, parent, curTime, interpolate );
parent = parent.getParent();
}
Matrix4 ret_matrix = convert(xf);
return ret_matrix;
}
示例4: IsAncestorInvisible
bool IsAncestorInvisible( IObject iObject,
const Abc::ISampleSelector &iSS )
{
ABCA_ASSERT ( iObject,
"IsAncestorInvisible (): object passed in isn't valid.");
IVisibilityProperty visibilityProperty =
GetVisibilityProperty ( iObject );
ObjectVisibility visibilityValue = kVisibilityDeferred;
if ( visibilityProperty )
{
int8_t rawVisibilityValue;
rawVisibilityValue = visibilityProperty.getValue( iSS );
visibilityValue = ObjectVisibility ( rawVisibilityValue );
}
IObject currentObject = iObject;
while ( visibilityValue == kVisibilityDeferred )
{
// go up a level
currentObject = currentObject.getParent();
if (! currentObject )
{
return false;
}
visibilityProperty = GetVisibilityProperty ( currentObject );
if ( visibilityProperty && visibilityProperty.valid() )
{
int8_t rawVisibilityValue;
rawVisibilityValue = visibilityProperty.getValue( iSS );
visibilityValue = ObjectVisibility ( rawVisibilityValue );
}
// At this point if we didn't find the visiblilty
// property OR if the value was deferred we'll
// continue up a level (so only if this object
// says hidden OR explicitly says visible do we stop.
}
if ( visibilityValue == kVisibilityHidden )
return true;
return false;
}