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


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

本文整理汇总了C++中IObject::getHeader方法的典型用法代码示例。如果您正苦于以下问题:C++ IObject::getHeader方法的具体用法?C++ IObject::getHeader怎么用?C++ IObject::getHeader使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IObject的用法示例。


在下文中一共展示了IObject::getHeader方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: getObjectTimeSpan

void getObjectTimeSpan(IObject obj, chrono_t& first, chrono_t& last, bool doChildren)
{
	if ( Alembic::AbcGeom::IPolyMesh::matches(obj.getHeader()) ) {
		IPolyMesh iPoly(obj, Alembic::Abc::kWrapExisting);
		getPolyMeshTimeSpan(iPoly, first, last);
	}

	else if ( Alembic::AbcGeom::ISubD::matches(obj.getHeader()) ) {
		ISubD iSub(obj, Alembic::Abc::kWrapExisting);
		getSubDTimeSpan(iSub, first, last);
	}

	else if ( Alembic::AbcGeom::IXform::matches(obj.getHeader()) ) {
		IXform iXf(obj, Alembic::Abc::kWrapExisting);
		getXformTimeSpan(iXf, first, last, false);
	}

	else if ( Alembic::AbcGeom::ICamera::matches(obj.getHeader()) ) {
		ICamera iCam(obj, Alembic::Abc::kWrapExisting);
		getCameraTimeSpan(iCam, first, last);
	}

	if (doChildren) {
		// do this object's children too
		for (unsigned i=0; i < obj.getNumChildren(); ++i)
		{
			IObject child( obj.getChild( i ));
			getObjectTimeSpan(child, first, last, doChildren);
		}
	}
}
开发者ID:ivanbusquets,项目名称:ABCNuke,代码行数:31,代码来源:ABCNuke_ArchiveHelper.cpp

示例2: getXformTimeSpan

void getXformTimeSpan(IXform iXf, chrono_t& first, chrono_t& last, bool inherits) {

	IXformSchema xf = iXf.getSchema();
	TimeSamplingPtr ts = xf.getTimeSampling();
	first = std::min(first, ts->getSampleTime(0) );
	if (xf.isConstant()) {
		last = first;
	}
	else {
		last = std::max(last, ts->getSampleTime(xf.getNumSamples()-1) );
	}
	if (inherits && xf.getInheritsXforms()) {
		IObject parent = iXf.getParent();

		// Once the Archive's Top Object is reached, IObject::getParent() will
		// return an invalid IObject, and that will evaluate to False.
		while ( parent )
		{
			if ( Alembic::AbcGeom::IXform::matches(parent.getHeader()) ) {
				IXform x( parent, kWrapExisting );
				getXformTimeSpan(x, first, last, inherits);
			}
		}

	}
}
开发者ID:ivanbusquets,项目名称:ABCNuke,代码行数:26,代码来源:ABCNuke_ArchiveHelper.cpp

示例3: accumXform

void accumXform( Imath::M44d &xf, IObject obj, chrono_t curTime, bool interpolate)
{
    if ( IXform::matches( obj.getHeader() ) )
    {
        Imath::M44d mtx;
        IXform x( obj, kWrapExisting );
        XformSample xs;
        x.getSchema().get( xs );

        if (!x.getSchema().isConstant()) {

            TimeSamplingPtr timeSampler = x.getSchema().getTimeSampling();

            if (interpolate) {

                //std::pair<index_t, chrono_t> lSamp;// = timeSampler->getFloorIndex(curTime, x.getSchema().getNumSamples());
                Alembic::AbcCoreAbstract::index_t floorIdx, ceilIdx;

                double amt = getWeightAndIndex(curTime, timeSampler,
                                               x.getSchema().getNumSamples(), floorIdx, ceilIdx);

                if (amt != 0 && floorIdx != ceilIdx) {

                    const ISampleSelector iss_start(floorIdx);//lSamp.first);
                    Imath::M44d mtx_start = x.getSchema().getValue(iss_start).getMatrix();

                    //std::pair<index_t, chrono_t> rSamp = timeSampler->getCeilIndex(curTime, x.getSchema().getNumSamples());
                    const ISampleSelector iss_end(ceilIdx);//rSamp.first);
                    Imath::M44d mtx_end = x.getSchema().getValue(iss_end).getMatrix();


                    Imath::V3d s_l,s_r,h_l,h_r,t_l,t_r;
                    Imath::Quatd quat_l,quat_r;



                    DecomposeXForm(mtx_start, s_l, h_l, quat_l, t_l);
                    DecomposeXForm(mtx_end, s_r, h_r, quat_r, t_r);


                    if ((quat_l ^ quat_r) < 0)
                    {
                        quat_r = -quat_r;
                    }

                    mtx =  RecomposeXForm(Imath::lerp(s_l, s_r, amt),
                                          Imath::lerp(h_l, h_r, amt),
                                          Imath::slerp(quat_l, quat_r, amt),
                                          Imath::lerp(t_l, t_r, amt));


                }

                else {
                    const ISampleSelector iss(curTime);
                    xs = x.getSchema().getValue(iss);
                    mtx = xs.getMatrix();
                }

            }



            else { // no interpolation, get nearest sample
                const ISampleSelector iss(curTime);
                xs = x.getSchema().getValue(iss);
                mtx = xs.getMatrix();
            }

        }
        else {
            mtx = xs.getMatrix();
        }
        xf *= mtx;
    }
}
开发者ID:nrusch,项目名称:ABCNuke,代码行数:76,代码来源:ABCNuke_MatrixHelper.cpp


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