[OpendTect_Developers] About horizon pre-load

Nageswara Rao nageswara.rao at dgbes.com
Fri Apr 1 14:28:03 CEST 2011


Hi all,

    In OpendTect there is an option 'Surveys->Pre-load->Horizons'. By
selecting this
 option user can pre-load some horizons and save them in a file. It is
very useful
 option as it saves time, for example it takes a lot of time to load a
big horizon but
 if it is saved beforehand in the pre load horizon then that will take
less amount of
 time to display the horizon. If the pre-loaded horizon is not needed by
the user
 then it can simply be unloaded.

 Global function EM::HorizonPreLoader using which horizons can be preloaded.

Global function EM::HorizonPreLoader::HPreL() is implemented like,

EM::HorizonPreLoader& HPreL()
{
    static PtrMan<HorizonPreLoader> hpl = 0;
    if ( !hpl )
        hpl = new HorizonPreLoader;


    return *hpl;
}

Because it is global function we can call this function directly like,
  'EM::HorizonPreLoadr& hpl = EM::HPreL();'

To pre-load horizons by providing MultiIDs like,
EM::HorizonPreLoader::load( const TypeSet<MultiID>& newmids, TaskRunner* tr)
{
<code>
    EM::ObjectedID emid = EM::EMM().getObjectID( newmids[idx] );
    EM::EMObject* emobj = EM::EMM().getObject( emid );
    if ( !emobj || emobj->isFullyLoaded() )
        continue;
<code>
    for ( int idx=0; idx<emobects.size(); idx++ )
    {
        emobjects[idx]->ref();     
    }
<code>
}

To unload horizon we can do simply unRef() the horizon by passing
selected horizon names to 'unload(const BufferStringSet&)' function.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opendtect.org/pipermail/developers/attachments/20110401/d48c009d/attachment.html>


More information about the Developers mailing list