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


C++ TimeSamplingPtr类代码示例

本文整理汇总了C++中TimeSamplingPtr的典型用法代码示例。如果您正苦于以下问题:C++ TimeSamplingPtr类的具体用法?C++ TimeSamplingPtr怎么用?C++ TimeSamplingPtr使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: getSubDTimeSpan

void getSubDTimeSpan(ISubD iSub, chrono_t& first, chrono_t& last) {

	ISubDSchema mesh = iSub.getSchema();
	TimeSamplingPtr ts = mesh.getTimeSampling();
	first = std::min(first, ts->getSampleTime(0) );
	last = std::max(last, ts->getSampleTime(mesh.getNumSamples()-1) );
}
开发者ID:nrusch,项目名称:ABCNuke,代码行数:7,代码来源:ABCNuke_ArchiveHelper.cpp

示例2: getABCTimeSpan

//-*****************************************************************************
void getABCTimeSpan(IArchive archive, chrono_t& first, chrono_t& last)
{
	// TO DO: Is the childBounds property reliable to get the full archive's span?

	if (!archive.valid())
		return;

	IObject archiveTop = archive.getTop();
    if ( archiveTop.getProperties().getPropertyHeader( ".childBnds" ) != NULL ) { // Try to get timing from childBounds first

        IBox3dProperty childbnds = Alembic::Abc::IBox3dProperty( archive.getTop().getProperties(),
                                   ".childBnds", ErrorHandler::kQuietNoopPolicy); 
    	TimeSamplingPtr ts = childbnds.getTimeSampling();
		first = std::min(first, ts->getSampleTime(0) );
		last = std::max(last, ts->getSampleTime(childbnds.getNumSamples()-1) );
        return;
    }

	unsigned int numChildren = archiveTop.getNumChildren();

	for (unsigned i=0; i<numChildren; ++i)  // Visit every object to get its first and last sample
	{
		IObject obj( archiveTop.getChild( i ));
		getObjectTimeSpan(obj, first, last, true);

	}

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

示例3: getCameraTimeSpan

void getCameraTimeSpan(ICamera iCam, chrono_t& first, chrono_t& last) {

	ICameraSchema cam = iCam.getSchema();
	TimeSamplingPtr ts = cam.getTimeSampling();
	first = std::min(first, ts->getSampleTime(0) );
	last = std::max(last, ts->getSampleTime(cam.getNumSamples()-1) );
}
开发者ID:nrusch,项目名称:ABCNuke,代码行数:7,代码来源:ABCNuke_ArchiveHelper.cpp

示例4: IObjectDrw

//-*****************************************************************************
IPolyMeshDrw::IPolyMeshDrw( IPolyMesh &iPmesh, std::vector<std::string> path )
  : IObjectDrw( iPmesh, false, path )
  , m_polyMesh( iPmesh )
{
    // Get out if problems.
    if ( !m_polyMesh.valid() )
    {
        return;
    }

    if ( m_polyMesh.getSchema().getNumSamples() > 0 )
    {
        m_polyMesh.getSchema().get( m_samp );
    }

    m_boundsProp = m_polyMesh.getSchema().getSelfBoundsProperty();

    // The object has already set up the min time and max time of
    // all the children.
    // if we have a non-constant time sampling, we should get times
    // out of it.
    TimeSamplingPtr iTsmp = m_polyMesh.getSchema().getTimeSampling();
    if ( !m_polyMesh.getSchema().isConstant() )
    {
        size_t numSamps =  m_polyMesh.getSchema().getNumSamples();
        if ( numSamps > 0 )
        {
            chrono_t minTime = iTsmp->getSampleTime( 0 );
            m_minTime = std::min( m_minTime, minTime );
            chrono_t maxTime = iTsmp->getSampleTime( numSamps-1 );
            m_maxTime = std::max( m_maxTime, maxTime );
        }
    }
    m_drwHelper.setName(m_object.getFullName());
}
开发者ID:BlueBolt,项目名称:bb_alembicArchiveNode,代码行数:36,代码来源:IPolyMeshDrw.cpp

示例5: IObjectDrw

//-*****************************************************************************
ISubDDrw::ISubDDrw( ISubD &iPmesh )
  : IObjectDrw( iPmesh, false )
  , m_subD( iPmesh )
{
    // Get out if problems.
    if ( !m_subD.valid() )
    {
        return;
    }


    // The object has already set up the min time and max time of
    // all the children.
    // if we have a non-constant time sampling, we should get times
    // out of it.
    TimeSamplingPtr iTsmp = m_subD.getSchema().getTimeSampling();
    if ( !m_subD.getSchema().isConstant() )
    {
        size_t numSamps =  m_subD.getSchema().getNumSamples();
        if ( numSamps > 0 )
        {
            chrono_t minTime = iTsmp->getSampleTime( 0 );
            m_minTime = std::min( m_minTime, minTime );
            chrono_t maxTime = iTsmp->getSampleTime( numSamps-1 );
            m_maxTime = std::max( m_maxTime, maxTime );
        }
    }
}
开发者ID:oyaGG,项目名称:helgemathee-alembic-softimage,代码行数:29,代码来源:ISubDDrw.cpp

示例6: getPolyMeshTimeSpan

void getPolyMeshTimeSpan(IPolyMesh iPoly, chrono_t& first, chrono_t& last) {

	IPolyMeshSchema mesh = iPoly.getSchema();
	TimeSamplingPtr ts = mesh.getTimeSampling();
	first = std::min(first, ts->getSampleTime(0) );
	last = std::max(last, ts->getSampleTime(mesh.getNumSamples()-1) );
}
开发者ID:nrusch,项目名称:ABCNuke,代码行数:7,代码来源:ABCNuke_ArchiveHelper.cpp

示例7: IObjectDrw

//-*****************************************************************************
INuPatchDrw::INuPatchDrw( INuPatch &iNuPatch )
  : IObjectDrw( iNuPatch, false )
  , m_nuPatch( iNuPatch )
{
    // create our nurb renderer.
    nurb = gluNewNurbsRenderer();

    gluNurbsProperty(nurb, GLU_SAMPLING_TOLERANCE, 25.0);
    gluNurbsProperty(nurb, GLU_DISPLAY_MODE, GLU_FILL);

    // Get out if problems.
    if ( !m_nuPatch.valid() )
    {
        return;
    }


    // The object has already set up the min time and max time of
    // all the children.
    // if we have a non-constant time sampling, we should get times
    // out of it.
    TimeSamplingPtr iTsmp = m_nuPatch.getSchema().getTimeSampling();
    if ( !m_nuPatch.getSchema().isConstant() )
    {
        size_t numSamps = m_nuPatch.getSchema().getNumSamples();
        if ( numSamps > 0 )
        {
            chrono_t minTime = iTsmp->getSampleTime( 0 );
            m_minTime = std::min( m_minTime, minTime );
            chrono_t maxTime = iTsmp->getSampleTime( numSamps-1 );
            m_maxTime = std::max( m_maxTime, maxTime );
        }
    }
}
开发者ID:AWhetter,项目名称:alembic,代码行数:35,代码来源:INuPatchDrw.cpp

示例8: init

/**
 * init
 */
bool UMAbcNurbsPatch::init(bool recursive)
{
	if (!is_valid()) return false;
	
	// // create our nurb renderer.
	// nurb = gluNewNurbsRenderer();

	// gluNurbsProperty(nurb, GLU_SAMPLING_TOLERANCE, 25.0);
	// gluNurbsProperty(nurb, GLU_DISPLAY_MODE, GLU_FILL);

	size_t num_samples = patch_.getSchema().getNumSamples();
	if (num_samples > 0)
	{
		// get constant sample
		patch_.getSchema().get(initial_sample_);
		
		// if not consistant, we get time
		if (!patch_.getSchema().isConstant())
		{
			TimeSamplingPtr time = patch_.getSchema().getTimeSampling();
			min_time_ = static_cast<unsigned long>(time->getSampleTime(0)*1000);
			max_time_ = static_cast<unsigned long>(time->getSampleTime(num_samples-1)*1000);
		}
	}

	return false;
}
开发者ID:uimac,项目名称:burger2,代码行数:30,代码来源:UMAbcNurbsPatch.cpp

示例9: 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

示例10:

void ofxAlembic::IGeom::update_timestamp(T& object)
{
	TimeSamplingPtr iTsmp = object.getSchema().getTimeSampling();
	if (!object.getSchema().isConstant())
	{
		size_t numSamps =  object.getSchema().getNumSamples();
		if (numSamps > 0)
		{
			m_minTime = iTsmp->getSampleTime(0);
			m_maxTime = iTsmp->getSampleTime(numSamps - 1);
		}
	}
}
开发者ID:perfume-dev,项目名称:ofxAlembic,代码行数:13,代码来源:ofxAlembicReader.cpp

示例11: simpleTestIn

//-*****************************************************************************
void simpleTestIn( const std::string &iArchiveName )
{
    IArchive archive( Alembic::AbcCoreHDF5::ReadArchive(),
                      iArchiveName, ErrorHandler::kThrowPolicy );

    IObject archiveTop = archive.getTop();
    IObject c0( archiveTop, "c0" );
    ICompoundProperty c0Props = c0.getProperties();

    TimeSamplingPtr uts = c0Props.getPtr()->
        getScalarProperty( "uniformdoubleprop" )->getTimeSampling();

    TimeSamplingPtr ats = c0Props.getPtr()->
        getScalarProperty( "acyclicdoubleprop" )->getTimeSampling();

    //IDoubleProperty dp0( c0Props, "uniformdoubleprop" );
    //IDoubleProperty dp1( c0Props, "acyclicdoubleprop" );
    //size_t numReadDoubleSamps = dp0.getNumSamples();
    //TESTING_ASSERT( numReadDoubleSamps == g_numDoubleSamps );
    //TESTING_ASSERT( dp1.getNumSamples() == numReadDoubleSamps );


    //scramble_heap();

    //const TimeSamplingType &utst = uts.getTimeSamplingType();
    const TimeSamplingType utst = c0Props.getPtr()->getScalarProperty(
        "uniformdoubleprop" )->getTimeSampling()->getTimeSamplingType();

    for ( size_t j = 0 ; j < g_numDoubleSamps ; j++ )
    {
        chrono_t utime = uts->getSampleTime( j );
        chrono_t atime = ats->getSampleTime( j );

        chrono_t reftime = g_doubleStartTime + ( j * g_dt );

        std::cout << "reference time: " << reftime << std::endl;

        std::cout << "uniform sample time: " << utime << std::endl;

        std::cout << "acyclic sample time: " << atime << std::endl;

        chrono_t ABSERROR = 0.00001;

        TESTING_ASSERT( Imath::equalWithAbsError( utime, reftime, ABSERROR ) );
        TESTING_ASSERT( Imath::equalWithAbsError( atime, reftime, ABSERROR ) );
        TESTING_ASSERT( Imath::equalWithAbsError( atime, utime, ABSERROR ) );
    }
}
开发者ID:oyaGG,项目名称:helgemathee-alembic-softimage,代码行数:49,代码来源:OctessenceBug17.cpp

示例12: m_xform

ofxAlembic::IXform::IXform(Alembic::AbcGeom::IXform object) : ofxAlembic::IGeom(object), m_xform(object)
{
	TimeSamplingPtr iTsmp = m_xform.getSchema().getTimeSampling();
	if (!m_xform.getSchema().isConstant())
	{
		size_t numSamps =  m_xform.getSchema().getNumSamples();
		if (numSamps > 0)
		{
			chrono_t minTime = iTsmp->getSampleTime(0);
			m_minTime = std::min(m_minTime, minTime);
			chrono_t maxTime = iTsmp->getSampleTime(numSamps - 1);
			m_maxTime = std::max(m_maxTime, maxTime);
		}
	}
	
	type = XFORM;
}
开发者ID:KazuyoshiUeno,项目名称:ofxAlembic,代码行数:17,代码来源:ofxAlembicReader.cpp

示例13: m_polyMesh

ofxAlembic::IPolyMesh::IPolyMesh(Alembic::AbcGeom::IPolyMesh object) : ofxAlembic::IGeom(object), m_polyMesh(object)
{
	TimeSamplingPtr iTsmp = m_polyMesh.getSchema().getTimeSampling();
	if (!m_polyMesh.getSchema().isConstant())
	{
		size_t numSamps =  m_polyMesh.getSchema().getNumSamples();
		if (numSamps > 0)
		{
			chrono_t minTime = iTsmp->getSampleTime(0);
			m_minTime = std::min(m_minTime, minTime);
			chrono_t maxTime = iTsmp->getSampleTime(numSamps - 1);
			m_maxTime = std::max(m_maxTime, maxTime);
		}
	}

	type = POLYMESH;
}
开发者ID:KazuyoshiUeno,项目名称:ofxAlembic,代码行数:17,代码来源:ofxAlembicReader.cpp

示例14: m_curves

ofxAlembic::ICurves::ICurves(Alembic::AbcGeom::ICurves object) : ofxAlembic::IGeom(object), m_curves(object)
{

	TimeSamplingPtr iTsmp = m_curves.getSchema().getTimeSampling();
	if (!object.getSchema().isConstant())
	{
		size_t numSamps = object.getSchema().getNumSamples();
		if (numSamps > 0)
		{
			chrono_t minTime = iTsmp->getSampleTime(0);
			m_minTime = std::min(m_minTime, minTime);
			chrono_t maxTime = iTsmp->getSampleTime(numSamps - 1);
			m_maxTime = std::max(m_maxTime, maxTime);
		}
	}

	type = CURVES;
}
开发者ID:KazuyoshiUeno,项目名称:ofxAlembic,代码行数:18,代码来源:ofxAlembicReader.cpp

示例15: IObjectDrw

//-*****************************************************************************
IPointsDrw::IPointsDrw( IPoints &iPmesh )
    : IObjectDrw( iPmesh, false )
    , m_points( iPmesh )
{
    // Get out if problems.
    if ( !m_points.valid() )
    {
        return;
    }

    // Try to create colors, if possible.
    IPointsSchema &pointsSchema = m_points.getSchema();
    const PropertyHeader *phead = pointsSchema.getPropertyHeader( "Cs" );
    if ( phead && IC3fArrayProperty::matches( *phead ) )
    {
        m_colorProp = IC3fArrayProperty( pointsSchema, "Cs" );
    }

    phead = pointsSchema.getPropertyHeader( "N" );
    if ( phead && IN3fArrayProperty::matches( *phead ) )
    {
        m_normalProp = IN3fArrayProperty( pointsSchema, "N" );
    }

    // The object has already set up the min time and max time of
    // all the children.
    // if we have a non-constant time sampling, we should get times
    // out of it.
    TimeSamplingPtr iTsmp = m_points.getSchema().getTimeSampling();
    if ( !m_points.getSchema().isConstant() )
    {
        size_t numSamps =  m_points.getSchema().getNumSamples();
        if ( numSamps > 0 )
        {
            chrono_t minTime = iTsmp->getSampleTime( 0 );
            m_minTime = std::min( m_minTime, minTime );
            chrono_t maxTime = iTsmp->getSampleTime( numSamps-1 );
            m_maxTime = std::max( m_maxTime, maxTime );
        }
    }
}
开发者ID:AWhetter,项目名称:alembic,代码行数:42,代码来源:IPointsDrw.cpp


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