Esempio n. 1
0
//-*****************************************************************************
void OFaceSetSchema::setFaceExclusivity( FaceSetExclusivity iFacesExclusive )
{
    if (m_facesExclusive != iFacesExclusive)
    {
        // The user has changed the exclusivity hint.
        m_facesExclusive = iFacesExclusive;
        _recordExclusivityHint();
    }
}
Esempio n. 2
0
//-*****************************************************************************
void OFaceSetSchema::set( const Sample &iSamp )
{
    ALEMBIC_ABC_SAFE_CALL_BEGIN( "OFaceSetSchema::set()" );

    // We could add sample integrity checking here.
    if ( m_facesProperty.getNumSamples () == 0 )
    {
        // First sample must provide faces
        ABCA_ASSERT( iSamp.getFaces() ,
                     "Sample 0 must provide the faces that make up the faceset." );
        m_facesProperty.set( iSamp.getFaces() );
    }
    else
    {
        SetPropUsePrevIfNull( m_facesProperty, iSamp.getFaces() );
    }

    // We've now set the sample for the m_faces property.
    if ( iSamp.getSelfBounds().hasVolume() )
    {
        // Caller explicity set bounds for this sample of the faceset.
        m_selfBoundsProperty.set( iSamp.getSelfBounds() );
    }
    else
    {
        m_selfBoundsProperty.set( iSamp.getSelfBounds() );
        // NYI compute self bounds via parent mesh's faces
    }

    if (m_facesExclusive != kFaceSetNonExclusive)
    {
        // The user has changed the exclusivity hint from the
        // default so we'll create a property now and store.
        _recordExclusivityHint();
    }
    ALEMBIC_ABC_SAFE_CALL_END();
}
Esempio n. 3
0
//-*****************************************************************************
void OFaceSetSchema::set( const Sample &iSamp )
{
    ALEMBIC_ABC_SAFE_CALL_BEGIN( "OFaceSetSchema::set()" );

    Abc::Box3d emptyBox;
    emptyBox.makeEmpty();
    // do we need to create child bounds?
    if ( iSamp.getChildBounds().hasVolume() && !m_childBoundsProperty)
    {
        m_childBoundsProperty = Abc::OBox3dProperty( this->getPtr(), 
            ".childBnds", m_facesProperty.getTimeSampling() );

        // -1 because we just dis an m_positions set above
        size_t numSamples = m_facesProperty.getNumSamples() - 1;

        // set all the missing samples
        for ( size_t i = 0; i < numSamples; ++i )
        {
            m_childBoundsProperty.set( emptyBox );
        }
    }

    // We could add sample integrity checking here.
    if ( m_facesProperty.getNumSamples () == 0 )
    {
        // First sample must provide faces
        ABCA_ASSERT( iSamp.getFaces() ,
                     "Sample 0 must provide the faces that make up the faceset." );
        m_facesProperty.set( iSamp.getFaces() );

        if (m_childBoundsProperty)
        { 
            m_childBoundsProperty.set( iSamp.getChildBounds() ); 
        }
    }
    else
    {
        SetPropUsePrevIfNull( m_facesProperty, iSamp.getFaces() );

        if ( m_childBoundsProperty )
        {
            SetPropUsePrevIfNull( m_childBoundsProperty, 
                iSamp.getChildBounds() );
        }
    }

    // We've now set the sample for the m_faces property.
    if ( iSamp.getSelfBounds().hasVolume() )
    {
        // Caller explicity set bounds for this sample of the faceset.
        m_selfBoundsProperty.set( iSamp.getSelfBounds() );
    }
    else
    {
        m_selfBoundsProperty.set( iSamp.getSelfBounds() );
        // NYI compute self bounds via parent mesh's faces
    }

    if (m_facesExclusive != kFaceSetNonExclusive)
    {
        // The user has changed the exclusivity hint from the
        // default so we'll create a property now and store.
        _recordExclusivityHint();
    }
    ALEMBIC_ABC_SAFE_CALL_END();
}