/*  Functions extracted out of readFromFile to enhance readability.  */
bool VertexBufferRoot::_constructFromPly( const std::string& filename )
{
    PLYLIBINFO << "Reading PLY file." << std::endl;
    boost::progress_display progress( 12 );

    VertexData data;
    if( _invertFaces )
        data.useInvertedFaces();
    if( !data.readPlyFile( filename ) )
    {
        PLYLIBERROR << "Unable to load PLY file." << std::endl;
        return false;
    }
    ++progress;

    data.calculateNormals();
    data.scale( 2.0f );
    ++progress;

    setupTree( data, progress );
    ++progress;
    if( !writeToFile( filename ))
        PLYLIBWARN << "Unable to write binary representation." << std::endl;

    ++progress;
    return true;
}
Example #2
0
/*  Functions extracted out of readFromFile to enhance readability.  */
bool VertexBufferRoot::_constructFromPly( const std::string& filename )
{
    MESHINFO << "Constructing new from PLY file." << std::endl;
    
    VertexData data;
    if( _invertFaces )
        data.useInvertedFaces();
    if( !data.readPlyFile( filename ) )
    {
        MESHERROR << "Unable to load PLY file." << std::endl;
        return false;
    }

    data.calculateNormals();
    data.scale( 2.0f );
    setupTree( data );
    if( !writeToFile( filename ))
        MESHWARN << "Unable to write binary representation." << std::endl;
    
    return true;
}