[Developers] Creating an horizon from scratch

Fernando J. Zunino fernando at zauber.com.ar
Tue Nov 27 19:45:36 CET 2007


Hi,
I'm writing a plugin that at certain point needs to create an horizon.

So far I've managed to create a new horizon doing the following steps:
  1. Load an existing horizon (h1)
  2. Modify the loaded horizon (h1) using code like:
        Coord3 pos = h1_->getPos(posid_);
        pos.z = 1.0;
        h1_->setPos(posid_, pos, false);
  3. Save h1's geometry into another horizon (h2) selected by the user via
an horizon selection control:
        CtxtIOObj&  outctio_ = *mMkCtxtIOObj(EMHorizon);
         ...
        new uiIOObjSel( this, outctio_, "Output Horizon" );
         ...
         exec = h1_->geometry().saver( 0, &outctio_.ioobj->key() );
         uiExecutor dlg2( this, *exec );
         dlg2.go();

This approach works but it isn't what I want. I want to create an horizon
from scratch, without specifying an existing horizon.
I've tried creating a new Horizon2D instance but it didn't work as I
expected:
   EM::EMManager& em = EM::EMM();
   EM::EMObject* emobj = EM::Horizon2D::create(em);
   mDynamicCastGet(EM::Horizon*,h1,emobj)

I'm probably not getting which is the proper way to do this.

Any suggestions?

Fernando
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opendtect.org/pipermail/developers/attachments/20071127/5b94e59a/attachment.html>


More information about the Developers mailing list