当前位置: 首页>>代码示例>>C++>>正文


C++ IObject::getParent方法代码示例

本文整理汇总了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;
}
开发者ID:oyaGG,项目名称:helgemathee-alembic-softimage,代码行数:16,代码来源:AbcBoundsEcho.cpp

示例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");
    }
}
开发者ID:BlackGinger,项目名称:ExocortexCrate,代码行数:58,代码来源:ArchiveTest.cpp

示例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;
}
开发者ID:nrusch,项目名称:ABCNuke,代码行数:18,代码来源:ABCNuke_MatrixHelper.cpp

示例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;
}
开发者ID:AWhetter,项目名称:alembic,代码行数:45,代码来源:Visibility.cpp


注:本文中的IObject::getParent方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。